Commit f677cef7d952e405d6e5f5ed81d97ac84ee28835
1 parent
029101a8
feat: update 采购转仓库
Showing
5 changed files
with
339 additions
and
21 deletions
src/pages/Order/components/ProcureCheckModal.tsx
1 | 1 | import { RESPONSE_CODE } from '@/constants/enum'; |
2 | 2 | import { |
3 | 3 | postServiceOrderProcureCheckOrder, |
4 | + postServiceOrderProcureConvertWarehouseKeeper, | |
4 | 5 | postServiceOrderQuerySupplier, |
5 | 6 | } from '@/services'; |
6 | 7 | import { ModalForm, ProFormSelect } from '@ant-design/pro-components'; |
7 | -import { Form, message } from 'antd'; | |
8 | +import { Button, Form, Input, Popconfirm, message } from 'antd'; | |
9 | +import { useState } from 'react'; | |
8 | 10 | export default ({ setCheckVisible, data, subOrders, onClose }) => { |
9 | 11 | const [form] = Form.useForm<{ name: string; company: string }>(); |
12 | + | |
13 | + const [checkNotes, setCheckNotes] = useState<string>(''); | |
14 | + | |
10 | 15 | let subOrderIds: any[] = []; |
11 | 16 | //是单条子订单审核 |
12 | 17 | if (subOrders === undefined) { |
... | ... | @@ -31,7 +36,7 @@ export default ({ setCheckVisible, data, subOrders, onClose }) => { |
31 | 36 | }> |
32 | 37 | width={500} |
33 | 38 | open |
34 | - title="供应商选择" | |
39 | + title="采购审核" | |
35 | 40 | form={form} |
36 | 41 | autoFocusFirstInput |
37 | 42 | modalProps={{ |
... | ... | @@ -44,7 +49,48 @@ export default ({ setCheckVisible, data, subOrders, onClose }) => { |
44 | 49 | }} |
45 | 50 | submitter={{ |
46 | 51 | render: (props, defaultDoms) => { |
47 | - return defaultDoms; | |
52 | + return [ | |
53 | + defaultDoms[0], | |
54 | + <> | |
55 | + <Popconfirm | |
56 | + title="是否转回仓库" | |
57 | + description={ | |
58 | + <div> | |
59 | + <div className="py-2"> | |
60 | + <span>转回仓库后将由仓库管理员进行打印、发货</span> | |
61 | + </div> | |
62 | + <Input.TextArea | |
63 | + placeholder="请填写备注" | |
64 | + onChange={(e: any) => { | |
65 | + setCheckNotes(e.target.value); | |
66 | + }} | |
67 | + rows={4} | |
68 | + ></Input.TextArea> | |
69 | + </div> | |
70 | + } | |
71 | + onConfirm={async () => { | |
72 | + const res = | |
73 | + await postServiceOrderProcureConvertWarehouseKeeper({ | |
74 | + data: { | |
75 | + subIds: subOrderIds, | |
76 | + checkNotes: checkNotes, | |
77 | + }, | |
78 | + }); | |
79 | + | |
80 | + if (res?.result === RESPONSE_CODE.SUCCESS) { | |
81 | + message.success(res.message); | |
82 | + onClose(); | |
83 | + return true; | |
84 | + } | |
85 | + }} | |
86 | + okText="确定" | |
87 | + cancelText="取消" | |
88 | + > | |
89 | + <Button type="primary">转回仓库</Button> | |
90 | + </Popconfirm> | |
91 | + </>, | |
92 | + defaultDoms[1], | |
93 | + ]; | |
48 | 94 | }, |
49 | 95 | }} |
50 | 96 | submitTimeout={2000} | ... | ... |
src/pages/Order/constant.ts
... | ... | @@ -112,6 +112,7 @@ export const ORDER_STATUS_OPTIONS = { |
112 | 112 | IN_AFTER_SALES: '售后中', |
113 | 113 | AFTER_SALES_COMPLETION: '售后完成', |
114 | 114 | NO_NEED_SEND: '无需发货', |
115 | + PROCURE_CONVERT_WAREHOUSE_KEEPER: '采购转仓库', | |
115 | 116 | }; |
116 | 117 | |
117 | 118 | export const AFTE_SALES_PLAN_OPTIONS = { |
... | ... | @@ -148,6 +149,7 @@ export const TAGS_COLOR = new Map<string, string>([ |
148 | 149 | ['PROCURE_PROCESS_FOR_MINE', 'processing'], |
149 | 150 | ['PROCURE_WAIT_SHIP', 'processing'], |
150 | 151 | ['NO_NEED_SEND', 'success'], |
152 | + ['PROCURE_CONVERT_WAREHOUSE_KEEPER', 'processing'], | |
151 | 153 | ]); |
152 | 154 | |
153 | 155 | export const SALES_CODE_OPTIONS = [ |
... | ... | @@ -217,6 +219,7 @@ export const HISTORY_OPT_TYPE = new Map<string, string>([ |
217 | 219 | ['PROCURE_PRINT', '采购打印子订单'], |
218 | 220 | ['PROCURE_SEND', '采购发货子订单'], |
219 | 221 | ['NO_NEED_SEND', '不需要发货'], |
222 | + ['PROCURE_CONVERT_WAREHOUSE_KEEPER', '采购转仓库'], | |
220 | 223 | ]); |
221 | 224 | |
222 | 225 | export const MAIN_ORDER_COLUMNS = [ | ... | ... |
src/pages/Order/index.tsx
... | ... | @@ -190,6 +190,24 @@ const OrderPage = () => { |
190 | 190 | ); |
191 | 191 | }; |
192 | 192 | |
193 | + /** | |
194 | + * 检查是否可以打印 | |
195 | + * @param paths 按钮集合 | |
196 | + * @returns | |
197 | + */ | |
198 | + function checkePrintable(paths: any) { | |
199 | + if ( | |
200 | + !paths?.includes('printOrder') && | |
201 | + !paths?.includes('supplierPrint') && | |
202 | + !paths?.includes('procurePrint') && | |
203 | + !paths?.includes('rePrintOrder') | |
204 | + ) { | |
205 | + return false; | |
206 | + } | |
207 | + | |
208 | + return true; | |
209 | + } | |
210 | + | |
193 | 211 | const onCheckboxChange = (record: never) => { |
194 | 212 | let newSelectedItems = []; |
195 | 213 | if (selectedItems.includes(record.id)) { |
... | ... | @@ -308,6 +326,28 @@ const OrderPage = () => { |
308 | 326 | ); |
309 | 327 | } |
310 | 328 | |
329 | + if (orderStatus === 'PROCURE_CONVERT_WAREHOUSE_KEEPER') { | |
330 | + return ( | |
331 | + <MyToolTip | |
332 | + title={optRecord.checkNotes} | |
333 | + content={ | |
334 | + <> | |
335 | + <Tag | |
336 | + color={TAGS_COLOR.get(optRecord.orderStatus)} | |
337 | + style={{ marginRight: '4px' }} | |
338 | + > | |
339 | + {enumValueToLabel( | |
340 | + optRecord.orderStatus, | |
341 | + ORDER_STATUS_OPTIONS, | |
342 | + )} | |
343 | + </Tag> | |
344 | + <QuestionCircleOutlined style={{ color: '#C1C1C1' }} /> | |
345 | + </> | |
346 | + } | |
347 | + /> | |
348 | + ); | |
349 | + } | |
350 | + | |
311 | 351 | return ( |
312 | 352 | <Tag color={TAGS_COLOR.get(optRecord.orderStatus)}> |
313 | 353 | {enumValueToLabel(optRecord.orderStatus, ORDER_STATUS_OPTIONS)} |
... | ... | @@ -349,22 +389,6 @@ const OrderPage = () => { |
349 | 389 | }} |
350 | 390 | /> |
351 | 391 | </Flex> |
352 | - | |
353 | - <Flex title={optRecord.notes}> | |
354 | - <div className="max-w-[90%] whitespace-no-wrap overflow-hidden overflow-ellipsis"> | |
355 | - <span className="text-[#8C8C8C]"> | |
356 | - 开票备注:请将2312210003,2312210002,2312210001订单合并开票 | |
357 | - </span> | |
358 | - </div> | |
359 | - {/* 编辑备注按钮 */} | |
360 | - <EditTwoTone | |
361 | - onClick={() => { | |
362 | - setNotesEditVisible(true); | |
363 | - setOrderRow(optRecord); | |
364 | - setIsMainOrder(false); | |
365 | - }} | |
366 | - /> | |
367 | - </Flex> | |
368 | 392 | </Flex> |
369 | 393 | <Flex className="w-[16%]" vertical gap="small"> |
370 | 394 | <div |
... | ... | @@ -1079,10 +1103,18 @@ const OrderPage = () => { |
1079 | 1103 | className="p-0" |
1080 | 1104 | type="link" |
1081 | 1105 | onClick={() => { |
1082 | - if (!selectedRowObj[record.id]?.length) { | |
1106 | + const selectedSubOrders = selectedRowObj[record.id]; | |
1107 | + if (!selectedSubOrders?.length) { | |
1083 | 1108 | return message.error('请选择选择子订单'); |
1084 | 1109 | } |
1085 | - setSelectedRows(selectedRowObj[record.id]); | |
1110 | + | |
1111 | + for (let subOrderRecord of selectedSubOrders) { | |
1112 | + let subPath = subOrderRecord.subPath; | |
1113 | + if (!checkePrintable(subPath)) { | |
1114 | + return message.error('请选择可以打印的子订单'); | |
1115 | + } | |
1116 | + } | |
1117 | + setSelectedRows(selectedSubOrders); | |
1086 | 1118 | setOrderRow(record); |
1087 | 1119 | setOrderPrintVisible(true); |
1088 | 1120 | setOrderCheckType(CHECK_TYPE.NORMAL); | ... | ... |
src/services/definition.ts
... | ... | @@ -709,6 +709,19 @@ export interface ProcureCheckOrderDto { |
709 | 709 | supplier?: string; |
710 | 710 | } |
711 | 711 | |
712 | +export interface ProcureConvertWarehouseKeeperDto { | |
713 | + /** | |
714 | + * @description | |
715 | + * 审核备注 | |
716 | + */ | |
717 | + checkNotes?: string; | |
718 | + /** | |
719 | + * @description | |
720 | + * 子订单id集合 | |
721 | + */ | |
722 | + subIds?: Array<number>; | |
723 | +} | |
724 | + | |
712 | 725 | export interface ProcurePrintDto { |
713 | 726 | /** |
714 | 727 | * @description |
... | ... | @@ -745,7 +758,16 @@ export interface QueryAnnexDto { |
745 | 758 | } |
746 | 759 | |
747 | 760 | export interface QueryHistoryRecordDto { |
761 | + /** | |
762 | + * @description | |
763 | + * 子订单id集合 | |
764 | + */ | |
748 | 765 | ids?: Array<number>; |
766 | + /** | |
767 | + * @description | |
768 | + * 查看已经删除的订单,false表示查看未删除的订单,true表示查看删除的订单 | |
769 | + */ | |
770 | + isDeleteQueryOrder?: boolean; | |
749 | 771 | } |
750 | 772 | |
751 | 773 | export interface QueryMainOrderDto { | ... | ... |
src/services/request.ts
... | ... | @@ -35,6 +35,7 @@ import type { |
35 | 35 | OrderUnlockFieldApplyVO, |
36 | 36 | OrderUpdateVO, |
37 | 37 | ProcureCheckOrderDto, |
38 | + ProcureConvertWarehouseKeeperDto, | |
38 | 39 | ProcurePrintDto, |
39 | 40 | ProductInformationDto, |
40 | 41 | QueryAnnexDto, |
... | ... | @@ -575,6 +576,77 @@ export const patchError = /* #__PURE__ */ (() => { |
575 | 576 | return request; |
576 | 577 | })(); |
577 | 578 | |
579 | +/** @description request parameter type for postOfficialWebsiteUploadAliOss */ | |
580 | +export interface PostOfficialWebsiteUploadAliOssOption { | |
581 | + /** | |
582 | + * @description | |
583 | + * files | |
584 | + */ | |
585 | + formData: { | |
586 | + /** | |
587 | + @description | |
588 | + files */ | |
589 | + files: Array<File>; | |
590 | + }; | |
591 | +} | |
592 | + | |
593 | +/** @description response type for postOfficialWebsiteUploadAliOss */ | |
594 | +export interface PostOfficialWebsiteUploadAliOssResponse { | |
595 | + /** | |
596 | + * @description | |
597 | + * OK | |
598 | + */ | |
599 | + 200: ServerResult; | |
600 | + /** | |
601 | + * @description | |
602 | + * Created | |
603 | + */ | |
604 | + 201: any; | |
605 | + /** | |
606 | + * @description | |
607 | + * Unauthorized | |
608 | + */ | |
609 | + 401: any; | |
610 | + /** | |
611 | + * @description | |
612 | + * Forbidden | |
613 | + */ | |
614 | + 403: any; | |
615 | + /** | |
616 | + * @description | |
617 | + * Not Found | |
618 | + */ | |
619 | + 404: any; | |
620 | +} | |
621 | + | |
622 | +export type PostOfficialWebsiteUploadAliOssResponseSuccess = | |
623 | + PostOfficialWebsiteUploadAliOssResponse[200]; | |
624 | +/** | |
625 | + * @description | |
626 | + * 为官网提供上传文件的接口 | |
627 | + * @tags 官网 | |
628 | + * @produces * | |
629 | + * @consumes application/json | |
630 | + */ | |
631 | +export const postOfficialWebsiteUploadAliOss = /* #__PURE__ */ (() => { | |
632 | + const method = 'post'; | |
633 | + const url = '/official/website/uploadAliOss'; | |
634 | + function request( | |
635 | + option: PostOfficialWebsiteUploadAliOssOption, | |
636 | + ): Promise<PostOfficialWebsiteUploadAliOssResponseSuccess> { | |
637 | + return requester(request.url, { | |
638 | + method: request.method, | |
639 | + ...option, | |
640 | + }) as unknown as Promise<PostOfficialWebsiteUploadAliOssResponseSuccess>; | |
641 | + } | |
642 | + | |
643 | + /** http method */ | |
644 | + request.method = method; | |
645 | + /** request url */ | |
646 | + request.url = url; | |
647 | + return request; | |
648 | +})(); | |
649 | + | |
578 | 650 | /** @description request parameter type for postOrderErpApplyList */ |
579 | 651 | export interface PostOrderErpApplyListOption { |
580 | 652 | /** |
... | ... | @@ -4927,6 +4999,77 @@ export const postServiceOrderApplyAfterSales = /* #__PURE__ */ (() => { |
4927 | 4999 | return request; |
4928 | 5000 | })(); |
4929 | 5001 | |
5002 | +/** @description request parameter type for postServiceOrderApplyInvoicing */ | |
5003 | +export interface PostServiceOrderApplyInvoicingOption { | |
5004 | + /** | |
5005 | + * @description | |
5006 | + * dto | |
5007 | + */ | |
5008 | + body: { | |
5009 | + /** | |
5010 | + @description | |
5011 | + dto */ | |
5012 | + dto: Dto; | |
5013 | + }; | |
5014 | +} | |
5015 | + | |
5016 | +/** @description response type for postServiceOrderApplyInvoicing */ | |
5017 | +export interface PostServiceOrderApplyInvoicingResponse { | |
5018 | + /** | |
5019 | + * @description | |
5020 | + * OK | |
5021 | + */ | |
5022 | + 200: ServerResult; | |
5023 | + /** | |
5024 | + * @description | |
5025 | + * Created | |
5026 | + */ | |
5027 | + 201: any; | |
5028 | + /** | |
5029 | + * @description | |
5030 | + * Unauthorized | |
5031 | + */ | |
5032 | + 401: any; | |
5033 | + /** | |
5034 | + * @description | |
5035 | + * Forbidden | |
5036 | + */ | |
5037 | + 403: any; | |
5038 | + /** | |
5039 | + * @description | |
5040 | + * Not Found | |
5041 | + */ | |
5042 | + 404: any; | |
5043 | +} | |
5044 | + | |
5045 | +export type PostServiceOrderApplyInvoicingResponseSuccess = | |
5046 | + PostServiceOrderApplyInvoicingResponse[200]; | |
5047 | +/** | |
5048 | + * @description | |
5049 | + * 销售发起开票 | |
5050 | + * @tags 内部订单 | |
5051 | + * @produces * | |
5052 | + * @consumes application/json | |
5053 | + */ | |
5054 | +export const postServiceOrderApplyInvoicing = /* #__PURE__ */ (() => { | |
5055 | + const method = 'post'; | |
5056 | + const url = '/service/order/applyInvoicing'; | |
5057 | + function request( | |
5058 | + option: PostServiceOrderApplyInvoicingOption, | |
5059 | + ): Promise<PostServiceOrderApplyInvoicingResponseSuccess> { | |
5060 | + return requester(request.url, { | |
5061 | + method: request.method, | |
5062 | + ...option, | |
5063 | + }) as unknown as Promise<PostServiceOrderApplyInvoicingResponseSuccess>; | |
5064 | + } | |
5065 | + | |
5066 | + /** http method */ | |
5067 | + request.method = method; | |
5068 | + /** request url */ | |
5069 | + request.url = url; | |
5070 | + return request; | |
5071 | +})(); | |
5072 | + | |
4930 | 5073 | /** @description request parameter type for postServiceOrderCheckOrder */ |
4931 | 5074 | export interface PostServiceOrderCheckOrderOption { |
4932 | 5075 | /** |
... | ... | @@ -5991,6 +6134,78 @@ export const postServiceOrderProcureCheckOrder = /* #__PURE__ */ (() => { |
5991 | 6134 | return request; |
5992 | 6135 | })(); |
5993 | 6136 | |
6137 | +/** @description request parameter type for postServiceOrderProcureConvertWarehouseKeeper */ | |
6138 | +export interface PostServiceOrderProcureConvertWarehouseKeeperOption { | |
6139 | + /** | |
6140 | + * @description | |
6141 | + * dto | |
6142 | + */ | |
6143 | + body: { | |
6144 | + /** | |
6145 | + @description | |
6146 | + dto */ | |
6147 | + dto: ProcureConvertWarehouseKeeperDto; | |
6148 | + }; | |
6149 | +} | |
6150 | + | |
6151 | +/** @description response type for postServiceOrderProcureConvertWarehouseKeeper */ | |
6152 | +export interface PostServiceOrderProcureConvertWarehouseKeeperResponse { | |
6153 | + /** | |
6154 | + * @description | |
6155 | + * OK | |
6156 | + */ | |
6157 | + 200: ServerResult; | |
6158 | + /** | |
6159 | + * @description | |
6160 | + * Created | |
6161 | + */ | |
6162 | + 201: any; | |
6163 | + /** | |
6164 | + * @description | |
6165 | + * Unauthorized | |
6166 | + */ | |
6167 | + 401: any; | |
6168 | + /** | |
6169 | + * @description | |
6170 | + * Forbidden | |
6171 | + */ | |
6172 | + 403: any; | |
6173 | + /** | |
6174 | + * @description | |
6175 | + * Not Found | |
6176 | + */ | |
6177 | + 404: any; | |
6178 | +} | |
6179 | + | |
6180 | +export type PostServiceOrderProcureConvertWarehouseKeeperResponseSuccess = | |
6181 | + PostServiceOrderProcureConvertWarehouseKeeperResponse[200]; | |
6182 | +/** | |
6183 | + * @description | |
6184 | + * 采购转回仓库 | |
6185 | + * @tags 内部订单 | |
6186 | + * @produces * | |
6187 | + * @consumes application/json | |
6188 | + */ | |
6189 | +export const postServiceOrderProcureConvertWarehouseKeeper = | |
6190 | + /* #__PURE__ */ (() => { | |
6191 | + const method = 'post'; | |
6192 | + const url = '/service/order/procureConvertWarehouseKeeper'; | |
6193 | + function request( | |
6194 | + option: PostServiceOrderProcureConvertWarehouseKeeperOption, | |
6195 | + ): Promise<PostServiceOrderProcureConvertWarehouseKeeperResponseSuccess> { | |
6196 | + return requester(request.url, { | |
6197 | + method: request.method, | |
6198 | + ...option, | |
6199 | + }) as unknown as Promise<PostServiceOrderProcureConvertWarehouseKeeperResponseSuccess>; | |
6200 | + } | |
6201 | + | |
6202 | + /** http method */ | |
6203 | + request.method = method; | |
6204 | + /** request url */ | |
6205 | + request.url = url; | |
6206 | + return request; | |
6207 | + })(); | |
6208 | + | |
5994 | 6209 | /** @description request parameter type for postServiceOrderProcurePrint */ |
5995 | 6210 | export interface PostServiceOrderProcurePrintOption { |
5996 | 6211 | /** | ... | ... |