@kmkf-fe-packages/kmkf-utils 2.3.19-beta.16 → 2.3.19-beta.20

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.
@@ -72,6 +72,7 @@ export declare const DATA_SPLIT_COMPONENT_FIELDS_MAP: {
72
72
  BS_RETURN_GOODS: string[];
73
73
  BS_SYSTEM_ORDER: string[];
74
74
  KM_SYSTEM_ORDER: string[];
75
+ PLATFORM_AFTER_SALES_ORDER: string[];
75
76
  BS_E3_SYSTEM_ORDER: string[];
76
77
  WLN_SYSTEM_ORDER: string[];
77
78
  WLN_GOODS: string[];
@@ -145,6 +145,7 @@ export var DATA_SPLIT_COMPONENT_FIELDS_MAP = {
145
145
  BS_RETURN_GOODS: ["bsReturnGoods"],
146
146
  BS_SYSTEM_ORDER: ["bsSystemShowOrder"],
147
147
  KM_SYSTEM_ORDER: ["kmSystemShowOrder"],
148
+ PLATFORM_AFTER_SALES_ORDER: ["platformAfaterSalesShowOrder"],
148
149
  BS_E3_SYSTEM_ORDER: ["bsE3SystemShowOrder"],
149
150
  WLN_SYSTEM_ORDER: ["wlnSystemShowOrder"],
150
151
  WLN_GOODS: ["wlnGoods"],
@@ -0,0 +1,50 @@
1
+ export declare const JST_SYSTEM_ORDER_CONFIG: {
2
+ key: string;
3
+ name: string;
4
+ selectId: string;
5
+ orderNo: string;
6
+ columns: {
7
+ dataIndex: string;
8
+ title: string;
9
+ width: number;
10
+ }[];
11
+ };
12
+ export declare const JST_ORDER_STATUS_MAP: Record<number, string>;
13
+ export declare const updateJstGoodsHandle: (orders?: any[], options?: {
14
+ canEdit?: boolean;
15
+ orderBackGoodsLevel?: string;
16
+ }) => any;
17
+ export declare const jstMergeIdenticalGoods: <T extends {
18
+ skuId: string;
19
+ qty: number;
20
+ systemOrderNo: string;
21
+ }>(goodDetails?: T[]) => T[];
22
+ export declare const jstOrderBackFormValues: (detail?: any, templateDetail?: any) => any;
23
+ export declare const jstOrderTransform: (detail: any, form: any) => {
24
+ jstSystemOrder: {
25
+ isRequest: boolean;
26
+ orderNo: any;
27
+ orders: any;
28
+ selectIds: any;
29
+ showOrderInfo: any;
30
+ };
31
+ jstReturnSystemOrderNo: any;
32
+ jstSystemOrderNo: any;
33
+ jstReissueGoods: any;
34
+ jstReturnGoods: any;
35
+ jstSystemOrderBillType: any;
36
+ jstReturnSystemOrderBillType: any;
37
+ jstGoods: {
38
+ isRequest: boolean;
39
+ allOrders: any;
40
+ orders: any;
41
+ orderNo: any;
42
+ shopCode: any;
43
+ jstGoods: any;
44
+ };
45
+ jstLogistics: any;
46
+ jstSendGood: any;
47
+ jstSupply: any;
48
+ jstItemSelectThird: any;
49
+ };
50
+ export declare const filterJstOrders: (detail: any, order_no: string) => any;
@@ -0,0 +1,380 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
3
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
5
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
6
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
7
+ 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; }
8
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
9
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
10
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
11
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
12
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
13
+ import uuid from "./getUUid";
14
+ import { SendDataCenter } from "./SendData";
15
+ import isNull from "./isNull";
16
+ export var JST_SYSTEM_ORDER_CONFIG = {
17
+ key: "jstSystemShowOrder",
18
+ name: "聚水潭",
19
+ selectId: "jstSystemSelectIds",
20
+ orderNo: "jstSystemOrderNo",
21
+ columns: [{
22
+ dataIndex: "orderType",
23
+ title: "订单类型",
24
+ width: 150
25
+ }, {
26
+ dataIndex: "oId",
27
+ title: "系统订单号",
28
+ width: 160
29
+ }, {
30
+ dataIndex: "labels",
31
+ title: "订单标签",
32
+ width: 150
33
+ }, {
34
+ dataIndex: "mergeSoId",
35
+ title: "合并订单号",
36
+ width: 160
37
+ }]
38
+ };
39
+ export var JST_ORDER_STATUS_MAP = {
40
+ 0: "未确认",
41
+ 1: "已确认",
42
+ 3: "已作废",
43
+ 5: "已完成"
44
+ };
45
+ export var updateJstGoodsHandle = function updateJstGoodsHandle() {
46
+ var orders = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
47
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
48
+ canEdit: false,
49
+ orderBackGoodsLevel: "1"
50
+ };
51
+ var wrapItem = function wrapItem(item, systemOrderNo) {
52
+ var _item$uuid;
53
+ item.canDelete = true;
54
+ item.canEdit = !!options.canEdit;
55
+ item.uuid = (_item$uuid = item.uuid) !== null && _item$uuid !== void 0 ? _item$uuid : uuid();
56
+ item.systemOrderNo = systemOrderNo;
57
+ return _objectSpread({}, item);
58
+ };
59
+ var list = orders.reduce(function (prv, next) {
60
+ if (options.orderBackGoodsLevel !== "2") {
61
+ var _next$items;
62
+ // 反填子商品
63
+ next === null || next === void 0 ? void 0 : (_next$items = next.items) === null || _next$items === void 0 ? void 0 : _next$items.forEach(function (item) {
64
+ if (item.skuType === 'combine') {
65
+ item.subItems.forEach(function (subItem) {
66
+ var newSubItem = wrapItem(subItem, next === null || next === void 0 ? void 0 : next.oId);
67
+ newSubItem.batchId = item.batchId;
68
+ newSubItem.isGift = item.isGift;
69
+ newSubItem.qty = subItem.qty * item.qty;
70
+ prv.push(newSubItem);
71
+ });
72
+ } else {
73
+ prv.push(wrapItem(item, next === null || next === void 0 ? void 0 : next.oId));
74
+ }
75
+ });
76
+ } else {
77
+ var _next$items2;
78
+ // 反填组合商品
79
+ var goods = (next === null || next === void 0 ? void 0 : (_next$items2 = next.items) === null || _next$items2 === void 0 ? void 0 : _next$items2.map(function (item) {
80
+ return wrapItem(item, next === null || next === void 0 ? void 0 : next.oId);
81
+ })) || [];
82
+ prv.push.apply(prv, _toConsumableArray(goods));
83
+ }
84
+ return prv;
85
+ }, []);
86
+ return list;
87
+ };
88
+ var updateJstItemListHandle = function updateJstItemListHandle(list, type, comList, form) {
89
+ var _newList;
90
+ if (type === "logistics") {
91
+ var _comList$find, _currentCom$component;
92
+ var currentCom = comList === null || comList === void 0 ? void 0 : (_comList$find = comList.find) === null || _comList$find === void 0 ? void 0 : _comList$find.call(comList, function (item) {
93
+ return item.workOrderComponentType === "JST_LOGISTICS";
94
+ });
95
+ var notOrderBack = (currentCom === null || currentCom === void 0 ? void 0 : (_currentCom$component = currentCom.componentConfig) === null || _currentCom$component === void 0 ? void 0 : _currentCom$component.notOrderBack) || false;
96
+ if (notOrderBack) {
97
+ var _currentValue;
98
+ var currentValue = form.getFieldValue(currentCom.uniqueKey);
99
+ currentValue = (_currentValue = currentValue) !== null && _currentValue !== void 0 && _currentValue.length ? currentValue : [{
100
+ logisticsCode: "",
101
+ logisticsCompany: ""
102
+ }];
103
+ return currentValue;
104
+ }
105
+ } else if (type === "send") {
106
+ var _comList$find2, _currentCom$component2;
107
+ var _currentCom = comList === null || comList === void 0 ? void 0 : (_comList$find2 = comList.find) === null || _comList$find2 === void 0 ? void 0 : _comList$find2.call(comList, function (item) {
108
+ return item.workOrderComponentType === "JST_SEND_GOOD";
109
+ });
110
+ var _notOrderBack = (_currentCom === null || _currentCom === void 0 ? void 0 : (_currentCom$component2 = _currentCom.componentConfig) === null || _currentCom$component2 === void 0 ? void 0 : _currentCom$component2.notOrderBack) || false;
111
+ if (_notOrderBack) {
112
+ var _currentValue3;
113
+ var _currentValue2 = form.getFieldValue(_currentCom.uniqueKey);
114
+ _currentValue2 = (_currentValue3 = _currentValue2) !== null && _currentValue3 !== void 0 && _currentValue3.length ? _currentValue2 : [{
115
+ sendId: "",
116
+ sendName: ""
117
+ }];
118
+ return _currentValue2;
119
+ }
120
+ }
121
+ var newList = list === null || list === void 0 ? void 0 : list.reduce(function (prv, next) {
122
+ var items = ((next === null || next === void 0 ? void 0 : next.items) || []).map(function (t) {
123
+ return _objectSpread({
124
+ title: (t === null || t === void 0 ? void 0 : t.name) || "",
125
+ picUrl: (t === null || t === void 0 ? void 0 : t.pic) || "",
126
+ platform: "jst"
127
+ }, type === "itemList" ? {
128
+ itemId: t === null || t === void 0 ? void 0 : t.supplierId,
129
+ supplierName: t === null || t === void 0 ? void 0 : t.supplierName
130
+ } : {
131
+ skuId: (t === null || t === void 0 ? void 0 : t.skuId) || ""
132
+ });
133
+ });
134
+ var params = {
135
+ items: items
136
+ };
137
+ if (type === "logistics") {
138
+ params.logisticsCompany = next === null || next === void 0 ? void 0 : next.logisticsCompany;
139
+ params.logisticsCode = next === null || next === void 0 ? void 0 : next.lId;
140
+ } else if (type === "send") {
141
+ var wmsCoId = (next === null || next === void 0 ? void 0 : next.wmsCoId) === "0" ? SendDataCenter.getInstance("jst").getMainWmsCoId() : "".concat(next === null || next === void 0 ? void 0 : next.wmsCoId);
142
+ params.sendId = wmsCoId;
143
+ params.sendName = wmsCoId && SendDataCenter.getInstance("jst").getSendNameByCode(wmsCoId);
144
+ params.sendSnapshotId = wmsCoId;
145
+ } else if (type === "supply") {
146
+ params.supplyId = next === null || next === void 0 ? void 0 : next.drpCoIdTo;
147
+ params.supplyName = next === null || next === void 0 ? void 0 : next.drpCoName;
148
+ }
149
+ if (type === "itemList") {
150
+ prv.push.apply(prv, _toConsumableArray(items.map(function (itemListItem) {
151
+ return _objectSpread({}, itemListItem);
152
+ })));
153
+ } else {
154
+ prv.push(params);
155
+ }
156
+ return prv;
157
+ }, []);
158
+ if (!((_newList = newList) !== null && _newList !== void 0 && _newList.length)) {
159
+ switch (type) {
160
+ case "logistics":
161
+ newList = [{
162
+ logisticsCode: ""
163
+ }];
164
+ break;
165
+ case "supply":
166
+ newList = [{
167
+ supplyName: "",
168
+ supplyId: ""
169
+ }];
170
+ break;
171
+ case "send":
172
+ newList = [{
173
+ sendId: "",
174
+ sendName: ""
175
+ }];
176
+ break;
177
+ }
178
+ }
179
+ return newList;
180
+ };
181
+ var updateJstItemListByConfigHandle = function updateJstItemListByConfigHandle(list, type) {
182
+ var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
183
+ var showField = config.showField,
184
+ enableItemId = config.enableItemId,
185
+ enableSupplierName = config.enableSupplierName;
186
+ return list === null || list === void 0 ? void 0 : list.reduce(function (prv, next) {
187
+ if (type === "logistics") {
188
+ if (!["logisticsCompany", ""].includes(showField || "")) {
189
+ next.logisticsCompany = undefined;
190
+ }
191
+ if (!["logisticsCode", ""].includes(showField || "")) {
192
+ next.logisticsCode = undefined;
193
+ }
194
+ } else if (type === "send") {
195
+ if (!["sendId", "all"].includes(showField || "")) {
196
+ next.sendId = undefined;
197
+ }
198
+ if (!["sendName", "all"].includes(showField || "")) {
199
+ next.sendName = undefined;
200
+ }
201
+ } else if (type === "supply") {
202
+ if (!["supplyId", "all"].includes(showField || "")) {
203
+ next.supplyId = undefined;
204
+ }
205
+ if (!["supplyName", "all"].includes(showField || "")) {
206
+ next.supplyName = undefined;
207
+ }
208
+ } else if (type === "itemList") {
209
+ if (!enableItemId) {
210
+ next.itemId = undefined;
211
+ }
212
+ if (!enableSupplierName) {
213
+ next.supplierName = undefined;
214
+ }
215
+ }
216
+ prv.push(next);
217
+ return prv;
218
+ }, []);
219
+ };
220
+ export var jstMergeIdenticalGoods = function jstMergeIdenticalGoods() {
221
+ var goodDetails = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
222
+ var list = [];
223
+ if (goodDetails.length) {
224
+ var obj = {};
225
+ goodDetails.forEach(function (goods) {
226
+ var goodIndex = obj["".concat(goods.systemOrderNo, "_").concat(goods.skuId)];
227
+ if (typeof goodIndex !== "number") {
228
+ obj["".concat(goods.systemOrderNo, "_").concat(goods.skuId)] = list.length;
229
+ list.push(goods);
230
+ } else {
231
+ list[goodIndex].qty = (list[goodIndex].qty || 0) + (goods.qty || 0);
232
+ }
233
+ });
234
+ }
235
+ return list;
236
+ };
237
+ export var jstOrderBackFormValues = function jstOrderBackFormValues() {
238
+ var detail = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
239
+ var templateDetail = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
240
+ return ((templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.componentDtoList) || []).reduce(function (prv, next) {
241
+ var uniqueKey = next.uniqueKey;
242
+ var config = next.componentConfig;
243
+ switch (next.workOrderComponentType) {
244
+ case "JST_SYSTEM_ORDER":
245
+ prv[uniqueKey] = detail === null || detail === void 0 ? void 0 : detail.jstSystemOrder;
246
+ break;
247
+ case "JST_GOODS":
248
+ prv[uniqueKey] = detail === null || detail === void 0 ? void 0 : detail.jstGoods;
249
+ break;
250
+ case "JST_REISSUE_GOODS":
251
+ {
252
+ var initReason = !isNull(config === null || config === void 0 ? void 0 : config.initReason) ? config.initReason : "1";
253
+ prv[uniqueKey] = {
254
+ jstSystemOrder: detail === null || detail === void 0 ? void 0 : detail.jstSystemOrder,
255
+ jstSystemOrderNo: detail === null || detail === void 0 ? void 0 : detail.jstSystemOrderNo,
256
+ jstReissueType: [initReason],
257
+ jstReissueGoods: initReason === "2" ? [] : jstMergeIdenticalGoods((detail === null || detail === void 0 ? void 0 : detail.jstReissueGoods) || []),
258
+ jstSystemOrderBillType: (detail === null || detail === void 0 ? void 0 : detail.jstSystemOrderBillType) || ""
259
+ };
260
+ }
261
+ break;
262
+ case "JST_RETURN_GOODS":
263
+ {
264
+ var _initReason = !isNull(config === null || config === void 0 ? void 0 : config.initReason) ? config.initReason : "1";
265
+ prv[uniqueKey] = {
266
+ jstSystemOrder: detail === null || detail === void 0 ? void 0 : detail.jstSystemOrder,
267
+ jstSystemOrderNo: detail === null || detail === void 0 ? void 0 : detail.jstReturnSystemOrderNo,
268
+ jstReturnType: [_initReason],
269
+ jstReturnGoods: _initReason === "2" ? [] : jstMergeIdenticalGoods((detail === null || detail === void 0 ? void 0 : detail.jstReturnGoods) || []),
270
+ jstSystemOrderBillType: (detail === null || detail === void 0 ? void 0 : detail.jstReturnSystemOrderBillType) || ""
271
+ };
272
+ }
273
+ break;
274
+ case "JST_ITEM_SELECT_THIRD":
275
+ prv[uniqueKey] = updateJstItemListByConfigHandle(detail === null || detail === void 0 ? void 0 : detail.jstItemSelectThird, "itemList", config);
276
+ break;
277
+ case "JST_SUPPLY":
278
+ prv[uniqueKey] = updateJstItemListByConfigHandle(detail === null || detail === void 0 ? void 0 : detail.jstSupply, "supply", config);
279
+ break;
280
+ case "JST_LOGISTICS":
281
+ prv[uniqueKey] = updateJstItemListByConfigHandle(detail === null || detail === void 0 ? void 0 : detail.jstLogistics, "logistics", config);
282
+ break;
283
+ case "JST_SEND_GOOD":
284
+ prv[uniqueKey] = updateJstItemListByConfigHandle(detail === null || detail === void 0 ? void 0 : detail.jstSendGood, "send", config);
285
+ break;
286
+ }
287
+ return prv;
288
+ }, {});
289
+ };
290
+ //jst订单信息转换
291
+ export var jstOrderTransform = function jstOrderTransform(detail, form) {
292
+ var _form$getFieldValue, _jstReissueCom$compon, _jstReturnCom$compone, _newOrderList$, _newOrderList$2, _jstReissueCom$compon2, _newOrderList$3, _newOrderList$4, _orderList$find, _orderList$find$call, _jstGoodsCom$componen;
293
+ var orderNo = detail.orderNo,
294
+ _detail$orderList = detail.orderList,
295
+ orderList = _detail$orderList === void 0 ? [] : _detail$orderList,
296
+ componentList = detail.componentList,
297
+ _detail$allOrders = detail.allOrders,
298
+ allOrders = _detail$allOrders === void 0 ? [] : _detail$allOrders;
299
+ var jstGoodsCom = (componentList || []).find(function (com) {
300
+ return com.workOrderComponentType === "JST_GOODS";
301
+ });
302
+ var jstReissueCom = (componentList || []).find(function (com) {
303
+ return com.workOrderComponentType === "JST_REISSUE_GOODS";
304
+ });
305
+ var jstReturnCom = (componentList || []).find(function (com) {
306
+ return com.workOrderComponentType === "JST_RETURN_GOODS";
307
+ });
308
+ var isStrict = jstGoodsCom ? (_form$getFieldValue = form.getFieldValue(jstGoodsCom.uniqueKey)) === null || _form$getFieldValue === void 0 ? void 0 : _form$getFieldValue.isStrict : false;
309
+ var newOrderList = orderList === null || orderList === void 0 ? void 0 : orderList.map(function (item) {
310
+ return _objectSpread({}, item);
311
+ });
312
+ var onlyOneSystemOrder = (newOrderList === null || newOrderList === void 0 ? void 0 : newOrderList.length) === 1;
313
+ var isReissueDefaultSelect = !!(jstReissueCom !== null && jstReissueCom !== void 0 && (_jstReissueCom$compon = jstReissueCom.componentConfig) !== null && _jstReissueCom$compon !== void 0 && _jstReissueCom$compon.showDefaultSelect);
314
+ var isReturnDefaultSelect = !!(jstReturnCom !== null && jstReturnCom !== void 0 && (_jstReturnCom$compone = jstReturnCom.componentConfig) !== null && _jstReturnCom$compone !== void 0 && _jstReturnCom$compone.showDefaultSelect);
315
+ var defaultOrder = newOrderList !== null && newOrderList !== void 0 && newOrderList[0] ? [newOrderList[0]] : [];
316
+ return {
317
+ jstSystemOrder: {
318
+ //标记通过请求获取的值
319
+ isRequest: true,
320
+ orderNo: orderNo,
321
+ orders: newOrderList,
322
+ selectIds: onlyOneSystemOrder ? orderList.map(function (item) {
323
+ return item.oId;
324
+ }) : [],
325
+ showOrderInfo: newOrderList
326
+ },
327
+ jstReturnSystemOrderNo: onlyOneSystemOrder || isReturnDefaultSelect ? (_newOrderList$ = newOrderList[0]) === null || _newOrderList$ === void 0 ? void 0 : _newOrderList$.oId : undefined,
328
+ // TODO: 当只有一条系统单时默认选中该系统单
329
+ jstSystemOrderNo: onlyOneSystemOrder || isReissueDefaultSelect ? (_newOrderList$2 = newOrderList[0]) === null || _newOrderList$2 === void 0 ? void 0 : _newOrderList$2.oId : undefined,
330
+ jstReissueGoods: onlyOneSystemOrder || isReissueDefaultSelect ? updateJstGoodsHandle(defaultOrder, {
331
+ orderBackGoodsLevel: jstReissueCom === null || jstReissueCom === void 0 ? void 0 : (_jstReissueCom$compon2 = jstReissueCom.componentConfig) === null || _jstReissueCom$compon2 === void 0 ? void 0 : _jstReissueCom$compon2.orderBackGoodsLevel,
332
+ canEdit: true
333
+ }).filter(function (good) {
334
+ return !isStrict || !orderNo || good.originalDealCode === orderNo;
335
+ }) : [],
336
+ jstReturnGoods: onlyOneSystemOrder || isReturnDefaultSelect ? updateJstGoodsHandle(defaultOrder, {
337
+ canEdit: true
338
+ }).filter(function (good) {
339
+ return !isStrict || !orderNo || good.originalDealCode === orderNo;
340
+ }) : [],
341
+ jstSystemOrderBillType: onlyOneSystemOrder || isReissueDefaultSelect ? (_newOrderList$3 = newOrderList[0]) === null || _newOrderList$3 === void 0 ? void 0 : _newOrderList$3.orderType : "",
342
+ jstReturnSystemOrderBillType: onlyOneSystemOrder || isReturnDefaultSelect ? (_newOrderList$4 = newOrderList[0]) === null || _newOrderList$4 === void 0 ? void 0 : _newOrderList$4.orderType : "",
343
+ jstGoods: {
344
+ //标记通过请求获取的值
345
+ isRequest: true,
346
+ allOrders: allOrders,
347
+ // 订单反填,要清空orders,存的是当前系统订单号勾选上的 订单
348
+ orders: orderList || [],
349
+ orderNo: orderNo,
350
+ shopCode: (orderList === null || orderList === void 0 ? void 0 : (_orderList$find = orderList.find) === null || _orderList$find === void 0 ? void 0 : (_orderList$find$call = _orderList$find.call(orderList, function (item) {
351
+ return item.sdCode;
352
+ })) === null || _orderList$find$call === void 0 ? void 0 : _orderList$find$call.sdCode) || null,
353
+ jstGoods: updateJstGoodsHandle(orderList, {
354
+ orderBackGoodsLevel: jstGoodsCom === null || jstGoodsCom === void 0 ? void 0 : (_jstGoodsCom$componen = jstGoodsCom.componentConfig) === null || _jstGoodsCom$componen === void 0 ? void 0 : _jstGoodsCom$componen.orderBackGoodsLevel
355
+ }).filter(function (good) {
356
+ return !isStrict || !orderNo || good.originalDealCode === orderNo;
357
+ })
358
+ },
359
+ jstLogistics: updateJstItemListHandle(detail === null || detail === void 0 ? void 0 : detail.orderList, "logistics", (detail === null || detail === void 0 ? void 0 : detail.componentList) || [], form),
360
+ jstSendGood: updateJstItemListHandle(detail === null || detail === void 0 ? void 0 : detail.orderList, "send", (detail === null || detail === void 0 ? void 0 : detail.componentList) || [], form),
361
+ jstSupply: updateJstItemListHandle(detail === null || detail === void 0 ? void 0 : detail.orderList, "supply", (detail === null || detail === void 0 ? void 0 : detail.componentList) || [], form),
362
+ jstItemSelectThird: updateJstItemListHandle(detail === null || detail === void 0 ? void 0 : detail.orderList, "itemList", (detail === null || detail === void 0 ? void 0 : detail.componentList) || [], form)
363
+ };
364
+ };
365
+
366
+ // TODO: 确定合并单,例如: WDT根据订单号请求返回的srcTid会有多个订单号组合在一起的数据 排除其他的,返回当前订单号
367
+ export var filterJstOrders = function filterJstOrders(detail, order_no) {
368
+ var currentTrades = ((detail === null || detail === void 0 ? void 0 : detail.orderList) || []).map(function (item) {
369
+ return _objectSpread(_objectSpread({}, item), {}, {
370
+ oId: String(item.oId)
371
+ });
372
+ });
373
+ // .filter(
374
+ // (item: Record<string, any>) => item?.dealCode === order_no
375
+ // );
376
+ if (currentTrades.length) {
377
+ return currentTrades;
378
+ }
379
+ return [];
380
+ };
@@ -14,6 +14,7 @@ export { bsE3OrderBackFormValues, bsE3OrderTransform, updateBsE3GoodsHandle, fil
14
14
  export { WLN_SYSTEM_ORDER_CONFIG, wlnOrderBackFormValues, wlnOrderTransform, } from "./wlnOrderBackFormValues";
15
15
  export { WDT_RETURN_BILL_NO_CONFIG, WDT_SYSTEM_ORDER_CONFIG, wdtOrderBackFormValues, wdtOrderTransform, WDT_ORDER_TYPE_MAP, filterWdtOrders, updateWdtGoodsHandle, updateWdtAftersaleGoodsHandle, tradeStatusMap, } from "./wdtOrderBackFormValues";
16
16
  export * from "./jstOrderBackFormValues";
17
+ export * from './platformAfterSalesOrderBackFormValues';
17
18
  export { kmOrderBackFormValues, kmOrderTransform, KM_SYSTEM_ORDER_CONFIG, filterKmOrders, updateKmGoodsHandle, handleKmAddressIdentify, kmSkuTypeMap, KM_ORDER_TYPE_MAP, KM_ORDER_STATUS, } from "./kmOrderBackFormValues";
18
19
  export { getIsPlatformCodesIncludeOrderNos, GY_DELIVERY_STATE_MAPPING, GY_SYSTEM_ORDER_CONFIG, updateGyGoodsHandle, gyOrderTransform, gyOrderBackFormValues, filterGyOrders, } from "./gyOrderBackFormValues";
19
20
  export { filterJyOrders, jyOrderBackFormValues, jyOrderTransform, updateJyGoodsHandle, JY_SYSTEM_ORDER_CONFIG, JY_ORDER_TYPE_MAP, JY_ORDER_STATUS_MAP, } from "./jyOrderBackFormValues";
@@ -15,6 +15,7 @@ export { WLN_SYSTEM_ORDER_CONFIG, wlnOrderBackFormValues, wlnOrderTransform } fr
15
15
  export { WDT_RETURN_BILL_NO_CONFIG, WDT_SYSTEM_ORDER_CONFIG, wdtOrderBackFormValues, wdtOrderTransform, WDT_ORDER_TYPE_MAP, filterWdtOrders, updateWdtGoodsHandle, updateWdtAftersaleGoodsHandle, tradeStatusMap } from "./wdtOrderBackFormValues";
16
16
  // export { default as jstOrderBackFormValues } from "./jstOrderBackFormValues";
17
17
  export * from "./jstOrderBackFormValues";
18
+ export * from "./platformAfterSalesOrderBackFormValues";
18
19
  export { kmOrderBackFormValues, kmOrderTransform, KM_SYSTEM_ORDER_CONFIG, filterKmOrders, updateKmGoodsHandle, handleKmAddressIdentify, kmSkuTypeMap, KM_ORDER_TYPE_MAP, KM_ORDER_STATUS } from "./kmOrderBackFormValues";
19
20
  export { getIsPlatformCodesIncludeOrderNos, GY_DELIVERY_STATE_MAPPING, GY_SYSTEM_ORDER_CONFIG, updateGyGoodsHandle, gyOrderTransform, gyOrderBackFormValues, filterGyOrders } from "./gyOrderBackFormValues";
20
21
  export { filterJyOrders, jyOrderBackFormValues, jyOrderTransform, updateJyGoodsHandle, JY_SYSTEM_ORDER_CONFIG, JY_ORDER_TYPE_MAP, JY_ORDER_STATUS_MAP } from "./jyOrderBackFormValues";
@@ -19,6 +19,7 @@ interface OrderBackFormValuesI {
19
19
  detail: Record<string, unknown>;
20
20
  fromQNCreateWorkOrderByOrderNo: boolean;
21
21
  _get_order_fail_?: boolean;
22
+ shopId?: string;
22
23
  }
23
- declare const _default: ({ _get_order_fail_, detail, order_no, formValue, templateDetail, type, fromQNCreateWorkOrderByOrderNo, }: OrderBackFormValuesI) => any;
24
+ declare const _default: ({ shopId, _get_order_fail_, detail, order_no, formValue, templateDetail, type, fromQNCreateWorkOrderByOrderNo, }: OrderBackFormValuesI) => any;
24
25
  export default _default;
@@ -13,6 +13,7 @@ import { kmOrderBackFormValues } from "./kmOrderBackFormValues";
13
13
  import { bsOrderBackFormValues } from "./bsOrderBackFormValues";
14
14
  import { wlnOrderBackFormValues } from "./wlnOrderBackFormValues";
15
15
  import { jstOrderBackFormValues } from "./jstOrderBackFormValues";
16
+ import { platformAfterSalesOrderBackFormValues } from "./platformAfterSalesOrderBackFormValues";
16
17
  import { wdtOrderBackFormValues } from "./wdtOrderBackFormValues";
17
18
  import { bsE3OrderBackFormValues } from "./bsE3OrderBackFormValues";
18
19
  import { gyOrderBackFormValues } from "./gyOrderBackFormValues";
@@ -72,7 +73,8 @@ var taobaoGoodHandle = function taobaoGoodHandle() {
72
73
  };
73
74
  //订单返填数据重组
74
75
  export default (function (_ref) {
75
- var _get_order_fail_ = _ref._get_order_fail_,
76
+ var shopId = _ref.shopId,
77
+ _get_order_fail_ = _ref._get_order_fail_,
76
78
  _ref$detail = _ref.detail,
77
79
  detail = _ref$detail === void 0 ? {} : _ref$detail,
78
80
  _ref$order_no = _ref.order_no,
@@ -245,6 +247,7 @@ export default (function (_ref) {
245
247
  }
246
248
  return prv;
247
249
  }, {}) : {};
250
+ var afterSalesValues = detail["afterSaleOrders"] ? platformAfterSalesOrderBackFormValues(detail["afterSaleOrders"], templateDetail) : {};
248
251
  var jstValues = detail["jstOrder"] ? jstOrderBackFormValues(detail["jstOrder"], templateDetail) : {};
249
252
  var bsValues = detail["bsOrder"] ? bsOrderBackFormValues(detail["bsOrder"], templateDetail) : {};
250
253
  var wlnValues = detail["wlnOrder"] ? wlnOrderBackFormValues(detail["wlnOrder"], templateDetail) : {};
@@ -261,5 +264,5 @@ export default (function (_ref) {
261
264
  pushGyLog("gyValues", gyValues);
262
265
  // console.log("bsE3Values", bsE3Values);
263
266
 
264
- return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, orderValues), jstValues), bsValues), wlnValues), wdtValues), bsE3Values), kmValues), gyValues), jyValues), skxValues), skxReturnValues), jkyValues);
267
+ return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, orderValues), afterSalesValues), jstValues), bsValues), wlnValues), wdtValues), bsE3Values), kmValues), gyValues), jyValues), skxValues), skxReturnValues), jkyValues);
265
268
  });
@@ -0,0 +1,14 @@
1
+ export declare const PLATFORM_AFTER_SALES_ORDER_CONFIG: {
2
+ key: string;
3
+ name: string;
4
+ selectId: string;
5
+ orderNo: string;
6
+ columns: any[];
7
+ };
8
+ export declare const platformAfterSalesOrderTransform: ({ orderNo, shopId, allOrders, selectOrders, }: {
9
+ orderNo?: string | undefined;
10
+ shopId?: string | undefined;
11
+ allOrders?: any[] | undefined;
12
+ selectOrders?: any[] | undefined;
13
+ }) => any;
14
+ export declare const platformAfterSalesOrderBackFormValues: (detail?: any, templateDetail?: any) => any;
@@ -0,0 +1,108 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
+ import ExpressData from "../expressData";
8
+ export var PLATFORM_AFTER_SALES_ORDER_CONFIG = {
9
+ key: "platformAfaterSalesShowOrder",
10
+ name: "平台售后单",
11
+ selectId: "platformAfaterSalesSelectIds",
12
+ orderNo: "platformAfaterSalesOrderNo",
13
+ columns: [{
14
+ dataIndex: "afterSaleOrderId",
15
+ title: "\u552E\u540E\u5355\u53F7"
16
+ }, {
17
+ dataIndex: "afterSaleType",
18
+ title: "\u552E\u540E\u7C7B\u578B"
19
+ }, {
20
+ dataIndex: "platformStatus",
21
+ title: "\u5E73\u53F0\u552E\u540E\u72B6\u6001"
22
+ }, {
23
+ dataIndex: "buyerNick",
24
+ title: "\u4E70\u5BB6\u6635\u79F0"
25
+ }, {
26
+ dataIndex: "refundAmount",
27
+ title: "\u9000\u6B3E\u91D1\u989D"
28
+ }, {
29
+ dataIndex: "refundPostFee",
30
+ title: "\u5E94\u9000\u8FD0\u8D39"
31
+ }, {
32
+ dataIndex: "reason",
33
+ title: "\u552E\u540E\u539F\u56E0"
34
+ }, {
35
+ dataIndex: "explains",
36
+ title: "\u552E\u540E\u8BF4\u660E"
37
+ }, {
38
+ dataIndex: "applyTime",
39
+ title: "\u552E\u540E\u7533\u8BF7\u65F6\u95F4"
40
+ }, {
41
+ dataIndex: "updateTime",
42
+ title: "\u552E\u540E\u66F4\u65B0\u65F6\u95F4"
43
+ }, {
44
+ dataIndex: "returnExpressCompany",
45
+ title: "\u9000\u8D27\u7269\u6D41\u516C\u53F8"
46
+ }, {
47
+ dataIndex: "returnExpressNo",
48
+ title: "\u9000\u8D27\u7269\u6D41\u5355\u53F7"
49
+ }].map(function (item) {
50
+ return _objectSpread(_objectSpread({}, item), {}, {
51
+ align: "center",
52
+ ellipsis: true,
53
+ width: item.width || 150
54
+ });
55
+ })
56
+ };
57
+ export var platformAfterSalesOrderTransform = function platformAfterSalesOrderTransform(_ref) {
58
+ var orderNo = _ref.orderNo,
59
+ shopId = _ref.shopId,
60
+ allOrders = _ref.allOrders,
61
+ selectOrders = _ref.selectOrders;
62
+ var values = {};
63
+ if (allOrders && shopId && orderNo) {
64
+ values.afterSalesOrder = {
65
+ //标记通过请求获取的值
66
+ isRequest: true,
67
+ orderNo: orderNo,
68
+ orders: allOrders,
69
+ selectIds: [],
70
+ shopId: shopId,
71
+ showOrderInfo: allOrders
72
+ };
73
+ }
74
+ if (selectOrders !== null && selectOrders !== void 0 && selectOrders[0]) {
75
+ var _selectOrders$ = selectOrders[0],
76
+ returnExpressCompany = _selectOrders$.returnExpressCompany,
77
+ returnExpressNo = _selectOrders$.returnExpressNo;
78
+ var expressCode = ExpressData.getInstance().getExpressCodeByName(returnExpressCompany);
79
+ values.returnLogistics = {
80
+ company: expressCode,
81
+ order: returnExpressNo
82
+ };
83
+ values.logisticsTrajectory = {
84
+ trajectoryCompany: expressCode,
85
+ trajectoryCode: returnExpressNo
86
+ };
87
+ }
88
+ return values;
89
+ };
90
+ export var platformAfterSalesOrderBackFormValues = function platformAfterSalesOrderBackFormValues() {
91
+ var detail = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
92
+ var templateDetail = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
93
+ return ((templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.componentDtoList) || []).reduce(function (prv, next) {
94
+ var uniqueKey = next.uniqueKey;
95
+ switch (next.workOrderComponentType) {
96
+ case "RETURN_LOGISTICS_SELECT":
97
+ prv[uniqueKey] = detail === null || detail === void 0 ? void 0 : detail.returnLogistics;
98
+ break;
99
+ case "LOGISTICS_TRAJECTORY":
100
+ prv[uniqueKey] = detail === null || detail === void 0 ? void 0 : detail.logisticsTrajectory;
101
+ break;
102
+ case "PLATFORM_AFTER_SALES_ORDER":
103
+ prv[uniqueKey] = detail === null || detail === void 0 ? void 0 : detail.afterSalesOrder;
104
+ break;
105
+ }
106
+ return prv;
107
+ }, {});
108
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/kmkf-utils",
3
- "version": "2.3.19-beta.16",
3
+ "version": "2.3.19-beta.20",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
@@ -41,7 +41,7 @@
41
41
  "publishConfig": {
42
42
  "access": "public"
43
43
  },
44
- "gitHead": "abb2770b3f49cd415ad86c79881b3a925afb8b29",
44
+ "gitHead": "a6cc441e22f98127bf7791e19e1563d5014eb422",
45
45
  "gitHooks": {
46
46
  "pre-commit": "lint-staged"
47
47
  }