@kmkf-fe-packages/kmkf-work-order-service-component 2.2.13-beta.90 → 2.2.13-beta.92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/FlowTemplateDetailV2/components/FormRender/index.js +88 -55
- package/dist/esm/FlowTemplateDetailV2/components/FormRender/onBlur.d.ts +9 -2
- package/dist/esm/FlowTemplateDetailV2/components/FormRender/onBlur.js +200 -107
- package/dist/esm/common/utils/constant.js +15 -0
- package/dist/esm/common/utils/submitDataTransOldFormat.js +2 -0
- package/dist/esm/common/utils/tools.d.ts +1 -0
- package/dist/esm/common/utils/tools.js +138 -95
- package/dist/esm/common/utils/transformWorkOrderData.js +39 -5
- package/dist/esm/model/servers/api.d.ts +1 -0
- package/dist/esm/model/servers/api.js +8 -0
- package/package.json +5 -5
|
@@ -29,7 +29,7 @@ import { get, some, set, every, cloneDeep, isEmpty, intersection, throttle, grou
|
|
|
29
29
|
import 'moment/locale/zh-cn';
|
|
30
30
|
import { calcWorkOrderList, orderBack, getReplaceWarnValues, COMPONENT_MAP_NAME, EXCLUDE_REPLACE_TOP_COMPONENT,
|
|
31
31
|
// 重复检验不需要展示在顶部的
|
|
32
|
-
INNER_REPLACE_COMPONENT, reversalFormValues, bsSystemOrderBackValues, kmSystemOrderBackValues, bsE3SystemOrderBackValues, wlnSystemOrderBackValues, gySystemOrderBackValues, jstSystemOrderBackValues, jySystemOrderBackValues, getMappingConfigByTemplateDetail, wdtSystemOrderBackValues, setLogisticsInfo, getMappingTargetValue } from "../../../common/utils/tools";
|
|
32
|
+
INNER_REPLACE_COMPONENT, reversalFormValues, wdtReturnBillNoBackValues, bsSystemOrderBackValues, kmSystemOrderBackValues, bsE3SystemOrderBackValues, wlnSystemOrderBackValues, gySystemOrderBackValues, jstSystemOrderBackValues, jySystemOrderBackValues, getMappingConfigByTemplateDetail, wdtSystemOrderBackValues, setLogisticsInfo, getMappingTargetValue } from "../../../common/utils/tools";
|
|
33
33
|
import { replaceCheck, orderDetail, queryLabelByTradeId, queryMemberLevel } from "../../../model/servers/api";
|
|
34
34
|
import { factory } from '@kmkf-fe-packages/services-components';
|
|
35
35
|
import { getExpression, formatDisplayConfig, isNull, LabelData, setSessionStorage } from '@kmkf-fe-packages/kmkf-utils';
|
|
@@ -43,7 +43,7 @@ import { jsonParseSecurity, findComponentUniqueKeyByType } from "../../../common
|
|
|
43
43
|
import { NEED_CLEAR_FIELDS_WHEN_SHOP_ID_CHANGE } from "../../constant";
|
|
44
44
|
import { Context } from "../../context";
|
|
45
45
|
import { orderBackKmAddress } from "./constants";
|
|
46
|
-
import { onBlurExpressLogisticsCode, onBlurErpAfterSaleTradeId, onBlurSkxOutboundNoticeNo, onBlurSkxReturnBillNo, onBlurSkxLogisticsCode, onBlurSkxReturnTHLogisticsCode } from "./onBlur";
|
|
46
|
+
import { onBlurExpressLogisticsCode, onBlurErpAfterSaleTradeId, onBlurSkxOutboundNoticeNo, onBlurSkxReturnBillNo, onBlurSkxLogisticsCode, onBlurSkxReturnTHLogisticsCode, onBlurReturnLogisticsCode } from "./onBlur";
|
|
47
47
|
import { findAllDependencies } from "./component-dependency-finder";
|
|
48
48
|
import { findValueDependencies } from "./value-mapping-finder";
|
|
49
49
|
import { skxOrderBack } from "./skxOrderBack";
|
|
@@ -418,7 +418,7 @@ var FormRender = function FormRender(props, ref) {
|
|
|
418
418
|
return prv;
|
|
419
419
|
}, {});
|
|
420
420
|
if (!workOrderId) {
|
|
421
|
-
_context2.next =
|
|
421
|
+
_context2.next = 44;
|
|
422
422
|
break;
|
|
423
423
|
}
|
|
424
424
|
// 先初始化端上内容
|
|
@@ -444,24 +444,25 @@ var FormRender = function FormRender(props, ref) {
|
|
|
444
444
|
created: newRecord.created,
|
|
445
445
|
processTime: newRecord.processTime
|
|
446
446
|
}));
|
|
447
|
+
console.log('transData', get(transData, '0', {}));
|
|
447
448
|
initialValues = get(transData, '0', {});
|
|
448
449
|
newRecord.preCreateAndNotModified && batchFillByMapping(initialValues);
|
|
449
450
|
orderBackReplace(transData, templateDetail);
|
|
450
451
|
// TODO: 非开始节点录入,都会有workOrderId,这里判断是否有前置组件含有订单号;如果存在订单号,进行订单反填。
|
|
451
452
|
tradeIdUniqueKey = findComponentUniqueKeyByType(templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.preNodeComponentDtoList, 'TRADE_ID_INPUT');
|
|
452
453
|
if (!newRecord.notAutoFillWithFirstSubmit) {
|
|
453
|
-
_context2.next =
|
|
454
|
+
_context2.next = 34;
|
|
454
455
|
break;
|
|
455
456
|
}
|
|
456
457
|
currentNodeTradeIdUniqueKey = findComponentUniqueKeyByType(templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.componentDtoList, 'TRADE_ID_INPUT');
|
|
457
458
|
_currentNodeTid = record === null || record === void 0 ? void 0 : (_record$jsonMap2 = record.jsonMap) === null || _record$jsonMap2 === void 0 ? void 0 : _record$jsonMap2["".concat(currentNodeTradeIdUniqueKey, "_tradeId")];
|
|
458
459
|
if (!_currentNodeTid) {
|
|
459
|
-
_context2.next =
|
|
460
|
+
_context2.next = 30;
|
|
460
461
|
break;
|
|
461
462
|
}
|
|
462
463
|
queryLabels(_currentNodeTid, shopId);
|
|
463
464
|
queryMemberLevels(_currentNodeTid, shopId);
|
|
464
|
-
_context2.next =
|
|
465
|
+
_context2.next = 28;
|
|
465
466
|
return orderBack({
|
|
466
467
|
companyKey: companyKey,
|
|
467
468
|
order_no: _currentNodeTid,
|
|
@@ -475,11 +476,11 @@ var FormRender = function FormRender(props, ref) {
|
|
|
475
476
|
callKey: 1,
|
|
476
477
|
setLoading: setLoading
|
|
477
478
|
});
|
|
478
|
-
case
|
|
479
|
-
_context2.next =
|
|
479
|
+
case 28:
|
|
480
|
+
_context2.next = 32;
|
|
480
481
|
break;
|
|
481
|
-
case
|
|
482
|
-
_context2.next =
|
|
482
|
+
case 30:
|
|
483
|
+
_context2.next = 32;
|
|
483
484
|
return skxOrderBack({
|
|
484
485
|
form: form,
|
|
485
486
|
companyKey: companyKey,
|
|
@@ -487,17 +488,17 @@ var FormRender = function FormRender(props, ref) {
|
|
|
487
488
|
componentOnBlur: componentOnBlur,
|
|
488
489
|
jsonMap: record === null || record === void 0 ? void 0 : record.jsonMap
|
|
489
490
|
});
|
|
490
|
-
case
|
|
491
|
-
_context2.next =
|
|
491
|
+
case 32:
|
|
492
|
+
_context2.next = 42;
|
|
492
493
|
break;
|
|
493
|
-
case
|
|
494
|
+
case 34:
|
|
494
495
|
if (!(tradeIdUniqueKey && shopId && record !== null && record !== void 0 && (_record$jsonMap3 = record.jsonMap) !== null && _record$jsonMap3 !== void 0 && _record$jsonMap3["".concat(tradeIdUniqueKey, "_tradeId")] && firstOrderBackfill)) {
|
|
495
|
-
_context2.next =
|
|
496
|
+
_context2.next = 41;
|
|
496
497
|
break;
|
|
497
498
|
}
|
|
498
499
|
queryLabels(record === null || record === void 0 ? void 0 : (_record$jsonMap4 = record.jsonMap) === null || _record$jsonMap4 === void 0 ? void 0 : _record$jsonMap4["".concat(tradeIdUniqueKey, "_tradeId")], shopId);
|
|
499
500
|
queryMemberLevels(record === null || record === void 0 ? void 0 : (_record$jsonMap5 = record.jsonMap) === null || _record$jsonMap5 === void 0 ? void 0 : _record$jsonMap5["".concat(tradeIdUniqueKey, "_tradeId")], shopId);
|
|
500
|
-
_context2.next =
|
|
501
|
+
_context2.next = 39;
|
|
501
502
|
return orderBack({
|
|
502
503
|
companyKey: companyKey,
|
|
503
504
|
order_no: record === null || record === void 0 ? void 0 : (_record$jsonMap6 = record.jsonMap) === null || _record$jsonMap6 === void 0 ? void 0 : _record$jsonMap6["".concat(tradeIdUniqueKey, "_tradeId")],
|
|
@@ -511,16 +512,16 @@ var FormRender = function FormRender(props, ref) {
|
|
|
511
512
|
callKey: 1,
|
|
512
513
|
setLoading: setLoading
|
|
513
514
|
});
|
|
514
|
-
case
|
|
515
|
-
_context2.next =
|
|
515
|
+
case 39:
|
|
516
|
+
_context2.next = 42;
|
|
516
517
|
break;
|
|
517
|
-
case
|
|
518
|
+
case 41:
|
|
518
519
|
// 如果没有订单反填,则单独更新remark
|
|
519
520
|
fetchRemark(shopId, currentNodeTid);
|
|
520
|
-
case
|
|
521
|
-
_context2.next =
|
|
521
|
+
case 42:
|
|
522
|
+
_context2.next = 67;
|
|
522
523
|
break;
|
|
523
|
-
case
|
|
524
|
+
case 44:
|
|
524
525
|
fillByShopId(shopId);
|
|
525
526
|
initFormValues = null;
|
|
526
527
|
if (plat !== null && plat !== void 0 && plat.subOrderNo) {
|
|
@@ -539,7 +540,7 @@ var FormRender = function FormRender(props, ref) {
|
|
|
539
540
|
|
|
540
541
|
// console.log(orderNo, initFormValues);
|
|
541
542
|
if (!initFormValues) {
|
|
542
|
-
_context2.next =
|
|
543
|
+
_context2.next = 55;
|
|
543
544
|
break;
|
|
544
545
|
}
|
|
545
546
|
form.setFieldsValue(_objectSpread(_objectSpread({}, initFormValues), {}, {
|
|
@@ -556,9 +557,9 @@ var FormRender = function FormRender(props, ref) {
|
|
|
556
557
|
_orderNo = orderNoField !== null && orderNoField !== void 0 && orderNoField.uniqueKey ? initFormValues[orderNoField === null || orderNoField === void 0 ? void 0 : orderNoField.uniqueKey] || _orderNo : _orderNo;
|
|
557
558
|
}
|
|
558
559
|
fetchRemark(_shopId, _orderNo);
|
|
559
|
-
_context2.next =
|
|
560
|
+
_context2.next = 67;
|
|
560
561
|
break;
|
|
561
|
-
case
|
|
562
|
+
case 55:
|
|
562
563
|
_transData = calcWorkOrderList([{
|
|
563
564
|
jsonMap: jsonMap
|
|
564
565
|
}], [].concat(_toConsumableArray((templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.preNodeComponentDtoList) || []), _toConsumableArray((templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.componentDtoList) || [])), 'init');
|
|
@@ -570,12 +571,12 @@ var FormRender = function FormRender(props, ref) {
|
|
|
570
571
|
batchFillByMapping(_initialValues);
|
|
571
572
|
//如果有订单号 订单返填 通过订单号入口进行工单录入,需要将订单数据反填到工单
|
|
572
573
|
if (!(orderNo && shopId)) {
|
|
573
|
-
_context2.next =
|
|
574
|
+
_context2.next = 66;
|
|
574
575
|
break;
|
|
575
576
|
}
|
|
576
577
|
queryLabels(orderNo, shopId);
|
|
577
578
|
queryMemberLevels(orderNo, shopId);
|
|
578
|
-
_context2.next =
|
|
579
|
+
_context2.next = 64;
|
|
579
580
|
return orderBack({
|
|
580
581
|
companyKey: companyKey,
|
|
581
582
|
order_no: orderNo,
|
|
@@ -590,13 +591,13 @@ var FormRender = function FormRender(props, ref) {
|
|
|
590
591
|
callKey: 2,
|
|
591
592
|
setLoading: setLoading
|
|
592
593
|
});
|
|
593
|
-
case
|
|
594
|
-
_context2.next =
|
|
594
|
+
case 64:
|
|
595
|
+
_context2.next = 67;
|
|
595
596
|
break;
|
|
596
|
-
case
|
|
597
|
+
case 66:
|
|
597
598
|
// 如果没有订单反填,则单独更新remark
|
|
598
599
|
fetchRemark(shopId, currentNodeTid);
|
|
599
|
-
case
|
|
600
|
+
case 67:
|
|
600
601
|
antFormEl = document.getElementsByClassName('ant-form');
|
|
601
602
|
(antFormEl === null || antFormEl === void 0 ? void 0 : antFormEl.length) > 0 && set(antFormEl, '0.scrollTop', 0);
|
|
602
603
|
resetMappingHideComponents();
|
|
@@ -605,7 +606,7 @@ var FormRender = function FormRender(props, ref) {
|
|
|
605
606
|
type: 'setaAutoSubmitFlag',
|
|
606
607
|
payload: true
|
|
607
608
|
});
|
|
608
|
-
case
|
|
609
|
+
case 71:
|
|
609
610
|
case "end":
|
|
610
611
|
return _context2.stop();
|
|
611
612
|
}
|
|
@@ -942,6 +943,13 @@ var FormRender = function FormRender(props, ref) {
|
|
|
942
943
|
form: form
|
|
943
944
|
});
|
|
944
945
|
}
|
|
946
|
+
if (workOrderComponentType === 'WDT_RETURN_BILL_NO') {
|
|
947
|
+
wdtReturnBillNoBackValues({
|
|
948
|
+
templateList: templateDetail,
|
|
949
|
+
value: value,
|
|
950
|
+
form: form
|
|
951
|
+
});
|
|
952
|
+
}
|
|
945
953
|
if (activeLogisticsComponents && ['INPUT', 'EXPRESS_LOGISTICS_SELECT', 'BS_LOGISTICS'].includes(workOrderComponentType)) {
|
|
946
954
|
setLogisticsInfo({
|
|
947
955
|
logisticsMappingConfig: activeLogisticsComponents,
|
|
@@ -972,11 +980,11 @@ var FormRender = function FormRender(props, ref) {
|
|
|
972
980
|
setKmLoading: setKmLoading
|
|
973
981
|
});
|
|
974
982
|
case 3:
|
|
975
|
-
_context6.next =
|
|
983
|
+
_context6.next = 48;
|
|
976
984
|
break;
|
|
977
985
|
case 5:
|
|
978
986
|
if (!(type === 'expressLogisticsCode')) {
|
|
979
|
-
_context6.next =
|
|
987
|
+
_context6.next = 15;
|
|
980
988
|
break;
|
|
981
989
|
}
|
|
982
990
|
_context6.next = 8;
|
|
@@ -1005,56 +1013,81 @@ var FormRender = function FormRender(props, ref) {
|
|
|
1005
1013
|
componentOnBlur: componentOnBlur
|
|
1006
1014
|
});
|
|
1007
1015
|
case 11:
|
|
1008
|
-
_context6.next =
|
|
1009
|
-
|
|
1016
|
+
_context6.next = 13;
|
|
1017
|
+
return onBlurReturnLogisticsCode({
|
|
1018
|
+
form: form,
|
|
1019
|
+
value: value,
|
|
1020
|
+
templateDetail: templateDetail,
|
|
1021
|
+
componentOnBlur: componentOnBlur,
|
|
1022
|
+
orderBackRule: 'outSid'
|
|
1023
|
+
});
|
|
1010
1024
|
case 13:
|
|
1025
|
+
_context6.next = 48;
|
|
1026
|
+
break;
|
|
1027
|
+
case 15:
|
|
1028
|
+
if (!(type === 'returnLogisticsCode')) {
|
|
1029
|
+
_context6.next = 20;
|
|
1030
|
+
break;
|
|
1031
|
+
}
|
|
1032
|
+
_context6.next = 18;
|
|
1033
|
+
return onBlurReturnLogisticsCode({
|
|
1034
|
+
form: form,
|
|
1035
|
+
value: value,
|
|
1036
|
+
templateDetail: templateDetail,
|
|
1037
|
+
componentOnBlur: componentOnBlur,
|
|
1038
|
+
orderBackRule: 'logisticsCode'
|
|
1039
|
+
});
|
|
1040
|
+
case 18:
|
|
1041
|
+
_context6.next = 48;
|
|
1042
|
+
break;
|
|
1043
|
+
case 20:
|
|
1011
1044
|
if (!(type === 'skxOutboundNoticeNo')) {
|
|
1012
|
-
_context6.next =
|
|
1045
|
+
_context6.next = 26;
|
|
1013
1046
|
break;
|
|
1014
1047
|
}
|
|
1015
1048
|
//[SKX]ON出库通知单号 返填
|
|
1016
1049
|
console.log('skxOutboundNoticeNo', value);
|
|
1017
|
-
_context6.next =
|
|
1050
|
+
_context6.next = 24;
|
|
1018
1051
|
return onBlurSkxOutboundNoticeNo({
|
|
1019
1052
|
form: form,
|
|
1020
1053
|
value: value,
|
|
1021
1054
|
templateDetail: templateDetail,
|
|
1022
1055
|
componentOnBlur: componentOnBlur
|
|
1023
1056
|
});
|
|
1024
|
-
case
|
|
1025
|
-
_context6.next =
|
|
1057
|
+
case 24:
|
|
1058
|
+
_context6.next = 48;
|
|
1026
1059
|
break;
|
|
1027
|
-
case
|
|
1060
|
+
case 26:
|
|
1028
1061
|
if (!(type === 'skxReturnBillNo')) {
|
|
1029
|
-
_context6.next =
|
|
1062
|
+
_context6.next = 31;
|
|
1030
1063
|
break;
|
|
1031
1064
|
}
|
|
1032
|
-
_context6.next =
|
|
1065
|
+
_context6.next = 29;
|
|
1033
1066
|
return onBlurSkxReturnBillNo({
|
|
1034
1067
|
form: form,
|
|
1035
1068
|
value: value,
|
|
1036
1069
|
templateDetail: templateDetail,
|
|
1037
1070
|
componentOnBlur: componentOnBlur
|
|
1038
1071
|
});
|
|
1039
|
-
case
|
|
1040
|
-
_context6.next =
|
|
1072
|
+
case 29:
|
|
1073
|
+
_context6.next = 48;
|
|
1041
1074
|
break;
|
|
1042
|
-
case
|
|
1075
|
+
case 31:
|
|
1043
1076
|
if (!(type === 'skxReturnTHLogisticsCode')) {
|
|
1044
|
-
_context6.next =
|
|
1077
|
+
_context6.next = 36;
|
|
1045
1078
|
break;
|
|
1046
1079
|
}
|
|
1047
|
-
_context6.next =
|
|
1080
|
+
_context6.next = 34;
|
|
1048
1081
|
return onBlurSkxReturnTHLogisticsCode({
|
|
1049
1082
|
form: form,
|
|
1050
1083
|
value: value,
|
|
1051
1084
|
templateDetail: templateDetail,
|
|
1052
1085
|
componentOnBlur: componentOnBlur
|
|
1053
1086
|
});
|
|
1054
|
-
case
|
|
1055
|
-
_context6.next =
|
|
1087
|
+
case 34:
|
|
1088
|
+
_context6.next = 48;
|
|
1056
1089
|
break;
|
|
1057
|
-
case
|
|
1090
|
+
case 36:
|
|
1058
1091
|
// 收集所有需要执行的异步操作
|
|
1059
1092
|
promises = [];
|
|
1060
1093
|
if (type === 'tradeId') {
|
|
@@ -1066,7 +1099,7 @@ var FormRender = function FormRender(props, ref) {
|
|
|
1066
1099
|
promises.push(handleChangeTradeId(value));
|
|
1067
1100
|
}
|
|
1068
1101
|
if (value) {
|
|
1069
|
-
_context6.next =
|
|
1102
|
+
_context6.next = 43;
|
|
1070
1103
|
break;
|
|
1071
1104
|
}
|
|
1072
1105
|
setReplaceValue(function (prev) {
|
|
@@ -1077,18 +1110,18 @@ var FormRender = function FormRender(props, ref) {
|
|
|
1077
1110
|
});
|
|
1078
1111
|
replaceValueRef.current = _objectSpread(_objectSpread({}, replaceValue), {}, _defineProperty({}, type, 0));
|
|
1079
1112
|
return _context6.abrupt("return");
|
|
1080
|
-
case
|
|
1113
|
+
case 43:
|
|
1081
1114
|
promises.push(queryReplaceCount(_defineProperty({}, type, value), templateDetail));
|
|
1082
1115
|
// TODO: ERP不走订单反弹逻辑
|
|
1083
1116
|
if ((type === 'tradeId' || type === 'enterprisePaymentTid') && !isErpUse) {
|
|
1084
1117
|
promises.push(changeHandle(value));
|
|
1085
1118
|
}
|
|
1086
1119
|
// 等待所有异步操作完成
|
|
1087
|
-
_context6.next =
|
|
1120
|
+
_context6.next = 47;
|
|
1088
1121
|
return Promise.all(promises);
|
|
1089
|
-
case
|
|
1122
|
+
case 47:
|
|
1090
1123
|
return _context6.abrupt("return", Promise.resolve());
|
|
1091
|
-
case
|
|
1124
|
+
case 48:
|
|
1092
1125
|
case "end":
|
|
1093
1126
|
return _context6.stop();
|
|
1094
1127
|
}
|
|
@@ -5,7 +5,7 @@ export declare const onBlurErpAfterSaleTradeId: ({ form, value, templateDetail,
|
|
|
5
5
|
templateDetail: any;
|
|
6
6
|
setKmLoading: (loading: boolean) => void;
|
|
7
7
|
}) => Promise<void>;
|
|
8
|
-
export declare const onBlurExpressLogisticsCode: ({ form, value, templateDetail, setKmLoading, componentOnBlur, onlyGetTid, needTradeIdOrderBack }: {
|
|
8
|
+
export declare const onBlurExpressLogisticsCode: ({ form, value, templateDetail, setKmLoading, componentOnBlur, onlyGetTid, needTradeIdOrderBack, }: {
|
|
9
9
|
form: FormInstance;
|
|
10
10
|
value: string;
|
|
11
11
|
templateDetail: any;
|
|
@@ -14,7 +14,14 @@ export declare const onBlurExpressLogisticsCode: ({ form, value, templateDetail,
|
|
|
14
14
|
onlyGetTid?: boolean | undefined;
|
|
15
15
|
needTradeIdOrderBack?: boolean | undefined;
|
|
16
16
|
}) => Promise<any>;
|
|
17
|
-
export declare const
|
|
17
|
+
export declare const onBlurReturnLogisticsCode: ({ form, value, templateDetail, componentOnBlur, orderBackRule, }: {
|
|
18
|
+
form: FormInstance;
|
|
19
|
+
value: string;
|
|
20
|
+
templateDetail: any;
|
|
21
|
+
componentOnBlur: (value: any, type: string) => Promise<void>;
|
|
22
|
+
orderBackRule: string;
|
|
23
|
+
}) => Promise<void>;
|
|
24
|
+
export declare const onBlurSkxOutboundNoticeNo: ({ form, value, templateDetail, componentOnBlur, onlyGetTid, needTradeIdOrderBack, }: {
|
|
18
25
|
form: FormInstance;
|
|
19
26
|
value: string;
|
|
20
27
|
templateDetail: any;
|