Commit c6137ba470d1d91efd91549d1e21a8b0b0bc37b1
1 parent
60aa1cb0
feat: update 收货人选项清除后报错修复
Showing
4 changed files
with
437 additions
and
5 deletions
src/pages/Order/components/OrderDrawer.tsx
@@ -498,13 +498,16 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | @@ -498,13 +498,16 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | ||
498 | * @param option 收货人信息 | 498 | * @param option 收货人信息 |
499 | */ | 499 | */ |
500 | async function autoFillCustomerInfo(option: any) { | 500 | async function autoFillCustomerInfo(option: any) { |
501 | - if (option.type === 'add') { | 501 | + if (option === undefined || option === null || option.type === 'add') { |
502 | form.setFieldValue('customerShippingAddress', undefined); | 502 | form.setFieldValue('customerShippingAddress', undefined); |
503 | form.setFieldValue('customerContactNumber', undefined); | 503 | form.setFieldValue('customerContactNumber', undefined); |
504 | form.setFieldValue('institution', undefined); | 504 | form.setFieldValue('institution', undefined); |
505 | form.setFieldValue('institutionContactName', undefined); | 505 | form.setFieldValue('institutionContactName', undefined); |
506 | form.setFieldValue('customerShippingAddress', undefined); | 506 | form.setFieldValue('customerShippingAddress', undefined); |
507 | - form.setFieldValue('customerNameString', option.name); | 507 | + |
508 | + if (option !== undefined && option !== null) { | ||
509 | + form.setFieldValue('customerNameString', option.name); | ||
510 | + } | ||
508 | } else { | 511 | } else { |
509 | form.setFieldValue('customerShippingAddress', option.fullAddress); | 512 | form.setFieldValue('customerShippingAddress', option.fullAddress); |
510 | form.setFieldValue('customerContactNumber', option.phone); | 513 | form.setFieldValue('customerContactNumber', option.phone); |
@@ -1073,7 +1076,21 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | @@ -1073,7 +1076,21 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | ||
1073 | width="lg" | 1076 | width="lg" |
1074 | key="totalPayment" | 1077 | key="totalPayment" |
1075 | label="支付总额(¥)" | 1078 | label="支付总额(¥)" |
1076 | - rules={[{ required: true, message: '支付总额必填' }]} | 1079 | + rules={[ |
1080 | + { required: true, message: '支付总额必填' }, | ||
1081 | + { | ||
1082 | + validator: (_, value) => { | ||
1083 | + if (value <= 0) { | ||
1084 | + return Promise.reject( | ||
1085 | + new Error( | ||
1086 | + '支付总额必须大于0 (扣预存的订单现在也必须填写实际金额)', | ||
1087 | + ), | ||
1088 | + ); | ||
1089 | + } | ||
1090 | + return Promise.resolve(); | ||
1091 | + }, | ||
1092 | + }, | ||
1093 | + ]} | ||
1077 | tooltip="点击计算,合计所有子订单金额" | 1094 | tooltip="点击计算,合计所有子订单金额" |
1078 | fieldProps={{ | 1095 | fieldProps={{ |
1079 | addonAfter: ( | 1096 | addonAfter: ( |
src/pages/Order/constant.ts
@@ -8,6 +8,7 @@ export const PAYMENT_CHANNEL_OPTIONS = { | @@ -8,6 +8,7 @@ export const PAYMENT_CHANNEL_OPTIONS = { | ||
8 | WECHAT: '微信', | 8 | WECHAT: '微信', |
9 | BANK_TRANSFER: '银行转账', | 9 | BANK_TRANSFER: '银行转账', |
10 | BALANCE: '预存款', | 10 | BALANCE: '预存款', |
11 | + OFFLINE: '线下付款', | ||
11 | }; | 12 | }; |
12 | 13 | ||
13 | export const RECEIPTS_RECORD_TYPES = { | 14 | export const RECEIPTS_RECORD_TYPES = { |
src/services/definition.ts
@@ -1478,13 +1478,13 @@ export interface QueryBankStatementDto { | @@ -1478,13 +1478,13 @@ export interface QueryBankStatementDto { | ||
1478 | * collection_date | 1478 | * collection_date |
1479 | * @format date | 1479 | * @format date |
1480 | */ | 1480 | */ |
1481 | - collectionDatetimeBegin?: string; | 1481 | + collectionDateBegin?: string; |
1482 | /** | 1482 | /** |
1483 | * @description | 1483 | * @description |
1484 | * collection_date | 1484 | * collection_date |
1485 | * @format date | 1485 | * @format date |
1486 | */ | 1486 | */ |
1487 | - collectionDatetimeEnd?: string; | 1487 | + collectionDateEnd?: string; |
1488 | /** @format int32 */ | 1488 | /** @format int32 */ |
1489 | current?: number; | 1489 | current?: number; |
1490 | /** @format int64 */ | 1490 | /** @format int64 */ |
src/services/request.ts
@@ -24,6 +24,9 @@ import type { | @@ -24,6 +24,9 @@ import type { | ||
24 | ApiApplyAddressModifyRequest, | 24 | ApiApplyAddressModifyRequest, |
25 | ApiApplyAfterSalesRequest, | 25 | ApiApplyAfterSalesRequest, |
26 | ApiCreateOrderRequest, | 26 | ApiCreateOrderRequest, |
27 | + ApiOrderConfirmReceiveRequest, | ||
28 | + ApiOrderCustomersRequest, | ||
29 | + ApiOrderEvaluatedRequest, | ||
27 | ApiQueryOrderDetailRequest, | 30 | ApiQueryOrderDetailRequest, |
28 | ApiQueryOrderStatusCountsRequest, | 31 | ApiQueryOrderStatusCountsRequest, |
29 | AuditDto, | 32 | AuditDto, |
@@ -91,6 +94,8 @@ import type { | @@ -91,6 +94,8 @@ import type { | ||
91 | UpdateHirePurchaseDto, | 94 | UpdateHirePurchaseDto, |
92 | UpdatePwdVO, | 95 | UpdatePwdVO, |
93 | UploadPaymentReceiptDTO, | 96 | UploadPaymentReceiptDTO, |
97 | + UserAddressListRequest, | ||
98 | + UserCenterInfoRequest, | ||
94 | UserDetailRequest, | 99 | UserDetailRequest, |
95 | UserListRequest, | 100 | UserListRequest, |
96 | } from './definition'; | 101 | } from './definition'; |
@@ -407,6 +412,77 @@ export const postApiOrderApplyAfterSales = /* #__PURE__ */ (() => { | @@ -407,6 +412,77 @@ export const postApiOrderApplyAfterSales = /* #__PURE__ */ (() => { | ||
407 | return request; | 412 | return request; |
408 | })(); | 413 | })(); |
409 | 414 | ||
415 | +/** @description request parameter type for postApiOrderConfirmReceive */ | ||
416 | +export interface PostApiOrderConfirmReceiveOption { | ||
417 | + /** | ||
418 | + * @description | ||
419 | + * request | ||
420 | + */ | ||
421 | + body: { | ||
422 | + /** | ||
423 | + @description | ||
424 | + request */ | ||
425 | + request: ApiOrderConfirmReceiveRequest; | ||
426 | + }; | ||
427 | +} | ||
428 | + | ||
429 | +/** @description response type for postApiOrderConfirmReceive */ | ||
430 | +export interface PostApiOrderConfirmReceiveResponse { | ||
431 | + /** | ||
432 | + * @description | ||
433 | + * OK | ||
434 | + */ | ||
435 | + 200: ServerResult; | ||
436 | + /** | ||
437 | + * @description | ||
438 | + * Created | ||
439 | + */ | ||
440 | + 201: any; | ||
441 | + /** | ||
442 | + * @description | ||
443 | + * Unauthorized | ||
444 | + */ | ||
445 | + 401: any; | ||
446 | + /** | ||
447 | + * @description | ||
448 | + * Forbidden | ||
449 | + */ | ||
450 | + 403: any; | ||
451 | + /** | ||
452 | + * @description | ||
453 | + * Not Found | ||
454 | + */ | ||
455 | + 404: any; | ||
456 | +} | ||
457 | + | ||
458 | +export type PostApiOrderConfirmReceiveResponseSuccess = | ||
459 | + PostApiOrderConfirmReceiveResponse[200]; | ||
460 | +/** | ||
461 | + * @description | ||
462 | + * 确认收货 | ||
463 | + * @tags 内部订单 | ||
464 | + * @produces * | ||
465 | + * @consumes application/json | ||
466 | + */ | ||
467 | +export const postApiOrderConfirmReceive = /* #__PURE__ */ (() => { | ||
468 | + const method = 'post'; | ||
469 | + const url = '/api/order/confirmReceive'; | ||
470 | + function request( | ||
471 | + option: PostApiOrderConfirmReceiveOption, | ||
472 | + ): Promise<PostApiOrderConfirmReceiveResponseSuccess> { | ||
473 | + return requester(request.url, { | ||
474 | + method: request.method, | ||
475 | + ...option, | ||
476 | + }) as unknown as Promise<PostApiOrderConfirmReceiveResponseSuccess>; | ||
477 | + } | ||
478 | + | ||
479 | + /** http method */ | ||
480 | + request.method = method; | ||
481 | + /** request url */ | ||
482 | + request.url = url; | ||
483 | + return request; | ||
484 | +})(); | ||
485 | + | ||
410 | /** @description request parameter type for postApiOrderCreateOrder */ | 486 | /** @description request parameter type for postApiOrderCreateOrder */ |
411 | export interface PostApiOrderCreateOrderOption { | 487 | export interface PostApiOrderCreateOrderOption { |
412 | /** | 488 | /** |
@@ -478,6 +554,148 @@ export const postApiOrderCreateOrder = /* #__PURE__ */ (() => { | @@ -478,6 +554,148 @@ export const postApiOrderCreateOrder = /* #__PURE__ */ (() => { | ||
478 | return request; | 554 | return request; |
479 | })(); | 555 | })(); |
480 | 556 | ||
557 | +/** @description request parameter type for postApiOrderCustomers */ | ||
558 | +export interface PostApiOrderCustomersOption { | ||
559 | + /** | ||
560 | + * @description | ||
561 | + * request | ||
562 | + */ | ||
563 | + body: { | ||
564 | + /** | ||
565 | + @description | ||
566 | + request */ | ||
567 | + request: ApiOrderCustomersRequest; | ||
568 | + }; | ||
569 | +} | ||
570 | + | ||
571 | +/** @description response type for postApiOrderCustomers */ | ||
572 | +export interface PostApiOrderCustomersResponse { | ||
573 | + /** | ||
574 | + * @description | ||
575 | + * OK | ||
576 | + */ | ||
577 | + 200: ServerResult; | ||
578 | + /** | ||
579 | + * @description | ||
580 | + * Created | ||
581 | + */ | ||
582 | + 201: any; | ||
583 | + /** | ||
584 | + * @description | ||
585 | + * Unauthorized | ||
586 | + */ | ||
587 | + 401: any; | ||
588 | + /** | ||
589 | + * @description | ||
590 | + * Forbidden | ||
591 | + */ | ||
592 | + 403: any; | ||
593 | + /** | ||
594 | + * @description | ||
595 | + * Not Found | ||
596 | + */ | ||
597 | + 404: any; | ||
598 | +} | ||
599 | + | ||
600 | +export type PostApiOrderCustomersResponseSuccess = | ||
601 | + PostApiOrderCustomersResponse[200]; | ||
602 | +/** | ||
603 | + * @description | ||
604 | + * 查询订单客户信息 | ||
605 | + * @tags 内部订单 | ||
606 | + * @produces * | ||
607 | + * @consumes application/json | ||
608 | + */ | ||
609 | +export const postApiOrderCustomers = /* #__PURE__ */ (() => { | ||
610 | + const method = 'post'; | ||
611 | + const url = '/api/order/customers'; | ||
612 | + function request( | ||
613 | + option: PostApiOrderCustomersOption, | ||
614 | + ): Promise<PostApiOrderCustomersResponseSuccess> { | ||
615 | + return requester(request.url, { | ||
616 | + method: request.method, | ||
617 | + ...option, | ||
618 | + }) as unknown as Promise<PostApiOrderCustomersResponseSuccess>; | ||
619 | + } | ||
620 | + | ||
621 | + /** http method */ | ||
622 | + request.method = method; | ||
623 | + /** request url */ | ||
624 | + request.url = url; | ||
625 | + return request; | ||
626 | +})(); | ||
627 | + | ||
628 | +/** @description request parameter type for postApiOrderEvaluated */ | ||
629 | +export interface PostApiOrderEvaluatedOption { | ||
630 | + /** | ||
631 | + * @description | ||
632 | + * request | ||
633 | + */ | ||
634 | + body: { | ||
635 | + /** | ||
636 | + @description | ||
637 | + request */ | ||
638 | + request: ApiOrderEvaluatedRequest; | ||
639 | + }; | ||
640 | +} | ||
641 | + | ||
642 | +/** @description response type for postApiOrderEvaluated */ | ||
643 | +export interface PostApiOrderEvaluatedResponse { | ||
644 | + /** | ||
645 | + * @description | ||
646 | + * OK | ||
647 | + */ | ||
648 | + 200: ServerResult; | ||
649 | + /** | ||
650 | + * @description | ||
651 | + * Created | ||
652 | + */ | ||
653 | + 201: any; | ||
654 | + /** | ||
655 | + * @description | ||
656 | + * Unauthorized | ||
657 | + */ | ||
658 | + 401: any; | ||
659 | + /** | ||
660 | + * @description | ||
661 | + * Forbidden | ||
662 | + */ | ||
663 | + 403: any; | ||
664 | + /** | ||
665 | + * @description | ||
666 | + * Not Found | ||
667 | + */ | ||
668 | + 404: any; | ||
669 | +} | ||
670 | + | ||
671 | +export type PostApiOrderEvaluatedResponseSuccess = | ||
672 | + PostApiOrderEvaluatedResponse[200]; | ||
673 | +/** | ||
674 | + * @description | ||
675 | + * 评价子订单 | ||
676 | + * @tags 内部订单 | ||
677 | + * @produces * | ||
678 | + * @consumes application/json | ||
679 | + */ | ||
680 | +export const postApiOrderEvaluated = /* #__PURE__ */ (() => { | ||
681 | + const method = 'post'; | ||
682 | + const url = '/api/order/evaluated'; | ||
683 | + function request( | ||
684 | + option: PostApiOrderEvaluatedOption, | ||
685 | + ): Promise<PostApiOrderEvaluatedResponseSuccess> { | ||
686 | + return requester(request.url, { | ||
687 | + method: request.method, | ||
688 | + ...option, | ||
689 | + }) as unknown as Promise<PostApiOrderEvaluatedResponseSuccess>; | ||
690 | + } | ||
691 | + | ||
692 | + /** http method */ | ||
693 | + request.method = method; | ||
694 | + /** request url */ | ||
695 | + request.url = url; | ||
696 | + return request; | ||
697 | +})(); | ||
698 | + | ||
481 | /** @description request parameter type for postApiOrderInvoicedOrderList */ | 699 | /** @description request parameter type for postApiOrderInvoicedOrderList */ |
482 | export interface PostApiOrderInvoicedOrderListOption { | 700 | export interface PostApiOrderInvoicedOrderListOption { |
483 | /** | 701 | /** |
@@ -620,6 +838,60 @@ export const postApiOrderInvoicedRecordList = /* #__PURE__ */ (() => { | @@ -620,6 +838,60 @@ export const postApiOrderInvoicedRecordList = /* #__PURE__ */ (() => { | ||
620 | return request; | 838 | return request; |
621 | })(); | 839 | })(); |
622 | 840 | ||
841 | +/** @description response type for postApiOrderListAllSubOrderBaseInfo */ | ||
842 | +export interface PostApiOrderListAllSubOrderBaseInfoResponse { | ||
843 | + /** | ||
844 | + * @description | ||
845 | + * OK | ||
846 | + */ | ||
847 | + 200: ServerResult; | ||
848 | + /** | ||
849 | + * @description | ||
850 | + * Created | ||
851 | + */ | ||
852 | + 201: any; | ||
853 | + /** | ||
854 | + * @description | ||
855 | + * Unauthorized | ||
856 | + */ | ||
857 | + 401: any; | ||
858 | + /** | ||
859 | + * @description | ||
860 | + * Forbidden | ||
861 | + */ | ||
862 | + 403: any; | ||
863 | + /** | ||
864 | + * @description | ||
865 | + * Not Found | ||
866 | + */ | ||
867 | + 404: any; | ||
868 | +} | ||
869 | + | ||
870 | +export type PostApiOrderListAllSubOrderBaseInfoResponseSuccess = | ||
871 | + PostApiOrderListAllSubOrderBaseInfoResponse[200]; | ||
872 | +/** | ||
873 | + * @description | ||
874 | + * 查询所有子订单基本信息 | ||
875 | + * @tags 内部订单 | ||
876 | + * @produces * | ||
877 | + * @consumes application/json | ||
878 | + */ | ||
879 | +export const postApiOrderListAllSubOrderBaseInfo = /* #__PURE__ */ (() => { | ||
880 | + const method = 'post'; | ||
881 | + const url = '/api/order/listAllSubOrderBaseInfo'; | ||
882 | + function request(): Promise<PostApiOrderListAllSubOrderBaseInfoResponseSuccess> { | ||
883 | + return requester(request.url, { | ||
884 | + method: request.method, | ||
885 | + }) as unknown as Promise<PostApiOrderListAllSubOrderBaseInfoResponseSuccess>; | ||
886 | + } | ||
887 | + | ||
888 | + /** http method */ | ||
889 | + request.method = method; | ||
890 | + /** request url */ | ||
891 | + request.url = url; | ||
892 | + return request; | ||
893 | +})(); | ||
894 | + | ||
623 | /** @description request parameter type for postApiOrderQueryOrderDetail */ | 895 | /** @description request parameter type for postApiOrderQueryOrderDetail */ |
624 | export interface PostApiOrderQueryOrderDetailOption { | 896 | export interface PostApiOrderQueryOrderDetailOption { |
625 | /** | 897 | /** |
@@ -975,6 +1247,148 @@ export const postApiOrderWaitInvoiceOrderList = /* #__PURE__ */ (() => { | @@ -975,6 +1247,148 @@ export const postApiOrderWaitInvoiceOrderList = /* #__PURE__ */ (() => { | ||
975 | return request; | 1247 | return request; |
976 | })(); | 1248 | })(); |
977 | 1249 | ||
1250 | +/** @description request parameter type for postCanrdApiUserAddressList */ | ||
1251 | +export interface PostCanrdApiUserAddressListOption { | ||
1252 | + /** | ||
1253 | + * @description | ||
1254 | + * request | ||
1255 | + */ | ||
1256 | + body: { | ||
1257 | + /** | ||
1258 | + @description | ||
1259 | + request */ | ||
1260 | + request: UserAddressListRequest; | ||
1261 | + }; | ||
1262 | +} | ||
1263 | + | ||
1264 | +/** @description response type for postCanrdApiUserAddressList */ | ||
1265 | +export interface PostCanrdApiUserAddressListResponse { | ||
1266 | + /** | ||
1267 | + * @description | ||
1268 | + * OK | ||
1269 | + */ | ||
1270 | + 200: ServerResult; | ||
1271 | + /** | ||
1272 | + * @description | ||
1273 | + * Created | ||
1274 | + */ | ||
1275 | + 201: any; | ||
1276 | + /** | ||
1277 | + * @description | ||
1278 | + * Unauthorized | ||
1279 | + */ | ||
1280 | + 401: any; | ||
1281 | + /** | ||
1282 | + * @description | ||
1283 | + * Forbidden | ||
1284 | + */ | ||
1285 | + 403: any; | ||
1286 | + /** | ||
1287 | + * @description | ||
1288 | + * Not Found | ||
1289 | + */ | ||
1290 | + 404: any; | ||
1291 | +} | ||
1292 | + | ||
1293 | +export type PostCanrdApiUserAddressListResponseSuccess = | ||
1294 | + PostCanrdApiUserAddressListResponse[200]; | ||
1295 | +/** | ||
1296 | + * @description | ||
1297 | + * 查询地址信息 | ||
1298 | + * @tags canrd-mobile-api-controller | ||
1299 | + * @produces * | ||
1300 | + * @consumes application/json | ||
1301 | + */ | ||
1302 | +export const postCanrdApiUserAddressList = /* #__PURE__ */ (() => { | ||
1303 | + const method = 'post'; | ||
1304 | + const url = '/canrd/api/user/address/list'; | ||
1305 | + function request( | ||
1306 | + option: PostCanrdApiUserAddressListOption, | ||
1307 | + ): Promise<PostCanrdApiUserAddressListResponseSuccess> { | ||
1308 | + return requester(request.url, { | ||
1309 | + method: request.method, | ||
1310 | + ...option, | ||
1311 | + }) as unknown as Promise<PostCanrdApiUserAddressListResponseSuccess>; | ||
1312 | + } | ||
1313 | + | ||
1314 | + /** http method */ | ||
1315 | + request.method = method; | ||
1316 | + /** request url */ | ||
1317 | + request.url = url; | ||
1318 | + return request; | ||
1319 | +})(); | ||
1320 | + | ||
1321 | +/** @description request parameter type for postCanrdApiUserCenterInfo */ | ||
1322 | +export interface PostCanrdApiUserCenterInfoOption { | ||
1323 | + /** | ||
1324 | + * @description | ||
1325 | + * request | ||
1326 | + */ | ||
1327 | + body: { | ||
1328 | + /** | ||
1329 | + @description | ||
1330 | + request */ | ||
1331 | + request: UserCenterInfoRequest; | ||
1332 | + }; | ||
1333 | +} | ||
1334 | + | ||
1335 | +/** @description response type for postCanrdApiUserCenterInfo */ | ||
1336 | +export interface PostCanrdApiUserCenterInfoResponse { | ||
1337 | + /** | ||
1338 | + * @description | ||
1339 | + * OK | ||
1340 | + */ | ||
1341 | + 200: ServerResult; | ||
1342 | + /** | ||
1343 | + * @description | ||
1344 | + * Created | ||
1345 | + */ | ||
1346 | + 201: any; | ||
1347 | + /** | ||
1348 | + * @description | ||
1349 | + * Unauthorized | ||
1350 | + */ | ||
1351 | + 401: any; | ||
1352 | + /** | ||
1353 | + * @description | ||
1354 | + * Forbidden | ||
1355 | + */ | ||
1356 | + 403: any; | ||
1357 | + /** | ||
1358 | + * @description | ||
1359 | + * Not Found | ||
1360 | + */ | ||
1361 | + 404: any; | ||
1362 | +} | ||
1363 | + | ||
1364 | +export type PostCanrdApiUserCenterInfoResponseSuccess = | ||
1365 | + PostCanrdApiUserCenterInfoResponse[200]; | ||
1366 | +/** | ||
1367 | + * @description | ||
1368 | + * 获取会员详情 | ||
1369 | + * @tags canrd-mobile-api-controller | ||
1370 | + * @produces * | ||
1371 | + * @consumes application/json | ||
1372 | + */ | ||
1373 | +export const postCanrdApiUserCenterInfo = /* #__PURE__ */ (() => { | ||
1374 | + const method = 'post'; | ||
1375 | + const url = '/canrd/api/user/center/info'; | ||
1376 | + function request( | ||
1377 | + option: PostCanrdApiUserCenterInfoOption, | ||
1378 | + ): Promise<PostCanrdApiUserCenterInfoResponseSuccess> { | ||
1379 | + return requester(request.url, { | ||
1380 | + method: request.method, | ||
1381 | + ...option, | ||
1382 | + }) as unknown as Promise<PostCanrdApiUserCenterInfoResponseSuccess>; | ||
1383 | + } | ||
1384 | + | ||
1385 | + /** http method */ | ||
1386 | + request.method = method; | ||
1387 | + /** request url */ | ||
1388 | + request.url = url; | ||
1389 | + return request; | ||
1390 | +})(); | ||
1391 | + | ||
978 | /** @description request parameter type for postCanrdApiUserDetail */ | 1392 | /** @description request parameter type for postCanrdApiUserDetail */ |
979 | export interface PostCanrdApiUserDetailOption { | 1393 | export interface PostCanrdApiUserDetailOption { |
980 | /** | 1394 | /** |