Commit 695fadcaee47a8daf40bacbcb0d4d8648b3ec6f0

Authored by zhongnanhuang
1 parent 98b84d37

feat: update 销售收款记录编辑功能

src/pages/Order/components/FinancialReceiptsModal.tsx
  1 +import { postServiceOrderUpdateHirePurchase } from '@/services';
1 import { 2 import {
2 EditableProTable, 3 EditableProTable,
3 ModalForm, 4 ModalForm,
@@ -8,65 +9,70 @@ import { Form } from 'antd'; @@ -8,65 +9,70 @@ import { Form } from 'antd';
8 import { useState } from 'react'; 9 import { useState } from 'react';
9 10
10 // import { cloneDeep } from 'lodash'; 11 // import { cloneDeep } from 'lodash';
11 -export default ({ setVisible, onClose }) => { 12 +export default ({ setVisible, datas, onClose }) => {
12 const [form] = Form.useForm<{ name: string; company: string }>(); 13 const [form] = Form.useForm<{ name: string; company: string }>();
13 type DataSourceType = { 14 type DataSourceType = {
14 id: React.Key; 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 notes?: string; 20 notes?: string;
19 }; 21 };
20 const defaultData: DataSourceType[] = [ 22 const defaultData: DataSourceType[] = [
21 { 23 {
22 id: 1, 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 id: 2, 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 id: 3, 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 id: 4, 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 const [editableKeys, setEditableRowKeys] = useState<React.Key[]>(() => 56 const [editableKeys, setEditableRowKeys] = useState<React.Key[]>(() =>
51 // defaultData.map((item) => item.id), 57 // defaultData.map((item) => item.id),
52 - [3, 4], 58 + [1, 2, 3, 4],
53 ); 59 );
54 const columns: ProColumns<DataSourceType>[] = [ 60 const columns: ProColumns<DataSourceType>[] = [
55 { 61 {
56 title: '款项', 62 title: '款项',
57 - dataIndex: 'receiptsType', 63 + dataIndex: 'hirePurchaseMethodName',
58 editable: false, 64 editable: false,
59 width: '10%', 65 width: '10%',
60 }, 66 },
61 { 67 {
62 title: '已收金额', 68 title: '已收金额',
63 - dataIndex: 'receiptsPrice', 69 + dataIndex: 'money',
64 valueType: 'digit', 70 valueType: 'digit',
65 width: '15%', 71 width: '15%',
66 }, 72 },
67 { 73 {
68 title: '收款时间', 74 title: '收款时间',
69 - dataIndex: 'receiptsTime', 75 + dataIndex: 'updateTime',
70 valueType: 'dateTime', 76 valueType: 'dateTime',
71 width: '25%', 77 width: '25%',
72 }, 78 },
@@ -95,7 +101,13 @@ export default ({ setVisible, onClose }) =&gt; { @@ -95,7 +101,13 @@ export default ({ setVisible, onClose }) =&gt; {
95 }, 101 },
96 }} 102 }}
97 onFinish={async (values) => { 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 onClose(); 111 onClose();
100 }} 112 }}
101 onOpenChange={setVisible} 113 onOpenChange={setVisible}
src/pages/Order/constant.ts
@@ -9,6 +9,13 @@ export const PAYMENT_CHANNEL_OPTIONS = { @@ -9,6 +9,13 @@ export const PAYMENT_CHANNEL_OPTIONS = {
9 BANK_TRANSFER: '银行转账', 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 export const PAYMENT_METHOD_OPTIONS = { 19 export const PAYMENT_METHOD_OPTIONS = {
13 UNPAID: '未付款', 20 UNPAID: '未付款',
14 TAOBAO_ORDER_HAS_BEEN_PAID: '淘宝订单已付款', 21 TAOBAO_ORDER_HAS_BEEN_PAID: '淘宝订单已付款',
@@ -16,6 +23,7 @@ export const PAYMENT_METHOD_OPTIONS = { @@ -16,6 +23,7 @@ export const PAYMENT_METHOD_OPTIONS = {
16 WITHHOLDING_ADVANCE_DEPOSIT: '扣预存', 23 WITHHOLDING_ADVANCE_DEPOSIT: '扣预存',
17 PLATFORM_SETTLEMENT: '平台结算', 24 PLATFORM_SETTLEMENT: '平台结算',
18 CASH_ON_DELIVERY: '货到付款', 25 CASH_ON_DELIVERY: '货到付款',
  26 + HIRE_PURCHASE: '分期付款',
19 }; 27 };
20 28
21 export const PRODUCT_BELONG_DEPARTMENT_OPTIONS = { 29 export const PRODUCT_BELONG_DEPARTMENT_OPTIONS = {
src/pages/Order/index.tsx
@@ -898,23 +898,6 @@ const OrderPage = () =&gt; { @@ -898,23 +898,6 @@ const OrderPage = () =&gt; {
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 {optRecord.subPath?.includes('invoicing') ? ( 901 {optRecord.subPath?.includes('invoicing') ? (
919 <Button 902 <Button
920 className="p-0" 903 className="p-0"
@@ -1419,6 +1402,22 @@ const OrderPage = () =&gt; { @@ -1419,6 +1402,22 @@ const OrderPage = () =&gt; {
1419 <Flex justify="flex-end"> 1402 <Flex justify="flex-end">
1420 <Space.Compact direction="vertical" align="end"> 1403 <Space.Compact direction="vertical" align="end">
1421 <Space> 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 {record.mainPath?.includes('procureConvertProcure') ? ( 1421 {record.mainPath?.includes('procureConvertProcure') ? (
1423 <Button 1422 <Button
1424 className="p-0" 1423 className="p-0"
@@ -2696,6 +2695,7 @@ const OrderPage = () =&gt; { @@ -2696,6 +2695,7 @@ const OrderPage = () =&gt; {
2696 {financialReceiptsModalVisible && ( 2695 {financialReceiptsModalVisible && (
2697 <FinancialReceiptsModal 2696 <FinancialReceiptsModal
2698 setVisible={setFinancialReceiptsModalVisible} 2697 setVisible={setFinancialReceiptsModalVisible}
  2698 + datas={selectedRows}
2699 onClose={() => { 2699 onClose={() => {
2700 setFinancialReceiptsModalVisible(false); 2700 setFinancialReceiptsModalVisible(false);
2701 setSelectedRows({}); 2701 setSelectedRows({});
src/services/definition.ts
@@ -891,6 +891,30 @@ export interface SysLogQueryVO { @@ -891,6 +891,30 @@ export interface SysLogQueryVO {
891 username?: string; 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 export interface UpdatePwdVO { 918 export interface UpdatePwdVO {
895 confirmPassword?: string; 919 confirmPassword?: string;
896 password?: string; 920 password?: string;
src/services/request.ts
@@ -26,7 +26,6 @@ import type { @@ -26,7 +26,6 @@ import type {
26 DictionaryQueryVO, 26 DictionaryQueryVO,
27 DictionaryVO, 27 DictionaryVO,
28 Dto, 28 Dto,
29 - ModelAndView,  
30 OrderAddVO, 29 OrderAddVO,
31 OrderAuditLogQueryVO, 30 OrderAuditLogQueryVO,
32 OrderBaseInfoQueryVO, 31 OrderBaseInfoQueryVO,
@@ -229,7 +228,9 @@ export interface GetErrorResponse { @@ -229,7 +228,9 @@ export interface GetErrorResponse {
229 * @description 228 * @description
230 * OK 229 * OK
231 */ 230 */
232 - 200: ModelAndView; 231 + 200: {
  232 + [propertyName: string]: any;
  233 + };
233 /** 234 /**
234 * @description 235 * @description
235 * Unauthorized 236 * Unauthorized
@@ -250,9 +251,9 @@ export interface GetErrorResponse { @@ -250,9 +251,9 @@ export interface GetErrorResponse {
250 export type GetErrorResponseSuccess = GetErrorResponse[200]; 251 export type GetErrorResponseSuccess = GetErrorResponse[200];
251 /** 252 /**
252 * @description 253 * @description
253 - * errorHtml 254 + * error
254 * @tags basic-error-controller 255 * @tags basic-error-controller
255 - * @produces text/html 256 + * @produces *
256 */ 257 */
257 export const getError = /* #__PURE__ */ (() => { 258 export const getError = /* #__PURE__ */ (() => {
258 const method = 'get'; 259 const method = 'get';
@@ -276,7 +277,9 @@ export interface PutErrorResponse { @@ -276,7 +277,9 @@ export interface PutErrorResponse {
276 * @description 277 * @description
277 * OK 278 * OK
278 */ 279 */
279 - 200: ModelAndView; 280 + 200: {
  281 + [propertyName: string]: any;
  282 + };
280 /** 283 /**
281 * @description 284 * @description
282 * Created 285 * Created
@@ -302,9 +305,9 @@ export interface PutErrorResponse { @@ -302,9 +305,9 @@ export interface PutErrorResponse {
302 export type PutErrorResponseSuccess = PutErrorResponse[200]; 305 export type PutErrorResponseSuccess = PutErrorResponse[200];
303 /** 306 /**
304 * @description 307 * @description
305 - * errorHtml 308 + * error
306 * @tags basic-error-controller 309 * @tags basic-error-controller
307 - * @produces text/html 310 + * @produces *
308 * @consumes application/json 311 * @consumes application/json
309 */ 312 */
310 export const putError = /* #__PURE__ */ (() => { 313 export const putError = /* #__PURE__ */ (() => {
@@ -329,7 +332,9 @@ export interface PostErrorResponse { @@ -329,7 +332,9 @@ export interface PostErrorResponse {
329 * @description 332 * @description
330 * OK 333 * OK
331 */ 334 */
332 - 200: ModelAndView; 335 + 200: {
  336 + [propertyName: string]: any;
  337 + };
333 /** 338 /**
334 * @description 339 * @description
335 * Created 340 * Created
@@ -355,9 +360,9 @@ export interface PostErrorResponse { @@ -355,9 +360,9 @@ export interface PostErrorResponse {
355 export type PostErrorResponseSuccess = PostErrorResponse[200]; 360 export type PostErrorResponseSuccess = PostErrorResponse[200];
356 /** 361 /**
357 * @description 362 * @description
358 - * errorHtml 363 + * error
359 * @tags basic-error-controller 364 * @tags basic-error-controller
360 - * @produces text/html 365 + * @produces *
361 * @consumes application/json 366 * @consumes application/json
362 */ 367 */
363 export const postError = /* #__PURE__ */ (() => { 368 export const postError = /* #__PURE__ */ (() => {
@@ -382,7 +387,9 @@ export interface DeleteErrorResponse { @@ -382,7 +387,9 @@ export interface DeleteErrorResponse {
382 * @description 387 * @description
383 * OK 388 * OK
384 */ 389 */
385 - 200: ModelAndView; 390 + 200: {
  391 + [propertyName: string]: any;
  392 + };
386 /** 393 /**
387 * @description 394 * @description
388 * No Content 395 * No Content
@@ -403,9 +410,9 @@ export interface DeleteErrorResponse { @@ -403,9 +410,9 @@ export interface DeleteErrorResponse {
403 export type DeleteErrorResponseSuccess = DeleteErrorResponse[200]; 410 export type DeleteErrorResponseSuccess = DeleteErrorResponse[200];
404 /** 411 /**
405 * @description 412 * @description
406 - * errorHtml 413 + * error
407 * @tags basic-error-controller 414 * @tags basic-error-controller
408 - * @produces text/html 415 + * @produces *
409 */ 416 */
410 export const deleteError = /* #__PURE__ */ (() => { 417 export const deleteError = /* #__PURE__ */ (() => {
411 const method = 'delete'; 418 const method = 'delete';
@@ -429,7 +436,9 @@ export interface OptionsErrorResponse { @@ -429,7 +436,9 @@ export interface OptionsErrorResponse {
429 * @description 436 * @description
430 * OK 437 * OK
431 */ 438 */
432 - 200: ModelAndView; 439 + 200: {
  440 + [propertyName: string]: any;
  441 + };
433 /** 442 /**
434 * @description 443 * @description
435 * No Content 444 * No Content
@@ -450,9 +459,9 @@ export interface OptionsErrorResponse { @@ -450,9 +459,9 @@ export interface OptionsErrorResponse {
450 export type OptionsErrorResponseSuccess = OptionsErrorResponse[200]; 459 export type OptionsErrorResponseSuccess = OptionsErrorResponse[200];
451 /** 460 /**
452 * @description 461 * @description
453 - * errorHtml 462 + * error
454 * @tags basic-error-controller 463 * @tags basic-error-controller
455 - * @produces text/html 464 + * @produces *
456 * @consumes application/json 465 * @consumes application/json
457 */ 466 */
458 export const optionsError = /* #__PURE__ */ (() => { 467 export const optionsError = /* #__PURE__ */ (() => {
@@ -477,7 +486,9 @@ export interface HeadErrorResponse { @@ -477,7 +486,9 @@ export interface HeadErrorResponse {
477 * @description 486 * @description
478 * OK 487 * OK
479 */ 488 */
480 - 200: ModelAndView; 489 + 200: {
  490 + [propertyName: string]: any;
  491 + };
481 /** 492 /**
482 * @description 493 * @description
483 * No Content 494 * No Content
@@ -498,9 +509,9 @@ export interface HeadErrorResponse { @@ -498,9 +509,9 @@ export interface HeadErrorResponse {
498 export type HeadErrorResponseSuccess = HeadErrorResponse[200]; 509 export type HeadErrorResponseSuccess = HeadErrorResponse[200];
499 /** 510 /**
500 * @description 511 * @description
501 - * errorHtml 512 + * error
502 * @tags basic-error-controller 513 * @tags basic-error-controller
503 - * @produces text/html 514 + * @produces *
504 * @consumes application/json 515 * @consumes application/json
505 */ 516 */
506 export const headError = /* #__PURE__ */ (() => { 517 export const headError = /* #__PURE__ */ (() => {
@@ -525,7 +536,9 @@ export interface PatchErrorResponse { @@ -525,7 +536,9 @@ export interface PatchErrorResponse {
525 * @description 536 * @description
526 * OK 537 * OK
527 */ 538 */
528 - 200: ModelAndView; 539 + 200: {
  540 + [propertyName: string]: any;
  541 + };
529 /** 542 /**
530 * @description 543 * @description
531 * No Content 544 * No Content
@@ -546,9 +559,9 @@ export interface PatchErrorResponse { @@ -546,9 +559,9 @@ export interface PatchErrorResponse {
546 export type PatchErrorResponseSuccess = PatchErrorResponse[200]; 559 export type PatchErrorResponseSuccess = PatchErrorResponse[200];
547 /** 560 /**
548 * @description 561 * @description
549 - * errorHtml 562 + * error
550 * @tags basic-error-controller 563 * @tags basic-error-controller
551 - * @produces text/html 564 + * @produces *
552 * @consumes application/json 565 * @consumes application/json
553 */ 566 */
554 export const patchError = /* #__PURE__ */ (() => { 567 export const patchError = /* #__PURE__ */ (() => {
@@ -567,54 +580,6 @@ export const patchError = /* #__PURE__ */ (() =&gt; { @@ -567,54 +580,6 @@ export const patchError = /* #__PURE__ */ (() =&gt; {
567 return request; 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 /** @description request parameter type for postOfficialWebsiteUploadAliOss */ 583 /** @description request parameter type for postOfficialWebsiteUploadAliOss */
619 export interface PostOfficialWebsiteUploadAliOssOption { 584 export interface PostOfficialWebsiteUploadAliOssOption {
620 /** 585 /**
@@ -8127,6 +8092,77 @@ export const postServiceOrderUpdateAnnex = /* #__PURE__ */ (() =&gt; { @@ -8127,6 +8092,77 @@ export const postServiceOrderUpdateAnnex = /* #__PURE__ */ (() =&gt; {
8127 return request; 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 /** @description request parameter type for postServiceOrderUpdateOrder */ 8166 /** @description request parameter type for postServiceOrderUpdateOrder */
8131 export interface PostServiceOrderUpdateOrderOption { 8167 export interface PostServiceOrderUpdateOrderOption {
8132 /** 8168 /**