@kmkf-fe-packages/kmkf-utils 2.0.12-beta.23 → 2.0.12-beta.24

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.
@@ -10,7 +10,7 @@ export { BS_SYSTEM_ORDER_CONFIG, bsOrderBackFormValues, bsOrderTransform, } from
10
10
  export { bsE3OrderBackFormValues, bsE3OrderTransform, updateBsE3GoodsHandle, filterBsE3Orders, BS_E3_ORDER_STATUS_MAP, BS_E3_BOOLEAN_STATUS_MAP, BS_E3_SYSTEM_ORDER_CONFIG, } from "./bsE3OrderBackFormValues";
11
11
  export { WLN_SYSTEM_ORDER_CONFIG, wlnOrderBackFormValues, wlnOrderTransform, } from "./wlnOrderBackFormValues";
12
12
  export { WDT_SYSTEM_ORDER_CONFIG, wdtOrderBackFormValues, wdtOrderTransform, WDT_ORDER_TYPE_MAP, filterWdtOrders, updateWdtGoodsHandle, } from "./wdtOrderBackFormValues";
13
- export { jstOrderBackFormValues, jstOrderTransform, updateJstGoodsHandle, filterJstOrders, JST_ORDER_STATUS_MAP, JST_SYSTEM_ORDER_CONFIG, } from "./jstOrderBackFormValues";
13
+ export * from "./jstOrderBackFormValues";
14
14
  export { kmOrderBackFormValues, kmOrderTransform, KM_SYSTEM_ORDER_CONFIG, filterKmOrders, } from "./kmOrderBackFormValues";
15
15
  export { getIsPlatformCodesIncludeOrderNos, GY_DELIVERY_STATE_MAPPING, GY_SYSTEM_ORDER_CONFIG, updateGyGoodsHandle, gyOrderTransform, gyOrderBackFormValues, filterGyOrders, } from "./gyOrderBackFormValues";
16
16
  export { default as uuid } from "./getUUid";
@@ -11,7 +11,7 @@ export { bsE3OrderBackFormValues, bsE3OrderTransform, updateBsE3GoodsHandle, fil
11
11
  export { WLN_SYSTEM_ORDER_CONFIG, wlnOrderBackFormValues, wlnOrderTransform } from "./wlnOrderBackFormValues";
12
12
  export { WDT_SYSTEM_ORDER_CONFIG, wdtOrderBackFormValues, wdtOrderTransform, WDT_ORDER_TYPE_MAP, filterWdtOrders, updateWdtGoodsHandle } from "./wdtOrderBackFormValues";
13
13
  // export { default as jstOrderBackFormValues } from "./jstOrderBackFormValues";
14
- export { jstOrderBackFormValues, jstOrderTransform, updateJstGoodsHandle, filterJstOrders, JST_ORDER_STATUS_MAP, JST_SYSTEM_ORDER_CONFIG } from "./jstOrderBackFormValues";
14
+ export * from "./jstOrderBackFormValues";
15
15
  export { kmOrderBackFormValues, kmOrderTransform, KM_SYSTEM_ORDER_CONFIG, filterKmOrders } from "./kmOrderBackFormValues";
16
16
  export { getIsPlatformCodesIncludeOrderNos, GY_DELIVERY_STATE_MAPPING, GY_SYSTEM_ORDER_CONFIG, updateGyGoodsHandle, gyOrderTransform, gyOrderBackFormValues, filterGyOrders } from "./gyOrderBackFormValues";
17
17
  export { default as uuid } from "./getUUid";
@@ -10,6 +10,10 @@ export declare const JST_SYSTEM_ORDER_CONFIG: {
10
10
  };
11
11
  export declare const JST_ORDER_STATUS_MAP: Record<number, string>;
12
12
  export declare const updateJstGoodsHandle: (orders?: any[], canEdit?: boolean) => any;
13
+ export declare const jstMergeIdenticalGoods: <T extends {
14
+ skuId: string;
15
+ qty: number;
16
+ }>(goodDetails?: T[]) => T[];
13
17
  export declare const jstOrderBackFormValues: (detail?: any, templateDetail?: any) => any;
14
18
  export declare const jstOrderTransform: (detail: any, form: any) => {
15
19
  jstSystemOrder: {
@@ -96,7 +96,7 @@ var updateJstItemListHandle = function updateJstItemListHandle(list, type, comLi
96
96
  title: (t === null || t === void 0 ? void 0 : t.name) || "",
97
97
  picUrl: (t === null || t === void 0 ? void 0 : t.pic) || "",
98
98
  platform: "jst"
99
- }, type === 'itemList' ? {
99
+ }, type === "itemList" ? {
100
100
  itemId: t === null || t === void 0 ? void 0 : t.supplierId,
101
101
  supplierName: t === null || t === void 0 ? void 0 : t.supplierName
102
102
  } : {
@@ -111,7 +111,7 @@ var updateJstItemListHandle = function updateJstItemListHandle(list, type, comLi
111
111
  params.logisticsCode = next === null || next === void 0 ? void 0 : next.lcId;
112
112
  } else if (type === "send") {
113
113
  params.sendId = next === null || next === void 0 ? void 0 : next.wmsCoId;
114
- params.sendName = (next === null || next === void 0 ? void 0 : next.wmsCoId) && SendDataCenter.getInstance('jst').getSendNameByCode(next === null || next === void 0 ? void 0 : next.wmsCoId);
114
+ params.sendName = (next === null || next === void 0 ? void 0 : next.wmsCoId) && SendDataCenter.getInstance("jst").getSendNameByCode(next === null || next === void 0 ? void 0 : next.wmsCoId);
115
115
  params.sendSnapshotId = next === null || next === void 0 ? void 0 : next.wmsCoId;
116
116
  } else if (type === "supply") {
117
117
  params.supplyId = next === null || next === void 0 ? void 0 : next.drpCoIdTo;
@@ -188,6 +188,23 @@ var updateJstItemListByConfigHandle = function updateJstItemListByConfigHandle(l
188
188
  return prv;
189
189
  }, []);
190
190
  };
191
+ export var jstMergeIdenticalGoods = function jstMergeIdenticalGoods() {
192
+ var goodDetails = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
193
+ var list = [];
194
+ if (goodDetails.length) {
195
+ var obj = {};
196
+ goodDetails.forEach(function (goods) {
197
+ var goodIndex = obj[goods.skuId];
198
+ if (typeof goodIndex !== "number") {
199
+ obj[goods.skuId] = list.length;
200
+ list.push(goods);
201
+ } else {
202
+ list[goodIndex].qty = (list[goodIndex].qty || 0) + (goods.qty || 0);
203
+ }
204
+ });
205
+ }
206
+ return list;
207
+ };
191
208
  export var jstOrderBackFormValues = function jstOrderBackFormValues() {
192
209
  var detail = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
193
210
  var templateDetail = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
@@ -206,7 +223,7 @@ export var jstOrderBackFormValues = function jstOrderBackFormValues() {
206
223
  jstSystemOrder: detail === null || detail === void 0 ? void 0 : detail.jstSystemOrder,
207
224
  jstSystemOrderNo: detail === null || detail === void 0 ? void 0 : detail.jstSystemOrderNo,
208
225
  jstReissueType: ["1"],
209
- jstReissueGoods: (detail === null || detail === void 0 ? void 0 : detail.jstReissueGoods) || [],
226
+ jstReissueGoods: jstMergeIdenticalGoods((detail === null || detail === void 0 ? void 0 : detail.jstReissueGoods) || []),
210
227
  jstSystemOrderBillType: (detail === null || detail === void 0 ? void 0 : detail.jstSystemOrderBillType) || ""
211
228
  };
212
229
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/kmkf-utils",
3
- "version": "2.0.12-beta.23",
3
+ "version": "2.0.12-beta.24",
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": "4aabf17e2b776525fea07c701a025e0be82cc915",
44
+ "gitHead": "65a159aff52920e26a4309b968ac55df724f2297",
45
45
  "gitHooks": {
46
46
  "pre-commit": "lint-staged"
47
47
  }