Commit 67f11cb1 authored by 前端-许佳敏's avatar 前端-许佳敏
parents 6c2ee79c 0f482b8b
/**
* @description: 确认询价报价
* @param {type}
* @return {type}
*/
export default [
{
path: '/memberCenter/tranactionAbility/confirmInquiryQuote',
name: 'confirmInquiryQuote',
routes: [
// 报价单查询
{
path: '/memberCenter/tranactionAbility/confirmInquiryQuote/quoteOrder',
name: 'quoteOrder',
component: '@/pages/transaction/confirmInquiryQuote/quoteOrder'
},
// 待提交审核报价单
{
path: '/memberCenter/tranactionAbility/confirmInquiryQuote/pendingSubmitReview',
name: 'pendingSubmitReview',
component: '@/pages/transaction/confirmInquiryQuote/pendingSubmitReview'
},
// 待审核询价单(一级)
{
path: '/memberCenter/tranactionAbility/confirmInquiryQuote/pendingReviewOne',
name: 'pendingReviewOne',
component: '@/pages/transaction/confirmInquiryQuote/pendingReviewOne'
},
// 待审核询价单(二级)
{
path: '/memberCenter/tranactionAbility/confirmInquiryQuote/pendingReviewTwo',
name: 'pendingReviewTwo',
component: '@/pages/transaction/confirmInquiryQuote/pendingReviewTwo'
},
// 详情
{
path: '/memberCenter/tranactionAbility/confirmInquiryQuote/components/details',
name: 'details',
hideInMenu: true,
component: '@/pages/transaction/confirmInquiryQuote/components/details'
},
// 待提交报价单
{
path: '/memberCenter/tranactionAbility/confirmInquiryQuote/pendingSubmit',
name: 'pendingSubmit',
component: '@/pages/transaction/confirmInquiryQuote/pendingSubmit'
},
]
},
]
\ No newline at end of file
/**
* @description: 商品询价
* @param {type}
* @return {type}
*/
export default [
{
path:'/memberCenter/tranactionAbility/goodsOffer',
name:'goodsOffer',
routes:[
// 询价单查询
{
path: '/memberCenter/tranactionAbility/goodsOffer/enquiryOrder',
name: 'enquiryOrder',
component: '@/pages/transaction/goodsOffer/enquiryOrder'
},
// 询价单查询详情
{
path: '/memberCenter/tranactionAbility/goodsOffer/enquiryOrder/details',
name: 'details',
hideInMenu: true,
component: '@/pages/transaction/goodsOffer/components/details'
},
// 待新增询价单
{
path: '/memberCenter/tranactionAbility/goodsOffer/addEnquiryOrder',
name: 'addEnquiryOrder',
component: '@/pages/transaction/goodsOffer/addEnquiryOrder'
},
// 新建报价单
{
path: '/memberCenter/tranactionAbility/goodsOffer/addEnquiryOrder/add',
name: 'add',
hideInMenu: true,
component: '@/pages/transaction/goodsOffer/addEnquiryOrder/add'
},
// 编辑报价单
{
path: '/memberCenter/tranactionAbility/goodsOffer/addEnquiryOrder/edit',
name: 'add',
hideInMenu: true,
component: '@/pages/transaction/goodsOffer/addEnquiryOrder/add'
},
// 待新增询价单详情
{
path: '/memberCenter/tranactionAbility/goodsOffer/addEnquiryOrder/details',
name: 'details',
hideInMenu: true,
component: '@/pages/transaction/goodsOffer/components/details'
},
// 待审核询价单(一级)
{
path: '/memberCenter/tranactionAbility/goodsOffer/pendingReviewOne',
name: 'pendingReviewOne',
component: '@/pages/transaction/goodsOffer/pendingReviewOne'
},
// 待审核询价单(一级)详情
{
path: '/memberCenter/tranactionAbility/goodsOffer/pendingReviewOne/details',
name: 'details',
hideInMenu: true,
component: '@/pages/transaction/goodsOffer/components/details'
},
// 待审核询价单(二级)
{
path: '/memberCenter/tranactionAbility/goodsOffer/pendingReviewTwo',
name: 'pendingReviewTwo',
component: '@/pages/transaction/goodsOffer/pendingReviewTwo'
},
// 待审核询价单(二级)详情
{
path: '/memberCenter/tranactionAbility/goodsOffer/pendingReviewTwo/details',
name: 'details',
hideInMenu: true,
component: '@/pages/transaction/goodsOffer/components/details'
},
// 待提交询价单
{
path: '/memberCenter/tranactionAbility/goodsOffer/pendingSubmit',
name: 'pendingSubmit',
component: '@/pages/transaction/goodsOffer/pendingSubmit'
},
// 待提交询价单详情
{
path: '/memberCenter/tranactionAbility/goodsOffer/pendingSubmit/details',
name: 'details',
hideInMenu: true,
component: '@/pages/transaction/goodsOffer/components/details'
}
]
}
]
\ No newline at end of file
import { RouterChild } from '../../utils';
import goodsOffer from './goodsOffer';
import inquiryQuote from './inquiryQuote';
import confirmInquiryQuote from './confirmInquiryQuote';
import purchaseOrder from './purchaseOrder';
import saleOrder from './saleOrder';
......@@ -397,73 +400,12 @@ const TranactionRoute: RouterChild = {
}
]
},
// 商品询价
{
path: '/memberCenter/tranactionAbility/goodsOffer',
name: 'goodsOffer',
routes: [
// 询价单查询
{
path: '/memberCenter/tranactionAbility/goodsOffer/enquiryOrder',
name: 'enquiryOrder',
component: '@/pages/transaction/goodsOffer/enquiryOrder'
},
// 待新增询价单
{
path: '/memberCenter/tranactionAbility/goodsOffer/addEnquiryOrder',
name: 'addEnquiryOrder',
component: '@/pages/transaction/goodsOffer/addEnquiryOrder'
},
// 待新增询价单-新增
{
path: '/memberCenter/tranactionAbility/goodsOffer/addEnquiryOrder/add',
name: 'add',
component: '@/pages/transaction/goodsOffer/addEnquiryOrder/add',
hideInMenu: true,
},
// 待新增询价单-编辑
{
path: '/memberCenter/tranactionAbility/goodsOffer/addEnquiryOrder/edit',
name: 'edit',
component: '@/pages/transaction/goodsOffer/addEnquiryOrder/add',
hideInMenu: true,
},
// 待新增询价单-详情
{
path: '/memberCenter/tranactionAbility/goodsOffer/addEnquiryOrder/detail',
name: 'detail',
component: '@/pages/transaction/goodsOffer/addEnquiryOrder/add',
hideInMenu: true,
},
// 待审核询价单(一级)
{
path: '/memberCenter/tranactionAbility/goodsOffer/pendingReviewOne',
name: 'pendingReviewOne',
component: '@/pages/transaction/goodsOffer/pendingReviewOne'
},
// 待审核询价单(二级)
{
path: '/memberCenter/tranactionAbility/goodsOffer/pendingReviewTwo',
name: 'pendingReviewTwo',
component: '@/pages/transaction/goodsOffer/pendingReviewTwo'
},
// 待提交询价单
{
path: '/memberCenter/tranactionAbility/goodsOffer/pendingSubmit',
name: 'pendingSubmit',
component: '@/pages/transaction/goodsOffer/pendingSubmit'
},
// 新建询价单
{
path: '/memberCenter/tranactionAbility/goodsOffer/components/details',
name: 'details',
hideInMenu: true,
component: '@/pages/transaction/goodsOffer/components/details'
}
]
},
...goodsOffer,
// 询价报价
...inquiryQuote,
// 确认询价报价
...confirmInquiryQuote,
// 采购订单
...purchaseOrder,
......
/**
* @description: 询价报价
* @param {type}
* @return {type}
*/
export default [
{
path: '/memberCenter/tranactionAbility/inquiryQuote',
name: 'inquiryQuote',
routes: [
//询价单查询
{
path: '/memberCenter/tranactionAbility/inquiryQuote/enquiryOrder',
name: 'enquiryOrder',
component: '@/pages/transaction/inquiryQuote/enquiryOrder'
},
// 询价单查询详情
{
path: '/memberCenter/tranactionAbility/inquiryQuote/enquiryOrder/details',
name: 'details',
hideInMenu: true,
component: '@/pages/transaction/inquiryQuote/components/details'
},
//报价单查询
{
path: '/memberCenter/tranactionAbility/inquiryQuote/quoteOrder',
name: 'quoteOrder',
component: '@/pages/transaction/inquiryQuote/quoteOrder'
},
// 报价单查询详情
{
path: '/memberCenter/tranactionAbility/inquiryQuote/quoteOrder/details',
name: 'details',
hideInMenu: true,
component: '@/pages/transaction/inquiryQuote/components/details'
},
//待新增报价单
{
path: '/memberCenter/tranactionAbility/inquiryQuote/addInquiryOrder',
name: 'addInquiryOrder',
component: '@/pages/transaction/inquiryQuote/addInquiryOrder'
},
// 新建报价单
{
path: '/memberCenter/tranactionAbility/inquiryQuote/addInquiryOrder/add',
name: 'add',
hideInMenu: true,
component: '@/pages/transaction/inquiryQuote/addInquiryOrder/add'
},
// 新建报价单编辑
{
path: '/memberCenter/tranactionAbility/inquiryQuote/addInquiryOrder/edit',
name: 'add',
hideInMenu: true,
component: '@/pages/transaction/inquiryQuote/addInquiryOrder/add'
},
// 新建报价单详情
{
path: '/memberCenter/tranactionAbility/inquiryQuote/addInquiryOrder/details',
name: 'details',
hideInMenu: true,
component: '@/pages/transaction/inquiryQuote/components/details'
},
// 待审核报价单(一级)
{
path: '/memberCenter/tranactionAbility/inquiryQuote/pendingReviewOne',
name: 'pendingReviewOne',
component: '@/pages/transaction/inquiryQuote/pendingReviewOne'
},
// 待审核报价单(一级)详情
{
path: '/memberCenter/tranactionAbility/inquiryQuote/pendingReviewOne/details',
name: 'details',
hideInMenu: true,
component: '@/pages/transaction/inquiryQuote/components/details'
},
// 待审核报价单(二级)
{
path: '/memberCenter/tranactionAbility/inquiryQuote/pendingReviewTwo',
name: 'pendingReviewTwo',
component: '@/pages/transaction/inquiryQuote/pendingReviewTwo'
},
// 待审核报价单(二级)详情
{
path: '/memberCenter/tranactionAbility/inquiryQuote/pendingReviewTwo/details',
name: 'details',
hideInMenu: true,
component: '@/pages/transaction/inquiryQuote/components/details'
},
// 待提交报价单
{
path: '/memberCenter/tranactionAbility/inquiryQuote/pendingSubmit',
name: 'pendingSubmit',
component: '@/pages/transaction/inquiryQuote/pendingSubmit'
},
// 待提交报价单详情
{
path: '/memberCenter/tranactionAbility/inquiryQuote/pendingSubmit/details',
name: 'details',
hideInMenu: true,
component: '@/pages/transaction/inquiryQuote/components/details'
},
]
}
]
\ No newline at end of file
......@@ -2,7 +2,7 @@
* @Author: LeeJiancong
* @Date: 2020-07-13 14:08:50
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-10-14 10:06:45
* @LastEditTime: 2020-10-20 19:48:59
*/
export default {
......@@ -132,6 +132,10 @@ export default {
'menu.tranactionAbility.electronicContracts.classSearch': '合同模板参数查询',
'menu.tranactionAbility.electronicContracts.template': '合同模板',
'menu.tranactionAbility.electronicContracts.addContract': '新建合同模板',
'menu.tranactionAbility.electronicContracts.addTemplate': '新建合同模板',
'menu.tranactionAbility.electronicContracts.editTemplate': '编辑合同模板',
'menu.tranactionAbility.electronicContracts.templateDetail': '查看合同模板',
// 确认询价报价
'menu.tranactionAbility.confirmInquiryQuote': '确认询价报价',
'menu.tranactionAbility.confirmInquiryQuote.quoteOrder': '报价单查询',
......@@ -140,15 +144,19 @@ export default {
'menu.tranactionAbility.confirmInquiryQuote.pendingReviewOne': '待审核报价单(一级)',
'menu.tranactionAbility.confirmInquiryQuote.pendingReviewTwo': '待审核报价单(二级)',
'menu.tranactionAbility.confirmInquiryQuote.pendingSubmit': '待确认报价单',
// 商品询价
'menu.tranactionAbility.goodsOffer': '商品询价',
'menu.tranactionAbility.goodsOffer.enquiryOrder': '询价单查询',
'menu.tranactionAbility.goodsOffer.addEnquiryOrder': '待新增询价单',
'menu.tranactionAbility.goodsOffer.add': '新建询价单',
'menu.tranactionAbility.goodsOffer.edit': '编辑询价单',
'menu.tranactionAbility.goodsOffer.detail': '查看询价单',
'menu.tranactionAbility.goodsOffer.details': '新建询价单',
'menu.tranactionAbility.goodsOffer.pendingReviewOne': '待审核询价单(一级)',
'menu.tranactionAbility.goodsOffer.pendingReviewTwo': '待审核询价单(二级)',
'menu.tranactionAbility.goodsOffer.pendingSubmit': '待提交询价单',
// 询价报价
'menu.tranactionAbility.inquiryQuote': '询价报价',
'menu.tranactionAbility.inquiryQuote.enquiryOrder': '询价单查询',
......@@ -159,6 +167,7 @@ export default {
'menu.tranactionAbility.inquiryQuote.pendingReviewOne': '待审核报价单(一级)',
'menu.tranactionAbility.inquiryQuote.pendingReviewTwo': '待审核报价单(二级)',
'menu.tranactionAbility.inquiryQuote.pendingSubmit': '待提交报价单',
//进销存
'menu.tranactionAbility.stockSellStorage': '进销存',
'menu.tranactionAbility.stockSellStorage.warehouse': '仓库',
......@@ -301,6 +310,7 @@ export default {
'menu.logisticsAbility.logistics.addTemplate': '新建运费模板',
'menu.logisticsAbility.logistics.editTemplate': '编辑运费模板',
'menu.logisticsAbility.logistics.templateDetail': '查看运费模板',
'menu.logisticsAbility.logistics.templateForm': '运费模板管理',
'menu.logisticsAbility.logisticsSubmit': '物流单提交',
'menu.logisticsAbility.logisticsSubmit.orderSubmitSearchList': '物流单查询',
......
......@@ -292,8 +292,9 @@ const AddProducts: React.FC<{}> = (props) => {
PublicApi.postProductCommoditySaveOrUpdateCommodity(_params).then(res => {
if (res.code === 1000) {
setIsEnableCheck(false)
// setIsDisableSaveBtn(false)
setReponseId(res.data)
} else {
setIsDisableSaveBtn(false)
}
})
}).then(e => {
......
......@@ -7,16 +7,14 @@ import {
MinusOutlined,
} from '@ant-design/icons'
import { PublicApi } from '@/services/api';
import {
GetProductCustomerGetCustomerCategoryTreeResponse,
GetManageAreaAllResponse
} from '@/services';
import { inject, observer } from 'mobx-react'
// import { IProductModule } from '@/module/productModule'
// import { IStore } from '@/store';
import { store } from '@/store'
import { validatorByte } from '@/utils/regExp';
import { GetProductCustomerGetCustomerCategoryTreeResponse } from '@/services/ProductApi';
import { GetManageAreaAllResponse } from '@/services/PassApi';
const { Option } = Select
const layout = {
......@@ -66,7 +64,7 @@ const BasicInfoForm: React.FC<Iprops> = (props) => {
productInfoByEdit,
getBasicFormParamsByEdit,
setAttributeLists,
setProductName,
setProductName,
setSelectCategoryId,
setSelectBrandId,
} = ProductStore
......
......@@ -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">X {item.good.purchaseCount || ''}</div>
<div className="goodInfo-price">{`¥ ${item.good.price}`}</div>
</div>
</div>
</Col>
......
/*
* @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 React from 'react';
import styles from './index.less';
const SupplierEvaluation: React.FC = () => {
return (
<div>123</div>
);
};
export default SupplierEvaluation;
\ 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,93 @@ 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 = () => {
if (!id) {
return;
}
setInfoLoading(true);
PublicApi.getOrderProcurementOrderDetails({
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.comments.map(item => {
const {
comment,
good,
picture,
star,
} = item;
return {
memberId: orderInfo.supplyMembersId,
roleId: orderInfo.supplyMembersRoleId,
memberName: orderInfo.supplyMembersName || '',
star,
comment,
product: JSON.stringify(good),
remark: orderInfo.orderNo,
productId: good.productId,
orderId: orderInfo.id,
productImgUrl: good.pic,
dealTime: orderInfo.createTime,
dealCount: good.purchaseCount,
price: good.price,
totalPrice: orderInfo.sumPrice,
pics: picture.map(item => item.status === 'done' && item.data).filter(Boolean),
};
});
PublicApi.postMemberCommentConsumerOrderTradeSubmit({
commentSubmitDetailList: payload,
}).then(res => {
if (res.code === 1000) {
setTimeout(() => {
history.goBack();
}, 800);
}
}).finally(() => {
setSubmitLoading(false);
});
};
const beforeUpload = file => {
......@@ -50,62 +137,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="供应会员">{orderInfo?.supplyMembersName}</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-23 18:06:56
* @LastEditTime: 2020-10-20 17:58:51
* @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,30 +43,35 @@ 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/upload/prefix',
action: '/api/file/file/upload/prefix',
data: {
fileType: UPLOAD_TYPE,
prefix: '/test/',
prefix: '/supplierEvaluation/',
},
beforeUpload: '{{beforeUpload}}',
accept: '.png, .jpg, .jpeg',
},
'x-mega-props': {
addonAfter: '{{UploadTip}}',
......
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 moment from 'moment';
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 } from '@/constants';
import { PublicApi } from '@/services/api';
import EyePreview from '@/components/EyePreview';
import NiceForm from '@/components/NiceForm';
import StatusTag from '@/components/StatusTag';
......@@ -16,29 +18,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 +37,46 @@ const Unevaluated: React.FC = () => {
},
{
title: '订单摘要',
dataIndex: 'abstract',
align: 'center',
dataIndex: 'orderThe',
align: 'center',
ellipsis: true,
},
{
title: '采购会员',
dataIndex: 'member',
title: '供应会员',
dataIndex: 'supplyMembersName',
align: 'center',
render: (text, record) => <>{text}</>,
},
{
title: '下单时间',
dataIndex: 'created',
dataIndex: 'createTime',
align: 'center',
render: (text, record) => <>{text}</>,
render: (text, record) => moment(text).format('YYYY-MM-DD HH:mm:ss'),
},
{
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 +84,7 @@ const Unevaluated: React.FC = () => {
align: 'center',
render: (text, record) => (
<>
<Link to={`/memberCenter/tranactionAbility/supplierEvaluation/unevaluated/evaluate`}>
<Link to={`/memberCenter/tranactionAbility/purchaserEvaluation/unevaluated/evaluate?id=${record.id}`}>
<Button
type="link"
>
......@@ -122,17 +99,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.getOrderProcurementOrderEvaluatedList(params)
.then(res => {
if (res.code === 1000) {
resolve(res.data);
}
reject();
})
.catch(() => {
reject();
});
});
};
// 初始化高级筛选选项
const fetchSelectOptions = async () => {
return {};
};
return (
<PageHeaderWrapper>
<Card>
......@@ -154,10 +134,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,15 +38,15 @@ export const listSearchSchema: ISchema = {
columns: 6,
},
properties: {
memberTypeId: {
supplyMembersName: {
type: 'string',
default: undefined,
'x-component-props': {
placeholder: '采购会员',
placeholder: '供应会员',
allowClear: true,
},
},
'[startDate, endDate]': {
'[startCreateTime, endCreateTime]': {
type: 'string',
default: '',
'x-component': 'dateSelect',
......@@ -45,33 +55,48 @@ export const listSearchSchema: ISchema = {
allowClear: true,
},
},
orderType: {
type: {
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-20 13:40:11
* @Description:
*/
// 初始化待评价列表
export const normalizeUnevaluatedList = (arr: {[key: string]: any}[]) => {
const ret = [];
if (!Array.isArray(arr)) {
return ret;
}
arr.forEach(item => {
const atom = {
good: {
pic: item.imgUrl || '',
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
......@@ -142,7 +142,7 @@ const EvaluationList = props => {
</div>
<div className="goodInfo-right">
<div className="goodInfo-title">{item.good.productName}</div>
<div className="goodInfo-desc">{item.good.purchaseCount || ''}</div>
<div className="goodInfo-desc">X {item.good.purchaseCount || ''}</div>
<div className="goodInfo-price">{`¥ ${item.good.price}`}</div>
</div>
</div>
......
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 styles from './index.less';
const SupplierEvaluation: React.FC = () => {
return (
<div>123</div>
);
};
export default SupplierEvaluation;
\ No newline at end of file
......@@ -49,6 +49,9 @@ const EvaluateOrder: React.FC = () => {
const [submitLoading, setSubmitLoading] = useState(false);
const getOrderInfo = () => {
if (!id) {
return;
}
setInfoLoading(true);
PublicApi.getOrderPurchaseOrderDetails({
id,
......@@ -71,7 +74,7 @@ const EvaluateOrder: React.FC = () => {
const handleSubmit = values => {
setSubmitLoading(true);
const payload = values.map(item => {
const payload = values.comments.map(item => {
const {
comment,
good,
......@@ -80,14 +83,16 @@ const EvaluateOrder: React.FC = () => {
} = item;
return {
memberId: orderInfo.supplyMembersId,
roleId: '暂无',
memberName: orderInfo.supplyMembersName,
memberId: orderInfo.createMemberId,
roleId: orderInfo.createRoleId,
memberName: orderInfo.createMemberName || '',
star,
comment,
product: JSON.stringify(good),
remark: orderInfo.orderNo,
productId: good.productId,
orderId: orderInfo.id,
productImgUrl: good.pic,
dealTime: orderInfo.createTime,
dealCount: good.purchaseCount,
price: good.price,
......@@ -168,7 +173,7 @@ const EvaluateOrder: React.FC = () => {
padding: '0 32px',
}}
>
<Descriptions.Item label="采购会员">{'暂无'}</Descriptions.Item>
<Descriptions.Item label="采购会员">{orderInfo?.createMemberName}</Descriptions.Item>
<Descriptions.Item label="下单时间" span={2}>{orderInfo?.createTime}</Descriptions.Item>
</Descriptions>
</PageHeader>
......
......@@ -5,14 +5,10 @@ import { StandardTable } from 'god';
import { ColumnType } from 'antd/lib/table/interface';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { createFormActions } from '@formily/antd';
import moment from 'moment';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
import { FORM_FILTER_PATH } from '@/formSchema/const';
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 { ORDER_TYPE2 } from '@/constants';
import { PublicApi } from '@/services/api';
import EyePreview from '@/components/EyePreview';
import NiceForm from '@/components/NiceForm';
......@@ -55,7 +51,7 @@ const Unevaluated: React.FC = () => {
title: '下单时间',
dataIndex: 'createTime',
align: 'center',
render: (text, record) => <>{text}</>,
render: (text, record) => moment(text).format('YYYY-MM-DD HH:mm:ss'),
},
{
title: '订单总额',
......@@ -72,8 +68,6 @@ const Unevaluated: React.FC = () => {
title: '外部状态',
dataIndex: 'externalState',
align: 'center',
filters: [],
onFilter: (value, record) => record.outerStatus === value,
render: (text, record) => (
<StatusTag type="success" title="已完成" />
),
......@@ -82,8 +76,6 @@ const Unevaluated: React.FC = () => {
title: '内部状态',
dataIndex: 'purchaseOrderInteriorState',
align: 'center',
filters: [],
onFilter: (value, record) => record.innerStatus === value,
render: (text, record) => <Badge color="#41CC9E" text="已完成" />,
},
{
......
......@@ -38,7 +38,7 @@ export const listSearchSchema: ISchema = {
columns: 6,
},
properties: {
supplyMembersName: {
membersName: {
type: 'string',
default: undefined,
'x-component-props': {
......@@ -46,7 +46,7 @@ export const listSearchSchema: ISchema = {
allowClear: true,
},
},
'[startDate, endDate]': {
'[startCreateTime, endCreateTime]': {
type: 'string',
default: '',
'x-component': 'dateSelect',
......@@ -55,7 +55,7 @@ export const listSearchSchema: ISchema = {
allowClear: true,
},
},
orderType: {
type: {
type: 'string',
default: undefined,
enum: [
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-10-19 16:02:53
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-10-19 17:10:42
* @LastEditTime: 2020-10-20 18:03:34
* @Description:
*/
......@@ -16,8 +16,7 @@ export const normalizeUnevaluatedList = (arr: {[key: string]: any}[]) => {
arr.forEach(item => {
const atom = {
good: {
pic: '',
quantity: item.productAttributeJson || '',
pic: item.imgUrl || '',
productId: item.productId,
orderId: item.orderId,
productName: item.productName,
......
......@@ -427,11 +427,19 @@ export const padRequiredMessage = (originSchema: ISchema) => {
return originSchema
}
export interface FileData {
uid: string;
name: string;
status: 'uploading' | 'done' | 'error' | 'removed';
url: string;
};
// 初始化 Upload 数据
export const normalizeFiledata = url => {
url = url || '';
export function normalizeFiledata<T>(url: T): T
export function normalizeFiledata(url: string): FileData
export function normalizeFiledata(url: any): any {
if (!url) {
return;
return url;
}
const splited = url.split('/');
const fileName = splited && splited.length ? splited[splited.length - 1] : '';
......@@ -445,13 +453,13 @@ export const normalizeFiledata = url => {
};
/**
* 检查是否还有更多
* 检查是否还有更多
* @param {Number} curPage 当前页码
* @param {Number} curSize 当前页数
* @param {Number} dataLen 当前数据长度
* @param {Number} dataTotal 数据总长度
*/
export const checkMore = (curPage, curSize, dataLen, dataTotal) => {
export const checkMore = (curPage: number, curSize: number, dataLen: number, dataTotal: number) => {
let hasMore = true;
if (!dataLen || dataLen + (curPage - 1) * curSize >= +dataTotal) {
......@@ -460,6 +468,22 @@ export const checkMore = (curPage, curSize, dataLen, dataTotal) => {
return hasMore;
};
/**
*
* @param {string} str 需要判断是否是 JSON字符串的 字符串
*/
export const isJSONStr = str => {
if (typeof str === 'string') {
try {
const complete = JSON.parse(str);
return complete;
} catch(e) {
return null;
}
}
return str;
}
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