Commit 1abb12737b02ee94e319090d12bcf8001ea7155e
1 parent
0233900d
feat: update
Showing
5 changed files
with
289 additions
and
128 deletions
src/pages/Order/components/ApplyForInvoicingModal.tsx
1 | 1 | import { RESPONSE_CODE } from '@/constants/enum'; |
2 | 2 | import { postServiceOrderApplyInvoicing } from '@/services'; |
3 | +import { getAliYunOSSFileNameFromUrl } from '@/utils'; | |
3 | 4 | import { |
4 | 5 | ModalForm, |
5 | 6 | ProFormTextArea, |
6 | 7 | ProFormUploadDragger, |
7 | 8 | } from '@ant-design/pro-components'; |
8 | 9 | import { Form, message } from 'antd'; |
9 | -export default ({ setCheckVisible, subOrders, onClose }) => { | |
10 | +import { cloneDeep } from 'lodash'; | |
11 | +export default ({ setCheckVisible, isEdit, subOrders, onClose }) => { | |
12 | + const subOrder = cloneDeep(subOrders[0]); | |
13 | + let newListAnnex = subOrder.afterAnnexList?.map((path) => { | |
14 | + let i = 0; | |
15 | + return { | |
16 | + uid: i++, | |
17 | + name: getAliYunOSSFileNameFromUrl(path), | |
18 | + status: 'uploaded', | |
19 | + url: path, | |
20 | + response: { data: [path] }, | |
21 | + }; | |
22 | + }); | |
23 | + | |
24 | + subOrder.filePaths = newListAnnex; | |
25 | + | |
10 | 26 | const [form] = Form.useForm<{ |
11 | 27 | applyInvoicingNotes: string; |
12 | 28 | filePaths: any; |
13 | 29 | subIds: any[]; |
30 | + afterInvoicingUpdate: boolean; | |
14 | 31 | }>(); |
15 | 32 | let subOrderIds = subOrders?.map((subOrder) => subOrder.id); |
16 | 33 | |
... | ... | @@ -19,10 +36,12 @@ export default ({ setCheckVisible, subOrders, onClose }) => { |
19 | 36 | applyInvoicingNotes: string; |
20 | 37 | filePaths: any; |
21 | 38 | subIds: any[]; |
39 | + afterInvoicingUpdate: boolean; | |
22 | 40 | }> |
23 | 41 | width={500} |
24 | 42 | open |
25 | - title="申请开票" | |
43 | + title={isEdit ? '修改信息' : '申请开票'} | |
44 | + initialValues={subOrder} | |
26 | 45 | form={form} |
27 | 46 | autoFocusFirstInput |
28 | 47 | modalProps={{ |
... | ... | @@ -46,6 +65,12 @@ export default ({ setCheckVisible, subOrders, onClose }) => { |
46 | 65 | return { url: item.response.data[0] }; |
47 | 66 | }); |
48 | 67 | |
68 | + if (isEdit) { | |
69 | + values.afterInvoicingUpdate = true; | |
70 | + } else { | |
71 | + values.afterInvoicingUpdate = false; | |
72 | + } | |
73 | + | |
49 | 74 | const res = await postServiceOrderApplyInvoicing({ data: values }); |
50 | 75 | |
51 | 76 | if (res.result === RESPONSE_CODE.SUCCESS) { | ... | ... |
src/pages/Order/components/CheckModal.tsx
... | ... | @@ -6,10 +6,11 @@ import { |
6 | 6 | import { ModalForm, ProFormTextArea } from '@ant-design/pro-components'; |
7 | 7 | import { Button, Form, Modal, UploadFile, message } from 'antd'; |
8 | 8 | import Upload, { RcFile, UploadProps } from 'antd/es/upload'; |
9 | -import { useRef, useState } from 'react'; | |
9 | +import { useEffect, useRef, useState } from 'react'; | |
10 | 10 | import { CHECK_TYPE, COMFIR_RECEIPT_IMAGES_NUMBER } from '../constant'; |
11 | 11 | // import { cloneDeep } from 'lodash'; |
12 | 12 | import { PlusOutlined } from '@ant-design/icons'; |
13 | +import { cloneDeep } from 'lodash'; | |
13 | 14 | export default ({ |
14 | 15 | setCheckVisible, |
15 | 16 | data, |
... | ... | @@ -39,66 +40,66 @@ export default ({ |
39 | 40 | setFileList(newFileList); |
40 | 41 | }; |
41 | 42 | |
42 | - // /** 粘贴快捷键的回调 */ | |
43 | - // const onPaste = async (e: any) => { | |
44 | - // /** 获取剪切板的数据clipboardData */ | |
45 | - // let clipboardData = e.clipboardData, | |
46 | - // i = 0, | |
47 | - // items, | |
48 | - // item, | |
49 | - // types; | |
43 | + /** 粘贴快捷键的回调 */ | |
44 | + const onPaste = async (e: any) => { | |
45 | + /** 获取剪切板的数据clipboardData */ | |
46 | + let clipboardData = e.clipboardData, | |
47 | + i = 0, | |
48 | + items, | |
49 | + item, | |
50 | + types; | |
50 | 51 | |
51 | - // /** 为空判断 */ | |
52 | - // if (clipboardData) { | |
53 | - // items = clipboardData.items; | |
54 | - // if (!items) { | |
55 | - // message.info('您的剪贴板中没有照片'); | |
56 | - // return; | |
57 | - // } | |
52 | + /** 为空判断 */ | |
53 | + if (clipboardData) { | |
54 | + items = clipboardData.items; | |
55 | + if (!items) { | |
56 | + message.info('您的剪贴板中没有照片'); | |
57 | + return; | |
58 | + } | |
58 | 59 | |
59 | - // item = items[0]; | |
60 | - // types = clipboardData.types || []; | |
61 | - // /** 遍历剪切板的数据 */ | |
62 | - // for (; i < types.length; i++) { | |
63 | - // if (types[i] === 'Files') { | |
64 | - // item = items[i]; | |
65 | - // break; | |
66 | - // } | |
67 | - // } | |
60 | + item = items[0]; | |
61 | + types = clipboardData.types || []; | |
62 | + /** 遍历剪切板的数据 */ | |
63 | + for (; i < types.length; i++) { | |
64 | + if (types[i] === 'Files') { | |
65 | + item = items[i]; | |
66 | + break; | |
67 | + } | |
68 | + } | |
68 | 69 | |
69 | - // /** 判断文件是否为图片 */ | |
70 | - // if (item && item.kind === 'file' && item.type.match(/^image\//i)) { | |
71 | - // const imgItem = item.getAsFile(); | |
72 | - // const newFileList = cloneDeep(fileListObj.current); | |
73 | - // let filteredArray = newFileList.filter( | |
74 | - // (obj) => obj.status !== 'removed', | |
75 | - // ); //过滤掉状态为已删除的照片 | |
76 | - // const listItem = { | |
77 | - // ...imgItem, | |
78 | - // status: 'done', | |
79 | - // url: await getBase64(imgItem), | |
80 | - // originFileObj: imgItem, | |
81 | - // }; | |
70 | + /** 判断文件是否为图片 */ | |
71 | + if (item && item.kind === 'file' && item.type.match(/^image\//i)) { | |
72 | + const imgItem = item.getAsFile(); | |
73 | + const newFileList = cloneDeep(fileListObj.current); | |
74 | + let filteredArray = newFileList.filter( | |
75 | + (obj) => obj.status !== 'removed', | |
76 | + ); //过滤掉状态为已删除的照片 | |
77 | + const listItem = { | |
78 | + ...imgItem, | |
79 | + status: 'done', | |
80 | + url: await getBase64(imgItem), | |
81 | + originFileObj: imgItem, | |
82 | + }; | |
82 | 83 | |
83 | - // if (filteredArray.length >= COMFIR_RECEIPT_IMAGES_NUMBER) { | |
84 | - // message.info('发货凭证照片数量不能超过3'); | |
85 | - // return; | |
86 | - // } | |
87 | - // fileListObj.current = filteredArray; | |
88 | - // filteredArray.push(listItem); | |
89 | - // setFileList(filteredArray); | |
90 | - // return; | |
91 | - // } | |
92 | - // } | |
84 | + if (filteredArray.length >= COMFIR_RECEIPT_IMAGES_NUMBER) { | |
85 | + message.info('发货照片数量不能超过3'); | |
86 | + return; | |
87 | + } | |
88 | + fileListObj.current = filteredArray; | |
89 | + filteredArray.push(listItem); | |
90 | + setFileList(filteredArray); | |
91 | + return; | |
92 | + } | |
93 | + } | |
93 | 94 | |
94 | - // message.info('您的剪贴板中没有照片'); | |
95 | - // }; | |
96 | - // useEffect(() => { | |
97 | - // document.addEventListener('paste', onPaste); | |
98 | - // return () => { | |
99 | - // document.removeEventListener('paste', onPaste); | |
100 | - // }; | |
101 | - // }, []); | |
95 | + message.info('您的剪贴板中没有照片'); | |
96 | + }; | |
97 | + useEffect(() => { | |
98 | + document.addEventListener('paste', onPaste); | |
99 | + return () => { | |
100 | + document.removeEventListener('paste', onPaste); | |
101 | + }; | |
102 | + }, []); | |
102 | 103 | const uploadButton = ( |
103 | 104 | <div> |
104 | 105 | <PlusOutlined /> |
... | ... | @@ -277,16 +278,14 @@ export default ({ |
277 | 278 | |
278 | 279 | //附件处理 |
279 | 280 | console.log(fileList); |
280 | - let fileUrls = fileList?.map((file) => { | |
281 | - return { url: file.response?.data[0] }; | |
282 | - }); | |
281 | + | |
283 | 282 | //财务审核 |
284 | - return doFinancailCheck({ | |
285 | - checkNotes: values.name, | |
286 | - ids: subOrderIds, | |
287 | - checkPassOrReject: true, | |
288 | - invoicingCheckAnnex: fileUrls, | |
289 | - }); | |
283 | + // return doFinancailCheck({ | |
284 | + // checkNotes: values.name, | |
285 | + // ids: subOrderIds, | |
286 | + // checkPassOrReject: true, | |
287 | + // invoicingCheckAnnex: fileUrls, | |
288 | + // }); | |
290 | 289 | }} |
291 | 290 | onOpenChange={setCheckVisible} |
292 | 291 | > | ... | ... |
src/pages/Order/constant.ts
... | ... | @@ -275,12 +275,16 @@ export const MAIN_ORDER_COLUMNS = [ |
275 | 275 | data: { name: 'institution', institution: keywords }, |
276 | 276 | params: params, |
277 | 277 | }); |
278 | - let options = data.map((c: any) => { | |
279 | - return { | |
280 | - label: c.orderValue, | |
281 | - value: c.orderValue, | |
282 | - }; | |
283 | - }); | |
278 | + let options = data | |
279 | + .filter((c: any) => { | |
280 | + return c.orderName === 'institution'; | |
281 | + }) | |
282 | + .map((item: any) => { | |
283 | + return { | |
284 | + label: item.orderValue, | |
285 | + value: item.orderValue, | |
286 | + }; | |
287 | + }); | |
284 | 288 | return options; |
285 | 289 | }, |
286 | 290 | }, |
... | ... | @@ -301,12 +305,16 @@ export const MAIN_ORDER_COLUMNS = [ |
301 | 305 | }, |
302 | 306 | params: params, |
303 | 307 | }); |
304 | - let options = data.map((c: any) => { | |
305 | - return { | |
306 | - label: c.orderValue, | |
307 | - value: c.orderValue, | |
308 | - }; | |
309 | - }); | |
308 | + let options = data | |
309 | + .filter((c: any) => { | |
310 | + return c.orderName === 'institutionCustomerUser'; | |
311 | + }) | |
312 | + .map((item: any) => { | |
313 | + return { | |
314 | + label: item.orderValue, | |
315 | + value: item.orderValue, | |
316 | + }; | |
317 | + }); | |
310 | 318 | return options; |
311 | 319 | }, |
312 | 320 | }, | ... | ... |
src/pages/Order/index.tsx
... | ... | @@ -4,6 +4,7 @@ import { |
4 | 4 | postServiceOrderAfterSalesCompletion, |
5 | 5 | postServiceOrderNoNeedSend, |
6 | 6 | postServiceOrderOrderCancel, |
7 | + postServiceOrderProcurePrint, | |
7 | 8 | postServiceOrderQueryServiceOrder, |
8 | 9 | } from '@/services'; |
9 | 10 | import { orderExport } from '@/services/order'; |
... | ... | @@ -102,7 +103,7 @@ const OrderPage = () => { |
102 | 103 | const [deliverInfoDrawerVisible, setDeliverInfoDrawerVisible] = |
103 | 104 | useState<boolean>(false); |
104 | 105 | const [orderOptType, setOrderOptType] = useState<string>(''); |
105 | - const [isFinalcialEdit, setIsFinalcialEdit] = useState<boolean>(false); | |
106 | + const [isEdit, setIsEdit] = useState<boolean>(false); | |
106 | 107 | const [expandedRowKeys, setExpandedRowKeys] = useState<Key[]>([]); |
107 | 108 | const [orderRow, setOrderRow] = useState<Partial<OrderType>>({}); |
108 | 109 | const [mainOrderAllItemKeys, setMainOrderAllItemKeys] = useState([]); |
... | ... | @@ -117,6 +118,10 @@ const OrderPage = () => { |
117 | 118 | const [currentPage, setCurrentPage] = useState(1); |
118 | 119 | const [orderCheckType, setOrderCheckType] = useState(''); |
119 | 120 | const [onlyShowCancelOrder, setOnlyShowCancelOrder] = useState(false); |
121 | + const [onlyShowProcureToBeProcessed, setOnlyShowProcureToBeProcessed] = | |
122 | + useState(false); | |
123 | + const [onlyShowFinancialToBeProcessed, setOnlyShowFinancialToBeProcessed] = | |
124 | + useState(false); | |
120 | 125 | const mainTableRef = useRef(); |
121 | 126 | let [searchParams, setSearchParam] = useState(Object); //表格的查询条件存储 |
122 | 127 | const [messageApi, contextHolder] = message.useMessage(); |
... | ... | @@ -158,6 +163,16 @@ const OrderPage = () => { |
158 | 163 | refreshTable(); |
159 | 164 | } |
160 | 165 | |
166 | + function changeProcureToBeProcessed(e: any) { | |
167 | + setOnlyShowProcureToBeProcessed(e.target.checked); | |
168 | + refreshTable(); | |
169 | + } | |
170 | + | |
171 | + function changeFinancialToBeProcessed(e: any) { | |
172 | + setOnlyShowFinancialToBeProcessed(e.target.checked); | |
173 | + refreshTable(); | |
174 | + } | |
175 | + | |
161 | 176 | // const resize = () => { |
162 | 177 | // // 计算元素底部到视口顶部的距离 |
163 | 178 | // let bottomDistance = document |
... | ... | @@ -432,6 +447,7 @@ const OrderPage = () => { |
432 | 447 | </div> |
433 | 448 | {/* 编辑备注按钮 */} |
434 | 449 | <EditTwoTone |
450 | + className="pl-1 hover:curcor-pointer" | |
435 | 451 | onClick={() => { |
436 | 452 | setNotesEditVisible(true); |
437 | 453 | setOrderRow(optRecord); |
... | ... | @@ -709,19 +725,36 @@ const OrderPage = () => { |
709 | 725 | )} |
710 | 726 | |
711 | 727 | {optRecord.subPath?.includes('procurePrint') ? ( |
712 | - <Button | |
728 | + <ButtonConfirm | |
713 | 729 | className="p-0" |
714 | - type="link" | |
715 | - onClick={async () => { | |
716 | - setOrderPrintVisible(true); | |
717 | - setSelectedRows([optRecord]); | |
718 | - setOrderRow(record); | |
719 | - setOrderCheckType(CHECK_TYPE.PROCURE); | |
730 | + title="确认打印?" | |
731 | + text="采购打印" | |
732 | + onConfirm={async () => { | |
733 | + let res = await postServiceOrderProcurePrint({ | |
734 | + data: { | |
735 | + ids: [optRecord.id], | |
736 | + }, | |
737 | + }); | |
738 | + | |
739 | + if (res.result === RESPONSE_CODE.SUCCESS) { | |
740 | + message.success(res.message); | |
741 | + refreshTable(); | |
742 | + } | |
720 | 743 | }} |
721 | - > | |
722 | - 采购打印 | |
723 | - </Button> | |
744 | + /> | |
724 | 745 | ) : ( |
746 | + // <Button | |
747 | + // className="p-0" | |
748 | + // type="link" | |
749 | + // onClick={async () => { | |
750 | + // setOrderPrintVisible(true); | |
751 | + // setSelectedRows([optRecord]); | |
752 | + // setOrderRow(record); | |
753 | + // setOrderCheckType(CHECK_TYPE.PROCURE); | |
754 | + // }} | |
755 | + // > | |
756 | + // 采购打印 | |
757 | + // </Button> | |
725 | 758 | '' |
726 | 759 | )} |
727 | 760 | |
... | ... | @@ -733,7 +766,7 @@ const OrderPage = () => { |
733 | 766 | setFinancialVisible(true); |
734 | 767 | setOrderRow(record); |
735 | 768 | setSelectedRows([optRecord]); |
736 | - setIsFinalcialEdit(true); | |
769 | + setIsEdit(true); | |
737 | 770 | }} |
738 | 771 | > |
739 | 772 | 编辑 |
... | ... | @@ -747,7 +780,7 @@ const OrderPage = () => { |
747 | 780 | type="link" |
748 | 781 | onClick={() => { |
749 | 782 | setFinancialVisible(true); |
750 | - setIsFinalcialEdit(false); | |
783 | + setIsEdit(false); | |
751 | 784 | setOrderRow(record); |
752 | 785 | setSelectedRows([optRecord]); |
753 | 786 | setIsMainOrder(false); |
... | ... | @@ -766,6 +799,7 @@ const OrderPage = () => { |
766 | 799 | onClick={() => { |
767 | 800 | setApplyForInvoicingVisible(true); |
768 | 801 | setSelectedRows([optRecord]); |
802 | + setIsEdit(false); | |
769 | 803 | }} |
770 | 804 | > |
771 | 805 | 申请开票 |
... | ... | @@ -963,7 +997,7 @@ const OrderPage = () => { |
963 | 997 | placement="topLeft" |
964 | 998 | > |
965 | 999 | <span className="text-[#8C8C8C]"> |
966 | - 销售申请开票备注: | |
1000 | + 申请开票备注: | |
967 | 1001 | {optRecord.applyInvoicingNotes === undefined || |
968 | 1002 | optRecord.applyInvoicingNotes === null |
969 | 1003 | ? '暂无备注' |
... | ... | @@ -973,6 +1007,17 @@ const OrderPage = () => { |
973 | 1007 | </div> |
974 | 1008 | |
975 | 1009 | {getAfterAnnexList()} |
1010 | + | |
1011 | + <Tooltip title="编辑"> | |
1012 | + <EditTwoTone | |
1013 | + className="pl-1 hover:curcor-pointer" | |
1014 | + onClick={() => { | |
1015 | + setApplyForInvoicingVisible(true); | |
1016 | + setSelectedRows([optRecord]); | |
1017 | + setIsEdit(true); | |
1018 | + }} | |
1019 | + /> | |
1020 | + </Tooltip> | |
976 | 1021 | </div> |
977 | 1022 | <Divider type="vertical" className="mx-5" /> |
978 | 1023 | <div className="flex items-center max-w-[500px]"> |
... | ... | @@ -1114,7 +1159,7 @@ const OrderPage = () => { |
1114 | 1159 | </div> |
1115 | 1160 | <Tooltip title="编辑"> |
1116 | 1161 | <EditTwoTone |
1117 | - className="hover:curcor-pointer" | |
1162 | + className="pl-1 hover:curcor-pointer" | |
1118 | 1163 | onClick={() => { |
1119 | 1164 | setNotesEditVisible(true); |
1120 | 1165 | setOrderRow(record); |
... | ... | @@ -1344,7 +1389,7 @@ const OrderPage = () => { |
1344 | 1389 | } |
1345 | 1390 | setOrderRow(record); |
1346 | 1391 | setFinancialVisible(true); |
1347 | - setIsFinalcialEdit(false); | |
1392 | + setIsEdit(false); | |
1348 | 1393 | }} |
1349 | 1394 | > |
1350 | 1395 | 开票 |
... | ... | @@ -1378,6 +1423,7 @@ const OrderPage = () => { |
1378 | 1423 | } |
1379 | 1424 | } |
1380 | 1425 | setApplyForInvoicingVisible(true); |
1426 | + setIsEdit(false); | |
1381 | 1427 | }} |
1382 | 1428 | > |
1383 | 1429 | 申请开票 |
... | ... | @@ -1674,22 +1720,58 @@ const OrderPage = () => { |
1674 | 1720 | )} |
1675 | 1721 | |
1676 | 1722 | {record.mainPath?.includes('procurePrint') ? ( |
1677 | - <Button | |
1723 | + <ButtonConfirm | |
1678 | 1724 | className="p-0" |
1679 | - type="link" | |
1680 | - onClick={() => { | |
1681 | - if (!selectedRowObj[record.id]?.length) { | |
1682 | - return message.error('请选择选择子订单'); | |
1725 | + title="确认打印?" | |
1726 | + text="采购打印" | |
1727 | + onConfirm={async () => { | |
1728 | + let selectedSubOrders = selectedRowObj[record.id]; | |
1729 | + if (selectedSubOrders === undefined) { | |
1730 | + selectedSubOrders = record.subOrderInformationLists; | |
1731 | + } | |
1732 | + for (let i = 0; i < selectedSubOrders.length; i++) { | |
1733 | + if ( | |
1734 | + selectedSubOrders[i].orderStatus !== | |
1735 | + 'PROCURE_PROCESS_FOR_MINE' | |
1736 | + ) { | |
1737 | + message.error( | |
1738 | + '请选择采购待打印状态的子订单进行打印', | |
1739 | + ); | |
1740 | + return false; | |
1741 | + } | |
1742 | + } | |
1743 | + | |
1744 | + const ids = selectedSubOrders?.map((item) => { | |
1745 | + return item.id; | |
1746 | + }); | |
1747 | + let res = await postServiceOrderProcurePrint({ | |
1748 | + data: { | |
1749 | + ids: ids, | |
1750 | + }, | |
1751 | + }); | |
1752 | + | |
1753 | + if (res.result === RESPONSE_CODE.SUCCESS) { | |
1754 | + message.success(res.message); | |
1755 | + refreshTable(); | |
1683 | 1756 | } |
1684 | - setSelectedRows(selectedRowObj[record.id]); | |
1685 | - setOrderRow(record); | |
1686 | - setOrderPrintVisible(true); | |
1687 | - setOrderCheckType(CHECK_TYPE.PROCURE); | |
1688 | 1757 | }} |
1689 | - > | |
1690 | - 采购打印 | |
1691 | - </Button> | |
1758 | + /> | |
1692 | 1759 | ) : ( |
1760 | + // <Button | |
1761 | + // className="p-0" | |
1762 | + // type="link" | |
1763 | + // onClick={() => { | |
1764 | + // if (!selectedRowObj[record.id]?.length) { | |
1765 | + // return message.error('请选择选择子订单'); | |
1766 | + // } | |
1767 | + // setSelectedRows(selectedRowObj[record.id]); | |
1768 | + // setOrderRow(record); | |
1769 | + // setOrderPrintVisible(true); | |
1770 | + // setOrderCheckType(CHECK_TYPE.PROCURE); | |
1771 | + // }} | |
1772 | + // > | |
1773 | + // 采购打印 | |
1774 | + // </Button> | |
1693 | 1775 | '' |
1694 | 1776 | )} |
1695 | 1777 | </Space> |
... | ... | @@ -1722,12 +1804,38 @@ const OrderPage = () => { |
1722 | 1804 | ); |
1723 | 1805 | |
1724 | 1806 | function toolBarRender() { |
1807 | + let roleCode = userInfo?.roleSmallVO?.code; | |
1725 | 1808 | let toolBtns = []; |
1726 | 1809 | |
1727 | 1810 | toolBtns.push( |
1728 | 1811 | <Checkbox onChange={changeCancelOrderShow}>只看作废</Checkbox>, |
1729 | 1812 | ); |
1730 | 1813 | |
1814 | + //采购可以筛选出需要处理的订单 | |
1815 | + if (roleCode === 'procure') { | |
1816 | + toolBtns.push( | |
1817 | + <Checkbox onChange={changeProcureToBeProcessed}>只看需处理</Checkbox>, | |
1818 | + ); | |
1819 | + } | |
1820 | + | |
1821 | + //财务可以将需要处理的订单排序到前面 | |
1822 | + if (roleCode === 'finance') { | |
1823 | + toolBtns.push( | |
1824 | + <Checkbox onChange={changeFinancialToBeProcessed}>排序</Checkbox>, | |
1825 | + ); | |
1826 | + } | |
1827 | + | |
1828 | + if (roleCode === 'admin') { | |
1829 | + toolBtns.push( | |
1830 | + <Checkbox onChange={changeProcureToBeProcessed}> | |
1831 | + 只看需处理(采购) | |
1832 | + </Checkbox>, | |
1833 | + ); | |
1834 | + toolBtns.push( | |
1835 | + <Checkbox onChange={changeFinancialToBeProcessed}>排序</Checkbox>, | |
1836 | + ); | |
1837 | + } | |
1838 | + | |
1731 | 1839 | //导出按钮配置 |
1732 | 1840 | const items: MenuProps['items'] = [ |
1733 | 1841 | { |
... | ... | @@ -1920,7 +2028,6 @@ const OrderPage = () => { |
1920 | 2028 | sorter, |
1921 | 2029 | filter, |
1922 | 2030 | ) => { |
1923 | - //保存这个搜索条件 | |
1924 | 2031 | //订单id处理 |
1925 | 2032 | if (params.id !== '') { |
1926 | 2033 | if (params.id?.indexOf(',')) { |
... | ... | @@ -1930,6 +2037,19 @@ const OrderPage = () => { |
1930 | 2037 | }); |
1931 | 2038 | } |
1932 | 2039 | } |
2040 | + //采购是否只查看需要自己处理的 | |
2041 | + if (onlyShowProcureToBeProcessed) { | |
2042 | + params.condition = 10; | |
2043 | + } | |
2044 | + | |
2045 | + //财务是否只查看需要自己处理的 | |
2046 | + if (onlyShowFinancialToBeProcessed) { | |
2047 | + params.condition = 20; | |
2048 | + } | |
2049 | + | |
2050 | + //是否只查看已作废 | |
2051 | + params.isDeleteQueryOrder = onlyShowCancelOrder; | |
2052 | + //保存这个搜索条件 | |
1933 | 2053 | setSearchParam(params); |
1934 | 2054 | const { data } = await postServiceOrderQueryServiceOrder({ |
1935 | 2055 | // ...params, |
... | ... | @@ -1937,7 +2057,7 @@ const OrderPage = () => { |
1937 | 2057 | // @ts-ignore |
1938 | 2058 | sorter, |
1939 | 2059 | filter, |
1940 | - data: { ...params, isDeleteQueryOrder: onlyShowCancelOrder }, | |
2060 | + data: { ...params }, | |
1941 | 2061 | }); |
1942 | 2062 | |
1943 | 2063 | let mainOrderIds = data?.data?.map((d) => d.id); |
... | ... | @@ -1992,6 +2112,7 @@ const OrderPage = () => { |
1992 | 2112 | <ApplyForInvoicingModal |
1993 | 2113 | setCheckVisible={setApplyForInvoicingVisible} |
1994 | 2114 | subOrders={selectedRows} |
2115 | + isEdit={isEdit} | |
1995 | 2116 | onClose={() => { |
1996 | 2117 | setApplyForInvoicingVisible(false); |
1997 | 2118 | setSelectedRows({}); |
... | ... | @@ -2032,7 +2153,7 @@ const OrderPage = () => { |
2032 | 2153 | |
2033 | 2154 | {financialVisible && ( |
2034 | 2155 | <FinancialDrawer |
2035 | - isEdit={isFinalcialEdit} | |
2156 | + isEdit={isEdit} | |
2036 | 2157 | mainOrder={orderRow} |
2037 | 2158 | subOrders={selectedRows} |
2038 | 2159 | isMainOrder={isMainOrder} |
... | ... | @@ -2040,14 +2161,14 @@ const OrderPage = () => { |
2040 | 2161 | setFinancialVisible(false); |
2041 | 2162 | setOrderRow({}); |
2042 | 2163 | setIsMainOrder(false); |
2043 | - setIsFinalcialEdit(false); | |
2164 | + setIsEdit(false); | |
2044 | 2165 | }} |
2045 | 2166 | onClose={() => { |
2046 | 2167 | setFinancialVisible(false); |
2047 | 2168 | setOrderRow({}); |
2048 | 2169 | refreshTable(); |
2049 | 2170 | setIsMainOrder(false); |
2050 | - setIsFinalcialEdit(false); | |
2171 | + setIsEdit(false); | |
2051 | 2172 | }} |
2052 | 2173 | /> |
2053 | 2174 | )} | ... | ... |
src/pages/OrderPrint/OrderPrintModal.tsx
... | ... | @@ -45,10 +45,10 @@ export default ({ |
45 | 45 | return; |
46 | 46 | } |
47 | 47 | confirm({ |
48 | - title: '确认打印出货单', | |
48 | + title: '打印出货单', | |
49 | 49 | icon: <ExclamationCircleFilled />, |
50 | - content: '您是否已打印出货单?', | |
51 | - okText: '是的我已打印', | |
50 | + content: '请确认订单信息是否正确。点击打印后订单状态将变为待发货状态。', | |
51 | + okText: '打印', | |
52 | 52 | okType: 'primary', |
53 | 53 | okButtonProps: {}, |
54 | 54 | cancelText: '取消', |
... | ... | @@ -80,6 +80,15 @@ export default ({ |
80 | 80 | } |
81 | 81 | |
82 | 82 | if (res.result === RESPONSE_CODE.SUCCESS) { |
83 | + //printJS打印出货单 | |
84 | + printJS({ | |
85 | + printable: 'printArea', // 元素id,不支持多个 | |
86 | + scanStyles: false, | |
87 | + type: 'html', | |
88 | + targetStyle: ['* '], | |
89 | + targetStyles: ['*'], | |
90 | + style: printerCSS(), | |
91 | + }); | |
83 | 92 | message.success(res.message); |
84 | 93 | onClose(); |
85 | 94 | } |
... | ... | @@ -96,19 +105,18 @@ export default ({ |
96 | 105 | centered |
97 | 106 | open |
98 | 107 | onOk={() => { |
99 | - //printJS打印出货单 | |
100 | - printJS({ | |
101 | - printable: 'printArea', // 元素id,不支持多个 | |
102 | - scanStyles: false, | |
103 | - type: 'html', | |
104 | - targetStyle: ['* '], | |
105 | - targetStyles: ['*'], | |
106 | - style: printerCSS(), | |
107 | - onPrintDialogClose: () => { | |
108 | - showPropsConfirm(); | |
109 | - }, | |
110 | - }); | |
111 | - | |
108 | + if (isRePrint) { | |
109 | + printJS({ | |
110 | + printable: 'printArea', // 元素id,不支持多个 | |
111 | + scanStyles: false, | |
112 | + type: 'html', | |
113 | + targetStyle: ['* '], | |
114 | + targetStyles: ['*'], | |
115 | + style: printerCSS(), | |
116 | + }); | |
117 | + setVisible(false); | |
118 | + } | |
119 | + showPropsConfirm(); | |
112 | 120 | // onClose(); |
113 | 121 | }} |
114 | 122 | onCancel={() => setVisible(false)} | ... | ... |