Commit 695fadcaee47a8daf40bacbcb0d4d8648b3ec6f0
1 parent
98b84d37
feat: update 销售收款记录编辑功能
Showing
5 changed files
with
192 additions
and
112 deletions
src/pages/Order/components/FinancialReceiptsModal.tsx
1 | +import { postServiceOrderUpdateHirePurchase } from '@/services'; | |
1 | 2 | import { |
2 | 3 | EditableProTable, |
3 | 4 | ModalForm, |
... | ... | @@ -8,65 +9,70 @@ import { Form } from 'antd'; |
8 | 9 | import { useState } from 'react'; |
9 | 10 | |
10 | 11 | // import { cloneDeep } from 'lodash'; |
11 | -export default ({ setVisible, onClose }) => { | |
12 | +export default ({ setVisible, datas, onClose }) => { | |
12 | 13 | const [form] = Form.useForm<{ name: string; company: string }>(); |
13 | 14 | type DataSourceType = { |
14 | 15 | id: React.Key; |
15 | - receiptsType?: string; | |
16 | - receiptsPrice?: number; | |
17 | - receiptsTime?: string; | |
16 | + hirePurchaseMethod?: string; | |
17 | + hirePurchaseMethodName?: string; | |
18 | + money?: number; | |
19 | + updateTime?: string; | |
18 | 20 | notes?: string; |
19 | 21 | }; |
20 | 22 | const defaultData: DataSourceType[] = [ |
21 | 23 | { |
22 | 24 | id: 1, |
23 | - receiptsType: '预付款', | |
24 | - receiptsPrice: 1234, | |
25 | - receiptsTime: '2023-01-02', | |
26 | - notes: '备注', | |
25 | + hirePurchaseMethod: 'ADVANCE_CHARGE', | |
26 | + hirePurchaseMethodName: '预付款', | |
27 | + money: undefined, | |
28 | + updateTime: undefined, | |
29 | + notes: undefined, | |
27 | 30 | }, |
28 | 31 | { |
29 | 32 | id: 2, |
30 | - receiptsType: '发货款', | |
31 | - receiptsPrice: 1234, | |
32 | - receiptsTime: '2023-01-02', | |
33 | - notes: '备注', | |
33 | + hirePurchaseMethod: 'PAYMENT_FOR_SHIPMENT', | |
34 | + hirePurchaseMethodName: '发货款', | |
35 | + money: undefined, | |
36 | + updateTime: undefined, | |
37 | + notes: undefined, | |
34 | 38 | }, |
35 | 39 | { |
36 | 40 | id: 3, |
37 | - receiptsType: '验收款', | |
38 | - receiptsPrice: 1234, | |
39 | - receiptsTime: '2023-01-02', | |
40 | - notes: '备注', | |
41 | + hirePurchaseMethod: 'ACCEPTANCE_PAYMENT', | |
42 | + hirePurchaseMethodName: '验收款', | |
43 | + money: undefined, | |
44 | + updateTime: undefined, | |
45 | + notes: undefined, | |
41 | 46 | }, |
42 | 47 | { |
43 | 48 | id: 4, |
44 | - receiptsType: '尾款', | |
45 | - receiptsPrice: 1234, | |
46 | - receiptsTime: '2023-01-02', | |
47 | - notes: '备注', | |
49 | + hirePurchaseMethod: 'BALANCE_PAYMENT', | |
50 | + hirePurchaseMethodName: '尾款', | |
51 | + money: undefined, | |
52 | + updateTime: undefined, | |
53 | + notes: undefined, | |
48 | 54 | }, |
49 | 55 | ]; |
50 | 56 | const [editableKeys, setEditableRowKeys] = useState<React.Key[]>(() => |
51 | 57 | // defaultData.map((item) => item.id), |
52 | - [3, 4], | |
58 | + [1, 2, 3, 4], | |
53 | 59 | ); |
54 | 60 | const columns: ProColumns<DataSourceType>[] = [ |
55 | 61 | { |
56 | 62 | title: '款项', |
57 | - dataIndex: 'receiptsType', | |
63 | + dataIndex: 'hirePurchaseMethodName', | |
58 | 64 | editable: false, |
59 | 65 | width: '10%', |
60 | 66 | }, |
61 | 67 | { |
62 | 68 | title: '已收金额', |
63 | - dataIndex: 'receiptsPrice', | |
69 | + dataIndex: 'money', | |
64 | 70 | valueType: 'digit', |
65 | 71 | width: '15%', |
66 | 72 | }, |
67 | 73 | { |
68 | 74 | title: '收款时间', |
69 | - dataIndex: 'receiptsTime', | |
75 | + dataIndex: 'updateTime', | |
70 | 76 | valueType: 'dateTime', |
71 | 77 | width: '25%', |
72 | 78 | }, |
... | ... | @@ -95,7 +101,13 @@ export default ({ setVisible, onClose }) => { |
95 | 101 | }, |
96 | 102 | }} |
97 | 103 | onFinish={async (values) => { |
98 | - console.log(values); | |
104 | + let res = await postServiceOrderUpdateHirePurchase({ | |
105 | + data: { | |
106 | + mainOrderId: datas[0].id, | |
107 | + list: values.dataSource, | |
108 | + }, | |
109 | + }); | |
110 | + console.log(res); | |
99 | 111 | onClose(); |
100 | 112 | }} |
101 | 113 | onOpenChange={setVisible} | ... | ... |
src/pages/Order/constant.ts
... | ... | @@ -9,6 +9,13 @@ export const PAYMENT_CHANNEL_OPTIONS = { |
9 | 9 | BANK_TRANSFER: '银行转账', |
10 | 10 | }; |
11 | 11 | |
12 | +export const RECEIPTS_RECORD_TYPES = { | |
13 | + ADVANCE_CHARGE: '预付款', | |
14 | + PAYMENT_FOR_SHIPMENT: '发货款', | |
15 | + ACCEPTANCE_PAYMENT: '验收款', | |
16 | + BALANCE_PAYMENT: '尾款', | |
17 | +}; | |
18 | + | |
12 | 19 | export const PAYMENT_METHOD_OPTIONS = { |
13 | 20 | UNPAID: '未付款', |
14 | 21 | TAOBAO_ORDER_HAS_BEEN_PAID: '淘宝订单已付款', |
... | ... | @@ -16,6 +23,7 @@ export const PAYMENT_METHOD_OPTIONS = { |
16 | 23 | WITHHOLDING_ADVANCE_DEPOSIT: '扣预存', |
17 | 24 | PLATFORM_SETTLEMENT: '平台结算', |
18 | 25 | CASH_ON_DELIVERY: '货到付款', |
26 | + HIRE_PURCHASE: '分期付款', | |
19 | 27 | }; |
20 | 28 | |
21 | 29 | export const PRODUCT_BELONG_DEPARTMENT_OPTIONS = { | ... | ... |
src/pages/Order/index.tsx
... | ... | @@ -898,23 +898,6 @@ const OrderPage = () => { |
898 | 898 | '' |
899 | 899 | )} |
900 | 900 | |
901 | - {false ? ( | |
902 | - <Button | |
903 | - className="p-0" | |
904 | - type="link" | |
905 | - onClick={() => { | |
906 | - setFinancialReceiptsModalVisible(true); | |
907 | - setOrderRow(record); | |
908 | - setSelectedRows([optRecord]); | |
909 | - setIsEdit(true); | |
910 | - }} | |
911 | - > | |
912 | - 收款记录 | |
913 | - </Button> | |
914 | - ) : ( | |
915 | - '' | |
916 | - )} | |
917 | - | |
918 | 901 | {optRecord.subPath?.includes('invoicing') ? ( |
919 | 902 | <Button |
920 | 903 | className="p-0" |
... | ... | @@ -1419,6 +1402,22 @@ const OrderPage = () => { |
1419 | 1402 | <Flex justify="flex-end"> |
1420 | 1403 | <Space.Compact direction="vertical" align="end"> |
1421 | 1404 | <Space> |
1405 | + {record.mainPath?.includes('updateHirePurchase') ? ( | |
1406 | + <Button | |
1407 | + className="p-0" | |
1408 | + type="link" | |
1409 | + onClick={() => { | |
1410 | + setFinancialReceiptsModalVisible(true); | |
1411 | + setOrderRow(record); | |
1412 | + setSelectedRows([record]); | |
1413 | + setIsEdit(true); | |
1414 | + }} | |
1415 | + > | |
1416 | + 收款记录 | |
1417 | + </Button> | |
1418 | + ) : ( | |
1419 | + '' | |
1420 | + )} | |
1422 | 1421 | {record.mainPath?.includes('procureConvertProcure') ? ( |
1423 | 1422 | <Button |
1424 | 1423 | className="p-0" |
... | ... | @@ -2696,6 +2695,7 @@ const OrderPage = () => { |
2696 | 2695 | {financialReceiptsModalVisible && ( |
2697 | 2696 | <FinancialReceiptsModal |
2698 | 2697 | setVisible={setFinancialReceiptsModalVisible} |
2698 | + datas={selectedRows} | |
2699 | 2699 | onClose={() => { |
2700 | 2700 | setFinancialReceiptsModalVisible(false); |
2701 | 2701 | setSelectedRows({}); | ... | ... |
src/services/definition.ts
... | ... | @@ -891,6 +891,30 @@ export interface SysLogQueryVO { |
891 | 891 | username?: string; |
892 | 892 | } |
893 | 893 | |
894 | +export interface UpdateHirePurchase { | |
895 | + /** | |
896 | + * @description | |
897 | + * 分期付款支付方式 | |
898 | + */ | |
899 | + hirePurchaseMethod?: string; | |
900 | + /** | |
901 | + * @description | |
902 | + * 金额 | |
903 | + */ | |
904 | + money?: number; | |
905 | + /** | |
906 | + * @description | |
907 | + * 备注 | |
908 | + */ | |
909 | + notes?: string; | |
910 | + /** | |
911 | + * @description | |
912 | + * 修改时间 | |
913 | + * @format date-time | |
914 | + */ | |
915 | + updateTime?: string; | |
916 | +} | |
917 | + | |
894 | 918 | export interface UpdatePwdVO { |
895 | 919 | confirmPassword?: string; |
896 | 920 | password?: string; | ... | ... |
src/services/request.ts
... | ... | @@ -26,7 +26,6 @@ import type { |
26 | 26 | DictionaryQueryVO, |
27 | 27 | DictionaryVO, |
28 | 28 | Dto, |
29 | - ModelAndView, | |
30 | 29 | OrderAddVO, |
31 | 30 | OrderAuditLogQueryVO, |
32 | 31 | OrderBaseInfoQueryVO, |
... | ... | @@ -229,7 +228,9 @@ export interface GetErrorResponse { |
229 | 228 | * @description |
230 | 229 | * OK |
231 | 230 | */ |
232 | - 200: ModelAndView; | |
231 | + 200: { | |
232 | + [propertyName: string]: any; | |
233 | + }; | |
233 | 234 | /** |
234 | 235 | * @description |
235 | 236 | * Unauthorized |
... | ... | @@ -250,9 +251,9 @@ export interface GetErrorResponse { |
250 | 251 | export type GetErrorResponseSuccess = GetErrorResponse[200]; |
251 | 252 | /** |
252 | 253 | * @description |
253 | - * errorHtml | |
254 | + * error | |
254 | 255 | * @tags basic-error-controller |
255 | - * @produces text/html | |
256 | + * @produces * | |
256 | 257 | */ |
257 | 258 | export const getError = /* #__PURE__ */ (() => { |
258 | 259 | const method = 'get'; |
... | ... | @@ -276,7 +277,9 @@ export interface PutErrorResponse { |
276 | 277 | * @description |
277 | 278 | * OK |
278 | 279 | */ |
279 | - 200: ModelAndView; | |
280 | + 200: { | |
281 | + [propertyName: string]: any; | |
282 | + }; | |
280 | 283 | /** |
281 | 284 | * @description |
282 | 285 | * Created |
... | ... | @@ -302,9 +305,9 @@ export interface PutErrorResponse { |
302 | 305 | export type PutErrorResponseSuccess = PutErrorResponse[200]; |
303 | 306 | /** |
304 | 307 | * @description |
305 | - * errorHtml | |
308 | + * error | |
306 | 309 | * @tags basic-error-controller |
307 | - * @produces text/html | |
310 | + * @produces * | |
308 | 311 | * @consumes application/json |
309 | 312 | */ |
310 | 313 | export const putError = /* #__PURE__ */ (() => { |
... | ... | @@ -329,7 +332,9 @@ export interface PostErrorResponse { |
329 | 332 | * @description |
330 | 333 | * OK |
331 | 334 | */ |
332 | - 200: ModelAndView; | |
335 | + 200: { | |
336 | + [propertyName: string]: any; | |
337 | + }; | |
333 | 338 | /** |
334 | 339 | * @description |
335 | 340 | * Created |
... | ... | @@ -355,9 +360,9 @@ export interface PostErrorResponse { |
355 | 360 | export type PostErrorResponseSuccess = PostErrorResponse[200]; |
356 | 361 | /** |
357 | 362 | * @description |
358 | - * errorHtml | |
363 | + * error | |
359 | 364 | * @tags basic-error-controller |
360 | - * @produces text/html | |
365 | + * @produces * | |
361 | 366 | * @consumes application/json |
362 | 367 | */ |
363 | 368 | export const postError = /* #__PURE__ */ (() => { |
... | ... | @@ -382,7 +387,9 @@ export interface DeleteErrorResponse { |
382 | 387 | * @description |
383 | 388 | * OK |
384 | 389 | */ |
385 | - 200: ModelAndView; | |
390 | + 200: { | |
391 | + [propertyName: string]: any; | |
392 | + }; | |
386 | 393 | /** |
387 | 394 | * @description |
388 | 395 | * No Content |
... | ... | @@ -403,9 +410,9 @@ export interface DeleteErrorResponse { |
403 | 410 | export type DeleteErrorResponseSuccess = DeleteErrorResponse[200]; |
404 | 411 | /** |
405 | 412 | * @description |
406 | - * errorHtml | |
413 | + * error | |
407 | 414 | * @tags basic-error-controller |
408 | - * @produces text/html | |
415 | + * @produces * | |
409 | 416 | */ |
410 | 417 | export const deleteError = /* #__PURE__ */ (() => { |
411 | 418 | const method = 'delete'; |
... | ... | @@ -429,7 +436,9 @@ export interface OptionsErrorResponse { |
429 | 436 | * @description |
430 | 437 | * OK |
431 | 438 | */ |
432 | - 200: ModelAndView; | |
439 | + 200: { | |
440 | + [propertyName: string]: any; | |
441 | + }; | |
433 | 442 | /** |
434 | 443 | * @description |
435 | 444 | * No Content |
... | ... | @@ -450,9 +459,9 @@ export interface OptionsErrorResponse { |
450 | 459 | export type OptionsErrorResponseSuccess = OptionsErrorResponse[200]; |
451 | 460 | /** |
452 | 461 | * @description |
453 | - * errorHtml | |
462 | + * error | |
454 | 463 | * @tags basic-error-controller |
455 | - * @produces text/html | |
464 | + * @produces * | |
456 | 465 | * @consumes application/json |
457 | 466 | */ |
458 | 467 | export const optionsError = /* #__PURE__ */ (() => { |
... | ... | @@ -477,7 +486,9 @@ export interface HeadErrorResponse { |
477 | 486 | * @description |
478 | 487 | * OK |
479 | 488 | */ |
480 | - 200: ModelAndView; | |
489 | + 200: { | |
490 | + [propertyName: string]: any; | |
491 | + }; | |
481 | 492 | /** |
482 | 493 | * @description |
483 | 494 | * No Content |
... | ... | @@ -498,9 +509,9 @@ export interface HeadErrorResponse { |
498 | 509 | export type HeadErrorResponseSuccess = HeadErrorResponse[200]; |
499 | 510 | /** |
500 | 511 | * @description |
501 | - * errorHtml | |
512 | + * error | |
502 | 513 | * @tags basic-error-controller |
503 | - * @produces text/html | |
514 | + * @produces * | |
504 | 515 | * @consumes application/json |
505 | 516 | */ |
506 | 517 | export const headError = /* #__PURE__ */ (() => { |
... | ... | @@ -525,7 +536,9 @@ export interface PatchErrorResponse { |
525 | 536 | * @description |
526 | 537 | * OK |
527 | 538 | */ |
528 | - 200: ModelAndView; | |
539 | + 200: { | |
540 | + [propertyName: string]: any; | |
541 | + }; | |
529 | 542 | /** |
530 | 543 | * @description |
531 | 544 | * No Content |
... | ... | @@ -546,9 +559,9 @@ export interface PatchErrorResponse { |
546 | 559 | export type PatchErrorResponseSuccess = PatchErrorResponse[200]; |
547 | 560 | /** |
548 | 561 | * @description |
549 | - * errorHtml | |
562 | + * error | |
550 | 563 | * @tags basic-error-controller |
551 | - * @produces text/html | |
564 | + * @produces * | |
552 | 565 | * @consumes application/json |
553 | 566 | */ |
554 | 567 | export const patchError = /* #__PURE__ */ (() => { |
... | ... | @@ -567,54 +580,6 @@ export const patchError = /* #__PURE__ */ (() => { |
567 | 580 | return request; |
568 | 581 | })(); |
569 | 582 | |
570 | -/** @description response type for getKingdeeTestGetToken */ | |
571 | -export interface GetKingdeeTestGetTokenResponse { | |
572 | - /** | |
573 | - * @description | |
574 | - * OK | |
575 | - */ | |
576 | - 200: string; | |
577 | - /** | |
578 | - * @description | |
579 | - * Unauthorized | |
580 | - */ | |
581 | - 401: any; | |
582 | - /** | |
583 | - * @description | |
584 | - * Forbidden | |
585 | - */ | |
586 | - 403: any; | |
587 | - /** | |
588 | - * @description | |
589 | - * Not Found | |
590 | - */ | |
591 | - 404: any; | |
592 | -} | |
593 | - | |
594 | -export type GetKingdeeTestGetTokenResponseSuccess = | |
595 | - GetKingdeeTestGetTokenResponse[200]; | |
596 | -/** | |
597 | - * @description | |
598 | - * getToken | |
599 | - * @tags kingdee-test-controller | |
600 | - * @produces * | |
601 | - */ | |
602 | -export const getKingdeeTestGetToken = /* #__PURE__ */ (() => { | |
603 | - const method = 'get'; | |
604 | - const url = '/kingdee/test/getToken'; | |
605 | - function request(): Promise<GetKingdeeTestGetTokenResponseSuccess> { | |
606 | - return requester(request.url, { | |
607 | - method: request.method, | |
608 | - }) as unknown as Promise<GetKingdeeTestGetTokenResponseSuccess>; | |
609 | - } | |
610 | - | |
611 | - /** http method */ | |
612 | - request.method = method; | |
613 | - /** request url */ | |
614 | - request.url = url; | |
615 | - return request; | |
616 | -})(); | |
617 | - | |
618 | 583 | /** @description request parameter type for postOfficialWebsiteUploadAliOss */ |
619 | 584 | export interface PostOfficialWebsiteUploadAliOssOption { |
620 | 585 | /** |
... | ... | @@ -8127,6 +8092,77 @@ export const postServiceOrderUpdateAnnex = /* #__PURE__ */ (() => { |
8127 | 8092 | return request; |
8128 | 8093 | })(); |
8129 | 8094 | |
8095 | +/** @description request parameter type for postServiceOrderUpdateHirePurchase */ | |
8096 | +export interface PostServiceOrderUpdateHirePurchaseOption { | |
8097 | + /** | |
8098 | + * @description | |
8099 | + * dto | |
8100 | + */ | |
8101 | + body: { | |
8102 | + /** | |
8103 | + @description | |
8104 | + dto */ | |
8105 | + dto: Dto; | |
8106 | + }; | |
8107 | +} | |
8108 | + | |
8109 | +/** @description response type for postServiceOrderUpdateHirePurchase */ | |
8110 | +export interface PostServiceOrderUpdateHirePurchaseResponse { | |
8111 | + /** | |
8112 | + * @description | |
8113 | + * OK | |
8114 | + */ | |
8115 | + 200: ServerResult; | |
8116 | + /** | |
8117 | + * @description | |
8118 | + * Created | |
8119 | + */ | |
8120 | + 201: any; | |
8121 | + /** | |
8122 | + * @description | |
8123 | + * Unauthorized | |
8124 | + */ | |
8125 | + 401: any; | |
8126 | + /** | |
8127 | + * @description | |
8128 | + * Forbidden | |
8129 | + */ | |
8130 | + 403: any; | |
8131 | + /** | |
8132 | + * @description | |
8133 | + * Not Found | |
8134 | + */ | |
8135 | + 404: any; | |
8136 | +} | |
8137 | + | |
8138 | +export type PostServiceOrderUpdateHirePurchaseResponseSuccess = | |
8139 | + PostServiceOrderUpdateHirePurchaseResponse[200]; | |
8140 | +/** | |
8141 | + * @description | |
8142 | + * 修改分期付款信息 | |
8143 | + * @tags 内部订单 | |
8144 | + * @produces * | |
8145 | + * @consumes application/json | |
8146 | + */ | |
8147 | +export const postServiceOrderUpdateHirePurchase = /* #__PURE__ */ (() => { | |
8148 | + const method = 'post'; | |
8149 | + const url = '/service/order/updateHirePurchase'; | |
8150 | + function request( | |
8151 | + option: PostServiceOrderUpdateHirePurchaseOption, | |
8152 | + ): Promise<PostServiceOrderUpdateHirePurchaseResponseSuccess> { | |
8153 | + return requester(request.url, { | |
8154 | + method: request.method, | |
8155 | + ...option, | |
8156 | + }) as unknown as Promise<PostServiceOrderUpdateHirePurchaseResponseSuccess>; | |
8157 | + } | |
8158 | + | |
8159 | + /** http method */ | |
8160 | + request.method = method; | |
8161 | + /** request url */ | |
8162 | + request.url = url; | |
8163 | + return request; | |
8164 | +})(); | |
8165 | + | |
8130 | 8166 | /** @description request parameter type for postServiceOrderUpdateOrder */ |
8131 | 8167 | export interface PostServiceOrderUpdateOrderOption { |
8132 | 8168 | /** | ... | ... |