Commit ba56bbe16366cc1baca7ec3b2ec789e889f4ac48
Committed by
曾国涛
1 parent
69e05245
fix: 修改订单预警params
Showing
1 changed file
with
530 additions
and
1026 deletions
src/pages/Order/OrderWarning/index.tsx
1 | 1 | import ButtonConfirm from '@/components/ButtomConfirm'; |
2 | 2 | import { RESPONSE_CODE } from '@/constants/enum'; |
3 | -import ImportExpressBillModal from '@/pages/Order/OrderWarning/components/ImportExpressBillModal'; | |
4 | 3 | import InvoicingDrawerForm from '@/pages/Order/OrderWarning/components/InvoicingDrawerForm'; |
5 | 4 | import ReissueModal from '@/pages/Order/OrderWarning/components/ReissueModal'; |
6 | 5 | import ReissueModal_old from '@/pages/Order/OrderWarning/components/ReissueModal_old'; |
... | ... | @@ -10,6 +9,7 @@ import { |
10 | 9 | postServiceConstCanApplyAfterInvoicingStatus, |
11 | 10 | postServiceInvoiceCancelApply, |
12 | 11 | postServiceOrderCancelSend, |
12 | + postServiceOrderConfirmInvoice, | |
13 | 13 | postServiceOrderGetCurrentOptNode, |
14 | 14 | postServiceOrderNoNeedSend, |
15 | 15 | postServiceOrderOrderCancel, |
... | ... | @@ -20,9 +20,7 @@ import { |
20 | 20 | postServiceOrderSaleCancelInvoicing, |
21 | 21 | postServiceOrderSalesConfirm, |
22 | 22 | postServiceOrderWarningOrderStatistics, |
23 | - postServiceOrderConfirmInvoice, | |
24 | 23 | } from '@/services'; |
25 | -import { orderExport } from '@/services/order'; | |
26 | 24 | import { |
27 | 25 | FloatAdd, |
28 | 26 | copyToClipboard, |
... | ... | @@ -49,7 +47,6 @@ import { |
49 | 47 | ContainerTwoTone, |
50 | 48 | CopyOutlined, |
51 | 49 | CopyTwoTone, |
52 | - DownOutlined, | |
53 | 50 | EditTwoTone, |
54 | 51 | QuestionCircleOutlined, |
55 | 52 | } from '@ant-design/icons'; |
... | ... | @@ -58,36 +55,48 @@ import { |
58 | 55 | ProColumns, |
59 | 56 | ProFormInstance, |
60 | 57 | ProTable, |
61 | - ProForm, | |
62 | - ProFormRadio, | |
63 | 58 | } from '@ant-design/pro-components'; |
64 | 59 | import { |
60 | + Badge, | |
65 | 61 | Button, |
66 | 62 | Checkbox, |
67 | 63 | Divider, |
68 | - Dropdown, | |
69 | 64 | Flex, |
70 | 65 | FloatButton, |
71 | 66 | Image, |
72 | - MenuProps, | |
73 | - Modal, | |
74 | 67 | Popconfirm, |
75 | 68 | Radio, |
76 | 69 | Space, |
77 | 70 | Spin, |
71 | + Tabs, | |
78 | 72 | Tag, |
79 | 73 | Tooltip, |
80 | 74 | message, |
81 | - Tabs, | |
82 | - Badge, | |
83 | - Card, | |
84 | - Col, | |
85 | - Row, | |
86 | 75 | } from 'antd'; |
87 | 76 | import Base64 from 'base-64'; |
77 | +import { format } from 'date-fns'; | |
88 | 78 | import { cloneDeep } from 'lodash'; |
89 | -import React, { Key, useEffect, useMemo, useRef, useState } from 'react'; | |
79 | +import React, { Key, useEffect, useRef, useState } from 'react'; | |
90 | 80 | import OrderPrintModal from '../../OrderPrint/OrderPrintModal'; |
81 | +import { | |
82 | + AFTER_INVOICING_STATUS, | |
83 | + CHECK_TYPE, | |
84 | + LOGISTICS_STATUS_OPTIONS, | |
85 | + MAIN_ORDER_COLUMNS, | |
86 | + MODIFIED_AUDIT_STATUS_OPTIONS, | |
87 | + ORDER_STATUS_OPTIONS, | |
88 | + PAYEE_OPTIONS, | |
89 | + PAYMENT_CHANNEL_OPTIONS, | |
90 | + PAYMENT_RECEIPTS_STATUS_OPTIONS, | |
91 | + POST_AUDIT_OPTIONS, | |
92 | + PROCURE_ORDER_STATUS, | |
93 | + PROCURE_PRIMARY_ORDER_STATUS_OPTIONS, | |
94 | + PRODUCT_BELONG_DEPARTMENT_OPTIONS, | |
95 | + SHIPPING_WAREHOUSE_OPTIONS, | |
96 | + TAGS_COLOR, | |
97 | + getInvoicingType, | |
98 | + getNeedInvoicing, | |
99 | +} from '../constant'; | |
91 | 100 | import AfterSalesDrawer from './components/AfterSalesDrawer'; |
92 | 101 | import ApplyForInvoicingModal from './components/ApplyForInvoicingModal'; |
93 | 102 | import AttachmentModal from './components/AttachmentModal'; |
... | ... | @@ -110,29 +119,8 @@ import ProcureConvertModal from './components/ProcureConvertModal'; |
110 | 119 | import ProductionTimeModal from './components/ProductionTimeModal'; |
111 | 120 | import ShippingWarehouseChangeModal from './components/ShippingWarehouseChangeModal'; |
112 | 121 | import UploadPayBillModal from './components/UploadPayBillModal'; |
113 | -import { | |
114 | - AFTER_INVOICING_STATUS, | |
115 | - CHECK_TYPE, | |
116 | - LOGISTICS_STATUS_OPTIONS, | |
117 | - MAIN_ORDER_COLUMNS, | |
118 | - MODIFIED_AUDIT_STATUS_OPTIONS, | |
119 | - ORDER_STATUS_OPTIONS, | |
120 | - PAYEE_OPTIONS, | |
121 | - PAYMENT_CHANNEL_OPTIONS, | |
122 | - PAYMENT_RECEIPTS_STATUS_OPTIONS, | |
123 | - POST_AUDIT_OPTIONS, | |
124 | - PROCURE_ORDER_STATUS, | |
125 | - PROCURE_PRIMARY_ORDER_STATUS_OPTIONS, | |
126 | - PRODUCT_BELONG_DEPARTMENT_OPTIONS, | |
127 | - SHIPPING_WAREHOUSE_OPTIONS, | |
128 | - TAGS_COLOR, | |
129 | - getInvoicingType, | |
130 | - getNeedInvoicing, | |
131 | -} from '../constant'; | |
132 | 122 | import './index.less'; |
133 | 123 | import { OrderListItemType, OrderType } from './type.d'; |
134 | -import { format } from 'date-fns'; | |
135 | -import { useParams } from '@umijs/max'; | |
136 | 124 | |
137 | 125 | const OrderPage = () => { |
138 | 126 | const [orderDrawerVisible, setOrderDrawerVisible] = useState<boolean>(false); |
... | ... | @@ -197,39 +185,26 @@ const OrderPage = () => { |
197 | 185 | const [currentPage, setCurrentPage] = useState(1); |
198 | 186 | const [orderCheckType, setOrderCheckType] = useState(''); |
199 | 187 | const [imagesViewerOptType, setImagesViewerOptType] = useState(''); |
200 | - const [filterCondifion, setFilterCondition] = useState(0); | |
188 | + const [filterCondifion] = useState(0); | |
201 | 189 | const [mainOrderSelectedMap] = useState(new Map()); //选中的主订单Map key:主订单id value:主订单数据 |
202 | 190 | const [subOrderSelectedMap, setSubOrderSelectedMap] = useState(new Map()); //选中的子订单Map key:主订单id value:选中的子订单数据集合 |
203 | 191 | const [currentOptMainId, setCurrentMainId] = useState<any>(undefined); //当前操作对象的主订单id |
204 | 192 | const [curretnOptSubId, setCurretnOptSubId] = useState<any>(undefined); //当前操作对象的子订单id |
205 | 193 | const [subOrderCount, setSubOrderCount] = useState(0); |
206 | - const [sorted, setSorted] = useState(false); | |
194 | + const [sorted] = useState(false); | |
207 | 195 | const mainTableRef = useRef<ActionType>(); |
208 | 196 | const mainTableRef2 = useRef<ActionType>(); |
209 | 197 | const mainTableFormRef = useRef<ProFormInstance>(); |
210 | - let [searchParams, setSearchParam] = useState(Object); //表格的查询条件存储 | |
211 | - const [messageApi, contextHolder] = message.useMessage(); | |
198 | + let [setSearchParam] = useState(Object); //表格的查询条件存储 | |
199 | + const [contextHolder] = message.useMessage(); | |
212 | 200 | const [ |
213 | 201 | shippingWarehouseChangeModalVisible, |
214 | 202 | setShippingWarehouseChangeModalVisible, |
215 | 203 | ] = useState(false); |
216 | - const [canApplyAfterInvoicingStatus, setCanApplyAfterInvoicingStatus] = | |
217 | - useState([]); | |
204 | + const [setCanApplyAfterInvoicingStatus] = useState([]); | |
218 | 205 | const [ids, setIds] = useState([]); |
219 | 206 | const [recordOptNode, setRecordOptNode] = useState(null); |
220 | 207 | const roleCode = userInfo?.roleSmallVO?.code; |
221 | - const canMergeInvoicing = useMemo(() => { | |
222 | - if (subOrderSelectedMap.size === 0) { | |
223 | - return false; | |
224 | - } | |
225 | - // 检查 value.items 中的每个元素 | |
226 | - console.log( | |
227 | - 'map' + JSON.stringify([...subOrderSelectedMap.values()].flat()), | |
228 | - ); | |
229 | - return [...subOrderSelectedMap.values()] | |
230 | - .flat() | |
231 | - .every((subItem) => subItem.paths.includes('applyInvoicing_old')); | |
232 | - }, [selectedSubOrderKeys]); | |
233 | 208 | |
234 | 209 | const triggerRecordOptNode = async (id) => { |
235 | 210 | const res = await postServiceOrderGetCurrentOptNode({ |
... | ... | @@ -240,18 +215,6 @@ const OrderPage = () => { |
240 | 215 | setRecordOptNode(res.data); |
241 | 216 | }; |
242 | 217 | |
243 | - const exportLoading = () => { | |
244 | - messageApi.open({ | |
245 | - type: 'loading', | |
246 | - content: '正在导出文件...', | |
247 | - duration: 0, | |
248 | - }); | |
249 | - }; | |
250 | - | |
251 | - const exportLoadingDestory = () => { | |
252 | - messageApi.destroy(); | |
253 | - }; | |
254 | - | |
255 | 218 | const refreshTable = () => { |
256 | 219 | mainTableRef.current?.reload(); |
257 | 220 | mainTableRef2.current?.reload(); |
... | ... | @@ -358,16 +321,6 @@ const OrderPage = () => { |
358 | 321 | } |
359 | 322 | |
360 | 323 | /** |
361 | - * 财务是否选中排序 | |
362 | - * @param e | |
363 | - */ | |
364 | - function financeSorted(e: any) { | |
365 | - let checked = e?.target.checked; | |
366 | - setSorted(checked); | |
367 | - refreshTable(); | |
368 | - } | |
369 | - | |
370 | - /** | |
371 | 324 | * 重置当前的操作对象 |
372 | 325 | */ |
373 | 326 | function clearOptObject() { |
... | ... | @@ -843,7 +796,7 @@ const OrderPage = () => { |
843 | 796 | onConfirm={() => { |
844 | 797 | window.open( |
845 | 798 | '/previewApi/onlinePreview?url=' + |
846 | - encodeURIComponent(Base64.encode(item.url)), | |
799 | + encodeURIComponent(Base64.encode(item.url)), | |
847 | 800 | ); |
848 | 801 | }} |
849 | 802 | onCancel={() => { |
... | ... | @@ -915,7 +868,7 @@ const OrderPage = () => { |
915 | 868 | </span> |
916 | 869 | {(roleCode === 'salesRepresentative' || |
917 | 870 | roleCode === 'salesManager') && |
918 | - !optRecord.isCurrentUserOrder ? ( | |
871 | + !optRecord.isCurrentUserOrder ? ( | |
919 | 872 | <span className="text-[#f44e4e]">(非本账号订单)</span> |
920 | 873 | ) : ( |
921 | 874 | '' |
... | ... | @@ -1099,13 +1052,13 @@ const OrderPage = () => { |
1099 | 1052 | <Tooltip |
1100 | 1053 | title={ |
1101 | 1054 | optRecord.invoicingUrgentCause !== null && |
1102 | - optRecord.afterInvoicingStatus === | |
1055 | + optRecord.afterInvoicingStatus === | |
1103 | 1056 | 'URGENT_INVOICE_AUDITING' |
1104 | 1057 | ? optRecord.invoicingUrgentCause |
1105 | 1058 | : enumValueToLabel( |
1106 | - optRecord.afterInvoicingStatus, | |
1107 | - AFTER_INVOICING_STATUS, | |
1108 | - ) | |
1059 | + optRecord.afterInvoicingStatus, | |
1060 | + AFTER_INVOICING_STATUS, | |
1061 | + ) | |
1109 | 1062 | } |
1110 | 1063 | > |
1111 | 1064 | <Tag |
... | ... | @@ -1136,7 +1089,7 @@ const OrderPage = () => { |
1136 | 1089 | )} |
1137 | 1090 | |
1138 | 1091 | {(roleCode === 'warehouseKeeper' || roleCode === 'admin') && |
1139 | - optRecord.shippingWarehouse !== null ? ( | |
1092 | + optRecord.shippingWarehouse !== null ? ( | |
1140 | 1093 | <div |
1141 | 1094 | className="overflow-hidden whitespace-no-wrap overflow-ellipsis" |
1142 | 1095 | title={enumValueToLabel( |
... | ... | @@ -1158,7 +1111,7 @@ const OrderPage = () => { |
1158 | 1111 | {/* 生产时间 */} |
1159 | 1112 | <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> |
1160 | 1113 | {optRecord.productionStartTime !== null || |
1161 | - optRecord.productionEndTime !== null ? ( | |
1114 | + optRecord.productionEndTime !== null ? ( | |
1162 | 1115 | <MyToolTip |
1163 | 1116 | title={ |
1164 | 1117 | formatdate(optRecord.productionStartTime) + |
... | ... | @@ -1188,7 +1141,7 @@ const OrderPage = () => { |
1188 | 1141 | <Tag |
1189 | 1142 | color={ |
1190 | 1143 | optRecord.invoicingTime === null || |
1191 | - optRecord.invoicingTime === undefined | |
1144 | + optRecord.invoicingTime === undefined | |
1192 | 1145 | ? TAGS_COLOR.get(optRecord.invoicingStatus) |
1193 | 1146 | : 'success' |
1194 | 1147 | } |
... | ... | @@ -1216,7 +1169,7 @@ const OrderPage = () => { |
1216 | 1169 | |
1217 | 1170 | {/**采购是否已下单状态 */} |
1218 | 1171 | {optRecord.procureOrderStatus !== null && |
1219 | - optRecord.procureOrderStatus !== undefined ? ( | |
1172 | + optRecord.procureOrderStatus !== undefined ? ( | |
1220 | 1173 | <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> |
1221 | 1174 | <Tag color="success"> |
1222 | 1175 | {enumValueToLabel( |
... | ... | @@ -1232,21 +1185,21 @@ const OrderPage = () => { |
1232 | 1185 | {/* 物流信息 */} |
1233 | 1186 | <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> |
1234 | 1187 | {optRecord.orderStatus === 'CONFIRM_RECEIPT' || |
1235 | - optRecord.orderStatus === 'AFTER_SALES_COMPLETION' || | |
1236 | - optRecord.orderStatus === 'IN_AFTER_SALES' || | |
1237 | - optRecord.orderStatus === 'SHIPPED' ? ( | |
1188 | + optRecord.orderStatus === 'AFTER_SALES_COMPLETION' || | |
1189 | + optRecord.orderStatus === 'IN_AFTER_SALES' || | |
1190 | + optRecord.orderStatus === 'SHIPPED' ? ( | |
1238 | 1191 | <MyToolTip |
1239 | 1192 | title={ |
1240 | 1193 | optRecord.serialNumber === undefined |
1241 | 1194 | ? '暂无物流信息' |
1242 | 1195 | : enumValueToLabel( |
1243 | - optRecord.logisticsMethod, | |
1244 | - LOGISTICS_STATUS_OPTIONS, | |
1245 | - ) + | |
1246 | - ' ' + | |
1247 | - optRecord.serialNumber + | |
1248 | - ' ' + | |
1249 | - optRecord.logisticsNotes | |
1196 | + optRecord.logisticsMethod, | |
1197 | + LOGISTICS_STATUS_OPTIONS, | |
1198 | + ) + | |
1199 | + ' ' + | |
1200 | + optRecord.serialNumber + | |
1201 | + ' ' + | |
1202 | + optRecord.logisticsNotes | |
1250 | 1203 | } |
1251 | 1204 | content={ |
1252 | 1205 | <Button type="link" size="small" style={{ padding: 0 }}> |
... | ... | @@ -1260,7 +1213,7 @@ const OrderPage = () => { |
1260 | 1213 | |
1261 | 1214 | {/* 修改审核状态 */} |
1262 | 1215 | {optRecord.modifiedAuditStatus !== null && |
1263 | - optRecord.modifiedAuditStatus !== 'AUDIT_FAILURE' ? ( | |
1216 | + optRecord.modifiedAuditStatus !== 'AUDIT_FAILURE' ? ( | |
1264 | 1217 | <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> |
1265 | 1218 | <Tooltip |
1266 | 1219 | title={recordOptNode ? recordOptNode : <Spin />} |
... | ... | @@ -1700,7 +1653,7 @@ const OrderPage = () => { |
1700 | 1653 | )} |
1701 | 1654 | |
1702 | 1655 | {optRecord.paths?.includes('queryAnnex') && |
1703 | - optRecord.listAnnex?.length > 0 ? ( | |
1656 | + optRecord.listAnnex?.length > 0 ? ( | |
1704 | 1657 | <Button |
1705 | 1658 | className="p-0" |
1706 | 1659 | type="link" |
... | ... | @@ -2153,7 +2106,7 @@ const OrderPage = () => { |
2153 | 2106 | </Flex> |
2154 | 2107 | |
2155 | 2108 | {(isProcure() || isWarehousekeeper() || isSales() || isAdmin()) && |
2156 | - !isSupplier() ? ( | |
2109 | + !isSupplier() ? ( | |
2157 | 2110 | <div className="pt-2"> |
2158 | 2111 | <Flex title={optRecord.supplierName}> |
2159 | 2112 | <div> |
... | ... | @@ -2228,7 +2181,7 @@ const OrderPage = () => { |
2228 | 2181 | <span className="text-[#8C8C8C]"> |
2229 | 2182 | 申请开票备注: |
2230 | 2183 | {optRecord.applyInvoicingNotes === undefined || |
2231 | - optRecord.applyInvoicingNotes === null | |
2184 | + optRecord.applyInvoicingNotes === null | |
2232 | 2185 | ? '暂无备注' |
2233 | 2186 | : optRecord.applyInvoicingNotes} |
2234 | 2187 | </span> |
... | ... | @@ -2256,7 +2209,7 @@ const OrderPage = () => { |
2256 | 2209 | <span className="text-[#8C8C8C] mr-3"> |
2257 | 2210 | 财务审核备注: |
2258 | 2211 | {optRecord.checkNotes === undefined || |
2259 | - optRecord.checkNotes === null | |
2212 | + optRecord.checkNotes === null | |
2260 | 2213 | ? '暂无备注' |
2261 | 2214 | : optRecord.checkNotes} |
2262 | 2215 | </span> |
... | ... | @@ -2280,7 +2233,7 @@ const OrderPage = () => { |
2280 | 2233 | <span className="text-[#8C8C8C]"> |
2281 | 2234 | 重新开票备注: |
2282 | 2235 | {optRecord.reissueNotes === undefined || |
2283 | - optRecord.reissueNotes === null | |
2236 | + optRecord.reissueNotes === null | |
2284 | 2237 | ? '暂无备注' |
2285 | 2238 | : optRecord.reissueNotes} |
2286 | 2239 | </span> |
... | ... | @@ -2584,9 +2537,9 @@ const OrderPage = () => { |
2584 | 2537 | <span className="text-slate-700"> |
2585 | 2538 | {record.receivingCompany !== null |
2586 | 2539 | ? enumValueToLabel( |
2587 | - record.receivingCompany, | |
2588 | - getReceivingCompanyOptions(PAYEE_OPTIONS), | |
2589 | - ) | |
2540 | + record.receivingCompany, | |
2541 | + getReceivingCompanyOptions(PAYEE_OPTIONS), | |
2542 | + ) | |
2590 | 2543 | : '暂无'} |
2591 | 2544 | </span> |
2592 | 2545 | </div> |
... | ... | @@ -3378,9 +3331,9 @@ const OrderPage = () => { |
3378 | 3331 | for (let i = 0; i < selectedSubOrders.length; i++) { |
3379 | 3332 | if ( |
3380 | 3333 | selectedSubOrders[i].invoicingStatus === |
3381 | - 'UN_INVOICE' || | |
3334 | + 'UN_INVOICE' || | |
3382 | 3335 | selectedSubOrders[i].afterInvoicingStatus === |
3383 | - 'APPLY_FOR_INVOICING' | |
3336 | + 'APPLY_FOR_INVOICING' | |
3384 | 3337 | ) { |
3385 | 3338 | message.error( |
3386 | 3339 | '请选择需要开票且未申请开票的子订单进行申请', |
... | ... | @@ -3415,9 +3368,9 @@ const OrderPage = () => { |
3415 | 3368 | for (let i = 0; i < selectedSubOrders.length; i++) { |
3416 | 3369 | if ( |
3417 | 3370 | selectedSubOrders[i].invoicingStatus === |
3418 | - 'UN_INVOICE' || | |
3371 | + 'UN_INVOICE' || | |
3419 | 3372 | selectedSubOrders[i].afterInvoicingStatus === |
3420 | - 'APPLY_FOR_INVOICING' | |
3373 | + 'APPLY_FOR_INVOICING' | |
3421 | 3374 | ) { |
3422 | 3375 | message.error( |
3423 | 3376 | '请选择需要开票且未申请开票的子订单进行申请', |
... | ... | @@ -3631,13 +3584,13 @@ const OrderPage = () => { |
3631 | 3584 | if ( |
3632 | 3585 | selectedSubOrders[i].orderStatus !== 'AUDITED' && |
3633 | 3586 | selectedSubOrders[i].orderStatus !== |
3634 | - 'PROCURE_PROCESS' && | |
3587 | + 'PROCURE_PROCESS' && | |
3635 | 3588 | selectedSubOrders[i].orderStatus !== |
3636 | - 'PROCURE_PROCESS_FOR_MINE' && | |
3589 | + 'PROCURE_PROCESS_FOR_MINE' && | |
3637 | 3590 | selectedSubOrders[i].orderStatus !== |
3638 | - 'PROCURE_WAIT_SHIP' && | |
3591 | + 'PROCURE_WAIT_SHIP' && | |
3639 | 3592 | selectedSubOrders[i].orderStatus !== |
3640 | - 'SUPPLIER_WAIT_SHIP' && | |
3593 | + 'SUPPLIER_WAIT_SHIP' && | |
3641 | 3594 | selectedSubOrders[i].orderStatus !== 'WAIT_SHIP' |
3642 | 3595 | ) { |
3643 | 3596 | message.error( |
... | ... | @@ -3723,9 +3676,9 @@ const OrderPage = () => { |
3723 | 3676 | if ( |
3724 | 3677 | selectedSubOrders[i].orderStatus !== 'UNAUDITED' && |
3725 | 3678 | selectedSubOrders[i].orderStatus !== |
3726 | - 'FINANCE_PROCESS' && | |
3679 | + 'FINANCE_PROCESS' && | |
3727 | 3680 | selectedSubOrders[i].orderStatus !== |
3728 | - 'LEADER_AUDITED' | |
3681 | + 'LEADER_AUDITED' | |
3729 | 3682 | ) { |
3730 | 3683 | message.error( |
3731 | 3684 | '请选择[未审核]、[财务待审核]、[领导已审核]的子订单进行审核', |
... | ... | @@ -3793,9 +3746,9 @@ const OrderPage = () => { |
3793 | 3746 | for (let i = 0; i < selectedSubOrders.length; i++) { |
3794 | 3747 | if ( |
3795 | 3748 | selectedSubOrders[i].orderStatus !== |
3796 | - 'CONFIRM_RECEIPT' && | |
3749 | + 'CONFIRM_RECEIPT' && | |
3797 | 3750 | selectedSubOrders[i].orderStatus !== |
3798 | - 'AFTER_SALES_FAILURE' | |
3751 | + 'AFTER_SALES_FAILURE' | |
3799 | 3752 | ) { |
3800 | 3753 | message.error('请选择确认收货状态的子订单进行售后'); |
3801 | 3754 | return; |
... | ... | @@ -3873,7 +3826,6 @@ const OrderPage = () => { |
3873 | 3826 | message.success('推送成功'); |
3874 | 3827 | mainTableRef.current.reload(); |
3875 | 3828 | mainTableRef2.current.reload(); |
3876 | - | |
3877 | 3829 | } |
3878 | 3830 | }} |
3879 | 3831 | /> |
... | ... | @@ -4130,392 +4082,6 @@ const OrderPage = () => { |
4130 | 4082 | }); |
4131 | 4083 | } |
4132 | 4084 | |
4133 | - function toolBarRender() { | |
4134 | - let toolBtns = []; | |
4135 | - let radios: any[] = []; | |
4136 | - | |
4137 | - radios.push(<Radio value={0}>全部</Radio>); | |
4138 | - | |
4139 | - if ( | |
4140 | - roleCode === 'admin' || | |
4141 | - roleCode === 'salesManager' || | |
4142 | - roleCode === 'salesRepresentative' | |
4143 | - ) { | |
4144 | - radios.push(<Radio value={70}>只看作废</Radio>); | |
4145 | - } | |
4146 | - | |
4147 | - if (roleCode === 'warehouseKeeper') { | |
4148 | - radios.push(<Radio value={40}>待处理</Radio>); | |
4149 | - } | |
4150 | - | |
4151 | - //采购可以筛选出需要处理的订单 | |
4152 | - if (roleCode === 'procure' && !isSupplier()) { | |
4153 | - radios.push(<Radio value={60}>其他采购</Radio>); | |
4154 | - radios.push(<Radio value={10}>待处理</Radio>); | |
4155 | - } | |
4156 | - | |
4157 | - //财务可以将需要处理的订单排序到前面 | |
4158 | - if (roleCode === 'finance') { | |
4159 | - radios.push(<Radio value={50}>加急</Radio>); | |
4160 | - | |
4161 | - radios.push(<Radio value={40}>待处理</Radio>); | |
4162 | - | |
4163 | - radios.push(<Checkbox onChange={financeSorted}>排序</Checkbox>); | |
4164 | - } | |
4165 | - | |
4166 | - if (roleCode === 'salesRepresentative' || roleCode === 'salesManager') { | |
4167 | - radios.push(<Radio value={30}>只看我创建</Radio>); | |
4168 | - | |
4169 | - radios.push(<Radio value={40}>待审核</Radio>); | |
4170 | - } | |
4171 | - | |
4172 | - if (roleCode === 'admin') { | |
4173 | - radios.push(<Radio value={10}>待处理</Radio>); | |
4174 | - radios.push(<Checkbox onChange={financeSorted}>排序</Checkbox>); | |
4175 | - } | |
4176 | - | |
4177 | - //筛选按钮配置 | |
4178 | - let radioGroup = ( | |
4179 | - <Radio.Group | |
4180 | - onChange={(e: any) => { | |
4181 | - setFilterCondition(e.target.value); | |
4182 | - refreshTable(); | |
4183 | - }} | |
4184 | - defaultValue={0} | |
4185 | - > | |
4186 | - {radios} | |
4187 | - </Radio.Group> | |
4188 | - ); | |
4189 | - | |
4190 | - toolBtns.push(radioGroup); | |
4191 | - | |
4192 | - toolBtns.push(<ImportExpressBillModal></ImportExpressBillModal>); | |
4193 | - | |
4194 | - //导出按钮配置 | |
4195 | - const exportItems: MenuProps['items'] = [ | |
4196 | - { | |
4197 | - label: '导出查询结果订单', | |
4198 | - key: '2', | |
4199 | - onClick: async () => { | |
4200 | - let body = { flag: 50, ...searchParams }; | |
4201 | - exportLoading(); | |
4202 | - orderExport( | |
4203 | - '/api/service/order/export', | |
4204 | - '订单导出结果.xls', | |
4205 | - 'POST', | |
4206 | - body, | |
4207 | - exportLoadingDestory, | |
4208 | - ); | |
4209 | - }, | |
4210 | - }, | |
4211 | - { | |
4212 | - label: '导出已选中订单', | |
4213 | - key: '1', | |
4214 | - onClick: async () => { | |
4215 | - if (mainOrderSelectedMap.size === 0) { | |
4216 | - message.error('请选择订单'); | |
4217 | - return; | |
4218 | - } | |
4219 | - let body = { flag: 30, id: Array.from(mainOrderSelectedMap.keys()) }; | |
4220 | - exportLoading(); | |
4221 | - orderExport( | |
4222 | - '/api/service/order/export', | |
4223 | - '订单导出结果.xls', | |
4224 | - 'POST', | |
4225 | - body, | |
4226 | - exportLoadingDestory, | |
4227 | - ); | |
4228 | - }, | |
4229 | - }, | |
4230 | - { | |
4231 | - label: '导出当天订单', | |
4232 | - key: '4', | |
4233 | - onClick: async () => { | |
4234 | - let body = { flag: 40, ids: [] }; | |
4235 | - exportLoading(); | |
4236 | - orderExport( | |
4237 | - '/api/service/order/export', | |
4238 | - '订单导出结果.xls', | |
4239 | - 'POST', | |
4240 | - body, | |
4241 | - exportLoadingDestory, | |
4242 | - ); | |
4243 | - }, | |
4244 | - }, | |
4245 | - { | |
4246 | - label: '导出所有订单', | |
4247 | - key: '3', | |
4248 | - onClick: async () => { | |
4249 | - let body = { flag: 10, ids: [] }; | |
4250 | - exportLoading(); | |
4251 | - orderExport( | |
4252 | - '/api/service/order/export', | |
4253 | - '订单导出结果.xls', | |
4254 | - 'POST', | |
4255 | - body, | |
4256 | - exportLoadingDestory, | |
4257 | - ); | |
4258 | - }, | |
4259 | - }, | |
4260 | - ]; | |
4261 | - | |
4262 | - const exportMenuProps = { | |
4263 | - items: exportItems, | |
4264 | - onClick: () => { }, | |
4265 | - }; | |
4266 | - | |
4267 | - //导出按钮配置 | |
4268 | - const auditItems: MenuProps['items'] = [ | |
4269 | - { | |
4270 | - label: '后置审核', | |
4271 | - key: '1', | |
4272 | - onClick: async () => { | |
4273 | - setIsMainOrder(true); | |
4274 | - setCheckVisible(true); | |
4275 | - setOrderCheckType(CHECK_TYPE.WAITING_FOR_POST_AUDIT); | |
4276 | - }, | |
4277 | - }, | |
4278 | - { | |
4279 | - label: '加急开票审核(旧)', | |
4280 | - key: '2', | |
4281 | - disabled: true, | |
4282 | - onClick: async () => { | |
4283 | - setIsMainOrder(true); | |
4284 | - setCheckVisible(true); | |
4285 | - setOrderCheckType(CHECK_TYPE.URGENT_INVOICE_AUDITING_OLD); | |
4286 | - }, | |
4287 | - }, | |
4288 | - { | |
4289 | - label: '领导审核', | |
4290 | - key: '3', | |
4291 | - onClick: async () => { | |
4292 | - setIsMainOrder(true); | |
4293 | - setCheckVisible(true); | |
4294 | - setOrderCheckType(CHECK_TYPE.LEADER_AUDIT); | |
4295 | - }, | |
4296 | - }, | |
4297 | - { | |
4298 | - label: '修改申请审核', | |
4299 | - key: '4', | |
4300 | - onClick: async () => { | |
4301 | - setIsMainOrder(true); | |
4302 | - setCheckVisible(true); | |
4303 | - setOrderCheckType(CHECK_TYPE.MODIFY_APPLY_WAIT_FOR_AUDIT); | |
4304 | - }, | |
4305 | - }, | |
4306 | - ]; | |
4307 | - | |
4308 | - const auditProps = { | |
4309 | - items: auditItems, | |
4310 | - onClick: () => { }, | |
4311 | - }; | |
4312 | - | |
4313 | - if (rolePath?.includes('leaderMergeAudit')) { | |
4314 | - toolBtns.push( | |
4315 | - <Dropdown | |
4316 | - disabled={selectedSubOrderKeys.length === 0} | |
4317 | - menu={auditProps} | |
4318 | - > | |
4319 | - <Button> | |
4320 | - <Space> | |
4321 | - 一键审核 | |
4322 | - <DownOutlined /> | |
4323 | - </Space> | |
4324 | - </Button> | |
4325 | - </Dropdown>, | |
4326 | - ); | |
4327 | - } | |
4328 | - | |
4329 | - if (rolePath?.includes('mergeAudit')) { | |
4330 | - toolBtns.push( | |
4331 | - <Button | |
4332 | - type="primary" | |
4333 | - key="out" | |
4334 | - onClick={() => { | |
4335 | - setIsMainOrder(true); | |
4336 | - if (roleCode === 'procure') { | |
4337 | - setProcureCheckModalVisible(true); | |
4338 | - } | |
4339 | - | |
4340 | - if (roleCode === 'warehouseKeeper') { | |
4341 | - setCheckVisible(true); | |
4342 | - setOrderCheckType(CHECK_TYPE.WEARHOUSE_KEEPER); | |
4343 | - } | |
4344 | - }} | |
4345 | - disabled={selectedSubOrderKeys?.length === 0} | |
4346 | - > | |
4347 | - 一键审核 | |
4348 | - </Button>, | |
4349 | - ); | |
4350 | - } | |
4351 | - | |
4352 | - if (rolePath?.includes('mergeProcureOrder')) { | |
4353 | - toolBtns.push( | |
4354 | - <Button | |
4355 | - key="mergeProcureOrder" | |
4356 | - type="primary" | |
4357 | - disabled={selectedSubOrderKeys.length === 0} | |
4358 | - onClick={() => { | |
4359 | - Modal.confirm({ | |
4360 | - title: '一键下单', | |
4361 | - content: '选中的订单是否都已下单?', | |
4362 | - onOk: async () => { | |
4363 | - let res = await postServiceOrderProcureOrder({ | |
4364 | - data: { subIds: [...selectedSubOrderKeys.values()].flat() }, | |
4365 | - }); | |
4366 | - if (res.result === RESPONSE_CODE.SUCCESS) { | |
4367 | - message.success(res.message); | |
4368 | - refreshTable(); | |
4369 | - return true; | |
4370 | - } | |
4371 | - }, | |
4372 | - }); | |
4373 | - }} | |
4374 | - > | |
4375 | - 一键下单 | |
4376 | - </Button>, | |
4377 | - ); | |
4378 | - } | |
4379 | - | |
4380 | - if (rolePath?.includes('mergeApplyInvoicing')) { | |
4381 | - toolBtns.push( | |
4382 | - <Button | |
4383 | - type="primary" | |
4384 | - key="out" | |
4385 | - onClick={() => { | |
4386 | - setIsEdit(false); | |
4387 | - setIsMainOrder(true); | |
4388 | - setApplyForInvoicingVisible(true); | |
4389 | - }} | |
4390 | - disabled={!canMergeInvoicing} /*{selectedSubOrderKeys?.length === 0}*/ | |
4391 | - > | |
4392 | - {roleCode === 'admin' ? '合并(销售)' : '合并开票'} | |
4393 | - </Button>, | |
4394 | - ); | |
4395 | - } | |
4396 | - | |
4397 | - <Button | |
4398 | - type="primary" | |
4399 | - key="out" | |
4400 | - onClick={() => { | |
4401 | - setIsEdit(false); | |
4402 | - setIsMainOrder(true); | |
4403 | - setInvoicingDrawerFormVisible(true); | |
4404 | - }} | |
4405 | - disabled={selectedSubOrderKeys?.length === 0} | |
4406 | - > | |
4407 | - 申请开票(旧) | |
4408 | - </Button>; | |
4409 | - | |
4410 | - if (rolePath?.includes('mergeInvoicing')) { | |
4411 | - toolBtns.push( | |
4412 | - <Button | |
4413 | - type="primary" | |
4414 | - key="out" | |
4415 | - onClick={() => { | |
4416 | - //检查订单状态是否正确 | |
4417 | - // 遍历Map中的键值对 | |
4418 | - let errorIds = new Set(); | |
4419 | - [...subOrderSelectedMap.values()].flat().forEach((subOrder) => { | |
4420 | - if ( | |
4421 | - subOrder.afterInvoicingStatus !== 'APPLY_FOR_INVOICING' && | |
4422 | - subOrder.afterInvoicingStatus !== 'PARTIAL_INVOICING' | |
4423 | - ) { | |
4424 | - errorIds.add(subOrder.mainOrderId); | |
4425 | - return; | |
4426 | - } | |
4427 | - }); | |
4428 | - if (errorIds.size > 0) { | |
4429 | - message.error( | |
4430 | - '订单号为:' + | |
4431 | - [...errorIds.values()].join(',') + | |
4432 | - '的订单存在不是[申请开票]或者[部分开票]状态的子订单,请检查!', | |
4433 | - ); | |
4434 | - return; | |
4435 | - } | |
4436 | - setIsMainOrder(true); | |
4437 | - setFinancialVisible(true); | |
4438 | - }} | |
4439 | - disabled={selectedSubOrderKeys?.length === 0} | |
4440 | - > | |
4441 | - {roleCode === 'admin' ? '合并(财务)' : '合并开票'} | |
4442 | - </Button>, | |
4443 | - ); | |
4444 | - } | |
4445 | - | |
4446 | - toolBtns.push( | |
4447 | - <Button | |
4448 | - type="primary" | |
4449 | - key="inv" | |
4450 | - onClick={() => { | |
4451 | - setIsMainOrder(true); | |
4452 | - let flat = [...subOrderSelectedMap.values()].flat(); | |
4453 | - //遍历flat,判断afterInvoicingStatusList存在于canApplyAfterInvoicingStatus | |
4454 | - flat.forEach((item) => { | |
4455 | - if ( | |
4456 | - item.invoicingStatus === 'UN_INVOICE' || | |
4457 | - (item.afterInvoicingStatus !== null && | |
4458 | - !canApplyAfterInvoicingStatus.includes( | |
4459 | - item.afterInvoicingStatus, | |
4460 | - )) | |
4461 | - ) { | |
4462 | - message.error('存在不能进行开票的订单'); | |
4463 | - return; | |
4464 | - } | |
4465 | - }); | |
4466 | - //遍历afterInvoicingStatusList | |
4467 | - setInvoicingDrawerFormVisible(true); | |
4468 | - }} | |
4469 | - disabled={selectedSubOrderKeys?.length === 0} | |
4470 | - > | |
4471 | - 申请开票 | |
4472 | - </Button>, | |
4473 | - ); | |
4474 | - | |
4475 | - if (rolePath?.includes('addOrder')) { | |
4476 | - toolBtns.push( | |
4477 | - <Button | |
4478 | - type="primary" | |
4479 | - key="out" | |
4480 | - onClick={() => { | |
4481 | - setOrderDrawerVisible(true); | |
4482 | - setOrderOptType('add'); | |
4483 | - }} | |
4484 | - > | |
4485 | - 新增 | |
4486 | - </Button>, | |
4487 | - ); | |
4488 | - } | |
4489 | - | |
4490 | - if (rolePath?.includes('importExcel')) { | |
4491 | - toolBtns.push( | |
4492 | - <Button | |
4493 | - type="primary" | |
4494 | - key="out" | |
4495 | - onClick={() => { | |
4496 | - setImportModalVisible(true); | |
4497 | - }} | |
4498 | - > | |
4499 | - 批量发货 | |
4500 | - </Button>, | |
4501 | - ); | |
4502 | - } | |
4503 | - | |
4504 | - if (rolePath?.includes('export')) { | |
4505 | - toolBtns.push( | |
4506 | - <Dropdown menu={exportMenuProps}> | |
4507 | - <Button> | |
4508 | - <Space> | |
4509 | - 导出 | |
4510 | - <DownOutlined /> | |
4511 | - </Space> | |
4512 | - </Button> | |
4513 | - </Dropdown>, | |
4514 | - ); | |
4515 | - } | |
4516 | - | |
4517 | - return toolBtns; | |
4518 | - } | |
4519 | 4085 | //选择天数1 |
4520 | 4086 | const options1 = [ |
4521 | 4087 | { |
... | ... | @@ -4564,16 +4130,16 @@ const OrderPage = () => { |
4564 | 4130 | setValue2(value); |
4565 | 4131 | }; |
4566 | 4132 | const confirmInvoice = async () => { |
4567 | - let flat = [...subOrderSelectedMap.values()].flat().map(item => item.id);; | |
4133 | + let flat = [...subOrderSelectedMap.values()].flat().map((item) => item.id); | |
4568 | 4134 | const data = await postServiceOrderConfirmInvoice({ |
4569 | - data: flat | |
4135 | + data: flat, | |
4570 | 4136 | }); |
4571 | 4137 | if (data.result === RESPONSE_CODE.SUCCESS) { |
4572 | 4138 | message.success(data.message); |
4573 | 4139 | refreshTable(); |
4574 | 4140 | } |
4575 | 4141 | console.log('5656confirm'); |
4576 | - } | |
4142 | + }; | |
4577 | 4143 | const [invoiceWarningNum, setInvoiceWarningNum] = useState(0); |
4578 | 4144 | const [invoiceRefundWarningNum, setInvoiceRefundWarningNum] = useState(0); |
4579 | 4145 | async function getInvoiceWarningNum() { |
... | ... | @@ -4594,11 +4160,7 @@ const OrderPage = () => { |
4594 | 4160 | } |
4595 | 4161 | }, [calDate]); |
4596 | 4162 | |
4597 | - const request = async ( | |
4598 | - params: any, | |
4599 | - sorter: any, | |
4600 | - filter: any, | |
4601 | - ) => { | |
4163 | + const request = async (params: any, sorter: any, filter: any) => { | |
4602 | 4164 | let orderIds = mainTableFormRef.current?.getFieldValue('id'); |
4603 | 4165 | let subOrderId = mainTableFormRef.current?.getFieldValue('subOrderId'); |
4604 | 4166 | params.id = params.id || orderIds; |
... | ... | @@ -4682,7 +4244,10 @@ const OrderPage = () => { |
4682 | 4244 | params.invoiceConfirmStatusDatetimeLe = null; |
4683 | 4245 | } else { |
4684 | 4246 | params.invoiceConfirmStatusDatetimeLe = calDate2; |
4685 | - console.log(params.invoiceConfirmStatusDatetimeLe, '5656params.statusDatetimeLe2') | |
4247 | + console.log( | |
4248 | + params.invoiceConfirmStatusDatetimeLe, | |
4249 | + '5656params.statusDatetimeLe2', | |
4250 | + ); | |
4686 | 4251 | } |
4687 | 4252 | //订单id处理 |
4688 | 4253 | /** |
... | ... | @@ -4690,8 +4255,7 @@ const OrderPage = () => { |
4690 | 4255 | * 第一次进来这个页面,url带有id的话,会自动填充到查询表单中,但是第一次查询params不会带这个id进来 |
4691 | 4256 | */ |
4692 | 4257 | let orderIds = mainTableFormRef.current?.getFieldValue('id'); |
4693 | - let subOrderId = | |
4694 | - mainTableFormRef.current?.getFieldValue('subOrderId'); | |
4258 | + let subOrderId = mainTableFormRef.current?.getFieldValue('subOrderId'); | |
4695 | 4259 | params.id = params.id || orderIds; |
4696 | 4260 | params.subOrderId = params.subOrderId || subOrderId; |
4697 | 4261 | if (params.id !== '') { |
... | ... | @@ -4751,7 +4315,7 @@ const OrderPage = () => { |
4751 | 4315 | data: data?.data || [], |
4752 | 4316 | total: data?.total || 0, |
4753 | 4317 | }; |
4754 | - } | |
4318 | + }; | |
4755 | 4319 | //biaojidown2 |
4756 | 4320 | //取消单选,将时间设为null |
4757 | 4321 | const handleSetNull = () => { |
... | ... | @@ -4776,24 +4340,25 @@ const OrderPage = () => { |
4776 | 4340 | <Radio.Group |
4777 | 4341 | value={value1} |
4778 | 4342 | onChange={radioOnChange1} |
4779 | - // 通过 onClick 处理单独 Radio 的点击事件 | |
4343 | + // 通过 onClick 处理单独 Radio 的点击事件 | |
4780 | 4344 | > |
4781 | - {options1.map(option => ( | |
4345 | + {options1.map((option) => ( | |
4782 | 4346 | <Radio |
4783 | 4347 | key={option.value} |
4784 | 4348 | value={option.value} |
4785 | 4349 | onClick={(e) => { |
4786 | - radioOnChange1(e as unknown as React.ChangeEvent<HTMLInputElement>) | |
4350 | + radioOnChange1( | |
4351 | + e as unknown as React.ChangeEvent<HTMLInputElement>, | |
4352 | + ); | |
4787 | 4353 | handleSetNull(); |
4788 | - } | |
4789 | - } | |
4354 | + }} | |
4790 | 4355 | > |
4791 | 4356 | {option.label} |
4792 | 4357 | </Radio> |
4793 | 4358 | ))} |
4794 | 4359 | </Radio.Group> |
4795 | 4360 | <Button |
4796 | - size='large' | |
4361 | + size="large" | |
4797 | 4362 | type="primary" |
4798 | 4363 | onClick={confirmInvoice} |
4799 | 4364 | style={{ position: 'absolute', right: '20px' }} |
... | ... | @@ -4852,9 +4417,9 @@ const OrderPage = () => { |
4852 | 4417 | toolbar={{ |
4853 | 4418 | multipleLine: true, |
4854 | 4419 | }} |
4855 | - // toolBarRender={() => { | |
4856 | - // return toolBarRender(); | |
4857 | - // }} | |
4420 | + // toolBarRender={() => { | |
4421 | + // return toolBarRender(); | |
4422 | + // }} | |
4858 | 4423 | /> |
4859 | 4424 | |
4860 | 4425 | {orderDrawerVisible && ( |
... | ... | @@ -5338,7 +4903,7 @@ const OrderPage = () => { |
5338 | 4903 | {contextHolder} |
5339 | 4904 | <FloatButton.BackTop visibilityHeight={0} /> |
5340 | 4905 | </div> |
5341 | - ) | |
4906 | + ), | |
5342 | 4907 | }, |
5343 | 4908 | { |
5344 | 4909 | key: 2, |
... | ... | @@ -5354,17 +4919,18 @@ const OrderPage = () => { |
5354 | 4919 | <Radio.Group |
5355 | 4920 | value={value2} |
5356 | 4921 | onChange={radioOnChange2} |
5357 | - // 通过 onClick 处理单独 Radio 的点击事件 | |
4922 | + // 通过 onClick 处理单独 Radio 的点击事件 | |
5358 | 4923 | > |
5359 | - {options2.map(option => ( | |
4924 | + {options2.map((option) => ( | |
5360 | 4925 | <Radio |
5361 | 4926 | key={option.value} |
5362 | 4927 | value={option.value} |
5363 | 4928 | onClick={(e) => { |
5364 | - radioOnChange2(e as unknown as React.ChangeEvent<HTMLInputElement>) | |
4929 | + radioOnChange2( | |
4930 | + e as unknown as React.ChangeEvent<HTMLInputElement>, | |
4931 | + ); | |
5365 | 4932 | handleSetNull2(); |
5366 | - } | |
5367 | - } | |
4933 | + }} | |
5368 | 4934 | > |
5369 | 4935 | {option.label} |
5370 | 4936 | </Radio> |
... | ... | @@ -5421,9 +4987,9 @@ const OrderPage = () => { |
5421 | 4987 | toolbar={{ |
5422 | 4988 | multipleLine: true, |
5423 | 4989 | }} |
5424 | - // toolBarRender={() => { | |
5425 | - // return toolBarRender(); | |
5426 | - // }} | |
4990 | + // toolBarRender={() => { | |
4991 | + // return toolBarRender(); | |
4992 | + // }} | |
5427 | 4993 | /> |
5428 | 4994 | |
5429 | 4995 | {orderDrawerVisible && ( |
... | ... | @@ -5441,532 +5007,475 @@ const OrderPage = () => { |
5441 | 5007 | /> |
5442 | 5008 | )} |
5443 | 5009 | |
5444 | - { | |
5445 | - checkVisible && ( | |
5446 | - <CheckModal | |
5447 | - setCheckVisible={(val: boolean) => { | |
5448 | - setCheckVisible(val); | |
5449 | - if (!val) { | |
5450 | - clearOptObject(); | |
5451 | - } | |
5452 | - }} | |
5453 | - data={isMainOrder ? getFirstMainOrder() : buildMainOrder()} | |
5454 | - subOrders={ | |
5455 | - isMainOrder | |
5456 | - ? [...subOrderSelectedMap.values()].flat() | |
5457 | - : buildSubOrders() | |
5458 | - } | |
5459 | - orderCheckType={orderCheckType} | |
5460 | - openOrderDrawer={(type: any, id: any) => { | |
5461 | - setCurrentMainId(id); | |
5462 | - setOrderOptType(type); | |
5463 | - setOrderDrawerVisible(true); | |
5464 | - }} | |
5465 | - onClose={() => { | |
5010 | + {checkVisible && ( | |
5011 | + <CheckModal | |
5012 | + setCheckVisible={(val: boolean) => { | |
5013 | + setCheckVisible(val); | |
5014 | + if (!val) { | |
5466 | 5015 | clearOptObject(); |
5467 | - setCheckVisible(false); | |
5468 | - refreshTable(); | |
5469 | - }} | |
5470 | - /> | |
5471 | - ) | |
5472 | - } | |
5473 | - | |
5474 | - { | |
5475 | - applyForInvoicingVisible && ( | |
5476 | - <ApplyForInvoicingModal | |
5477 | - setCheckVisible={(val: boolean) => { | |
5478 | - setApplyForInvoicingVisible(val); | |
5479 | - if (!val) { | |
5480 | - clearOptObject(); | |
5481 | - } | |
5482 | - }} | |
5483 | - subOrders={ | |
5484 | - isMainOrder | |
5485 | - ? [...subOrderSelectedMap.values()].flat() | |
5486 | - : buildSubOrders() | |
5487 | 5016 | } |
5488 | - totalPayment={getApplyInvoicingTotalPayment()} | |
5489 | - isMainOrder={isMainOrder} | |
5490 | - isEdit={isEdit} | |
5491 | - onClose={() => { | |
5492 | - setApplyForInvoicingVisible(false); | |
5493 | - setIsMainOrder(false); | |
5494 | - clearOptObject(); | |
5495 | - refreshTable(); | |
5496 | - }} | |
5497 | - /> | |
5498 | - ) | |
5499 | - } | |
5500 | - | |
5501 | - { | |
5502 | - notesEditVisible && ( | |
5503 | - <OrderNotesEditModal | |
5504 | - setNotesEditVisible={(val: boolean) => { | |
5505 | - setNotesEditVisible(val); | |
5506 | - if (!val) { | |
5507 | - clearOptObject(); | |
5508 | - } | |
5509 | - }} | |
5510 | - ids={selectedRows} | |
5511 | - notesType={notesType} | |
5512 | - notes={notes} | |
5513 | - onClose={() => { | |
5514 | - setNotesEditVisible(false); | |
5515 | - setSelectedRows([]); | |
5516 | - setNotes(notes); | |
5517 | - setNotesType(1); | |
5518 | - refreshTable(); | |
5519 | - }} | |
5520 | - /> | |
5521 | - ) | |
5522 | - } | |
5017 | + }} | |
5018 | + data={isMainOrder ? getFirstMainOrder() : buildMainOrder()} | |
5019 | + subOrders={ | |
5020 | + isMainOrder | |
5021 | + ? [...subOrderSelectedMap.values()].flat() | |
5022 | + : buildSubOrders() | |
5023 | + } | |
5024 | + orderCheckType={orderCheckType} | |
5025 | + openOrderDrawer={(type: any, id: any) => { | |
5026 | + setCurrentMainId(id); | |
5027 | + setOrderOptType(type); | |
5028 | + setOrderDrawerVisible(true); | |
5029 | + }} | |
5030 | + onClose={() => { | |
5031 | + clearOptObject(); | |
5032 | + setCheckVisible(false); | |
5033 | + refreshTable(); | |
5034 | + }} | |
5035 | + /> | |
5036 | + )} | |
5523 | 5037 | |
5524 | - { | |
5525 | - deliverVisible && ( | |
5526 | - <DeliverModal | |
5527 | - data={buildSubOrders()} | |
5528 | - isSendProduct={isSendProduct} | |
5529 | - setVisible={(val: boolean) => { | |
5530 | - setDeliverVisible(val); | |
5531 | - if (!val) { | |
5532 | - clearOptObject(); | |
5533 | - } | |
5534 | - }} | |
5535 | - sendType={orderCheckType} | |
5536 | - onClose={() => { | |
5038 | + {applyForInvoicingVisible && ( | |
5039 | + <ApplyForInvoicingModal | |
5040 | + setCheckVisible={(val: boolean) => { | |
5041 | + setApplyForInvoicingVisible(val); | |
5042 | + if (!val) { | |
5537 | 5043 | clearOptObject(); |
5538 | - setDeliverVisible(false); | |
5539 | - setIsSendProduct(false); | |
5540 | - refreshTable(); | |
5541 | - }} | |
5542 | - /> | |
5543 | - ) | |
5544 | - } | |
5545 | - | |
5546 | - { | |
5547 | - financialVisible && ( | |
5548 | - <FinancialDrawer | |
5549 | - isEdit={isEdit} | |
5550 | - mainOrder={isMainOrder ? getFirstMainOrder() : buildMainOrder()} | |
5551 | - subOrders={ | |
5552 | - isMainOrder | |
5553 | - ? [...subOrderSelectedMap.values()].flat() | |
5554 | - : buildSubOrders() | |
5555 | 5044 | } |
5556 | - isMainOrder={isMainOrder} | |
5557 | - cancel={() => { | |
5558 | - setFinancialVisible(false); | |
5559 | - clearOptObject(); | |
5560 | - setIsMainOrder(false); | |
5561 | - setIsEdit(false); | |
5562 | - }} | |
5563 | - onClose={() => { | |
5564 | - setFinancialVisible(false); | |
5565 | - clearOptObject(); | |
5566 | - refreshTable(); | |
5567 | - setIsMainOrder(false); | |
5568 | - setIsEdit(false); | |
5569 | - }} | |
5570 | - /> | |
5571 | - ) | |
5572 | - } | |
5573 | - | |
5574 | - { | |
5575 | - financialEditVisible && ( | |
5576 | - <FinancialEditDrawer | |
5577 | - mainOrder={buildMainOrder()} | |
5578 | - subOrders={buildSubOrders()} | |
5579 | - isMainOrder={isMainOrder} | |
5580 | - setVisible={() => { | |
5581 | - setFinancialEditVisible(false); | |
5582 | - clearOptObject(); | |
5583 | - }} | |
5584 | - onClose={() => { | |
5585 | - setFinancialEditVisible(false); | |
5586 | - refreshTable(); | |
5587 | - setIsMainOrder(false); | |
5588 | - clearOptObject(); | |
5589 | - }} | |
5590 | - /> | |
5591 | - ) | |
5592 | - } | |
5045 | + }} | |
5046 | + subOrders={ | |
5047 | + isMainOrder | |
5048 | + ? [...subOrderSelectedMap.values()].flat() | |
5049 | + : buildSubOrders() | |
5050 | + } | |
5051 | + totalPayment={getApplyInvoicingTotalPayment()} | |
5052 | + isMainOrder={isMainOrder} | |
5053 | + isEdit={isEdit} | |
5054 | + onClose={() => { | |
5055 | + setApplyForInvoicingVisible(false); | |
5056 | + setIsMainOrder(false); | |
5057 | + clearOptObject(); | |
5058 | + refreshTable(); | |
5059 | + }} | |
5060 | + /> | |
5061 | + )} | |
5593 | 5062 | |
5594 | - { | |
5595 | - orderPrintVisible && ( | |
5596 | - <OrderPrintModal | |
5597 | - mainOrder={buildMainOrder()} | |
5598 | - subOrders={buildSubOrders()} | |
5599 | - isRePrint={isRePrintOrder} | |
5600 | - setVisible={(val: boolean) => { | |
5601 | - setOrderPrintVisible(val); | |
5602 | - if (!val) { | |
5603 | - clearOptObject(); | |
5604 | - } | |
5605 | - }} | |
5606 | - printOptType={orderCheckType} | |
5607 | - onClose={() => { | |
5608 | - setOrderPrintVisible(false); | |
5063 | + {notesEditVisible && ( | |
5064 | + <OrderNotesEditModal | |
5065 | + setNotesEditVisible={(val: boolean) => { | |
5066 | + setNotesEditVisible(val); | |
5067 | + if (!val) { | |
5609 | 5068 | clearOptObject(); |
5610 | - setIsRePrintOrder(false); | |
5611 | - refreshTable(); | |
5612 | - }} | |
5613 | - /> | |
5614 | - ) | |
5615 | - } | |
5069 | + } | |
5070 | + }} | |
5071 | + ids={selectedRows} | |
5072 | + notesType={notesType} | |
5073 | + notes={notes} | |
5074 | + onClose={() => { | |
5075 | + setNotesEditVisible(false); | |
5076 | + setSelectedRows([]); | |
5077 | + setNotes(notes); | |
5078 | + setNotesType(1); | |
5079 | + refreshTable(); | |
5080 | + }} | |
5081 | + /> | |
5082 | + )} | |
5616 | 5083 | |
5617 | - { | |
5618 | - confirmReceiptVisible && ( | |
5619 | - <ConfirmReceiptModal | |
5620 | - data={buildSubOrders()} | |
5621 | - onClose={() => { | |
5622 | - setConfirmReceiptVisible(false); | |
5084 | + {deliverVisible && ( | |
5085 | + <DeliverModal | |
5086 | + data={buildSubOrders()} | |
5087 | + isSendProduct={isSendProduct} | |
5088 | + setVisible={(val: boolean) => { | |
5089 | + setDeliverVisible(val); | |
5090 | + if (!val) { | |
5623 | 5091 | clearOptObject(); |
5624 | - refreshTable(); | |
5625 | - }} | |
5626 | - /> | |
5627 | - ) | |
5628 | - } | |
5092 | + } | |
5093 | + }} | |
5094 | + sendType={orderCheckType} | |
5095 | + onClose={() => { | |
5096 | + clearOptObject(); | |
5097 | + setDeliverVisible(false); | |
5098 | + setIsSendProduct(false); | |
5099 | + refreshTable(); | |
5100 | + }} | |
5101 | + /> | |
5102 | + )} | |
5629 | 5103 | |
5630 | - { | |
5631 | - imagesViewerModalVisible && ( | |
5632 | - <ImagesViewerModal | |
5633 | - optType={imagesViewerOptType} | |
5634 | - setVisible={(val: boolean) => { | |
5635 | - setImagesViewerModalVisible(val); | |
5636 | - if (!val) { | |
5637 | - clearOptObject(); | |
5638 | - } | |
5639 | - }} | |
5640 | - onClose={() => { | |
5641 | - setImagesViewerModalVisible(false); | |
5642 | - }} | |
5643 | - orderRow={buildSubOrders()[0]} | |
5644 | - /> | |
5645 | - ) | |
5646 | - } | |
5104 | + {financialVisible && ( | |
5105 | + <FinancialDrawer | |
5106 | + isEdit={isEdit} | |
5107 | + mainOrder={isMainOrder ? getFirstMainOrder() : buildMainOrder()} | |
5108 | + subOrders={ | |
5109 | + isMainOrder | |
5110 | + ? [...subOrderSelectedMap.values()].flat() | |
5111 | + : buildSubOrders() | |
5112 | + } | |
5113 | + isMainOrder={isMainOrder} | |
5114 | + cancel={() => { | |
5115 | + setFinancialVisible(false); | |
5116 | + clearOptObject(); | |
5117 | + setIsMainOrder(false); | |
5118 | + setIsEdit(false); | |
5119 | + }} | |
5120 | + onClose={() => { | |
5121 | + setFinancialVisible(false); | |
5122 | + clearOptObject(); | |
5123 | + refreshTable(); | |
5124 | + setIsMainOrder(false); | |
5125 | + setIsEdit(false); | |
5126 | + }} | |
5127 | + /> | |
5128 | + )} | |
5647 | 5129 | |
5648 | - { | |
5649 | - importModalVisible && ( | |
5650 | - <ImportModal | |
5651 | - onClose={() => { | |
5652 | - setImportModalVisible(false); | |
5653 | - refreshTable(); | |
5654 | - }} | |
5655 | - /> | |
5656 | - ) | |
5657 | - } | |
5130 | + {financialEditVisible && ( | |
5131 | + <FinancialEditDrawer | |
5132 | + mainOrder={buildMainOrder()} | |
5133 | + subOrders={buildSubOrders()} | |
5134 | + isMainOrder={isMainOrder} | |
5135 | + setVisible={() => { | |
5136 | + setFinancialEditVisible(false); | |
5137 | + clearOptObject(); | |
5138 | + }} | |
5139 | + onClose={() => { | |
5140 | + setFinancialEditVisible(false); | |
5141 | + refreshTable(); | |
5142 | + setIsMainOrder(false); | |
5143 | + clearOptObject(); | |
5144 | + }} | |
5145 | + /> | |
5146 | + )} | |
5658 | 5147 | |
5659 | - { | |
5660 | - attachmentModalVisible && ( | |
5661 | - <AttachmentModal | |
5662 | - data={buildSubOrders()[0]} | |
5663 | - onClose={() => { | |
5664 | - setAttachmentModalVisible(false); | |
5148 | + {orderPrintVisible && ( | |
5149 | + <OrderPrintModal | |
5150 | + mainOrder={buildMainOrder()} | |
5151 | + subOrders={buildSubOrders()} | |
5152 | + isRePrint={isRePrintOrder} | |
5153 | + setVisible={(val: boolean) => { | |
5154 | + setOrderPrintVisible(val); | |
5155 | + if (!val) { | |
5665 | 5156 | clearOptObject(); |
5666 | - }} | |
5667 | - /> | |
5668 | - ) | |
5669 | - } | |
5157 | + } | |
5158 | + }} | |
5159 | + printOptType={orderCheckType} | |
5160 | + onClose={() => { | |
5161 | + setOrderPrintVisible(false); | |
5162 | + clearOptObject(); | |
5163 | + setIsRePrintOrder(false); | |
5164 | + refreshTable(); | |
5165 | + }} | |
5166 | + /> | |
5167 | + )} | |
5670 | 5168 | |
5671 | - { | |
5672 | - historyModalVisible && ( | |
5673 | - <HistoryModal | |
5674 | - subOrders={selectedRows} | |
5675 | - isCancelledOrder={filterCondifion === 70} | |
5676 | - onClose={() => { | |
5677 | - setHistoryModalVisible(false); | |
5678 | - setSelectedRows({}); | |
5679 | - clearOptObject(); | |
5680 | - }} | |
5681 | - /> | |
5682 | - ) | |
5683 | - } | |
5169 | + {confirmReceiptVisible && ( | |
5170 | + <ConfirmReceiptModal | |
5171 | + data={buildSubOrders()} | |
5172 | + onClose={() => { | |
5173 | + setConfirmReceiptVisible(false); | |
5174 | + clearOptObject(); | |
5175 | + refreshTable(); | |
5176 | + }} | |
5177 | + /> | |
5178 | + )} | |
5684 | 5179 | |
5685 | - { | |
5686 | - deliverInfoDrawerVisible && ( | |
5687 | - <DeliverInfoDrawer | |
5688 | - data={buildMainOrder()} | |
5689 | - onClose={() => { | |
5690 | - setDeliverInfoDrawerVisible(false); | |
5180 | + {imagesViewerModalVisible && ( | |
5181 | + <ImagesViewerModal | |
5182 | + optType={imagesViewerOptType} | |
5183 | + setVisible={(val: boolean) => { | |
5184 | + setImagesViewerModalVisible(val); | |
5185 | + if (!val) { | |
5691 | 5186 | clearOptObject(); |
5692 | - }} | |
5693 | - /> | |
5694 | - ) | |
5695 | - } | |
5187 | + } | |
5188 | + }} | |
5189 | + onClose={() => { | |
5190 | + setImagesViewerModalVisible(false); | |
5191 | + }} | |
5192 | + orderRow={buildSubOrders()[0]} | |
5193 | + /> | |
5194 | + )} | |
5696 | 5195 | |
5697 | - { | |
5698 | - deliverInfoDrawerVisible && ( | |
5699 | - <DeliverInfoDrawer | |
5700 | - data={buildMainOrder()} | |
5701 | - onClose={() => { | |
5702 | - setDeliverInfoDrawerVisible(false); | |
5703 | - clearOptObject(); | |
5704 | - }} | |
5705 | - /> | |
5706 | - ) | |
5707 | - } | |
5196 | + {importModalVisible && ( | |
5197 | + <ImportModal | |
5198 | + onClose={() => { | |
5199 | + setImportModalVisible(false); | |
5200 | + refreshTable(); | |
5201 | + }} | |
5202 | + /> | |
5203 | + )} | |
5708 | 5204 | |
5709 | - { | |
5710 | - procureCheckModalVisible && ( | |
5711 | - <ProcureCheckModal | |
5712 | - setCheckVisible={(val: boolean) => { | |
5713 | - setProcureCheckModalVisible(val); | |
5714 | - if (!val) { | |
5715 | - clearOptObject(); | |
5716 | - } | |
5717 | - }} | |
5718 | - isMainOrder={isMainOrder} | |
5719 | - orders={ | |
5720 | - isMainOrder | |
5721 | - ? [...subOrderSelectedMap.values()].flat() | |
5722 | - : buildSubOrders() | |
5205 | + {attachmentModalVisible && ( | |
5206 | + <AttachmentModal | |
5207 | + data={buildSubOrders()[0]} | |
5208 | + onClose={() => { | |
5209 | + setAttachmentModalVisible(false); | |
5210 | + clearOptObject(); | |
5211 | + }} | |
5212 | + /> | |
5213 | + )} | |
5214 | + | |
5215 | + {historyModalVisible && ( | |
5216 | + <HistoryModal | |
5217 | + subOrders={selectedRows} | |
5218 | + isCancelledOrder={filterCondifion === 70} | |
5219 | + onClose={() => { | |
5220 | + setHistoryModalVisible(false); | |
5221 | + setSelectedRows({}); | |
5222 | + clearOptObject(); | |
5223 | + }} | |
5224 | + /> | |
5225 | + )} | |
5226 | + | |
5227 | + {deliverInfoDrawerVisible && ( | |
5228 | + <DeliverInfoDrawer | |
5229 | + data={buildMainOrder()} | |
5230 | + onClose={() => { | |
5231 | + setDeliverInfoDrawerVisible(false); | |
5232 | + clearOptObject(); | |
5233 | + }} | |
5234 | + /> | |
5235 | + )} | |
5236 | + | |
5237 | + {deliverInfoDrawerVisible && ( | |
5238 | + <DeliverInfoDrawer | |
5239 | + data={buildMainOrder()} | |
5240 | + onClose={() => { | |
5241 | + setDeliverInfoDrawerVisible(false); | |
5242 | + clearOptObject(); | |
5243 | + }} | |
5244 | + /> | |
5245 | + )} | |
5246 | + | |
5247 | + {procureCheckModalVisible && ( | |
5248 | + <ProcureCheckModal | |
5249 | + setCheckVisible={(val: boolean) => { | |
5250 | + setProcureCheckModalVisible(val); | |
5251 | + if (!val) { | |
5252 | + clearOptObject(); | |
5723 | 5253 | } |
5724 | - onClose={() => { | |
5725 | - setProcureCheckModalVisible(false); | |
5254 | + }} | |
5255 | + isMainOrder={isMainOrder} | |
5256 | + orders={ | |
5257 | + isMainOrder | |
5258 | + ? [...subOrderSelectedMap.values()].flat() | |
5259 | + : buildSubOrders() | |
5260 | + } | |
5261 | + onClose={() => { | |
5262 | + setProcureCheckModalVisible(false); | |
5263 | + clearOptObject(); | |
5264 | + setIsMainOrder(false); | |
5265 | + refreshTable(); | |
5266 | + }} | |
5267 | + /> | |
5268 | + )} | |
5269 | + | |
5270 | + {afterSalesDrawerVisible && ( | |
5271 | + <AfterSalesDrawer | |
5272 | + setVisible={(val: boolean) => { | |
5273 | + setAfterSalesDrawerVisible(val); | |
5274 | + if (!val) { | |
5726 | 5275 | clearOptObject(); |
5727 | - setIsMainOrder(false); | |
5728 | - refreshTable(); | |
5729 | - }} | |
5730 | - /> | |
5731 | - ) | |
5732 | - } | |
5276 | + } | |
5277 | + }} | |
5278 | + mainOrder={buildMainOrder()} | |
5279 | + subOrders={buildSubOrders()} | |
5280 | + onClose={() => { | |
5281 | + setAfterSalesDrawerVisible(false); | |
5282 | + clearOptObject(); | |
5283 | + refreshTable(); | |
5284 | + }} | |
5285 | + /> | |
5286 | + )} | |
5733 | 5287 | |
5734 | - { | |
5735 | - afterSalesDrawerVisible && ( | |
5736 | - <AfterSalesDrawer | |
5737 | - setVisible={(val: boolean) => { | |
5738 | - setAfterSalesDrawerVisible(val); | |
5739 | - if (!val) { | |
5740 | - clearOptObject(); | |
5741 | - } | |
5742 | - }} | |
5743 | - mainOrder={buildMainOrder()} | |
5744 | - subOrders={buildSubOrders()} | |
5745 | - onClose={() => { | |
5746 | - setAfterSalesDrawerVisible(false); | |
5288 | + {procureConvertModalVisible && ( | |
5289 | + <ProcureConvertModal | |
5290 | + setVisible={(val: boolean) => { | |
5291 | + setProcureConvertModalVisible(val); | |
5292 | + if (!val) { | |
5747 | 5293 | clearOptObject(); |
5748 | - refreshTable(); | |
5749 | - }} | |
5750 | - /> | |
5751 | - ) | |
5752 | - } | |
5294 | + } | |
5295 | + }} | |
5296 | + subOrders={buildSubOrders()} | |
5297 | + onClose={() => { | |
5298 | + setProcureConvertModalVisible(false); | |
5299 | + clearOptObject(); | |
5300 | + refreshTable(); | |
5301 | + }} | |
5302 | + /> | |
5303 | + )} | |
5753 | 5304 | |
5754 | - { | |
5755 | - procureConvertModalVisible && ( | |
5756 | - <ProcureConvertModal | |
5757 | - setVisible={(val: boolean) => { | |
5758 | - setProcureConvertModalVisible(val); | |
5759 | - if (!val) { | |
5760 | - clearOptObject(); | |
5761 | - } | |
5762 | - }} | |
5763 | - subOrders={buildSubOrders()} | |
5764 | - onClose={() => { | |
5765 | - setProcureConvertModalVisible(false); | |
5305 | + {financialMergeDrawerVisible && ( | |
5306 | + <FinancialMergeDrawer | |
5307 | + setVisible={(val: boolean) => { | |
5308 | + setFinancialMergeDrawerVisible(val); | |
5309 | + if (!val) { | |
5766 | 5310 | clearOptObject(); |
5767 | - refreshTable(); | |
5768 | - }} | |
5769 | - /> | |
5770 | - ) | |
5771 | - } | |
5772 | - | |
5773 | - { | |
5774 | - financialMergeDrawerVisible && ( | |
5775 | - <FinancialMergeDrawer | |
5776 | - setVisible={(val: boolean) => { | |
5777 | - setFinancialMergeDrawerVisible(val); | |
5778 | - if (!val) { | |
5779 | - clearOptObject(); | |
5780 | - } | |
5781 | - }} | |
5782 | - dataList={ | |
5783 | - isMainOrder | |
5784 | - ? [...subOrderSelectedMap.values()].flat() | |
5785 | - : buildSubOrders() | |
5786 | 5311 | } |
5787 | - onClose={() => { | |
5788 | - setFinancialMergeDrawerVisible(false); | |
5789 | - setIsMainOrder(false); | |
5790 | - clearOptObject(); | |
5791 | - refreshTable(); | |
5792 | - }} | |
5793 | - /> | |
5794 | - ) | |
5795 | - } | |
5312 | + }} | |
5313 | + dataList={ | |
5314 | + isMainOrder | |
5315 | + ? [...subOrderSelectedMap.values()].flat() | |
5316 | + : buildSubOrders() | |
5317 | + } | |
5318 | + onClose={() => { | |
5319 | + setFinancialMergeDrawerVisible(false); | |
5320 | + setIsMainOrder(false); | |
5321 | + clearOptObject(); | |
5322 | + refreshTable(); | |
5323 | + }} | |
5324 | + /> | |
5325 | + )} | |
5796 | 5326 | |
5797 | - { | |
5798 | - financialReceiptsModalVisible && ( | |
5799 | - <FinancialReceiptsModal | |
5800 | - setVisible={(val: boolean) => { | |
5801 | - setFinancialReceiptsModalVisible(val); | |
5802 | - if (!val) { | |
5803 | - clearOptObject(); | |
5804 | - } | |
5805 | - }} | |
5806 | - datas={selectedRows} | |
5807 | - onClose={() => { | |
5808 | - setFinancialReceiptsModalVisible(false); | |
5809 | - setSelectedRows({}); | |
5810 | - refreshTable(); | |
5811 | - }} | |
5812 | - /> | |
5813 | - ) | |
5814 | - } | |
5327 | + {financialReceiptsModalVisible && ( | |
5328 | + <FinancialReceiptsModal | |
5329 | + setVisible={(val: boolean) => { | |
5330 | + setFinancialReceiptsModalVisible(val); | |
5331 | + if (!val) { | |
5332 | + clearOptObject(); | |
5333 | + } | |
5334 | + }} | |
5335 | + datas={selectedRows} | |
5336 | + onClose={() => { | |
5337 | + setFinancialReceiptsModalVisible(false); | |
5338 | + setSelectedRows({}); | |
5339 | + refreshTable(); | |
5340 | + }} | |
5341 | + /> | |
5342 | + )} | |
5815 | 5343 | |
5816 | - { | |
5817 | - shippingWarehouseChangeModalVisible && ( | |
5818 | - <ShippingWarehouseChangeModal | |
5819 | - setVisible={(val: boolean) => { | |
5820 | - setShippingWarehouseChangeModalVisible(val); | |
5821 | - if (!val) { | |
5822 | - clearOptObject(); | |
5823 | - } | |
5824 | - }} | |
5825 | - subOrderIds={ids} | |
5826 | - originShippingWarehouse={buildSubOrders()[0].shippingWarehouse} | |
5827 | - onClose={() => { | |
5828 | - setShippingWarehouseChangeModalVisible(false); | |
5344 | + {shippingWarehouseChangeModalVisible && ( | |
5345 | + <ShippingWarehouseChangeModal | |
5346 | + setVisible={(val: boolean) => { | |
5347 | + setShippingWarehouseChangeModalVisible(val); | |
5348 | + if (!val) { | |
5829 | 5349 | clearOptObject(); |
5830 | - setIds([]); | |
5831 | - refreshTable(); | |
5832 | - }} | |
5833 | - /> | |
5834 | - ) | |
5835 | - } | |
5836 | - { | |
5837 | - reissueVisible && ( | |
5838 | - <ReissueModal | |
5839 | - setVisible={(val: boolean) => { | |
5840 | - setReissueVisible(val); | |
5841 | - if (!val) { | |
5842 | - clearOptObject(); | |
5843 | - } | |
5844 | - }} | |
5845 | - subOrders={ | |
5846 | - isMainOrder | |
5847 | - ? [...subOrderSelectedMap.values()].flat() | |
5848 | - : buildSubOrders() | |
5849 | 5350 | } |
5850 | - onClose={() => { | |
5851 | - setReissueVisible(false); | |
5351 | + }} | |
5352 | + subOrderIds={ids} | |
5353 | + originShippingWarehouse={buildSubOrders()[0].shippingWarehouse} | |
5354 | + onClose={() => { | |
5355 | + setShippingWarehouseChangeModalVisible(false); | |
5356 | + clearOptObject(); | |
5357 | + setIds([]); | |
5358 | + refreshTable(); | |
5359 | + }} | |
5360 | + /> | |
5361 | + )} | |
5362 | + {reissueVisible && ( | |
5363 | + <ReissueModal | |
5364 | + setVisible={(val: boolean) => { | |
5365 | + setReissueVisible(val); | |
5366 | + if (!val) { | |
5852 | 5367 | clearOptObject(); |
5853 | - refreshTable(); | |
5854 | - }} | |
5855 | - /> | |
5856 | - ) | |
5857 | - } | |
5858 | - { | |
5859 | - reissueVisibleOld && ( | |
5860 | - <ReissueModal_old | |
5861 | - setVisible={(val: boolean) => { | |
5862 | - setReissueVisibleOld(val); | |
5863 | - console.log(reissueVisible); | |
5864 | - if (!val) { | |
5865 | - clearOptObject(); | |
5866 | - } | |
5867 | - }} | |
5868 | - mainOrder={buildMainOrder()} | |
5869 | - subOrders={buildSubOrders()} | |
5870 | - onClose={() => { | |
5871 | - setReissueVisibleOld(false); | |
5368 | + } | |
5369 | + }} | |
5370 | + subOrders={ | |
5371 | + isMainOrder | |
5372 | + ? [...subOrderSelectedMap.values()].flat() | |
5373 | + : buildSubOrders() | |
5374 | + } | |
5375 | + onClose={() => { | |
5376 | + setReissueVisible(false); | |
5377 | + clearOptObject(); | |
5378 | + refreshTable(); | |
5379 | + }} | |
5380 | + /> | |
5381 | + )} | |
5382 | + {reissueVisibleOld && ( | |
5383 | + <ReissueModal_old | |
5384 | + setVisible={(val: boolean) => { | |
5385 | + setReissueVisibleOld(val); | |
5386 | + console.log(reissueVisible); | |
5387 | + if (!val) { | |
5872 | 5388 | clearOptObject(); |
5873 | - refreshTable(); | |
5874 | - }} | |
5875 | - /> | |
5876 | - ) | |
5877 | - } | |
5878 | - { | |
5879 | - productionTimeModalVisible && ( | |
5880 | - <ProductionTimeModal | |
5881 | - setVisible={(val: boolean) => { | |
5882 | - setProductionTimeModalVisible(val); | |
5883 | - if (!val) { | |
5884 | - clearOptObject(); | |
5885 | - } | |
5886 | - }} | |
5887 | - subOrders={buildSubOrders()} | |
5888 | - onClose={() => { | |
5889 | - setProductionTimeModalVisible(false); | |
5389 | + } | |
5390 | + }} | |
5391 | + mainOrder={buildMainOrder()} | |
5392 | + subOrders={buildSubOrders()} | |
5393 | + onClose={() => { | |
5394 | + setReissueVisibleOld(false); | |
5395 | + clearOptObject(); | |
5396 | + refreshTable(); | |
5397 | + }} | |
5398 | + /> | |
5399 | + )} | |
5400 | + {productionTimeModalVisible && ( | |
5401 | + <ProductionTimeModal | |
5402 | + setVisible={(val: boolean) => { | |
5403 | + setProductionTimeModalVisible(val); | |
5404 | + if (!val) { | |
5890 | 5405 | clearOptObject(); |
5891 | - refreshTable(); | |
5892 | - }} | |
5893 | - /> | |
5894 | - ) | |
5895 | - } | |
5406 | + } | |
5407 | + }} | |
5408 | + subOrders={buildSubOrders()} | |
5409 | + onClose={() => { | |
5410 | + setProductionTimeModalVisible(false); | |
5411 | + clearOptObject(); | |
5412 | + refreshTable(); | |
5413 | + }} | |
5414 | + /> | |
5415 | + )} | |
5896 | 5416 | |
5897 | - { | |
5898 | - modifiedDiffModalVisible && ( | |
5899 | - <ModifiedDiffModal | |
5900 | - setVisible={(val: boolean) => { | |
5901 | - setModifiedDiffModalVisible(val); | |
5902 | - if (!val) { | |
5903 | - clearOptObject(); | |
5904 | - } | |
5905 | - }} | |
5906 | - subOrders={buildSubOrders()} | |
5907 | - mainOrder={buildMainOrder()} | |
5908 | - onClose={() => { | |
5909 | - setModifiedDiffModalVisible(false); | |
5417 | + {modifiedDiffModalVisible && ( | |
5418 | + <ModifiedDiffModal | |
5419 | + setVisible={(val: boolean) => { | |
5420 | + setModifiedDiffModalVisible(val); | |
5421 | + if (!val) { | |
5910 | 5422 | clearOptObject(); |
5911 | - }} | |
5912 | - /> | |
5913 | - ) | |
5914 | - } | |
5423 | + } | |
5424 | + }} | |
5425 | + subOrders={buildSubOrders()} | |
5426 | + mainOrder={buildMainOrder()} | |
5427 | + onClose={() => { | |
5428 | + setModifiedDiffModalVisible(false); | |
5429 | + clearOptObject(); | |
5430 | + }} | |
5431 | + /> | |
5432 | + )} | |
5915 | 5433 | |
5916 | - { | |
5917 | - uploadPayBillModalVisible && ( | |
5918 | - <UploadPayBillModal | |
5919 | - setVisible={(val: boolean) => { | |
5920 | - setUploadPayBillModalVisible(val); | |
5921 | - if (!val) { | |
5922 | - clearOptObject(); | |
5923 | - } | |
5924 | - }} | |
5925 | - subOrders={buildSubOrders()} | |
5926 | - mainOrder={buildMainOrder()} | |
5927 | - onClose={() => { | |
5928 | - setUploadPayBillModalVisible(false); | |
5434 | + {uploadPayBillModalVisible && ( | |
5435 | + <UploadPayBillModal | |
5436 | + setVisible={(val: boolean) => { | |
5437 | + setUploadPayBillModalVisible(val); | |
5438 | + if (!val) { | |
5929 | 5439 | clearOptObject(); |
5930 | - refreshTable(); | |
5931 | - }} | |
5932 | - /> | |
5933 | - ) | |
5934 | - } | |
5935 | - { | |
5936 | - invoicingDrawerFormVisible && ( | |
5937 | - <InvoicingDrawerForm | |
5938 | - dataList={ | |
5939 | - isMainOrder | |
5940 | - ? [...subOrderSelectedMap.values()].flat() | |
5941 | - : buildSubOrders() | |
5942 | 5440 | } |
5943 | - setVisible={(val: boolean) => { | |
5944 | - setInvoicingDrawerFormVisible(val); | |
5945 | - if (!val) { | |
5946 | - clearOptObject(); | |
5947 | - } | |
5948 | - }} | |
5949 | - mainOrder={isMainOrder ? getFirstMainOrder() : buildMainOrder()} | |
5950 | - onClose={() => { | |
5951 | - setInvoicingDrawerFormVisible(false); | |
5952 | - setIsMainOrder(true); | |
5441 | + }} | |
5442 | + subOrders={buildSubOrders()} | |
5443 | + mainOrder={buildMainOrder()} | |
5444 | + onClose={() => { | |
5445 | + setUploadPayBillModalVisible(false); | |
5446 | + clearOptObject(); | |
5447 | + refreshTable(); | |
5448 | + }} | |
5449 | + /> | |
5450 | + )} | |
5451 | + {invoicingDrawerFormVisible && ( | |
5452 | + <InvoicingDrawerForm | |
5453 | + dataList={ | |
5454 | + isMainOrder | |
5455 | + ? [...subOrderSelectedMap.values()].flat() | |
5456 | + : buildSubOrders() | |
5457 | + } | |
5458 | + setVisible={(val: boolean) => { | |
5459 | + setInvoicingDrawerFormVisible(val); | |
5460 | + if (!val) { | |
5953 | 5461 | clearOptObject(); |
5954 | - refreshTable(); | |
5955 | - }} | |
5956 | - /> | |
5957 | - ) | |
5958 | - } | |
5462 | + } | |
5463 | + }} | |
5464 | + mainOrder={isMainOrder ? getFirstMainOrder() : buildMainOrder()} | |
5465 | + onClose={() => { | |
5466 | + setInvoicingDrawerFormVisible(false); | |
5467 | + setIsMainOrder(true); | |
5468 | + clearOptObject(); | |
5469 | + refreshTable(); | |
5470 | + }} | |
5471 | + /> | |
5472 | + )} | |
5959 | 5473 | {contextHolder} |
5960 | 5474 | <FloatButton.BackTop visibilityHeight={0} /> |
5961 | - </div > | |
5962 | - ) | |
5963 | - } | |
5964 | - ] | |
5965 | - const [open, setOpen] = useState(true); | |
5966 | - //隐藏弹窗 | |
5967 | - const hideModal = () => { | |
5968 | - setOpen(false); | |
5969 | - }; | |
5475 | + </div> | |
5476 | + ), | |
5477 | + }, | |
5478 | + ]; | |
5970 | 5479 | return ( |
5971 | 5480 | <div className="order-page-container"> |
5972 | 5481 | <div id="resizeDiv"></div> |
... | ... | @@ -6059,12 +5568,7 @@ const OrderPage = () => { |
6059 | 5568 | <p>2、从发票确认之日起,超过15天未确认回款的订单将会进行第一次提醒,超过25天未确认回款的订单将会每天进行一次提醒,并限制下单功能</p> |
6060 | 5569 | </div> |
6061 | 5570 | </Modal> */} |
6062 | - <Tabs | |
6063 | - defaultActiveKey="1" | |
6064 | - items={tabsItems} | |
6065 | - onChange={(value) => { | |
6066 | - }} | |
6067 | - /> | |
5571 | + <Tabs defaultActiveKey="1" items={tabsItems} onChange={() => {}} /> | |
6068 | 5572 | </div> |
6069 | 5573 | ); |
6070 | 5574 | }; | ... | ... |