Commit 04acf26af9736f9e3c46f15491c779acf4bcc745
1 parent
117c2644
feat: update
Showing
15 changed files
with
1181 additions
and
797 deletions
.idea/.gitignore
0 → 100644
.idea/canrd-erp-front.iml
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<module type="WEB_MODULE" version="4"> | |
3 | + <component name="NewModuleRootManager"> | |
4 | + <content url="file://$MODULE_DIR$"> | |
5 | + <excludeFolder url="file://$MODULE_DIR$/temp" /> | |
6 | + <excludeFolder url="file://$MODULE_DIR$/.tmp" /> | |
7 | + <excludeFolder url="file://$MODULE_DIR$/tmp" /> | |
8 | + </content> | |
9 | + <orderEntry type="inheritedJdk" /> | |
10 | + <orderEntry type="sourceFolder" forTests="false" /> | |
11 | + </component> | |
12 | +</module> | |
0 | 13 | \ No newline at end of file | ... | ... |
.idea/inspectionProfiles/Project_Default.xml
0 → 100644
1 | +<component name="InspectionProjectProfileManager"> | |
2 | + <profile version="1.0"> | |
3 | + <option name="myName" value="Project Default" /> | |
4 | + <inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" /> | |
5 | + <inspection_tool class="Stylelint" enabled="true" level="ERROR" enabled_by_default="true" /> | |
6 | + </profile> | |
7 | +</component> | |
0 | 8 | \ No newline at end of file | ... | ... |
.idea/modules.xml
0 → 100644
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<project version="4"> | |
3 | + <component name="ProjectModuleManager"> | |
4 | + <modules> | |
5 | + <module fileurl="file://$PROJECT_DIR$/.idea/canrd-erp-front.iml" filepath="$PROJECT_DIR$/.idea/canrd-erp-front.iml" /> | |
6 | + </modules> | |
7 | + </component> | |
8 | +</project> | |
0 | 9 | \ No newline at end of file | ... | ... |
.idea/vcs.xml
0 → 100644
.umirc.ts
... | ... | @@ -13,9 +13,9 @@ export default defineConfig({ |
13 | 13 | }, |
14 | 14 | proxy: { |
15 | 15 | '/api/': { |
16 | - target: 'http://localhost:8085/', | |
16 | + // target: 'http://localhost:8085/', | |
17 | 17 | // target: 'http://192.168.1.6:8085/', |
18 | - // target: 'http://39.108.227.113:8085/', | |
18 | + target: 'http://39.108.227.113:8085/', | |
19 | 19 | changeOrigin: true, |
20 | 20 | pathRewrite: { '^/api': '' }, |
21 | 21 | }, |
... | ... | @@ -36,6 +36,7 @@ export default defineConfig({ |
36 | 36 | name: '订单管理', |
37 | 37 | path: '/order', |
38 | 38 | component: './Order', |
39 | + icon: 'ProfileOutlined', | |
39 | 40 | }, |
40 | 41 | { |
41 | 42 | name: '打印', | ... | ... |
src/app.ts
... | ... | @@ -17,14 +17,13 @@ export async function getInitialState(): Promise<{ name: string }> { |
17 | 17 | |
18 | 18 | export const layout = () => { |
19 | 19 | return { |
20 | - menuRender: false, | |
21 | - | |
22 | 20 | menu: { |
23 | 21 | locale: false, |
24 | 22 | // header: true, |
25 | 23 | headerRender: true, |
26 | 24 | // rightContentRender: () => <RightContent />, |
27 | 25 | // footerRender: () => <Footer />, |
26 | + siderWidth: 190, | |
28 | 27 | }, |
29 | 28 | }; |
30 | 29 | }; | ... | ... |
src/pages/Order/components/HistoryModal.tsx
0 → 100644
1 | +import { postServiceOrderQueryHistoryOrderRecord } from '@/services'; | |
2 | +import { Button, Modal, Timeline } from 'antd'; | |
3 | + | |
4 | +export default ({ subOrders, onClose }) => { | |
5 | + let subOrderIds = subOrders?.map((subOrder: any) => { | |
6 | + return subOrder.id; | |
7 | + }); | |
8 | + | |
9 | + const handleOk = () => { | |
10 | + onClose(); | |
11 | + }; | |
12 | + | |
13 | + const getHistory = async () => { | |
14 | + let res = await postServiceOrderQueryHistoryOrderRecord({ | |
15 | + data: { ids: subOrderIds }, | |
16 | + }); | |
17 | + console.log(res); | |
18 | + }; | |
19 | + getHistory(); | |
20 | + | |
21 | + const handleCancel = () => { | |
22 | + onClose(); | |
23 | + }; | |
24 | + | |
25 | + return ( | |
26 | + <> | |
27 | + <Modal | |
28 | + title="订单历史记录" | |
29 | + open | |
30 | + onOk={handleOk} | |
31 | + onCancel={handleCancel} | |
32 | + footer={() => ( | |
33 | + <> | |
34 | + <Button onClick={handleCancel}>返回</Button> | |
35 | + </> | |
36 | + )} | |
37 | + > | |
38 | + <Timeline | |
39 | + className="pt-10" | |
40 | + items={[ | |
41 | + { | |
42 | + children: 'Create a services site 2015-09-01', | |
43 | + }, | |
44 | + { | |
45 | + children: 'Solve initial network problems 2015-09-01', | |
46 | + }, | |
47 | + { | |
48 | + children: 'Technical testing 2015-09-01', | |
49 | + }, | |
50 | + { | |
51 | + children: 'Network problems being solved 2015-09-01', | |
52 | + }, | |
53 | + ]} | |
54 | + /> | |
55 | + </Modal> | |
56 | + </> | |
57 | + ); | |
58 | +}; | ... | ... |
src/pages/Order/components/OrderDrawer.tsx
1 | 1 | import { RESPONSE_CODE } from '@/constants/enum'; |
2 | 2 | import { |
3 | 3 | postServiceOrderAddOrder, |
4 | + postServiceOrderQueryCustomerNameInformation, | |
4 | 5 | postServiceOrderQueryProductInformation, |
5 | 6 | postServiceOrderUpdateOrder, |
6 | 7 | } from '@/services'; |
... | ... | @@ -21,7 +22,7 @@ import { |
21 | 22 | ProFormTextArea, |
22 | 23 | ProFormUploadDragger, |
23 | 24 | } from '@ant-design/pro-components'; |
24 | -import { Form, message } from 'antd'; | |
25 | +import { Button, Form, message } from 'antd'; | |
25 | 26 | import { cloneDeep } from 'lodash'; |
26 | 27 | import { useEffect, useRef, useState } from 'react'; |
27 | 28 | import { |
... | ... | @@ -134,6 +135,56 @@ export default ({ onClose, data, subOrders, orderOptType }) => { |
134 | 135 | currentData.unit = option?.unit; |
135 | 136 | form.setFieldValue('list', copyList); |
136 | 137 | } |
138 | + | |
139 | + /** | |
140 | + * 选择收货人后自动填充信息 | |
141 | + * @param option 收货人信息 | |
142 | + */ | |
143 | + function autoFillCustomerInfo(option: any) { | |
144 | + form.setFieldValue('institution', option.institution); | |
145 | + form.setFieldValue('institutionContactName', option.institutionContactName); | |
146 | + form.setFieldValue( | |
147 | + 'customerShippingAddress', | |
148 | + option.customerShippingAddress, | |
149 | + ); | |
150 | + form.setFieldValue('customerContactNumber', option.customerContactNumber); | |
151 | + form.setFieldValue('customerName', option.customerName); | |
152 | + } | |
153 | + | |
154 | + /** | |
155 | + * 计算子订单金额 | |
156 | + * @param listMeta 当前商品信息 | |
157 | + */ | |
158 | + function computeSubOrderPayment(listMeta: any) { | |
159 | + let quantity = listMeta?.record?.quantity; | |
160 | + let productPrice = listMeta?.record?.productPrice; | |
161 | + quantity = quantity === '' || quantity === undefined ? 0 : quantity; | |
162 | + productPrice = | |
163 | + productPrice === '' || productPrice === undefined ? 0 : productPrice; | |
164 | + | |
165 | + listMeta.subOrderPayment = quantity * productPrice; | |
166 | + let list = form.getFieldValue('list'); | |
167 | + list[listMeta?.index].subOrderPayment = quantity * productPrice; | |
168 | + form.setFieldValue('list', list); | |
169 | + } | |
170 | + | |
171 | + /** | |
172 | + * 计算支付总额 | |
173 | + */ | |
174 | + function computeTotalPayment() { | |
175 | + let list = form.getFieldValue('list'); | |
176 | + let totalPayment = 0; | |
177 | + list?.forEach((subOrder: any) => { | |
178 | + let subOrderPayment = subOrder?.subOrderPayment; | |
179 | + if (subOrderPayment === '' || subOrderPayment === undefined) { | |
180 | + totalPayment += 0; | |
181 | + } else { | |
182 | + totalPayment += subOrderPayment; | |
183 | + } | |
184 | + }); | |
185 | + form.setFieldValue('totalPayment', totalPayment); | |
186 | + } | |
187 | + | |
137 | 188 | return ( |
138 | 189 | <DrawerForm<{ |
139 | 190 | deleteSubOrderLists: any; |
... | ... | @@ -225,13 +276,99 @@ export default ({ onClose, data, subOrders, orderOptType }) => { |
225 | 276 | rules={[{ required: true, message: '销售代表必填' }]} |
226 | 277 | // disabled={mainInfoDisbled} |
227 | 278 | /> |
228 | - <ProFormText | |
229 | - name="customerName" | |
230 | - width="lg" | |
279 | + <ProFormSelect | |
280 | + key="key" | |
231 | 281 | label="收货人" |
282 | + width="lg" | |
283 | + showSearch | |
284 | + name="customerName" | |
285 | + // options={options} | |
232 | 286 | placeholder="请输入收货人" |
233 | 287 | rules={[{ required: true, message: '收货人必填' }]} |
234 | - // disabled={mainInfoDisbled} | |
288 | + onChange={(_, option) => { | |
289 | + autoFillCustomerInfo(option); | |
290 | + }} | |
291 | + fieldProps={{ | |
292 | + optionItemRender(item) { | |
293 | + if (item.type === 'add') { | |
294 | + return ( | |
295 | + <div title={item.customerName + '(新增商品信息)'}> | |
296 | + <span style={{ color: '#333333' }}>{item.customerName}</span> | |
297 | + {' | '} | |
298 | + <span style={{ color: 'orange' }}>自定义</span> | |
299 | + </div> | |
300 | + ); | |
301 | + } | |
302 | + return ( | |
303 | + <div | |
304 | + title={ | |
305 | + item.customerName + | |
306 | + ' | ' + | |
307 | + item.customerContactNumber + | |
308 | + ' | ' + | |
309 | + (item.customerShippingAddress === undefined | |
310 | + ? '无地址' | |
311 | + : item.customerShippingAddress) + | |
312 | + ' | ' + | |
313 | + item.institutionContactName + | |
314 | + ' | ' + | |
315 | + item.institution | |
316 | + } | |
317 | + > | |
318 | + <span style={{ color: '#333333' }}>{item.customerName}</span> | |
319 | + {' | '} | |
320 | + <span style={{ color: '#339999' }}> | |
321 | + {item.customerContactNumber === undefined | |
322 | + ? '无电话号码' | |
323 | + : item.customerContactNumber} | |
324 | + </span> | |
325 | + {' | '} | |
326 | + <span style={{ color: '#666666' }}> | |
327 | + {item.customerShippingAddress === undefined | |
328 | + ? '无地址' | |
329 | + : item.customerShippingAddress} | |
330 | + </span> | |
331 | + {' | '} | |
332 | + <span style={{ color: '#666666' }}> | |
333 | + {item.institutionContactName === undefined | |
334 | + ? '无单位联系人' | |
335 | + : item.institutionContactName} | |
336 | + </span> | |
337 | + {' | '} | |
338 | + <span style={{ color: '#666666' }}> | |
339 | + {item.institution === undefined ? '无单位' : item.institution} | |
340 | + </span> | |
341 | + </div> | |
342 | + ); | |
343 | + }, | |
344 | + }} | |
345 | + request={async (value, { params }) => { | |
346 | + const keywords = value.keyWords; | |
347 | + const { data } = await postServiceOrderQueryCustomerNameInformation({ | |
348 | + data: { customerName: keywords }, | |
349 | + params: params, | |
350 | + }); | |
351 | + let options = data.map((c: any) => { | |
352 | + return { | |
353 | + ...c, | |
354 | + label: c.customerName, | |
355 | + value: c.id, | |
356 | + key: c.id, | |
357 | + }; | |
358 | + }); | |
359 | + | |
360 | + //第一个商品默认为要新增的商品 | |
361 | + if (keywords.trim() !== '') { | |
362 | + options.unshift({ | |
363 | + customerName: keywords, | |
364 | + type: 'add', | |
365 | + label: keywords, | |
366 | + value: 3.1415926, | |
367 | + key: keywords, | |
368 | + }); | |
369 | + } | |
370 | + return options; | |
371 | + }} | |
235 | 372 | /> |
236 | 373 | <ProFormText |
237 | 374 | width="lg" |
... | ... | @@ -265,13 +402,28 @@ export default ({ onClose, data, subOrders, orderOptType }) => { |
265 | 402 | rules={[{ required: true, message: '收货地址必填' }]} |
266 | 403 | // disabled={mainInfoDisbled} |
267 | 404 | /> |
268 | - <ProFormDigit | |
269 | - name="totalPayment" | |
270 | - width="lg" | |
271 | - label="支付总额(¥)" | |
272 | - rules={[{ required: true, message: '支付总额必填' }]} | |
273 | - // disabled={mainInfoDisbled} | |
274 | - /> | |
405 | + <div id="total-payment"> | |
406 | + <ProFormDigit | |
407 | + name="totalPayment" | |
408 | + width="lg" | |
409 | + label="支付总额(¥)" | |
410 | + rules={[{ required: true, message: '支付总额必填' }]} | |
411 | + tooltip="点击计算,合计所有子订单金额" | |
412 | + fieldProps={{ | |
413 | + addonAfter: ( | |
414 | + <Button | |
415 | + className="rounded-l-none" | |
416 | + type="primary" | |
417 | + onClick={computeTotalPayment} | |
418 | + > | |
419 | + 计算 | |
420 | + </Button> | |
421 | + ), | |
422 | + }} | |
423 | + // disabled={mainInfoDisbled} | |
424 | + /> | |
425 | + </div> | |
426 | + | |
275 | 427 | <ProFormSelect |
276 | 428 | placeholder="请输入支付渠道" |
277 | 429 | name="paymentChannel" |
... | ... | @@ -382,14 +534,11 @@ export default ({ onClose, data, subOrders, orderOptType }) => { |
382 | 534 | resolve(false); |
383 | 535 | return; |
384 | 536 | } |
385 | - setTimeout(() => { | |
386 | - resolve(true); | |
387 | - }, 1000); | |
537 | + resolve(true); | |
388 | 538 | }); |
389 | 539 | }, |
390 | 540 | }} |
391 | 541 | itemRender={(doms, listMeta) => { |
392 | - // const list = actionRef.current?.getList(); | |
393 | 542 | if (optType('edit')) { |
394 | 543 | let i = 0; |
395 | 544 | let defaultFileList = listMeta.record?.listAnnex?.map((annex) => { |
... | ... | @@ -495,9 +644,96 @@ export default ({ onClose, data, subOrders, orderOptType }) => { |
495 | 644 | return options; |
496 | 645 | }} |
497 | 646 | />, |
498 | - doms.listDom, | |
647 | + <ProFormText | |
648 | + key="productCode" | |
649 | + width="lg" | |
650 | + name="productCode" | |
651 | + disabled | |
652 | + label={ | |
653 | + <> | |
654 | + <span>商品编码</span> | |
655 | + <span className="text-gray-400 text-xs pl-2"> | |
656 | + 新增商品时,商品编码由系统自动生成 | |
657 | + </span> | |
658 | + </> | |
659 | + } | |
660 | + placeholder="未输入商品名称" | |
661 | + />, | |
662 | + <ProFormText | |
663 | + key="parameters" | |
664 | + width="lg" | |
665 | + name="parameters" | |
666 | + label="商品参数" | |
667 | + placeholder="请输入商品参数" | |
668 | + rules={[{ required: true, message: '商品参数必填' }]} | |
669 | + />, | |
670 | + <ProFormDigit | |
671 | + key="quantity" | |
672 | + width="lg" | |
673 | + name="quantity" | |
674 | + label="商品数量" | |
675 | + fieldProps={{ | |
676 | + onChange: (value) => { | |
677 | + listMeta.record.quantity = value; | |
678 | + computeSubOrderPayment(listMeta); | |
679 | + }, | |
680 | + }} | |
681 | + placeholder="请输入商品数量" | |
682 | + rules={[{ required: true, message: '商品数量必填' }]} | |
683 | + />, | |
684 | + <ProFormDigit | |
685 | + key="productPrice" | |
686 | + width="lg" | |
687 | + name="productPrice" | |
688 | + label="商品单价" | |
689 | + fieldProps={{ | |
690 | + onChange: (value) => { | |
691 | + listMeta.record.productPrice = value; | |
692 | + computeSubOrderPayment(listMeta); | |
693 | + }, | |
694 | + }} | |
695 | + placeholder="请输入商品单价" | |
696 | + rules={[{ required: true, message: '商品单价必填' }]} | |
697 | + />, | |
698 | + <ProFormText | |
699 | + key="unit" | |
700 | + width="lg" | |
701 | + name="unit" | |
702 | + label="商品单位" | |
703 | + placeholder="请输入商品单位" | |
704 | + rules={[{ required: true, message: '商品单位必填' }]} | |
705 | + />, | |
706 | + | |
707 | + <ProFormDigit | |
708 | + width="lg" | |
709 | + key="subOrderPayment" | |
710 | + name="subOrderPayment" | |
711 | + label="子订单金额" | |
712 | + placeholder="请输入子订单金额" | |
713 | + tooltip="商品数量和单价变化后会自动计算子订单金额" | |
714 | + rules={[{ required: true, message: '子订单金额必填' }]} | |
715 | + />, | |
716 | + <ProFormSelect | |
717 | + key="productBelongBusiness" | |
718 | + placeholder="请输入所属事业部" | |
719 | + name="productBelongBusiness" | |
720 | + width="lg" | |
721 | + label="所属事业部" | |
722 | + options={enumToSelect(PRODUCT_BELONG_DEPARTMENT_OPTIONS)} | |
723 | + initialValue={'EXPERIMENTAL_CONSUMABLES'} | |
724 | + rules={[{ required: true, message: '所属事业部必填' }]} | |
725 | + // disabled={mainInfoDisbled} | |
726 | + />, | |
727 | + <ProFormText | |
728 | + key="notes" | |
729 | + width="lg" | |
730 | + name="notes" | |
731 | + label="备注" | |
732 | + placeholder="请输入备注" | |
733 | + />, | |
499 | 734 | <> |
500 | 735 | <ProFormUploadDragger |
736 | + key="filePaths" | |
501 | 737 | label="附件" |
502 | 738 | name="filePaths" |
503 | 739 | action="/api/service/order/fileProcess" |
... | ... | @@ -512,74 +748,7 @@ export default ({ onClose, data, subOrders, orderOptType }) => { |
512 | 748 | ); |
513 | 749 | }} |
514 | 750 | actionRef={actionRef} |
515 | - > | |
516 | - <ProFormText | |
517 | - width="lg" | |
518 | - name="productCode" | |
519 | - disabled | |
520 | - label={ | |
521 | - <> | |
522 | - <span>商品编码</span> | |
523 | - <span className="text-gray-400 text-xs pl-2"> | |
524 | - 新增商品时,商品编码由系统自动生成 | |
525 | - </span> | |
526 | - </> | |
527 | - } | |
528 | - placeholder="未输入商品名称" | |
529 | - /> | |
530 | - <ProFormText | |
531 | - width="lg" | |
532 | - name="parameters" | |
533 | - label="商品参数" | |
534 | - placeholder="请输入商品参数" | |
535 | - rules={[{ required: true, message: '商品参数必填' }]} | |
536 | - /> | |
537 | - <ProFormDigit | |
538 | - width="lg" | |
539 | - name="quantity" | |
540 | - label="商品数量" | |
541 | - placeholder="请输入商品数量" | |
542 | - rules={[{ required: true, message: '商品数量必填' }]} | |
543 | - /> | |
544 | - <ProFormDigit | |
545 | - width="lg" | |
546 | - name="productPrice" | |
547 | - label="商品单价" | |
548 | - placeholder="请输入商品单价" | |
549 | - rules={[{ required: true, message: '商品单价必填' }]} | |
550 | - /> | |
551 | - <ProFormText | |
552 | - width="lg" | |
553 | - name="unit" | |
554 | - label="商品单位" | |
555 | - placeholder="请输入商品单位" | |
556 | - rules={[{ required: true, message: '商品单位必填' }]} | |
557 | - /> | |
558 | - | |
559 | - <ProFormDigit | |
560 | - width="lg" | |
561 | - name="subOrderPayment" | |
562 | - label="子订单金额" | |
563 | - placeholder="请输入子订单金额" | |
564 | - rules={[{ required: true, message: '子订单金额必填' }]} | |
565 | - /> | |
566 | - <ProFormSelect | |
567 | - placeholder="请输入所属事业部" | |
568 | - name="productBelongBusiness" | |
569 | - width="lg" | |
570 | - label="所属事业部" | |
571 | - options={enumToSelect(PRODUCT_BELONG_DEPARTMENT_OPTIONS)} | |
572 | - initialValue={'EXPERIMENTAL_CONSUMABLES'} | |
573 | - rules={[{ required: true, message: '所属事业部必填' }]} | |
574 | - // disabled={mainInfoDisbled} | |
575 | - /> | |
576 | - <ProFormText | |
577 | - width="lg" | |
578 | - name="notes" | |
579 | - label="备注" | |
580 | - placeholder="请输入备注" | |
581 | - /> | |
582 | - </ProFormList> | |
751 | + ></ProFormList> | |
583 | 752 | </DrawerForm> |
584 | 753 | ); |
585 | 754 | }; | ... | ... |
src/pages/Order/index.less
... | ... | @@ -9,3 +9,74 @@ td { |
9 | 9 | 'WenQuanYi Micro Hei', sans-serif; |
10 | 10 | font-size: 13px; |
11 | 11 | } |
12 | + | |
13 | +//订单编辑抽屉中,订单总额addonAfter的padding去除 | |
14 | +#total-payment .ant-input-number-group-addon { | |
15 | + padding: 0 !important; | |
16 | +} | |
17 | + | |
18 | +table:hover, | |
19 | +tr:hover, | |
20 | +thead:hover { | |
21 | + background: none !important; | |
22 | +} | |
23 | + | |
24 | +#main-table .ant-table-tbody > tr.ant-table-row:hover > td { | |
25 | + background: none !important; | |
26 | +} | |
27 | + | |
28 | +.ant-pro-card { | |
29 | + background-color: transparent; | |
30 | +} | |
31 | + | |
32 | +#main-table .ant-table-tbody .ant-table-cell { | |
33 | + padding: 10px 0 0; | |
34 | +} | |
35 | + | |
36 | +#main-table .ant-table-tbody { | |
37 | + background-color: #f5f5f5; | |
38 | +} | |
39 | + | |
40 | +.ant-pro-card-body { | |
41 | + padding: 0 !important; | |
42 | +} | |
43 | + | |
44 | +.ant-table-thead .ant-table-cell { | |
45 | + background-color: #fff !important; | |
46 | + border-radius: 8px !important; | |
47 | +} | |
48 | + | |
49 | +#sub-table tbody td { | |
50 | + padding: 10px 0 !important; | |
51 | +} | |
52 | + | |
53 | +// 子订单第一行的上边两个角为圆角 | |
54 | +#sub-table tbody tr:first-child td:first-child { | |
55 | + border-top-left-radius: 8px; | |
56 | +} | |
57 | + | |
58 | +#sub-table tbody tr:first-child td:nth-child(2) { | |
59 | + border-top-right-radius: 8px; | |
60 | +} | |
61 | + | |
62 | +//子订单最后一行的下边两个角为圆角 | |
63 | +#sub-table tbody tr:last-child td:first-child { | |
64 | + border-bottom-left-radius: 8px; | |
65 | +} | |
66 | + | |
67 | +#sub-table tbody tr:last-child td:nth-child(2) { | |
68 | + border-bottom-right-radius: 8px; | |
69 | +} | |
70 | + | |
71 | +//子订单边线颜色 | |
72 | +#sub-table tbody tr td:first-child { | |
73 | + border-top: 1px solid #d7d6d6; /* 设置行与行之间分割线的颜色 */ | |
74 | + border-bottom: 1px solid #d7d6d6; /* 设置行与行之间分割线的颜色 */ | |
75 | + border-left: 1px solid #d7d6d6; /* 设置行与行之间分割线的颜色 */ | |
76 | +} | |
77 | + | |
78 | +#sub-table tbody tr td:nth-child(2) { | |
79 | + border-top: 1px solid #d7d6d6; /* 设置行与行之间分割线的颜色 */ | |
80 | + border-bottom: 1px solid #d7d6d6; /* 设置行与行之间分割线的颜色 */ | |
81 | + border-right: 1px solid #d7d6d6; /* 设置行与行之间分割线的颜色 */ | |
82 | +} | ... | ... |
src/pages/Order/index.tsx
... | ... | @@ -7,9 +7,10 @@ import { |
7 | 7 | import { orderExport } from '@/services/order'; |
8 | 8 | import { enumValueToLabel, formatDateTime } from '@/utils'; |
9 | 9 | import { |
10 | + ClockCircleOutlined, | |
11 | + CopyOutlined, | |
10 | 12 | DownOutlined, |
11 | 13 | EllipsisOutlined, |
12 | - QuestionCircleOutlined, | |
13 | 14 | } from '@ant-design/icons'; |
14 | 15 | import { |
15 | 16 | PageContainer, |
... | ... | @@ -21,38 +22,33 @@ import { |
21 | 22 | Avatar, |
22 | 23 | Button, |
23 | 24 | Checkbox, |
24 | - Divider, | |
25 | 25 | Dropdown, |
26 | 26 | Flex, |
27 | 27 | MenuProps, |
28 | - Modal, | |
29 | 28 | Space, |
30 | 29 | Tag, |
31 | - Tooltip, | |
32 | 30 | message, |
33 | 31 | } from 'antd'; |
34 | 32 | import { cloneDeep } from 'lodash'; |
35 | -import { Key, useEffect, useRef, useState } from 'react'; | |
33 | +import { Key, useRef, useState } from 'react'; | |
36 | 34 | import OrderPrintModal from '../OrderPrint/OrderPrintModal'; |
37 | 35 | import AttachmentModal from './components/AttachmentModal'; |
38 | 36 | import CheckModal from './components/CheckModal'; |
39 | 37 | import ConfirmReceiptModal from './components/ConfirmReceiptModal'; |
40 | 38 | import DeliverModal from './components/DeliverModal'; |
41 | 39 | import FinancialDrawer from './components/FinancialDrawer'; |
40 | +import HistoryModal from './components/HistoryModal'; | |
42 | 41 | import ImportModal from './components/ImportModal'; |
43 | 42 | import OrderDrawer from './components/OrderDrawer'; |
44 | 43 | import OrderNotesEditModal from './components/OrderNotesEditModal'; |
45 | 44 | import SubOrderComfirmReceiptImagesModal from './components/SubOrderComfirmReceiptImagesModal'; |
46 | 45 | import { |
47 | 46 | INVOCING_STATUS_OPTIONS, |
48 | - LOGISTICS_STATUS_OPTIONS, | |
49 | 47 | MAIN_ORDER_COLUMNS, |
50 | 48 | ORDER_STATUS_OPTIONS, |
51 | 49 | PAYMENT_CHANNEL_OPTIONS, |
52 | 50 | PAYMENT_METHOD_OPTIONS, |
53 | 51 | PRODUCT_BELONG_DEPARTMENT_OPTIONS, |
54 | - SUB_ORDER_COLUMNS, | |
55 | - TAGS_COLOR, | |
56 | 52 | } from './constant'; |
57 | 53 | import './index.less'; |
58 | 54 | import { OrderListItemType, OrderType } from './type.d'; |
... | ... | @@ -69,6 +65,8 @@ const OrderPage = () => { |
69 | 65 | const [attachmentModalVisible, setAttachmentModalVisible] = |
70 | 66 | useState<boolean>(false); |
71 | 67 | const [financialVisible, setFinancialVisible] = useState<boolean>(false); |
68 | + const [historyModalVisible, setHistoryModalVisible] = | |
69 | + useState<boolean>(false); | |
72 | 70 | const [isRePrintOrder, setIsRePrintOrder] = useState<boolean>(false); |
73 | 71 | const [isSendProduct, setIsSendProduct] = useState<boolean>(false); |
74 | 72 | const [isMainOrder, setIsMainOrder] = useState<boolean>(false); |
... | ... | @@ -83,7 +81,7 @@ const OrderPage = () => { |
83 | 81 | const [mainOrderAllItemKeys, setMainOrderAllItemKeys] = useState([]); |
84 | 82 | const [rolePath, setRolePath] = useState([]); //当前角色权限(新增跟打印按钮) |
85 | 83 | const userInfo = JSON.parse(localStorage.getItem('userInfo')); |
86 | - const [tableHeight, setTableHeight] = useState(200); | |
84 | + // const [tableHeight, setTableHeight] = useState(200); | |
87 | 85 | const [selectedRows, setSelectedRows] = useState({}); |
88 | 86 | const [selectedRowObj, setSelectedRowObj] = useState({}); |
89 | 87 | const [selectedItems, setSelectedItems] = useState([]); |
... | ... | @@ -93,17 +91,17 @@ const OrderPage = () => { |
93 | 91 | const mainTableRef = useRef(); |
94 | 92 | const [messageApi, contextHolder] = message.useMessage(); |
95 | 93 | |
96 | - const openCheckNotes = (checkNotes: string) => { | |
97 | - Modal.info({ | |
98 | - title: '驳回备注', | |
99 | - content: ( | |
100 | - <div> | |
101 | - <p>{checkNotes}</p> | |
102 | - </div> | |
103 | - ), | |
104 | - onOk() {}, | |
105 | - }); | |
106 | - }; | |
94 | + // const openCheckNotes = (checkNotes: string) => { | |
95 | + // Modal.info({ | |
96 | + // title: '驳回备注', | |
97 | + // content: ( | |
98 | + // <div> | |
99 | + // <p>{checkNotes}</p> | |
100 | + // </div> | |
101 | + // ), | |
102 | + // onOk() { }, | |
103 | + // }); | |
104 | + // }; | |
107 | 105 | |
108 | 106 | const exportLoading = () => { |
109 | 107 | messageApi.open({ |
... | ... | @@ -125,30 +123,30 @@ const OrderPage = () => { |
125 | 123 | setSelectedRowKeys([]); |
126 | 124 | }; |
127 | 125 | |
128 | - const resize = () => { | |
129 | - // 计算元素底部到视口顶部的距离 | |
130 | - let bottomDistance = document | |
131 | - .getElementById('mainTable') | |
132 | - ?.getElementsByClassName('ant-table-thead')[0] | |
133 | - .getBoundingClientRect().bottom; | |
134 | - // 获取屏幕高度 | |
135 | - let screenHeight = | |
136 | - window.innerHeight || document.documentElement.clientHeight; | |
126 | + // const resize = () => { | |
127 | + // // 计算元素底部到视口顶部的距离 | |
128 | + // let bottomDistance = document | |
129 | + // .getElementById('mainTable') | |
130 | + // ?.getElementsByClassName('ant-table-thead')[0] | |
131 | + // .getBoundingClientRect().bottom; | |
132 | + // // 获取屏幕高度 | |
133 | + // let screenHeight = | |
134 | + // window.innerHeight || document.documentElement.clientHeight; | |
137 | 135 | |
138 | - // 计算元素底部到屏幕底部的距离 | |
139 | - let bottomToScreenBottomDistance = screenHeight - bottomDistance; | |
136 | + // // 计算元素底部到屏幕底部的距离 | |
137 | + // let bottomToScreenBottomDistance = screenHeight - bottomDistance; | |
140 | 138 | |
141 | - // //底部分页元素的高度 | |
142 | - // var pH = screenHeight - document.getElementById("mainTable").getElementsByClassName('ant-table-body')[0].getBoundingClientRect().bottom; | |
139 | + // // //底部分页元素的高度 | |
140 | + // // var pH = screenHeight - document.getElementById("main-table").getElementsByClassName('ant-table-body')[0].getBoundingClientRect().bottom; | |
143 | 141 | |
144 | - setTableHeight(bottomToScreenBottomDistance - 88); | |
145 | - }; | |
142 | + // setTableHeight(bottomToScreenBottomDistance - 88); | |
143 | + // }; | |
146 | 144 | |
147 | - useEffect(() => { | |
148 | - resize(); | |
149 | - // 添加事件监听器,当窗口大小改变时调用resize方法 | |
150 | - window.addEventListener('resize', resize); | |
151 | - }); | |
145 | + // useEffect(() => { | |
146 | + // resize(); | |
147 | + // // 添加事件监听器,当窗口大小改变时调用resize方法 | |
148 | + // window.addEventListener('resize', resize); | |
149 | + // }); | |
152 | 150 | |
153 | 151 | const onCheckboxChange = (itemKey: never) => { |
154 | 152 | const newSelectedItems = selectedItems.includes(itemKey) |
... | ... | @@ -157,453 +155,398 @@ const OrderPage = () => { |
157 | 155 | |
158 | 156 | setSelectedItems(newSelectedItems); |
159 | 157 | }; |
160 | - const handleAllExpand = () => { | |
161 | - if (expandedRowKeys.length === mainOrderAllItemKeys.length) { | |
162 | - setExpandedRowKeys([]); | |
163 | - return; | |
164 | - } | |
165 | - setExpandedRowKeys(mainOrderAllItemKeys); | |
158 | + const handleTableExpand = (mainOrderIds: any) => { | |
159 | + setExpandedRowKeys(mainOrderIds); | |
160 | + }; | |
161 | + | |
162 | + //表头渲染 | |
163 | + const OrderTableHeader = () => { | |
164 | + return ( | |
165 | + <Flex className="w-full"> | |
166 | + <Flex className="w-[24%] ml-[5%]">商品信息</Flex> | |
167 | + <Flex className="w-[15%]">交易金额</Flex> | |
168 | + <Flex className="w-[10%]">支付</Flex> | |
169 | + <Flex className="w-[13%]">其他</Flex> | |
170 | + <Flex className="w-[10%]">交易状态</Flex> | |
171 | + <Flex className="w-[23%]">操作</Flex> | |
172 | + </Flex> | |
173 | + ); | |
174 | + }; | |
175 | + //子订单内容渲染 | |
176 | + const SubOderRander = ({ record, optRecord }) => { | |
177 | + return ( | |
178 | + <Flex className="w-full border-b-indigo-500"> | |
179 | + <Flex vertical className="w-[26%]" gap="small"> | |
180 | + <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> | |
181 | + {optRecord.productName} | |
182 | + </div> | |
183 | + <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> | |
184 | + {optRecord.parameters} | |
185 | + </div> | |
186 | + <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> | |
187 | + {optRecord.notes} | |
188 | + <Button | |
189 | + type="dashed" | |
190 | + size="small" | |
191 | + onClick={() => { | |
192 | + setNotesEditVisible(true); | |
193 | + setOrderRow(optRecord); | |
194 | + setIsMainOrder(false); | |
195 | + }} | |
196 | + > | |
197 | + 详情 | |
198 | + </Button> | |
199 | + </div> | |
200 | + </Flex> | |
201 | + <Flex className="w-[16%]" vertical gap="small"> | |
202 | + <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> | |
203 | + 单价:¥{optRecord.productPrice} | |
204 | + </div> | |
205 | + <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> | |
206 | + 数量:x{optRecord.quantity} | |
207 | + </div> | |
208 | + <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> | |
209 | + 合计:¥{optRecord.subOrderPayment} | |
210 | + </div> | |
211 | + </Flex> | |
212 | + <Flex className="w-[10%]" vertical gap="small"> | |
213 | + <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> | |
214 | + {enumValueToLabel(optRecord.paymentMethod, PAYMENT_METHOD_OPTIONS)} | |
215 | + </div> | |
216 | + <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> | |
217 | + {enumValueToLabel( | |
218 | + optRecord.paymentChannel, | |
219 | + PAYMENT_CHANNEL_OPTIONS, | |
220 | + )} | |
221 | + </div> | |
222 | + </Flex> | |
223 | + <Flex className="w-[15%]" vertical gap="small"> | |
224 | + <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> | |
225 | + {enumValueToLabel( | |
226 | + optRecord.productBelongBusiness, | |
227 | + PRODUCT_BELONG_DEPARTMENT_OPTIONS, | |
228 | + )} | |
229 | + </div> | |
230 | + </Flex> | |
231 | + <Flex className="w-[10%]" vertical gap="small"> | |
232 | + <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> | |
233 | + {enumValueToLabel( | |
234 | + optRecord.invoicingStatus, | |
235 | + INVOCING_STATUS_OPTIONS, | |
236 | + )} | |
237 | + </div> | |
238 | + <div className="whitespace-no-wrap overflow-hidden overflow-ellipsis"> | |
239 | + {enumValueToLabel(optRecord.orderStatus, ORDER_STATUS_OPTIONS)} | |
240 | + </div> | |
241 | + </Flex> | |
242 | + <Flex className="w-[23%]" wrap="wrap" gap="small"> | |
243 | + {optRecord.subPath.includes('sendProduct') ? ( | |
244 | + <Button | |
245 | + className="p-0" | |
246 | + type="link" | |
247 | + onClick={() => { | |
248 | + optRecord.mainOrderId = record.id; | |
249 | + setSelectedRows([cloneDeep(optRecord)]); //克隆一份数据,避免后续修改污染 | |
250 | + setDeliverVisible(true); | |
251 | + setIsSendProduct(true); | |
252 | + }} | |
253 | + > | |
254 | + 发货 | |
255 | + </Button> | |
256 | + ) : ( | |
257 | + '' | |
258 | + )} | |
259 | + | |
260 | + {optRecord.subPath.includes('queryAnnex') ? ( | |
261 | + <Button | |
262 | + className="p-0" | |
263 | + type="link" | |
264 | + onClick={() => { | |
265 | + optRecord.mainOrderId = record.id; | |
266 | + setAttachmentModalVisible(true); | |
267 | + setOrderRow(optRecord); | |
268 | + }} | |
269 | + > | |
270 | + 附件 | |
271 | + </Button> | |
272 | + ) : ( | |
273 | + '' | |
274 | + )} | |
275 | + | |
276 | + {optRecord.subPath.includes('modifySendInformation') ? ( | |
277 | + <Button | |
278 | + className="p-0" | |
279 | + type="link" | |
280 | + onClick={() => { | |
281 | + optRecord.mainOrderId = record.id; | |
282 | + setSelectedRows([cloneDeep(optRecord)]); //克隆一份数据,避免后续修改污染 | |
283 | + setDeliverVisible(true); | |
284 | + setIsSendProduct(false); | |
285 | + }} | |
286 | + > | |
287 | + 修改发货信息 | |
288 | + </Button> | |
289 | + ) : ( | |
290 | + '' | |
291 | + )} | |
292 | + | |
293 | + {optRecord.subPath.includes('printOrder') ? ( | |
294 | + <Button | |
295 | + className="p-0" | |
296 | + type="link" | |
297 | + onClick={async () => { | |
298 | + setOrderPrintVisible(true); | |
299 | + setSelectedRows([optRecord]); | |
300 | + setOrderRow(record); | |
301 | + }} | |
302 | + > | |
303 | + 打印 | |
304 | + </Button> | |
305 | + ) : ( | |
306 | + '' | |
307 | + )} | |
308 | + {optRecord.subPath.includes('editOrder') ? ( | |
309 | + <Button | |
310 | + className="p-0" | |
311 | + type="link" | |
312 | + onClick={() => { | |
313 | + setFinancialVisible(true); | |
314 | + setOrderRow(record); | |
315 | + setSelectedRows([optRecord]); | |
316 | + setIsFinalcialEdit(true); | |
317 | + }} | |
318 | + > | |
319 | + 编辑 | |
320 | + </Button> | |
321 | + ) : ( | |
322 | + '' | |
323 | + )} | |
324 | + {optRecord.subPath.includes('invoicing') ? ( | |
325 | + <Button | |
326 | + className="p-0" | |
327 | + type="link" | |
328 | + onClick={() => { | |
329 | + setFinancialVisible(true); | |
330 | + setIsFinalcialEdit(false); | |
331 | + setOrderRow(record); | |
332 | + setSelectedRows([optRecord]); | |
333 | + }} | |
334 | + > | |
335 | + 开票 | |
336 | + </Button> | |
337 | + ) : ( | |
338 | + '' | |
339 | + )} | |
340 | + {optRecord.subPath.includes('checkOrder') ? ( | |
341 | + <Button | |
342 | + className="p-0" | |
343 | + type="link" | |
344 | + onClick={() => { | |
345 | + setOrderRow(optRecord); | |
346 | + setCheckVisible(true); | |
347 | + setSelectedRows([optRecord]); | |
348 | + }} | |
349 | + > | |
350 | + 审核 | |
351 | + </Button> | |
352 | + ) : ( | |
353 | + '' | |
354 | + )} | |
355 | + | |
356 | + {optRecord.subPath.includes('rePrintOrder') ? ( | |
357 | + <Button | |
358 | + className="p-0" | |
359 | + type="link" | |
360 | + onClick={() => { | |
361 | + setOrderPrintVisible(true); | |
362 | + setSelectedRows([optRecord]); | |
363 | + setOrderRow(record); | |
364 | + setIsRePrintOrder(true); | |
365 | + }} | |
366 | + > | |
367 | + 重新打印 | |
368 | + </Button> | |
369 | + ) : ( | |
370 | + '' | |
371 | + )} | |
372 | + | |
373 | + {optRecord.subPath.includes('confirmReceipt') ? ( | |
374 | + <Button | |
375 | + className="p-0" | |
376 | + type="link" | |
377 | + onClick={() => { | |
378 | + setConfirmReceiptVisible(true); | |
379 | + setOrderRow(optRecord); | |
380 | + }} | |
381 | + > | |
382 | + 确认收货 | |
383 | + </Button> | |
384 | + ) : ( | |
385 | + '' | |
386 | + )} | |
387 | + {optRecord.subPath.includes('viewImages') ? ( | |
388 | + <Button | |
389 | + className="p-0" | |
390 | + type="link" | |
391 | + onClick={() => { | |
392 | + setSubOrderConfirmReceiptImagesVisible(true); | |
393 | + setOrderRow(optRecord); | |
394 | + }} | |
395 | + > | |
396 | + 查看收货凭证 | |
397 | + </Button> | |
398 | + ) : ( | |
399 | + '' | |
400 | + )} | |
401 | + </Flex> | |
402 | + </Flex> | |
403 | + ); | |
166 | 404 | }; |
405 | + const expandedRowRender = (record) => { | |
406 | + let subOrders = record.subOrderInformationLists; | |
407 | + | |
408 | + return ( | |
409 | + <ProTable | |
410 | + id="sub-table" | |
411 | + className=" w-full" | |
412 | + showHeader={false} | |
413 | + columns={[ | |
414 | + { | |
415 | + title: 'ID', | |
416 | + dataIndex: 'id', | |
417 | + key: 'id', | |
418 | + render: (text: any, optRecord: any) => { | |
419 | + return <SubOderRander record={record} optRecord={optRecord} />; | |
420 | + }, | |
421 | + }, | |
422 | + ]} | |
423 | + rowSelection={{ | |
424 | + onChange: (selectedRowKeys: any, selectedRows: any) => { | |
425 | + setSelectedRowKeys(selectedRowKeys); | |
426 | + setSelectedRowObj({ | |
427 | + ...setSelectedRowObj, | |
428 | + [record.id]: selectedRows, | |
429 | + }); | |
430 | + selectedRowObj[record.id] = selectedRows; | |
431 | + setSelectedRows(selectedRows); | |
432 | + }, | |
433 | + selectedRowKeys: selectedRowKeys, | |
434 | + // 自定义选择项参考: https://ant.design/components/table-cn/#components-table-demo-row-selection-custom | |
435 | + // 注释该行则默认不显示下拉选项 | |
436 | + // selections: [Table.SELECTION_ALL, Table.SELECTION_INVERT], | |
437 | + // defaultSelectedRowKeys: [], | |
438 | + }} | |
439 | + rowKey="id" | |
440 | + headerTitle={false} | |
441 | + search={false} | |
442 | + options={false} | |
443 | + dataSource={subOrders} | |
444 | + pagination={false} | |
445 | + /> | |
446 | + ); | |
447 | + }; | |
448 | + | |
167 | 449 | // 主订单内容渲染 |
168 | 450 | const MainOrderColumnRender = ({ record }: { record: OrderListItemType }) => { |
169 | - const handleExpand = (key: number) => { | |
170 | - const newExpandedRowKeys = expandedRowKeys.includes(key) | |
171 | - ? expandedRowKeys.filter((k) => k !== key) | |
172 | - : [...expandedRowKeys, key]; | |
451 | + // const handleExpand = (key: number) => { | |
452 | + // const newExpandedRowKeys = expandedRowKeys.includes(key) | |
453 | + // ? expandedRowKeys.filter((k) => k !== key) | |
454 | + // : [...expandedRowKeys, key]; | |
173 | 455 | |
174 | - setExpandedRowKeys(newExpandedRowKeys); | |
175 | - }; | |
456 | + // setExpandedRowKeys(newExpandedRowKeys); | |
457 | + // }; | |
176 | 458 | return ( |
177 | 459 | <Flex vertical={true}> |
178 | 460 | {/* 编号、时间、销售信息 */} |
179 | - <Flex justify="space-between" className="px-2 py-4 bg-gray-100"> | |
180 | - <Checkbox | |
181 | - onChange={() => onCheckboxChange(record.id)} | |
182 | - checked={selectedItems.includes(record.id)} | |
183 | - > | |
184 | - <Flex wrap="wrap" gap="middle"> | |
185 | - <div>{formatDateTime(record.createTime)}</div> | |
186 | - <div>订单编号:{record.id}</div> | |
461 | + <Flex | |
462 | + className="px-4 py-4 bg-white bg-white rounded-t-lg" | |
463 | + justify="space-between" | |
464 | + > | |
465 | + <Flex wrap="wrap" gap="middle" vertical> | |
466 | + <Flex> | |
467 | + <Flex> | |
468 | + <Checkbox | |
469 | + onChange={() => onCheckboxChange(record.id)} | |
470 | + checked={selectedItems.includes(record.id)} | |
471 | + > | |
472 | + <div> | |
473 | + 订单号:{record.id} | |
474 | + {' ' + formatDateTime(record.createTime)} | |
475 | + </div> | |
476 | + </Checkbox> | |
477 | + <div>代表:{record.salesCode}</div> | |
478 | + <span>单位:{record.institution}</span> | |
479 | + <span>联系人:{record.institutionContactName}</span> | |
480 | + </Flex> | |
187 | 481 | </Flex> |
188 | - </Checkbox> | |
189 | - <Space> | |
190 | - <div>销售代表:{record.salesCode}</div> | |
191 | - | |
192 | - {rolePath?.includes('addOrder') ? ( | |
482 | + <Flex className="pl-6" align="center"> | |
483 | + <div> | |
484 | + 备注: | |
485 | + <span className="ml-2">{record.notes}</span> | |
486 | + </div> | |
193 | 487 | <Button |
194 | - size="small" | |
488 | + className="p-0" | |
489 | + type="link" | |
195 | 490 | onClick={() => { |
196 | - setOrderOptType('copy'); | |
197 | - setOrderDrawerVisible(true); | |
198 | - let copy = cloneDeep(record); | |
199 | - copy.id = undefined; | |
200 | - copy.subOrderInformationLists?.forEach((item) => { | |
201 | - item.id = undefined; | |
202 | - }); | |
203 | - setOrderRow(copy); | |
491 | + setNotesEditVisible(true); | |
492 | + setOrderRow(record); | |
493 | + setIsMainOrder(true); | |
204 | 494 | }} |
205 | 495 | > |
206 | - 复制 | |
496 | + 备注 | |
207 | 497 | </Button> |
208 | - ) : ( | |
209 | - '' | |
210 | - )} | |
211 | - </Space> | |
212 | - </Flex> | |
213 | - {/* 收货、开票、备注信息 */} | |
214 | - <Flex justify="space-between" className="px-2 py-4"> | |
215 | - <Space split={<Divider type="vertical" align="center" />}> | |
216 | - <Space.Compact direction="vertical" className="gap-2"> | |
217 | - <div> | |
218 | - 收货信息: | |
219 | - <Space | |
220 | - split={<span className="text-blue-300">|</span>} | |
221 | - className="ml-2" | |
222 | - > | |
223 | - <span>收货人:{record.customerName}</span> | |
224 | - <span> | |
225 | - 联系方式: | |
226 | - {record.customerContactNumber} | |
227 | - </span> | |
228 | - <span> | |
229 | - 单位联系人: | |
230 | - {record.institutionContactName} | |
231 | - </span> | |
232 | - <span>单位名称:{record.institution}</span> | |
233 | - {/* className='whitespace-pre-wrap max-w-sm' */} | |
234 | - <span> 收货地址:{record.customerShippingAddress}</span> | |
235 | - </Space> | |
236 | - </div> | |
237 | - <div> | |
238 | - 开票信息: | |
239 | - <Space | |
240 | - split={<span className="text-blue-300">|</span>} | |
241 | - className="ml-2" | |
242 | - > | |
243 | - <span>开户银行:{record.bank}</span> | |
244 | - <span> | |
245 | - 银行账号: | |
246 | - {record.bankAccountNumber} | |
247 | - </span> | |
248 | - <span> | |
249 | - 识别号: | |
250 | - {record.invoiceIdentificationNumber} | |
251 | - </span> | |
252 | - </Space> | |
253 | - </div> | |
254 | - <div> | |
255 | - 备 注: | |
256 | - <span className="ml-2">{record.notes}</span> | |
257 | - </div> | |
258 | - </Space.Compact> | |
259 | - </Space> | |
260 | - {/* 总金额、操作按钮信息 */} | |
261 | - <Space> | |
262 | - <Space.Compact direction="vertical" align="end"> | |
263 | - <div> | |
264 | - 总金额:<span className="text-lg">{record.totalPayment}¥</span> | |
265 | - </div> | |
266 | - <Space> | |
267 | - {record.mainPath.includes('sendProduct') ? ( | |
268 | - <Button | |
269 | - className="p-0" | |
270 | - type="link" | |
271 | - onClick={() => { | |
272 | - if (!selectedRowObj[record.id]?.length) { | |
273 | - return message.error('请选择选择子订单'); | |
274 | - } | |
275 | - setSelectedRows(selectedRowObj[record.id]); | |
276 | - setDeliverVisible(true); | |
277 | - setIsSendProduct(true); | |
278 | - }} | |
279 | - > | |
280 | - 发货 | |
281 | - </Button> | |
282 | - ) : ( | |
283 | - '' | |
284 | - )} | |
285 | - {record.mainPath.includes('printOrder') ? ( | |
286 | - <Button | |
287 | - className="p-0" | |
288 | - type="link" | |
289 | - onClick={() => { | |
290 | - if (!selectedRowObj[record.id]?.length) { | |
291 | - return message.error('请选择选择子订单'); | |
292 | - } | |
293 | - setSelectedRows(selectedRowObj[record.id]); | |
294 | - setOrderRow(record); | |
295 | - setOrderPrintVisible(true); | |
296 | - }} | |
297 | - > | |
298 | - 打印 | |
299 | - </Button> | |
300 | - ) : ( | |
301 | - '' | |
302 | - )} | |
303 | - {record.mainPath.includes('rePrintOrder') ? ( | |
304 | - <Button | |
305 | - className="p-0" | |
306 | - type="link" | |
307 | - onClick={() => { | |
308 | - if (!selectedRowObj[record.id]?.length) { | |
309 | - return message.error('请选择选择子订单'); | |
310 | - } | |
311 | - setSelectedRows(selectedRowObj[record.id]); | |
312 | - setOrderRow(record); | |
313 | - setOrderPrintVisible(true); | |
314 | - setIsRePrintOrder(true); | |
315 | - }} | |
316 | - > | |
317 | - 重新打印 | |
318 | - </Button> | |
319 | - ) : ( | |
320 | - '' | |
321 | - )} | |
322 | - {record.mainPath.includes('modifySendInformation') ? ( | |
323 | - <Button | |
324 | - className="p-0" | |
325 | - type="link" | |
326 | - onClick={() => { | |
327 | - if (!selectedRowObj[record.id]?.length) { | |
328 | - return message.error( | |
329 | - '请选择已经发货或者已经确认收货的子订单', | |
330 | - ); | |
331 | - } | |
332 | - for (let row of selectedRowObj[record.id]) { | |
333 | - if ( | |
334 | - row.orderStatus !== 'CONFIRM_RECEIPT' && | |
335 | - row.orderStatus !== 'SHIPPED' | |
336 | - ) { | |
337 | - return message.error( | |
338 | - '请选择已经发货或者已经确认收货的子订单', | |
339 | - ); | |
340 | - } | |
341 | - } | |
342 | - setSelectedRows(selectedRowObj[record.id]); | |
343 | - setDeliverVisible(true); | |
344 | - setIsSendProduct(false); | |
345 | - }} | |
346 | - > | |
347 | - 修改发货信息 | |
348 | - </Button> | |
349 | - ) : ( | |
350 | - '' | |
351 | - )} | |
352 | - {record.mainPath.includes('invoicing') ? ( | |
353 | - <Button | |
354 | - type="link" | |
355 | - className="p-0" | |
356 | - onClick={() => { | |
357 | - let selectedSubOrders = selectedRowObj[record.id]; | |
358 | - setSelectedRows(selectedSubOrders); | |
359 | - if (selectedSubOrders === undefined) { | |
360 | - setSelectedRows(record.subOrderInformationLists); | |
361 | - } | |
362 | - setOrderRow(record); | |
363 | - setFinancialVisible(true); | |
364 | - }} | |
365 | - > | |
366 | - 开票 | |
367 | - </Button> | |
368 | - ) : ( | |
369 | - '' | |
370 | - )} | |
371 | - {record.mainPath.includes('updateOrder') ? ( | |
372 | - <Button | |
373 | - className="p-0" | |
374 | - type="link" | |
498 | + </Flex> | |
499 | + </Flex> | |
500 | + <Flex wrap="wrap" gap="middle" vertical> | |
501 | + <Flex justify="flex-end"> | |
502 | + <Flex wrap="wrap" gap="middle" align="center"> | |
503 | + <div> | |
504 | + 总金额: | |
505 | + <span className="text-lg">{record.totalPayment}¥</span> | |
506 | + </div> | |
507 | + {rolePath?.includes('addOrder') ? ( | |
508 | + <CopyOutlined | |
509 | + className="hover:cursor-pointer" | |
375 | 510 | onClick={() => { |
376 | - //勾选的子订单:如果有勾选,后面只校验有勾选的 | |
377 | - let selectedSubOrders = selectedRowObj[record.id]; | |
378 | - if ( | |
379 | - selectedSubOrders === undefined || | |
380 | - selectedSubOrders.length === 0 | |
381 | - ) { | |
382 | - selectedSubOrders = record.subOrderInformationLists; | |
383 | - } | |
384 | - for ( | |
385 | - let index = 0; | |
386 | - index < selectedSubOrders.length; | |
387 | - index++ | |
388 | - ) { | |
389 | - let orderStatus = selectedSubOrders[index].orderStatus; | |
390 | - //是审核通过及之后的订单 | |
391 | - if ( | |
392 | - orderStatus !== 'UNAUDITED' && | |
393 | - orderStatus !== 'AUDIT_FAILED' | |
394 | - ) { | |
395 | - message.error( | |
396 | - '请选择未审核或者审核失败的订单进行编辑', | |
397 | - ); | |
398 | - return; | |
399 | - } | |
400 | - } | |
511 | + setOrderOptType('copy'); | |
401 | 512 | setOrderDrawerVisible(true); |
402 | - setOrderRow(record); | |
403 | - setSelectedRows(selectedSubOrders); | |
404 | - setOrderOptType('edit'); | |
405 | - }} | |
406 | - > | |
407 | - 编辑 | |
408 | - </Button> | |
409 | - ) : ( | |
410 | - '' | |
411 | - )} | |
412 | - | |
413 | - {record.mainPath.includes('checkOrder') ? ( | |
414 | - <Button | |
415 | - className="p-0" | |
416 | - type="link" | |
417 | - onClick={() => { | |
418 | - let selectedSubOrders = selectedRowObj[record.id]; | |
419 | - setSelectedRows(selectedSubOrders); | |
420 | - if (selectedSubOrders === undefined) { | |
421 | - setSelectedRows(record.subOrderInformationLists); | |
422 | - console.log( | |
423 | - 'subOrderInformationLists:' + | |
424 | - record.subOrderInformationLists, | |
425 | - ); | |
426 | - } | |
427 | - for (let i = 0; i < selectedRows.length; i++) { | |
428 | - if ( | |
429 | - selectedRows[i].orderStatus !== 'UNAUDITED' && | |
430 | - selectedRows[i].orderStatus !== 'AUDIT_FAILED' | |
431 | - ) { | |
432 | - message.error( | |
433 | - '请选择未审核或者审核失败的子订单进行审核', | |
434 | - ); | |
435 | - return; | |
436 | - } | |
437 | - } | |
438 | - setOrderRow(record); | |
439 | - setCheckVisible(true); | |
440 | - }} | |
441 | - > | |
442 | - 审核 | |
443 | - </Button> | |
444 | - ) : ( | |
445 | - '' | |
446 | - )} | |
447 | - | |
448 | - {record.mainPath.includes('OrderCancel') ? ( | |
449 | - <ButtonConfirm | |
450 | - className="p-0" | |
451 | - title="确认作废?" | |
452 | - text="作废" | |
453 | - onConfirm={async () => { | |
454 | - let body = { id: record.id }; | |
455 | - const data = await postServiceOrderOrderCancel({ | |
456 | - data: body, | |
513 | + let copy = cloneDeep(record); | |
514 | + copy.id = undefined; | |
515 | + copy.subOrderInformationLists?.forEach((item) => { | |
516 | + item.id = undefined; | |
457 | 517 | }); |
458 | - if (data.result === RESPONSE_CODE.SUCCESS) { | |
459 | - message.success(data.message); | |
460 | - refreshTable(); | |
461 | - } | |
518 | + setOrderRow(copy); | |
462 | 519 | }} |
463 | 520 | /> |
464 | 521 | ) : ( |
465 | 522 | '' |
466 | 523 | )} |
467 | 524 | |
468 | - <Button | |
469 | - className="p-0" | |
470 | - type="link" | |
525 | + <ClockCircleOutlined | |
526 | + className="hover:cursor-pointer" | |
471 | 527 | onClick={() => { |
472 | - setNotesEditVisible(true); | |
473 | - setOrderRow(record); | |
474 | - setIsMainOrder(true); | |
528 | + setHistoryModalVisible(true); | |
529 | + if (selectedRowObj[record.id]?.length) { | |
530 | + setSelectedRows(selectedRowObj[record.id]); | |
531 | + } else { | |
532 | + setSelectedRows(record.subOrderInformationLists); | |
533 | + } | |
475 | 534 | }} |
476 | - > | |
477 | - 备注 | |
478 | - </Button> | |
479 | - </Space> | |
480 | - </Space.Compact> | |
481 | - <Space.Compact direction="vertical"> | |
482 | - <Button | |
483 | - type="primary" | |
484 | - // todo change main_order_id | |
485 | - onClick={() => handleExpand(record.id)} | |
486 | - size="small" | |
487 | - > | |
488 | - {expandedRowKeys.includes(record.id) ? '收起详情' : '订单详情'} | |
489 | - </Button> | |
490 | - </Space.Compact> | |
491 | - </Space> | |
492 | - </Flex> | |
493 | - </Flex> | |
494 | - ); | |
495 | - }; | |
496 | - | |
497 | - // 主订单列表 | |
498 | - const mainOrdersColumns: ProColumns<OrderType>[] = MAIN_ORDER_COLUMNS.map( | |
499 | - (item) => { | |
500 | - if (item.dataIndex === 'name') { | |
501 | - return { | |
502 | - ...item, | |
503 | - render: (text, record) => { | |
504 | - return <MainOrderColumnRender record={record} />; | |
505 | - }, | |
506 | - }; | |
507 | - } | |
508 | - return item; | |
509 | - }, | |
510 | - ); | |
511 | - | |
512 | - const expandedRowRender = (record) => { | |
513 | - let subOrders = record.subOrderInformationLists; | |
514 | - | |
515 | - return ( | |
516 | - <ProTable | |
517 | - columns={(SUB_ORDER_COLUMNS as any) | |
518 | - .map((item) => { | |
519 | - if (item.component === 'tag') { | |
520 | - return { | |
521 | - ...item, | |
522 | - render: (text: string, optRecord) => { | |
523 | - let newText = text; | |
524 | - let label = enumValueToLabel(text, ORDER_STATUS_OPTIONS); | |
525 | - if (label === undefined) { | |
526 | - label = enumValueToLabel(text, INVOCING_STATUS_OPTIONS); | |
527 | - } | |
528 | - if ( | |
529 | - label === '需要开票' && | |
530 | - optRecord.invoicingTime !== undefined | |
531 | - ) { | |
532 | - label = '已开票'; | |
533 | - newText = 'AFTER_INVOICED'; | |
534 | - } | |
535 | - //审核失败点击标签可以弹出驳回备注信息 | |
536 | - if (text === 'AUDIT_FAILED') { | |
537 | - return ( | |
538 | - <Tooltip placement="top" title="点击查看备注"> | |
539 | - <Tag | |
540 | - color={TAGS_COLOR.get(newText)} | |
541 | - className="mr-1 cursor-pointer" | |
542 | - onClick={() => { | |
543 | - openCheckNotes(optRecord.checkNotes); | |
544 | - }} | |
545 | - > | |
546 | - {label} | |
547 | - </Tag> | |
548 | - <QuestionCircleOutlined /> | |
549 | - </Tooltip> | |
550 | - ); | |
551 | - } | |
552 | - return <Tag color={TAGS_COLOR.get(newText)}>{label}</Tag>; | |
553 | - }, | |
554 | - }; | |
555 | - } else if ( | |
556 | - //枚举字段处理 | |
557 | - item.key === 'paymentMethod' || | |
558 | - item.key === 'paymentChannel' || | |
559 | - item.key === 'logisticsMethod' || | |
560 | - item.key === 'productBelongBusiness' | |
561 | - ) { | |
562 | - return { | |
563 | - ...item, | |
564 | - render: (text: string) => { | |
565 | - let label = enumValueToLabel(text, PAYMENT_CHANNEL_OPTIONS); | |
566 | - if (label === undefined) { | |
567 | - label = enumValueToLabel(text, PAYMENT_METHOD_OPTIONS); | |
568 | - } | |
569 | - if (label === undefined) { | |
570 | - label = enumValueToLabel(text, LOGISTICS_STATUS_OPTIONS); | |
571 | - } | |
572 | - if (label === undefined) { | |
573 | - label = enumValueToLabel( | |
574 | - text, | |
575 | - PRODUCT_BELONG_DEPARTMENT_OPTIONS, | |
576 | - ); | |
577 | - } | |
578 | - return label; | |
579 | - }, | |
580 | - }; | |
581 | - } else { | |
582 | - return { | |
583 | - ...item, | |
584 | - render: (text: string) => { | |
585 | - return <span>{text}</span>; | |
586 | - }, | |
587 | - }; | |
588 | - } | |
589 | - // return item; | |
590 | - }) | |
591 | - .concat([ | |
592 | - { | |
593 | - title: '操作', | |
594 | - dataIndex: 'operation', | |
595 | - key: 'operation', | |
596 | - align: 'center', | |
597 | - fixed: 'right', | |
598 | - render: (optText, optRecord) => ( | |
599 | - <Flex gap="small"> | |
600 | - {optRecord.subPath.includes('sendProduct') ? ( | |
535 | + /> | |
536 | + </Flex> | |
537 | + </Flex> | |
538 | + <Flex justify="flex-end"> | |
539 | + <Space.Compact direction="vertical" align="end"> | |
540 | + <Space> | |
541 | + {record.mainPath.includes('sendProduct') ? ( | |
601 | 542 | <Button |
602 | 543 | className="p-0" |
603 | 544 | type="link" |
604 | 545 | onClick={() => { |
605 | - optRecord.mainOrderId = record.id; | |
606 | - setSelectedRows([cloneDeep(optRecord)]); //克隆一份数据,避免后续修改污染 | |
546 | + if (!selectedRowObj[record.id]?.length) { | |
547 | + return message.error('请选择选择子订单'); | |
548 | + } | |
549 | + setSelectedRows(selectedRowObj[record.id]); | |
607 | 550 | setDeliverVisible(true); |
608 | 551 | setIsSendProduct(true); |
609 | 552 | }} |
... | ... | @@ -613,80 +556,85 @@ const OrderPage = () => { |
613 | 556 | ) : ( |
614 | 557 | '' |
615 | 558 | )} |
616 | - | |
617 | - {optRecord.subPath.includes('queryAnnex') ? ( | |
559 | + {record.mainPath.includes('printOrder') ? ( | |
618 | 560 | <Button |
619 | 561 | className="p-0" |
620 | 562 | type="link" |
621 | 563 | onClick={() => { |
622 | - optRecord.mainOrderId = record.id; | |
623 | - setAttachmentModalVisible(true); | |
624 | - setOrderRow(optRecord); | |
564 | + if (!selectedRowObj[record.id]?.length) { | |
565 | + return message.error('请选择选择子订单'); | |
566 | + } | |
567 | + setSelectedRows(selectedRowObj[record.id]); | |
568 | + setOrderRow(record); | |
569 | + setOrderPrintVisible(true); | |
625 | 570 | }} |
626 | 571 | > |
627 | - 附件 | |
572 | + 打印 | |
628 | 573 | </Button> |
629 | 574 | ) : ( |
630 | 575 | '' |
631 | 576 | )} |
632 | - | |
633 | - {optRecord.subPath.includes('modifySendInformation') ? ( | |
577 | + {record.mainPath.includes('rePrintOrder') ? ( | |
634 | 578 | <Button |
635 | 579 | className="p-0" |
636 | 580 | type="link" |
637 | 581 | onClick={() => { |
638 | - optRecord.mainOrderId = record.id; | |
639 | - setSelectedRows([cloneDeep(optRecord)]); //克隆一份数据,避免后续修改污染 | |
640 | - setDeliverVisible(true); | |
641 | - setIsSendProduct(false); | |
642 | - }} | |
643 | - > | |
644 | - 修改发货信息 | |
645 | - </Button> | |
646 | - ) : ( | |
647 | - '' | |
648 | - )} | |
649 | - | |
650 | - {optRecord.subPath.includes('printOrder') ? ( | |
651 | - <Button | |
652 | - className="p-0" | |
653 | - type="link" | |
654 | - onClick={async () => { | |
655 | - setOrderPrintVisible(true); | |
656 | - setSelectedRows([optRecord]); | |
582 | + if (!selectedRowObj[record.id]?.length) { | |
583 | + return message.error('请选择选择子订单'); | |
584 | + } | |
585 | + setSelectedRows(selectedRowObj[record.id]); | |
657 | 586 | setOrderRow(record); |
587 | + setOrderPrintVisible(true); | |
588 | + setIsRePrintOrder(true); | |
658 | 589 | }} |
659 | 590 | > |
660 | - 打印 | |
591 | + 重新打印 | |
661 | 592 | </Button> |
662 | 593 | ) : ( |
663 | 594 | '' |
664 | 595 | )} |
665 | - {optRecord.subPath.includes('editOrder') ? ( | |
596 | + {record.mainPath.includes('modifySendInformation') ? ( | |
666 | 597 | <Button |
667 | 598 | className="p-0" |
668 | 599 | type="link" |
669 | 600 | onClick={() => { |
670 | - setFinancialVisible(true); | |
671 | - setOrderRow(record); | |
672 | - setSelectedRows([optRecord]); | |
673 | - setIsFinalcialEdit(true); | |
601 | + if (!selectedRowObj[record.id]?.length) { | |
602 | + return message.error( | |
603 | + '请选择已经发货或者已经确认收货的子订单', | |
604 | + ); | |
605 | + } | |
606 | + for (let row of selectedRowObj[record.id]) { | |
607 | + if ( | |
608 | + row.orderStatus !== 'CONFIRM_RECEIPT' && | |
609 | + row.orderStatus !== 'SHIPPED' | |
610 | + ) { | |
611 | + return message.error( | |
612 | + '请选择已经发货或者已经确认收货的子订单', | |
613 | + ); | |
614 | + } | |
615 | + } | |
616 | + setSelectedRows(selectedRowObj[record.id]); | |
617 | + setDeliverVisible(true); | |
618 | + setIsSendProduct(false); | |
674 | 619 | }} |
675 | 620 | > |
676 | - 编辑 | |
621 | + 修改发货信息 | |
677 | 622 | </Button> |
678 | 623 | ) : ( |
679 | 624 | '' |
680 | 625 | )} |
681 | - {optRecord.subPath.includes('invoicing') ? ( | |
626 | + {record.mainPath.includes('invoicing') ? ( | |
682 | 627 | <Button |
683 | - className="p-0" | |
684 | 628 | type="link" |
629 | + className="p-0" | |
685 | 630 | onClick={() => { |
686 | - setFinancialVisible(true); | |
687 | - setIsFinalcialEdit(false); | |
631 | + let selectedSubOrders = selectedRowObj[record.id]; | |
632 | + setSelectedRows(selectedSubOrders); | |
633 | + if (selectedSubOrders === undefined) { | |
634 | + setSelectedRows(record.subOrderInformationLists); | |
635 | + } | |
688 | 636 | setOrderRow(record); |
689 | - setSelectedRows([optRecord]); | |
637 | + setFinancialVisible(true); | |
690 | 638 | }} |
691 | 639 | > |
692 | 640 | 开票 |
... | ... | @@ -694,116 +642,132 @@ const OrderPage = () => { |
694 | 642 | ) : ( |
695 | 643 | '' |
696 | 644 | )} |
697 | - {optRecord.subPath.includes('checkOrder') ? ( | |
645 | + {record.mainPath.includes('updateOrder') ? ( | |
698 | 646 | <Button |
699 | 647 | className="p-0" |
700 | 648 | type="link" |
701 | 649 | onClick={() => { |
702 | - setOrderRow(optRecord); | |
703 | - setCheckVisible(true); | |
704 | - setSelectedRows([optRecord]); | |
650 | + //勾选的子订单:如果有勾选,后面只校验有勾选的 | |
651 | + let selectedSubOrders = selectedRowObj[record.id]; | |
652 | + if ( | |
653 | + selectedSubOrders === undefined || | |
654 | + selectedSubOrders.length === 0 | |
655 | + ) { | |
656 | + selectedSubOrders = record.subOrderInformationLists; | |
657 | + } | |
658 | + for ( | |
659 | + let index = 0; | |
660 | + index < selectedSubOrders.length; | |
661 | + index++ | |
662 | + ) { | |
663 | + let orderStatus = | |
664 | + selectedSubOrders[index].orderStatus; | |
665 | + //是审核通过及之后的订单 | |
666 | + if ( | |
667 | + orderStatus !== 'UNAUDITED' && | |
668 | + orderStatus !== 'AUDIT_FAILED' | |
669 | + ) { | |
670 | + message.error( | |
671 | + '请选择未审核或者审核失败的订单进行编辑', | |
672 | + ); | |
673 | + return; | |
674 | + } | |
675 | + } | |
676 | + setOrderDrawerVisible(true); | |
677 | + setOrderRow(record); | |
678 | + setSelectedRows(selectedSubOrders); | |
679 | + setOrderOptType('edit'); | |
705 | 680 | }} |
706 | 681 | > |
707 | - 审核 | |
682 | + 编辑 | |
708 | 683 | </Button> |
709 | 684 | ) : ( |
710 | 685 | '' |
711 | 686 | )} |
712 | 687 | |
713 | - {optRecord.subPath.includes('rePrintOrder') ? ( | |
688 | + {record.mainPath.includes('checkOrder') ? ( | |
714 | 689 | <Button |
715 | 690 | className="p-0" |
716 | 691 | type="link" |
717 | 692 | onClick={() => { |
718 | - setOrderPrintVisible(true); | |
719 | - setSelectedRows([optRecord]); | |
693 | + let selectedSubOrders = selectedRowObj[record.id]; | |
694 | + setSelectedRows(selectedSubOrders); | |
695 | + if (selectedSubOrders === undefined) { | |
696 | + setSelectedRows(record.subOrderInformationLists); | |
697 | + console.log( | |
698 | + 'subOrderInformationLists:' + | |
699 | + record.subOrderInformationLists, | |
700 | + ); | |
701 | + } | |
702 | + for (let i = 0; i < selectedRows.length; i++) { | |
703 | + if ( | |
704 | + selectedRows[i].orderStatus !== 'UNAUDITED' && | |
705 | + selectedRows[i].orderStatus !== 'AUDIT_FAILED' | |
706 | + ) { | |
707 | + message.error( | |
708 | + '请选择未审核或者审核失败的子订单进行审核', | |
709 | + ); | |
710 | + return; | |
711 | + } | |
712 | + } | |
720 | 713 | setOrderRow(record); |
721 | - setIsRePrintOrder(true); | |
714 | + setCheckVisible(true); | |
722 | 715 | }} |
723 | 716 | > |
724 | - 重新打印 | |
717 | + 审核 | |
725 | 718 | </Button> |
726 | 719 | ) : ( |
727 | 720 | '' |
728 | 721 | )} |
729 | 722 | |
730 | - {optRecord.subPath.includes('confirmReceipt') ? ( | |
731 | - <Button | |
732 | - className="p-0" | |
733 | - type="link" | |
734 | - onClick={() => { | |
735 | - setConfirmReceiptVisible(true); | |
736 | - setOrderRow(optRecord); | |
737 | - }} | |
738 | - > | |
739 | - 确认收货 | |
740 | - </Button> | |
741 | - ) : ( | |
742 | - '' | |
743 | - )} | |
744 | - {optRecord.subPath.includes('viewImages') ? ( | |
745 | - <Button | |
723 | + {record.mainPath.includes('OrderCancel') ? ( | |
724 | + <ButtonConfirm | |
746 | 725 | className="p-0" |
747 | - type="link" | |
748 | - onClick={() => { | |
749 | - setSubOrderConfirmReceiptImagesVisible(true); | |
750 | - setOrderRow(optRecord); | |
726 | + title="确认作废?" | |
727 | + text="作废" | |
728 | + onConfirm={async () => { | |
729 | + let body = { id: record.id }; | |
730 | + const data = await postServiceOrderOrderCancel({ | |
731 | + data: body, | |
732 | + }); | |
733 | + if (data.result === RESPONSE_CODE.SUCCESS) { | |
734 | + message.success(data.message); | |
735 | + refreshTable(); | |
736 | + } | |
751 | 737 | }} |
752 | - > | |
753 | - 查看收货凭证 | |
754 | - </Button> | |
738 | + /> | |
755 | 739 | ) : ( |
756 | 740 | '' |
757 | 741 | )} |
758 | - </Flex> | |
759 | - ), | |
760 | - }, | |
761 | - { | |
762 | - title: '备注', | |
763 | - dataIndex: 'notes', | |
764 | - key: 'notes', | |
765 | - align: 'center', | |
766 | - render: (optTxt, optRecord) => ( | |
767 | - <Button | |
768 | - type="dashed" | |
769 | - size="small" | |
770 | - onClick={() => { | |
771 | - setNotesEditVisible(true); | |
772 | - setOrderRow(optRecord); | |
773 | - setIsMainOrder(false); | |
774 | - }} | |
775 | - > | |
776 | - 详情 | |
777 | - </Button> | |
778 | - ), | |
779 | - }, | |
780 | - ])} | |
781 | - rowSelection={{ | |
782 | - onChange: (selectedRowKeys: any, selectedRows: any) => { | |
783 | - setSelectedRowKeys(selectedRowKeys); | |
784 | - setSelectedRowObj({ | |
785 | - ...setSelectedRowObj, | |
786 | - [record.id]: selectedRows, | |
787 | - }); | |
788 | - selectedRowObj[record.id] = selectedRows; | |
789 | - setSelectedRows(selectedRows); | |
790 | - }, | |
791 | - selectedRowKeys: selectedRowKeys, | |
792 | - // 自定义选择项参考: https://ant.design/components/table-cn/#components-table-demo-row-selection-custom | |
793 | - // 注释该行则默认不显示下拉选项 | |
794 | - // selections: [Table.SELECTION_ALL, Table.SELECTION_INVERT], | |
795 | - // defaultSelectedRowKeys: [], | |
796 | - }} | |
797 | - rowKey="id" | |
798 | - headerTitle={false} | |
799 | - search={false} | |
800 | - options={false} | |
801 | - dataSource={subOrders} | |
802 | - pagination={false} | |
803 | - /> | |
742 | + </Space> | |
743 | + </Space.Compact> | |
744 | + </Flex> | |
745 | + </Flex> | |
746 | + </Flex> | |
747 | + | |
748 | + <Flex className="p-0 py-[24px] pl-[23px] pr-[5px] bg-white rounded-b-lg"> | |
749 | + {expandedRowRender(record)} | |
750 | + </Flex> | |
751 | + </Flex> | |
804 | 752 | ); |
805 | 753 | }; |
806 | 754 | |
755 | + // 主订单列表 | |
756 | + const mainOrdersColumns: ProColumns<OrderType>[] = MAIN_ORDER_COLUMNS.map( | |
757 | + (item) => { | |
758 | + if (item.dataIndex === 'name') { | |
759 | + return { | |
760 | + ...item, | |
761 | + title: <OrderTableHeader />, | |
762 | + render: (text, record) => { | |
763 | + return <MainOrderColumnRender record={record} />; | |
764 | + }, | |
765 | + }; | |
766 | + } | |
767 | + return item; | |
768 | + }, | |
769 | + ); | |
770 | + | |
807 | 771 | function toolBarRender() { |
808 | 772 | let toolBtns = []; |
809 | 773 | |
... | ... | @@ -817,7 +781,7 @@ const OrderPage = () => { |
817 | 781 | message.error('请选择订单'); |
818 | 782 | return; |
819 | 783 | } |
820 | - let body = { flag: true, ids: selectedItems }; | |
784 | + let body = { flag: 30, ids: selectedItems }; | |
821 | 785 | exportLoading(); |
822 | 786 | orderExport('/api/service/order/export', body, exportLoadingDestory); |
823 | 787 | }, |
... | ... | @@ -830,7 +794,7 @@ const OrderPage = () => { |
830 | 794 | message.error('当前没有订单'); |
831 | 795 | return; |
832 | 796 | } |
833 | - let body = { flag: true, ids: mainOrderAllItemKeys }; | |
797 | + let body = { flag: 20, ids: mainOrderAllItemKeys }; | |
834 | 798 | exportLoading(); |
835 | 799 | orderExport('/api/service/order/export', body, exportLoadingDestory); |
836 | 800 | }, |
... | ... | @@ -839,7 +803,16 @@ const OrderPage = () => { |
839 | 803 | label: '导出所有订单', |
840 | 804 | key: '3', |
841 | 805 | onClick: async () => { |
842 | - let body = { flag: false, ids: [] }; | |
806 | + let body = { flag: 10, ids: [] }; | |
807 | + exportLoading(); | |
808 | + orderExport('/api/service/order/export', body, exportLoadingDestory); | |
809 | + }, | |
810 | + }, | |
811 | + { | |
812 | + label: '导出当天订单', | |
813 | + key: '4', | |
814 | + onClick: async () => { | |
815 | + let body = { flag: 40, ids: [] }; | |
843 | 816 | exportLoading(); |
844 | 817 | orderExport('/api/service/order/export', body, exportLoadingDestory); |
845 | 818 | }, |
... | ... | @@ -890,18 +863,18 @@ const OrderPage = () => { |
890 | 863 | </Dropdown>, |
891 | 864 | ); |
892 | 865 | |
893 | - toolBtns.push( | |
894 | - <Button | |
895 | - key="show" | |
896 | - onClick={() => { | |
897 | - handleAllExpand(); | |
898 | - }} | |
899 | - > | |
900 | - {mainOrderAllItemKeys?.length !== expandedRowKeys.length | |
901 | - ? '一键展开' | |
902 | - : '一键收起'} | |
903 | - </Button>, | |
904 | - ); | |
866 | + // toolBtns.push( | |
867 | + // <Button | |
868 | + // key="show" | |
869 | + // onClick={() => { | |
870 | + // handleAllExpand(); | |
871 | + // }} | |
872 | + // > | |
873 | + // {mainOrderAllItemKeys?.length !== expandedRowKeys.length | |
874 | + // ? '一键展开' | |
875 | + // : '一键收起'} | |
876 | + // </Button>, | |
877 | + // ); | |
905 | 878 | |
906 | 879 | return toolBtns; |
907 | 880 | } |
... | ... | @@ -944,9 +917,9 @@ const OrderPage = () => { |
944 | 917 | > |
945 | 918 | <div id="resizeDiv"></div> |
946 | 919 | <ProTable |
947 | - id="mainTable" | |
948 | - // tableStyle={{height:'100px'}} | |
949 | - scroll={{ x: true, y: tableHeight }} | |
920 | + id="main-table" | |
921 | + // tableStyle={{backgroundColor:'red'}} | |
922 | + | |
950 | 923 | actionRef={mainTableRef} |
951 | 924 | expandIconColumnIndex={-1} |
952 | 925 | columns={mainOrdersColumns} |
... | ... | @@ -961,14 +934,15 @@ const OrderPage = () => { |
961 | 934 | setCurrentPage(page); |
962 | 935 | }, |
963 | 936 | }} |
937 | + // showHeader={false} | |
964 | 938 | expandedRowKeys={expandedRowKeys} |
965 | - expandable={{ expandedRowRender }} | |
939 | + // expandable={{ expandedRowRender }} | |
966 | 940 | dateFormatter="string" |
967 | 941 | options={false} |
968 | 942 | headerTitle="订单列表" |
969 | 943 | search={{ |
970 | 944 | labelWidth: 'auto', |
971 | - onCollapse: resize, | |
945 | + // onCollapse: resize, | |
972 | 946 | }} |
973 | 947 | request={async ( |
974 | 948 | // 第一个参数 params 查询表单和 params 参数的结合 |
... | ... | @@ -993,6 +967,7 @@ const OrderPage = () => { |
993 | 967 | setMainOrderAllItemKeys(mainOrderIds); |
994 | 968 | } |
995 | 969 | setRolePath(data.specialPath); |
970 | + handleTableExpand(mainOrderIds); | |
996 | 971 | return { |
997 | 972 | data: data?.data || [], |
998 | 973 | total: data?.total || 0, |
... | ... | @@ -1125,6 +1100,16 @@ const OrderPage = () => { |
1125 | 1100 | /> |
1126 | 1101 | )} |
1127 | 1102 | |
1103 | + {historyModalVisible && ( | |
1104 | + <HistoryModal | |
1105 | + subOrders={selectedRows} | |
1106 | + onClose={() => { | |
1107 | + setHistoryModalVisible(false); | |
1108 | + setSelectedRows({}); | |
1109 | + }} | |
1110 | + /> | |
1111 | + )} | |
1112 | + | |
1128 | 1113 | {contextHolder} |
1129 | 1114 | </PageContainer> |
1130 | 1115 | ); | ... | ... |
src/pages/OrderPrint/components/HoujiePrinter.tsx
... | ... | @@ -82,10 +82,10 @@ export default ({ mainOrder, subOrders }) => { |
82 | 82 | style={{ msoWidthSource: 'userset', msoWidthAlt: 2048 }} |
83 | 83 | /> |
84 | 84 | <col |
85 | - width="114" | |
85 | + width="60" | |
86 | 86 | style={{ msoWidthSource: 'userset', msoWidthAlt: 2432 }} |
87 | 87 | /> |
88 | - <col width="108" style={{ width: '54.00pt' }} /> | |
88 | + <col width="108" style={{ width: '95.00pt' }} /> | |
89 | 89 | <tr height="42" style={{ height: '21.00pt' }}> |
90 | 90 | <td height="42" style={{ height: '21.00pt' }}></td> |
91 | 91 | <td | ... | ... |
src/services/definition.ts
src/services/request.ts
... | ... | @@ -26,6 +26,7 @@ import type { |
26 | 26 | DictionaryQueryVO, |
27 | 27 | DictionaryVO, |
28 | 28 | Dto, |
29 | + ModelAndView, | |
29 | 30 | OrderAddVO, |
30 | 31 | OrderAuditLogQueryVO, |
31 | 32 | OrderBaseInfoQueryVO, |
... | ... | @@ -36,6 +37,7 @@ import type { |
36 | 37 | OrderUpdateVO, |
37 | 38 | ProductInformationDto, |
38 | 39 | QueryAnnexDto, |
40 | + QueryHistoryRecordDto, | |
39 | 41 | QueryMainOrderDto, |
40 | 42 | ResetPwdVO, |
41 | 43 | ServerResult, |
... | ... | @@ -219,9 +221,7 @@ export interface GetErrorResponse { |
219 | 221 | * @description |
220 | 222 | * OK |
221 | 223 | */ |
222 | - 200: { | |
223 | - [propertyName: string]: any; | |
224 | - }; | |
224 | + 200: ModelAndView; | |
225 | 225 | /** |
226 | 226 | * @description |
227 | 227 | * Unauthorized |
... | ... | @@ -242,9 +242,9 @@ export interface GetErrorResponse { |
242 | 242 | export type GetErrorResponseSuccess = GetErrorResponse[200]; |
243 | 243 | /** |
244 | 244 | * @description |
245 | - * error | |
245 | + * errorHtml | |
246 | 246 | * @tags basic-error-controller |
247 | - * @produces * | |
247 | + * @produces text/html | |
248 | 248 | */ |
249 | 249 | export const getError = /* #__PURE__ */ (() => { |
250 | 250 | const method = 'get'; |
... | ... | @@ -268,9 +268,7 @@ export interface PutErrorResponse { |
268 | 268 | * @description |
269 | 269 | * OK |
270 | 270 | */ |
271 | - 200: { | |
272 | - [propertyName: string]: any; | |
273 | - }; | |
271 | + 200: ModelAndView; | |
274 | 272 | /** |
275 | 273 | * @description |
276 | 274 | * Created |
... | ... | @@ -296,9 +294,9 @@ export interface PutErrorResponse { |
296 | 294 | export type PutErrorResponseSuccess = PutErrorResponse[200]; |
297 | 295 | /** |
298 | 296 | * @description |
299 | - * error | |
297 | + * errorHtml | |
300 | 298 | * @tags basic-error-controller |
301 | - * @produces * | |
299 | + * @produces text/html | |
302 | 300 | * @consumes application/json |
303 | 301 | */ |
304 | 302 | export const putError = /* #__PURE__ */ (() => { |
... | ... | @@ -323,9 +321,7 @@ export interface PostErrorResponse { |
323 | 321 | * @description |
324 | 322 | * OK |
325 | 323 | */ |
326 | - 200: { | |
327 | - [propertyName: string]: any; | |
328 | - }; | |
324 | + 200: ModelAndView; | |
329 | 325 | /** |
330 | 326 | * @description |
331 | 327 | * Created |
... | ... | @@ -351,9 +347,9 @@ export interface PostErrorResponse { |
351 | 347 | export type PostErrorResponseSuccess = PostErrorResponse[200]; |
352 | 348 | /** |
353 | 349 | * @description |
354 | - * error | |
350 | + * errorHtml | |
355 | 351 | * @tags basic-error-controller |
356 | - * @produces * | |
352 | + * @produces text/html | |
357 | 353 | * @consumes application/json |
358 | 354 | */ |
359 | 355 | export const postError = /* #__PURE__ */ (() => { |
... | ... | @@ -378,9 +374,7 @@ export interface DeleteErrorResponse { |
378 | 374 | * @description |
379 | 375 | * OK |
380 | 376 | */ |
381 | - 200: { | |
382 | - [propertyName: string]: any; | |
383 | - }; | |
377 | + 200: ModelAndView; | |
384 | 378 | /** |
385 | 379 | * @description |
386 | 380 | * No Content |
... | ... | @@ -401,9 +395,9 @@ export interface DeleteErrorResponse { |
401 | 395 | export type DeleteErrorResponseSuccess = DeleteErrorResponse[200]; |
402 | 396 | /** |
403 | 397 | * @description |
404 | - * error | |
398 | + * errorHtml | |
405 | 399 | * @tags basic-error-controller |
406 | - * @produces * | |
400 | + * @produces text/html | |
407 | 401 | */ |
408 | 402 | export const deleteError = /* #__PURE__ */ (() => { |
409 | 403 | const method = 'delete'; |
... | ... | @@ -427,9 +421,7 @@ export interface OptionsErrorResponse { |
427 | 421 | * @description |
428 | 422 | * OK |
429 | 423 | */ |
430 | - 200: { | |
431 | - [propertyName: string]: any; | |
432 | - }; | |
424 | + 200: ModelAndView; | |
433 | 425 | /** |
434 | 426 | * @description |
435 | 427 | * No Content |
... | ... | @@ -450,9 +442,9 @@ export interface OptionsErrorResponse { |
450 | 442 | export type OptionsErrorResponseSuccess = OptionsErrorResponse[200]; |
451 | 443 | /** |
452 | 444 | * @description |
453 | - * error | |
445 | + * errorHtml | |
454 | 446 | * @tags basic-error-controller |
455 | - * @produces * | |
447 | + * @produces text/html | |
456 | 448 | * @consumes application/json |
457 | 449 | */ |
458 | 450 | export const optionsError = /* #__PURE__ */ (() => { |
... | ... | @@ -477,9 +469,7 @@ export interface HeadErrorResponse { |
477 | 469 | * @description |
478 | 470 | * OK |
479 | 471 | */ |
480 | - 200: { | |
481 | - [propertyName: string]: any; | |
482 | - }; | |
472 | + 200: ModelAndView; | |
483 | 473 | /** |
484 | 474 | * @description |
485 | 475 | * No Content |
... | ... | @@ -500,9 +490,9 @@ export interface HeadErrorResponse { |
500 | 490 | export type HeadErrorResponseSuccess = HeadErrorResponse[200]; |
501 | 491 | /** |
502 | 492 | * @description |
503 | - * error | |
493 | + * errorHtml | |
504 | 494 | * @tags basic-error-controller |
505 | - * @produces * | |
495 | + * @produces text/html | |
506 | 496 | * @consumes application/json |
507 | 497 | */ |
508 | 498 | export const headError = /* #__PURE__ */ (() => { |
... | ... | @@ -527,9 +517,7 @@ export interface PatchErrorResponse { |
527 | 517 | * @description |
528 | 518 | * OK |
529 | 519 | */ |
530 | - 200: { | |
531 | - [propertyName: string]: any; | |
532 | - }; | |
520 | + 200: ModelAndView; | |
533 | 521 | /** |
534 | 522 | * @description |
535 | 523 | * No Content |
... | ... | @@ -550,9 +538,9 @@ export interface PatchErrorResponse { |
550 | 538 | export type PatchErrorResponseSuccess = PatchErrorResponse[200]; |
551 | 539 | /** |
552 | 540 | * @description |
553 | - * error | |
541 | + * errorHtml | |
554 | 542 | * @tags basic-error-controller |
555 | - * @produces * | |
543 | + * @produces text/html | |
556 | 544 | * @consumes application/json |
557 | 545 | */ |
558 | 546 | export const patchError = /* #__PURE__ */ (() => { |
... | ... | @@ -4710,77 +4698,6 @@ export const postOrderErpUsersUpdatePass = /* #__PURE__ */ (() => { |
4710 | 4698 | return request; |
4711 | 4699 | })(); |
4712 | 4700 | |
4713 | -/** @description request parameter type for postServiceOrderOrderCancel */ | |
4714 | -export interface PostServiceOrderOrderCancelOption { | |
4715 | - /** | |
4716 | - * @description | |
4717 | - * dto | |
4718 | - */ | |
4719 | - body: { | |
4720 | - /** | |
4721 | - @description | |
4722 | - dto */ | |
4723 | - dto: Dto; | |
4724 | - }; | |
4725 | -} | |
4726 | - | |
4727 | -/** @description response type for postServiceOrderOrderCancel */ | |
4728 | -export interface PostServiceOrderOrderCancelResponse { | |
4729 | - /** | |
4730 | - * @description | |
4731 | - * OK | |
4732 | - */ | |
4733 | - 200: ServerResult; | |
4734 | - /** | |
4735 | - * @description | |
4736 | - * Created | |
4737 | - */ | |
4738 | - 201: any; | |
4739 | - /** | |
4740 | - * @description | |
4741 | - * Unauthorized | |
4742 | - */ | |
4743 | - 401: any; | |
4744 | - /** | |
4745 | - * @description | |
4746 | - * Forbidden | |
4747 | - */ | |
4748 | - 403: any; | |
4749 | - /** | |
4750 | - * @description | |
4751 | - * Not Found | |
4752 | - */ | |
4753 | - 404: any; | |
4754 | -} | |
4755 | - | |
4756 | -export type PostServiceOrderOrderCancelResponseSuccess = | |
4757 | - PostServiceOrderOrderCancelResponse[200]; | |
4758 | -/** | |
4759 | - * @description | |
4760 | - * 订单作废 | |
4761 | - * @tags 内部订单 | |
4762 | - * @produces * | |
4763 | - * @consumes application/json | |
4764 | - */ | |
4765 | -export const postServiceOrderOrderCancel = /* #__PURE__ */ (() => { | |
4766 | - const method = 'post'; | |
4767 | - const url = '/service/order/OrderCancel'; | |
4768 | - function request( | |
4769 | - option: PostServiceOrderOrderCancelOption, | |
4770 | - ): Promise<PostServiceOrderOrderCancelResponseSuccess> { | |
4771 | - return requester(request.url, { | |
4772 | - method: request.method, | |
4773 | - ...option, | |
4774 | - }) as unknown as Promise<PostServiceOrderOrderCancelResponseSuccess>; | |
4775 | - } | |
4776 | - | |
4777 | - /** http method */ | |
4778 | - request.method = method; | |
4779 | - /** request url */ | |
4780 | - request.url = url; | |
4781 | - return request; | |
4782 | -})(); | |
4783 | - | |
4784 | 4701 | /** @description request parameter type for postServiceOrderAddOrder */ |
4785 | 4702 | export interface PostServiceOrderAddOrderOption { |
4786 | 4703 | /** |
... | ... | @@ -5561,6 +5478,77 @@ export const postServiceOrderInvoicing = /* #__PURE__ */ (() => { |
5561 | 5478 | return request; |
5562 | 5479 | })(); |
5563 | 5480 | |
5481 | +/** @description request parameter type for postServiceOrderOrderCancel */ | |
5482 | +export interface PostServiceOrderOrderCancelOption { | |
5483 | + /** | |
5484 | + * @description | |
5485 | + * dto | |
5486 | + */ | |
5487 | + body: { | |
5488 | + /** | |
5489 | + @description | |
5490 | + dto */ | |
5491 | + dto: Dto; | |
5492 | + }; | |
5493 | +} | |
5494 | + | |
5495 | +/** @description response type for postServiceOrderOrderCancel */ | |
5496 | +export interface PostServiceOrderOrderCancelResponse { | |
5497 | + /** | |
5498 | + * @description | |
5499 | + * OK | |
5500 | + */ | |
5501 | + 200: ServerResult; | |
5502 | + /** | |
5503 | + * @description | |
5504 | + * Created | |
5505 | + */ | |
5506 | + 201: any; | |
5507 | + /** | |
5508 | + * @description | |
5509 | + * Unauthorized | |
5510 | + */ | |
5511 | + 401: any; | |
5512 | + /** | |
5513 | + * @description | |
5514 | + * Forbidden | |
5515 | + */ | |
5516 | + 403: any; | |
5517 | + /** | |
5518 | + * @description | |
5519 | + * Not Found | |
5520 | + */ | |
5521 | + 404: any; | |
5522 | +} | |
5523 | + | |
5524 | +export type PostServiceOrderOrderCancelResponseSuccess = | |
5525 | + PostServiceOrderOrderCancelResponse[200]; | |
5526 | +/** | |
5527 | + * @description | |
5528 | + * 订单作废 | |
5529 | + * @tags 内部订单 | |
5530 | + * @produces * | |
5531 | + * @consumes application/json | |
5532 | + */ | |
5533 | +export const postServiceOrderOrderCancel = /* #__PURE__ */ (() => { | |
5534 | + const method = 'post'; | |
5535 | + const url = '/service/order/orderCancel'; | |
5536 | + function request( | |
5537 | + option: PostServiceOrderOrderCancelOption, | |
5538 | + ): Promise<PostServiceOrderOrderCancelResponseSuccess> { | |
5539 | + return requester(request.url, { | |
5540 | + method: request.method, | |
5541 | + ...option, | |
5542 | + }) as unknown as Promise<PostServiceOrderOrderCancelResponseSuccess>; | |
5543 | + } | |
5544 | + | |
5545 | + /** http method */ | |
5546 | + request.method = method; | |
5547 | + /** request url */ | |
5548 | + request.url = url; | |
5549 | + return request; | |
5550 | +})(); | |
5551 | + | |
5564 | 5552 | /** @description request parameter type for postServiceOrderPrintOrder */ |
5565 | 5553 | export interface PostServiceOrderPrintOrderOption { |
5566 | 5554 | /** |
... | ... | @@ -6089,6 +6077,77 @@ export const postServiceOrderQueryCustomerNameInformation = |
6089 | 6077 | return request; |
6090 | 6078 | })(); |
6091 | 6079 | |
6080 | +/** @description request parameter type for postServiceOrderQueryHistoryOrderRecord */ | |
6081 | +export interface PostServiceOrderQueryHistoryOrderRecordOption { | |
6082 | + /** | |
6083 | + * @description | |
6084 | + * dto | |
6085 | + */ | |
6086 | + body: { | |
6087 | + /** | |
6088 | + @description | |
6089 | + dto */ | |
6090 | + dto: QueryHistoryRecordDto; | |
6091 | + }; | |
6092 | +} | |
6093 | + | |
6094 | +/** @description response type for postServiceOrderQueryHistoryOrderRecord */ | |
6095 | +export interface PostServiceOrderQueryHistoryOrderRecordResponse { | |
6096 | + /** | |
6097 | + * @description | |
6098 | + * OK | |
6099 | + */ | |
6100 | + 200: ServerResult; | |
6101 | + /** | |
6102 | + * @description | |
6103 | + * Created | |
6104 | + */ | |
6105 | + 201: any; | |
6106 | + /** | |
6107 | + * @description | |
6108 | + * Unauthorized | |
6109 | + */ | |
6110 | + 401: any; | |
6111 | + /** | |
6112 | + * @description | |
6113 | + * Forbidden | |
6114 | + */ | |
6115 | + 403: any; | |
6116 | + /** | |
6117 | + * @description | |
6118 | + * Not Found | |
6119 | + */ | |
6120 | + 404: any; | |
6121 | +} | |
6122 | + | |
6123 | +export type PostServiceOrderQueryHistoryOrderRecordResponseSuccess = | |
6124 | + PostServiceOrderQueryHistoryOrderRecordResponse[200]; | |
6125 | +/** | |
6126 | + * @description | |
6127 | + * 查询历史订单记录 | |
6128 | + * @tags 内部订单 | |
6129 | + * @produces * | |
6130 | + * @consumes application/json | |
6131 | + */ | |
6132 | +export const postServiceOrderQueryHistoryOrderRecord = /* #__PURE__ */ (() => { | |
6133 | + const method = 'post'; | |
6134 | + const url = '/service/order/queryHistoryOrderRecord'; | |
6135 | + function request( | |
6136 | + option: PostServiceOrderQueryHistoryOrderRecordOption, | |
6137 | + ): Promise<PostServiceOrderQueryHistoryOrderRecordResponseSuccess> { | |
6138 | + return requester(request.url, { | |
6139 | + method: request.method, | |
6140 | + ...option, | |
6141 | + }) as unknown as Promise<PostServiceOrderQueryHistoryOrderRecordResponseSuccess>; | |
6142 | + } | |
6143 | + | |
6144 | + /** http method */ | |
6145 | + request.method = method; | |
6146 | + /** request url */ | |
6147 | + request.url = url; | |
6148 | + return request; | |
6149 | +})(); | |
6150 | + | |
6092 | 6151 | /** @description request parameter type for postServiceOrderQueryProductInformation */ |
6093 | 6152 | export interface PostServiceOrderQueryProductInformationOption { |
6094 | 6153 | /** | ... | ... |
src/utils/index.ts
... | ... | @@ -67,7 +67,7 @@ function formatSalesCode(salesCode: any) { |
67 | 67 | } |
68 | 68 | |
69 | 69 | // 将二进制流的字符串转换成 Blob 对象 |
70 | -function dataURItoBlob(dataURI) { | |
70 | +function dataURItoBlob(dataURI: any) { | |
71 | 71 | const byteString = atob(dataURI.split(',')[1]); |
72 | 72 | const mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]; |
73 | 73 | const ab = new ArrayBuffer(byteString.length); |
... | ... | @@ -79,11 +79,11 @@ function dataURItoBlob(dataURI) { |
79 | 79 | } |
80 | 80 | |
81 | 81 | // 将 Blob 对象转换成 File 对象 |
82 | -function blobToFile(blob, fileName) { | |
82 | +function blobToFile(blob: any, fileName: any) { | |
83 | 83 | return new File([blob], fileName, { type: blob.type }); |
84 | 84 | } |
85 | 85 | |
86 | -function appendFormData(formData, data, parentKey = null) { | |
86 | +function appendFormData(formData: any, data: any, parentKey = null) { | |
87 | 87 | for (const key in data) { |
88 | 88 | if (data.hasOwnProperty(key)) { |
89 | 89 | const value = data[key]; | ... | ... |