Commit 2eeef652db7e9dcb5ea0d3d9a6abc806f328bf96
Merge remote-tracking branch 'origin/master'
# Conflicts: # src/services/definition.ts
Showing
16 changed files
with
1150 additions
and
113 deletions
.umirc.ts
@@ -16,12 +16,12 @@ export default defineConfig({ | @@ -16,12 +16,12 @@ export default defineConfig({ | ||
16 | '/api/': { | 16 | '/api/': { |
17 | target: 'http://localhost:8085/', | 17 | target: 'http://localhost:8085/', |
18 | // target: 'http://192.168.1.6:8085/', | 18 | // target: 'http://192.168.1.6:8085/', |
19 | - //target: 'http://39.108.227.113:8085/', | 19 | + // target: 'http://39.108.227.113:8085/', |
20 | changeOrigin: true, | 20 | changeOrigin: true, |
21 | pathRewrite: { '^/api': '' }, | 21 | pathRewrite: { '^/api': '' }, |
22 | }, | 22 | }, |
23 | '/previewApi/': { | 23 | '/previewApi/': { |
24 | - //target: 'http://39.108.227.113:8092/', | 24 | + target: 'http://39.108.227.113:8092/', |
25 | changeOrigin: true, | 25 | changeOrigin: true, |
26 | pathRewrite: { '^/previewApi': '' }, | 26 | pathRewrite: { '^/previewApi': '' }, |
27 | }, | 27 | }, |
@@ -59,11 +59,11 @@ export default defineConfig({ | @@ -59,11 +59,11 @@ export default defineConfig({ | ||
59 | access: 'canReadAdminAndSalesManager', | 59 | access: 'canReadAdminAndSalesManager', |
60 | component: './Order/WarningWhitelist', | 60 | component: './Order/WarningWhitelist', |
61 | }, | 61 | }, |
62 | - /*{ | 62 | + { |
63 | name: '订单售后', | 63 | name: '订单售后', |
64 | path: 'FeedBack', | 64 | path: 'FeedBack', |
65 | component: './Order/FeedBack', | 65 | component: './Order/FeedBack', |
66 | - },*/ | 66 | + }, |
67 | ], | 67 | ], |
68 | }, | 68 | }, |
69 | { | 69 | { |
src/pages/Order/FeedBack/CheckModal.tsx
@@ -66,7 +66,7 @@ export default ({ | @@ -66,7 +66,7 @@ export default ({ | ||
66 | const [messageApi, contextHolder] = message.useMessage(); | 66 | const [messageApi, contextHolder] = message.useMessage(); |
67 | const [form] = Form.useForm<{ name: string; company: string }>(); | 67 | const [form] = Form.useForm<{ name: string; company: string }>(); |
68 | let subOrderIds: any[] = subOrders?.map((subOrder) => subOrder.id); | 68 | let subOrderIds: any[] = subOrders?.map((subOrder) => subOrder.id); |
69 | - const [mainOrderId] = useState(data.id); | 69 | + const [mainOrderId] = useState(data?.id || null); |
70 | 70 | ||
71 | const [afterSalesInfo, setAfterSalesInfo] = useState<any>(); | 71 | const [afterSalesInfo, setAfterSalesInfo] = useState<any>(); |
72 | const [prepaidProofImages, setPrepaidProofImages] = useState<any[]>([]); | 72 | const [prepaidProofImages, setPrepaidProofImages] = useState<any[]>([]); |
@@ -90,14 +90,18 @@ export default ({ | @@ -90,14 +90,18 @@ export default ({ | ||
90 | let index = 1; | 90 | let index = 1; |
91 | let annexLinks = annex?.map((f) => { | 91 | let annexLinks = annex?.map((f) => { |
92 | return ( | 92 | return ( |
93 | - <Button className="p-0 pr-1" type="link" key="key" href={f}> | 93 | + <Button |
94 | + className="p-0 pr-1" | ||
95 | + type="link" | ||
96 | + key="key" | ||
97 | + href={f} | ||
98 | + onClick={console.log(data)} | ||
99 | + > | ||
94 | {'附件' + index++} | 100 | {'附件' + index++} |
95 | </Button> | 101 | </Button> |
96 | ); | 102 | ); |
97 | }); | 103 | }); |
98 | 104 | ||
99 | - console.log(annexLinks); | ||
100 | - | ||
101 | setAfterSalesInfo( | 105 | setAfterSalesInfo( |
102 | <div className="my-5"> | 106 | <div className="my-5"> |
103 | <Row gutter={[16, 24]}> | 107 | <Row gutter={[16, 24]}> |
@@ -670,7 +674,7 @@ export default ({ | @@ -670,7 +674,7 @@ export default ({ | ||
670 | <ProFormTextArea | 674 | <ProFormTextArea |
671 | width="lg" | 675 | width="lg" |
672 | name="name" | 676 | name="name" |
673 | - placeholder="若驳回,请填写驳回理由" | 677 | + // placeholder="若驳回,请填写驳回理由" |
674 | /> | 678 | /> |
675 | ) : ( | 679 | ) : ( |
676 | <></> | 680 | <></> |
src/pages/Order/FeedBack/OrderDrawer.tsx
@@ -122,6 +122,8 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | @@ -122,6 +122,8 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | ||
122 | 122 | ||
123 | let originSubOrders = cloneDeep(subOrders); | 123 | let originSubOrders = cloneDeep(subOrders); |
124 | 124 | ||
125 | + let currentSubOrders = cloneDeep(subOrders); | ||
126 | + | ||
125 | /** | 127 | /** |
126 | * 获取当前的操作类型boolean值 | 128 | * 获取当前的操作类型boolean值 |
127 | * @param type 操作类型,如果与当前匹配返回true | 129 | * @param type 操作类型,如果与当前匹配返回true |
@@ -277,8 +279,8 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | @@ -277,8 +279,8 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | ||
277 | function buildOrderData() { | 279 | function buildOrderData() { |
278 | // let mainInfoDisbled = optType('edit'); | 280 | // let mainInfoDisbled = optType('edit'); |
279 | if (!optType('add')) { | 281 | if (!optType('add')) { |
280 | - if (subOrders !== undefined && subOrders.length > 0) { | ||
281 | - copyData.subOrderInformationLists = subOrders; | 282 | + if (currentSubOrders !== undefined && currentSubOrders.length > 0) { |
283 | + copyData.subOrderInformationLists = currentSubOrders; | ||
282 | } | 284 | } |
283 | 285 | ||
284 | //如果是复制,需要开票,不回显是否需要开票字段 | 286 | //如果是复制,需要开票,不回显是否需要开票字段 |
@@ -292,6 +294,7 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | @@ -292,6 +294,7 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | ||
292 | } | 294 | } |
293 | } | 295 | } |
294 | } | 296 | } |
297 | + console.log(copyData); | ||
295 | //主订单事业部默认显示子订单第一条的事业部 | 298 | //主订单事业部默认显示子订单第一条的事业部 |
296 | copyData.productBelongBusiness = | 299 | copyData.productBelongBusiness = |
297 | copyData.subOrderInformationLists[0].productBelongBusiness; | 300 | copyData.subOrderInformationLists[0].productBelongBusiness; |
@@ -358,7 +361,7 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | @@ -358,7 +361,7 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | ||
358 | copyData = res.data.mainOrder; | 361 | copyData = res.data.mainOrder; |
359 | copyData.subOrderInformationLists = res.data.subOrders; | 362 | copyData.subOrderInformationLists = res.data.subOrders; |
360 | originSubOrders = res.data.subOrders; | 363 | originSubOrders = res.data.subOrders; |
361 | - | 364 | + currentSubOrders = originSubOrders; |
362 | //客户显示 | 365 | //客户显示 |
363 | form.setFieldValue('erpCustomerId', { | 366 | form.setFieldValue('erpCustomerId', { |
364 | label: copyData.erpCustomerName, | 367 | label: copyData.erpCustomerName, |
@@ -1131,7 +1134,10 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | @@ -1131,7 +1134,10 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | ||
1131 | console.log(form.getFieldValue('id')); | 1134 | console.log(form.getFieldValue('id')); |
1132 | if (form.getFieldValue('id') !== undefined) { | 1135 | if (form.getFieldValue('id') !== undefined) { |
1133 | const resp = await postDistrictSelOrderProvince({ | 1136 | const resp = await postDistrictSelOrderProvince({ |
1134 | - data: form.getFieldValue('id'), | 1137 | + data: { |
1138 | + oId: form.getFieldValue('id'), | ||
1139 | + orderType: orderOptType, | ||
1140 | + }, | ||
1135 | }); | 1141 | }); |
1136 | if (resp && resp.data) { | 1142 | if (resp && resp.data) { |
1137 | if (resp.data.province) { | 1143 | if (resp.data.province) { |
@@ -1318,7 +1324,10 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | @@ -1318,7 +1324,10 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | ||
1318 | console.log(form.getFieldValue('id')); | 1324 | console.log(form.getFieldValue('id')); |
1319 | if (form.getFieldValue('id')) { | 1325 | if (form.getFieldValue('id')) { |
1320 | const resp = await postDistrictSelOrderProvince({ | 1326 | const resp = await postDistrictSelOrderProvince({ |
1321 | - data: form.getFieldValue('id'), | 1327 | + data: { |
1328 | + oId: form.getFieldValue('id'), | ||
1329 | + orderType: orderOptType, | ||
1330 | + }, | ||
1322 | }); | 1331 | }); |
1323 | if ( | 1332 | if ( |
1324 | resp.data.province !== null && | 1333 | resp.data.province !== null && |
@@ -1378,7 +1387,10 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | @@ -1378,7 +1387,10 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | ||
1378 | let districtOptions = []; | 1387 | let districtOptions = []; |
1379 | if (form.getFieldValue('id')) { | 1388 | if (form.getFieldValue('id')) { |
1380 | const resp = await postDistrictSelOrderProvince({ | 1389 | const resp = await postDistrictSelOrderProvince({ |
1381 | - data: form.getFieldValue('id'), | 1390 | + data: { |
1391 | + oId: form.getFieldValue('id'), | ||
1392 | + orderType: orderOptType, | ||
1393 | + }, | ||
1382 | }); | 1394 | }); |
1383 | if (resp.data.city !== null && resp.data.city !== undefined) { | 1395 | if (resp.data.city !== null && resp.data.city !== undefined) { |
1384 | let res = await postDistrictSelectByNameAndLevel({ | 1396 | let res = await postDistrictSelectByNameAndLevel({ |
src/pages/Order/FeedBack/OrderList.tsx
@@ -8,7 +8,6 @@ import { | @@ -8,7 +8,6 @@ import { | ||
8 | postKingdeeRepSalOrderSave, | 8 | postKingdeeRepSalOrderSave, |
9 | postServiceConstCanApplyAfterInvoicingStatus, | 9 | postServiceConstCanApplyAfterInvoicingStatus, |
10 | postServiceInvoiceCancelApply, | 10 | postServiceInvoiceCancelApply, |
11 | - postServiceOrderAfterSalesCheck, | ||
12 | postServiceOrderCancelSend, | 11 | postServiceOrderCancelSend, |
13 | postServiceOrderConfirmInvoice, | 12 | postServiceOrderConfirmInvoice, |
14 | postServiceOrderGetCurrentOptNode, | 13 | postServiceOrderGetCurrentOptNode, |
@@ -100,6 +99,7 @@ import ProcureCheckModal from './ProcureCheckModal'; | @@ -100,6 +99,7 @@ import ProcureCheckModal from './ProcureCheckModal'; | ||
100 | import ProcureConvertModal from './ProcureConvertModal'; | 99 | import ProcureConvertModal from './ProcureConvertModal'; |
101 | import ProductionTimeModal from './ProductionTimeModal'; | 100 | import ProductionTimeModal from './ProductionTimeModal'; |
102 | import ShippingWarehouseChangeModal from './ShippingWarehouseChangeModal'; | 101 | import ShippingWarehouseChangeModal from './ShippingWarehouseChangeModal'; |
102 | +import StoreCheckModal from './StoreCheckModal'; | ||
103 | import UploadPayBillModal from './UploadPayBillModal'; | 103 | import UploadPayBillModal from './UploadPayBillModal'; |
104 | import { | 104 | import { |
105 | AFTER_INVOICING_STATUS, | 105 | AFTER_INVOICING_STATUS, |
@@ -128,6 +128,8 @@ import { OrderListItemType, OrderType } from './type.d'; | @@ -128,6 +128,8 @@ import { OrderListItemType, OrderType } from './type.d'; | ||
128 | const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | 128 | const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { |
129 | const [orderDrawerVisible, setOrderDrawerVisible] = useState<boolean>(false); | 129 | const [orderDrawerVisible, setOrderDrawerVisible] = useState<boolean>(false); |
130 | const [checkVisible, setCheckVisible] = useState<boolean>(false); | 130 | const [checkVisible, setCheckVisible] = useState<boolean>(false); |
131 | + const [storeCheckModalVisible, setStoreCheckModalVisible] = | ||
132 | + useState<boolean>(false); | ||
131 | const [orderPrintVisible, setOrderPrintVisible] = useState<boolean>(false); | 133 | const [orderPrintVisible, setOrderPrintVisible] = useState<boolean>(false); |
132 | const [allMainChecked, setAllMainChecked] = useState(false); | 134 | const [allMainChecked, setAllMainChecked] = useState(false); |
133 | const [imagesViewerModalVisible, setImagesViewerModalVisible] = | 135 | const [imagesViewerModalVisible, setImagesViewerModalVisible] = |
@@ -413,20 +415,21 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | @@ -413,20 +415,21 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | ||
413 | return null; | 415 | return null; |
414 | } | 416 | } |
415 | 417 | ||
416 | - async function doAfterSalesCheck(body: object) { | ||
417 | - const data = await postServiceOrderAfterSalesCheck({ | ||
418 | - data: body, | ||
419 | - }); | ||
420 | - console.log(data); | ||
421 | - if (data.data) { | ||
422 | - refreshTable(); | ||
423 | - } | ||
424 | - } | 418 | + // async function doAfterSalesCheck(body: object) { |
419 | + // const data = await postServiceOrderAfterSalesCheck({ | ||
420 | + // data: body, | ||
421 | + // }); | ||
422 | + // console.log(data); | ||
423 | + // if (data.data) { | ||
424 | + // refreshTable(); | ||
425 | + // } | ||
426 | + // } | ||
425 | 427 | ||
426 | /** | 428 | /** |
427 | * 返回当前操作的主订单数据 | 429 | * 返回当前操作的主订单数据 |
428 | */ | 430 | */ |
429 | function buildMainOrder() { | 431 | function buildMainOrder() { |
432 | + console.log(currentOptMainId); | ||
430 | if (currentOptMainId === undefined || currentOptMainId === null) { | 433 | if (currentOptMainId === undefined || currentOptMainId === null) { |
431 | message.error('页面错误:当前操作的主订单id不存在,请联系系统管理员'); | 434 | message.error('页面错误:当前操作的主订单id不存在,请联系系统管理员'); |
432 | return; | 435 | return; |
@@ -704,7 +707,11 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | @@ -704,7 +707,11 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | ||
704 | } | 707 | } |
705 | 708 | ||
706 | //如果是未审核或者领导已审核,付款状态为预付款则需要财务审核【财务待审核】,否则仓库审核【】 | 709 | //如果是未审核或者领导已审核,付款状态为预付款则需要财务审核【财务待审核】,否则仓库审核【】 |
707 | - if (orderStatus === 'UNAUDITED' || orderStatus === 'LEADER_AUDITED') { | 710 | + if ( |
711 | + orderStatus === 'UNAUDITED' || | ||
712 | + orderStatus === 'LEADER_AUDITED' || | ||
713 | + orderStatus === 'PROCURE_REJECT' | ||
714 | + ) { | ||
708 | if (paymentMethod === 'PAYMENT_IN_ADVANCE') { | 715 | if (paymentMethod === 'PAYMENT_IN_ADVANCE') { |
709 | orderStatusTagText = '财务待审核'; | 716 | orderStatusTagText = '财务待审核'; |
710 | } else { | 717 | } else { |
@@ -1895,6 +1902,8 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | @@ -1895,6 +1902,8 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | ||
1895 | className="p-0" | 1902 | className="p-0" |
1896 | type="link" | 1903 | type="link" |
1897 | onClick={() => { | 1904 | onClick={() => { |
1905 | + setCurrentMainId(record.id); | ||
1906 | + console.log(currentOptMainId); | ||
1898 | createOptObject(optRecord.id, record.id); | 1907 | createOptObject(optRecord.id, record.id); |
1899 | setCheckVisible(true); | 1908 | setCheckVisible(true); |
1900 | setOrderCheckType(CHECK_TYPE.AFTER_SALES); | 1909 | setOrderCheckType(CHECK_TYPE.AFTER_SALES); |
@@ -1907,10 +1916,27 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | @@ -1907,10 +1916,27 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | ||
1907 | )} | 1916 | )} |
1908 | 1917 | ||
1909 | {optRecord.paths?.includes('afterSalesConfirm') ? ( | 1918 | {optRecord.paths?.includes('afterSalesConfirm') ? ( |
1919 | + <Button | ||
1920 | + className="p-0" | ||
1921 | + type="link" | ||
1922 | + onClick={() => { | ||
1923 | + setCurrentMainId(record.id); | ||
1924 | + createOptObject(optRecord.id, record.id); | ||
1925 | + setStoreCheckModalVisible(true); | ||
1926 | + setOrderCheckType(CHECK_TYPE.AFTER_SALES); | ||
1927 | + }} | ||
1928 | + > | ||
1929 | + 仓库确认 | ||
1930 | + </Button> | ||
1931 | + ) : ( | ||
1932 | + '' | ||
1933 | + )} | ||
1934 | + | ||
1935 | + {/* {optRecord.paths?.includes('afterSalesConfirm') ? ( | ||
1910 | <ButtonConfirm | 1936 | <ButtonConfirm |
1911 | className="p-0" | 1937 | className="p-0" |
1912 | title="确认通过?" | 1938 | title="确认通过?" |
1913 | - text="售后已审核待确认" | 1939 | + text="仓库确认" |
1914 | onConfirm={() => { | 1940 | onConfirm={() => { |
1915 | setIsMainOrder(false); | 1941 | setIsMainOrder(false); |
1916 | doAfterSalesCheck({ | 1942 | doAfterSalesCheck({ |
@@ -1918,8 +1944,8 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | @@ -1918,8 +1944,8 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | ||
1918 | isAfterSalesSuccess: true, | 1944 | isAfterSalesSuccess: true, |
1919 | subOrderIds: isMainOrder | 1945 | subOrderIds: isMainOrder |
1920 | ? [...record.subOrderInformationLists] | 1946 | ? [...record.subOrderInformationLists] |
1921 | - .flat() | ||
1922 | - ?.map((subOrder) => subOrder.id) | 1947 | + .flat() |
1948 | + ?.map((subOrder) => subOrder.id) | ||
1923 | : [optRecord.id], | 1949 | : [optRecord.id], |
1924 | mainId: record.id, | 1950 | mainId: record.id, |
1925 | }); | 1951 | }); |
@@ -1927,7 +1953,7 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | @@ -1927,7 +1953,7 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | ||
1927 | /> | 1953 | /> |
1928 | ) : ( | 1954 | ) : ( |
1929 | '' | 1955 | '' |
1930 | - )} | 1956 | + )} */} |
1931 | 1957 | ||
1932 | {optRecord.paths?.includes('financeCheckOrder') ? ( | 1958 | {optRecord.paths?.includes('financeCheckOrder') ? ( |
1933 | <Button | 1959 | <Button |
@@ -2015,7 +2041,7 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | @@ -2015,7 +2041,7 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | ||
2015 | onClick={() => { | 2041 | onClick={() => { |
2016 | createOptObject(optRecord.id, record.id); | 2042 | createOptObject(optRecord.id, record.id); |
2017 | setOrderDrawerVisible(true); | 2043 | setOrderDrawerVisible(true); |
2018 | - setOrderOptType('after_sales'); | 2044 | + setOrderOptType('after-sales'); |
2019 | }} | 2045 | }} |
2020 | > | 2046 | > |
2021 | 申请售后 | 2047 | 申请售后 |
@@ -3539,6 +3565,7 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | @@ -3539,6 +3565,7 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | ||
3539 | //是审核通过及之后的订单 | 3565 | //是审核通过及之后的订单 |
3540 | if ( | 3566 | if ( |
3541 | orderStatus !== 'UNAUDITED' && | 3567 | orderStatus !== 'UNAUDITED' && |
3568 | + orderStatus !== 'PROCURE_REJECT' && | ||
3542 | orderStatus !== 'AUDIT_FAILED' && | 3569 | orderStatus !== 'AUDIT_FAILED' && |
3543 | orderStatus !== 'LEADER_PROCESS' && | 3570 | orderStatus !== 'LEADER_PROCESS' && |
3544 | orderStatus !== 'SALES_CONFIRM' && | 3571 | orderStatus !== 'SALES_CONFIRM' && |
@@ -3554,6 +3581,7 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | @@ -3554,6 +3581,7 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | ||
3554 | if ( | 3581 | if ( |
3555 | roleCode !== 'admin' && | 3582 | roleCode !== 'admin' && |
3556 | (orderStatus === 'UNAUDITED' || | 3583 | (orderStatus === 'UNAUDITED' || |
3584 | + orderStatus === 'PROCURE_REJECT' || | ||
3557 | orderStatus === 'AUDIT_FAILED') | 3585 | orderStatus === 'AUDIT_FAILED') |
3558 | ) { | 3586 | ) { |
3559 | message.error('请选择已审核的订单进行编辑'); | 3587 | message.error('请选择已审核的订单进行编辑'); |
@@ -3607,6 +3635,7 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | @@ -3607,6 +3635,7 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | ||
3607 | let orderStatus = selectedSubOrders[i].orderStatus; | 3635 | let orderStatus = selectedSubOrders[i].orderStatus; |
3608 | if ( | 3636 | if ( |
3609 | orderStatus !== 'UNAUDITED' && | 3637 | orderStatus !== 'UNAUDITED' && |
3638 | + orderStatus !== 'PROCURE_REJECT' && | ||
3610 | orderStatus !== 'FINANCE_PROCESS' && | 3639 | orderStatus !== 'FINANCE_PROCESS' && |
3611 | orderStatus !== 'LEADER_AUDITED' | 3640 | orderStatus !== 'LEADER_AUDITED' |
3612 | ) { | 3641 | ) { |
@@ -3633,6 +3662,8 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | @@ -3633,6 +3662,8 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | ||
3633 | className="p-0" | 3662 | className="p-0" |
3634 | type="link" | 3663 | type="link" |
3635 | onClick={() => { | 3664 | onClick={() => { |
3665 | + setCurrentMainId(record.id); | ||
3666 | + console.log(currentOptMainId); | ||
3636 | let selectedSubOrders = subOrderSelectedMap.get( | 3667 | let selectedSubOrders = subOrderSelectedMap.get( |
3637 | record.id, | 3668 | record.id, |
3638 | ); | 3669 | ); |
@@ -3649,7 +3680,6 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | @@ -3649,7 +3680,6 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | ||
3649 | return; | 3680 | return; |
3650 | } | 3681 | } |
3651 | } | 3682 | } |
3652 | - | ||
3653 | createOptObject(null, record.id); | 3683 | createOptObject(null, record.id); |
3654 | setCheckVisible(true); | 3684 | setCheckVisible(true); |
3655 | setOrderCheckType(CHECK_TYPE.AFTER_SALES); | 3685 | setOrderCheckType(CHECK_TYPE.AFTER_SALES); |
@@ -3662,23 +3692,35 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | @@ -3662,23 +3692,35 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | ||
3662 | )} | 3692 | )} |
3663 | 3693 | ||
3664 | {record.paths?.includes('afterSalesConfirm') ? ( | 3694 | {record.paths?.includes('afterSalesConfirm') ? ( |
3665 | - <ButtonConfirm | 3695 | + <Button |
3666 | className="p-0" | 3696 | className="p-0" |
3667 | - title="确认通过?" | ||
3668 | - text="售后已审核待确认" | ||
3669 | - onConfirm={() => { | ||
3670 | - setIsMainOrder(true); | ||
3671 | - doAfterSalesCheck({ | ||
3672 | - applyType: 'after-sales', | ||
3673 | - isAfterSalesSuccess: true, | ||
3674 | - subOrderIds: [...record.subOrderInformationLists] | ||
3675 | - .flat() | ||
3676 | - ?.map((subOrder) => subOrder.id), | ||
3677 | - mainId: record.id, | ||
3678 | - }); | 3697 | + type="link" |
3698 | + onClick={() => { | ||
3699 | + setCurrentMainId(record.id); | ||
3700 | + createOptObject(null, record.id); | ||
3701 | + setStoreCheckModalVisible(true); | ||
3702 | + setOrderCheckType(CHECK_TYPE.AFTER_SALES); | ||
3679 | }} | 3703 | }} |
3680 | - /> | 3704 | + > |
3705 | + 仓库确认 | ||
3706 | + </Button> | ||
3681 | ) : ( | 3707 | ) : ( |
3708 | + // <ButtonConfirm | ||
3709 | + // className="p-0" | ||
3710 | + // title="确认通过?" | ||
3711 | + // text="仓库确认" | ||
3712 | + // onConfirm={() => { | ||
3713 | + // setIsMainOrder(true); | ||
3714 | + // doAfterSalesCheck({ | ||
3715 | + // applyType: 'after-sales', | ||
3716 | + // isAfterSalesSuccess: true, | ||
3717 | + // subOrderIds: [...record.subOrderInformationLists] | ||
3718 | + // .flat() | ||
3719 | + // ?.map((subOrder) => subOrder.id), | ||
3720 | + // mainId: record.id, | ||
3721 | + // }); | ||
3722 | + // }} | ||
3723 | + // /> | ||
3682 | '' | 3724 | '' |
3683 | )} | 3725 | )} |
3684 | 3726 | ||
@@ -3791,6 +3833,8 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | @@ -3791,6 +3833,8 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | ||
3791 | if ( | 3833 | if ( |
3792 | selectedSubOrders[i].orderStatus !== 'UNAUDITED' && | 3834 | selectedSubOrders[i].orderStatus !== 'UNAUDITED' && |
3793 | selectedSubOrders[i].orderStatus !== | 3835 | selectedSubOrders[i].orderStatus !== |
3836 | + 'PROCURE_REJECT' && | ||
3837 | + selectedSubOrders[i].orderStatus !== | ||
3794 | 'FINANCE_PROCESS' && | 3838 | 'FINANCE_PROCESS' && |
3795 | selectedSubOrders[i].orderStatus !== | 3839 | selectedSubOrders[i].orderStatus !== |
3796 | 'LEADER_AUDITED' | 3840 | 'LEADER_AUDITED' |
@@ -3863,7 +3907,9 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | @@ -3863,7 +3907,9 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | ||
3863 | selectedSubOrders[i].orderStatus !== | 3907 | selectedSubOrders[i].orderStatus !== |
3864 | 'CONFIRM_RECEIPT' && | 3908 | 'CONFIRM_RECEIPT' && |
3865 | selectedSubOrders[i].orderStatus !== | 3909 | selectedSubOrders[i].orderStatus !== |
3866 | - 'AFTER_SALES_FAILURE' | 3910 | + 'AFTER_SALES_FAILURE' && |
3911 | + selectedSubOrders[i].orderStatus !== | ||
3912 | + 'AFTER_SALES_COMPLETION' | ||
3867 | ) { | 3913 | ) { |
3868 | message.error('请选择确认收货状态的子订单进行售后'); | 3914 | message.error('请选择确认收货状态的子订单进行售后'); |
3869 | return; | 3915 | return; |
@@ -4807,7 +4853,7 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | @@ -4807,7 +4853,7 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | ||
4807 | subOrders={orderOptType === 'add' ? [] : buildSubOrders()} | 4853 | subOrders={orderOptType === 'add' ? [] : buildSubOrders()} |
4808 | onClose={(isSuccess: boolean) => { | 4854 | onClose={(isSuccess: boolean) => { |
4809 | setOrderDrawerVisible(false); | 4855 | setOrderDrawerVisible(false); |
4810 | - clearOptObject(); | 4856 | + // clearOptObject(); |
4811 | if (isSuccess) { | 4857 | if (isSuccess) { |
4812 | refreshTable(); | 4858 | refreshTable(); |
4813 | } | 4859 | } |
@@ -4844,6 +4890,34 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | @@ -4844,6 +4890,34 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | ||
4844 | /> | 4890 | /> |
4845 | )} | 4891 | )} |
4846 | 4892 | ||
4893 | + {storeCheckModalVisible && ( | ||
4894 | + <StoreCheckModal | ||
4895 | + setCheckVisible={(val: boolean) => { | ||
4896 | + setStoreCheckModalVisible(val); | ||
4897 | + if (!val) { | ||
4898 | + clearOptObject(); | ||
4899 | + } | ||
4900 | + }} | ||
4901 | + data={isMainOrder ? getFirstMainOrder() : buildMainOrder()} | ||
4902 | + subOrders={ | ||
4903 | + isMainOrder | ||
4904 | + ? [...subOrderSelectedMap.values()].flat() | ||
4905 | + : buildSubOrders() | ||
4906 | + } | ||
4907 | + orderCheckType={orderCheckType} | ||
4908 | + openOrderDrawer={(type: any, id: any) => { | ||
4909 | + setCurrentMainId(id); | ||
4910 | + setOrderOptType(type); | ||
4911 | + setOrderDrawerVisible(true); | ||
4912 | + }} | ||
4913 | + onClose={() => { | ||
4914 | + clearOptObject(); | ||
4915 | + setStoreCheckModalVisible(false); | ||
4916 | + refreshTable(); | ||
4917 | + }} | ||
4918 | + /> | ||
4919 | + )} | ||
4920 | + | ||
4847 | {applyForInvoicingVisible && ( | 4921 | {applyForInvoicingVisible && ( |
4848 | <ApplyForInvoicingModal | 4922 | <ApplyForInvoicingModal |
4849 | setCheckVisible={(val: boolean) => { | 4923 | setCheckVisible={(val: boolean) => { |
src/pages/Order/FeedBack/StoreCheckModal.tsx
0 → 100644
1 | +import { RESPONSE_CODE } from '@/constants/enum'; | ||
2 | +import { | ||
3 | + postPrepaidAudit, | ||
4 | + postServiceOrderAfterSalesStoreSure, | ||
5 | + postServiceOrderAudit, | ||
6 | + postServiceOrderFileProcess, | ||
7 | + postServiceOrderFinanceCheckOrder, | ||
8 | + postServiceOrderLeaderAudit, | ||
9 | + postServiceOrderToProcureAudit, | ||
10 | +} from '@/services'; | ||
11 | +import { | ||
12 | + ModalForm, | ||
13 | + ProFormText, | ||
14 | + ProFormTextArea, | ||
15 | + ProList, | ||
16 | +} from '@ant-design/pro-components'; | ||
17 | +import { | ||
18 | + Button, | ||
19 | + Col, | ||
20 | + Divider, | ||
21 | + Form, | ||
22 | + Image, | ||
23 | + Modal, | ||
24 | + Row, | ||
25 | + Space, | ||
26 | + Tag, | ||
27 | + UploadFile, | ||
28 | + message, | ||
29 | +} from 'antd'; | ||
30 | +import Upload, { RcFile, UploadProps } from 'antd/es/upload'; | ||
31 | +import { useEffect, useRef, useState } from 'react'; | ||
32 | +import { | ||
33 | + AFTE_SALES_PLAN_OPTIONS, | ||
34 | + CHECK_TYPE, | ||
35 | + COMFIR_RECEIPT_IMAGES_NUMBER, | ||
36 | +} from './constant'; | ||
37 | +// import { cloneDeep } from 'lodash'; | ||
38 | +import InvoiceSubOrderInfoTable from '@/pages/Order/Order/components/InvoiceSubOrderInfoTable'; | ||
39 | +import { enumValueToLabel, transImageFile } from '@/utils'; | ||
40 | +import { PlusOutlined } from '@ant-design/icons'; | ||
41 | +import { cloneDeep } from 'lodash'; | ||
42 | + | ||
43 | +export default ({ | ||
44 | + setCheckVisible, | ||
45 | + data, | ||
46 | + subOrders, | ||
47 | + orderCheckType, | ||
48 | + openOrderDrawer, | ||
49 | + onClose, | ||
50 | +}) => { | ||
51 | + const [previewOpen, setPreviewOpen] = useState(false); | ||
52 | + const [aPopoverTitle, setAPopoverTitle] = useState('审核'); | ||
53 | + const [previewImage, setPreviewImage] = useState(''); | ||
54 | + const [previewTitle, setPreviewTitle] = useState(''); | ||
55 | + const [paymentReceiptsImages, setPymentReceiptsImages] = useState<any[]>([]); | ||
56 | + const fileListObj = useRef<UploadFile[]>([]); //使用引用类型,使得在useEffect里面设置监听事件后,不用更新监听事件也能保持obj与外界一致 | ||
57 | + const getBase64 = (file: RcFile): Promise<string> => | ||
58 | + new Promise((resolve, reject) => { | ||
59 | + const reader = new FileReader(); | ||
60 | + reader.readAsDataURL(file); | ||
61 | + reader.onload = () => resolve(reader.result as string); | ||
62 | + reader.onerror = (error) => reject(error); | ||
63 | + }); | ||
64 | + const [fileList, setFileList] = useState<UploadFile[]>([]); | ||
65 | + const handleCancel = () => setPreviewOpen(false); | ||
66 | + const [messageApi, contextHolder] = message.useMessage(); | ||
67 | + const [form] = Form.useForm<{ name: string; company: string }>(); | ||
68 | + let subOrderIds: any[] = subOrders?.map((subOrder) => subOrder.id); | ||
69 | + const [mainOrderId] = useState(data?.id || null); | ||
70 | + | ||
71 | + const [afterSalesInfo, setAfterSalesInfo] = useState<any>(); | ||
72 | + const [prepaidProofImages, setPrepaidProofImages] = useState<any[]>([]); | ||
73 | + /** | ||
74 | + * 审核类型 | ||
75 | + */ | ||
76 | + function checkType(check: string) { | ||
77 | + if (orderCheckType === check) { | ||
78 | + return true; | ||
79 | + } | ||
80 | + return false; | ||
81 | + } | ||
82 | + | ||
83 | + const getOrderAfterSalesInfo = async () => { | ||
84 | + // let res = await postServiceOrderQueryAfterSalesInfoSnapshot({ | ||
85 | + // data: { subOrderIds: subOrderIds }, | ||
86 | + // }); | ||
87 | + | ||
88 | + //附件 | ||
89 | + let annex = subOrders[0].afterSalesAnnexList; | ||
90 | + let index = 1; | ||
91 | + let annexLinks = annex?.map((f) => { | ||
92 | + return ( | ||
93 | + <Button | ||
94 | + className="p-0 pr-1" | ||
95 | + type="link" | ||
96 | + key="key" | ||
97 | + href={f} | ||
98 | + onClick={console.log(data)} | ||
99 | + > | ||
100 | + {'附件' + index++} | ||
101 | + </Button> | ||
102 | + ); | ||
103 | + }); | ||
104 | + | ||
105 | + setAfterSalesInfo( | ||
106 | + <div className="my-5"> | ||
107 | + <Row gutter={[16, 24]}> | ||
108 | + <Col span={6}> | ||
109 | + <span className="text-[#333333]">售后方案</span> | ||
110 | + </Col> | ||
111 | + <Col span={18}> | ||
112 | + {enumValueToLabel( | ||
113 | + subOrders[0]?.afterSalesPlan, | ||
114 | + AFTE_SALES_PLAN_OPTIONS, | ||
115 | + )} | ||
116 | + </Col> | ||
117 | + <Col span={6}> | ||
118 | + <span className="className='text-[#333333]'">售后原因</span> | ||
119 | + </Col> | ||
120 | + <Col span={18}>{subOrders[0]?.afterSalesNotes}</Col> | ||
121 | + <Col span={6}> | ||
122 | + <span className="className='text-[#333333]'">附件</span> | ||
123 | + </Col> | ||
124 | + <Col span={18}>{annexLinks}</Col> | ||
125 | + </Row> | ||
126 | + </div>, | ||
127 | + ); | ||
128 | + }; | ||
129 | + | ||
130 | + useEffect(() => { | ||
131 | + if (checkType(CHECK_TYPE.CONFIRM_DELIVER)) { | ||
132 | + setAPopoverTitle('确认发货'); | ||
133 | + } | ||
134 | + getOrderAfterSalesInfo(); | ||
135 | + | ||
136 | + let paymentReceiptsImagesList: any[] = []; | ||
137 | + subOrders?.forEach((item: any) => { | ||
138 | + if (item.paymentReceiptAnnexList) { | ||
139 | + paymentReceiptsImagesList.push(...item.paymentReceiptAnnexList); | ||
140 | + } | ||
141 | + }); | ||
142 | + //去重 | ||
143 | + paymentReceiptsImagesList = [...new Set(paymentReceiptsImagesList)]; | ||
144 | + setPymentReceiptsImages(paymentReceiptsImagesList); | ||
145 | + | ||
146 | + //预存审核的凭证 | ||
147 | + let proofImages: any[] = []; | ||
148 | + subOrders?.forEach((item) => { | ||
149 | + let images = item.proofImages; | ||
150 | + if (images !== null && images !== undefined) { | ||
151 | + proofImages.push(...images); | ||
152 | + } | ||
153 | + }); | ||
154 | + setPrepaidProofImages(proofImages); | ||
155 | + }, []); | ||
156 | + | ||
157 | + const handleChange: UploadProps['onChange'] = ({ fileList: newFileList }) => { | ||
158 | + //fileListObj得在change里变化,change的参数是已经处理过的file数组 | ||
159 | + //beforeUpload中的参数file是未处理过,还需要Base64拿到文件数据处理 | ||
160 | + fileListObj.current = newFileList; | ||
161 | + setFileList(newFileList); | ||
162 | + }; | ||
163 | + | ||
164 | + /** 粘贴快捷键的回调 */ | ||
165 | + const onPaste = async (e: any) => { | ||
166 | + /** 获取剪切板的数据clipboardData */ | ||
167 | + let clipboardData = e.clipboardData, | ||
168 | + i = 0, | ||
169 | + items, | ||
170 | + item, | ||
171 | + types; | ||
172 | + | ||
173 | + /** 为空判断 */ | ||
174 | + if (clipboardData) { | ||
175 | + items = clipboardData.items; | ||
176 | + if (!items) { | ||
177 | + message.info('您的剪贴板中没有照片'); | ||
178 | + return; | ||
179 | + } | ||
180 | + | ||
181 | + item = items[0]; | ||
182 | + types = clipboardData.types || []; | ||
183 | + /** 遍历剪切板的数据 */ | ||
184 | + for (; i < types.length; i++) { | ||
185 | + if (types[i] === 'Files') { | ||
186 | + item = items[i]; | ||
187 | + break; | ||
188 | + } | ||
189 | + } | ||
190 | + | ||
191 | + /** 判断文件是否为图片 */ | ||
192 | + if (item && item.kind === 'file' && item.type.match(/^image\//i)) { | ||
193 | + const imgItem = item.getAsFile(); | ||
194 | + const newFileList = cloneDeep(fileListObj.current); | ||
195 | + let filteredArray = newFileList.filter( | ||
196 | + (obj) => obj.status !== 'removed', | ||
197 | + ); //过滤掉状态为已删除的照片 | ||
198 | + const listItem = { | ||
199 | + ...imgItem, | ||
200 | + status: 'done', | ||
201 | + url: await getBase64(imgItem), | ||
202 | + originFileObj: imgItem, | ||
203 | + }; | ||
204 | + | ||
205 | + if (filteredArray.length >= COMFIR_RECEIPT_IMAGES_NUMBER) { | ||
206 | + message.info('发货照片数量不能超过3'); | ||
207 | + return; | ||
208 | + } | ||
209 | + fileListObj.current = filteredArray; | ||
210 | + filteredArray.push(listItem); | ||
211 | + setFileList(filteredArray); | ||
212 | + return; | ||
213 | + } | ||
214 | + } | ||
215 | + | ||
216 | + message.info('您的剪贴板中没有照片'); | ||
217 | + }; | ||
218 | + useEffect(() => { | ||
219 | + //回显售后信息 | ||
220 | + // if (checkType(CHECK_TYPE.AFTER_SALES)) { | ||
221 | + // getOrderAfterSalesInfo(); | ||
222 | + // } | ||
223 | + | ||
224 | + document.addEventListener('paste', onPaste); | ||
225 | + return () => { | ||
226 | + document.removeEventListener('paste', onPaste); | ||
227 | + }; | ||
228 | + }, []); | ||
229 | + const uploadButton = ( | ||
230 | + <div> | ||
231 | + <PlusOutlined /> | ||
232 | + <div style={{ marginTop: 8 }}>上传凭证</div> | ||
233 | + </div> | ||
234 | + ); | ||
235 | + const handlePreview = async (file: UploadFile) => { | ||
236 | + if (!file.url && !file.preview) { | ||
237 | + file.preview = await getBase64(file.originFileObj as RcFile); | ||
238 | + } | ||
239 | + setPreviewImage(file.url || (file.preview as string)); | ||
240 | + setPreviewOpen(true); | ||
241 | + setPreviewTitle( | ||
242 | + file.name || | ||
243 | + file.originFileObj?.name || | ||
244 | + file.url!.substring(file.url!.lastIndexOf('/') + 1), | ||
245 | + ); | ||
246 | + }; | ||
247 | + | ||
248 | + const handleBeforeUpload = (file: any) => { | ||
249 | + setFileList([...fileList, file]); | ||
250 | + return false; | ||
251 | + }; | ||
252 | + | ||
253 | + const props: UploadProps = { | ||
254 | + onRemove: (file) => { | ||
255 | + const index = fileList.indexOf(file); | ||
256 | + const newFileList = fileList.slice(); | ||
257 | + newFileList.splice(index, 1); | ||
258 | + setFileList(newFileList); | ||
259 | + }, | ||
260 | + beforeUpload: handleBeforeUpload, | ||
261 | + listType: 'picture-card', | ||
262 | + onPreview: handlePreview, | ||
263 | + fileList, | ||
264 | + onChange: handleChange, | ||
265 | + accept: 'image/png, image/jpeg, image/png', | ||
266 | + // action: '/api/service/order/fileProcess', | ||
267 | + name: 'files', | ||
268 | + headers: { Authorization: localStorage.getItem('token') }, | ||
269 | + }; | ||
270 | + | ||
271 | + //仓库审核 | ||
272 | + async function doCheck(body: object) { | ||
273 | + const data = await postServiceOrderAudit({ | ||
274 | + data: body, | ||
275 | + }); | ||
276 | + if (data.result === RESPONSE_CODE.SUCCESS) { | ||
277 | + message.success(data.message); | ||
278 | + onClose(); | ||
279 | + } | ||
280 | + } | ||
281 | + | ||
282 | + /** | ||
283 | + * | ||
284 | + * @param body 财务审核 | ||
285 | + */ | ||
286 | + async function doFinancailCheck(values: any, isAgree: boolean) { | ||
287 | + if (fileList.length <= 0) { | ||
288 | + message.error('凭证不能为空'); | ||
289 | + return; | ||
290 | + } | ||
291 | + messageApi.open({ | ||
292 | + type: 'loading', | ||
293 | + content: '正在上传图片...', | ||
294 | + duration: 0, | ||
295 | + }); | ||
296 | + //附件处理 | ||
297 | + let formData = new FormData(); | ||
298 | + //附件处理 | ||
299 | + for (let file of fileList) { | ||
300 | + if (file.originFileObj) { | ||
301 | + formData.append('files', file.originFileObj as RcFile); | ||
302 | + } else { | ||
303 | + //有url的话取url(源文件),没url取thumbUrl。有url的时候thumbUrl是略缩图 | ||
304 | + if (file?.url === undefined || file?.url === null) { | ||
305 | + formData.append( | ||
306 | + 'files', | ||
307 | + transImageFile(file?.thumbUrl), | ||
308 | + file?.originFileObj?.name, | ||
309 | + ); | ||
310 | + } else { | ||
311 | + formData.append( | ||
312 | + 'files', | ||
313 | + transImageFile(file?.url), | ||
314 | + file?.originFileObj?.name, | ||
315 | + ); | ||
316 | + } | ||
317 | + } | ||
318 | + } | ||
319 | + let res = await postServiceOrderFileProcess({ | ||
320 | + data: formData, | ||
321 | + }); | ||
322 | + messageApi.destroy(); | ||
323 | + if (res.result === RESPONSE_CODE.SUCCESS) { | ||
324 | + message.success('上传成功!'); | ||
325 | + | ||
326 | + let fileUrls = res?.data?.map((item) => { | ||
327 | + return { url: item }; | ||
328 | + }); | ||
329 | + //财务审核 | ||
330 | + const data = await postServiceOrderFinanceCheckOrder({ | ||
331 | + data: { | ||
332 | + ...values, | ||
333 | + checkNotes: values.name, | ||
334 | + ids: subOrderIds, | ||
335 | + checkPassOrReject: isAgree, | ||
336 | + invoicingCheckAnnex: fileUrls, | ||
337 | + }, | ||
338 | + }); | ||
339 | + if (data.result === RESPONSE_CODE.SUCCESS) { | ||
340 | + message.success(data.message); | ||
341 | + onClose(); | ||
342 | + } | ||
343 | + } else { | ||
344 | + message.success('上传失败'); | ||
345 | + } | ||
346 | + } | ||
347 | + | ||
348 | + /** | ||
349 | + * | ||
350 | + * @param body 售后审核 | ||
351 | + */ | ||
352 | + async function doAfterSalesCheck(body: object) { | ||
353 | + const data = await postServiceOrderAfterSalesStoreSure({ | ||
354 | + data: body, | ||
355 | + }); | ||
356 | + if (data.result === RESPONSE_CODE.SUCCESS) { | ||
357 | + message.success(data.message); | ||
358 | + onClose(); | ||
359 | + } | ||
360 | + } | ||
361 | + | ||
362 | + /** | ||
363 | + * | ||
364 | + * @param body 领导审核 | ||
365 | + */ | ||
366 | + async function doLeaderCheck(body: object) { | ||
367 | + const data = await postServiceOrderLeaderAudit({ | ||
368 | + data: body, | ||
369 | + }); | ||
370 | + if (data.result === RESPONSE_CODE.SUCCESS) { | ||
371 | + message.success(data.message); | ||
372 | + onClose(); | ||
373 | + } | ||
374 | + } | ||
375 | + | ||
376 | + /** | ||
377 | + * 预存审核 | ||
378 | + * @param body | ||
379 | + */ | ||
380 | + async function doPrepaidAudit(body: any) { | ||
381 | + const data = await postPrepaidAudit({ | ||
382 | + data: body, | ||
383 | + }); | ||
384 | + if (data.result === RESPONSE_CODE.SUCCESS) { | ||
385 | + message.success(data.message); | ||
386 | + onClose(); | ||
387 | + } | ||
388 | + } | ||
389 | + | ||
390 | + function computeType() { | ||
391 | + let type: string = ''; | ||
392 | + if (checkType(CHECK_TYPE.CONFIRM_DELIVER)) { | ||
393 | + type = 'confirm_deliver'; | ||
394 | + } | ||
395 | + if (checkType(CHECK_TYPE.WEARHOUSE_KEEPER)) { | ||
396 | + type = 'warehouse_audit'; | ||
397 | + } | ||
398 | + if (checkType(CHECK_TYPE.WAITING_FOR_POST_AUDIT)) { | ||
399 | + type = 'post_audit'; | ||
400 | + } | ||
401 | + if (checkType(CHECK_TYPE.NODE_OPERATING_AUDIT)) { | ||
402 | + type = 'node_operating_audit'; | ||
403 | + } | ||
404 | + if (checkType(CHECK_TYPE.MODIFY_LEADER_AUDIT)) { | ||
405 | + type = 'modify_leader_audit'; | ||
406 | + } | ||
407 | + if (checkType(CHECK_TYPE.URGENT_INVOICE_AUDITING)) { | ||
408 | + type = 'urgent_invoice_audit'; | ||
409 | + } | ||
410 | + if (checkType(CHECK_TYPE.PAYMENT_RECEIPTS_AUDIT)) { | ||
411 | + type = 'payment_receipt_audit'; | ||
412 | + } | ||
413 | + if (checkType(CHECK_TYPE.CONFIRM_REISSUE)) { | ||
414 | + type = 'confirm_reissue'; | ||
415 | + } | ||
416 | + if (checkType(CHECK_TYPE.CREDIT_AUDIT)) { | ||
417 | + type = 'credit_audit'; | ||
418 | + } | ||
419 | + if (checkType(CHECK_TYPE.URGENT_INVOICE_AUDITING_OLD)) { | ||
420 | + type = 'urgent_invoice_audit_old'; | ||
421 | + } | ||
422 | + if (checkType(CHECK_TYPE.CONFIRM_REISSUE_OLD)) { | ||
423 | + type = 'confirm_reissue_old'; | ||
424 | + } | ||
425 | + return type; | ||
426 | + } | ||
427 | + | ||
428 | + return ( | ||
429 | + <> | ||
430 | + <ModalForm<{ | ||
431 | + name: string; | ||
432 | + company: string; | ||
433 | + }> | ||
434 | + width={500} | ||
435 | + open | ||
436 | + title={aPopoverTitle} | ||
437 | + form={form} | ||
438 | + autoFocusFirstInput | ||
439 | + modalProps={{ | ||
440 | + okText: '通过', | ||
441 | + cancelText: '取消', | ||
442 | + destroyOnClose: true, | ||
443 | + onCancel: () => { | ||
444 | + setCheckVisible(false); | ||
445 | + }, | ||
446 | + }} | ||
447 | + submitter={{ | ||
448 | + render: () => { | ||
449 | + let myDoms = []; | ||
450 | + if (!checkType(CHECK_TYPE.CONFIRM_DELIVER)) { | ||
451 | + myDoms | ||
452 | + .push | ||
453 | + // <Button | ||
454 | + // key="驳回" | ||
455 | + // onClick={async () => { | ||
456 | + // if (checkType(CHECK_TYPE.AFTER_SALES)) { | ||
457 | + // doAfterSalesCheck({ | ||
458 | + // applyType: 'after-sales', | ||
459 | + // isAfterSalesSuccess: false, | ||
460 | + // subOrderIds: subOrderIds, | ||
461 | + // mainId: mainOrderId, | ||
462 | + // afterSalesRejectionNotes: form.getFieldValue('name'), | ||
463 | + // }); | ||
464 | + // return; | ||
465 | + // } | ||
466 | + | ||
467 | + // if (checkType(CHECK_TYPE.FINALCIAL)) { | ||
468 | + // let values = { name: form.getFieldValue('name') }; | ||
469 | + // doFinancailCheck(values, false); | ||
470 | + // return; | ||
471 | + // } | ||
472 | + | ||
473 | + // if (checkType(CHECK_TYPE.LEADER_AUDIT)) { | ||
474 | + // doLeaderCheck({ | ||
475 | + // pass: false, | ||
476 | + // subOrderIds: subOrderIds, | ||
477 | + // reason: form.getFieldValue('name'), | ||
478 | + // }); | ||
479 | + // return; | ||
480 | + // } | ||
481 | + | ||
482 | + // if (checkType(CHECK_TYPE.MODIFY_APPLY_WAIT_FOR_AUDIT)) { | ||
483 | + // doAfterSalesCheck({ | ||
484 | + // applyType: 'order-change-normal', | ||
485 | + // isAfterSalesSuccess: false, | ||
486 | + // subOrderIds: subOrderIds, | ||
487 | + // mainId: mainOrderId, | ||
488 | + // afterSalesRejectionNotes: form.getFieldValue('name'), | ||
489 | + // }); | ||
490 | + // return; | ||
491 | + // } | ||
492 | + | ||
493 | + // //预存审核,先暂时共用同一个审核弹窗 | ||
494 | + // if (checkType(CHECK_TYPE.PREPAID_AUDIT)) { | ||
495 | + // return doPrepaidAudit({ | ||
496 | + // pass: false, | ||
497 | + // ids: subOrderIds, | ||
498 | + // auditNotes: form.getFieldValue('name'), | ||
499 | + // }); | ||
500 | + // } | ||
501 | + | ||
502 | + // let type = ''; | ||
503 | + // type = computeType(); | ||
504 | + // console.log('type:' + type); | ||
505 | + // doCheck({ | ||
506 | + // pass: false, | ||
507 | + // subOrderIds: subOrderIds, | ||
508 | + // type: type, | ||
509 | + // notes: form.getFieldValue('name'), | ||
510 | + // }); | ||
511 | + // }} | ||
512 | + // > | ||
513 | + // 驳回 | ||
514 | + // </Button>, | ||
515 | + (); | ||
516 | + } | ||
517 | + | ||
518 | + //如果是仓库审核,那么显示这个外部采购 | ||
519 | + if (checkType(CHECK_TYPE.WEARHOUSE_KEEPER)) { | ||
520 | + myDoms.push( | ||
521 | + <Button | ||
522 | + key="外部采购" | ||
523 | + onClick={async () => { | ||
524 | + let res = await postServiceOrderToProcureAudit({ | ||
525 | + data: { | ||
526 | + subOrderIds: subOrderIds, | ||
527 | + }, | ||
528 | + }); | ||
529 | + | ||
530 | + if (res && res.result === RESPONSE_CODE.SUCCESS) { | ||
531 | + message.success(res.message); | ||
532 | + onClose(); | ||
533 | + } | ||
534 | + }} | ||
535 | + > | ||
536 | + 外部采购 | ||
537 | + </Button>, | ||
538 | + ); | ||
539 | + } | ||
540 | + | ||
541 | + //确认 | ||
542 | + // myDoms.push(defaultDoms[1]); | ||
543 | + return myDoms; | ||
544 | + }, | ||
545 | + }} | ||
546 | + submitTimeout={2000} | ||
547 | + onFinish={async (values) => { | ||
548 | + if (checkType(CHECK_TYPE.AFTER_SALES)) { | ||
549 | + //审核通过 | ||
550 | + return doAfterSalesCheck({ | ||
551 | + applyType: 'after-sales', | ||
552 | + isAfterSalesSuccess: true, | ||
553 | + subOrderIds: subOrderIds, | ||
554 | + mainId: mainOrderId, | ||
555 | + afterSalesRejectionNotes: values.name, | ||
556 | + afterSalesStoreNotes: values.sure, | ||
557 | + }); | ||
558 | + } | ||
559 | + console.log('h'); | ||
560 | + if (checkType(CHECK_TYPE.FINALCIAL)) { | ||
561 | + doFinancailCheck(values, true); | ||
562 | + return; | ||
563 | + } | ||
564 | + | ||
565 | + if (checkType(CHECK_TYPE.LEADER_AUDIT)) { | ||
566 | + doLeaderCheck({ | ||
567 | + pass: true, | ||
568 | + subOrderIds: subOrderIds, | ||
569 | + reason: values.name, | ||
570 | + }); | ||
571 | + return; | ||
572 | + } | ||
573 | + | ||
574 | + if (checkType(CHECK_TYPE.MODIFY_APPLY_WAIT_FOR_AUDIT)) { | ||
575 | + //审核通过 | ||
576 | + return doAfterSalesCheck({ | ||
577 | + applyType: 'order-change-normal', | ||
578 | + isAfterSalesSuccess: true, | ||
579 | + subOrderIds: subOrderIds, | ||
580 | + mainId: mainOrderId, | ||
581 | + afterSalesRejectionNotes: values.name, | ||
582 | + afterSalesStoreNotes: values.sure, | ||
583 | + }); | ||
584 | + } | ||
585 | + | ||
586 | + //预存审核,先暂时共用同一个审核弹窗 | ||
587 | + if (checkType(CHECK_TYPE.PREPAID_AUDIT)) { | ||
588 | + return doPrepaidAudit({ | ||
589 | + pass: true, | ||
590 | + ids: subOrderIds, | ||
591 | + auditNotes: form.getFieldValue('name'), | ||
592 | + }); | ||
593 | + } | ||
594 | + | ||
595 | + let type = ''; | ||
596 | + type = computeType(); | ||
597 | + doCheck({ | ||
598 | + ...values, | ||
599 | + pass: true, | ||
600 | + subOrderIds: subOrderIds, | ||
601 | + type: type, | ||
602 | + notes: form.getFieldValue('name'), | ||
603 | + }); | ||
604 | + }} | ||
605 | + onOpenChange={setCheckVisible} | ||
606 | + > | ||
607 | + {checkType(CHECK_TYPE.AFTER_SALES) ? ( | ||
608 | + <> | ||
609 | + {afterSalesInfo} | ||
610 | + <Button | ||
611 | + className="px-0" | ||
612 | + type="link" | ||
613 | + onClick={() => { | ||
614 | + console.log(data); | ||
615 | + openOrderDrawer('after-sales-check', mainOrderId); | ||
616 | + }} | ||
617 | + > | ||
618 | + 查看旧订单 | ||
619 | + </Button> | ||
620 | + </> | ||
621 | + ) : ( | ||
622 | + '' | ||
623 | + )} | ||
624 | + {checkType(CHECK_TYPE.PAYMENT_RECEIPTS_AUDIT) ? ( | ||
625 | + <> | ||
626 | + <Divider orientation="center"> | ||
627 | + <span className="text-sm">回款凭证</span> | ||
628 | + </Divider> | ||
629 | + <Image.PreviewGroup | ||
630 | + className="mr-10" | ||
631 | + preview={{ | ||
632 | + onChange: (current, prev) => | ||
633 | + console.log(`current index: ${current}, prev index: ${prev}`), | ||
634 | + }} | ||
635 | + > | ||
636 | + {paymentReceiptsImages.map((url) => ( | ||
637 | + <> | ||
638 | + <Image width={120} src={url} /> <Divider type="vertical" /> | ||
639 | + </> | ||
640 | + ))} | ||
641 | + </Image.PreviewGroup> | ||
642 | + <Divider></Divider> | ||
643 | + </> | ||
644 | + ) : ( | ||
645 | + '' | ||
646 | + )} | ||
647 | + | ||
648 | + {checkType(CHECK_TYPE.PREPAID_AUDIT) && ( | ||
649 | + <> | ||
650 | + <Divider orientation="center"> | ||
651 | + <span className="text-sm">凭证</span> | ||
652 | + </Divider> | ||
653 | + <Image.PreviewGroup | ||
654 | + className="mr-10" | ||
655 | + preview={{ | ||
656 | + onChange: (current, prev) => | ||
657 | + console.log(`current index: ${current}, prev index: ${prev}`), | ||
658 | + }} | ||
659 | + > | ||
660 | + {prepaidProofImages.map((url) => ( | ||
661 | + <> | ||
662 | + <Image width={120} src={url} /> <Divider type="vertical" /> | ||
663 | + </> | ||
664 | + ))} | ||
665 | + </Image.PreviewGroup> | ||
666 | + <Divider></Divider> | ||
667 | + </> | ||
668 | + )} | ||
669 | + | ||
670 | + {/* {checkType('prepaidAudit') ? ( | ||
671 | + <div>请特别注意手机号码和充值金额。</div> | ||
672 | + ) : ( | ||
673 | + <div>请特别注意订单总金额与订单金额。</div> | ||
674 | + )} */} | ||
675 | + {!checkType(CHECK_TYPE.CONFIRM_DELIVER) ? ( | ||
676 | + <ProFormTextArea | ||
677 | + width="lg" | ||
678 | + name="name" | ||
679 | + readonly | ||
680 | + initialValue={subOrders?.find((order) => order.notes)?.notes || ''} | ||
681 | + // placeholder="若驳回,请填写驳回理由" | ||
682 | + /> | ||
683 | + ) : ( | ||
684 | + <></> | ||
685 | + )} | ||
686 | + | ||
687 | + <ProFormTextArea | ||
688 | + width="lg" | ||
689 | + name="sure" | ||
690 | + label="确认原因 :" | ||
691 | + rules={[ | ||
692 | + { | ||
693 | + required: true, | ||
694 | + message: '请输入确认原因!', | ||
695 | + }, | ||
696 | + ]} | ||
697 | + // placeholder="若驳回,请填写驳回理由" | ||
698 | + /> | ||
699 | + | ||
700 | + {checkType(CHECK_TYPE.FINALCIAL) ? ( | ||
701 | + <> | ||
702 | + <ProFormText | ||
703 | + width="md" | ||
704 | + name="bankStatementSerialNumbersText" | ||
705 | + label="流水号" | ||
706 | + rules={[ | ||
707 | + { | ||
708 | + required: true, | ||
709 | + message: '请输入流水号!', | ||
710 | + }, | ||
711 | + ]} | ||
712 | + placeholder={'多个流水号用逗号隔开'} | ||
713 | + /> | ||
714 | + <div className="pb-4 text-xs decoration-gray-50"> | ||
715 | + 可复制照片粘贴 | ||
716 | + </div> | ||
717 | + <Upload {...props}> | ||
718 | + {fileList.length < COMFIR_RECEIPT_IMAGES_NUMBER | ||
719 | + ? uploadButton | ||
720 | + : ''} | ||
721 | + </Upload> | ||
722 | + </> | ||
723 | + ) : ( | ||
724 | + '' | ||
725 | + )} | ||
726 | + {checkType(CHECK_TYPE.CONFIRM_REISSUE) && ( | ||
727 | + <> | ||
728 | + <InvoiceSubOrderInfoTable | ||
729 | + subOrderIds={subOrderIds} | ||
730 | + ></InvoiceSubOrderInfoTable> | ||
731 | + </> | ||
732 | + )} | ||
733 | + {checkType(CHECK_TYPE.URGENT_INVOICE_AUDITING) ? ( | ||
734 | + <> | ||
735 | + <ProList | ||
736 | + rowKey="id" | ||
737 | + headerTitle="发票信息" | ||
738 | + metas={{ | ||
739 | + title: { | ||
740 | + dataIndex: 'name', | ||
741 | + }, | ||
742 | + avatar: { | ||
743 | + dataIndex: 'image', | ||
744 | + editable: false, | ||
745 | + }, | ||
746 | + description: { | ||
747 | + dataIndex: 'desc', | ||
748 | + }, | ||
749 | + subTitle: { | ||
750 | + render: () => { | ||
751 | + return ( | ||
752 | + <Space size={0}> | ||
753 | + <Tag color="blue">Ant Design</Tag> | ||
754 | + <Tag color="#5BD8A6">TechUI</Tag> | ||
755 | + </Space> | ||
756 | + ); | ||
757 | + }, | ||
758 | + }, | ||
759 | + actions: { | ||
760 | + render: (text, row, index, action) => [ | ||
761 | + <a | ||
762 | + onClick={() => { | ||
763 | + action?.startEditable(row.id); | ||
764 | + }} | ||
765 | + key="link" | ||
766 | + > | ||
767 | + 编辑 | ||
768 | + </a>, | ||
769 | + ], | ||
770 | + }, | ||
771 | + }} | ||
772 | + ></ProList> | ||
773 | + </> | ||
774 | + ) : ( | ||
775 | + '' | ||
776 | + )} | ||
777 | + | ||
778 | + <Form.Item> | ||
779 | + <Button type="primary" htmlType="submit"> | ||
780 | + 确认 | ||
781 | + </Button> | ||
782 | + </Form.Item> | ||
783 | + </ModalForm> | ||
784 | + | ||
785 | + <Modal | ||
786 | + open={previewOpen} | ||
787 | + title={previewTitle} | ||
788 | + footer={null} | ||
789 | + onCancel={handleCancel} | ||
790 | + > | ||
791 | + <img alt="图片预览" style={{ width: '100%' }} src={previewImage} /> | ||
792 | + </Modal> | ||
793 | + {contextHolder} | ||
794 | + </> | ||
795 | + ); | ||
796 | +}; |
src/pages/Order/FeedBack/constant.ts
@@ -181,6 +181,7 @@ export const ORDER_STATUS_OPTIONS = { | @@ -181,6 +181,7 @@ export const ORDER_STATUS_OPTIONS = { | ||
181 | WAIT_CONFIRM_DELIVER_AFTER_INVOICE: '待开票后确认发货', | 181 | WAIT_CONFIRM_DELIVER_AFTER_INVOICE: '待开票后确认发货', |
182 | SALES_CONFIRM: '销售待确认', | 182 | SALES_CONFIRM: '销售待确认', |
183 | UNAUDITED: '未审核', | 183 | UNAUDITED: '未审核', |
184 | + PROCURE_REJECT: '采购驳回至销售', | ||
184 | LEADER_PROCESS: '领导待审核', | 185 | LEADER_PROCESS: '领导待审核', |
185 | MODIFY_APPLY_WAIT_FOR_AUDIT: '修改待审核', | 186 | MODIFY_APPLY_WAIT_FOR_AUDIT: '修改待审核', |
186 | LEADER_AUDITED: '领导已审核', | 187 | LEADER_AUDITED: '领导已审核', |
@@ -265,6 +266,7 @@ export const TAGS_COLOR = new Map<string, string>([ | @@ -265,6 +266,7 @@ export const TAGS_COLOR = new Map<string, string>([ | ||
265 | ['COMMON_INVOICED', 'processing'], | 266 | ['COMMON_INVOICED', 'processing'], |
266 | ['AFTER_INVOICED', 'success'], | 267 | ['AFTER_INVOICED', 'success'], |
267 | ['UNAUDITED', 'warning'], | 268 | ['UNAUDITED', 'warning'], |
269 | + ['PROCURE_REJECT', 'warning'], | ||
268 | ['AUDITED', 'processing'], | 270 | ['AUDITED', 'processing'], |
269 | ['WAIT_SHIP', 'processing'], | 271 | ['WAIT_SHIP', 'processing'], |
270 | ['SHIPPED', 'processing'], | 272 | ['SHIPPED', 'processing'], |
src/pages/Order/Order/components/CheckModal.tsx
@@ -66,7 +66,7 @@ export default ({ | @@ -66,7 +66,7 @@ export default ({ | ||
66 | const [messageApi, contextHolder] = message.useMessage(); | 66 | const [messageApi, contextHolder] = message.useMessage(); |
67 | const [form] = Form.useForm<{ name: string; company: string }>(); | 67 | const [form] = Form.useForm<{ name: string; company: string }>(); |
68 | let subOrderIds: any[] = subOrders?.map((subOrder) => subOrder.id); | 68 | let subOrderIds: any[] = subOrders?.map((subOrder) => subOrder.id); |
69 | - const [mainOrderId] = useState(data.id); | 69 | + const [mainOrderId] = useState(data?.id || null); |
70 | 70 | ||
71 | const [afterSalesInfo, setAfterSalesInfo] = useState<any>(); | 71 | const [afterSalesInfo, setAfterSalesInfo] = useState<any>(); |
72 | const [prepaidProofImages, setPrepaidProofImages] = useState<any[]>([]); | 72 | const [prepaidProofImages, setPrepaidProofImages] = useState<any[]>([]); |
src/pages/Order/Order/components/OrderDrawer.tsx
@@ -1140,7 +1140,10 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | @@ -1140,7 +1140,10 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | ||
1140 | console.log(form.getFieldValue('id')); | 1140 | console.log(form.getFieldValue('id')); |
1141 | if (form.getFieldValue('id') !== undefined) { | 1141 | if (form.getFieldValue('id') !== undefined) { |
1142 | const resp = await postDistrictSelOrderProvince({ | 1142 | const resp = await postDistrictSelOrderProvince({ |
1143 | - data: form.getFieldValue('id'), | 1143 | + data: { |
1144 | + oId: form.getFieldValue('id'), | ||
1145 | + orderType: orderOptType, | ||
1146 | + }, | ||
1144 | }); | 1147 | }); |
1145 | if (resp && resp.data) { | 1148 | if (resp && resp.data) { |
1146 | if (resp.data.province) { | 1149 | if (resp.data.province) { |
@@ -1327,7 +1330,10 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | @@ -1327,7 +1330,10 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | ||
1327 | console.log(form.getFieldValue('id')); | 1330 | console.log(form.getFieldValue('id')); |
1328 | if (form.getFieldValue('id')) { | 1331 | if (form.getFieldValue('id')) { |
1329 | const resp = await postDistrictSelOrderProvince({ | 1332 | const resp = await postDistrictSelOrderProvince({ |
1330 | - data: form.getFieldValue('id'), | 1333 | + data: { |
1334 | + oId: form.getFieldValue('id'), | ||
1335 | + orderType: orderOptType, | ||
1336 | + }, | ||
1331 | }); | 1337 | }); |
1332 | if ( | 1338 | if ( |
1333 | resp.data.province !== null && | 1339 | resp.data.province !== null && |
@@ -1387,7 +1393,10 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | @@ -1387,7 +1393,10 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | ||
1387 | let districtOptions = []; | 1393 | let districtOptions = []; |
1388 | if (form.getFieldValue('id')) { | 1394 | if (form.getFieldValue('id')) { |
1389 | const resp = await postDistrictSelOrderProvince({ | 1395 | const resp = await postDistrictSelOrderProvince({ |
1390 | - data: form.getFieldValue('id'), | 1396 | + data: { |
1397 | + oId: form.getFieldValue('id'), | ||
1398 | + orderType: orderOptType, | ||
1399 | + }, | ||
1391 | }); | 1400 | }); |
1392 | if (resp.data.city !== null && resp.data.city !== undefined) { | 1401 | if (resp.data.city !== null && resp.data.city !== undefined) { |
1393 | let res = await postDistrictSelectByNameAndLevel({ | 1402 | let res = await postDistrictSelectByNameAndLevel({ |
src/pages/Order/Order/components/ProcureCheckModal.tsx
@@ -2,6 +2,7 @@ import { RESPONSE_CODE } from '@/constants/enum'; | @@ -2,6 +2,7 @@ import { RESPONSE_CODE } from '@/constants/enum'; | ||
2 | import { | 2 | import { |
3 | postServiceOrderProcureCheckOrder, | 3 | postServiceOrderProcureCheckOrder, |
4 | postServiceOrderProcureConvertWarehouseKeeper, | 4 | postServiceOrderProcureConvertWarehouseKeeper, |
5 | + postServiceOrderPurchaseRejectionToSale, | ||
5 | postServiceOrderQuerySupplier, | 6 | postServiceOrderQuerySupplier, |
6 | } from '@/services'; | 7 | } from '@/services'; |
7 | import { | 8 | import { |
@@ -13,7 +14,7 @@ import { Button, Form, Input, Popconfirm, message } from 'antd'; | @@ -13,7 +14,7 @@ import { Button, Form, Input, Popconfirm, message } from 'antd'; | ||
13 | import { useState } from 'react'; | 14 | import { useState } from 'react'; |
14 | export default ({ setCheckVisible, isMainOrder, orders, onClose }) => { | 15 | export default ({ setCheckVisible, isMainOrder, orders, onClose }) => { |
15 | const [form] = Form.useForm<{ supplier: string }>(); | 16 | const [form] = Form.useForm<{ supplier: string }>(); |
16 | - const [checkNotes, setCheckNotes] = useState<string>(''); | 17 | + const [procureNotes, setProcureNotes] = useState<string>(''); |
17 | 18 | ||
18 | console.log(isMainOrder); | 19 | console.log(isMainOrder); |
19 | 20 | ||
@@ -51,6 +52,38 @@ export default ({ setCheckVisible, isMainOrder, orders, onClose }) => { | @@ -51,6 +52,38 @@ export default ({ setCheckVisible, isMainOrder, orders, onClose }) => { | ||
51 | defaultDoms[0], | 52 | defaultDoms[0], |
52 | <> | 53 | <> |
53 | <Popconfirm | 54 | <Popconfirm |
55 | + title="是否驳回至销售" | ||
56 | + description={ | ||
57 | + <div> | ||
58 | + <Input.TextArea | ||
59 | + placeholder="请填写备注" | ||
60 | + onChange={(e: any) => { | ||
61 | + setProcureNotes(e.target.value); | ||
62 | + }} | ||
63 | + rows={4} | ||
64 | + ></Input.TextArea> | ||
65 | + </div> | ||
66 | + } | ||
67 | + onConfirm={async () => { | ||
68 | + let res = await postServiceOrderPurchaseRejectionToSale({ | ||
69 | + data: { | ||
70 | + subIds: ids, | ||
71 | + procureNotes: procureNotes, | ||
72 | + }, | ||
73 | + }); | ||
74 | + | ||
75 | + if (res?.result === RESPONSE_CODE.SUCCESS) { | ||
76 | + message.success(res.message); | ||
77 | + onClose(); | ||
78 | + return true; | ||
79 | + } | ||
80 | + }} | ||
81 | + okText="确定" | ||
82 | + cancelText="取消" | ||
83 | + > | ||
84 | + <Button type="primary">驳回至销售</Button> | ||
85 | + </Popconfirm> | ||
86 | + <Popconfirm | ||
54 | title="是否转回仓库" | 87 | title="是否转回仓库" |
55 | description={ | 88 | description={ |
56 | <div> | 89 | <div> |
@@ -60,7 +93,7 @@ export default ({ setCheckVisible, isMainOrder, orders, onClose }) => { | @@ -60,7 +93,7 @@ export default ({ setCheckVisible, isMainOrder, orders, onClose }) => { | ||
60 | <Input.TextArea | 93 | <Input.TextArea |
61 | placeholder="请填写备注" | 94 | placeholder="请填写备注" |
62 | onChange={(e: any) => { | 95 | onChange={(e: any) => { |
63 | - setCheckNotes(e.target.value); | 96 | + setProcureNotes(e.target.value); |
64 | }} | 97 | }} |
65 | rows={4} | 98 | rows={4} |
66 | ></Input.TextArea> | 99 | ></Input.TextArea> |
@@ -71,7 +104,7 @@ export default ({ setCheckVisible, isMainOrder, orders, onClose }) => { | @@ -71,7 +104,7 @@ export default ({ setCheckVisible, isMainOrder, orders, onClose }) => { | ||
71 | { | 104 | { |
72 | data: { | 105 | data: { |
73 | subIds: ids, | 106 | subIds: ids, |
74 | - checkNotes: checkNotes, | 107 | + procureNotes: procureNotes, |
75 | }, | 108 | }, |
76 | }, | 109 | }, |
77 | ); | 110 | ); |
src/pages/Order/Order/index copy.tsx
@@ -712,7 +712,11 @@ const OrderPage = () => { | @@ -712,7 +712,11 @@ const OrderPage = () => { | ||
712 | } | 712 | } |
713 | 713 | ||
714 | //如果是未审核或者领导已审核,付款状态为预付款则需要财务审核【财务待审核】,否则仓库审核【】 | 714 | //如果是未审核或者领导已审核,付款状态为预付款则需要财务审核【财务待审核】,否则仓库审核【】 |
715 | - if (orderStatus === 'UNAUDITED' || orderStatus === 'LEADER_AUDITED') { | 715 | + if ( |
716 | + orderStatus === 'UNAUDITED' || | ||
717 | + orderStatus === 'LEADER_AUDITED' || | ||
718 | + orderStatus === 'PROCURE_REJECT' | ||
719 | + ) { | ||
716 | if (paymentMethod === 'PAYMENT_IN_ADVANCE') { | 720 | if (paymentMethod === 'PAYMENT_IN_ADVANCE') { |
717 | orderStatusTagText = '财务待审核'; | 721 | orderStatusTagText = '财务待审核'; |
718 | } else { | 722 | } else { |
@@ -1999,7 +2003,7 @@ const OrderPage = () => { | @@ -1999,7 +2003,7 @@ const OrderPage = () => { | ||
1999 | onClick={() => { | 2003 | onClick={() => { |
2000 | createOptObject(optRecord.id, record.id); | 2004 | createOptObject(optRecord.id, record.id); |
2001 | setOrderDrawerVisible(true); | 2005 | setOrderDrawerVisible(true); |
2002 | - setOrderOptType('after_sales'); | 2006 | + setOrderOptType('after-sales'); |
2003 | }} | 2007 | }} |
2004 | > | 2008 | > |
2005 | 申请售后 | 2009 | 申请售后 |
@@ -3523,6 +3527,7 @@ const OrderPage = () => { | @@ -3523,6 +3527,7 @@ const OrderPage = () => { | ||
3523 | //是审核通过及之后的订单 | 3527 | //是审核通过及之后的订单 |
3524 | if ( | 3528 | if ( |
3525 | orderStatus !== 'UNAUDITED' && | 3529 | orderStatus !== 'UNAUDITED' && |
3530 | + orderStatus !== 'PROCURE_REJECT' && | ||
3526 | orderStatus !== 'AUDIT_FAILED' && | 3531 | orderStatus !== 'AUDIT_FAILED' && |
3527 | orderStatus !== 'LEADER_PROCESS' && | 3532 | orderStatus !== 'LEADER_PROCESS' && |
3528 | orderStatus !== 'SALES_CONFIRM' && | 3533 | orderStatus !== 'SALES_CONFIRM' && |
@@ -3538,6 +3543,7 @@ const OrderPage = () => { | @@ -3538,6 +3543,7 @@ const OrderPage = () => { | ||
3538 | if ( | 3543 | if ( |
3539 | roleCode !== 'admin' && | 3544 | roleCode !== 'admin' && |
3540 | (orderStatus === 'UNAUDITED' || | 3545 | (orderStatus === 'UNAUDITED' || |
3546 | + orderStatus === 'PROCURE_REJECT' || | ||
3541 | orderStatus === 'AUDIT_FAILED') | 3547 | orderStatus === 'AUDIT_FAILED') |
3542 | ) { | 3548 | ) { |
3543 | message.error('请选择已审核的订单进行编辑'); | 3549 | message.error('请选择已审核的订单进行编辑'); |
@@ -3591,6 +3597,7 @@ const OrderPage = () => { | @@ -3591,6 +3597,7 @@ const OrderPage = () => { | ||
3591 | let orderStatus = selectedSubOrders[i].orderStatus; | 3597 | let orderStatus = selectedSubOrders[i].orderStatus; |
3592 | if ( | 3598 | if ( |
3593 | orderStatus !== 'UNAUDITED' && | 3599 | orderStatus !== 'UNAUDITED' && |
3600 | + orderStatus !== 'PROCURE_REJECT' && | ||
3594 | orderStatus !== 'FINANCE_PROCESS' && | 3601 | orderStatus !== 'FINANCE_PROCESS' && |
3595 | orderStatus !== 'LEADER_AUDITED' | 3602 | orderStatus !== 'LEADER_AUDITED' |
3596 | ) { | 3603 | ) { |
@@ -3754,6 +3761,8 @@ const OrderPage = () => { | @@ -3754,6 +3761,8 @@ const OrderPage = () => { | ||
3754 | if ( | 3761 | if ( |
3755 | selectedSubOrders[i].orderStatus !== 'UNAUDITED' && | 3762 | selectedSubOrders[i].orderStatus !== 'UNAUDITED' && |
3756 | selectedSubOrders[i].orderStatus !== | 3763 | selectedSubOrders[i].orderStatus !== |
3764 | + 'PROCURE_REJECT' && | ||
3765 | + selectedSubOrders[i].orderStatus !== | ||
3757 | 'FINANCE_PROCESS' && | 3766 | 'FINANCE_PROCESS' && |
3758 | selectedSubOrders[i].orderStatus !== | 3767 | selectedSubOrders[i].orderStatus !== |
3759 | 'LEADER_AUDITED' | 3768 | 'LEADER_AUDITED' |
@@ -3826,7 +3835,9 @@ const OrderPage = () => { | @@ -3826,7 +3835,9 @@ const OrderPage = () => { | ||
3826 | selectedSubOrders[i].orderStatus !== | 3835 | selectedSubOrders[i].orderStatus !== |
3827 | 'CONFIRM_RECEIPT' && | 3836 | 'CONFIRM_RECEIPT' && |
3828 | selectedSubOrders[i].orderStatus !== | 3837 | selectedSubOrders[i].orderStatus !== |
3829 | - 'AFTER_SALES_FAILURE' | 3838 | + 'AFTER_SALES_FAILURE' && |
3839 | + selectedSubOrders[i].orderStatus !== | ||
3840 | + 'AFTER_SALES_COMPLETION' | ||
3830 | ) { | 3841 | ) { |
3831 | message.error('请选择确认收货状态的子订单进行售后'); | 3842 | message.error('请选择确认收货状态的子订单进行售后'); |
3832 | return; | 3843 | return; |
@@ -5062,7 +5073,7 @@ const OrderPage = () => { | @@ -5062,7 +5073,7 @@ const OrderPage = () => { | ||
5062 | subOrders={orderOptType === 'add' ? [] : buildSubOrders()} | 5073 | subOrders={orderOptType === 'add' ? [] : buildSubOrders()} |
5063 | onClose={(isSuccess: boolean) => { | 5074 | onClose={(isSuccess: boolean) => { |
5064 | setOrderDrawerVisible(false); | 5075 | setOrderDrawerVisible(false); |
5065 | - clearOptObject(); | 5076 | + // clearOptObject(); |
5066 | if (isSuccess) { | 5077 | if (isSuccess) { |
5067 | refreshTable(); | 5078 | refreshTable(); |
5068 | } | 5079 | } |
src/pages/Order/OrderList/CheckModal.tsx
@@ -66,7 +66,7 @@ export default ({ | @@ -66,7 +66,7 @@ export default ({ | ||
66 | const [messageApi, contextHolder] = message.useMessage(); | 66 | const [messageApi, contextHolder] = message.useMessage(); |
67 | const [form] = Form.useForm<{ name: string; company: string }>(); | 67 | const [form] = Form.useForm<{ name: string; company: string }>(); |
68 | let subOrderIds: any[] = subOrders?.map((subOrder) => subOrder.id); | 68 | let subOrderIds: any[] = subOrders?.map((subOrder) => subOrder.id); |
69 | - const [mainOrderId] = useState(data.id); | 69 | + const [mainOrderId] = useState(data?.id || null); |
70 | 70 | ||
71 | const [afterSalesInfo, setAfterSalesInfo] = useState<any>(); | 71 | const [afterSalesInfo, setAfterSalesInfo] = useState<any>(); |
72 | const [prepaidProofImages, setPrepaidProofImages] = useState<any[]>([]); | 72 | const [prepaidProofImages, setPrepaidProofImages] = useState<any[]>([]); |
src/pages/Order/OrderList/OrderDrawer.tsx
@@ -1162,7 +1162,10 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | @@ -1162,7 +1162,10 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | ||
1162 | console.log(form.getFieldValue('id')); | 1162 | console.log(form.getFieldValue('id')); |
1163 | if (form.getFieldValue('id') !== undefined) { | 1163 | if (form.getFieldValue('id') !== undefined) { |
1164 | const resp = await postDistrictSelOrderProvince({ | 1164 | const resp = await postDistrictSelOrderProvince({ |
1165 | - data: form.getFieldValue('id'), | 1165 | + data: { |
1166 | + oId: form.getFieldValue('id'), | ||
1167 | + orderType: orderOptType, | ||
1168 | + }, | ||
1166 | }); | 1169 | }); |
1167 | if (resp && resp.data) { | 1170 | if (resp && resp.data) { |
1168 | if (resp.data.province) { | 1171 | if (resp.data.province) { |
@@ -1349,7 +1352,10 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | @@ -1349,7 +1352,10 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | ||
1349 | console.log(form.getFieldValue('id')); | 1352 | console.log(form.getFieldValue('id')); |
1350 | if (form.getFieldValue('id')) { | 1353 | if (form.getFieldValue('id')) { |
1351 | const resp = await postDistrictSelOrderProvince({ | 1354 | const resp = await postDistrictSelOrderProvince({ |
1352 | - data: form.getFieldValue('id'), | 1355 | + data: { |
1356 | + oId: form.getFieldValue('id'), | ||
1357 | + orderType: orderOptType, | ||
1358 | + }, | ||
1353 | }); | 1359 | }); |
1354 | if ( | 1360 | if ( |
1355 | resp.data.province !== null && | 1361 | resp.data.province !== null && |
@@ -1409,7 +1415,10 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | @@ -1409,7 +1415,10 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | ||
1409 | let districtOptions = []; | 1415 | let districtOptions = []; |
1410 | if (form.getFieldValue('id')) { | 1416 | if (form.getFieldValue('id')) { |
1411 | const resp = await postDistrictSelOrderProvince({ | 1417 | const resp = await postDistrictSelOrderProvince({ |
1412 | - data: form.getFieldValue('id'), | 1418 | + data: { |
1419 | + oId: form.getFieldValue('id'), | ||
1420 | + orderType: orderOptType, | ||
1421 | + }, | ||
1413 | }); | 1422 | }); |
1414 | if (resp.data.city !== null && resp.data.city !== undefined) { | 1423 | if (resp.data.city !== null && resp.data.city !== undefined) { |
1415 | let res = await postDistrictSelectByNameAndLevel({ | 1424 | let res = await postDistrictSelectByNameAndLevel({ |
src/pages/Order/OrderList/OrderList.tsx
@@ -9,7 +9,6 @@ import { | @@ -9,7 +9,6 @@ import { | ||
9 | postKingdeeRepSalOrderSave, | 9 | postKingdeeRepSalOrderSave, |
10 | postServiceConstCanApplyAfterInvoicingStatus, | 10 | postServiceConstCanApplyAfterInvoicingStatus, |
11 | postServiceInvoiceCancelApply, | 11 | postServiceInvoiceCancelApply, |
12 | - postServiceOrderAfterSalesCheck, | ||
13 | postServiceOrderCancelSend, | 12 | postServiceOrderCancelSend, |
14 | postServiceOrderConfirmInvoice, | 13 | postServiceOrderConfirmInvoice, |
15 | postServiceOrderGetCurrentOptNode, | 14 | postServiceOrderGetCurrentOptNode, |
@@ -81,6 +80,7 @@ import Base64 from 'base-64'; | @@ -81,6 +80,7 @@ import Base64 from 'base-64'; | ||
81 | import { cloneDeep } from 'lodash'; | 80 | import { cloneDeep } from 'lodash'; |
82 | import React, { Key, useEffect, useMemo, useRef, useState } from 'react'; | 81 | import React, { Key, useEffect, useMemo, useRef, useState } from 'react'; |
83 | import OrderPrintModal from '../../OrderPrint/OrderPrintModal'; | 82 | import OrderPrintModal from '../../OrderPrint/OrderPrintModal'; |
83 | +import StoreCheckModal from '../FeedBack/StoreCheckModal'; | ||
84 | import { | 84 | import { |
85 | AFTER_INVOICING_STATUS, | 85 | AFTER_INVOICING_STATUS, |
86 | CHECK_TYPE, | 86 | CHECK_TYPE, |
@@ -156,6 +156,8 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | @@ -156,6 +156,8 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | ||
156 | useState<boolean>(false); | 156 | useState<boolean>(false); |
157 | const [afterSalesDrawerVisible, setAfterSalesDrawerVisible] = | 157 | const [afterSalesDrawerVisible, setAfterSalesDrawerVisible] = |
158 | useState<boolean>(false); | 158 | useState<boolean>(false); |
159 | + const [storeCheckModalVisible, setStoreCheckModalVisible] = | ||
160 | + useState<boolean>(false); | ||
159 | const [historyModalVisible, setHistoryModalVisible] = | 161 | const [historyModalVisible, setHistoryModalVisible] = |
160 | useState<boolean>(false); | 162 | useState<boolean>(false); |
161 | const [isRePrintOrder, setIsRePrintOrder] = useState<boolean>(false); | 163 | const [isRePrintOrder, setIsRePrintOrder] = useState<boolean>(false); |
@@ -563,15 +565,15 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | @@ -563,15 +565,15 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | ||
563 | } | 565 | } |
564 | }; | 566 | }; |
565 | 567 | ||
566 | - async function doAfterSalesCheck(body: object) { | ||
567 | - const data = await postServiceOrderAfterSalesCheck({ | ||
568 | - data: body, | ||
569 | - }); | ||
570 | - console.log(data); | ||
571 | - if (data.data) { | ||
572 | - refreshTable(); | ||
573 | - } | ||
574 | - } | 568 | + // async function doAfterSalesCheck(body: object) { |
569 | + // const data = await postServiceOrderAfterSalesCheck({ | ||
570 | + // data: body, | ||
571 | + // }); | ||
572 | + // console.log(data); | ||
573 | + // if (data.data) { | ||
574 | + // refreshTable(); | ||
575 | + // } | ||
576 | + // } | ||
575 | 577 | ||
576 | const onCheckboxChange = (record: never) => { | 578 | const onCheckboxChange = (record: never) => { |
577 | let newSelectedMainOrderKeys = []; | 579 | let newSelectedMainOrderKeys = []; |
@@ -718,7 +720,11 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | @@ -718,7 +720,11 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | ||
718 | } | 720 | } |
719 | 721 | ||
720 | //如果是未审核或者领导已审核,付款状态为预付款则需要财务审核【财务待审核】,否则仓库审核【】 | 722 | //如果是未审核或者领导已审核,付款状态为预付款则需要财务审核【财务待审核】,否则仓库审核【】 |
721 | - if (orderStatus === 'UNAUDITED' || orderStatus === 'LEADER_AUDITED') { | 723 | + if ( |
724 | + orderStatus === 'UNAUDITED' || | ||
725 | + orderStatus === 'LEADER_AUDITED' || | ||
726 | + orderStatus === 'PROCURE_REJECT' | ||
727 | + ) { | ||
722 | if (paymentMethod === 'PAYMENT_IN_ADVANCE') { | 728 | if (paymentMethod === 'PAYMENT_IN_ADVANCE') { |
723 | orderStatusTagText = '财务待审核'; | 729 | orderStatusTagText = '财务待审核'; |
724 | } else { | 730 | } else { |
@@ -1234,6 +1240,16 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | @@ -1234,6 +1240,16 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | ||
1234 | ) : ( | 1240 | ) : ( |
1235 | '' | 1241 | '' |
1236 | )} | 1242 | )} |
1243 | + {/* 后置审核状态 */} | ||
1244 | + {optRecord.orderStatus === 'PROCURE_REJECT' ? ( | ||
1245 | + <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> | ||
1246 | + <Tag color={'red'} style={{ marginRight: '4px' }}> | ||
1247 | + {'采购驳回'} | ||
1248 | + </Tag> | ||
1249 | + </div> | ||
1250 | + ) : ( | ||
1251 | + '' | ||
1252 | + )} | ||
1237 | 1253 | ||
1238 | {/**采购是否已下单状态 */} | 1254 | {/**采购是否已下单状态 */} |
1239 | {optRecord.procureOrderStatus !== null && | 1255 | {optRecord.procureOrderStatus !== null && |
@@ -1887,24 +1903,18 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | @@ -1887,24 +1903,18 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | ||
1887 | )} | 1903 | )} |
1888 | 1904 | ||
1889 | {optRecord.paths?.includes('afterSalesConfirm') ? ( | 1905 | {optRecord.paths?.includes('afterSalesConfirm') ? ( |
1890 | - <ButtonConfirm | 1906 | + <Button |
1891 | className="p-0" | 1907 | className="p-0" |
1892 | - title="确认通过?" | ||
1893 | - text="售后已审核待确认" | ||
1894 | - onConfirm={() => { | ||
1895 | - setIsMainOrder(false); | ||
1896 | - doAfterSalesCheck({ | ||
1897 | - applyType: 'after-sales', | ||
1898 | - isAfterSalesSuccess: true, | ||
1899 | - subOrderIds: isMainOrder | ||
1900 | - ? [...record.subOrderInformationLists] | ||
1901 | - .flat() | ||
1902 | - ?.map((subOrder) => subOrder.id) | ||
1903 | - : [optRecord.id], | ||
1904 | - mainId: record.id, | ||
1905 | - }); | 1908 | + type="link" |
1909 | + onClick={() => { | ||
1910 | + setCurrentMainId(record.id); | ||
1911 | + createOptObject(optRecord.id, record.id); | ||
1912 | + setStoreCheckModalVisible(true); | ||
1913 | + setOrderCheckType(CHECK_TYPE.AFTER_SALES); | ||
1906 | }} | 1914 | }} |
1907 | - /> | 1915 | + > |
1916 | + 仓库确认 | ||
1917 | + </Button> | ||
1908 | ) : ( | 1918 | ) : ( |
1909 | '' | 1919 | '' |
1910 | )} | 1920 | )} |
@@ -1995,7 +2005,7 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | @@ -1995,7 +2005,7 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | ||
1995 | onClick={() => { | 2005 | onClick={() => { |
1996 | createOptObject(optRecord.id, record.id); | 2006 | createOptObject(optRecord.id, record.id); |
1997 | setOrderDrawerVisible(true); | 2007 | setOrderDrawerVisible(true); |
1998 | - setOrderOptType('after_sales'); | 2008 | + setOrderOptType('after-sales'); |
1999 | }} | 2009 | }} |
2000 | > | 2010 | > |
2001 | 申请售后 | 2011 | 申请售后 |
@@ -3484,6 +3494,7 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | @@ -3484,6 +3494,7 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | ||
3484 | //是审核通过及之后的订单 | 3494 | //是审核通过及之后的订单 |
3485 | if ( | 3495 | if ( |
3486 | orderStatus !== 'UNAUDITED' && | 3496 | orderStatus !== 'UNAUDITED' && |
3497 | + orderStatus !== 'PROCURE_REJECT' && | ||
3487 | orderStatus !== 'AUDIT_FAILED' && | 3498 | orderStatus !== 'AUDIT_FAILED' && |
3488 | orderStatus !== 'LEADER_PROCESS' && | 3499 | orderStatus !== 'LEADER_PROCESS' && |
3489 | orderStatus !== 'SALES_CONFIRM' && | 3500 | orderStatus !== 'SALES_CONFIRM' && |
@@ -3499,6 +3510,7 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | @@ -3499,6 +3510,7 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | ||
3499 | if ( | 3510 | if ( |
3500 | roleCode !== 'admin' && | 3511 | roleCode !== 'admin' && |
3501 | (orderStatus === 'UNAUDITED' || | 3512 | (orderStatus === 'UNAUDITED' || |
3513 | + orderStatus === 'PROCURE_REJECT' || | ||
3502 | orderStatus === 'AUDIT_FAILED') | 3514 | orderStatus === 'AUDIT_FAILED') |
3503 | ) { | 3515 | ) { |
3504 | message.error('请选择已审核的订单进行编辑'); | 3516 | message.error('请选择已审核的订单进行编辑'); |
@@ -3552,6 +3564,7 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | @@ -3552,6 +3564,7 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | ||
3552 | let orderStatus = selectedSubOrders[i].orderStatus; | 3564 | let orderStatus = selectedSubOrders[i].orderStatus; |
3553 | if ( | 3565 | if ( |
3554 | orderStatus !== 'UNAUDITED' && | 3566 | orderStatus !== 'UNAUDITED' && |
3567 | + orderStatus !== 'PROCURE_REJECT' && | ||
3555 | orderStatus !== 'FINANCE_PROCESS' && | 3568 | orderStatus !== 'FINANCE_PROCESS' && |
3556 | orderStatus !== 'LEADER_AUDITED' | 3569 | orderStatus !== 'LEADER_AUDITED' |
3557 | ) { | 3570 | ) { |
@@ -3607,22 +3620,18 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | @@ -3607,22 +3620,18 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | ||
3607 | )} | 3620 | )} |
3608 | 3621 | ||
3609 | {record.paths?.includes('afterSalesConfirm') ? ( | 3622 | {record.paths?.includes('afterSalesConfirm') ? ( |
3610 | - <ButtonConfirm | 3623 | + <Button |
3611 | className="p-0" | 3624 | className="p-0" |
3612 | - title="确认通过?" | ||
3613 | - text="售后已审核待确认" | ||
3614 | - onConfirm={() => { | ||
3615 | - setIsMainOrder(true); | ||
3616 | - doAfterSalesCheck({ | ||
3617 | - applyType: 'after-sales', | ||
3618 | - isAfterSalesSuccess: true, | ||
3619 | - subOrderIds: [...record.subOrderInformationLists] | ||
3620 | - .flat() | ||
3621 | - ?.map((subOrder) => subOrder.id), | ||
3622 | - mainId: record.id, | ||
3623 | - }); | 3625 | + type="link" |
3626 | + onClick={() => { | ||
3627 | + setCurrentMainId(record.id); | ||
3628 | + createOptObject(null, record.id); | ||
3629 | + setStoreCheckModalVisible(true); | ||
3630 | + setOrderCheckType(CHECK_TYPE.AFTER_SALES); | ||
3624 | }} | 3631 | }} |
3625 | - /> | 3632 | + > |
3633 | + 仓库确认 | ||
3634 | + </Button> | ||
3626 | ) : ( | 3635 | ) : ( |
3627 | '' | 3636 | '' |
3628 | )} | 3637 | )} |
@@ -3736,6 +3745,8 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | @@ -3736,6 +3745,8 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | ||
3736 | if ( | 3745 | if ( |
3737 | selectedSubOrders[i].orderStatus !== 'UNAUDITED' && | 3746 | selectedSubOrders[i].orderStatus !== 'UNAUDITED' && |
3738 | selectedSubOrders[i].orderStatus !== | 3747 | selectedSubOrders[i].orderStatus !== |
3748 | + 'PROCURE_REJECT' && | ||
3749 | + selectedSubOrders[i].orderStatus !== | ||
3739 | 'FINANCE_PROCESS' && | 3750 | 'FINANCE_PROCESS' && |
3740 | selectedSubOrders[i].orderStatus !== | 3751 | selectedSubOrders[i].orderStatus !== |
3741 | 'LEADER_AUDITED' | 3752 | 'LEADER_AUDITED' |
@@ -3808,7 +3819,9 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | @@ -3808,7 +3819,9 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | ||
3808 | selectedSubOrders[i].orderStatus !== | 3819 | selectedSubOrders[i].orderStatus !== |
3809 | 'CONFIRM_RECEIPT' && | 3820 | 'CONFIRM_RECEIPT' && |
3810 | selectedSubOrders[i].orderStatus !== | 3821 | selectedSubOrders[i].orderStatus !== |
3811 | - 'AFTER_SALES_FAILURE' | 3822 | + 'AFTER_SALES_FAILURE' && |
3823 | + selectedSubOrders[i].orderStatus !== | ||
3824 | + 'AFTER_SALES_COMPLETION' | ||
3812 | ) { | 3825 | ) { |
3813 | message.error('请选择确认收货状态的子订单进行售后'); | 3826 | message.error('请选择确认收货状态的子订单进行售后'); |
3814 | return; | 3827 | return; |
@@ -4722,7 +4735,7 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | @@ -4722,7 +4735,7 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | ||
4722 | subOrders={orderOptType === 'add' ? [] : buildSubOrders()} | 4735 | subOrders={orderOptType === 'add' ? [] : buildSubOrders()} |
4723 | onClose={(isSuccess: boolean) => { | 4736 | onClose={(isSuccess: boolean) => { |
4724 | setOrderDrawerVisible(false); | 4737 | setOrderDrawerVisible(false); |
4725 | - clearOptObject(); | 4738 | + // clearOptObject(); |
4726 | if (isSuccess) { | 4739 | if (isSuccess) { |
4727 | refreshTable(); | 4740 | refreshTable(); |
4728 | } | 4741 | } |
@@ -4759,6 +4772,34 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | @@ -4759,6 +4772,34 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | ||
4759 | /> | 4772 | /> |
4760 | )} | 4773 | )} |
4761 | 4774 | ||
4775 | + {storeCheckModalVisible && ( | ||
4776 | + <StoreCheckModal | ||
4777 | + setCheckVisible={(val: boolean) => { | ||
4778 | + setStoreCheckModalVisible(val); | ||
4779 | + if (!val) { | ||
4780 | + clearOptObject(); | ||
4781 | + } | ||
4782 | + }} | ||
4783 | + data={isMainOrder ? getFirstMainOrder() : buildMainOrder()} | ||
4784 | + subOrders={ | ||
4785 | + isMainOrder | ||
4786 | + ? [...subOrderSelectedMap.values()].flat() | ||
4787 | + : buildSubOrders() | ||
4788 | + } | ||
4789 | + orderCheckType={orderCheckType} | ||
4790 | + openOrderDrawer={(type: any, id: any) => { | ||
4791 | + setCurrentMainId(id); | ||
4792 | + setOrderOptType(type); | ||
4793 | + setOrderDrawerVisible(true); | ||
4794 | + }} | ||
4795 | + onClose={() => { | ||
4796 | + clearOptObject(); | ||
4797 | + setStoreCheckModalVisible(false); | ||
4798 | + refreshTable(); | ||
4799 | + }} | ||
4800 | + /> | ||
4801 | + )} | ||
4802 | + | ||
4762 | {applyForInvoicingVisible && ( | 4803 | {applyForInvoicingVisible && ( |
4763 | <ApplyForInvoicingModal | 4804 | <ApplyForInvoicingModal |
4764 | setCheckVisible={(val: boolean) => { | 4805 | setCheckVisible={(val: boolean) => { |
src/pages/Order/OrderList/ProcureCheckModal.tsx
@@ -2,6 +2,7 @@ import { RESPONSE_CODE } from '@/constants/enum'; | @@ -2,6 +2,7 @@ import { RESPONSE_CODE } from '@/constants/enum'; | ||
2 | import { | 2 | import { |
3 | postServiceOrderProcureCheckOrder, | 3 | postServiceOrderProcureCheckOrder, |
4 | postServiceOrderProcureConvertWarehouseKeeper, | 4 | postServiceOrderProcureConvertWarehouseKeeper, |
5 | + postServiceOrderPurchaseRejectionToSale, | ||
5 | postServiceOrderQuerySupplier, | 6 | postServiceOrderQuerySupplier, |
6 | } from '@/services'; | 7 | } from '@/services'; |
7 | import { | 8 | import { |
@@ -13,7 +14,7 @@ import { Button, Form, Input, Popconfirm, message } from 'antd'; | @@ -13,7 +14,7 @@ import { Button, Form, Input, Popconfirm, message } from 'antd'; | ||
13 | import { useState } from 'react'; | 14 | import { useState } from 'react'; |
14 | export default ({ setCheckVisible, isMainOrder, orders, onClose }) => { | 15 | export default ({ setCheckVisible, isMainOrder, orders, onClose }) => { |
15 | const [form] = Form.useForm<{ supplier: string }>(); | 16 | const [form] = Form.useForm<{ supplier: string }>(); |
16 | - const [checkNotes, setCheckNotes] = useState<string>(''); | 17 | + const [procureNotes, setProcureNotes] = useState<string>(''); |
17 | 18 | ||
18 | console.log(isMainOrder); | 19 | console.log(isMainOrder); |
19 | 20 | ||
@@ -51,6 +52,38 @@ export default ({ setCheckVisible, isMainOrder, orders, onClose }) => { | @@ -51,6 +52,38 @@ export default ({ setCheckVisible, isMainOrder, orders, onClose }) => { | ||
51 | defaultDoms[0], | 52 | defaultDoms[0], |
52 | <> | 53 | <> |
53 | <Popconfirm | 54 | <Popconfirm |
55 | + title="是否驳回至销售" | ||
56 | + description={ | ||
57 | + <div> | ||
58 | + <Input.TextArea | ||
59 | + placeholder="请填写备注" | ||
60 | + onChange={(e: any) => { | ||
61 | + setProcureNotes(e.target.value); | ||
62 | + }} | ||
63 | + rows={4} | ||
64 | + ></Input.TextArea> | ||
65 | + </div> | ||
66 | + } | ||
67 | + onConfirm={async () => { | ||
68 | + let res = await postServiceOrderPurchaseRejectionToSale({ | ||
69 | + data: { | ||
70 | + subIds: ids, | ||
71 | + procureNotes: procureNotes, | ||
72 | + }, | ||
73 | + }); | ||
74 | + | ||
75 | + if (res?.result === RESPONSE_CODE.SUCCESS) { | ||
76 | + message.success(res.message); | ||
77 | + onClose(); | ||
78 | + return true; | ||
79 | + } | ||
80 | + }} | ||
81 | + okText="确定" | ||
82 | + cancelText="取消" | ||
83 | + > | ||
84 | + <Button type="primary">驳回至销售</Button> | ||
85 | + </Popconfirm> | ||
86 | + <Popconfirm | ||
54 | title="是否转回仓库" | 87 | title="是否转回仓库" |
55 | description={ | 88 | description={ |
56 | <div> | 89 | <div> |
@@ -60,7 +93,7 @@ export default ({ setCheckVisible, isMainOrder, orders, onClose }) => { | @@ -60,7 +93,7 @@ export default ({ setCheckVisible, isMainOrder, orders, onClose }) => { | ||
60 | <Input.TextArea | 93 | <Input.TextArea |
61 | placeholder="请填写备注" | 94 | placeholder="请填写备注" |
62 | onChange={(e: any) => { | 95 | onChange={(e: any) => { |
63 | - setCheckNotes(e.target.value); | 96 | + setProcureNotes(e.target.value); |
64 | }} | 97 | }} |
65 | rows={4} | 98 | rows={4} |
66 | ></Input.TextArea> | 99 | ></Input.TextArea> |
@@ -71,7 +104,7 @@ export default ({ setCheckVisible, isMainOrder, orders, onClose }) => { | @@ -71,7 +104,7 @@ export default ({ setCheckVisible, isMainOrder, orders, onClose }) => { | ||
71 | { | 104 | { |
72 | data: { | 105 | data: { |
73 | subIds: ids, | 106 | subIds: ids, |
74 | - checkNotes: checkNotes, | 107 | + procureNotes: procureNotes, |
75 | }, | 108 | }, |
76 | }, | 109 | }, |
77 | ); | 110 | ); |
src/pages/Order/OrderWarning/index copy.tsx
@@ -662,7 +662,11 @@ const OrderPage = () => { | @@ -662,7 +662,11 @@ const OrderPage = () => { | ||
662 | } | 662 | } |
663 | 663 | ||
664 | //如果是未审核或者领导已审核,付款状态为预付款则需要财务审核【财务待审核】,否则仓库审核【】 | 664 | //如果是未审核或者领导已审核,付款状态为预付款则需要财务审核【财务待审核】,否则仓库审核【】 |
665 | - if (orderStatus === 'UNAUDITED' || orderStatus === 'LEADER_AUDITED') { | 665 | + if ( |
666 | + orderStatus === 'UNAUDITED' || | ||
667 | + orderStatus === 'LEADER_AUDITED' || | ||
668 | + orderStatus === 'PROCURE_REJECT' | ||
669 | + ) { | ||
666 | if (paymentMethod === 'PAYMENT_IN_ADVANCE') { | 670 | if (paymentMethod === 'PAYMENT_IN_ADVANCE') { |
667 | orderStatusTagText = '财务待审核'; | 671 | orderStatusTagText = '财务待审核'; |
668 | } else { | 672 | } else { |
@@ -1935,7 +1939,7 @@ const OrderPage = () => { | @@ -1935,7 +1939,7 @@ const OrderPage = () => { | ||
1935 | onClick={() => { | 1939 | onClick={() => { |
1936 | createOptObject(optRecord.id, record.id); | 1940 | createOptObject(optRecord.id, record.id); |
1937 | setOrderDrawerVisible(true); | 1941 | setOrderDrawerVisible(true); |
1938 | - setOrderOptType('after_sales'); | 1942 | + setOrderOptType('after-sales'); |
1939 | }} | 1943 | }} |
1940 | > | 1944 | > |
1941 | 申请售后 | 1945 | 申请售后 |
@@ -3481,6 +3485,7 @@ const OrderPage = () => { | @@ -3481,6 +3485,7 @@ const OrderPage = () => { | ||
3481 | //是审核通过及之后的订单 | 3485 | //是审核通过及之后的订单 |
3482 | if ( | 3486 | if ( |
3483 | orderStatus !== 'UNAUDITED' && | 3487 | orderStatus !== 'UNAUDITED' && |
3488 | + orderStatus !== 'PROCURE_REJECT' && | ||
3484 | orderStatus !== 'AUDIT_FAILED' && | 3489 | orderStatus !== 'AUDIT_FAILED' && |
3485 | orderStatus !== 'LEADER_PROCESS' && | 3490 | orderStatus !== 'LEADER_PROCESS' && |
3486 | orderStatus !== 'SALES_CONFIRM' && | 3491 | orderStatus !== 'SALES_CONFIRM' && |
@@ -3496,6 +3501,7 @@ const OrderPage = () => { | @@ -3496,6 +3501,7 @@ const OrderPage = () => { | ||
3496 | if ( | 3501 | if ( |
3497 | roleCode !== 'admin' && | 3502 | roleCode !== 'admin' && |
3498 | (orderStatus === 'UNAUDITED' || | 3503 | (orderStatus === 'UNAUDITED' || |
3504 | + orderStatus === 'PROCURE_REJECT' || | ||
3499 | orderStatus === 'AUDIT_FAILED') | 3505 | orderStatus === 'AUDIT_FAILED') |
3500 | ) { | 3506 | ) { |
3501 | message.error('请选择已审核的订单进行编辑'); | 3507 | message.error('请选择已审核的订单进行编辑'); |
@@ -3549,6 +3555,7 @@ const OrderPage = () => { | @@ -3549,6 +3555,7 @@ const OrderPage = () => { | ||
3549 | let orderStatus = selectedSubOrders[i].orderStatus; | 3555 | let orderStatus = selectedSubOrders[i].orderStatus; |
3550 | if ( | 3556 | if ( |
3551 | orderStatus !== 'UNAUDITED' && | 3557 | orderStatus !== 'UNAUDITED' && |
3558 | + orderStatus !== 'PROCURE_REJECT' && | ||
3552 | orderStatus !== 'FINANCE_PROCESS' && | 3559 | orderStatus !== 'FINANCE_PROCESS' && |
3553 | orderStatus !== 'LEADER_AUDITED' | 3560 | orderStatus !== 'LEADER_AUDITED' |
3554 | ) { | 3561 | ) { |
@@ -3712,6 +3719,8 @@ const OrderPage = () => { | @@ -3712,6 +3719,8 @@ const OrderPage = () => { | ||
3712 | if ( | 3719 | if ( |
3713 | selectedSubOrders[i].orderStatus !== 'UNAUDITED' && | 3720 | selectedSubOrders[i].orderStatus !== 'UNAUDITED' && |
3714 | selectedSubOrders[i].orderStatus !== | 3721 | selectedSubOrders[i].orderStatus !== |
3722 | + 'PROCURE_REJECT' && | ||
3723 | + selectedSubOrders[i].orderStatus !== | ||
3715 | 'FINANCE_PROCESS' && | 3724 | 'FINANCE_PROCESS' && |
3716 | selectedSubOrders[i].orderStatus !== | 3725 | selectedSubOrders[i].orderStatus !== |
3717 | 'LEADER_AUDITED' | 3726 | 'LEADER_AUDITED' |
@@ -3784,7 +3793,9 @@ const OrderPage = () => { | @@ -3784,7 +3793,9 @@ const OrderPage = () => { | ||
3784 | selectedSubOrders[i].orderStatus !== | 3793 | selectedSubOrders[i].orderStatus !== |
3785 | 'CONFIRM_RECEIPT' && | 3794 | 'CONFIRM_RECEIPT' && |
3786 | selectedSubOrders[i].orderStatus !== | 3795 | selectedSubOrders[i].orderStatus !== |
3787 | - 'AFTER_SALES_FAILURE' | 3796 | + 'AFTER_SALES_FAILURE' && |
3797 | + selectedSubOrders[i].orderStatus !== | ||
3798 | + 'AFTER_SALES_COMPLETION' | ||
3788 | ) { | 3799 | ) { |
3789 | message.error('请选择确认收货状态的子订单进行售后'); | 3800 | message.error('请选择确认收货状态的子订单进行售后'); |
3790 | return; | 3801 | return; |
src/pages/Order/constant.ts
@@ -195,6 +195,7 @@ export const ORDER_STATUS_OPTIONS = { | @@ -195,6 +195,7 @@ export const ORDER_STATUS_OPTIONS = { | ||
195 | WAIT_CONFIRM_DELIVER_AFTER_INVOICE: '待开票后确认发货', | 195 | WAIT_CONFIRM_DELIVER_AFTER_INVOICE: '待开票后确认发货', |
196 | SALES_CONFIRM: '销售待确认', | 196 | SALES_CONFIRM: '销售待确认', |
197 | UNAUDITED: '未审核', | 197 | UNAUDITED: '未审核', |
198 | + PROCURE_REJECT: '采购驳回至销售', | ||
198 | LEADER_PROCESS: '领导待审核', | 199 | LEADER_PROCESS: '领导待审核', |
199 | MODIFY_APPLY_WAIT_FOR_AUDIT: '修改待审核', | 200 | MODIFY_APPLY_WAIT_FOR_AUDIT: '修改待审核', |
200 | LEADER_AUDITED: '领导已审核', | 201 | LEADER_AUDITED: '领导已审核', |
@@ -273,6 +274,7 @@ export const TAGS_COLOR = new Map<string, string>([ | @@ -273,6 +274,7 @@ export const TAGS_COLOR = new Map<string, string>([ | ||
273 | ['COMMON_INVOICED', 'processing'], | 274 | ['COMMON_INVOICED', 'processing'], |
274 | ['AFTER_INVOICED', 'success'], | 275 | ['AFTER_INVOICED', 'success'], |
275 | ['UNAUDITED', 'warning'], | 276 | ['UNAUDITED', 'warning'], |
277 | + ['PROCURE_REJECT', 'warning'], | ||
276 | ['AUDITED', 'processing'], | 278 | ['AUDITED', 'processing'], |
277 | ['WAIT_SHIP', 'processing'], | 279 | ['WAIT_SHIP', 'processing'], |
278 | ['SHIPPED', 'processing'], | 280 | ['SHIPPED', 'processing'], |