@kmkf-fe-packages/kmkf-work-order-service-component 0.8.16-alpha.0 → 0.8.16-alpha.2
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/FlowTemplateDetail/common.js +1 -1
- package/dist/esm/FlowTemplateDetail/components/ActionList/index.js +1 -2
- package/dist/esm/FlowTemplateDetail/components/FormRender/index.js +6 -13
- package/dist/esm/common/utils/tools.d.ts +0 -1
- package/dist/esm/common/utils/tools.js +46 -127
- package/package.json +5 -5
|
@@ -121,7 +121,7 @@ export var submitParams = function submitParams(_ref) {
|
|
|
121
121
|
});
|
|
122
122
|
// 获取非空字段对应的组件
|
|
123
123
|
var finalDtoList = currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo6 = currentNodeDetail.workOrderTemplateInfo) === null || _currentNodeDetail$wo6 === void 0 ? void 0 : (_currentNodeDetail$wo7 = _currentNodeDetail$wo6.componentDtoList) === null || _currentNodeDetail$wo7 === void 0 ? void 0 : _currentNodeDetail$wo7.filter(function (item) {
|
|
124
|
-
return finalComponentList.includes(item.uniqueKey);
|
|
124
|
+
return finalComponentList.includes(item.uniqueKey) || item.workOrderComponentType === 'BUYER_MESSAGE_NOTICE';
|
|
125
125
|
});
|
|
126
126
|
set(newTemplateDetail, 'componentDtoList', finalDtoList);
|
|
127
127
|
params.workOrder = {
|
|
@@ -77,10 +77,9 @@ var ActionList = function ActionList(props) {
|
|
|
77
77
|
onClick: function onClick(e) {
|
|
78
78
|
return e.preventDefault();
|
|
79
79
|
}
|
|
80
|
-
}, /*#__PURE__*/React.createElement(Space, null, "\u66F4\u591A", /*#__PURE__*/React.createElement(DownOutlined, null)))), (_buttonList$slice = buttonList.slice(0, 3)) === null || _buttonList$slice === void 0 ? void 0 : _buttonList$slice.map(function (button
|
|
80
|
+
}, /*#__PURE__*/React.createElement(Space, null, "\u66F4\u591A", /*#__PURE__*/React.createElement(DownOutlined, null)))), (_buttonList$slice = buttonList.slice(0, 3)) === null || _buttonList$slice === void 0 ? void 0 : _buttonList$slice.map(function (button) {
|
|
81
81
|
var _buttonMap$button;
|
|
82
82
|
return /*#__PURE__*/React.createElement(Button, {
|
|
83
|
-
key: "button".concat(index),
|
|
84
83
|
type: buttonMap[button].type,
|
|
85
84
|
onClick: function onClick() {
|
|
86
85
|
return handleAction(button);
|
|
@@ -26,7 +26,7 @@ import { ConfigProvider, Form } from 'antd';
|
|
|
26
26
|
import zhCN from 'antd/es/locale/zh_CN';
|
|
27
27
|
import { get, some, set, every, cloneDeep, isEmpty, intersection } from 'lodash';
|
|
28
28
|
import 'moment/locale/zh-cn';
|
|
29
|
-
import { calcWorkOrderList, orderBack, getReplaceWarnValues, COMPONENT_MAP_NAME, reversalFormValues
|
|
29
|
+
import { calcWorkOrderList, orderBack, getReplaceWarnValues, COMPONENT_MAP_NAME, reversalFormValues } from "../../../common/utils/tools";
|
|
30
30
|
import { replaceCheck } from "../../../model/servers/api";
|
|
31
31
|
import { factory } from '@kmkf-fe-packages/services-components';
|
|
32
32
|
import { AddressData, ExpressData, ExpressInterceptData, PlatData, LogisticsAddressData, getExpression, formatDisplayConfig } from '@kmkf-fe-packages/kmkf-utils';
|
|
@@ -80,7 +80,7 @@ var FormRender = function FormRender(props) {
|
|
|
80
80
|
return i.componentUniqueKey === item.uniqueKey;
|
|
81
81
|
})) === null || _componentTemplateCon === void 0 ? void 0 : _componentTemplateCon.config) || {});
|
|
82
82
|
if ((_newItem$componentCon = newItem.componentConfig.mapping) !== null && _newItem$componentCon !== void 0 && _newItem$componentCon.triggerComponentKey && newItem.componentConfig.mapping.triggerComponentKey !== 'SHOP_SELECT_MAPPING' && (_newItem$componentCon2 = newItem.componentConfig.mapping) !== null && _newItem$componentCon2 !== void 0 && (_newItem$componentCon3 = _newItem$componentCon2.rules) !== null && _newItem$componentCon3 !== void 0 && _newItem$componentCon3.length) {
|
|
83
|
-
// PS: 直接修改triggerComponentKey会报错
|
|
83
|
+
// PS: 直接修改triggerComponentKey会报错
|
|
84
84
|
// Cannot assign to read only property 'triggerComponentKey' of object '#<Object>'
|
|
85
85
|
// 所以修改整个mapping
|
|
86
86
|
// newItem.componentConfig.mapping.triggerComponentKey = `${nodeId}-${newItem.componentConfig.mapping.triggerComponentKey}`
|
|
@@ -433,18 +433,11 @@ var FormRender = function FormRender(props) {
|
|
|
433
433
|
});
|
|
434
434
|
};
|
|
435
435
|
// 组件值变化
|
|
436
|
-
var componentOnValueChange = function componentOnValueChange(uniqueKey, value
|
|
436
|
+
var componentOnValueChange = function componentOnValueChange(uniqueKey, value) {
|
|
437
437
|
if (mappingConfig.config[uniqueKey]) {
|
|
438
438
|
// PS: 目前只有string 和 { value: string, other: ''}这两种类型,后面其他组件如果需要在调整
|
|
439
439
|
fillByMapping(uniqueKey, typeof value === 'string' ? value : value === null || value === void 0 ? void 0 : value.value);
|
|
440
440
|
}
|
|
441
|
-
if (workOrderComponentType === 'BS_SYSTEM_ORDER') {
|
|
442
|
-
bsSystemOrderBackValues({
|
|
443
|
-
templateList: templateDetail,
|
|
444
|
-
value: value,
|
|
445
|
-
form: form
|
|
446
|
-
});
|
|
447
|
-
}
|
|
448
441
|
};
|
|
449
442
|
//组件失焦事件
|
|
450
443
|
var componentOnBlur = /*#__PURE__*/function () {
|
|
@@ -484,7 +477,7 @@ var FormRender = function FormRender(props) {
|
|
|
484
477
|
setShopId(val);
|
|
485
478
|
// 清空表单字段
|
|
486
479
|
var needClearFormFields = get(templateDetail, 'componentDtoList', []).reduce(function (cur, nxt) {
|
|
487
|
-
if (['ITEM_SELECT_THIRD', 'STATUS', 'ITEM_SELECT', 'ITEM_ID', 'ITEM_ENCODE', 'JST_LOGISTICS', 'JST_ITEM_SELECT_THIRD', 'JST_SUPPLY', 'JST_SEND_GOOD', 'BS_GOODS', 'BS_EXCHANGE_GOODS', 'BS_REISSUE_GOODS', 'BS_LOGISTICS', 'BS_SEND_GOOD'
|
|
480
|
+
if (['ITEM_SELECT_THIRD', 'STATUS', 'ITEM_SELECT', 'ITEM_ID', 'ITEM_ENCODE', 'JST_LOGISTICS', 'JST_ITEM_SELECT_THIRD', 'JST_SUPPLY', 'JST_SEND_GOOD', 'BS_GOODS', 'BS_EXCHANGE_GOODS', 'BS_REISSUE_GOODS', 'BS_LOGISTICS', 'BS_SEND_GOOD'].includes(nxt === null || nxt === void 0 ? void 0 : nxt.workOrderComponentType)) {
|
|
488
481
|
cur.push(nxt === null || nxt === void 0 ? void 0 : nxt.uniqueKey);
|
|
489
482
|
}
|
|
490
483
|
return cur;
|
|
@@ -688,7 +681,7 @@ var FormRender = function FormRender(props) {
|
|
|
688
681
|
return instance.editRender({
|
|
689
682
|
onBlur: componentOnBlur,
|
|
690
683
|
onChange: function onChange(value) {
|
|
691
|
-
return componentOnValueChange(uniqueKey, value
|
|
684
|
+
return componentOnValueChange(uniqueKey, value);
|
|
692
685
|
},
|
|
693
686
|
hidden: !show || mappdingHideComponents.includes(uniqueKey)
|
|
694
687
|
});
|
|
@@ -697,7 +690,7 @@ var FormRender = function FormRender(props) {
|
|
|
697
690
|
return instance.editRender({
|
|
698
691
|
onBlur: componentOnBlur,
|
|
699
692
|
onChange: function onChange(value) {
|
|
700
|
-
return componentOnValueChange(uniqueKey, value
|
|
693
|
+
return componentOnValueChange(uniqueKey, value);
|
|
701
694
|
},
|
|
702
695
|
hidden: mappdingHideComponents.includes(uniqueKey)
|
|
703
696
|
});
|
|
@@ -92,5 +92,4 @@ export declare const verifyHandle: (data: any, componentDtoList: Array<any>) =>
|
|
|
92
92
|
};
|
|
93
93
|
export declare const reversalFormValues: (templateList: any[] | undefined, values: any) => any;
|
|
94
94
|
export declare const deleteCacheOrder: (templateList: any[], values: any) => void;
|
|
95
|
-
export declare const bsSystemOrderBackValues: ({ templateList, value, form }: any) => void;
|
|
96
95
|
export {};
|
|
@@ -17,11 +17,11 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
17
17
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
18
18
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
19
19
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
20
|
-
import { get, every, maxBy } from 'lodash';
|
|
20
|
+
import { get, every, maxBy, isObject, isArray } from 'lodash';
|
|
21
21
|
import V from 'voca';
|
|
22
22
|
import { orderDetail, jstOrderDetail, bsOrderDetail } from "../../model/servers/api";
|
|
23
23
|
import moment from 'moment';
|
|
24
|
-
import { AddressData, ExpressData, orderBackFormValues, findLabelBySelectValue, request
|
|
24
|
+
import { AddressData, ExpressData, orderBackFormValues, findLabelBySelectValue, request } from '@kmkf-fe-packages/kmkf-utils';
|
|
25
25
|
import { cloneDeep, isEqual, set } from 'lodash';
|
|
26
26
|
import { isNull } from '@kmkf-fe-packages/kmkf-utils';
|
|
27
27
|
import { PlatForm } from "../../model/flowTemplateDetail/types";
|
|
@@ -31,6 +31,8 @@ import cache from "../cache";
|
|
|
31
31
|
|
|
32
32
|
var ONLY_SHOW_COMPONENT_TYPE = ['RADIO', 'INPUT', 'TEXTAREA', 'CHECKBOX', 'SELECT', 'DATETIME', 'PICTURE', 'MULT_SELECT', 'ORDINARY_INVOICE'];
|
|
33
33
|
var workTypeKeys = {
|
|
34
|
+
// TRADE_ID_INPUT: 'tradeId', //订单号
|
|
35
|
+
// BUYER_NICK_INPUT: 'buyerNick', //买家旺旺
|
|
34
36
|
SHOP_NAME_INPUT: 'shopName',
|
|
35
37
|
//店铺名称
|
|
36
38
|
RECEIVER_NAME_INPUT: 'receiveName',
|
|
@@ -544,57 +546,15 @@ export var submitDataTransOldFormat = function submitDataTransOldFormat(nowData,
|
|
|
544
546
|
}).join(),
|
|
545
547
|
name: item.name
|
|
546
548
|
});
|
|
547
|
-
} else if (item.workOrderComponentType === 'REISSUE_LOGISTICS') {
|
|
548
|
-
var reissueLogisticsList = get(nowData, "".concat(item.uniqueKey), []);
|
|
549
|
-
var reissueLogisticsCompany = reissueLogisticsList.map(function (item) {
|
|
550
|
-
return item.logisticsCompany;
|
|
551
|
-
});
|
|
552
|
-
var _hasTrans = reissueLogisticsCompany.some(function (t) {
|
|
553
|
-
return t && !ExpressData.getInstance().getExpressNameByCode(t, false);
|
|
554
|
-
});
|
|
555
|
-
if (_hasTrans) {
|
|
556
|
-
needTransForm = true;
|
|
557
|
-
}
|
|
558
|
-
contentVoList.push({
|
|
559
|
-
uniqueKey: "".concat(item.uniqueKey, "_reissueLogisticsList"),
|
|
560
|
-
content: reissueLogisticsList,
|
|
561
|
-
name: item.name
|
|
562
|
-
});
|
|
563
|
-
contentVoList.push({
|
|
564
|
-
uniqueKey: "".concat(item.uniqueKey, "_reissueLogisticsCompany"),
|
|
565
|
-
content: reissueLogisticsList.map(function (item) {
|
|
566
|
-
return item.logisticsCompany + '';
|
|
567
|
-
}),
|
|
568
|
-
name: item.name
|
|
569
|
-
});
|
|
570
|
-
contentVoList.push({
|
|
571
|
-
uniqueKey: "".concat(item.uniqueKey, "_reissueLogisticsCode"),
|
|
572
|
-
content: reissueLogisticsList.map(function (item) {
|
|
573
|
-
return item.logisticsCode + '';
|
|
574
|
-
}),
|
|
575
|
-
name: item.name
|
|
576
|
-
});
|
|
577
|
-
} else if (item.workOrderComponentType === 'REISSUE_TRADE_ID') {
|
|
578
|
-
contentVoList.push({
|
|
579
|
-
uniqueKey: "".concat(item.uniqueKey, "_resissueTradeId"),
|
|
580
|
-
content: get(nowData, "".concat(item.uniqueKey), ''),
|
|
581
|
-
name: item.name
|
|
582
|
-
});
|
|
583
|
-
} else if (item.workOrderComponentType === 'REISSUE_STATUS') {
|
|
584
|
-
contentVoList.push({
|
|
585
|
-
uniqueKey: "".concat(item.uniqueKey, "_resissueStatus"),
|
|
586
|
-
content: get(nowData, "".concat(item.uniqueKey), ''),
|
|
587
|
-
name: item.name
|
|
588
|
-
});
|
|
589
549
|
} else if (item.workOrderComponentType === 'BS_LOGISTICS') {
|
|
590
550
|
var bsLogisticsList = get(nowData, "".concat(item.uniqueKey), []);
|
|
591
551
|
var bsLogisticsCompany = bsLogisticsList.map(function (item) {
|
|
592
552
|
return item.logisticsCompany;
|
|
593
553
|
});
|
|
594
|
-
var
|
|
554
|
+
var _hasTrans = bsLogisticsCompany.some(function (t) {
|
|
595
555
|
return t && !ExpressData.getInstance().getExpressNameByCode(t, false);
|
|
596
556
|
});
|
|
597
|
-
if (
|
|
557
|
+
if (_hasTrans) {
|
|
598
558
|
needTransForm = true;
|
|
599
559
|
}
|
|
600
560
|
contentVoList.push({
|
|
@@ -751,32 +711,18 @@ export var submitDataTransOldFormat = function submitDataTransOldFormat(nowData,
|
|
|
751
711
|
content: get(nowData, "".concat(item.uniqueKey, ".postingReceiverMobile"), ''),
|
|
752
712
|
name: item.name
|
|
753
713
|
});
|
|
754
|
-
} else if (item.workOrderComponentType === 'BS_SYSTEM_ORDER') {
|
|
755
|
-
contentVoList.push({
|
|
756
|
-
uniqueKey: "".concat(item.uniqueKey, "_bsSystemOrderNo"),
|
|
757
|
-
content: get(nowData, "".concat(item.uniqueKey, ".orderNo"), ''),
|
|
758
|
-
name: item.name
|
|
759
|
-
}, {
|
|
760
|
-
uniqueKey: "".concat(item.uniqueKey, "_bsSystemSelectIds"),
|
|
761
|
-
content: get(nowData, "".concat(item.uniqueKey, ".selectIds"), ''),
|
|
762
|
-
name: item.name
|
|
763
|
-
}, {
|
|
764
|
-
uniqueKey: "".concat(item.uniqueKey, "_bsSystemShowOrder"),
|
|
765
|
-
content: get(nowData, "".concat(item.uniqueKey, ".showOrderInfo"), ''),
|
|
766
|
-
name: item.name
|
|
767
|
-
});
|
|
768
714
|
} else if (item.workOrderComponentType === 'BUYER_MESSAGE_NOTICE') {
|
|
769
|
-
var
|
|
715
|
+
var _nowData$item$uniqueK;
|
|
770
716
|
contentVoList.push({
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
717
|
+
uniqueKey: "".concat(item.uniqueKey, "_").concat(V.camelCase(item.workOrderComponentType)),
|
|
718
|
+
content: (_nowData$item$uniqueK = nowData === null || nowData === void 0 ? void 0 : nowData[item.uniqueKey]) !== null && _nowData$item$uniqueK !== void 0 ? _nowData$item$uniqueK : '未通知',
|
|
719
|
+
name: item.name
|
|
774
720
|
});
|
|
775
721
|
} else {
|
|
776
|
-
var _nowData$item$
|
|
722
|
+
var _nowData$item$uniqueK2;
|
|
777
723
|
contentVoList.push({
|
|
778
724
|
uniqueKey: "".concat(item.uniqueKey, "_").concat(V.camelCase(item.workOrderComponentType)),
|
|
779
|
-
content: (_nowData$item$
|
|
725
|
+
content: (_nowData$item$uniqueK2 = nowData === null || nowData === void 0 ? void 0 : nowData[item.uniqueKey]) !== null && _nowData$item$uniqueK2 !== void 0 ? _nowData$item$uniqueK2 : '',
|
|
780
726
|
name: item.name
|
|
781
727
|
});
|
|
782
728
|
}
|
|
@@ -1062,31 +1008,21 @@ var transDataSource = function transDataSource(templateColumns) {
|
|
|
1062
1008
|
}));
|
|
1063
1009
|
} else if (nex.workOrderComponentType === 'BS_DEPOSIT') {
|
|
1064
1010
|
return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), item.jsonMap["".concat(nex.uniqueKey, "_bsDeposit")]));
|
|
1065
|
-
} else if (nex.workOrderComponentType === 'REISSUE_LOGISTICS') {
|
|
1066
|
-
var _itemList6 = jsonParseSecurity(item.jsonMap["".concat(nex.uniqueKey, "_reissueLogisticsList")], [{
|
|
1067
|
-
logisticsCompany: null,
|
|
1068
|
-
logisticsCode: null
|
|
1069
|
-
}]);
|
|
1070
|
-
return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), _itemList6));
|
|
1071
|
-
} else if (nex.workOrderComponentType === 'REISSUE_TRADE_ID') {
|
|
1072
|
-
return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), item.jsonMap["".concat(nex.uniqueKey, "_reissueTradeId")]));
|
|
1073
|
-
} else if (nex.workOrderComponentType === 'REISSUE_STATUS') {
|
|
1074
|
-
return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), item.jsonMap["".concat(nex.uniqueKey, "_reissueStatus")]));
|
|
1075
1011
|
} else if (nex.workOrderComponentType === 'BS_LOGISTICS') {
|
|
1076
|
-
var
|
|
1012
|
+
var _itemList6 = jsonParseSecurity(item.jsonMap["".concat(nex.uniqueKey, "_bsLogisticsList")], [{
|
|
1077
1013
|
logisticsCompany: null,
|
|
1078
1014
|
logisticsCode: null
|
|
1079
1015
|
}]);
|
|
1080
|
-
return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey),
|
|
1016
|
+
return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), _itemList6 !== null && _itemList6 !== void 0 && _itemList6.length ? _itemList6 : [{
|
|
1081
1017
|
logisticsCompany: null,
|
|
1082
1018
|
logisticsCode: null
|
|
1083
1019
|
}]));
|
|
1084
1020
|
} else if (nex.workOrderComponentType === 'BS_SEND_GOOD') {
|
|
1085
|
-
var
|
|
1021
|
+
var _itemList7 = jsonParseSecurity(item.jsonMap["".concat(nex.uniqueKey, "_bsSendGood")], [{
|
|
1086
1022
|
sendName: '',
|
|
1087
1023
|
sendId: ''
|
|
1088
1024
|
}]);
|
|
1089
|
-
return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey),
|
|
1025
|
+
return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), _itemList7 !== null && _itemList7 !== void 0 && _itemList7.length ? _itemList7 : [{
|
|
1090
1026
|
sendName: '',
|
|
1091
1027
|
sendId: ''
|
|
1092
1028
|
}]));
|
|
@@ -1153,13 +1089,6 @@ var transDataSource = function transDataSource(templateColumns) {
|
|
|
1153
1089
|
bsExchangeGiftGoods: jsonParseSecurity(item.jsonMap["".concat(nex.uniqueKey, "_bsExchangeGiftGoods")], []),
|
|
1154
1090
|
shopCode: item.jsonMap["".concat(nex.uniqueKey, "_shopCode")]
|
|
1155
1091
|
}));
|
|
1156
|
-
} else if (nex.workOrderComponentType === 'BS_SYSTEM_ORDER') {
|
|
1157
|
-
return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), {
|
|
1158
|
-
orderNo: item.jsonMap["".concat(nex.uniqueKey, "_bsSystemOrderNo")],
|
|
1159
|
-
orders: [],
|
|
1160
|
-
selectIds: jsonParseSecurity(item.jsonMap["".concat(nex.uniqueKey, "_bsSystemSelectIds")], []),
|
|
1161
|
-
showOrderInfo: jsonParseSecurity(item.jsonMap["".concat(nex.uniqueKey, "_bsSystemShowOrder")], [])
|
|
1162
|
-
}));
|
|
1163
1092
|
} else if (nex.workOrderComponentType === 'BUYER_MESSAGE_NOTICE') {
|
|
1164
1093
|
return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), item.jsonMap["".concat(nex.uniqueKey, "_buyerMessageNotice")] || (config === null || config === void 0 ? void 0 : config.select)));
|
|
1165
1094
|
}
|
|
@@ -1241,7 +1170,7 @@ var taobaoGoodHandle = /*#__PURE__*/function () {
|
|
|
1241
1170
|
//订单返填
|
|
1242
1171
|
export var orderBack = /*#__PURE__*/function () {
|
|
1243
1172
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref2) {
|
|
1244
|
-
var order_no, form, shopId, shopList, templateDetail, _ref2$type, type, callback, fromQNCreateWorkOrderByOrderNo, JOIN_SHOP, hasBs, _ref4, shopSourceStr, _ref4$thirdUserNick, thirdUserNick, _data$value, _jstOrder$value, _jstOrder$value$data, _bsOrder$value,
|
|
1173
|
+
var order_no, form, shopId, shopList, templateDetail, _ref2$type, type, callback, fromQNCreateWorkOrderByOrderNo, JOIN_SHOP, hasBs, _ref4, shopSourceStr, _ref4$thirdUserNick, thirdUserNick, _data$value, _jstOrder$value, _jstOrder$value$data, _bsOrder$value, promise, hasJst, _yield$Promise$allSet, _yield$Promise$allSet2, data, jstOrder, bsOrder, orderInfo, jstInfo, bsInfo, formValue, detail, hasSelectItem, erpPromiseList, list, promises, _detail$itemList, values, _templateDetail$compo, paymentUniqueKey, cacheOrderInfo;
|
|
1245
1174
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
1246
1175
|
while (1) switch (_context2.prev = _context2.next) {
|
|
1247
1176
|
case 0:
|
|
@@ -1250,7 +1179,7 @@ export var orderBack = /*#__PURE__*/function () {
|
|
|
1250
1179
|
JOIN_SHOP = shopList.find(function (item) {
|
|
1251
1180
|
return !item.notJoin && item.shopId == shopId;
|
|
1252
1181
|
}); //判断是否有百胜组件 有就请求bs订单接口
|
|
1253
|
-
hasBs = HasFilterHandle(templateDetail, ['BS_SIGNING_TIME', 'BS_SEND_TIME', 'BS_TRADE_PAYMENT_TIME', 'BS_NET_RECEIPTS', 'BS_PACKAGE_WEIGHT', 'BS_GOODS', 'BS_DEPOSIT', 'BS_LOGISTICS', 'BS_SEND_GOOD', 'BS_POSTING'
|
|
1182
|
+
hasBs = HasFilterHandle(templateDetail, ['BS_SIGNING_TIME', 'BS_SEND_TIME', 'BS_TRADE_PAYMENT_TIME', 'BS_NET_RECEIPTS', 'BS_PACKAGE_WEIGHT', 'BS_GOODS', 'BS_DEPOSIT', 'BS_LOGISTICS', 'BS_SEND_GOOD', 'BS_POSTING']); //如果不是对接店铺且百胜组件都没有
|
|
1254
1183
|
if (!(!JOIN_SHOP && !hasBs)) {
|
|
1255
1184
|
_context2.next = 5;
|
|
1256
1185
|
break;
|
|
@@ -1313,13 +1242,7 @@ export var orderBack = /*#__PURE__*/function () {
|
|
|
1313
1242
|
orderInfo = (data === null || data === void 0 ? void 0 : (_data$value = data.value) === null || _data$value === void 0 ? void 0 : _data$value.data) || {};
|
|
1314
1243
|
jstInfo = (jstOrder === null || jstOrder === void 0 ? void 0 : (_jstOrder$value = jstOrder.value) === null || _jstOrder$value === void 0 ? void 0 : (_jstOrder$value$data = _jstOrder$value.data) === null || _jstOrder$value$data === void 0 ? void 0 : _jstOrder$value$data.orders) || [];
|
|
1315
1244
|
bsInfo = (bsOrder === null || bsOrder === void 0 ? void 0 : (_bsOrder$value = bsOrder.value) === null || _bsOrder$value === void 0 ? void 0 : _bsOrder$value.data) || {};
|
|
1316
|
-
|
|
1317
|
-
//如果bs订单信息大于1
|
|
1318
|
-
if ((bsInfo === null || bsInfo === void 0 ? void 0 : (_bsInfo$orders = bsInfo.orders) === null || _bsInfo$orders === void 0 ? void 0 : _bsInfo$orders.length) > 1) {
|
|
1319
|
-
bsInfo.systemOrders = (bsInfo === null || bsInfo === void 0 ? void 0 : bsInfo.orders) || [];
|
|
1320
|
-
delete bsInfo.orders;
|
|
1321
|
-
}
|
|
1322
|
-
|
|
1245
|
+
console.log(bsOrder);
|
|
1323
1246
|
//获取当前表单字段
|
|
1324
1247
|
formValue = form.getFieldsValue();
|
|
1325
1248
|
detail = _objectSpread(_objectSpread({}, orderInfo), {}, {
|
|
@@ -1335,7 +1258,7 @@ export var orderBack = /*#__PURE__*/function () {
|
|
|
1335
1258
|
hasSelectItem = HasErpItemSelectHandle(templateDetail);
|
|
1336
1259
|
erpPromiseList = [];
|
|
1337
1260
|
if (!(shopSourceStr === 'TAOBAO' && hasSelectItem)) {
|
|
1338
|
-
_context2.next =
|
|
1261
|
+
_context2.next = 41;
|
|
1339
1262
|
break;
|
|
1340
1263
|
}
|
|
1341
1264
|
list = detail['itemList'];
|
|
@@ -1350,10 +1273,10 @@ export var orderBack = /*#__PURE__*/function () {
|
|
|
1350
1273
|
}
|
|
1351
1274
|
});
|
|
1352
1275
|
});
|
|
1353
|
-
_context2.prev =
|
|
1354
|
-
_context2.next =
|
|
1276
|
+
_context2.prev = 31;
|
|
1277
|
+
_context2.next = 34;
|
|
1355
1278
|
return Promise.all(promises);
|
|
1356
|
-
case
|
|
1279
|
+
case 34:
|
|
1357
1280
|
erpPromiseList = _context2.sent;
|
|
1358
1281
|
detail['itemList'] = (_detail$itemList = detail['itemList']) === null || _detail$itemList === void 0 ? void 0 : _detail$itemList.map(function (item, index) {
|
|
1359
1282
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
@@ -1363,13 +1286,13 @@ export var orderBack = /*#__PURE__*/function () {
|
|
|
1363
1286
|
})
|
|
1364
1287
|
});
|
|
1365
1288
|
});
|
|
1366
|
-
_context2.next =
|
|
1289
|
+
_context2.next = 41;
|
|
1367
1290
|
break;
|
|
1368
|
-
case
|
|
1369
|
-
_context2.prev =
|
|
1370
|
-
_context2.t0 = _context2["catch"](
|
|
1291
|
+
case 38:
|
|
1292
|
+
_context2.prev = 38;
|
|
1293
|
+
_context2.t0 = _context2["catch"](31);
|
|
1371
1294
|
console.error('调用erp获取宝贝编码错误', _context2.t0);
|
|
1372
|
-
case
|
|
1295
|
+
case 41:
|
|
1373
1296
|
values = orderBackFormValues({
|
|
1374
1297
|
detail: detail,
|
|
1375
1298
|
order_no: order_no,
|
|
@@ -1393,17 +1316,17 @@ export var orderBack = /*#__PURE__*/function () {
|
|
|
1393
1316
|
}
|
|
1394
1317
|
form.setFieldsValue(_objectSpread(_objectSpread({}, formValue), values));
|
|
1395
1318
|
callback === null || callback === void 0 ? void 0 : callback(detail, templateDetail);
|
|
1396
|
-
_context2.next =
|
|
1319
|
+
_context2.next = 50;
|
|
1397
1320
|
break;
|
|
1398
|
-
case
|
|
1399
|
-
_context2.prev =
|
|
1321
|
+
case 47:
|
|
1322
|
+
_context2.prev = 47;
|
|
1400
1323
|
_context2.t1 = _context2["catch"](6);
|
|
1401
1324
|
console.error(_context2.t1);
|
|
1402
|
-
case
|
|
1325
|
+
case 50:
|
|
1403
1326
|
case "end":
|
|
1404
1327
|
return _context2.stop();
|
|
1405
1328
|
}
|
|
1406
|
-
}, _callee2, null, [[6,
|
|
1329
|
+
}, _callee2, null, [[6, 47], [31, 38]]);
|
|
1407
1330
|
}));
|
|
1408
1331
|
return function orderBack(_x) {
|
|
1409
1332
|
return _ref3.apply(this, arguments);
|
|
@@ -1658,6 +1581,7 @@ export var verifyHandle = function verifyHandle(data, componentDtoList) {
|
|
|
1658
1581
|
export var reversalFormValues = function reversalFormValues() {
|
|
1659
1582
|
var templateList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
1660
1583
|
var values = arguments.length > 1 ? arguments[1] : undefined;
|
|
1584
|
+
console.log(templateList, values);
|
|
1661
1585
|
return templateList.reduce(function (prv, next) {
|
|
1662
1586
|
var _values$next$uniqueKe, _values$next$uniqueKe2, _values$next$uniqueKe3, _values$next$uniqueKe4, _values$next$uniqueKe5, _values$next$uniqueKe6;
|
|
1663
1587
|
if (!(values !== null && values !== void 0 && values[next.uniqueKey])) {
|
|
@@ -1709,6 +1633,18 @@ export var reversalFormValues = function reversalFormValues() {
|
|
|
1709
1633
|
}
|
|
1710
1634
|
return prv;
|
|
1711
1635
|
}, {});
|
|
1636
|
+
return Object.keys(values).reduce(function (prv, next) {
|
|
1637
|
+
if (isObject(values[next])) {
|
|
1638
|
+
Object.keys(values[next]).forEach(function (key) {
|
|
1639
|
+
prv["".concat(next, "_").concat(key)] = isArray(values[next][key]) ? JSON.stringify(values[next][key]) : values[next][key];
|
|
1640
|
+
});
|
|
1641
|
+
} else {
|
|
1642
|
+
if (templateKeysMap[next]) {
|
|
1643
|
+
prv["".concat(next, "_").concat(templateKeysMap[next])] = values[next];
|
|
1644
|
+
}
|
|
1645
|
+
}
|
|
1646
|
+
return prv;
|
|
1647
|
+
}, {});
|
|
1712
1648
|
};
|
|
1713
1649
|
|
|
1714
1650
|
//删除缓存数据
|
|
@@ -1723,21 +1659,4 @@ export var deleteCacheOrder = function deleteCacheOrder(templateList, values) {
|
|
|
1723
1659
|
delete getCacheInfo[tradeId];
|
|
1724
1660
|
sessionStorage.setItem('cacheOrderInfo', JSON.stringify(getCacheInfo));
|
|
1725
1661
|
}
|
|
1726
|
-
};
|
|
1727
|
-
export var bsSystemOrderBackValues = function bsSystemOrderBackValues(_ref6) {
|
|
1728
|
-
var _value$selectedRows, _templateList$compone;
|
|
1729
|
-
var templateList = _ref6.templateList,
|
|
1730
|
-
value = _ref6.value,
|
|
1731
|
-
form = _ref6.form;
|
|
1732
|
-
if (!(value !== null && value !== void 0 && (_value$selectedRows = value.selectedRows) !== null && _value$selectedRows !== void 0 && _value$selectedRows.length)) return;
|
|
1733
|
-
var bsGoodsComponent = (_templateList$compone = templateList.componentDtoList) === null || _templateList$compone === void 0 ? void 0 : _templateList$compone.filter(function (item) {
|
|
1734
|
-
return item.workOrderComponentType === 'BS_GOODS';
|
|
1735
|
-
});
|
|
1736
|
-
if (!(bsGoodsComponent !== null && bsGoodsComponent !== void 0 && bsGoodsComponent.length)) return;
|
|
1737
|
-
var values = bsOrderBackFormValues({
|
|
1738
|
-
orders: value.selectedRows
|
|
1739
|
-
}, {
|
|
1740
|
-
componentDtoList: bsGoodsComponent
|
|
1741
|
-
});
|
|
1742
|
-
form.setFieldsValue(values);
|
|
1743
1662
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/kmkf-work-order-service-component",
|
|
3
|
-
"version": "0.8.16-alpha.
|
|
3
|
+
"version": "0.8.16-alpha.2",
|
|
4
4
|
"module": "dist/esm/index.js",
|
|
5
5
|
"typings": "dist/esm/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@ant-design/icons": "^4.7.0",
|
|
35
|
-
"@kmkf-fe-packages/basic-components": "^0.8.
|
|
36
|
-
"@kmkf-fe-packages/kmkf-utils": "^0.8.
|
|
37
|
-
"@kmkf-fe-packages/services-components": "^0.8.16-alpha.
|
|
35
|
+
"@kmkf-fe-packages/basic-components": "^0.8.9",
|
|
36
|
+
"@kmkf-fe-packages/kmkf-utils": "^0.8.9",
|
|
37
|
+
"@kmkf-fe-packages/services-components": "^0.8.16-alpha.2",
|
|
38
38
|
"@reduxjs/toolkit": "^1.8.5",
|
|
39
39
|
"ahooks": "^3.7.4",
|
|
40
40
|
"copy-to-clipboard": "^3.3.3",
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"gitHooks": {
|
|
76
76
|
"pre-commit": "lint-staged"
|
|
77
77
|
},
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "0ca951da22c72e5074f4109818bda7c14faa0bb9"
|
|
79
79
|
}
|