@kmkf-fe-packages/kmkf-utils 2.0.54-beta.34 → 2.0.54-beta.39
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.
|
@@ -43,6 +43,7 @@ declare const KM_ORDER_TYPE_MAP: {
|
|
|
43
43
|
};
|
|
44
44
|
export declare const updateKmGoodsHandle: (orders?: any[], config?: {
|
|
45
45
|
orderBackGoodsLevel?: string;
|
|
46
|
+
canEdit?: boolean;
|
|
46
47
|
}) => any[];
|
|
47
48
|
export declare const getKmOrderTypeValue: (key: keyof typeof KM_ORDER_TYPE_MAP) => string;
|
|
48
49
|
declare const KM_ORDER_STATUS: {
|
|
@@ -84,6 +85,7 @@ export declare const KM_SYSTEM_ORDER_CONFIG: {
|
|
|
84
85
|
};
|
|
85
86
|
export declare const filterKmOrders: (detail: any, order_no: string) => any;
|
|
86
87
|
export declare const kmOrderTransform: (detail: any, form: any) => {
|
|
88
|
+
kmSystemOrderNo: any;
|
|
87
89
|
kmSystemOrder: {
|
|
88
90
|
orderNo: any;
|
|
89
91
|
orders: any;
|
|
@@ -98,5 +100,7 @@ export declare const kmOrderTransform: (detail: any, form: any) => {
|
|
|
98
100
|
shopCode: any;
|
|
99
101
|
kmGoods: any[];
|
|
100
102
|
};
|
|
103
|
+
kmReissueGoods: any[];
|
|
104
|
+
kmReturnGoods: any[];
|
|
101
105
|
};
|
|
102
106
|
export {};
|
|
@@ -11,6 +11,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
11
11
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
12
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
13
|
import uuid from "./getUUid";
|
|
14
|
+
import isNull from "./isNull";
|
|
14
15
|
export var kmOrderBackFormValues = function kmOrderBackFormValues() {
|
|
15
16
|
var detail = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
16
17
|
var templateDetail = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
@@ -30,6 +31,32 @@ export var kmOrderBackFormValues = function kmOrderBackFormValues() {
|
|
|
30
31
|
case "KM_GOODS":
|
|
31
32
|
prv[uniqueKey] = detail === null || detail === void 0 ? void 0 : detail.kmGoods;
|
|
32
33
|
break;
|
|
34
|
+
case "KM_REISSUE_GOODS":
|
|
35
|
+
{
|
|
36
|
+
var _detail$kmGoods;
|
|
37
|
+
var initReason = !isNull(config === null || config === void 0 ? void 0 : config.initReason) ? config.initReason : "1";
|
|
38
|
+
prv[uniqueKey] = {
|
|
39
|
+
kmSystemOrder: detail === null || detail === void 0 ? void 0 : detail.kmSystemOrder,
|
|
40
|
+
kmReissueGoods: initReason === "2" ? [] : detail === null || detail === void 0 ? void 0 : detail.kmReissueGoods,
|
|
41
|
+
kmSystemOrderNo: detail === null || detail === void 0 ? void 0 : detail.kmSystemOrderNo,
|
|
42
|
+
kmReissueType: [initReason],
|
|
43
|
+
shopCode: detail === null || detail === void 0 ? void 0 : (_detail$kmGoods = detail.kmGoods) === null || _detail$kmGoods === void 0 ? void 0 : _detail$kmGoods.shopCode
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
break;
|
|
47
|
+
case "KM_RETURN_GOODS":
|
|
48
|
+
{
|
|
49
|
+
var _detail$kmGoods2;
|
|
50
|
+
var _initReason = !isNull(config === null || config === void 0 ? void 0 : config.initReason) ? config.initReason : "1";
|
|
51
|
+
prv[uniqueKey] = {
|
|
52
|
+
kmSystemOrder: detail === null || detail === void 0 ? void 0 : detail.kmSystemOrder,
|
|
53
|
+
kmReturnGoods: _initReason === "2" ? [] : detail === null || detail === void 0 ? void 0 : detail.kmReturnGoods,
|
|
54
|
+
kmSystemOrderNo: detail === null || detail === void 0 ? void 0 : detail.kmSystemOrderNo,
|
|
55
|
+
kmReturnType: [_initReason],
|
|
56
|
+
shopCode: detail === null || detail === void 0 ? void 0 : (_detail$kmGoods2 = detail.kmGoods) === null || _detail$kmGoods2 === void 0 ? void 0 : _detail$kmGoods2.shopCode
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
break;
|
|
33
60
|
}
|
|
34
61
|
return prv;
|
|
35
62
|
}, {});
|
|
@@ -85,12 +112,15 @@ export var updateKmGoodsHandle = function updateKmGoodsHandle() {
|
|
|
85
112
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
86
113
|
sysTitle: item.title,
|
|
87
114
|
title: item.platformTitle,
|
|
88
|
-
num: item.itemNum,
|
|
115
|
+
num: item.itemNum || item.num,
|
|
116
|
+
realNum: item.itemNum || item.num,
|
|
117
|
+
desiredNum: item.itemNum || item.num,
|
|
89
118
|
type: item.erpOrderType,
|
|
90
119
|
itemSysId: item.sysItemId,
|
|
91
120
|
skuSysId: item.sysSkuId,
|
|
92
121
|
sysPicPath: item.picUrl,
|
|
93
122
|
canDelete: true,
|
|
123
|
+
canEdit: !!config.canEdit,
|
|
94
124
|
uuid: (_item$uuid = item.uuid) !== null && _item$uuid !== void 0 ? _item$uuid : uuid()
|
|
95
125
|
});
|
|
96
126
|
});
|
|
@@ -271,11 +301,15 @@ export var filterKmOrders = function filterKmOrders(detail, order_no) {
|
|
|
271
301
|
|
|
272
302
|
//km订单信息转换
|
|
273
303
|
export var kmOrderTransform = function kmOrderTransform(detail, form) {
|
|
274
|
-
var _componentList$find, _componentList$find$c, _trades$find, _trades$find$call;
|
|
304
|
+
var _form$getFieldValue, _componentList$find, _componentList$find$c, _componentList$find2, _componentList$find2$, _componentList$find3, _componentList$find3$, _trades$, _trades$find, _trades$find$call;
|
|
275
305
|
var trades = (detail === null || detail === void 0 ? void 0 : detail.orderDetailDtoList) || (detail === null || detail === void 0 ? void 0 : detail.trades) || [];
|
|
276
306
|
var _ref = detail || {},
|
|
277
307
|
orderNo = _ref.orderNo,
|
|
278
308
|
componentList = _ref.componentList;
|
|
309
|
+
var kmGoodsCom = (componentList || []).find(function (com) {
|
|
310
|
+
return com.workOrderComponentType === "KM_GOODS";
|
|
311
|
+
});
|
|
312
|
+
var isStrict = kmGoodsCom ? (_form$getFieldValue = form.getFieldValue(kmGoodsCom.uniqueKey)) === null || _form$getFieldValue === void 0 ? void 0 : _form$getFieldValue.isStrict : false;
|
|
279
313
|
var onlyOneSystemOrder = (trades === null || trades === void 0 ? void 0 : trades.length) === 1;
|
|
280
314
|
console.log("kmOrderTransform---", {
|
|
281
315
|
detail: detail,
|
|
@@ -284,7 +318,14 @@ export var kmOrderTransform = function kmOrderTransform(detail, form) {
|
|
|
284
318
|
var kmGoodsOrderBackGoodsLevel = (_componentList$find = componentList.find(function (item) {
|
|
285
319
|
return item.workOrderComponentType === "KM_GOODS";
|
|
286
320
|
})) === null || _componentList$find === void 0 ? void 0 : (_componentList$find$c = _componentList$find.componentConfig) === null || _componentList$find$c === void 0 ? void 0 : _componentList$find$c.orderBackGoodsLevel;
|
|
321
|
+
var kmReissueGoodsOrderBackGoodsLevel = (_componentList$find2 = componentList.find(function (item) {
|
|
322
|
+
return item.workOrderComponentType === "KM_REISSUE_GOODS";
|
|
323
|
+
})) === null || _componentList$find2 === void 0 ? void 0 : (_componentList$find2$ = _componentList$find2.componentConfig) === null || _componentList$find2$ === void 0 ? void 0 : _componentList$find2$.orderBackGoodsLevel;
|
|
324
|
+
var kmReturnGoodsOrderBackGoodsLevel = (_componentList$find3 = componentList.find(function (item) {
|
|
325
|
+
return item.workOrderComponentType === "KM_RETURN_GOODS";
|
|
326
|
+
})) === null || _componentList$find3 === void 0 ? void 0 : (_componentList$find3$ = _componentList$find3.componentConfig) === null || _componentList$find3$ === void 0 ? void 0 : _componentList$find3$.orderBackGoodsLevel;
|
|
287
327
|
return {
|
|
328
|
+
kmSystemOrderNo: onlyOneSystemOrder ? (_trades$ = trades[0]) === null || _trades$ === void 0 ? void 0 : _trades$.sid : undefined,
|
|
288
329
|
kmSystemOrder: {
|
|
289
330
|
orderNo: detail === null || detail === void 0 ? void 0 : detail.order_no,
|
|
290
331
|
orders: trades.map(function (item) {
|
|
@@ -316,10 +357,19 @@ export var kmOrderTransform = function kmOrderTransform(detail, form) {
|
|
|
316
357
|
shopCode: (trades === null || trades === void 0 ? void 0 : (_trades$find = trades.find) === null || _trades$find === void 0 ? void 0 : (_trades$find$call = _trades$find.call(trades, function (item) {
|
|
317
358
|
return item.shopCode;
|
|
318
359
|
})) === null || _trades$find$call === void 0 ? void 0 : _trades$find$call.shopCode) || null,
|
|
319
|
-
// kmGoods: updateKmGoodsHandle(trades),
|
|
320
360
|
kmGoods: updateKmGoodsHandle(trades, {
|
|
321
361
|
orderBackGoodsLevel: kmGoodsOrderBackGoodsLevel
|
|
322
362
|
})
|
|
323
|
-
}
|
|
363
|
+
},
|
|
364
|
+
kmReissueGoods: onlyOneSystemOrder ? updateKmGoodsHandle([trades[0]], {
|
|
365
|
+
orderBackGoodsLevel: kmReissueGoodsOrderBackGoodsLevel
|
|
366
|
+
}).filter(function (good) {
|
|
367
|
+
return !isStrict || !orderNo || good.sid === orderNo;
|
|
368
|
+
}) : [],
|
|
369
|
+
kmReturnGoods: onlyOneSystemOrder ? updateKmGoodsHandle([trades[0]], {
|
|
370
|
+
orderBackGoodsLevel: kmReturnGoodsOrderBackGoodsLevel
|
|
371
|
+
}).filter(function (good) {
|
|
372
|
+
return !isStrict || !orderNo || good.sid === orderNo;
|
|
373
|
+
}) : []
|
|
324
374
|
};
|
|
325
375
|
};
|
|
@@ -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", "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"].reduce(function (cur, nxt) {
|
|
2
|
+
return ["itemList", "itemId", "supplierName", "numIid", "aloneItemId", "aloneItemEncode", "jstItemList", "logisticsCompany", "logisticsCode", "supplyId", "supplyName", "sendId", "sendName", "dateTime", "basicMultSelect", "memberLevel", "erpOrderType", "orderRefundType", "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", "kmReturnGoods"].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.54-beta.
|
|
3
|
+
"version": "2.0.54-beta.39",
|
|
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": "
|
|
44
|
+
"gitHead": "49b0b68362eefefcdab0ee03d4e181bc37d248cb",
|
|
45
45
|
"gitHooks": {
|
|
46
46
|
"pre-commit": "lint-staged"
|
|
47
47
|
}
|