Commit e3479f505b75434dc424f9e47f18bbd9f194c5f2
1 parent
69baaa5e
feat: update供应商账号信息显示调整
Showing
6 changed files
with
602 additions
and
308 deletions
src/pages/Order/components/ModifiedDiffModal.tsx
1 | 1 | import { postServiceOrderModifiedDiff } from '@/services'; |
2 | 2 | import { enumValueToLabel, getAliYunOSSFileNameFromUrl } from '@/utils'; |
3 | -import { Button, Modal, Space, Table, TableProps } from 'antd'; | |
3 | +import { getReceivingCompanyOptions } from '@/utils/order'; | |
4 | +import { Button, Divider, Modal, Space, Table, TableProps } from 'antd'; | |
4 | 5 | import Base64 from 'base-64'; |
5 | 6 | import { useEffect, useState } from 'react'; |
6 | 7 | import { |
8 | + PAYEE_OPTIONS, | |
7 | 9 | PRODUCT_BELONG_DEPARTMENT_OPTIONS, |
8 | 10 | SHIPPING_WAREHOUSE_OPTIONS, |
9 | 11 | } from '../constant'; |
10 | 12 | import '../table.less'; |
11 | 13 | |
12 | -export default ({ setVisible, subOrders, onClose }) => { | |
13 | - let ids = subOrders?.map((item: any) => { | |
14 | +export default ({ setVisible, subOrders, mainOrder, onClose }) => { | |
15 | + let subIds = subOrders?.map((item: any) => { | |
14 | 16 | return item.id; |
15 | 17 | }); |
16 | 18 | |
17 | - const [diffDatas, setDiffDatas] = useState([]); | |
19 | + let mainId = mainOrder?.id; | |
20 | + | |
21 | + const [subOrderDiffs, setSubOrderDiffs] = useState([]); | |
22 | + const [mainOrderDiffs, setMainOrderDiffs] = useState([]); | |
18 | 23 | |
19 | 24 | async function loadData() { |
20 | 25 | let res = await postServiceOrderModifiedDiff({ |
21 | 26 | data: { |
22 | - subOrderIds: ids, | |
27 | + subOrderIds: subIds, | |
28 | + mainOrderId: mainId, | |
23 | 29 | }, |
24 | 30 | }); |
25 | - let datas = res?.data; | |
26 | - setDiffDatas(datas); | |
31 | + setSubOrderDiffs(res?.data?.subOrderDiffs); | |
32 | + setMainOrderDiffs(res?.data?.mainOrderDiffs); | |
27 | 33 | } |
28 | 34 | |
29 | 35 | useEffect(() => { |
... | ... | @@ -41,6 +47,12 @@ export default ({ setVisible, subOrders, onClose }) => { |
41 | 47 | if (key === '单价' || key === '合计') { |
42 | 48 | newText = '¥' + newText; |
43 | 49 | } |
50 | + if (key === '开票收款单位') { | |
51 | + newText = enumValueToLabel( | |
52 | + text, | |
53 | + getReceivingCompanyOptions(PAYEE_OPTIONS), | |
54 | + ); | |
55 | + } | |
44 | 56 | return newText; |
45 | 57 | } |
46 | 58 | |
... | ... | @@ -73,7 +85,7 @@ export default ({ setVisible, subOrders, onClose }) => { |
73 | 85 | return ( |
74 | 86 | <div |
75 | 87 | title={toChineseName(record.fieldName, value)} |
76 | - className="max-w-[300px] whitespace-no-wrap overflow-hidden overflow-ellipsis" | |
88 | + className="max-w-[250px] whitespace-no-wrap overflow-hidden overflow-ellipsis" | |
77 | 89 | > |
78 | 90 | <span className={record.isDiff ? 'text-[red]' : ''}> |
79 | 91 | {toChineseName(record.fieldName, value)} |
... | ... | @@ -94,6 +106,16 @@ export default ({ setVisible, subOrders, onClose }) => { |
94 | 106 | title: '字段名', |
95 | 107 | dataIndex: 'fieldName', |
96 | 108 | key: 'fieldName', |
109 | + render(value) { | |
110 | + return ( | |
111 | + <div | |
112 | + title={value} | |
113 | + className="max-w-[80px] whitespace-no-wrap overflow-hidden overflow-ellipsis" | |
114 | + > | |
115 | + {value} | |
116 | + </div> | |
117 | + ); | |
118 | + }, | |
97 | 119 | }, |
98 | 120 | { |
99 | 121 | title: '修改前字段值', |
... | ... | @@ -113,6 +135,97 @@ export default ({ setVisible, subOrders, onClose }) => { |
113 | 135 | }, |
114 | 136 | ]; |
115 | 137 | |
138 | + function loadSubOrderDiffTable(item: any, index: any) { | |
139 | + //转换为表格数据 | |
140 | + let oldDatas = item[0]; | |
141 | + let curDatas = item[1]; | |
142 | + let diffFiledNames = oldDatas?.diffFieldsName; | |
143 | + | |
144 | + let tableData = []; | |
145 | + let visibleFields = [ | |
146 | + ['productName', '商品名称'], | |
147 | + ['productCode', '商品编码'], | |
148 | + ['parameters', '商品参数'], | |
149 | + ['quantity', '数量'], | |
150 | + ['productPrice', '单价'], | |
151 | + ['unit', '单位'], | |
152 | + ['subOrderPayment', '合计'], | |
153 | + ['productBelongBusiness', '所属事业部'], | |
154 | + ['shippingWarehouse', '发货仓库'], | |
155 | + ['notes', '备注'], | |
156 | + ['listAnnex', '附件'], | |
157 | + ]; | |
158 | + for (let field of visibleFields) { | |
159 | + let filedKey = field[0]; | |
160 | + let filedName = field[1]; | |
161 | + tableData.push({ | |
162 | + fieldName: filedName, | |
163 | + oldValue: oldDatas[filedKey], | |
164 | + newValue: curDatas[filedKey], | |
165 | + isDiff: diffFiledNames?.includes(filedKey), | |
166 | + }); | |
167 | + } | |
168 | + return ( | |
169 | + <> | |
170 | + <Divider orientation="left">商品{index + 1}:</Divider> | |
171 | + <Table | |
172 | + className="myTable" | |
173 | + size="small" | |
174 | + pagination={false} | |
175 | + key={index} | |
176 | + columns={columns} | |
177 | + dataSource={tableData} | |
178 | + /> | |
179 | + </> | |
180 | + ); | |
181 | + } | |
182 | + | |
183 | + function loadMainOrderDiffTable(item: any, index: any) { | |
184 | + if (!item || item.length <= 0) { | |
185 | + return; | |
186 | + } | |
187 | + //转换为表格数据 | |
188 | + let oldDatas = item[0]; | |
189 | + let curDatas = item[1]; | |
190 | + let diffFiledNames = oldDatas?.diffFieldsName; | |
191 | + | |
192 | + let tableData = []; | |
193 | + let visibleFields = [ | |
194 | + ['salesCode', '销售代号'], | |
195 | + ['customerName', '收货人姓名'], | |
196 | + ['customerContactNumber', '收货人联系手机号'], | |
197 | + ['customerShippingAddress', '收货人地址信息'], | |
198 | + ['institutionContactName', '单位联系人'], | |
199 | + ['institution', '单位'], | |
200 | + ['totalPayment', '支付总金额'], | |
201 | + ['notes', '备注'], | |
202 | + ['bank', '开户银行'], | |
203 | + ['bankAccountNumber', '银行账号'], | |
204 | + ['invoiceIdentificationNumber', '开票识别号'], | |
205 | + ['receivingCompany', '开票收款单位'], | |
206 | + ]; | |
207 | + for (let field of visibleFields) { | |
208 | + let filedKey = field[0]; | |
209 | + let filedName = field[1]; | |
210 | + tableData.push({ | |
211 | + fieldName: filedName, | |
212 | + oldValue: oldDatas[filedKey], | |
213 | + newValue: curDatas[filedKey], | |
214 | + isDiff: diffFiledNames?.includes(filedKey), | |
215 | + }); | |
216 | + } | |
217 | + return ( | |
218 | + <Table | |
219 | + className="myTable" | |
220 | + size="small" | |
221 | + pagination={false} | |
222 | + key={index} | |
223 | + columns={columns} | |
224 | + dataSource={tableData} | |
225 | + /> | |
226 | + ); | |
227 | + } | |
228 | + | |
116 | 229 | return ( |
117 | 230 | <> |
118 | 231 | <Modal |
... | ... | @@ -125,48 +238,20 @@ export default ({ setVisible, subOrders, onClose }) => { |
125 | 238 | setVisible(false); |
126 | 239 | onClose(); |
127 | 240 | }} |
241 | + onCancel={() => { | |
242 | + setVisible(false); | |
243 | + }} | |
244 | + cancelButtonProps={{ | |
245 | + hidden: true, | |
246 | + }} | |
128 | 247 | destroyOnClose={true} |
129 | 248 | > |
130 | - {diffDatas?.map((item: any, index) => { | |
131 | - //转换为表格数据 | |
132 | - let oldDatas = item[0]; | |
133 | - let curDatas = item[1]; | |
134 | - let diffFiledNames = oldDatas?.diffFieldsName; | |
249 | + <Divider>主订单信息:</Divider> | |
250 | + {loadMainOrderDiffTable(mainOrderDiffs, 0)} | |
135 | 251 | |
136 | - let tableData = []; | |
137 | - let visibleFields = [ | |
138 | - ['productName', '商品名称'], | |
139 | - ['productCode', '商品编码'], | |
140 | - ['parameters', '商品参数'], | |
141 | - ['quantity', '数量'], | |
142 | - ['productPrice', '单价'], | |
143 | - ['unit', '单位'], | |
144 | - ['subOrderPayment', '合计'], | |
145 | - ['productBelongBusiness', '所属事业部'], | |
146 | - ['shippingWarehouse', '发货仓库'], | |
147 | - ['notes', '备注'], | |
148 | - ['listAnnex', '附件'], | |
149 | - ]; | |
150 | - for (let field of visibleFields) { | |
151 | - let filedKey = field[0]; | |
152 | - let filedName = field[1]; | |
153 | - tableData.push({ | |
154 | - fieldName: filedName, | |
155 | - oldValue: oldDatas[filedKey], | |
156 | - newValue: curDatas[filedKey], | |
157 | - isDiff: diffFiledNames?.includes(filedKey), | |
158 | - }); | |
159 | - } | |
160 | - return ( | |
161 | - <Table | |
162 | - className="myTable" | |
163 | - size="small" | |
164 | - pagination={false} | |
165 | - key={index} | |
166 | - columns={columns} | |
167 | - dataSource={tableData} | |
168 | - /> | |
169 | - ); | |
252 | + <Divider>子订单信息:</Divider> | |
253 | + {subOrderDiffs?.map((item: any, index) => { | |
254 | + return loadSubOrderDiffTable(item, index); | |
170 | 255 | })} |
171 | 256 | </Modal> |
172 | 257 | </> | ... | ... |
src/pages/Order/components/ProcureCheckModal.tsx
... | ... | @@ -13,9 +13,10 @@ import { Button, Form, Input, Popconfirm, message } from 'antd'; |
13 | 13 | import { useState } from 'react'; |
14 | 14 | export default ({ setCheckVisible, isMainOrder, orders, onClose }) => { |
15 | 15 | const [form] = Form.useForm<{ supplier: string }>(); |
16 | - console.log(isMainOrder); | |
17 | 16 | const [checkNotes, setCheckNotes] = useState<string>(''); |
18 | 17 | |
18 | + console.log(isMainOrder); | |
19 | + | |
19 | 20 | let ids: any[] = orders.map((order: any) => order.id); |
20 | 21 | async function doCheck(body: object) { |
21 | 22 | const data = await postServiceOrderProcureCheckOrder({ | ... | ... |
src/pages/Order/components/ProcureConvertModal.tsx
... | ... | @@ -16,15 +16,7 @@ export default ({ setVisible, subOrders, onClose }) => { |
16 | 16 | procureConvertNotes: string; |
17 | 17 | }>(); |
18 | 18 | |
19 | - // const [checkNotes, setCheckNotes] = useState<string>(''); | |
20 | - | |
21 | - let subOrderIds: any[] = []; | |
22 | - //是单条子订单审核 | |
23 | - if (subOrders === undefined) { | |
24 | - subOrderIds = [data.id]; | |
25 | - } else { | |
26 | - subOrderIds = subOrders.map((subOrder) => subOrder.id); | |
27 | - } | |
19 | + let subOrderIds: any[] = subOrders?.map((subOrder) => subOrder.id); | |
28 | 20 | |
29 | 21 | return ( |
30 | 22 | <ModalForm<{ |
... | ... | @@ -100,7 +92,6 @@ export default ({ setVisible, subOrders, onClose }) => { |
100 | 92 | label="转发备注" |
101 | 93 | width="lg" |
102 | 94 | name="procureConvertNotes" |
103 | - // options={options} | |
104 | 95 | placeholder="请填写转发备注" |
105 | 96 | /> |
106 | 97 | </ModalForm> | ... | ... |
src/pages/Order/constant.ts
... | ... | @@ -168,6 +168,13 @@ export const ORDER_STATUS_OPTIONS = { |
168 | 168 | PROCURE_CONVERT_WAREHOUSE_KEEPER: '采购转仓库', |
169 | 169 | }; |
170 | 170 | |
171 | +export const MODIFIED_AUDIT_STATUS_OPTIONS = { | |
172 | + AUDIT_FAILURE: '审核成功', | |
173 | + PENDING_AUDIT_FOR_CURRENT_NODE_PERSONNEL: '当前节点人员待审核', | |
174 | + LEADER_PENDING_AUDIT: '领导待审核', | |
175 | + AUDIT_SUCCESS: '审核成功', | |
176 | +}; | |
177 | + | |
171 | 178 | /** |
172 | 179 | * 采购筛选订单的主要订单状态 |
173 | 180 | */ |
... | ... | @@ -198,6 +205,10 @@ export const AFTER_INVOICING_STATUS = { |
198 | 205 | }; |
199 | 206 | |
200 | 207 | export const TAGS_COLOR = new Map<string, string>([ |
208 | + ['AUDIT_FAILURE', 'error'], | |
209 | + ['PENDING_AUDIT_FOR_CURRENT_NODE_PERSONNEL', 'processing'], | |
210 | + ['LEADER_PENDING_AUDIT', 'processing'], | |
211 | + ['AUDIT_SUCCESS', 'success'], | |
201 | 212 | ['UN_INVOICE', 'success'], |
202 | 213 | ['LEADER_PROCESS', 'processing'], |
203 | 214 | ['MODIFY_APPLY_WAIT_FOR_AUDIT', 'processing'], | ... | ... |
src/pages/Order/index.tsx
... | ... | @@ -89,6 +89,7 @@ import { |
89 | 89 | CHECK_TYPE, |
90 | 90 | LOGISTICS_STATUS_OPTIONS, |
91 | 91 | MAIN_ORDER_COLUMNS, |
92 | + MODIFIED_AUDIT_STATUS_OPTIONS, | |
92 | 93 | ORDER_STATUS_OPTIONS, |
93 | 94 | PAYEE_OPTIONS, |
94 | 95 | PAYMENT_CHANNEL_OPTIONS, |
... | ... | @@ -275,6 +276,7 @@ const OrderPage = () => { |
275 | 276 | function clearOptObject() { |
276 | 277 | setCurrentMainId(undefined); |
277 | 278 | setCurretnOptSubId(undefined); |
279 | + setIsMainOrder(false); | |
278 | 280 | } |
279 | 281 | |
280 | 282 | /** |
... | ... | @@ -541,12 +543,20 @@ const OrderPage = () => { |
541 | 543 | <Flex className="w-[13%]"> |
542 | 544 | <span className="font-medium">交易金额</span> |
543 | 545 | </Flex> |
544 | - <Flex className="w-[10%]"> | |
545 | - <span className="font-medium">支付</span> | |
546 | - </Flex> | |
547 | - <Flex className="w-[12%]"> | |
548 | - <span className="font-medium">其他</span> | |
549 | - </Flex> | |
546 | + | |
547 | + {userInfo.username !== '首能' ? ( | |
548 | + <> | |
549 | + <Flex className="w-[10%]"> | |
550 | + <span className="font-medium">支付</span> | |
551 | + </Flex> | |
552 | + <Flex className="w-[12%]"> | |
553 | + <span className="font-medium">其他</span> | |
554 | + </Flex> | |
555 | + </> | |
556 | + ) : ( | |
557 | + '' | |
558 | + )} | |
559 | + | |
550 | 560 | <Flex className="w-[10%]"> |
551 | 561 | <span className="font-medium">交易状态</span> |
552 | 562 | </Flex> |
... | ... | @@ -777,15 +787,17 @@ const OrderPage = () => { |
777 | 787 | '' |
778 | 788 | )} |
779 | 789 | {optRecord.modified ? ( |
780 | - <span | |
781 | - className="text-[#f44e4e] cursor-pointer" | |
782 | - onClick={async () => { | |
783 | - createOptObject(optRecord.id, record.id); | |
784 | - setModifiedDiffModalVisible(true); | |
785 | - }} | |
786 | - > | |
787 | - (修改过) | |
788 | - </span> | |
790 | + <Tooltip title="点击查看详情"> | |
791 | + <span | |
792 | + className="text-[#f44e4e] cursor-pointer" | |
793 | + onClick={async () => { | |
794 | + createOptObject(optRecord.id, record.id); | |
795 | + setModifiedDiffModalVisible(true); | |
796 | + }} | |
797 | + > | |
798 | + (修改过) | |
799 | + </span> | |
800 | + </Tooltip> | |
789 | 801 | ) : ( |
790 | 802 | '' |
791 | 803 | )} |
... | ... | @@ -805,27 +817,34 @@ const OrderPage = () => { |
805 | 817 | 参数:{optRecord.parameters} |
806 | 818 | </span> |
807 | 819 | </div> |
808 | - <Flex title={optRecord.notes}> | |
809 | - <div className="max-w-[375px] whitespace-no-wrap overflow-hidden overflow-ellipsis"> | |
810 | - <span className="text-[#8C8C8C]"> | |
811 | - 备注: | |
812 | - {optRecord.notes === null ? '暂无备注' : optRecord.notes} | |
813 | - </span> | |
814 | - </div> | |
815 | - {/* 编辑备注按钮 */} | |
816 | - <EditTwoTone | |
817 | - className="pl-1 hover:curcor-pointer" | |
818 | - onClick={() => { | |
819 | - setNotesEditVisible(true); | |
820 | - setSelectedRows([optRecord.id]); | |
821 | - setNotes(optRecord.notes); | |
822 | - setNotesType(1); | |
823 | - }} | |
824 | - /> | |
825 | - </Flex> | |
826 | - {roleCode === 'procure' || | |
827 | - roleCode === 'warehouseKeeper' || | |
828 | - roleCode === 'admin' ? ( | |
820 | + | |
821 | + {userInfo.username !== '首能' ? ( | |
822 | + <Flex title={optRecord.notes}> | |
823 | + <div className="max-w-[375px] whitespace-no-wrap overflow-hidden overflow-ellipsis"> | |
824 | + <span className="text-[#8C8C8C]"> | |
825 | + 备注: | |
826 | + {optRecord.notes === null ? '暂无备注' : optRecord.notes} | |
827 | + </span> | |
828 | + </div> | |
829 | + {/* 编辑备注按钮 */} | |
830 | + <EditTwoTone | |
831 | + className="pl-1 hover:curcor-pointer" | |
832 | + onClick={() => { | |
833 | + setNotesEditVisible(true); | |
834 | + setSelectedRows([optRecord.id]); | |
835 | + setNotes(optRecord.notes); | |
836 | + setNotesType(1); | |
837 | + }} | |
838 | + /> | |
839 | + </Flex> | |
840 | + ) : ( | |
841 | + '' | |
842 | + )} | |
843 | + | |
844 | + {(roleCode === 'procure' || | |
845 | + roleCode === 'warehouseKeeper' || | |
846 | + roleCode === 'admin') && | |
847 | + userInfo.username !== '首能' ? ( | |
829 | 848 | <> |
830 | 849 | <Flex title={optRecord.supplierName}> |
831 | 850 | <div className="max-w-[90%] whitespace-no-wrap overflow-hidden overflow-ellipsis"> |
... | ... | @@ -899,13 +918,22 @@ const OrderPage = () => { |
899 | 918 | )} */} |
900 | 919 | </Flex> |
901 | 920 | <Flex className="w-[13%]" vertical gap="small"> |
902 | - <div | |
903 | - className="overflow-hidden whitespace-no-wrap overflow-ellipsis" | |
904 | - title={optRecord.productPrice} | |
905 | - > | |
906 | - <span className="text-[#8C8C8C]">单价:</span> | |
907 | - <span className="text-slate-700">¥{optRecord.productPrice}</span> | |
908 | - </div> | |
921 | + {userInfo.username !== '首能' ? ( | |
922 | + <> | |
923 | + <div | |
924 | + className="overflow-hidden whitespace-no-wrap overflow-ellipsis" | |
925 | + title={optRecord.productPrice} | |
926 | + > | |
927 | + <span className="text-[#8C8C8C]">单价:</span> | |
928 | + <span className="text-slate-700"> | |
929 | + ¥{optRecord.productPrice} | |
930 | + </span> | |
931 | + </div> | |
932 | + </> | |
933 | + ) : ( | |
934 | + '' | |
935 | + )} | |
936 | + | |
909 | 937 | <div |
910 | 938 | className="overflow-hidden whitespace-no-wrap overflow-ellipsis" |
911 | 939 | title={optRecord.quantity} |
... | ... | @@ -916,143 +944,166 @@ const OrderPage = () => { |
916 | 944 | </span> |
917 | 945 | <span className="text-[#8C8C8C]">{optRecord.unit}</span> |
918 | 946 | </div> |
919 | - <div | |
920 | - className="overflow-hidden whitespace-no-wrap overflow-ellipsis" | |
921 | - title={optRecord.subOrderPayment} | |
922 | - > | |
923 | - <span className="text-[#8C8C8C]">合计:</span> | |
924 | - <span className="text-slate-700"> | |
925 | - ¥{optRecord.subOrderPayment} | |
926 | - </span> | |
927 | - </div> | |
928 | - </Flex> | |
929 | - <Flex className="w-[10%]" vertical gap="small"> | |
930 | - {/* 支付方式 */} | |
931 | - <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> | |
932 | - <span className="text-slate-700"> | |
933 | - {enumValueToLabel( | |
934 | - optRecord.paymentMethod, | |
935 | - PAYMENT_METHOD_OPTIONS, | |
936 | - )} | |
937 | - </span> | |
938 | - </div> | |
939 | - {/* 支付渠道 */} | |
940 | - <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> | |
941 | - <span className="text-slate-700"> | |
942 | - {enumValueToLabel( | |
943 | - optRecord.paymentChannel, | |
944 | - PAYMENT_CHANNEL_OPTIONS, | |
945 | - )} | |
946 | - </span> | |
947 | - </div> | |
948 | - </Flex> | |
949 | - <Flex className="w-[13%]" vertical gap="small"> | |
950 | - {/* 所属部门 */} | |
951 | - <div | |
952 | - className="overflow-hidden whitespace-no-wrap overflow-ellipsis" | |
953 | - title={enumValueToLabel( | |
954 | - optRecord.productBelongBusiness, | |
955 | - PRODUCT_BELONG_DEPARTMENT_OPTIONS, | |
956 | - )} | |
957 | - > | |
958 | - <span className="text-slate-700"> | |
959 | - {enumValueToLabel( | |
960 | - optRecord.productBelongBusiness, | |
961 | - PRODUCT_BELONG_DEPARTMENT_OPTIONS, | |
962 | - )} | |
963 | - </span> | |
964 | - </div> | |
965 | 947 | |
966 | - {/* 开票类型 */} | |
967 | - {optRecord.invoicingStatus !== null ? ( | |
968 | - <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> | |
948 | + {userInfo.username !== '首能' ? ( | |
949 | + <div | |
950 | + className="overflow-hidden whitespace-no-wrap overflow-ellipsis" | |
951 | + title={optRecord.subOrderPayment} | |
952 | + > | |
953 | + <span className="text-[#8C8C8C]">合计:</span> | |
969 | 954 | <span className="text-slate-700"> |
970 | - {getInvoicingType(optRecord)} | |
955 | + ¥{optRecord.subOrderPayment} | |
971 | 956 | </span> |
972 | 957 | </div> |
973 | 958 | ) : ( |
974 | 959 | '' |
975 | 960 | )} |
961 | + </Flex> | |
976 | 962 | |
977 | - {/* 开票状态 */} | |
978 | - <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> | |
979 | - <span className="text-slate-700"> | |
980 | - {enumValueToLabel( | |
981 | - optRecord.afterInvoicingStatus, | |
982 | - AFTER_INVOICING_STATUS, | |
983 | - )} | |
984 | - </span> | |
985 | - </div> | |
986 | - | |
987 | - {/* 是否加急图标显示 */} | |
988 | - {optRecord.isUrgent ? ( | |
989 | - <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> | |
990 | - <Tooltip | |
991 | - title={'期望开票时间:' + formatdate(optRecord.deadline)} | |
992 | - > | |
993 | - <Tag color="red">加急开票</Tag> | |
994 | - </Tooltip> | |
995 | - </div> | |
963 | + <Flex className="w-[10%]" vertical gap="small"> | |
964 | + {userInfo.username !== '首能' ? ( | |
965 | + <> | |
966 | + {/* 支付方式 */} | |
967 | + <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> | |
968 | + <span className="text-slate-700"> | |
969 | + {enumValueToLabel( | |
970 | + optRecord.paymentMethod, | |
971 | + PAYMENT_METHOD_OPTIONS, | |
972 | + )} | |
973 | + </span> | |
974 | + </div> | |
975 | + {/* 支付渠道 */} | |
976 | + <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> | |
977 | + <span className="text-slate-700"> | |
978 | + {enumValueToLabel( | |
979 | + optRecord.paymentChannel, | |
980 | + PAYMENT_CHANNEL_OPTIONS, | |
981 | + )} | |
982 | + </span> | |
983 | + </div> | |
984 | + </> | |
996 | 985 | ) : ( |
997 | 986 | '' |
998 | 987 | )} |
988 | + </Flex> | |
989 | + <Flex className="w-[13%]" vertical gap="small"> | |
990 | + {userInfo.username !== '首能' ? ( | |
991 | + <> | |
992 | + {/* 所属部门 */} | |
993 | + <div | |
994 | + className="overflow-hidden whitespace-no-wrap overflow-ellipsis" | |
995 | + title={enumValueToLabel( | |
996 | + optRecord.productBelongBusiness, | |
997 | + PRODUCT_BELONG_DEPARTMENT_OPTIONS, | |
998 | + )} | |
999 | + > | |
1000 | + <span className="text-slate-700"> | |
1001 | + {enumValueToLabel( | |
1002 | + optRecord.productBelongBusiness, | |
1003 | + PRODUCT_BELONG_DEPARTMENT_OPTIONS, | |
1004 | + )} | |
1005 | + </span> | |
1006 | + </div> | |
999 | 1007 | |
1000 | - {(roleCode === 'warehouseKeeper' || roleCode === 'admin') && | |
1001 | - optRecord.shippingWarehouse !== null ? ( | |
1002 | - <div | |
1003 | - className="overflow-hidden whitespace-no-wrap overflow-ellipsis" | |
1004 | - title={enumValueToLabel( | |
1005 | - optRecord.shippingWarehouse, | |
1006 | - SHIPPING_WAREHOUSE_OPTIONS, | |
1008 | + {/* 开票类型 */} | |
1009 | + {optRecord.invoicingStatus !== null ? ( | |
1010 | + <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> | |
1011 | + <span className="text-slate-700"> | |
1012 | + {getInvoicingType(optRecord)} | |
1013 | + </span> | |
1014 | + </div> | |
1015 | + ) : ( | |
1016 | + '' | |
1007 | 1017 | )} |
1008 | - > | |
1009 | - <span className="text-slate-700"> | |
1010 | - {enumValueToLabel( | |
1011 | - optRecord.shippingWarehouse, | |
1012 | - SHIPPING_WAREHOUSE_OPTIONS, | |
1018 | + | |
1019 | + {/* 开票状态 */} | |
1020 | + <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> | |
1021 | + <span className="text-slate-700"> | |
1022 | + {enumValueToLabel( | |
1023 | + optRecord.afterInvoicingStatus, | |
1024 | + AFTER_INVOICING_STATUS, | |
1025 | + )} | |
1026 | + </span> | |
1027 | + </div> | |
1028 | + | |
1029 | + {/* 是否加急图标显示 */} | |
1030 | + {optRecord.isUrgent ? ( | |
1031 | + <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> | |
1032 | + <Tooltip | |
1033 | + title={'期望开票时间:' + formatdate(optRecord.deadline)} | |
1034 | + > | |
1035 | + <Tag color="red">加急开票</Tag> | |
1036 | + </Tooltip> | |
1037 | + </div> | |
1038 | + ) : ( | |
1039 | + '' | |
1040 | + )} | |
1041 | + | |
1042 | + {(roleCode === 'warehouseKeeper' || roleCode === 'admin') && | |
1043 | + optRecord.shippingWarehouse !== null ? ( | |
1044 | + <div | |
1045 | + className="overflow-hidden whitespace-no-wrap overflow-ellipsis" | |
1046 | + title={enumValueToLabel( | |
1047 | + optRecord.shippingWarehouse, | |
1048 | + SHIPPING_WAREHOUSE_OPTIONS, | |
1049 | + )} | |
1050 | + > | |
1051 | + <span className="text-slate-700"> | |
1052 | + {enumValueToLabel( | |
1053 | + optRecord.shippingWarehouse, | |
1054 | + SHIPPING_WAREHOUSE_OPTIONS, | |
1055 | + )} | |
1056 | + </span> | |
1057 | + </div> | |
1058 | + ) : ( | |
1059 | + '' | |
1060 | + )} | |
1061 | + | |
1062 | + {/* 生产时间 */} | |
1063 | + <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> | |
1064 | + {optRecord.productionStartTime !== null || | |
1065 | + optRecord.productionEndTime !== null ? ( | |
1066 | + <MyToolTip | |
1067 | + title={ | |
1068 | + formatdate(optRecord.productionStartTime) + | |
1069 | + ' 至 ' + | |
1070 | + formatdate(optRecord.productionEndTime) | |
1071 | + } | |
1072 | + content={ | |
1073 | + <Button type="link" size="small" style={{ padding: 0 }}> | |
1074 | + 生产时间 | |
1075 | + </Button> | |
1076 | + } | |
1077 | + /> | |
1078 | + ) : ( | |
1079 | + '' | |
1013 | 1080 | )} |
1014 | - </span> | |
1015 | - </div> | |
1081 | + </div> | |
1082 | + </> | |
1016 | 1083 | ) : ( |
1017 | 1084 | '' |
1018 | 1085 | )} |
1019 | - | |
1020 | - {/* 生产时间 */} | |
1021 | - <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> | |
1022 | - {optRecord.productionStartTime !== null || | |
1023 | - optRecord.productionEndTime !== null ? ( | |
1024 | - <MyToolTip | |
1025 | - title={ | |
1026 | - formatdate(optRecord.productionStartTime) + | |
1027 | - ' 至 ' + | |
1028 | - formatdate(optRecord.productionEndTime) | |
1029 | - } | |
1030 | - content={ | |
1031 | - <Button type="link" size="small" style={{ padding: 0 }}> | |
1032 | - 生产时间 | |
1033 | - </Button> | |
1034 | - } | |
1035 | - /> | |
1036 | - ) : ( | |
1037 | - '' | |
1038 | - )} | |
1039 | - </div> | |
1040 | 1086 | </Flex> |
1041 | 1087 | |
1042 | 1088 | <Flex className="w-[10%]" vertical gap="small"> |
1043 | 1089 | {/* 开票状态 */} |
1044 | - <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> | |
1045 | - <Tag | |
1046 | - color={ | |
1047 | - optRecord.invoicingTime === null || | |
1048 | - optRecord.invoicingTime === undefined | |
1049 | - ? TAGS_COLOR.get(optRecord.invoicingStatus) | |
1050 | - : 'success' | |
1051 | - } | |
1052 | - > | |
1053 | - {getNeedInvoicing(optRecord)} | |
1054 | - </Tag> | |
1055 | - </div> | |
1090 | + {userInfo.username !== '首能' ? ( | |
1091 | + <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> | |
1092 | + <Tag | |
1093 | + color={ | |
1094 | + optRecord.invoicingTime === null || | |
1095 | + optRecord.invoicingTime === undefined | |
1096 | + ? TAGS_COLOR.get(optRecord.invoicingStatus) | |
1097 | + : 'success' | |
1098 | + } | |
1099 | + > | |
1100 | + {getNeedInvoicing(optRecord)} | |
1101 | + </Tag> | |
1102 | + </div> | |
1103 | + ) : ( | |
1104 | + '' | |
1105 | + )} | |
1106 | + | |
1056 | 1107 | {/* 订单状态 */} |
1057 | 1108 | <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> |
1058 | 1109 | {getOrderStatusTag(optRecord)} |
... | ... | @@ -1110,6 +1161,27 @@ const OrderPage = () => { |
1110 | 1161 | ) : ( |
1111 | 1162 | '' |
1112 | 1163 | )} |
1164 | + | |
1165 | + {/* 修改审核状态 */} | |
1166 | + {optRecord.modifiedAuditStatus !== null ? ( | |
1167 | + <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> | |
1168 | + <Tooltip | |
1169 | + title={enumValueToLabel( | |
1170 | + optRecord.modifiedAuditStatus, | |
1171 | + MODIFIED_AUDIT_STATUS_OPTIONS, | |
1172 | + )} | |
1173 | + > | |
1174 | + <Tag color={TAGS_COLOR.get(optRecord.modifiedAuditStatus)}> | |
1175 | + {enumValueToLabel( | |
1176 | + optRecord.modifiedAuditStatus, | |
1177 | + MODIFIED_AUDIT_STATUS_OPTIONS, | |
1178 | + )} | |
1179 | + </Tag> | |
1180 | + </Tooltip> | |
1181 | + </div> | |
1182 | + ) : ( | |
1183 | + '' | |
1184 | + )} | |
1113 | 1185 | </div> |
1114 | 1186 | </Flex> |
1115 | 1187 | <Flex className="w-[18%]" wrap="wrap" gap="small"> |
... | ... | @@ -1136,8 +1208,7 @@ const OrderPage = () => { |
1136 | 1208 | className="p-0" |
1137 | 1209 | type="link" |
1138 | 1210 | onClick={() => { |
1139 | - setCurrentMainId(record.id); | |
1140 | - setCurretnOptSubId(optRecord.id); | |
1211 | + createOptObject(optRecord.id, record.id); | |
1141 | 1212 | setCheckVisible(true); |
1142 | 1213 | setOrderCheckType(CHECK_TYPE.WAITING_FOR_POST_AUDIT); |
1143 | 1214 | }} |
... | ... | @@ -1148,6 +1219,22 @@ const OrderPage = () => { |
1148 | 1219 | '' |
1149 | 1220 | )} |
1150 | 1221 | |
1222 | + {optRecord.subPath?.includes('modifiedAuditRequest') ? ( | |
1223 | + <Button | |
1224 | + className="p-0" | |
1225 | + type="link" | |
1226 | + onClick={() => { | |
1227 | + createOptObject(optRecord.id, record.id); | |
1228 | + setCheckVisible(true); | |
1229 | + setOrderCheckType(CHECK_TYPE.WAITING_FOR_POST_AUDIT); | |
1230 | + }} | |
1231 | + > | |
1232 | + 修改审核 | |
1233 | + </Button> | |
1234 | + ) : ( | |
1235 | + '' | |
1236 | + )} | |
1237 | + | |
1151 | 1238 | {optRecord.subPath?.includes('shippingWarehouseChangeRequest') ? ( |
1152 | 1239 | <Button |
1153 | 1240 | className="p-0" |
... | ... | @@ -1486,7 +1573,7 @@ const OrderPage = () => { |
1486 | 1573 | className="p-0" |
1487 | 1574 | type="link" |
1488 | 1575 | onClick={() => { |
1489 | - setSelectedRows([optRecord]); | |
1576 | + createOptObject(optRecord.id, record.id); | |
1490 | 1577 | setOrderCheckType(CHECK_TYPE.PROCURE); |
1491 | 1578 | setProcureConvertModalVisible(true); |
1492 | 1579 | }} |
... | ... | @@ -1831,6 +1918,21 @@ const OrderPage = () => { |
1831 | 1918 | <div> |
1832 | 1919 | <span className="text-[#8C8C8C]">订单号:</span> |
1833 | 1920 | <span className="text-slate-700">{record.id}</span> |
1921 | + {record.modified ? ( | |
1922 | + <Tooltip title="点击查看详情"> | |
1923 | + <span | |
1924 | + className="text-[#f44e4e] cursor-pointer" | |
1925 | + onClick={async () => { | |
1926 | + createOptObject(null, record.id); | |
1927 | + setModifiedDiffModalVisible(true); | |
1928 | + }} | |
1929 | + > | |
1930 | + (修改过) | |
1931 | + </span> | |
1932 | + </Tooltip> | |
1933 | + ) : ( | |
1934 | + '' | |
1935 | + )} | |
1834 | 1936 | </div> |
1835 | 1937 | </Space> |
1836 | 1938 | </Checkbox> |
... | ... | @@ -1848,38 +1950,66 @@ const OrderPage = () => { |
1848 | 1950 | <span>{formatDateTime(record.createTime)}</span> |
1849 | 1951 | <Divider type="vertical" /> |
1850 | 1952 | <Space split={<Divider type="vertical" />}> |
1851 | - <div> | |
1852 | - <span className="text-[#8C8C8C]">代表:</span> | |
1853 | - <span className="text-slate-700">{record.salesCode}</span> | |
1854 | - </div> | |
1855 | - <div | |
1856 | - title={record.institution} | |
1857 | - className="whitespace-no-wrap overflow-hidden overflow-ellipsis max-w-[150px]" | |
1858 | - > | |
1859 | - <span className="text-[#8C8C8C]">单位:</span> | |
1860 | - <span className="text-slate-700">{record.institution}</span> | |
1861 | - </div> | |
1862 | - <span> | |
1863 | - <span className="text-[#8C8C8C]">联系人:</span> | |
1864 | - <span className="text-slate-700"> | |
1865 | - {record.institutionContactName + ' '} | |
1866 | - </span> | |
1867 | - </span> | |
1953 | + {userInfo?.username !== '首能' ? ( | |
1954 | + <> | |
1955 | + <div> | |
1956 | + <span className="text-[#8C8C8C]">代表:</span> | |
1957 | + <span className="text-slate-700"> | |
1958 | + {record.salesCode} | |
1959 | + </span> | |
1960 | + </div> | |
1961 | + <div | |
1962 | + title={record.institution} | |
1963 | + className="whitespace-no-wrap overflow-hidden overflow-ellipsis max-w-[150px]" | |
1964 | + > | |
1965 | + <span className="text-[#8C8C8C]">单位:</span> | |
1966 | + <span className="text-slate-700"> | |
1967 | + {record.institution} | |
1968 | + </span> | |
1969 | + </div> | |
1970 | + <span> | |
1971 | + <span className="text-[#8C8C8C]">联系人:</span> | |
1972 | + <span className="text-slate-700"> | |
1973 | + {record.institutionContactName + ' '} | |
1974 | + </span> | |
1975 | + </span> | |
1976 | + </> | |
1977 | + ) : ( | |
1978 | + '' | |
1979 | + )} | |
1868 | 1980 | <span> |
1869 | 1981 | <span className="text-[#8C8C8C]">收货人:</span> |
1870 | 1982 | <span className="text-slate-700"> |
1871 | 1983 | {record.customerName + ' '} |
1872 | - <Tooltip className="order-tooltip" title="详情"> | |
1873 | - <ContainerTwoTone | |
1874 | - className="hover:curcor-pointer" | |
1875 | - onClick={() => { | |
1876 | - createOptObject(null, record.id); | |
1877 | - setDeliverInfoDrawerVisible(true); | |
1878 | - }} | |
1879 | - /> | |
1880 | - </Tooltip> | |
1984 | + | |
1985 | + {userInfo?.username !== '首能' ? ( | |
1986 | + <Tooltip className="order-tooltip" title="详情"> | |
1987 | + <ContainerTwoTone | |
1988 | + className="hover:curcor-pointer" | |
1989 | + onClick={() => { | |
1990 | + createOptObject(null, record.id); | |
1991 | + setDeliverInfoDrawerVisible(true); | |
1992 | + }} | |
1993 | + /> | |
1994 | + </Tooltip> | |
1995 | + ) : ( | |
1996 | + '' | |
1997 | + )} | |
1881 | 1998 | </span> |
1882 | 1999 | </span> |
2000 | + {userInfo?.username === '首能' ? ( | |
2001 | + <div | |
2002 | + title={record.customerShippingAddress} | |
2003 | + className="whitespace-no-wrap overflow-hidden overflow-ellipsis max-w-[500px]" | |
2004 | + > | |
2005 | + <span className="text-[#8C8C8C]">收货地址:</span> | |
2006 | + <span className="text-slate-700"> | |
2007 | + {record.customerShippingAddress} | |
2008 | + </span> | |
2009 | + </div> | |
2010 | + ) : ( | |
2011 | + '' | |
2012 | + )} | |
1883 | 2013 | </Space> |
1884 | 2014 | </Flex> |
1885 | 2015 | </Flex> |
... | ... | @@ -1932,48 +2062,54 @@ const OrderPage = () => { |
1932 | 2062 | <Flex wrap="wrap" gap="middle" vertical> |
1933 | 2063 | <Flex justify="flex-end"> |
1934 | 2064 | <Flex wrap="wrap" gap="middle" align="center"> |
1935 | - <div> | |
1936 | - <span className="text-[#8C8C8C]">总金额:¥</span> | |
1937 | - <span className="text-lg font-medium"> | |
1938 | - {record.totalPayment} | |
1939 | - </span> | |
1940 | - </div> | |
1941 | - {rolePath?.includes('addOrder') ? ( | |
1942 | - <Tooltip title="复制"> | |
1943 | - <CopyTwoTone | |
1944 | - className="hover:cursor-pointer" | |
1945 | - onClick={() => { | |
1946 | - createOptObject(null, record.id); | |
1947 | - copyOrderToClipboard(record); | |
1948 | - setOrderOptType('copy'); | |
1949 | - setOrderDrawerVisible(true); | |
1950 | - }} | |
1951 | - /> | |
1952 | - </Tooltip> | |
2065 | + {userInfo.username !== '首能' ? ( | |
2066 | + <> | |
2067 | + <div> | |
2068 | + <span className="text-[#8C8C8C]">总金额:¥</span> | |
2069 | + <span className="text-lg font-medium"> | |
2070 | + {record.totalPayment} | |
2071 | + </span> | |
2072 | + </div> | |
2073 | + {rolePath?.includes('addOrder') ? ( | |
2074 | + <Tooltip title="复制"> | |
2075 | + <CopyTwoTone | |
2076 | + className="hover:cursor-pointer" | |
2077 | + onClick={() => { | |
2078 | + createOptObject(null, record.id); | |
2079 | + copyOrderToClipboard(record); | |
2080 | + setOrderOptType('copy'); | |
2081 | + setOrderDrawerVisible(true); | |
2082 | + }} | |
2083 | + /> | |
2084 | + </Tooltip> | |
2085 | + ) : ( | |
2086 | + <Tooltip title="复制文本"> | |
2087 | + <CopyTwoTone | |
2088 | + className="hover:cursor-pointer" | |
2089 | + onClick={() => { | |
2090 | + copyOrderToClipboard(record); | |
2091 | + }} | |
2092 | + /> | |
2093 | + </Tooltip> | |
2094 | + )} | |
2095 | + | |
2096 | + <Tooltip title="历史"> | |
2097 | + <ClockCircleTwoTone | |
2098 | + className="hover:cursor-pointer" | |
2099 | + onClick={() => { | |
2100 | + setHistoryModalVisible(true); | |
2101 | + if (subOrderSelectedMap.get(record.id)?.length) { | |
2102 | + setSelectedRows(subOrderSelectedMap.get(record.id)); | |
2103 | + } else { | |
2104 | + setSelectedRows(record.subOrderInformationLists); | |
2105 | + } | |
2106 | + }} | |
2107 | + /> | |
2108 | + </Tooltip> | |
2109 | + </> | |
1953 | 2110 | ) : ( |
1954 | - <Tooltip title="复制文本"> | |
1955 | - <CopyTwoTone | |
1956 | - className="hover:cursor-pointer" | |
1957 | - onClick={() => { | |
1958 | - copyOrderToClipboard(record); | |
1959 | - }} | |
1960 | - /> | |
1961 | - </Tooltip> | |
2111 | + '' | |
1962 | 2112 | )} |
1963 | - | |
1964 | - <Tooltip title="历史"> | |
1965 | - <ClockCircleTwoTone | |
1966 | - className="hover:cursor-pointer" | |
1967 | - onClick={() => { | |
1968 | - setHistoryModalVisible(true); | |
1969 | - if (subOrderSelectedMap.get(record.id)?.length) { | |
1970 | - setSelectedRows(subOrderSelectedMap.get(record.id)); | |
1971 | - } else { | |
1972 | - setSelectedRows(record.subOrderInformationLists); | |
1973 | - } | |
1974 | - }} | |
1975 | - /> | |
1976 | - </Tooltip> | |
1977 | 2113 | </Flex> |
1978 | 2114 | </Flex> |
1979 | 2115 | <Flex justify="flex-end"> |
... | ... | @@ -2185,7 +2321,6 @@ const OrderPage = () => { |
2185 | 2321 | selectedSubOrders = record.subOrderInformationLists; |
2186 | 2322 | } |
2187 | 2323 | |
2188 | - setSelectedRows(selectedSubOrders); | |
2189 | 2324 | for (let i = 0; i < selectedSubOrders.length; i++) { |
2190 | 2325 | if ( |
2191 | 2326 | !selectedSubOrders[i].subPath.includes( |
... | ... | @@ -2196,7 +2331,7 @@ const OrderPage = () => { |
2196 | 2331 | return; |
2197 | 2332 | } |
2198 | 2333 | } |
2199 | - setSelectedRows(selectedSubOrders); | |
2334 | + createOptObject(null, record.id); | |
2200 | 2335 | setOrderCheckType(CHECK_TYPE.PROCURE); |
2201 | 2336 | setProcureConvertModalVisible(true); |
2202 | 2337 | }} |
... | ... | @@ -3464,6 +3599,7 @@ const OrderPage = () => { |
3464 | 3599 | let orderIds = mainTableFormRef.current?.getFieldValue('id'); |
3465 | 3600 | params.id = params.id || orderIds; |
3466 | 3601 | if (params.id !== '') { |
3602 | + params.id = params.id?.replace(/ /g, ''); | |
3467 | 3603 | if (params.id?.indexOf(',')) { |
3468 | 3604 | params.id = params.id.split(','); |
3469 | 3605 | params.id = params.id.filter((id) => { |
... | ... | @@ -3526,7 +3662,7 @@ const OrderPage = () => { |
3526 | 3662 | subOrders={orderOptType === 'add' ? [] : buildSubOrders()} |
3527 | 3663 | onClose={(isSuccess: boolean) => { |
3528 | 3664 | setOrderDrawerVisible(false); |
3529 | - // clearOptObject(); | |
3665 | + clearOptObject(); | |
3530 | 3666 | if (isSuccess) { |
3531 | 3667 | refreshTable(); |
3532 | 3668 | } |
... | ... | @@ -3537,7 +3673,12 @@ const OrderPage = () => { |
3537 | 3673 | |
3538 | 3674 | {checkVisible && ( |
3539 | 3675 | <CheckModal |
3540 | - setCheckVisible={setCheckVisible} | |
3676 | + setCheckVisible={(val: boolean) => { | |
3677 | + setCheckVisible(val); | |
3678 | + if (!val) { | |
3679 | + clearOptObject(); | |
3680 | + } | |
3681 | + }} | |
3541 | 3682 | data={isMainOrder ? getFirstMainOrder() : buildMainOrder()} |
3542 | 3683 | subOrders={ |
3543 | 3684 | isMainOrder |
... | ... | @@ -3560,7 +3701,12 @@ const OrderPage = () => { |
3560 | 3701 | |
3561 | 3702 | {applyForInvoicingVisible && ( |
3562 | 3703 | <ApplyForInvoicingModal |
3563 | - setCheckVisible={setApplyForInvoicingVisible} | |
3704 | + setCheckVisible={(val: boolean) => { | |
3705 | + setApplyForInvoicingVisible(val); | |
3706 | + if (!val) { | |
3707 | + clearOptObject(); | |
3708 | + } | |
3709 | + }} | |
3564 | 3710 | subOrders={ |
3565 | 3711 | isMainOrder |
3566 | 3712 | ? [...subOrderSelectedMap.values()].flat() |
... | ... | @@ -3579,7 +3725,12 @@ const OrderPage = () => { |
3579 | 3725 | |
3580 | 3726 | {notesEditVisible && ( |
3581 | 3727 | <OrderNotesEditModal |
3582 | - setNotesEditVisible={setNotesEditVisible} | |
3728 | + setNotesEditVisible={(val: boolean) => { | |
3729 | + setNotesEditVisible(val); | |
3730 | + if (!val) { | |
3731 | + clearOptObject(); | |
3732 | + } | |
3733 | + }} | |
3583 | 3734 | ids={selectedRows} |
3584 | 3735 | notesType={notesType} |
3585 | 3736 | notes={notes} |
... | ... | @@ -3597,8 +3748,11 @@ const OrderPage = () => { |
3597 | 3748 | <DeliverModal |
3598 | 3749 | data={buildSubOrders()} |
3599 | 3750 | isSendProduct={isSendProduct} |
3600 | - setVisible={(b: boolean) => { | |
3601 | - setDeliverVisible(b); | |
3751 | + setVisible={(val: boolean) => { | |
3752 | + setDeliverVisible(val); | |
3753 | + if (!val) { | |
3754 | + clearOptObject(); | |
3755 | + } | |
3602 | 3756 | }} |
3603 | 3757 | sendType={orderCheckType} |
3604 | 3758 | onClose={() => { |
... | ... | @@ -3643,7 +3797,7 @@ const OrderPage = () => { |
3643 | 3797 | isMainOrder={isMainOrder} |
3644 | 3798 | setVisible={() => { |
3645 | 3799 | setFinancialEditVisible(false); |
3646 | - setIsMainOrder(false); | |
3800 | + clearOptObject(); | |
3647 | 3801 | }} |
3648 | 3802 | onClose={() => { |
3649 | 3803 | setFinancialEditVisible(false); |
... | ... | @@ -3659,8 +3813,11 @@ const OrderPage = () => { |
3659 | 3813 | mainOrder={buildMainOrder()} |
3660 | 3814 | subOrders={buildSubOrders()} |
3661 | 3815 | isRePrint={isRePrintOrder} |
3662 | - setVisible={(b: boolean) => { | |
3663 | - setOrderPrintVisible(b); | |
3816 | + setVisible={(val: boolean) => { | |
3817 | + setOrderPrintVisible(val); | |
3818 | + if (!val) { | |
3819 | + clearOptObject(); | |
3820 | + } | |
3664 | 3821 | }} |
3665 | 3822 | printOptType={orderCheckType} |
3666 | 3823 | onClose={() => { |
... | ... | @@ -3685,7 +3842,12 @@ const OrderPage = () => { |
3685 | 3842 | |
3686 | 3843 | {subOrderConfirmReceiptImagesVisible && ( |
3687 | 3844 | <SubOrderComfirmReceiptImagesModal |
3688 | - setVisible={setSubOrderConfirmReceiptImagesVisible} | |
3845 | + setVisible={(val: boolean) => { | |
3846 | + setSubOrderConfirmReceiptImagesVisible(val); | |
3847 | + if (!val) { | |
3848 | + clearOptObject(); | |
3849 | + } | |
3850 | + }} | |
3689 | 3851 | onClose={() => { |
3690 | 3852 | setSubOrderConfirmReceiptImagesVisible(false); |
3691 | 3853 | }} |
... | ... | @@ -3719,6 +3881,7 @@ const OrderPage = () => { |
3719 | 3881 | onClose={() => { |
3720 | 3882 | setHistoryModalVisible(false); |
3721 | 3883 | setSelectedRows({}); |
3884 | + clearOptObject(); | |
3722 | 3885 | }} |
3723 | 3886 | /> |
3724 | 3887 | )} |
... | ... | @@ -3745,7 +3908,12 @@ const OrderPage = () => { |
3745 | 3908 | |
3746 | 3909 | {procureCheckModalVisible && ( |
3747 | 3910 | <ProcureCheckModal |
3748 | - setCheckVisible={setProcureCheckModalVisible} | |
3911 | + setCheckVisible={(val: boolean) => { | |
3912 | + setProcureCheckModalVisible(val); | |
3913 | + if (!val) { | |
3914 | + clearOptObject(); | |
3915 | + } | |
3916 | + }} | |
3749 | 3917 | isMainOrder={isMainOrder} |
3750 | 3918 | orders={ |
3751 | 3919 | isMainOrder |
... | ... | @@ -3763,7 +3931,12 @@ const OrderPage = () => { |
3763 | 3931 | |
3764 | 3932 | {afterSalesDrawerVisible && ( |
3765 | 3933 | <AfterSalesDrawer |
3766 | - setVisible={setAfterSalesDrawerVisible} | |
3934 | + setVisible={(val: boolean) => { | |
3935 | + setAfterSalesDrawerVisible(val); | |
3936 | + if (!val) { | |
3937 | + clearOptObject(); | |
3938 | + } | |
3939 | + }} | |
3767 | 3940 | mainOrder={buildMainOrder()} |
3768 | 3941 | subOrders={buildSubOrders()} |
3769 | 3942 | onClose={() => { |
... | ... | @@ -3776,11 +3949,16 @@ const OrderPage = () => { |
3776 | 3949 | |
3777 | 3950 | {procureConvertModalVisible && ( |
3778 | 3951 | <ProcureConvertModal |
3779 | - setVisible={setProcureConvertModalVisible} | |
3780 | - subOrders={selectedRows} | |
3952 | + setVisible={(val: boolean) => { | |
3953 | + setProcureConvertModalVisible(val); | |
3954 | + if (!val) { | |
3955 | + clearOptObject(); | |
3956 | + } | |
3957 | + }} | |
3958 | + subOrders={buildSubOrders()} | |
3781 | 3959 | onClose={() => { |
3782 | 3960 | setProcureConvertModalVisible(false); |
3783 | - setSelectedRows({}); | |
3961 | + clearOptObject(); | |
3784 | 3962 | refreshTable(); |
3785 | 3963 | }} |
3786 | 3964 | /> |
... | ... | @@ -3788,7 +3966,12 @@ const OrderPage = () => { |
3788 | 3966 | |
3789 | 3967 | {financialMergeDrawerVisible && ( |
3790 | 3968 | <FinancialMergeDrawer |
3791 | - setVisible={setFinancialMergeDrawerVisible} | |
3969 | + setVisible={(val: boolean) => { | |
3970 | + setFinancialMergeDrawerVisible(val); | |
3971 | + if (!val) { | |
3972 | + clearOptObject(); | |
3973 | + } | |
3974 | + }} | |
3792 | 3975 | dataList={ |
3793 | 3976 | isMainOrder |
3794 | 3977 | ? [...subOrderSelectedMap.values()].flat() |
... | ... | @@ -3805,7 +3988,12 @@ const OrderPage = () => { |
3805 | 3988 | |
3806 | 3989 | {financialReceiptsModalVisible && ( |
3807 | 3990 | <FinancialReceiptsModal |
3808 | - setVisible={setFinancialReceiptsModalVisible} | |
3991 | + setVisible={(val: boolean) => { | |
3992 | + setFinancialReceiptsModalVisible(val); | |
3993 | + if (!val) { | |
3994 | + clearOptObject(); | |
3995 | + } | |
3996 | + }} | |
3809 | 3997 | datas={selectedRows} |
3810 | 3998 | onClose={() => { |
3811 | 3999 | setFinancialReceiptsModalVisible(false); |
... | ... | @@ -3817,7 +4005,12 @@ const OrderPage = () => { |
3817 | 4005 | |
3818 | 4006 | {shippingWarehouseChangeModalVisible && ( |
3819 | 4007 | <ShippingWarehouseChangeModal |
3820 | - setVisible={setShippingWarehouseChangeModalVisible} | |
4008 | + setVisible={(val: boolean) => { | |
4009 | + setShippingWarehouseChangeModalVisible(val); | |
4010 | + if (!val) { | |
4011 | + clearOptObject(); | |
4012 | + } | |
4013 | + }} | |
3821 | 4014 | subOrderIds={ids} |
3822 | 4015 | originShippingWarehouse={buildSubOrders()[0].shippingWarehouse} |
3823 | 4016 | onClose={() => { |
... | ... | @@ -3831,7 +4024,12 @@ const OrderPage = () => { |
3831 | 4024 | |
3832 | 4025 | {productionTimeModalVisible && ( |
3833 | 4026 | <ProductionTimeModal |
3834 | - setVisible={setProductionTimeModalVisible} | |
4027 | + setVisible={(val: boolean) => { | |
4028 | + setProductionTimeModalVisible(val); | |
4029 | + if (!val) { | |
4030 | + clearOptObject(); | |
4031 | + } | |
4032 | + }} | |
3835 | 4033 | subOrders={buildSubOrders()} |
3836 | 4034 | onClose={() => { |
3837 | 4035 | setProductionTimeModalVisible(false); |
... | ... | @@ -3843,8 +4041,14 @@ const OrderPage = () => { |
3843 | 4041 | |
3844 | 4042 | {modifiedDiffModalVisible && ( |
3845 | 4043 | <ModifiedDiffModal |
3846 | - setVisible={setModifiedDiffModalVisible} | |
4044 | + setVisible={(val: boolean) => { | |
4045 | + setModifiedDiffModalVisible(val); | |
4046 | + if (!val) { | |
4047 | + clearOptObject(); | |
4048 | + } | |
4049 | + }} | |
3847 | 4050 | subOrders={buildSubOrders()} |
4051 | + mainOrder={buildMainOrder()} | |
3848 | 4052 | onClose={() => { |
3849 | 4053 | setModifiedDiffModalVisible(false); |
3850 | 4054 | clearOptObject(); | ... | ... |