@kmkf-fe-packages/kmkf-work-order-service-component 0.8.16 → 0.8.17-alpha.1
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.
|
@@ -77,9 +77,10 @@ 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, index) {
|
|
81
81
|
var _buttonMap$button;
|
|
82
82
|
return /*#__PURE__*/React.createElement(Button, {
|
|
83
|
+
key: "button".concat(index),
|
|
83
84
|
type: buttonMap[button].type,
|
|
84
85
|
onClick: function onClick() {
|
|
85
86
|
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 } from "../../../common/utils/tools";
|
|
29
|
+
import { calcWorkOrderList, orderBack, getReplaceWarnValues, COMPONENT_MAP_NAME, reversalFormValues, bsSystemOrderBackValues } 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,11 +433,18 @@ 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, workOrderComponentType) {
|
|
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
|
+
}
|
|
441
448
|
};
|
|
442
449
|
//组件失焦事件
|
|
443
450
|
var componentOnBlur = /*#__PURE__*/function () {
|
|
@@ -477,7 +484,7 @@ var FormRender = function FormRender(props) {
|
|
|
477
484
|
setShopId(val);
|
|
478
485
|
// 清空表单字段
|
|
479
486
|
var needClearFormFields = get(templateDetail, 'componentDtoList', []).reduce(function (cur, nxt) {
|
|
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)) {
|
|
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', 'BS_SYSTEM_ORDER'].includes(nxt === null || nxt === void 0 ? void 0 : nxt.workOrderComponentType)) {
|
|
481
488
|
cur.push(nxt === null || nxt === void 0 ? void 0 : nxt.uniqueKey);
|
|
482
489
|
}
|
|
483
490
|
return cur;
|
|
@@ -681,7 +688,7 @@ var FormRender = function FormRender(props) {
|
|
|
681
688
|
return instance.editRender({
|
|
682
689
|
onBlur: componentOnBlur,
|
|
683
690
|
onChange: function onChange(value) {
|
|
684
|
-
return componentOnValueChange(uniqueKey, value);
|
|
691
|
+
return componentOnValueChange(uniqueKey, value, workOrderComponentType);
|
|
685
692
|
},
|
|
686
693
|
hidden: !show || mappdingHideComponents.includes(uniqueKey)
|
|
687
694
|
});
|
|
@@ -690,7 +697,7 @@ var FormRender = function FormRender(props) {
|
|
|
690
697
|
return instance.editRender({
|
|
691
698
|
onBlur: componentOnBlur,
|
|
692
699
|
onChange: function onChange(value) {
|
|
693
|
-
return componentOnValueChange(uniqueKey, value);
|
|
700
|
+
return componentOnValueChange(uniqueKey, value, workOrderComponentType);
|
|
694
701
|
},
|
|
695
702
|
hidden: mappdingHideComponents.includes(uniqueKey)
|
|
696
703
|
});
|
|
@@ -92,4 +92,5 @@ 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;
|
|
95
96
|
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
|
|
20
|
+
import { get, every, maxBy } 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 } from '@kmkf-fe-packages/kmkf-utils';
|
|
24
|
+
import { AddressData, ExpressData, orderBackFormValues, findLabelBySelectValue, request, bsOrderBackFormValues } 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,8 +31,6 @@ 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', //买家旺旺
|
|
36
34
|
SHOP_NAME_INPUT: 'shopName',
|
|
37
35
|
//店铺名称
|
|
38
36
|
RECEIVER_NAME_INPUT: 'receiveName',
|
|
@@ -546,15 +544,80 @@ export var submitDataTransOldFormat = function submitDataTransOldFormat(nowData,
|
|
|
546
544
|
}).join(),
|
|
547
545
|
name: item.name
|
|
548
546
|
});
|
|
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
|
+
}).join(),
|
|
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
|
+
}).join(),
|
|
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 (['REISSUE_STATUS', 'EXCHANGE_STATUS', 'CREATE_STATUS', 'RETURN_GOODS_STATUS'].includes(item.workOrderComponentType)) {
|
|
584
|
+
var STATUS_MAP = {
|
|
585
|
+
REISSUE_STATUS: {
|
|
586
|
+
status: 'reissueStatusValue',
|
|
587
|
+
reason: 'reissueReason'
|
|
588
|
+
},
|
|
589
|
+
EXCHANGE_STATUS: {
|
|
590
|
+
status: 'exchangeStatusValue',
|
|
591
|
+
reason: 'exchangeReason'
|
|
592
|
+
},
|
|
593
|
+
CREATE_STATUS: {
|
|
594
|
+
status: 'createStatusValue',
|
|
595
|
+
reason: 'createReason'
|
|
596
|
+
},
|
|
597
|
+
RETURN_GOODS_STATUS: {
|
|
598
|
+
status: 'returnGoodsStatusValue',
|
|
599
|
+
reason: 'returnGoodsReason'
|
|
600
|
+
}
|
|
601
|
+
};
|
|
602
|
+
contentVoList.push({
|
|
603
|
+
uniqueKey: "".concat(item.uniqueKey, "_").concat(STATUS_MAP[item.workOrderComponentType].status),
|
|
604
|
+
content: get(nowData, "".concat(item.uniqueKey, ".status"), ''),
|
|
605
|
+
name: item.name
|
|
606
|
+
});
|
|
607
|
+
contentVoList.push({
|
|
608
|
+
uniqueKey: "".concat(item.uniqueKey, "_").concat(STATUS_MAP[item.workOrderComponentType].reason),
|
|
609
|
+
content: get(nowData, "".concat(item.uniqueKey, ".reason"), ''),
|
|
610
|
+
name: item.name
|
|
611
|
+
});
|
|
549
612
|
} else if (item.workOrderComponentType === 'BS_LOGISTICS') {
|
|
550
613
|
var bsLogisticsList = get(nowData, "".concat(item.uniqueKey), []);
|
|
551
614
|
var bsLogisticsCompany = bsLogisticsList.map(function (item) {
|
|
552
615
|
return item.logisticsCompany;
|
|
553
616
|
});
|
|
554
|
-
var
|
|
617
|
+
var _hasTrans2 = bsLogisticsCompany.some(function (t) {
|
|
555
618
|
return t && !ExpressData.getInstance().getExpressNameByCode(t, false);
|
|
556
619
|
});
|
|
557
|
-
if (
|
|
620
|
+
if (_hasTrans2) {
|
|
558
621
|
needTransForm = true;
|
|
559
622
|
}
|
|
560
623
|
contentVoList.push({
|
|
@@ -711,6 +774,20 @@ export var submitDataTransOldFormat = function submitDataTransOldFormat(nowData,
|
|
|
711
774
|
content: get(nowData, "".concat(item.uniqueKey, ".postingReceiverMobile"), ''),
|
|
712
775
|
name: item.name
|
|
713
776
|
});
|
|
777
|
+
} else if (item.workOrderComponentType === 'BS_SYSTEM_ORDER') {
|
|
778
|
+
contentVoList.push({
|
|
779
|
+
uniqueKey: "".concat(item.uniqueKey, "_bsSystemOrderNo"),
|
|
780
|
+
content: get(nowData, "".concat(item.uniqueKey, ".orderNo"), ''),
|
|
781
|
+
name: item.name
|
|
782
|
+
}, {
|
|
783
|
+
uniqueKey: "".concat(item.uniqueKey, "_bsSystemSelectIds"),
|
|
784
|
+
content: get(nowData, "".concat(item.uniqueKey, ".selectIds"), ''),
|
|
785
|
+
name: item.name
|
|
786
|
+
}, {
|
|
787
|
+
uniqueKey: "".concat(item.uniqueKey, "_bsSystemShowOrder"),
|
|
788
|
+
content: get(nowData, "".concat(item.uniqueKey, ".showOrderInfo"), ''),
|
|
789
|
+
name: item.name
|
|
790
|
+
});
|
|
714
791
|
} else if (item.workOrderComponentType === 'BUYER_MESSAGE_NOTICE') {
|
|
715
792
|
var _nowData$item$uniqueK;
|
|
716
793
|
contentVoList.push({
|
|
@@ -1008,21 +1085,52 @@ var transDataSource = function transDataSource(templateColumns) {
|
|
|
1008
1085
|
}));
|
|
1009
1086
|
} else if (nex.workOrderComponentType === 'BS_DEPOSIT') {
|
|
1010
1087
|
return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), item.jsonMap["".concat(nex.uniqueKey, "_bsDeposit")]));
|
|
1088
|
+
} else if (nex.workOrderComponentType === 'REISSUE_LOGISTICS') {
|
|
1089
|
+
var _itemList6 = jsonParseSecurity(item.jsonMap["".concat(nex.uniqueKey, "_reissueLogisticsList")], [{
|
|
1090
|
+
logisticsCompany: null,
|
|
1091
|
+
logisticsCode: null
|
|
1092
|
+
}]);
|
|
1093
|
+
return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), _itemList6));
|
|
1094
|
+
} else if (nex.workOrderComponentType === 'REISSUE_TRADE_ID') {
|
|
1095
|
+
return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), item.jsonMap["".concat(nex.uniqueKey, "_reissueTradeId")]));
|
|
1096
|
+
} else if (['REISSUE_STATUS', 'EXCHANGE_STATUS', 'CREATE_STATUS', 'RETURN_GOODS_STATUS'].includes(nex.workOrderComponentType)) {
|
|
1097
|
+
var STATUS_MAP = {
|
|
1098
|
+
REISSUE_STATUS: {
|
|
1099
|
+
status: 'reissueStatusValue',
|
|
1100
|
+
reason: 'reissueReason'
|
|
1101
|
+
},
|
|
1102
|
+
EXCHANGE_STATUS: {
|
|
1103
|
+
status: 'exchangeStatusValue',
|
|
1104
|
+
reason: 'exchangeReason'
|
|
1105
|
+
},
|
|
1106
|
+
CREATE_STATUS: {
|
|
1107
|
+
status: 'createStatusValue',
|
|
1108
|
+
reason: 'createReason'
|
|
1109
|
+
},
|
|
1110
|
+
RETURN_GOODS_STATUS: {
|
|
1111
|
+
status: 'returnGoodsStatusValue',
|
|
1112
|
+
reason: 'returnGoodsReason'
|
|
1113
|
+
}
|
|
1114
|
+
};
|
|
1115
|
+
return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), {
|
|
1116
|
+
status: item.jsonMap["".concat(nex.uniqueKey, "_").concat(STATUS_MAP[nex.workOrderComponentType].status)],
|
|
1117
|
+
reason: item.jsonMap["".concat(nex.uniqueKey, "_").concat(STATUS_MAP[nex.workOrderComponentType].reason)]
|
|
1118
|
+
}));
|
|
1011
1119
|
} else if (nex.workOrderComponentType === 'BS_LOGISTICS') {
|
|
1012
|
-
var
|
|
1120
|
+
var _itemList7 = jsonParseSecurity(item.jsonMap["".concat(nex.uniqueKey, "_bsLogisticsList")], [{
|
|
1013
1121
|
logisticsCompany: null,
|
|
1014
1122
|
logisticsCode: null
|
|
1015
1123
|
}]);
|
|
1016
|
-
return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey),
|
|
1124
|
+
return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), _itemList7 !== null && _itemList7 !== void 0 && _itemList7.length ? _itemList7 : [{
|
|
1017
1125
|
logisticsCompany: null,
|
|
1018
1126
|
logisticsCode: null
|
|
1019
1127
|
}]));
|
|
1020
1128
|
} else if (nex.workOrderComponentType === 'BS_SEND_GOOD') {
|
|
1021
|
-
var
|
|
1129
|
+
var _itemList8 = jsonParseSecurity(item.jsonMap["".concat(nex.uniqueKey, "_bsSendGood")], [{
|
|
1022
1130
|
sendName: '',
|
|
1023
1131
|
sendId: ''
|
|
1024
1132
|
}]);
|
|
1025
|
-
return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey),
|
|
1133
|
+
return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), _itemList8 !== null && _itemList8 !== void 0 && _itemList8.length ? _itemList8 : [{
|
|
1026
1134
|
sendName: '',
|
|
1027
1135
|
sendId: ''
|
|
1028
1136
|
}]));
|
|
@@ -1089,6 +1197,13 @@ var transDataSource = function transDataSource(templateColumns) {
|
|
|
1089
1197
|
bsExchangeGiftGoods: jsonParseSecurity(item.jsonMap["".concat(nex.uniqueKey, "_bsExchangeGiftGoods")], []),
|
|
1090
1198
|
shopCode: item.jsonMap["".concat(nex.uniqueKey, "_shopCode")]
|
|
1091
1199
|
}));
|
|
1200
|
+
} else if (nex.workOrderComponentType === 'BS_SYSTEM_ORDER') {
|
|
1201
|
+
return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), {
|
|
1202
|
+
orderNo: item.jsonMap["".concat(nex.uniqueKey, "_bsSystemOrderNo")],
|
|
1203
|
+
orders: [],
|
|
1204
|
+
selectIds: jsonParseSecurity(item.jsonMap["".concat(nex.uniqueKey, "_bsSystemSelectIds")], []),
|
|
1205
|
+
showOrderInfo: jsonParseSecurity(item.jsonMap["".concat(nex.uniqueKey, "_bsSystemShowOrder")], [])
|
|
1206
|
+
}));
|
|
1092
1207
|
} else if (nex.workOrderComponentType === 'BUYER_MESSAGE_NOTICE') {
|
|
1093
1208
|
return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), item.jsonMap["".concat(nex.uniqueKey, "_buyerMessageNotice")] || (config === null || config === void 0 ? void 0 : config.select)));
|
|
1094
1209
|
}
|
|
@@ -1170,7 +1285,7 @@ var taobaoGoodHandle = /*#__PURE__*/function () {
|
|
|
1170
1285
|
//订单返填
|
|
1171
1286
|
export var orderBack = /*#__PURE__*/function () {
|
|
1172
1287
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref2) {
|
|
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;
|
|
1288
|
+
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, _bsInfo$orders, 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;
|
|
1174
1289
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
1175
1290
|
while (1) switch (_context2.prev = _context2.next) {
|
|
1176
1291
|
case 0:
|
|
@@ -1179,7 +1294,7 @@ export var orderBack = /*#__PURE__*/function () {
|
|
|
1179
1294
|
JOIN_SHOP = shopList.find(function (item) {
|
|
1180
1295
|
return !item.notJoin && item.shopId == shopId;
|
|
1181
1296
|
}); //判断是否有百胜组件 有就请求bs订单接口
|
|
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']); //如果不是对接店铺且百胜组件都没有
|
|
1297
|
+
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', 'BS_SYSTEM_ORDER']); //如果不是对接店铺且百胜组件都没有
|
|
1183
1298
|
if (!(!JOIN_SHOP && !hasBs)) {
|
|
1184
1299
|
_context2.next = 5;
|
|
1185
1300
|
break;
|
|
@@ -1242,7 +1357,13 @@ export var orderBack = /*#__PURE__*/function () {
|
|
|
1242
1357
|
orderInfo = (data === null || data === void 0 ? void 0 : (_data$value = data.value) === null || _data$value === void 0 ? void 0 : _data$value.data) || {};
|
|
1243
1358
|
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) || [];
|
|
1244
1359
|
bsInfo = (bsOrder === null || bsOrder === void 0 ? void 0 : (_bsOrder$value = bsOrder.value) === null || _bsOrder$value === void 0 ? void 0 : _bsOrder$value.data) || {};
|
|
1245
|
-
|
|
1360
|
+
bsInfo.systemOrders = [];
|
|
1361
|
+
//如果bs订单信息大于1
|
|
1362
|
+
if ((bsInfo === null || bsInfo === void 0 ? void 0 : (_bsInfo$orders = bsInfo.orders) === null || _bsInfo$orders === void 0 ? void 0 : _bsInfo$orders.length) > 1) {
|
|
1363
|
+
bsInfo.systemOrders = (bsInfo === null || bsInfo === void 0 ? void 0 : bsInfo.orders) || [];
|
|
1364
|
+
delete bsInfo.orders;
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1246
1367
|
//获取当前表单字段
|
|
1247
1368
|
formValue = form.getFieldsValue();
|
|
1248
1369
|
detail = _objectSpread(_objectSpread({}, orderInfo), {}, {
|
|
@@ -1258,7 +1379,7 @@ export var orderBack = /*#__PURE__*/function () {
|
|
|
1258
1379
|
hasSelectItem = HasErpItemSelectHandle(templateDetail);
|
|
1259
1380
|
erpPromiseList = [];
|
|
1260
1381
|
if (!(shopSourceStr === 'TAOBAO' && hasSelectItem)) {
|
|
1261
|
-
_context2.next =
|
|
1382
|
+
_context2.next = 42;
|
|
1262
1383
|
break;
|
|
1263
1384
|
}
|
|
1264
1385
|
list = detail['itemList'];
|
|
@@ -1273,10 +1394,10 @@ export var orderBack = /*#__PURE__*/function () {
|
|
|
1273
1394
|
}
|
|
1274
1395
|
});
|
|
1275
1396
|
});
|
|
1276
|
-
_context2.prev =
|
|
1277
|
-
_context2.next =
|
|
1397
|
+
_context2.prev = 32;
|
|
1398
|
+
_context2.next = 35;
|
|
1278
1399
|
return Promise.all(promises);
|
|
1279
|
-
case
|
|
1400
|
+
case 35:
|
|
1280
1401
|
erpPromiseList = _context2.sent;
|
|
1281
1402
|
detail['itemList'] = (_detail$itemList = detail['itemList']) === null || _detail$itemList === void 0 ? void 0 : _detail$itemList.map(function (item, index) {
|
|
1282
1403
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
@@ -1286,13 +1407,13 @@ export var orderBack = /*#__PURE__*/function () {
|
|
|
1286
1407
|
})
|
|
1287
1408
|
});
|
|
1288
1409
|
});
|
|
1289
|
-
_context2.next =
|
|
1410
|
+
_context2.next = 42;
|
|
1290
1411
|
break;
|
|
1291
|
-
case
|
|
1292
|
-
_context2.prev =
|
|
1293
|
-
_context2.t0 = _context2["catch"](
|
|
1412
|
+
case 39:
|
|
1413
|
+
_context2.prev = 39;
|
|
1414
|
+
_context2.t0 = _context2["catch"](32);
|
|
1294
1415
|
console.error('调用erp获取宝贝编码错误', _context2.t0);
|
|
1295
|
-
case
|
|
1416
|
+
case 42:
|
|
1296
1417
|
values = orderBackFormValues({
|
|
1297
1418
|
detail: detail,
|
|
1298
1419
|
order_no: order_no,
|
|
@@ -1316,17 +1437,17 @@ export var orderBack = /*#__PURE__*/function () {
|
|
|
1316
1437
|
}
|
|
1317
1438
|
form.setFieldsValue(_objectSpread(_objectSpread({}, formValue), values));
|
|
1318
1439
|
callback === null || callback === void 0 ? void 0 : callback(detail, templateDetail);
|
|
1319
|
-
_context2.next =
|
|
1440
|
+
_context2.next = 51;
|
|
1320
1441
|
break;
|
|
1321
|
-
case
|
|
1322
|
-
_context2.prev =
|
|
1442
|
+
case 48:
|
|
1443
|
+
_context2.prev = 48;
|
|
1323
1444
|
_context2.t1 = _context2["catch"](6);
|
|
1324
1445
|
console.error(_context2.t1);
|
|
1325
|
-
case
|
|
1446
|
+
case 51:
|
|
1326
1447
|
case "end":
|
|
1327
1448
|
return _context2.stop();
|
|
1328
1449
|
}
|
|
1329
|
-
}, _callee2, null, [[6,
|
|
1450
|
+
}, _callee2, null, [[6, 48], [32, 39]]);
|
|
1330
1451
|
}));
|
|
1331
1452
|
return function orderBack(_x) {
|
|
1332
1453
|
return _ref3.apply(this, arguments);
|
|
@@ -1581,7 +1702,6 @@ export var verifyHandle = function verifyHandle(data, componentDtoList) {
|
|
|
1581
1702
|
export var reversalFormValues = function reversalFormValues() {
|
|
1582
1703
|
var templateList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
1583
1704
|
var values = arguments.length > 1 ? arguments[1] : undefined;
|
|
1584
|
-
console.log(templateList, values);
|
|
1585
1705
|
return templateList.reduce(function (prv, next) {
|
|
1586
1706
|
var _values$next$uniqueKe, _values$next$uniqueKe2, _values$next$uniqueKe3, _values$next$uniqueKe4, _values$next$uniqueKe5, _values$next$uniqueKe6;
|
|
1587
1707
|
if (!(values !== null && values !== void 0 && values[next.uniqueKey])) {
|
|
@@ -1633,18 +1753,6 @@ export var reversalFormValues = function reversalFormValues() {
|
|
|
1633
1753
|
}
|
|
1634
1754
|
return prv;
|
|
1635
1755
|
}, {});
|
|
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
|
-
}, {});
|
|
1648
1756
|
};
|
|
1649
1757
|
|
|
1650
1758
|
//删除缓存数据
|
|
@@ -1659,4 +1767,21 @@ export var deleteCacheOrder = function deleteCacheOrder(templateList, values) {
|
|
|
1659
1767
|
delete getCacheInfo[tradeId];
|
|
1660
1768
|
sessionStorage.setItem('cacheOrderInfo', JSON.stringify(getCacheInfo));
|
|
1661
1769
|
}
|
|
1770
|
+
};
|
|
1771
|
+
export var bsSystemOrderBackValues = function bsSystemOrderBackValues(_ref6) {
|
|
1772
|
+
var _value$selectedRows, _templateList$compone;
|
|
1773
|
+
var templateList = _ref6.templateList,
|
|
1774
|
+
value = _ref6.value,
|
|
1775
|
+
form = _ref6.form;
|
|
1776
|
+
if (!(value !== null && value !== void 0 && (_value$selectedRows = value.selectedRows) !== null && _value$selectedRows !== void 0 && _value$selectedRows.length)) return;
|
|
1777
|
+
var bsGoodsComponent = (_templateList$compone = templateList.componentDtoList) === null || _templateList$compone === void 0 ? void 0 : _templateList$compone.filter(function (item) {
|
|
1778
|
+
return item.workOrderComponentType === 'BS_GOODS';
|
|
1779
|
+
});
|
|
1780
|
+
if (!(bsGoodsComponent !== null && bsGoodsComponent !== void 0 && bsGoodsComponent.length)) return;
|
|
1781
|
+
var values = bsOrderBackFormValues({
|
|
1782
|
+
orders: value.selectedRows
|
|
1783
|
+
}, {
|
|
1784
|
+
componentDtoList: bsGoodsComponent
|
|
1785
|
+
});
|
|
1786
|
+
form.setFieldsValue(values);
|
|
1662
1787
|
};
|
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.
|
|
3
|
+
"version": "0.8.17-alpha.1",
|
|
4
4
|
"module": "dist/esm/index.js",
|
|
5
5
|
"typings": "dist/esm/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@ant-design/icons": "^4.7.0",
|
|
35
35
|
"@kmkf-fe-packages/basic-components": "^0.8.9",
|
|
36
36
|
"@kmkf-fe-packages/kmkf-utils": "^0.8.9",
|
|
37
|
-
"@kmkf-fe-packages/services-components": "^0.8.
|
|
37
|
+
"@kmkf-fe-packages/services-components": "^0.8.17-alpha.1",
|
|
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": "4d96e54eb4d5bf04c6189fbfe2655d76f3eaffb4"
|
|
79
79
|
}
|