Commit 699fa04cbefe2b6f583e2ddb9396fdecb0c7a5d8
1 parent
6718e7eb
feat: update
Showing
6 changed files
with
172 additions
and
85 deletions
src/pages/Order/components/DeliverModal.tsx
@@ -13,7 +13,12 @@ import { cloneDeep } from 'lodash'; | @@ -13,7 +13,12 @@ import { cloneDeep } from 'lodash'; | ||
13 | import { useEffect, useRef, useState } from 'react'; | 13 | import { useEffect, useRef, useState } from 'react'; |
14 | import { LOGISTICS_STATUS_OPTIONS } from '../constant'; | 14 | import { LOGISTICS_STATUS_OPTIONS } from '../constant'; |
15 | 15 | ||
16 | -const DeliverModal = ({ data: propsData, isSendProduct, onClose }) => { | 16 | +const DeliverModal = ({ |
17 | + data: propsData, | ||
18 | + isSendProduct, | ||
19 | + setVisible, | ||
20 | + onClose, | ||
21 | +}) => { | ||
17 | const [data, setData] = useState(propsData || {}); | 22 | const [data, setData] = useState(propsData || {}); |
18 | const form = useRef(); | 23 | const form = useRef(); |
19 | 24 | ||
@@ -69,7 +74,9 @@ const DeliverModal = ({ data: propsData, isSendProduct, onClose }) => { | @@ -69,7 +74,9 @@ const DeliverModal = ({ data: propsData, isSendProduct, onClose }) => { | ||
69 | dataIndex: 'packageNumber', | 74 | dataIndex: 'packageNumber', |
70 | render: (_, record, index) => ( | 75 | render: (_, record, index) => ( |
71 | <InputNumber | 76 | <InputNumber |
77 | + min={1} | ||
72 | value={record.packageNumber} | 78 | value={record.packageNumber} |
79 | + defaultValue={1} | ||
73 | onChange={(value) => handleChange('packageNumber', index, value)} | 80 | onChange={(value) => handleChange('packageNumber', index, value)} |
74 | /> | 81 | /> |
75 | ), | 82 | ), |
@@ -118,7 +125,8 @@ const DeliverModal = ({ data: propsData, isSendProduct, onClose }) => { | @@ -118,7 +125,8 @@ const DeliverModal = ({ data: propsData, isSendProduct, onClose }) => { | ||
118 | id: item.id, | 125 | id: item.id, |
119 | logisticsMethod: item.logisticsMethod, | 126 | logisticsMethod: item.logisticsMethod, |
120 | serialNumber: item.serialNumber, | 127 | serialNumber: item.serialNumber, |
121 | - packageNumber: item.packageNumber, | 128 | + packageNumber: |
129 | + item.packageNumber === undefined ? 1 : item.packageNumber, | ||
122 | }; | 130 | }; |
123 | }); | 131 | }); |
124 | let body = { id: data[0].mainOrderId, list: list, flag: false }; | 132 | let body = { id: data[0].mainOrderId, list: list, flag: false }; |
@@ -133,7 +141,7 @@ const DeliverModal = ({ data: propsData, isSendProduct, onClose }) => { | @@ -133,7 +141,7 @@ const DeliverModal = ({ data: propsData, isSendProduct, onClose }) => { | ||
133 | } | 141 | } |
134 | }} | 142 | }} |
135 | onCancel={() => { | 143 | onCancel={() => { |
136 | - onClose(); | 144 | + setVisible(false); |
137 | }} | 145 | }} |
138 | > | 146 | > |
139 | <strong>将物流方式和物流单号更新到下方所有订单</strong> | 147 | <strong>将物流方式和物流单号更新到下方所有订单</strong> |
src/pages/Order/components/HistoryModal.tsx
1 | import { postServiceOrderQueryHistoryOrderRecord } from '@/services'; | 1 | import { postServiceOrderQueryHistoryOrderRecord } from '@/services'; |
2 | import { enumValueToLabel, formatDateTime } from '@/utils'; | 2 | import { enumValueToLabel, formatDateTime } from '@/utils'; |
3 | -import { Button, Col, Empty, Flex, Modal, Row } from 'antd'; | 3 | +import { Button, Col, Empty, Flex, Modal, Row, Spin } from 'antd'; |
4 | import { useEffect, useState } from 'react'; | 4 | import { useEffect, useState } from 'react'; |
5 | import { HISTORY_OPT_TYPE, ORDER_STATUS_OPTIONS } from '../constant'; | 5 | import { HISTORY_OPT_TYPE, ORDER_STATUS_OPTIONS } from '../constant'; |
6 | 6 | ||
@@ -9,7 +9,8 @@ export default ({ subOrders, onClose }) => { | @@ -9,7 +9,8 @@ export default ({ subOrders, onClose }) => { | ||
9 | return subOrder.id; | 9 | return subOrder.id; |
10 | }); | 10 | }); |
11 | const [data, setData] = useState([]); | 11 | const [data, setData] = useState([]); |
12 | - let i = 1; | 12 | + const [loading, setLoading] = useState(true); |
13 | + let i = 0; | ||
13 | 14 | ||
14 | const handleOk = () => { | 15 | const handleOk = () => { |
15 | onClose(); | 16 | onClose(); |
@@ -20,7 +21,7 @@ export default ({ subOrders, onClose }) => { | @@ -20,7 +21,7 @@ export default ({ subOrders, onClose }) => { | ||
20 | data: { ids: subOrderIds }, | 21 | data: { ids: subOrderIds }, |
21 | }); | 22 | }); |
22 | setData(res.data); | 23 | setData(res.data); |
23 | - console.log(data); | 24 | + setLoading(false); |
24 | }; | 25 | }; |
25 | 26 | ||
26 | useEffect(() => { | 27 | useEffect(() => { |
@@ -36,6 +37,7 @@ export default ({ subOrders, onClose }) => { | @@ -36,6 +37,7 @@ export default ({ subOrders, onClose }) => { | ||
36 | <Modal | 37 | <Modal |
37 | title="订单历史记录" | 38 | title="订单历史记录" |
38 | open | 39 | open |
40 | + width={650} | ||
39 | onOk={handleOk} | 41 | onOk={handleOk} |
40 | onCancel={handleCancel} | 42 | onCancel={handleCancel} |
41 | footer={() => ( | 43 | footer={() => ( |
@@ -44,59 +46,69 @@ export default ({ subOrders, onClose }) => { | @@ -44,59 +46,69 @@ export default ({ subOrders, onClose }) => { | ||
44 | </> | 46 | </> |
45 | )} | 47 | )} |
46 | > | 48 | > |
47 | - <Row> | ||
48 | - {data.map((item) => { | ||
49 | - return ( | ||
50 | - <Col span={24} key="key"> | ||
51 | - <Flex vertical> | ||
52 | - <span className="py-2 text-[#5E5E5E]">{'商品' + i++}</span> | 49 | + <Spin tip="加载中" spinning={loading}> |
50 | + <Row className="max-h-[500px] overflow-auto" gutter={[0, 14]}> | ||
51 | + {data.map((item) => { | ||
52 | + return ( | ||
53 | + <Col span={24} key="key"> | ||
53 | <Flex vertical> | 54 | <Flex vertical> |
54 | - {item.historySubOrderRecordDto?.map((history) => { | ||
55 | - return ( | ||
56 | - <div className="py-1" key="key"> | ||
57 | - <span className="pr-2 text-[#5E5E5E]"> | ||
58 | - {formatDateTime(history.createTime)} | ||
59 | - </span> | ||
60 | - <span className="text-[#3b83e5]"> | ||
61 | - {history.createByName} | ||
62 | - </span> | ||
63 | - 进行了 | ||
64 | - <span className="text-[#3b83e5]"> | ||
65 | - {HISTORY_OPT_TYPE.get(history.record)} | ||
66 | - </span> | ||
67 | - , | ||
68 | - {enumValueToLabel( | ||
69 | - history.status, | ||
70 | - ORDER_STATUS_OPTIONS, | ||
71 | - ) === undefined | ||
72 | - ? '子订单开票状态为' | ||
73 | - : '子订单状态为'} | ||
74 | - : | ||
75 | - <span className="text-[#3b83e5]"> | 55 | + <div> |
56 | + <span className="py-2 text-[#5E5E5E]"> | ||
57 | + {'商品' + ++i} | ||
58 | + </span> | ||
59 | + <span className="text-[#8C8C8C]"> | ||
60 | + -【{subOrders[i - 1].productName}】 | ||
61 | + </span> | ||
62 | + </div> | ||
63 | + | ||
64 | + <Flex vertical> | ||
65 | + {item.historySubOrderRecordDto?.map((history) => { | ||
66 | + return ( | ||
67 | + <div className="py-1" key="key"> | ||
68 | + <span className="pr-2 text-[#5E5E5E]"> | ||
69 | + {formatDateTime(history.createTime)} | ||
70 | + </span> | ||
71 | + <span className="text-[#3b83e5]"> | ||
72 | + {history.createByName} | ||
73 | + </span> | ||
74 | + 进行了 | ||
75 | + <span className="text-[#3b83e5]"> | ||
76 | + {HISTORY_OPT_TYPE.get(history.record)} | ||
77 | + </span> | ||
78 | + , | ||
76 | {enumValueToLabel( | 79 | {enumValueToLabel( |
77 | history.status, | 80 | history.status, |
78 | ORDER_STATUS_OPTIONS, | 81 | ORDER_STATUS_OPTIONS, |
79 | ) === undefined | 82 | ) === undefined |
80 | - ? '已开票' | ||
81 | - : enumValueToLabel( | ||
82 | - history.status, | ||
83 | - ORDER_STATUS_OPTIONS, | ||
84 | - )} | ||
85 | - </span> | ||
86 | - </div> | ||
87 | - ); | ||
88 | - })} | 83 | + ? '子订单开票状态为' |
84 | + : '子订单状态为'} | ||
85 | + : | ||
86 | + <span className="text-[#3b83e5]"> | ||
87 | + {enumValueToLabel( | ||
88 | + history.status, | ||
89 | + ORDER_STATUS_OPTIONS, | ||
90 | + ) === undefined | ||
91 | + ? '已开票' | ||
92 | + : enumValueToLabel( | ||
93 | + history.status, | ||
94 | + ORDER_STATUS_OPTIONS, | ||
95 | + )} | ||
96 | + </span> | ||
97 | + </div> | ||
98 | + ); | ||
99 | + })} | ||
100 | + </Flex> | ||
89 | </Flex> | 101 | </Flex> |
90 | - </Flex> | ||
91 | - </Col> | ||
92 | - ); | ||
93 | - })} | ||
94 | - </Row> | ||
95 | - {data?.length <= 0 ? ( | ||
96 | - <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} /> | ||
97 | - ) : ( | ||
98 | - '' | ||
99 | - )} | 102 | + </Col> |
103 | + ); | ||
104 | + })} | ||
105 | + </Row> | ||
106 | + {data?.length <= 0 ? ( | ||
107 | + <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} /> | ||
108 | + ) : ( | ||
109 | + '' | ||
110 | + )} | ||
111 | + </Spin> | ||
100 | </Modal> | 112 | </Modal> |
101 | </> | 113 | </> |
102 | ); | 114 | ); |
src/pages/Order/components/OrderDrawer.tsx
@@ -508,6 +508,12 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | @@ -508,6 +508,12 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | ||
508 | label="备注" | 508 | label="备注" |
509 | // disabled={mainInfoDisbled} | 509 | // disabled={mainInfoDisbled} |
510 | placeholder="请输入备注" | 510 | placeholder="请输入备注" |
511 | + rules={[ | ||
512 | + { | ||
513 | + max: 120, // 最大长度为120个字符 | ||
514 | + message: '备注不能超过120个字符', | ||
515 | + }, | ||
516 | + ]} | ||
511 | /> | 517 | /> |
512 | 518 | ||
513 | <h2>商品信息</h2> | 519 | <h2>商品信息</h2> |
@@ -730,6 +736,12 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | @@ -730,6 +736,12 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | ||
730 | name="notes" | 736 | name="notes" |
731 | label="备注" | 737 | label="备注" |
732 | placeholder="请输入备注" | 738 | placeholder="请输入备注" |
739 | + rules={[ | ||
740 | + { | ||
741 | + max: 120, // 最大长度为120个字符 | ||
742 | + message: '备注不能超过120个字符', | ||
743 | + }, | ||
744 | + ]} | ||
733 | />, | 745 | />, |
734 | <> | 746 | <> |
735 | <ProFormUploadDragger | 747 | <ProFormUploadDragger |
src/pages/Order/constant.ts
@@ -27,6 +27,7 @@ export const INVOCING_STATUS_OPTIONS = { | @@ -27,6 +27,7 @@ export const INVOCING_STATUS_OPTIONS = { | ||
27 | UN_INVOICE: '不需开票', | 27 | UN_INVOICE: '不需开票', |
28 | SPECIALLY_INVOICED: '专票', | 28 | SPECIALLY_INVOICED: '专票', |
29 | COMMON_INVOICED: '普票', | 29 | COMMON_INVOICED: '普票', |
30 | + INVOICED: '需要开票', | ||
30 | }; | 31 | }; |
31 | 32 | ||
32 | export const INVOCING_STATUS = { | 33 | export const INVOCING_STATUS = { |
@@ -86,6 +87,8 @@ export const ORDER_STATUS_OPTIONS = { | @@ -86,6 +87,8 @@ export const ORDER_STATUS_OPTIONS = { | ||
86 | export const TAGS_COLOR = new Map<string, string>([ | 87 | export const TAGS_COLOR = new Map<string, string>([ |
87 | ['UN_INVOICE', 'success'], | 88 | ['UN_INVOICE', 'success'], |
88 | ['INVOICED', 'processing'], | 89 | ['INVOICED', 'processing'], |
90 | + ['SPECIALLY_INVOICED', 'processing'], | ||
91 | + ['COMMON_INVOICED', 'processing'], | ||
89 | ['AFTER_INVOICED', 'success'], | 92 | ['AFTER_INVOICED', 'success'], |
90 | ['UNAUDITED', 'warning'], | 93 | ['UNAUDITED', 'warning'], |
91 | ['AUDITED', 'processing'], | 94 | ['AUDITED', 'processing'], |
@@ -148,6 +151,7 @@ export const HISTORY_OPT_TYPE = new Map<string, string>([ | @@ -148,6 +151,7 @@ export const HISTORY_OPT_TYPE = new Map<string, string>([ | ||
148 | ['PRINT_ORDER', '打印'], | 151 | ['PRINT_ORDER', '打印'], |
149 | ['INVOICING', '财务开票'], | 152 | ['INVOICING', '财务开票'], |
150 | ['EDIT_ORDER', '财务编辑'], | 153 | ['EDIT_ORDER', '财务编辑'], |
154 | + ['MODIFY_SEN_INFORMATION', '发货信息编辑'], | ||
151 | ]); | 155 | ]); |
152 | 156 | ||
153 | export const MAIN_ORDER_COLUMNS = [ | 157 | export const MAIN_ORDER_COLUMNS = [ |
src/pages/Order/index.tsx
@@ -30,6 +30,7 @@ import { | @@ -30,6 +30,7 @@ import { | ||
30 | MenuProps, | 30 | MenuProps, |
31 | Space, | 31 | Space, |
32 | Tag, | 32 | Tag, |
33 | + Tooltip, | ||
33 | message, | 34 | message, |
34 | } from 'antd'; | 35 | } from 'antd'; |
35 | import { cloneDeep } from 'lodash'; | 36 | import { cloneDeep } from 'lodash'; |
@@ -47,6 +48,7 @@ import OrderDrawer from './components/OrderDrawer'; | @@ -47,6 +48,7 @@ import OrderDrawer from './components/OrderDrawer'; | ||
47 | import OrderNotesEditModal from './components/OrderNotesEditModal'; | 48 | import OrderNotesEditModal from './components/OrderNotesEditModal'; |
48 | import SubOrderComfirmReceiptImagesModal from './components/SubOrderComfirmReceiptImagesModal'; | 49 | import SubOrderComfirmReceiptImagesModal from './components/SubOrderComfirmReceiptImagesModal'; |
49 | import { | 50 | import { |
51 | + LOGISTICS_STATUS_OPTIONS, | ||
50 | MAIN_ORDER_COLUMNS, | 52 | MAIN_ORDER_COLUMNS, |
51 | ORDER_STATUS_OPTIONS, | 53 | ORDER_STATUS_OPTIONS, |
52 | PAYMENT_CHANNEL_OPTIONS, | 54 | PAYMENT_CHANNEL_OPTIONS, |
@@ -198,12 +200,18 @@ const OrderPage = () => { | @@ -198,12 +200,18 @@ const OrderPage = () => { | ||
198 | <Flex className="w-full border-b-indigo-500"> | 200 | <Flex className="w-full border-b-indigo-500"> |
199 | <Flex vertical className="w-[31%]" gap="small"> | 201 | <Flex vertical className="w-[31%]" gap="small"> |
200 | {/* 商品名称 */} | 202 | {/* 商品名称 */} |
201 | - <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> | 203 | + <div |
204 | + className="whitespace-no-wrap overflow-hidden overflow-ellipsis" | ||
205 | + title={optRecord.productName} | ||
206 | + > | ||
202 | <span className="text-black font-medium "> | 207 | <span className="text-black font-medium "> |
203 | {optRecord.productName} | 208 | {optRecord.productName} |
204 | </span> | 209 | </span> |
205 | </div> | 210 | </div> |
206 | - <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> | 211 | + <div |
212 | + className="whitespace-no-wrap overflow-hidden overflow-ellipsis" | ||
213 | + title={optRecord.parameters} | ||
214 | + > | ||
207 | <span className="text-[#8C8C8C]">参数:{optRecord.parameters}</span> | 215 | <span className="text-[#8C8C8C]">参数:{optRecord.parameters}</span> |
208 | </div> | 216 | </div> |
209 | <Flex title={optRecord.notes}> | 217 | <Flex title={optRecord.notes}> |
@@ -224,15 +232,24 @@ const OrderPage = () => { | @@ -224,15 +232,24 @@ const OrderPage = () => { | ||
224 | </Flex> | 232 | </Flex> |
225 | </Flex> | 233 | </Flex> |
226 | <Flex className="w-[16%]" vertical gap="small"> | 234 | <Flex className="w-[16%]" vertical gap="small"> |
227 | - <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> | 235 | + <div |
236 | + className="whitespace-no-wrap overflow-hidden overflow-ellipsis" | ||
237 | + title={optRecord.productPrice} | ||
238 | + > | ||
228 | <span className="text-[#8C8C8C]">单价:</span> | 239 | <span className="text-[#8C8C8C]">单价:</span> |
229 | <span className="text-slate-700">¥{optRecord.productPrice}</span> | 240 | <span className="text-slate-700">¥{optRecord.productPrice}</span> |
230 | </div> | 241 | </div> |
231 | - <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> | 242 | + <div |
243 | + className="whitespace-no-wrap overflow-hidden overflow-ellipsis" | ||
244 | + title={optRecord.quantity} | ||
245 | + > | ||
232 | <span className="text-[#8C8C8C]">数量:</span> | 246 | <span className="text-[#8C8C8C]">数量:</span> |
233 | <span className="text-slate-700">x{optRecord.quantity}</span> | 247 | <span className="text-slate-700">x{optRecord.quantity}</span> |
234 | </div> | 248 | </div> |
235 | - <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> | 249 | + <div |
250 | + className="whitespace-no-wrap overflow-hidden overflow-ellipsis" | ||
251 | + title={optRecord.subOrderPayment} | ||
252 | + > | ||
236 | <span className="text-[#8C8C8C]">合计:</span> | 253 | <span className="text-[#8C8C8C]">合计:</span> |
237 | <span className="text-slate-700"> | 254 | <span className="text-slate-700"> |
238 | ¥{optRecord.subOrderPayment} | 255 | ¥{optRecord.subOrderPayment} |
@@ -261,7 +278,13 @@ const OrderPage = () => { | @@ -261,7 +278,13 @@ const OrderPage = () => { | ||
261 | </Flex> | 278 | </Flex> |
262 | <Flex className="w-[15%]" vertical gap="small"> | 279 | <Flex className="w-[15%]" vertical gap="small"> |
263 | {/* 所属部门 */} | 280 | {/* 所属部门 */} |
264 | - <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> | 281 | + <div |
282 | + className="whitespace-no-wrap overflow-hidden overflow-ellipsis" | ||
283 | + title={enumValueToLabel( | ||
284 | + optRecord.productBelongBusiness, | ||
285 | + PRODUCT_BELONG_DEPARTMENT_OPTIONS, | ||
286 | + )} | ||
287 | + > | ||
265 | <span className="text-slate-700"> | 288 | <span className="text-slate-700"> |
266 | {enumValueToLabel( | 289 | {enumValueToLabel( |
267 | optRecord.productBelongBusiness, | 290 | optRecord.productBelongBusiness, |
@@ -300,9 +323,31 @@ const OrderPage = () => { | @@ -300,9 +323,31 @@ const OrderPage = () => { | ||
300 | 323 | ||
301 | {/* 物流信息 */} | 324 | {/* 物流信息 */} |
302 | <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> | 325 | <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> |
303 | - <Button type="link" size="small" className="px-0"> | ||
304 | - 物流信息 | ||
305 | - </Button> | 326 | + {optRecord.orderStatus === 'CONFIRM_RECEIPT' || |
327 | + optRecord.orderStatus === 'SHIPPED' ? ( | ||
328 | + <Tooltip | ||
329 | + color="#FFFFFF" | ||
330 | + placement="bottom" | ||
331 | + title={ | ||
332 | + <div className="text-black px-5 py-4"> | ||
333 | + {optRecord.serialNumber === undefined | ||
334 | + ? '暂无物流信息' | ||
335 | + : enumValueToLabel( | ||
336 | + optRecord.logisticsMethod, | ||
337 | + LOGISTICS_STATUS_OPTIONS, | ||
338 | + ) + | ||
339 | + ' ' + | ||
340 | + optRecord.serialNumber} | ||
341 | + </div> | ||
342 | + } | ||
343 | + > | ||
344 | + <Button type="link" size="small" style={{ padding: 0 }}> | ||
345 | + 物流信息 | ||
346 | + </Button> | ||
347 | + </Tooltip> | ||
348 | + ) : ( | ||
349 | + '' | ||
350 | + )} | ||
306 | </div> | 351 | </div> |
307 | </Flex> | 352 | </Flex> |
308 | <Flex className="w-[18%]" wrap="wrap" gap="small"> | 353 | <Flex className="w-[18%]" wrap="wrap" gap="small"> |
@@ -339,26 +384,6 @@ const OrderPage = () => { | @@ -339,26 +384,6 @@ const OrderPage = () => { | ||
339 | '' | 384 | '' |
340 | )} | 385 | )} |
341 | 386 | ||
342 | - {optRecord.subPath.includes('orderCancel') ? ( | ||
343 | - <ButtonConfirm | ||
344 | - className="p-0" | ||
345 | - title="确认作废?" | ||
346 | - text="作废" | ||
347 | - onConfirm={async () => { | ||
348 | - let body = { ids: [optRecord.id], checkIsMainOrderId: false }; | ||
349 | - const data = await postServiceOrderOrderCancel({ | ||
350 | - data: body, | ||
351 | - }); | ||
352 | - if (data.result === RESPONSE_CODE.SUCCESS) { | ||
353 | - message.success(data.message); | ||
354 | - refreshTable(); | ||
355 | - } | ||
356 | - }} | ||
357 | - /> | ||
358 | - ) : ( | ||
359 | - '' | ||
360 | - )} | ||
361 | - | ||
362 | {optRecord.subPath.includes('modifySendInformation') ? ( | 387 | {optRecord.subPath.includes('modifySendInformation') ? ( |
363 | <Button | 388 | <Button |
364 | className="p-0" | 389 | className="p-0" |
@@ -484,6 +509,26 @@ const OrderPage = () => { | @@ -484,6 +509,26 @@ const OrderPage = () => { | ||
484 | ) : ( | 509 | ) : ( |
485 | '' | 510 | '' |
486 | )} | 511 | )} |
512 | + | ||
513 | + {optRecord.subPath.includes('orderCancel') ? ( | ||
514 | + <ButtonConfirm | ||
515 | + className="p-0" | ||
516 | + title="确认作废?" | ||
517 | + text="作废" | ||
518 | + onConfirm={async () => { | ||
519 | + let body = { ids: [optRecord.id], checkIsMainOrderId: false }; | ||
520 | + const data = await postServiceOrderOrderCancel({ | ||
521 | + data: body, | ||
522 | + }); | ||
523 | + if (data.result === RESPONSE_CODE.SUCCESS) { | ||
524 | + message.success(data.message); | ||
525 | + refreshTable(); | ||
526 | + } | ||
527 | + }} | ||
528 | + /> | ||
529 | + ) : ( | ||
530 | + '' | ||
531 | + )} | ||
487 | </Flex> | 532 | </Flex> |
488 | </Flex> | 533 | </Flex> |
489 | ); | 534 | ); |
@@ -854,7 +899,7 @@ const OrderPage = () => { | @@ -854,7 +899,7 @@ const OrderPage = () => { | ||
854 | </Flex> | 899 | </Flex> |
855 | </Flex> | 900 | </Flex> |
856 | 901 | ||
857 | - <Flex className="p-0 py-[24px] pl-[23px] pr-[5px] bg-white rounded-b-lg"> | 902 | + <Flex className="p-0 pb-[24px] pt-[4px] pl-[23px] pr-[5px] bg-white rounded-b-lg"> |
858 | {expandedRowRender(record)} | 903 | {expandedRowRender(record)} |
859 | </Flex> | 904 | </Flex> |
860 | </Flex> | 905 | </Flex> |
@@ -1134,6 +1179,9 @@ const OrderPage = () => { | @@ -1134,6 +1179,9 @@ const OrderPage = () => { | ||
1134 | <DeliverModal | 1179 | <DeliverModal |
1135 | data={selectedRows} | 1180 | data={selectedRows} |
1136 | isSendProduct={isSendProduct} | 1181 | isSendProduct={isSendProduct} |
1182 | + setVisible={(b: boolean) => { | ||
1183 | + setDeliverVisible(b); | ||
1184 | + }} | ||
1137 | onClose={() => { | 1185 | onClose={() => { |
1138 | setDeliverVisible(false); | 1186 | setDeliverVisible(false); |
1139 | setOrderRow({}); | 1187 | setOrderRow({}); |
@@ -1161,6 +1209,9 @@ const OrderPage = () => { | @@ -1161,6 +1209,9 @@ const OrderPage = () => { | ||
1161 | mainOrder={orderRow} | 1209 | mainOrder={orderRow} |
1162 | subOrders={selectedRows} | 1210 | subOrders={selectedRows} |
1163 | isRePrint={isRePrintOrder} | 1211 | isRePrint={isRePrintOrder} |
1212 | + setVisible={(b: boolean) => { | ||
1213 | + setOrderPrintVisible(b); | ||
1214 | + }} | ||
1164 | onClose={() => { | 1215 | onClose={() => { |
1165 | setOrderPrintVisible(false); | 1216 | setOrderPrintVisible(false); |
1166 | setOrderRow({}); | 1217 | setOrderRow({}); |
src/pages/OrderPrint/OrderPrintModal.tsx
@@ -10,7 +10,7 @@ import DalangPrinter from './components/DalangPrinter'; | @@ -10,7 +10,7 @@ import DalangPrinter from './components/DalangPrinter'; | ||
10 | import HoujiePrinter from './components/HoujiePrinter'; | 10 | import HoujiePrinter from './components/HoujiePrinter'; |
11 | import ZhuguangPrinter from './components/ZhuguangPrinter'; | 11 | import ZhuguangPrinter from './components/ZhuguangPrinter'; |
12 | 12 | ||
13 | -export default ({ mainOrder, subOrders, isRePrint, onClose }) => { | 13 | +export default ({ mainOrder, subOrders, isRePrint, setVisible, onClose }) => { |
14 | const [printerType, setPrinterType] = useState('Houjie'); | 14 | const [printerType, setPrinterType] = useState('Houjie'); |
15 | const { confirm } = Modal; | 15 | const { confirm } = Modal; |
16 | const handleChange = (value: string) => { | 16 | const handleChange = (value: string) => { |
@@ -67,7 +67,7 @@ export default ({ mainOrder, subOrders, isRePrint, onClose }) => { | @@ -67,7 +67,7 @@ export default ({ mainOrder, subOrders, isRePrint, onClose }) => { | ||
67 | 67 | ||
68 | // onClose(); | 68 | // onClose(); |
69 | }} | 69 | }} |
70 | - onCancel={() => onClose()} | 70 | + onCancel={() => setVisible(false)} |
71 | width={1000} | 71 | width={1000} |
72 | > | 72 | > |
73 | <Space direction="vertical" className="py-2"> | 73 | <Space direction="vertical" className="py-2"> |