@kmkf-fe-packages/kmkf-utils 2.0.79-beta.51 → 2.0.79-beta.52

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.
@@ -74,6 +74,7 @@ export var SendDataCenter = /*#__PURE__*/function () {
74
74
  if (platform === "KM_SEND_GOOD") platform = "km";
75
75
  if (platform === "GY_SEND_GOOD") platform = "gy";
76
76
  if (platform === "JST_SEND_GOOD") platform = "jst";
77
+ if (platform === "JY_SEND_GOOD") platform = "jy";
77
78
  if (!this.instanceMap.has(platform)) {
78
79
  this.instanceMap.set(platform, new SendData(platform));
79
80
  }
@@ -16,6 +16,7 @@ export { WDT_SYSTEM_ORDER_CONFIG, wdtOrderBackFormValues, wdtOrderTransform, WDT
16
16
  export * from "./jstOrderBackFormValues";
17
17
  export { kmOrderBackFormValues, kmOrderTransform, KM_SYSTEM_ORDER_CONFIG, filterKmOrders, updateKmGoodsHandle, handleKmAddressIdentify, } from "./kmOrderBackFormValues";
18
18
  export { getIsPlatformCodesIncludeOrderNos, GY_DELIVERY_STATE_MAPPING, GY_SYSTEM_ORDER_CONFIG, updateGyGoodsHandle, gyOrderTransform, gyOrderBackFormValues, filterGyOrders, } from "./gyOrderBackFormValues";
19
+ export { filterJyOrders, jyOrderBackFormValues, jyOrderTransform, updateJyGoodsHandle, JY_SYSTEM_ORDER_CONFIG, } from "./jyOrderBackFormValues";
19
20
  export { updateWlnGoodsHandle } from "./wlnOrderBackFormValues";
20
21
  export { default as uuid } from "./getUUid";
21
22
  export * as filterFn from "./filterFn";
@@ -17,6 +17,7 @@ export { WDT_SYSTEM_ORDER_CONFIG, wdtOrderBackFormValues, wdtOrderTransform, WDT
17
17
  export * from "./jstOrderBackFormValues";
18
18
  export { kmOrderBackFormValues, kmOrderTransform, KM_SYSTEM_ORDER_CONFIG, filterKmOrders, updateKmGoodsHandle, handleKmAddressIdentify } from "./kmOrderBackFormValues";
19
19
  export { getIsPlatformCodesIncludeOrderNos, GY_DELIVERY_STATE_MAPPING, GY_SYSTEM_ORDER_CONFIG, updateGyGoodsHandle, gyOrderTransform, gyOrderBackFormValues, filterGyOrders } from "./gyOrderBackFormValues";
20
+ export { filterJyOrders, jyOrderBackFormValues, jyOrderTransform, updateJyGoodsHandle, JY_SYSTEM_ORDER_CONFIG } from "./jyOrderBackFormValues";
20
21
  export { updateWlnGoodsHandle } from "./wlnOrderBackFormValues";
21
22
  export { default as uuid } from "./getUUid";
22
23
  import * as _filterFn from "./filterFn";
@@ -0,0 +1,36 @@
1
+ export declare const JY_SYSTEM_ORDER_CONFIG: {
2
+ key: string;
3
+ name: string;
4
+ selectId: string;
5
+ columns: {
6
+ dataIndex: string;
7
+ title: string;
8
+ width: number;
9
+ }[];
10
+ };
11
+ export declare const getIsPlatformCodesIncludeOrderNos: (platformCodes: string, orderNos: string) => boolean;
12
+ export declare const updateJyGoodsHandle: (orders?: any[]) => any;
13
+ export declare const jyOrderTransform: (detail: any, form: any) => {
14
+ jySystemOrder: {
15
+ orderNo: any;
16
+ orders: any;
17
+ selectIds: any;
18
+ showOrderInfo: any;
19
+ };
20
+ jyReturnSystemOrderNo: any;
21
+ jySystemOrderNo: any;
22
+ jyReissueGoods: any;
23
+ jyReturnGoods: any;
24
+ jyGoods: {
25
+ allOrders: any;
26
+ orders: any;
27
+ orderNo: any;
28
+ shopCode: any;
29
+ jyGoods: any;
30
+ };
31
+ shopCode: any;
32
+ jyLogistics: any;
33
+ jySendGood: any;
34
+ };
35
+ export declare const jyOrderBackFormValues: (detail?: any, templateDetail?: any) => any;
36
+ export declare const filterJyOrders: (trades: any, order_no: string) => any;
@@ -0,0 +1,307 @@
1
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
+ 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."); }
3
+ 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); }
4
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
5
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6
+ 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; }
7
+ import uuid from "./getUUid";
8
+ import isNull from "./isNull";
9
+ export var JY_SYSTEM_ORDER_CONFIG = {
10
+ key: "jySystemShowOrder",
11
+ name: "巨益",
12
+ selectId: "jySystemSelectIds",
13
+ columns: [{
14
+ dataIndex: "tradeNo",
15
+ title: "系统订单号",
16
+ width: 160
17
+ }, {
18
+ dataIndex: "tradeType",
19
+ title: "订单类型",
20
+ width: 150
21
+ }, {
22
+ dataIndex: "tradeStatus",
23
+ title: "订单状态",
24
+ width: 100
25
+ }, {
26
+ dataIndex: "sourcePlatformName",
27
+ title: "来源平台",
28
+ width: 150
29
+ }]
30
+ };
31
+ export var getIsPlatformCodesIncludeOrderNos = function getIsPlatformCodesIncludeOrderNos(platformCodes, orderNos) {
32
+ var getSortedList = function getSortedList(str) {
33
+ try {
34
+ var parts = str.split(";");
35
+ var bigInts = parts.map(BigInt);
36
+ var sortedBigInts = bigInts.sort(function (a, b) {
37
+ if (a < b) return -1;
38
+ if (a > b) return 1;
39
+ return 0;
40
+ });
41
+ return sortedBigInts.map(String).join(";");
42
+ } catch (error) {
43
+ return "";
44
+ }
45
+ };
46
+ var platformCodesSortStr = getSortedList(platformCodes || "");
47
+ var orderNosSortStr = getSortedList(orderNos || "");
48
+ return platformCodesSortStr.includes(orderNosSortStr);
49
+ };
50
+ export var updateJyGoodsHandle = function updateJyGoodsHandle() {
51
+ var orders = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
52
+ return orders === null || orders === void 0 ? void 0 : orders.reduce(function (acc, cur) {
53
+ if (Array.isArray(cur.details)) {
54
+ acc.push.apply(acc, _toConsumableArray(cur.details.map(function (item) {
55
+ var _item$uuid;
56
+ item.canDelete = true;
57
+ item.uuid = (_item$uuid = item.uuid) !== null && _item$uuid !== void 0 ? _item$uuid : uuid();
58
+ item.systemOrderNo = cur === null || cur === void 0 ? void 0 : cur.tradeNo;
59
+ return item;
60
+ })));
61
+ }
62
+ return acc;
63
+ }, []);
64
+ };
65
+ var updateJyItemListHandle = function updateJyItemListHandle(list, type, comList, form) {
66
+ var _newList;
67
+ if (type === "logistics") {
68
+ var _comList$find, _currentCom$component;
69
+ //巨益物流信息组件
70
+ 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) {
71
+ return item.workOrderComponentType === "JY_LOGISTICS";
72
+ });
73
+ var notOrderBack = (currentCom === null || currentCom === void 0 ? void 0 : (_currentCom$component = currentCom.componentConfig) === null || _currentCom$component === void 0 ? void 0 : _currentCom$component.notOrderBack) || false;
74
+ if (notOrderBack) {
75
+ var _currentValue;
76
+ var currentValue = form.getFieldValue(currentCom.uniqueKey);
77
+ currentValue = (_currentValue = currentValue) !== null && _currentValue !== void 0 && _currentValue.length ? currentValue : [{
78
+ logisticsCode: "",
79
+ logisticsCompany: ""
80
+ }];
81
+ return currentValue;
82
+ }
83
+ } else if (type === "send") {
84
+ var _comList$find2, _currentCom$component2;
85
+ 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) {
86
+ return item.workOrderComponentType === "JY_SEND_GOOD";
87
+ });
88
+ var _notOrderBack = (_currentCom === null || _currentCom === void 0 ? void 0 : (_currentCom$component2 = _currentCom.componentConfig) === null || _currentCom$component2 === void 0 ? void 0 : _currentCom$component2.notOrderBack) || false;
89
+ if (_notOrderBack) {
90
+ var _currentValue3;
91
+ var _currentValue2 = form.getFieldValue(_currentCom.uniqueKey);
92
+ _currentValue2 = (_currentValue3 = _currentValue2) !== null && _currentValue3 !== void 0 && _currentValue3.length ? _currentValue2 : [{
93
+ sendId: "",
94
+ sendName: ""
95
+ }];
96
+ return _currentValue2;
97
+ }
98
+ }
99
+ var newList = list === null || list === void 0 ? void 0 : list.reduce(function (prv, next) {
100
+ var items = ((next === null || next === void 0 ? void 0 : next.details) || []).map(function (t) {
101
+ return {
102
+ title: (t === null || t === void 0 ? void 0 : t.itemName) || "",
103
+ picUrl: (t === null || t === void 0 ? void 0 : t.picPath) || "",
104
+ platform: "jy",
105
+ skuId: (t === null || t === void 0 ? void 0 : t.itemCode) || ""
106
+ };
107
+ });
108
+ if (type === "logistics") {
109
+ // 巨益的单个系统子订单存在拆单,会包含多个物流信息
110
+ var deliveryList = ((next === null || next === void 0 ? void 0 : next.deliveryList) || []).map(function (t) {
111
+ return {
112
+ items: items,
113
+ logisticsCompanyName: t === null || t === void 0 ? void 0 : t.expressName,
114
+ logisticsCompany: t === null || t === void 0 ? void 0 : t.expressCode,
115
+ logisticsCode: t === null || t === void 0 ? void 0 : t.mailNo
116
+ };
117
+ });
118
+ prv.push.apply(prv, _toConsumableArray(deliveryList));
119
+ // params.logisticsCompany = next?.expressName;
120
+ // params.logisticsCode = next?.mailNo;
121
+ } else if (type === "send") {
122
+ var params = {
123
+ items: items
124
+ };
125
+ params.sendId = next === null || next === void 0 ? void 0 : next.warehouseCode;
126
+ //下拉框,取id
127
+ params.sendName = next === null || next === void 0 ? void 0 : next.warehouseCode;
128
+ params.sendSnapshotName = next === null || next === void 0 ? void 0 : next.warehouseName;
129
+ prv.push(params);
130
+ }
131
+ return prv;
132
+ }, []);
133
+ if (!((_newList = newList) !== null && _newList !== void 0 && _newList.length)) {
134
+ switch (type) {
135
+ case "logistics":
136
+ newList = [{
137
+ logisticsCode: ""
138
+ }];
139
+ break;
140
+ case "supply":
141
+ newList = [{
142
+ supplyId: ""
143
+ }];
144
+ break;
145
+ case "send":
146
+ newList = [{
147
+ sendId: "",
148
+ sendName: ""
149
+ }];
150
+ break;
151
+ }
152
+ }
153
+ return newList;
154
+ };
155
+
156
+ //巨益订单信息转换
157
+ export var jyOrderTransform = function jyOrderTransform(detail, form) {
158
+ var _form$getFieldValue, _jyReissueCom$compone, _jyReturnCom$componen, _filterCurrentTrades$, _filterCurrentTrades$2, _currentTrades$find, _currentTrades$find$c, _currentTrades$find2, _currentTrades$find2$;
159
+ var _detail$allOrders = detail.allOrders,
160
+ allOrders = _detail$allOrders === void 0 ? [] : _detail$allOrders,
161
+ orderNo = detail.orderNo,
162
+ _detail$trades = detail.trades,
163
+ currentTrades = _detail$trades === void 0 ? [] : _detail$trades,
164
+ componentList = detail.componentList;
165
+ var filterCurrentTrades = currentTrades === null || currentTrades === void 0 ? void 0 : currentTrades.filter(function (trade) {
166
+ return !trade.cancel;
167
+ });
168
+ var jyGoodsCom = (componentList || []).find(function (com) {
169
+ return com.workOrderComponentType === "JY_GOODS";
170
+ });
171
+ var jyReissueCom = (componentList || []).find(function (com) {
172
+ return com.workOrderComponentType === "JY_REISSUE_GOODS";
173
+ });
174
+ var jyReturnCom = (componentList || []).find(function (com) {
175
+ return com.workOrderComponentType === "JY_RETURN_GOODS";
176
+ });
177
+ var isStrict = jyGoodsCom ? (_form$getFieldValue = form.getFieldValue(jyGoodsCom.uniqueKey)) === null || _form$getFieldValue === void 0 ? void 0 : _form$getFieldValue.isStrict : false;
178
+ var onlyOneSystemOrder = (filterCurrentTrades === null || filterCurrentTrades === void 0 ? void 0 : filterCurrentTrades.length) === 1;
179
+ var isReissueDefaultSelect = !!(jyReissueCom !== null && jyReissueCom !== void 0 && (_jyReissueCom$compone = jyReissueCom.componentConfig) !== null && _jyReissueCom$compone !== void 0 && _jyReissueCom$compone.showDefaultSelect);
180
+ var isReturnDefaultSelect = !!(jyReturnCom !== null && jyReturnCom !== void 0 && (_jyReturnCom$componen = jyReturnCom.componentConfig) !== null && _jyReturnCom$componen !== void 0 && _jyReturnCom$componen.showDefaultSelect);
181
+ var defaultOrder = filterCurrentTrades !== null && filterCurrentTrades !== void 0 && filterCurrentTrades[0] ? [filterCurrentTrades[0]] : [];
182
+ return {
183
+ jySystemOrder: {
184
+ orderNo: orderNo,
185
+ orders: currentTrades,
186
+ selectIds: onlyOneSystemOrder ? currentTrades.map(function (item) {
187
+ return item.tradeNo;
188
+ }) : [],
189
+ showOrderInfo: currentTrades
190
+ },
191
+ jyReturnSystemOrderNo: onlyOneSystemOrder || isReturnDefaultSelect ? (_filterCurrentTrades$ = filterCurrentTrades[0]) === null || _filterCurrentTrades$ === void 0 ? void 0 : _filterCurrentTrades$.tradeNo : undefined,
192
+ jySystemOrderNo: onlyOneSystemOrder || isReissueDefaultSelect ? (_filterCurrentTrades$2 = filterCurrentTrades[0]) === null || _filterCurrentTrades$2 === void 0 ? void 0 : _filterCurrentTrades$2.tradeNo : undefined,
193
+ jyReissueGoods: onlyOneSystemOrder || isReissueDefaultSelect ? updateJyGoodsHandle(defaultOrder).filter(function (good) {
194
+ return !isStrict || !orderNo || getIsPlatformCodesIncludeOrderNos(good.platformCode, orderNo);
195
+ }) : [],
196
+ jyReturnGoods: onlyOneSystemOrder || isReturnDefaultSelect ? updateJyGoodsHandle(defaultOrder).filter(function (good) {
197
+ return !isStrict || !orderNo || getIsPlatformCodesIncludeOrderNos(good.platformCode, orderNo);
198
+ }) : [],
199
+ jyGoods: {
200
+ // allOrders用于选择订单商品,代入该订单的所有商品
201
+ allOrders: allOrders,
202
+ // 订单反填,要清空orders,存的是当前系统订单号勾选上的 订单
203
+ orders: currentTrades,
204
+ orderNo: orderNo,
205
+ shopCode: (currentTrades === null || currentTrades === void 0 ? void 0 : (_currentTrades$find = currentTrades.find) === null || _currentTrades$find === void 0 ? void 0 : (_currentTrades$find$c = _currentTrades$find.call(currentTrades, function (item) {
206
+ return item.shopCode;
207
+ })) === null || _currentTrades$find$c === void 0 ? void 0 : _currentTrades$find$c.shopCode) || null,
208
+ jyGoods: updateJyGoodsHandle(currentTrades).filter(function (good) {
209
+ return !isStrict || !orderNo || getIsPlatformCodesIncludeOrderNos(good.platformCode, orderNo);
210
+ })
211
+ },
212
+ shopCode: (currentTrades === null || currentTrades === void 0 ? void 0 : (_currentTrades$find2 = currentTrades.find) === null || _currentTrades$find2 === void 0 ? void 0 : (_currentTrades$find2$ = _currentTrades$find2.call(currentTrades, function (item) {
213
+ return item.shopCode;
214
+ })) === null || _currentTrades$find2$ === void 0 ? void 0 : _currentTrades$find2$.shopCode) || null,
215
+ jyLogistics: updateJyItemListHandle(currentTrades, "logistics", componentList || [], form),
216
+ jySendGood: updateJyItemListHandle(currentTrades, "send", componentList || [], form)
217
+ };
218
+ };
219
+ export var jyOrderBackFormValues = function jyOrderBackFormValues() {
220
+ var detail = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
221
+ var templateDetail = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
222
+ return ((templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.componentDtoList) || []).reduce(function (prv, next) {
223
+ var uniqueKey = next.uniqueKey;
224
+ var config = next.componentConfig;
225
+ switch (next.workOrderComponentType) {
226
+ case "JY_SYSTEM_ORDER":
227
+ prv[uniqueKey] = detail === null || detail === void 0 ? void 0 : detail.jySystemOrder;
228
+ break;
229
+ case "JY_GOODS":
230
+ prv[uniqueKey] = detail === null || detail === void 0 ? void 0 : detail.jyGoods;
231
+ break;
232
+ case "JY_REISSUE_GOODS":
233
+ {
234
+ var _detail$jyGoods, _detail$jySystemOrder, _detail$jySystemOrder2, _detail$jySystemOrder3, _detail$jySystemOrder4, _detail$jySystemOrder5, _detail$jySystemOrder6;
235
+ var initReason = !isNull(config === null || config === void 0 ? void 0 : config.initReason) ? config.initReason : "1";
236
+ prv[uniqueKey] = {
237
+ jySystemOrder: detail === null || detail === void 0 ? void 0 : detail.jySystemOrder,
238
+ jyReissueGoods: initReason === "2" ? [] : detail === null || detail === void 0 ? void 0 : detail.jyReissueGoods,
239
+ jySystemOrderNo: detail === null || detail === void 0 ? void 0 : detail.jySystemOrderNo,
240
+ jyReissueType: [initReason],
241
+ shopCode: (detail === null || detail === void 0 ? void 0 : (_detail$jyGoods = detail.jyGoods) === null || _detail$jyGoods === void 0 ? void 0 : _detail$jyGoods.shopCode) || (detail === null || detail === void 0 ? void 0 : detail.shopCode) || (detail === null || detail === void 0 ? void 0 : (_detail$jySystemOrder = detail.jySystemOrder) === null || _detail$jySystemOrder === void 0 ? void 0 : (_detail$jySystemOrder2 = _detail$jySystemOrder.orders) === null || _detail$jySystemOrder2 === void 0 ? void 0 : (_detail$jySystemOrder3 = _detail$jySystemOrder2[0]) === null || _detail$jySystemOrder3 === void 0 ? void 0 : _detail$jySystemOrder3.shopCode) || (detail === null || detail === void 0 ? void 0 : (_detail$jySystemOrder4 = detail.jySystemOrder) === null || _detail$jySystemOrder4 === void 0 ? void 0 : (_detail$jySystemOrder5 = _detail$jySystemOrder4.showOrderInfo) === null || _detail$jySystemOrder5 === void 0 ? void 0 : (_detail$jySystemOrder6 = _detail$jySystemOrder5[0]) === null || _detail$jySystemOrder6 === void 0 ? void 0 : _detail$jySystemOrder6.shopCode)
242
+ };
243
+ }
244
+ break;
245
+ case "JY_LOGISTICS":
246
+ prv[uniqueKey] = updateJyItemListByConfigHandle(detail === null || detail === void 0 ? void 0 : detail.jyLogistics, "logistics", config);
247
+ break;
248
+ case "JY_SEND_GOOD":
249
+ prv[uniqueKey] = updateJyItemListByConfigHandle(detail === null || detail === void 0 ? void 0 : detail.jySendGood, "send", config);
250
+ break;
251
+ case "JY_RETURN_GOODS":
252
+ {
253
+ var _detail$jyGoods2, _detail$jySystemOrder7, _detail$jySystemOrder8, _detail$jySystemOrder9, _detail$jySystemOrder10, _detail$jySystemOrder11, _detail$jySystemOrder12;
254
+ var _initReason = !isNull(config === null || config === void 0 ? void 0 : config.initReason) ? config.initReason : "1";
255
+ prv[uniqueKey] = {
256
+ jySystemOrder: detail === null || detail === void 0 ? void 0 : detail.jySystemOrder,
257
+ jyReturnGoods: _initReason === "2" ? [] : detail === null || detail === void 0 ? void 0 : detail.jyReturnGoods,
258
+ jySystemOrderNo: detail === null || detail === void 0 ? void 0 : detail.jyReturnSystemOrderNo,
259
+ shopCode: (detail === null || detail === void 0 ? void 0 : (_detail$jyGoods2 = detail.jyGoods) === null || _detail$jyGoods2 === void 0 ? void 0 : _detail$jyGoods2.shopCode) || (detail === null || detail === void 0 ? void 0 : detail.shopCode) || (detail === null || detail === void 0 ? void 0 : (_detail$jySystemOrder7 = detail.jySystemOrder) === null || _detail$jySystemOrder7 === void 0 ? void 0 : (_detail$jySystemOrder8 = _detail$jySystemOrder7.orders) === null || _detail$jySystemOrder8 === void 0 ? void 0 : (_detail$jySystemOrder9 = _detail$jySystemOrder8[0]) === null || _detail$jySystemOrder9 === void 0 ? void 0 : _detail$jySystemOrder9.shopCode) || (detail === null || detail === void 0 ? void 0 : (_detail$jySystemOrder10 = detail.jySystemOrder) === null || _detail$jySystemOrder10 === void 0 ? void 0 : (_detail$jySystemOrder11 = _detail$jySystemOrder10.showOrderInfo) === null || _detail$jySystemOrder11 === void 0 ? void 0 : (_detail$jySystemOrder12 = _detail$jySystemOrder11[0]) === null || _detail$jySystemOrder12 === void 0 ? void 0 : _detail$jySystemOrder12.shopCode),
260
+ gyReturnType: [_initReason]
261
+ };
262
+ }
263
+ break;
264
+ }
265
+ return prv;
266
+ }, {});
267
+ };
268
+ var updateJyItemListByConfigHandle = function updateJyItemListByConfigHandle(list, type) {
269
+ var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
270
+ var showField = config.showField,
271
+ _config$notOrderBack = config.notOrderBack,
272
+ notOrderBack = _config$notOrderBack === void 0 ? false : _config$notOrderBack;
273
+ if (notOrderBack) {
274
+ return list;
275
+ }
276
+ return list === null || list === void 0 ? void 0 : list.reduce(function (prv, next) {
277
+ if (type === "logistics") {
278
+ if (!["logisticsCompany", ""].includes(showField || "")) {
279
+ next.logisticsCompany = undefined;
280
+ }
281
+ if (!["logisticsCode", ""].includes(showField || "")) {
282
+ next.logisticsCode = undefined;
283
+ }
284
+ } else if (type === "send") {
285
+ if (!["sendId", "all"].includes(showField || "")) {
286
+ next.sendId = undefined;
287
+ }
288
+ if (!["sendName", "all"].includes(showField || "")) {
289
+ next.sendName = undefined;
290
+ next.sendSnapshotName = undefined;
291
+ }
292
+ }
293
+ prv.push(next);
294
+ return prv;
295
+ }, []);
296
+ };
297
+
298
+ // 巨益根据订单号请求返回的platformCode会有多个订单号组合在一起的数据 排除其他的,返回当前订单号
299
+ export var filterJyOrders = function filterJyOrders(trades, order_no) {
300
+ var currentTrades = (trades || []).filter(function (item) {
301
+ return getIsPlatformCodesIncludeOrderNos(item.platformCode, order_no);
302
+ });
303
+ if (currentTrades.length) {
304
+ return currentTrades;
305
+ }
306
+ return [];
307
+ };
@@ -16,6 +16,7 @@ import { jstOrderBackFormValues } from "./jstOrderBackFormValues";
16
16
  import { wdtOrderBackFormValues } from "./wdtOrderBackFormValues";
17
17
  import { bsE3OrderBackFormValues } from "./bsE3OrderBackFormValues";
18
18
  import { gyOrderBackFormValues } from "./gyOrderBackFormValues";
19
+ import { jyOrderBackFormValues } from "./jyOrderBackFormValues";
19
20
  import { pushGyLog } from "../utils";
20
21
 
21
22
  // 淘宝商品组件信息处理
@@ -242,8 +243,9 @@ export default (function (_ref) {
242
243
  var bsE3Values = detail["bsE3Order"] ? bsE3OrderBackFormValues(detail["bsE3Order"], templateDetail) : {};
243
244
  var kmValues = detail["kmOrder"] ? kmOrderBackFormValues(detail["kmOrder"], templateDetail) : {};
244
245
  var gyValues = detail["gyOrder"] ? gyOrderBackFormValues(detail["gyOrder"], templateDetail, 1) : {};
246
+ var jyValues = detail["jyOrder"] ? jyOrderBackFormValues(detail["jyOrder"], templateDetail) : {};
245
247
  pushGyLog("gyValues", gyValues);
246
248
  // console.log("bsE3Values", bsE3Values);
247
249
 
248
- return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, orderValues), jstValues), bsValues), wlnValues), wdtValues), bsE3Values), kmValues), gyValues);
250
+ return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, orderValues), jstValues), bsValues), wlnValues), wdtValues), bsE3Values), kmValues), gyValues), jyValues);
249
251
  });
@@ -1,5 +1,5 @@
1
1
  export default (function (key) {
2
- return ["itemList", "itemId", "supplierName", "numIid", "aloneItemId", "aloneItemEncode", "jstItemList", "logisticsCompany", "logisticsCode", "supplyId", "supplyName", "sendId", "sendName", "dateTime", "basicMultSelect", "memberLevel", "erpOrderType", "orderRefundType", "executeActionType", "checkbox", "multSelect", "rate", "picture", "pictureProList", "file", "wdtGoods", "wdtReissueType", "wdtSystemOrderNo", "wdtReissueGoods", "wdtSendGood", "wdtSendId", "wdtSendName", "wdtLogisticsCode", "wdtSystemShowOrder", "wdtSystemSelectIds", "wdtLogisticsCompany", "wdtLogisticsList", "wdtReturnGoods", "wdtReturnType", "wdtExchangeGoods", "bsSendGood", "bsSendId", "bsSendName", "bsGoods", "bsExchangeType", "bsExchangeReturnGoods", "bsExchangeSwapOutGoods", "bsExchangeGiftGoods", "bsReissueType", "bsReissueGoods", "bsReturnGoods", "bsReturnType", "bsLogisticsList", "bsLogisticsCompany", "bsLogisticsCode", "kmSystemShowOrder", "bsSystemShowOrder", "bsSystemSelectIds", "bsE3SystemOrderNo", "bsE3SystemShowOrder", "bsE3SystemSelectIds", "bsE3Goods", "bsE3ReissueGoods", "bsE3ReissueType", "reissueLogisticsList", "reissueLogisticsCompany", "reissueLogisticsCode", "deliveryNoList", "deliveryNoIds", "returnGoodsStatusList", "returnGoodsTradeIdList", "returnGoodsTradeItemList", "tradeIdList", "tradeItemList", "wlnLogisticsList", "wlnLogisticsCompany", "wlnLogisticsCode", "wlnSystemShowOrder", "wlnSystemSelectIds", "wlnGoods", "wlnSendGood", "wlnSendId", "wlnSendName", "exchangeReason", "flowTag", "returnGoodsStatusList", "returnGoodsStatusValue", "exchangeReason", "exchangeStatusValue", "inStockStatusItemList", "inStockStatusList", "bsE3InStockStatusItemList", "bsE3InStockStatusList", "reissueStatusValue", "reissueReason", "adjustWorkOrderStatusValue", "adjustWorkOrderReason", "msgStatusValues", "msgStatus4Search", "createStatusValue", "createReason", "invoiceStatusValue", "invoiceReason", "invoicingStatusValue", "invoicingReason", "trajectoryList", "trajectoryMoreCompany", "trajectoryMoreCode", "trajectoryMoreSnapshot", "logisticsInterceptList", "logisticsInterceptCompanyList", "logisticsInterceptCodeList", "logisticsInterceptTypeList", "logisticsInterceptStatusList", "logisticsInterceptApiStatusList", "interceptLogisticsApiStatus", "logisticsInterceptSnapshotList", "productList", "label", "kmSendGood", "kmSendId", "kmSendName", "kmGoods", "gyGoods", "gyReissueType", "gySystemOrderNo", "gyReissueGoods", "gySendGood", "gySendId", "gySendName", "gyLogisticsCode", "gySystemShowOrder", "gySystemSelectIds", "gyLogisticsCompany", "gyLogisticsList", "gyReturnGoods", "gyReturnType", "gyExchangeGoods", "kmLogisticsList", "jstGoods", "jstSendGood", "jstReissueType", "jstReissueGoods", "jstSystemOrderNo", "jstLogisticsList", "jstSystemShowOrder", "jstSystemSelectIds", "jstReturnGoods", "jstReturnType", "jstExchangeGoods", "trajectoryApiStatus", "kmReissueGoods", "kmReissueType", "kmReturnGoods", "kmReturnType", "kmVideo", "wdtTags"].reduce(function (cur, nxt) {
2
+ return ["itemList", "itemId", "supplierName", "numIid", "aloneItemId", "aloneItemEncode", "jstItemList", "logisticsCompany", "logisticsCode", "supplyId", "supplyName", "sendId", "sendName", "dateTime", "basicMultSelect", "memberLevel", "erpOrderType", "orderRefundType", "executeActionType", "checkbox", "multSelect", "rate", "picture", "pictureProList", "file", "wdtGoods", "wdtReissueType", "wdtSystemOrderNo", "wdtReissueGoods", "wdtSendGood", "wdtSendId", "wdtSendName", "wdtLogisticsCode", "wdtSystemShowOrder", "wdtSystemSelectIds", "wdtLogisticsCompany", "wdtLogisticsList", "wdtReturnGoods", "wdtReturnType", "wdtExchangeGoods", "bsSendGood", "bsSendId", "bsSendName", "bsGoods", "bsExchangeType", "bsExchangeReturnGoods", "bsExchangeSwapOutGoods", "bsExchangeGiftGoods", "bsReissueType", "bsReissueGoods", "bsReturnGoods", "bsReturnType", "bsLogisticsList", "bsLogisticsCompany", "bsLogisticsCode", "kmSystemShowOrder", "bsSystemShowOrder", "bsSystemSelectIds", "bsE3SystemOrderNo", "bsE3SystemShowOrder", "bsE3SystemSelectIds", "bsE3Goods", "bsE3ReissueGoods", "bsE3ReissueType", "reissueLogisticsList", "reissueLogisticsCompany", "reissueLogisticsCode", "deliveryNoList", "deliveryNoIds", "returnGoodsStatusList", "returnGoodsTradeIdList", "returnGoodsTradeItemList", "tradeIdList", "tradeItemList", "wlnLogisticsList", "wlnLogisticsCompany", "wlnLogisticsCode", "wlnSystemShowOrder", "wlnSystemSelectIds", "wlnGoods", "wlnSendGood", "wlnSendId", "wlnSendName", "exchangeReason", "flowTag", "returnGoodsStatusList", "returnGoodsStatusValue", "exchangeReason", "exchangeStatusValue", "inStockStatusItemList", "inStockStatusList", "bsE3InStockStatusItemList", "bsE3InStockStatusList", "reissueStatusValue", "reissueReason", "adjustWorkOrderStatusValue", "adjustWorkOrderReason", "msgStatusValues", "msgStatus4Search", "createStatusValue", "createReason", "invoiceStatusValue", "invoiceReason", "invoicingStatusValue", "invoicingReason", "trajectoryList", "trajectoryMoreCompany", "trajectoryMoreCode", "trajectoryMoreSnapshot", "logisticsInterceptList", "logisticsInterceptCompanyList", "logisticsInterceptCodeList", "logisticsInterceptTypeList", "logisticsInterceptStatusList", "logisticsInterceptApiStatusList", "interceptLogisticsApiStatus", "logisticsInterceptSnapshotList", "productList", "label", "kmSendGood", "kmSendId", "kmSendName", "kmGoods", "gyGoods", "gyReissueType", "gySystemOrderNo", "gyReissueGoods", "gySendGood", "gySendId", "gySendName", "gyLogisticsCode", "gySystemShowOrder", "gySystemSelectIds", "gyLogisticsCompany", "gyLogisticsList", "gyReturnGoods", "gyReturnType", "gyExchangeGoods", "jyGoods", "jySystemOrderNo", "jySystemShowOrder", "jySystemSelectIds", "jySendGood", "jySendId", "jySendName", "jyLogisticsList", "jyLogisticsCompany", "jyLogisticsCode", "kmLogisticsList", "jstGoods", "jstSendGood", "jstReissueType", "jstReissueGoods", "jstSystemOrderNo", "jstLogisticsList", "jstSystemShowOrder", "jstSystemSelectIds", "jstReturnGoods", "jstReturnType", "jstExchangeGoods", "trajectoryApiStatus", "kmReissueGoods", "kmReissueType", "kmReturnGoods", "kmReturnType", "kmVideo", "wdtTags"].reduce(function (cur, nxt) {
3
3
  return cur || (key === null || key === void 0 ? void 0 : key.includes(nxt));
4
4
  }, false);
5
5
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/kmkf-utils",
3
- "version": "2.0.79-beta.51",
3
+ "version": "2.0.79-beta.52",
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": "22621e697649260177a8c784335016b9a6b311ab",
44
+ "gitHead": "41c227e32bbb551269c71df7b15d07574d0de141",
45
45
  "gitHooks": {
46
46
  "pre-commit": "lint-staged"
47
47
  }
@@ -1,285 +0,0 @@
1
- "use strict";
2
-
3
- var __assign = this && this.__assign || function () {
4
- __assign = Object.assign || function (t) {
5
- for (var s, i = 1, n = arguments.length; i < n; i++) {
6
- s = arguments[i];
7
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- exports.__esModule = true;
14
- exports.filterGyOrders = exports.gyOrderBackFormValues = exports.gyOrderTransform = exports.updateGyGoodsHandle = exports.GY_SYSTEM_ORDER_CONFIG = void 0;
15
- var getUUid_1 = require("./getUUid");
16
- var deliveryStateMap = {
17
- 0: "未发货",
18
- 2: "全部发货"
19
- };
20
- exports.GY_SYSTEM_ORDER_CONFIG = {
21
- key: "gySystemShowOrder",
22
- name: "管易",
23
- selectId: "gySystemSelectIds",
24
- columns: [{
25
- dataIndex: "billType",
26
- title: "订单类型",
27
- width: 150
28
- }, {
29
- dataIndex: "billNo",
30
- title: "系统订单号",
31
- width: 160
32
- }, {
33
- dataIndex: "tradeTagName",
34
- title: "订单标记名称",
35
- width: 150
36
- }, {
37
- dataIndex: "billTag",
38
- title: "订单标签",
39
- width: 150
40
- }, {
41
- dataIndex: "deliveryState",
42
- title: "发货状态",
43
- width: 150
44
- }]
45
- };
46
- exports.updateGyGoodsHandle = function (orders) {
47
- if (orders === void 0) {
48
- orders = [];
49
- }
50
- return orders === null || orders === void 0 ? void 0 : orders.reduce(function (acc, cur) {
51
- if (Array.isArray(cur.details)) {
52
- acc.push.apply(acc, cur.details.map(function (item) {
53
- var _a;
54
- item.goodName = item.itemName;
55
- item.goodShortName = item.itemSimpleName;
56
- item.goodNo = item.itemCode;
57
- item.specNo = item.skuCode;
58
- item.specName = item.skuName;
59
- item.canDelete = true;
60
- item.uuid = (_a = item.uuid) !== null && _a !== void 0 ? _a : getUUid_1["default"]();
61
- return item;
62
- }));
63
- }
64
- return acc;
65
- }, []);
66
- };
67
- var updateGyItemListHandle = function updateGyItemListHandle(list, type, comList, form) {
68
- var _a, _b;
69
- if (type === "logistics") {
70
- //管易物流信息组件先不做
71
- // const currentCom = comList?.find?.(
72
- // (item) => item.workOrderComponentType === "GY_LOGISTICS"
73
- // );
74
- // const notOrderBack = currentCom?.componentConfig?.notOrderBack || false;
75
- // if (notOrderBack) {
76
- // let currentValue = form.getFieldValue(currentCom.uniqueKey);
77
- // currentValue = currentValue?.length
78
- // ? currentValue
79
- // : [{ logisticsCode: "", logisticsCompany: "" }];
80
- // return currentValue;
81
- // }
82
- } else if (type === "send") {
83
- var currentCom = (_a = comList === null || comList === void 0 ? void 0 : comList.find) === null || _a === void 0 ? void 0 : _a.call(comList, function (item) {
84
- return item.workOrderComponentType === "GY_SEND_GOOD";
85
- });
86
- var notOrderBack = ((_b = currentCom === null || currentCom === void 0 ? void 0 : currentCom.componentConfig) === null || _b === void 0 ? void 0 : _b.notOrderBack) || false;
87
- if (notOrderBack) {
88
- var currentValue = form.getFieldValue(currentCom.uniqueKey);
89
- currentValue = (currentValue === null || currentValue === void 0 ? void 0 : currentValue.length) ? currentValue : [{
90
- sendId: "",
91
- sendName: ""
92
- }];
93
- return currentValue;
94
- }
95
- }
96
- var newList = list === null || list === void 0 ? void 0 : list.reduce(function (prv, next) {
97
- var items = ((next === null || next === void 0 ? void 0 : next.details) || []).map(function (t) {
98
- return {
99
- title: (t === null || t === void 0 ? void 0 : t.itemName) || "",
100
- picUrl: (t === null || t === void 0 ? void 0 : t.picPath) || "",
101
- platform: "gy",
102
- skuId: (t === null || t === void 0 ? void 0 : t.itemCode) || ""
103
- };
104
- });
105
- var params = {
106
- items: items
107
- };
108
- if (type === "logistics") {
109
- // params.logisticsCompany = next?.shippingCode;
110
- // params.logisticsCode = next?.shippingSn;
111
- } else if (type === "send") {
112
- params.sendId = next === null || next === void 0 ? void 0 : next.warehouseCode;
113
- //下拉框,取id
114
- params.sendName = next === null || next === void 0 ? void 0 : next.warehouseCode;
115
- params.sendSnapshotName = next === null || next === void 0 ? void 0 : next.warehouseName;
116
- }
117
- prv.push(params);
118
- return prv;
119
- }, []);
120
- if (!(newList === null || newList === void 0 ? void 0 : newList.length)) {
121
- switch (type) {
122
- case "logistics":
123
- newList = [{
124
- logisticsCode: ""
125
- }];
126
- break;
127
- case "supply":
128
- newList = [{
129
- supplyId: ""
130
- }];
131
- break;
132
- case "send":
133
- newList = [{
134
- sendId: "",
135
- sendName: ""
136
- }];
137
- break;
138
- }
139
- }
140
- return newList;
141
- };
142
- //管易订单信息转换
143
- exports.gyOrderTransform = function (detail, form) {
144
- var _a, _b, _c, _d, _e, _f;
145
- var orderNo = detail.orderNo,
146
- _g = detail.trades,
147
- currentTrades = _g === void 0 ? [] : _g,
148
- componentList = detail.componentList;
149
- var gyGoodsCom = (componentList || []).find(function (com) {
150
- return com.workOrderComponentType === "GY_GOODS";
151
- });
152
- var isStrict = gyGoodsCom ? (_a = form.getFieldValue(gyGoodsCom.uniqueKey)) === null || _a === void 0 ? void 0 : _a.isStrict : false;
153
- var onlyOneSystemOrder = (currentTrades === null || currentTrades === void 0 ? void 0 : currentTrades.length) === 1;
154
- console.log("触发---getGyOrderList--4");
155
- return {
156
- gySystemOrder: {
157
- orderNo: orderNo,
158
- isTest: 4,
159
- orders: currentTrades.map(function (item) {
160
- return __assign(__assign({}, item), {
161
- billNo: item.code,
162
- billType: item.orderTypeName,
163
- billTag: item.tagName,
164
- tradeTagName: item.tradeTagName,
165
- deliveryState: deliveryStateMap[item.deliveryState]
166
- });
167
- }),
168
- selectIds: onlyOneSystemOrder ? currentTrades.map(function (item) {
169
- return item.code;
170
- }) : [],
171
- showOrderInfo: currentTrades === null || currentTrades === void 0 ? void 0 : currentTrades.map(function (item) {
172
- return __assign(__assign({}, item), {
173
- billNo: item.code,
174
- billType: item.orderTypeName,
175
- billTag: item.tagName,
176
- tradeTagName: item.tradeTagName,
177
- deliveryState: deliveryStateMap[item.deliveryState]
178
- });
179
- })
180
- },
181
- gySystemOrderNo: onlyOneSystemOrder ? (_b = currentTrades[0]) === null || _b === void 0 ? void 0 : _b.code : undefined,
182
- gyReissueGoods: onlyOneSystemOrder ? exports.updateGyGoodsHandle([currentTrades[0]]).filter(function (good) {
183
- return !isStrict || !orderNo || good.platformCode === orderNo;
184
- }) : [],
185
- gyGoods: {
186
- // 订单反填,要清空orders,存的是当前系统订单号勾选上的 订单
187
- orders: currentTrades,
188
- orderNo: orderNo,
189
- shopCode: ((_d = (_c = currentTrades === null || currentTrades === void 0 ? void 0 : currentTrades.find) === null || _c === void 0 ? void 0 : _c.call(currentTrades, function (item) {
190
- return item.shopCode;
191
- })) === null || _d === void 0 ? void 0 : _d.shopCode) || null,
192
- vipCode: ((_f = (_e = currentTrades === null || currentTrades === void 0 ? void 0 : currentTrades.find) === null || _e === void 0 ? void 0 : _e.call(currentTrades, function (item) {
193
- return item.vipCode;
194
- })) === null || _f === void 0 ? void 0 : _f.vipCode) || null,
195
- gyGoods: exports.updateGyGoodsHandle(currentTrades).filter(function (good) {
196
- return !isStrict || !orderNo || good.platformCode === orderNo;
197
- })
198
- },
199
- // gyLogistics: updateGyItemListHandle(
200
- // currentTrades,
201
- // "logistics",
202
- // componentList || [],
203
- // form
204
- // ),
205
- gySendGood: updateGyItemListHandle(currentTrades, "send", componentList || [], form)
206
- };
207
- };
208
- exports.gyOrderBackFormValues = function (detail, templateDetail) {
209
- if (detail === void 0) {
210
- detail = {};
211
- }
212
- if (templateDetail === void 0) {
213
- templateDetail = {};
214
- }
215
- return ((templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.componentDtoList) || []).reduce(function (prv, next) {
216
- var _a, _b;
217
- var uniqueKey = next.uniqueKey;
218
- var config = next.componentConfig;
219
- switch (next.workOrderComponentType) {
220
- case "GY_SYSTEM_ORDER":
221
- prv[uniqueKey] = detail === null || detail === void 0 ? void 0 : detail.gySystemOrder;
222
- break;
223
- case "GY_GOODS":
224
- prv[uniqueKey] = detail === null || detail === void 0 ? void 0 : detail.gyGoods;
225
- break;
226
- case "GY_REISSUE_GOODS":
227
- prv[uniqueKey] = {
228
- gySystemOrder: detail === null || detail === void 0 ? void 0 : detail.gySystemOrder,
229
- gyReissueGoods: detail === null || detail === void 0 ? void 0 : detail.gyReissueGoods,
230
- gySystemOrderNo: detail === null || detail === void 0 ? void 0 : detail.gySystemOrderNo,
231
- gyReissueType: ["1"],
232
- shopCode: (_a = detail === null || detail === void 0 ? void 0 : detail.gyGoods) === null || _a === void 0 ? void 0 : _a.shopCode,
233
- vipCode: (_b = detail === null || detail === void 0 ? void 0 : detail.gyGoods) === null || _b === void 0 ? void 0 : _b.vipCode
234
- };
235
- break;
236
- case "GY_LOGISTICS":
237
- prv[uniqueKey] = updateGyItemListByConfigHandle(detail === null || detail === void 0 ? void 0 : detail.gyLogistics, "logistics", config);
238
- break;
239
- case "GY_SEND_GOOD":
240
- prv[uniqueKey] = updateGyItemListByConfigHandle(detail === null || detail === void 0 ? void 0 : detail.gySendGood, "send", config);
241
- }
242
- return prv;
243
- }, {});
244
- };
245
- var updateGyItemListByConfigHandle = function updateGyItemListByConfigHandle(list, type, config) {
246
- if (config === void 0) {
247
- config = {};
248
- }
249
- var showField = config.showField,
250
- _a = config.notOrderBack,
251
- notOrderBack = _a === void 0 ? false : _a;
252
- if (notOrderBack) {
253
- return list;
254
- }
255
- return list === null || list === void 0 ? void 0 : list.reduce(function (prv, next) {
256
- if (type === "logistics") {
257
- if (!["logisticsCompany", ""].includes(showField || "")) {
258
- next.logisticsCompany = undefined;
259
- }
260
- if (!["logisticsCode", ""].includes(showField || "")) {
261
- next.logisticsCode = undefined;
262
- }
263
- } else if (type === "send") {
264
- if (!["sendId", "all"].includes(showField || "")) {
265
- next.sendId = undefined;
266
- }
267
- if (!["sendName", "all"].includes(showField || "")) {
268
- next.sendName = undefined;
269
- next.sendSnapshotName = undefined;
270
- }
271
- }
272
- prv.push(next);
273
- return prv;
274
- }, []);
275
- };
276
- // 管易根据订单号请求返回的platformCode会有多个订单号组合在一起的数据 排除其他的,返回当前订单号
277
- exports.filterGyOrders = function (trades, order_no) {
278
- var currentTrades = (trades || []).filter(function (item) {
279
- return (item.platformCode || "").split(",").includes(order_no);
280
- });
281
- if (currentTrades.length) {
282
- return currentTrades;
283
- }
284
- return [];
285
- };