Commit d7aa931c authored by XieZhiXiong's avatar XieZhiXiong

对接供应会员评价管理中..

parent 17df40b6
......@@ -11,6 +11,7 @@ const SmilingFace: React.FC<SmilingFaceProps> = ({
let node = null;
switch (value) {
case 0:
case 1:
case 2: {
node = (
......
......@@ -68,7 +68,6 @@ registerVirtualBox('controller-group', (_props) => {
// 左右两列布局
registerVirtualBox('LeftRightLayout', (_props) => {
console.log('_props', _props)
const { children, props } = _props;
const leftItems = children.filter(
child => child.props.schema['x-component-props'] && child.props.schema['x-component-props'].position === 'left'
......
import React from 'react';
import React, { useState } from 'react';
import { Tabs, Row, Col, Button } from 'antd';
import { createFormActions } from '@formily/antd';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { PublicApi } from '@/services/api';
import MellowCard from '@/components/MellowCard';
import PolymericTable from '@/components/PolymericTable';
import { EditableColumns } from '@/components/PolymericTable/interface';
import { Pie } from '@/components/Charts';
import Mood from '@/components/Mood';
import NiceForm from '@/components/NiceForm';
import { searchSchema } from './schema';
import Shelves from '../components/Shelves';
import RecordList from '../components/RecordList';
import styles from './index.less';
const { TabPane } = Tabs;
const receivedFormActions = createFormActions();
const sentFormActions = createFormActions();
const PAGE_SIZE = 10;
interface ReceivedSearch {
/**
* 评价星级(1-5)
*/
star: string
/**
* 交易时间开始
*/
dealTimeStart: string
/**
* 交易时间结束
*/
dealTimeEnd: string
/**
* 评价方名称
*/
memberName: string
};
const Analysis: React.FC = () => {
const [historyPage, setHistoryPage] = useState(1);
const [historySize, setHistorySize] = useState(PAGE_SIZE);
const [receivedPage, setReceivedPage] = useState(1);
const [receivedSize, setReceivedSize] = useState(PAGE_SIZE);
const [receivedSearchVal, setReceivedSearchVal] = useState<ReceivedSearch>({
star: '0',
dealTimeStart: '',
dealTimeEnd: '',
memberName: '',
});
const [receivedList, setReceivedList] = useState([]);
// 获取评价汇总
const getTradeSummary = () => {
PublicApi.getMemberCommentSupplyCountSupplyTradeSummary().then(res => {
if (res.code === 1000) {
}
});
};
// 获取评价记录
const getTradeHistory = () => {
PublicApi.getMemberCommentSupplyCountSupplyTradeHistoryPage({
memberId: '0',
validateId: '0',
starLevel: null,
current: `${historyPage}`,
pageSize: `${historySize}`,
}).then(res => {
if (res.code === 1000) {
}
});
};
// 获取收到的评价列表
const getReceivedList = () => {
PublicApi.getMemberCommentSupplySupplyTradeHistoryPage({
...receivedSearchVal,
current: `${receivedPage}`,
pageSize: `${receivedSize}`,
}).then(res => {
});
};
const evaluateColumns: EditableColumns[] = [
{
title: ' ',
......@@ -89,6 +152,29 @@ const Analysis: React.FC = () => {
},
];
const handleTabsChange = key => {
console.log('key', key)
switch (key) {
case '1': {
break;
}
case '2': {
break;
}
case '3': {
break;
}
default:
break;
}
};
return (
<PageHeaderWrapper>
<MellowCard
......@@ -96,7 +182,10 @@ const Analysis: React.FC = () => {
padding: '0 24px 24px',
}}
>
<Tabs className={styles.tabs}>
<Tabs
className={styles.tabs}
onChange={handleTabsChange}
>
<TabPane tab="概览" key="1">
<Shelves title="评价统计">
<Row gutter={24}>
......@@ -128,39 +217,14 @@ const Analysis: React.FC = () => {
<Shelves title="评价记录">
<RecordList list={[]} />
<div
style={{
padding: '24px 0',
textAlign: 'center',
}}
>
<Button>查看更多评论</Button>
</div>
</Shelves>
</TabPane>
<TabPane tab="收到的评价" key="2">
<NiceForm
actions={receivedFormActions}
onSubmit={values => {}}
effects={($, actions) => {
}}
schema={searchSchema}
/>
<TabPane tab="收到的评价" key="2">
<RecordList list={[]} />
</TabPane>
<TabPane tab="发出的评价" key="3">
<NiceForm
actions={sentFormActions}
onSubmit={values => {}}
effects={($, actions) => {
}}
schema={searchSchema}
/>
<TabPane tab="发出的评价" key="3">
<RecordList list={[]} />
</TabPane>
</Tabs>
......
......@@ -141,9 +141,9 @@ const EvaluationList = props => {
<img src={item.good ? item.good.pic : ''} />
</div>
<div className="goodInfo-right">
<div className="goodInfo-title">进口头层黄牛皮荔枝纹/红色/XL</div>
<div className="goodInfo-desc">20 平方英尺</div>
<div className="goodInfo-price">¥ 400.00</div>
<div className="goodInfo-title">{item.good.productName}</div>
<div className="goodInfo-desc">{item.good.purchaseCount || ''}</div>
<div className="goodInfo-price">{`¥ ${item.good.price}`}</div>
</div>
</div>
</Col>
......
import React from 'react';
import { Button, Rate } from 'antd';
import React, { useState, useEffect } from 'react';
import { Button, Rate, Spin } from 'antd';
import { createFormActions } from '@formily/antd';
import NiceForm from '@/components/NiceForm';
import { searchSchema } from './schema';
import styles from './index.less';
const formActions = createFormActions();
const PAGE_SIZE = 10;
export interface Search {
/**
* 评价星级(1-5)
*/
star: string
/**
* 交易时间开始
*/
dealTimeStart: string
/**
* 交易时间结束
*/
dealTimeEnd: string
/**
* 评价方名称
*/
memberName: string
};
export interface ListParams extends Search {
/**
* 当前页
*/
current: string
/**
* 每页行数
*/
pageSize: string
};
export interface RecordItem {
/**
* 记录id
*/
id: number
/**
* 评价星级(1-5)
*/
star: number
/**
* 评价内容
*/
comment: string
/**
* 商品信息
*/
product: string
/**
* 备注(订单号)
*/
remark: string
/**
* 交易时间
*/
dealTime: {}
/**
* 评价方
*/
memberName: string
};
export interface RecordRes {
data: RecordItem[];
totalCount: number;
};
interface RecordListProps {
list: [];
fetchList: (params: ListParams) => Promise<RecordRes>;
};
const RecordList: React.FC<RecordListProps> = () => {
const RecordList: React.FC<RecordListProps> = ({
fetchList,
}) => {
const [hasMore, setHasMore] = useState(false);
const [page, setPage] = useState(1);
const [size, setSize] = useState(PAGE_SIZE);
const [searchVal, setSearchVal] = useState<Search>({
star: '0',
dealTimeStart: '',
dealTimeEnd: '',
memberName: '',
});
const [receivedList, setReceivedList] = useState<RecordRes>({ data: [], totalCount: 0 });
const [loading, setLoading] = useState(false);
// 获取列表数据
const getRecordList = (): Promise<RecordRes> => {
if (!fetchList) {
return Promise.reject();
}
setLoading(true);
return new Promise((resolve, reject) => {
fetchList({
...searchVal,
current: `${page}`,
pageSize: `${size}`,
}).then(res => {
resolve(res);
}).catch(err => {
reject(err);
}).finally(() => {
setLoading(false);
});
});
};
useEffect(() => {
getRecordList().then(res => {
setReceivedList(res);
});
}, []);
// 查询列表
const handleSearch = values => {
setPage(1);
setSearchVal(values);
getRecordList().then(res => {
setReceivedList(res);
});
};
// 加载更多
const handleLoadMore = () => {
if (!hasMore || loading) {
return;
}
setSize(size + 1);
getRecordList().then(res => {
setReceivedList({
...receivedList,
data: receivedList.data.concat(res.data),
});
});
};
return (
<ul className={styles.record}>
<li className={styles['record-item']}>
<div className={styles['record-item-good']}>
<div className={styles['record-item-good-name']}>
进口头层黄牛皮荔枝纹/红色/XL
</div>
<div>
<span className={styles['record-item-good-price']}>¥400.00</span>
<span className={styles['record-item-good-desc']}>20 平方英尺</span>
<>
<NiceForm
actions={formActions}
onSubmit={handleSearch}
effects={($, actions) => {
}}
schema={searchSchema}
/>
<ul className={styles.record}>
<li className={styles['record-item']}>
<div className={styles['record-item-good']}>
<div className={styles['record-item-good-name']}>
进口头层黄牛皮荔枝纹/红色/XL
</div>
<div>
<span className={styles['record-item-good-price']}>¥400.00</span>
<span className={styles['record-item-good-desc']}>20 平方英尺</span>
</div>
</div>
</div>
<div className={styles['record-item-extra']}>
<div className={styles['record-item-extra-item']}>
<div className={styles['record-item-extra-item-label']}>
交易时间:
</div>
<div className={styles['record-item-extra-item-control']}>
2020-05-20 17:09
</div>
<div className={styles['record-item-extra']}>
<div className={styles['record-item-extra-item']}>
<div className={styles['record-item-extra-item-label']}>
交易时间:
</div>
<div className={styles['record-item-extra-item-control']}>
2020-05-20 17:09
</div>
</div>
<div className={styles['record-item-extra-item']}>
<div className={styles['record-item-extra-item-label']}>
评价方:
</div>
<div className={styles['record-item-extra-item-control']}>
温州龙昌手袋有限公司
</div>
</div>
</div>
<div className={styles['record-item-extra-item']}>
<div className={styles['record-item-extra-item-label']}>
评价方:
</div>
<div className={styles['record-item-extra-item-control']}>
温州龙昌手袋有限公司
</div>
<div className={styles['record-item-comment']}>
<Rate value={2} disabled />
<div className={styles['record-item-comment-main']}>
付款准时,合作愉快。付款准时,合作愉快。付款准时,合作愉快。付款准时,合作愉快。付款准时…
</div>
</div>
</div>
<div className={styles['record-item-comment']}>
<Rate value={2} disabled />
<div className={styles['record-item-comment-main']}>
付款准时,合作愉快。付款准时,合作愉快。付款准时,合作愉快。付款准时,合作愉快。付款准时…
<div className={styles['record-item-actions']}>
<Button type="link">查看</Button>
</div>
</li>
</ul>
{(hasMore && !loading) && (
<div
style={{
padding: '24px 0',
textAlign: 'center',
}}
>
<Button onClick={handleLoadMore}>查看更多评论</Button>
</div>
<div className={styles['record-item-actions']}>
<Button type="link">查看</Button>
)}
{loading && (
<div
style={{
padding: '24px 0',
textAlign: 'center',
}}
>
<Spin />
</div>
</li>
</ul>
)}
</>
);
};
......
/*
* @Author: XieZhiXiong
* @Date: 2020-09-22 20:34:49
* @Date: 2020-10-19 18:08:51
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-09-22 20:52:53
* @LastEditTime: 2020-10-19 18:09:31
* @Description:
*/
import { ISchema } from '@formily/antd';
......@@ -28,7 +28,7 @@ export const searchSchema: ISchema = {
},
},
},
'[startDate, endDate]': {
'[dealTimeStart, dealTimeEnd]': {
type: 'string',
default: '',
'x-component': 'dateSelect',
......@@ -40,7 +40,7 @@ export const searchSchema: ISchema = {
},
},
},
name: {
memberName: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
......
import {
PurchaseOrderOutWorkState,
SaleOrderInsideWorkState,
} from '@/constants';
// 订单外部状态 StatusTag map
export const ORDER_INNER_STATUS_TYPE = {
[PurchaseOrderOutWorkState.FINISH_ORDER]: 'success',
};
// 订单内部状态 Tag badge map
export const ORDER_INNER_STATUS_BADGE_COLOR = {
[SaleOrderInsideWorkState.FILLING_ORDER]: '#00B37A',
};
// 订单内部状态 text
export const ORDER_INNER_STATUS_TXT_FINISHING = {
[SaleOrderInsideWorkState.FILLING_ORDER]: '已完成',
};
\ No newline at end of file
import React from 'react';
import React, { useState, useEffect } from 'react';
import {
PageHeader,
Descriptions,
......@@ -11,9 +11,13 @@ import { FormOutlined } from '@ant-design/icons';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { history } from 'umi';
import { createFormActions, FormEffectHooks, FormPath } from '@formily/antd';
import { usePageStatus } from '@/hooks/usePageStatus';
import { PublicApi } from '@/services/api';
import { GetOrderPurchaseOrderDetailsResponse } from '@/services/OrderApi';
import { normalizeFiledata } from '@/utils';
import AvatarWrap from '@/components/AvatarWrap';
import NiceForm from '@/components/NiceForm';
import { normalizeUnevaluatedList } from '../../utils';
import { evaluateSchema } from './schema';
import { createEffects } from './effects';
import EvaluationList from '../../components/EvaluationList';
......@@ -21,10 +25,88 @@ import styles from './index.less';
const formActions = createFormActions();
interface Unevaluated {
good: {
pic: string,
name: string,
price: string,
desc: string,
};
star: number;
comment: string;
picture: string[];
smile: number;
};
interface OrderInfo extends GetOrderPurchaseOrderDetailsResponse {
unevaluatedList: Unevaluated[];
};
const EvaluateOrder: React.FC = () => {
const { id } = usePageStatus();
const [orderInfo, setOrderInfo] = useState<OrderInfo>(null);
const [infoLoading, setInfoLoading] = useState(false);
const [submitLoading, setSubmitLoading] = useState(false);
const getOrderInfo = () => {
setInfoLoading(true);
PublicApi.getOrderPurchaseOrderDetails({
id,
}).then(res => {
if (res.code === 1000) {
const { orderProductRequests } = res.data;
setOrderInfo({
...res.data,
unevaluatedList: normalizeUnevaluatedList(orderProductRequests),
});
}
}).finally(() => {
setInfoLoading(false);
});
};
useEffect(() => {
getOrderInfo();
}, []);
const handleSubmit = values => {
console.log('values', values);
setSubmitLoading(true);
const payload = values.map(item => {
const {
comment,
good,
picture,
star,
} = item;
return {
memberId: orderInfo.supplyMembersId,
roleId: '暂无',
memberName: orderInfo.supplyMembersName,
star,
comment,
product: JSON.stringify(good),
remark: orderInfo.orderNo,
orderId: orderInfo.id,
dealTime: orderInfo.createTime,
dealCount: good.purchaseCount,
price: good.price,
totalPrice: orderInfo.sumPrice,
pics: picture.map(item => item.status === 'done' && item.data).filter(Boolean),
};
});
PublicApi.postMemberCommentSupplyOrderTradeSubmit({
commentSubmitDetailList: payload,
}).then(res => {
if (res.code === 1000) {
setTimeout(() => {
history.goBack();
}, 800);
}
}).finally(() => {
setSubmitLoading(false);
});
};
const beforeUpload = file => {
......@@ -50,62 +132,69 @@ const EvaluateOrder: React.FC = () => {
);
return (
<PageHeaderWrapper
title={
<>
<PageHeader
style={{ padding: '0' }}
onBack={() => history.goBack()}
title={
<AvatarWrap
info={{
aloneTxt: '单',
name: '订单号:DPTY12'
}}
/>
}
extra={(
<>
<Button
type="primary"
icon={<FormOutlined />}
onClick={() => formActions.submit()}
>
发布
</Button>
</>
)}
>
<Descriptions
size="small"
column={3}
style={{
padding: '0 32px',
}}
<Spin spinning={infoLoading}>
<PageHeaderWrapper
title={
<>
<PageHeader
style={{ padding: '0' }}
onBack={() => history.goBack()}
title={
<AvatarWrap
info={{
aloneTxt: '单',
name: orderInfo?.orderNo,
}}
/>
}
extra={(
<>
<Button
type="primary"
icon={<FormOutlined />}
disabled={!orderInfo || !orderInfo.id}
loading={submitLoading}
onClick={() => formActions.submit()}
>
发布
</Button>
</>
)}
>
<Descriptions.Item label="采购会员">BPTY12</Descriptions.Item>
<Descriptions.Item label="下单时间" span={2}>2020-08-25 08:49</Descriptions.Item>
</Descriptions>
</PageHeader>
</>
}
>
<NiceForm
actions={formActions}
expressionScope={{
UploadTip,
beforeUpload,
}}
onSubmit={handleSubmit}
components={{
EvaluationList,
}}
effects={($, actions) => {
createEffects($, actions);
}}
schema={evaluateSchema}
/>
</PageHeaderWrapper>
<Descriptions
size="small"
column={3}
style={{
padding: '0 32px',
}}
>
<Descriptions.Item label="采购会员">{'暂无'}</Descriptions.Item>
<Descriptions.Item label="下单时间" span={2}>{orderInfo?.createTime}</Descriptions.Item>
</Descriptions>
</PageHeader>
</>
}
>
<NiceForm
actions={formActions}
initialValues={{
comments: orderInfo ? orderInfo.unevaluatedList : [],
}}
expressionScope={{
UploadTip,
beforeUpload,
}}
onSubmit={handleSubmit}
components={{
EvaluationList,
}}
effects={($, actions) => {
createEffects($, actions);
}}
schema={evaluateSchema}
/>
</PageHeaderWrapper>
</Spin>
);
};
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-09-23 17:00:24
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-09-29 16:40:00
* @LastEditTime: 2020-10-19 16:23:24
* @Description:
*/
import { ISchema } from '@formily/antd';
......@@ -14,14 +14,7 @@ export const evaluateSchema: ISchema = {
comments: {
type: 'array',
'x-component': 'EvaluationList',
default: [
{
name: '杰尼',
age: 24,
small: 1,
star2: 0,
},
],
default: [],
items: {
type: 'object',
properties: {
......@@ -50,28 +43,32 @@ export const evaluateSchema: ISchema = {
'x-component': 'Rating',
'x-component-props': {
allowHalf: false,
},
},
'x-rules': [
{
required: true,
message: '请选择满意程度',
},
],
},
comment: {
type: 'string',
title: '评价',
required: true,
'x-component': 'TextArea',
'x-component-props': {
rows: 4,
},
},
},
picture: {
type: 'string',
title: '图片',
required: true,
'x-component': 'Upload',
'x-component-props': {
listType: 'card',
action: '/api/file/file/upload/prefix',
data: {
fileType: UPLOAD_TYPE,
prefix: '/test/',
prefix: '/supplierEvaluation/',
},
beforeUpload: '{{beforeUpload}}',
accept: '.png, .jpg, .jpeg',
......
import React, { useState, useRef } from 'react';
import { Card, Badge, Button } from 'antd';
import { Link } from 'umi';
import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { createFormActions } from '@formily/antd';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { useAsyncInitSelect } from '@/formSchema/effects/useAsyncInitSelect';
import { Link } from 'umi';
import { ORDER_TYPE2, SaleOrderInsideWorkStateTexts, PayOutWorkStateTexts } from '@/constants';
import {
ORDER_INNER_STATUS_TYPE,
ORDER_INNER_STATUS_BADGE_COLOR,
ORDER_INNER_STATUS_TXT_FINISHING,
} from '../constans';
import { PublicApi } from '@/services/api';
import EyePreview from '@/components/EyePreview';
import NiceForm from '@/components/NiceForm';
import StatusTag from '@/components/StatusTag';
......@@ -16,29 +22,6 @@ import styles from './index.less';
const formActions = createFormActions();
const mock = [
{
orderNo: 'DPTY12',
abstract: '进口头层黄牛皮荔枝纹',
member: '广州白马皮具交易有限公司',
created: '2020-09-22 11:16:00',
amount: '¥ 50,000.00',
orderType: '现货采购',
outerStatusName: '已完成',
innerStatusName: '已完成',
},
{
orderNo: 'DPTY13',
abstract: '进口头层黄牛皮荔枝纹',
member: '广州白马皮具交易有限公司',
created: '2020-09-22 11:16:00',
amount: '¥ 50,000.00',
orderType: '现货采购',
outerStatusName: '已完成',
innerStatusName: '已完成',
},
];
const Unevaluated: React.FC = () => {
const ref = useRef<any>({});
......@@ -58,48 +41,50 @@ const Unevaluated: React.FC = () => {
},
{
title: '订单摘要',
dataIndex: 'abstract',
align: 'center',
dataIndex: 'orderThe',
align: 'center',
ellipsis: true,
},
{
title: '采购会员',
dataIndex: 'member',
dataIndex: 'memberName',
align: 'center',
render: (text, record) => <>{text}</>,
},
{
title: '下单时间',
dataIndex: 'created',
dataIndex: 'createTime',
align: 'center',
render: (text, record) => <>{text}</>,
},
{
title: '订单总额',
dataIndex: 'amount',
dataIndex: 'sumPrice',
align: 'center',
},
{
title: '订单类型',
dataIndex: 'orderType',
align: 'center',
dataIndex: 'type',
align: 'center',
render: text => ORDER_TYPE2[text],
},
{
title: '外部状态',
dataIndex: 'outerStatusName',
dataIndex: 'externalState',
align: 'center',
filters: [],
onFilter: (value, record) => record.outerStatus === value,
render: (text, record) => (
<StatusTag type="warnning" title="已完成" />
<StatusTag type="success" title="已完成" />
),
},
{
title: '内部状态',
dataIndex: 'innerStatusName',
dataIndex: 'purchaseOrderInteriorState',
align: 'center',
filters: [],
onFilter: (value, record) => record.innerStatus === value,
render: (text, record) => <Badge color="#606266" text="已完成" />,
render: (text, record) => <Badge color="#41CC9E" text="已完成" />,
},
{
title: '操作',
......@@ -107,7 +92,7 @@ const Unevaluated: React.FC = () => {
align: 'center',
render: (text, record) => (
<>
<Link to={`/memberCenter/tranactionAbility/supplierEvaluation/unevaluated/evaluate`}>
<Link to={`/memberCenter/tranactionAbility/supplierEvaluation/unevaluated/evaluate?id=${record.id}`}>
<Button
type="link"
>
......@@ -122,17 +107,20 @@ const Unevaluated: React.FC = () => {
const [columns, setColumns] = useState<any[]>(defaultColumns);
const fetchListData = (params: any) => {
return Promise.resolve({
total: 2,
data: mock,
return new Promise((resolve, reject) => {
PublicApi.getOrderEvaluatedList(params)
.then(res => {
if (res.code === 1000) {
resolve(res.data);
}
reject();
})
.catch(() => {
reject();
});
});
};
// 初始化高级筛选选项
const fetchSelectOptions = async () => {
return {};
};
return (
<PageHeaderWrapper>
<Card>
......@@ -154,10 +142,6 @@ const Unevaluated: React.FC = () => {
'name',
FORM_FILTER_PATH,
);
useAsyncInitSelect(
['innerStatus', 'outerStatus'],
fetchSelectOptions,
);
}}
schema={listSearchSchema}
/>
......
import { ISchema } from '@formily/antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { UPLOAD_TYPE } from '@/constants';
import {
ORDER_TYPE2_INQUIRY,
ORDER_TYPE2_DEMAND,
ORDER_TYPE2_SPOT,
ORDER_TYPE2_CENTRALIZED,
ORDER_TYPE2_POINTS,
ORDER_TYPE2_CHANNEL_DIRECT,
ORDER_TYPE2_CHANNEL_SPOT,
ORDER_TYPE2_CHANNEL_POINTS,
ORDER_TYPE2,
} from '@/constants';
export const listSearchSchema: ISchema = {
type: 'object',
......@@ -28,7 +38,7 @@ export const listSearchSchema: ISchema = {
columns: 6,
},
properties: {
memberTypeId: {
supplyMembersName: {
type: 'string',
default: undefined,
'x-component-props': {
......@@ -48,30 +58,45 @@ export const listSearchSchema: ISchema = {
orderType: {
type: 'string',
default: undefined,
enum: [],
enum: [
{
label: ORDER_TYPE2[ORDER_TYPE2_INQUIRY],
value: ORDER_TYPE2_INQUIRY,
},
{
label: ORDER_TYPE2[ORDER_TYPE2_DEMAND],
value: ORDER_TYPE2_DEMAND,
},
{
label: ORDER_TYPE2[ORDER_TYPE2_SPOT],
value: ORDER_TYPE2_SPOT,
},
{
label: ORDER_TYPE2[ORDER_TYPE2_CENTRALIZED],
value: ORDER_TYPE2_CENTRALIZED,
},
{
label: ORDER_TYPE2[ORDER_TYPE2_POINTS],
value: ORDER_TYPE2_POINTS,
},
{
label: ORDER_TYPE2[ORDER_TYPE2_CHANNEL_DIRECT],
value: ORDER_TYPE2_CHANNEL_DIRECT,
},
{
label: ORDER_TYPE2[ORDER_TYPE2_CHANNEL_SPOT],
value: ORDER_TYPE2_CHANNEL_SPOT,
},
{
label: ORDER_TYPE2[ORDER_TYPE2_CHANNEL_POINTS],
value: ORDER_TYPE2_CHANNEL_POINTS,
},
],
'x-component-props': {
placeholder: '订单类型',
allowClear: true,
},
},
outerStatus: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '外部状态(全部)',
allowClear: true,
},
},
innerStatus: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '内部状态(全部)',
allowClear: true,
},
},
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
......
/*
* @Author: XieZhiXiong
* @Date: 2020-10-19 16:02:53
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-10-19 17:10:42
* @Description:
*/
// 初始化待评价列表
export const normalizeUnevaluatedList = (arr: {[key: string]: any}[]) => {
const ret = [];
if (!Array.isArray(arr)) {
return ret;
}
arr.forEach(item => {
const atom = {
good: {
pic: '',
quantity: item.productAttributeJson || '',
productId: item.productId,
orderId: item.orderId,
productName: item.productName,
category: item.category,
brand: item.brand,
unit: item.unit,
price: item.price,
memberPrice: item.memberPrice,
purchaseCount: item.purchaseCount, // 采购数量
taxInclusive: item.taxInclusive,
money: item.money,
inventory: item.inventory,
productAttributeJson: item.productAttributeJson,
},
star: 0, // 评分星星
comment: '', // 评价
picture: [],
smile: 1, // 笑脸
};
ret.push(atom);
});
return ret;
};
\ No newline at end of file
......@@ -444,6 +444,22 @@ export const normalizeFiledata = url => {
};
};
/**
* 检查是否还有更多
* @param {Number} curPage 当前页码
* @param {Number} curSize 当前页数
* @param {Number} dataLen 当前数据长度
* @param {Number} dataTotal 数据总长度
*/
export const checkMore = (curPage, curSize, dataLen, dataTotal) => {
let hasMore = true;
if (!dataLen || dataLen + (curPage - 1) * curSize >= +dataTotal) {
hasMore = false;
}
return hasMore;
};
export default {
isArray,
isObject,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment