@kmkf-fe-packages/kmkf-utils 1.19.4-beta.0 → 1.19.4

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.
@@ -1,9 +1,3 @@
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
1
  import isEmpty from "lodash/isEmpty";
8
2
  import keys from "lodash/keys";
9
3
  import get from "lodash/get";
@@ -14,16 +8,10 @@ export default (function (values, options) {
14
8
  values === null || values === void 0 ? void 0 : values.map(function (value, index) {
15
9
  var list = get(options, "".concat(index, ".list"), []);
16
10
  var flatt = keys(list).reduce(function (next, cur) {
17
- var _list;
18
- var newList = (_list = list[cur]) === null || _list === void 0 ? void 0 : _list.map(function (item) {
19
- return item !== null && item !== void 0 && item.actived ? _objectSpread(_objectSpread({}, item), {}, {
20
- actived: String(item.actived)
21
- }) : item;
22
- });
23
- return next.concat(newList);
11
+ return next.concat(list[cur]);
24
12
  }, []);
25
13
  var label = get(find(flatt, {
26
- actived: String(value)
14
+ actived: value
27
15
  }), "label", "");
28
16
  newKV.push({
29
17
  label: label,
@@ -52,15 +52,15 @@ var getExpression = function getExpression(condition, l, r) {
52
52
  var _intersection3, _intersection4;
53
53
  return Array.isArray(l) ? ((_intersection3 = intersection(r, l)) === null || _intersection3 === void 0 ? void 0 : _intersection3.length) > 0 : ((_intersection4 = intersection(r, [l])) === null || _intersection4 === void 0 ? void 0 : _intersection4.length) > 0;
54
54
  }
55
- if (condition === 'ARRAY_OBJECT_INCLUDE') {
56
- var _intersection5;
57
- return ((_intersection5 = intersection(extractPrimitiveValues(l), r)) === null || _intersection5 === void 0 ? void 0 : _intersection5.length) > 0;
58
- }
59
55
  if (condition === 'NINCLUDE') {
60
- var _intersection6, _intersection7;
61
- var _include = Array.isArray(l) ? ((_intersection6 = intersection(r, l)) === null || _intersection6 === void 0 ? void 0 : _intersection6.length) > 0 : ((_intersection7 = intersection(r, [l])) === null || _intersection7 === void 0 ? void 0 : _intersection7.length) > 0;
56
+ var _intersection5, _intersection6;
57
+ var _include = Array.isArray(l) ? ((_intersection5 = intersection(r, l)) === null || _intersection5 === void 0 ? void 0 : _intersection5.length) > 0 : ((_intersection6 = intersection(r, [l])) === null || _intersection6 === void 0 ? void 0 : _intersection6.length) > 0;
62
58
  return !_include;
63
59
  }
60
+ if (condition === 'ARRAY_OBJECT_INCLUDE') {
61
+ var _intersection7;
62
+ return ((_intersection7 = intersection(extractPrimitiveValues(l), r)) === null || _intersection7 === void 0 ? void 0 : _intersection7.length) > 0;
63
+ }
64
64
  return false;
65
65
  };
66
66
  export default getExpression;
@@ -7,7 +7,6 @@ export { default as getExpression } from "./getExpression";
7
7
  export { default as formatDisplayConfig } from "./formatDisplayConfig";
8
8
  export { default as orderBackFormValues } from "./orderBackFormValues";
9
9
  export { bsOrderBackFormValues, bsOrderTransform, } from "./bsOrderBackFormValues";
10
- export { bsE3OrderBackFormValues, bsE3OrderTransform, updateBsE3GoodsHandle, filterBsE3Orders, BS_E3_ORDER_STATUS_MAP, BS_E3_BOOLEAN_STATUS_MAP, BS_E3_IS_GIFT_STATUS_MAP } from './bsE3OrderBackFormValues';
11
10
  export { wlnOrderBackFormValues, wlnOrderTransform, } from "./wlnOrderBackFormValues";
12
11
  export { wdtOrderBackFormValues, wdtOrderTransform, WDT_ORDER_TYPE_MAP, filterWdtOrders, updateWdtGoodsHandle, } from "./wdtOrderBackFormValues";
13
12
  export { default as jstOrderBackFormValues } from "./jstOrderBackFormValues";
@@ -7,7 +7,6 @@ export { default as getExpression } from "./getExpression";
7
7
  export { default as formatDisplayConfig } from "./formatDisplayConfig";
8
8
  export { default as orderBackFormValues } from "./orderBackFormValues";
9
9
  export { bsOrderBackFormValues, bsOrderTransform } from "./bsOrderBackFormValues";
10
- export { bsE3OrderBackFormValues, bsE3OrderTransform, updateBsE3GoodsHandle, filterBsE3Orders, BS_E3_ORDER_STATUS_MAP, BS_E3_BOOLEAN_STATUS_MAP, BS_E3_IS_GIFT_STATUS_MAP } from "./bsE3OrderBackFormValues";
11
10
  export { wlnOrderBackFormValues, wlnOrderTransform } from "./wlnOrderBackFormValues";
12
11
  export { wdtOrderBackFormValues, wdtOrderTransform, WDT_ORDER_TYPE_MAP, filterWdtOrders, updateWdtGoodsHandle } from "./wdtOrderBackFormValues";
13
12
  export { default as jstOrderBackFormValues } from "./jstOrderBackFormValues";
@@ -13,7 +13,6 @@ import { bsOrderBackFormValues } from "./bsOrderBackFormValues";
13
13
  import { wlnOrderBackFormValues } from "./wlnOrderBackFormValues";
14
14
  import jstOrderBackFormValues from "./jstOrderBackFormValues";
15
15
  import { wdtOrderBackFormValues } from "./wdtOrderBackFormValues";
16
- import { bsE3OrderBackFormValues } from "./bsE3OrderBackFormValues";
17
16
 
18
17
  // 淘宝商品组件信息处理
19
18
 
@@ -223,7 +222,5 @@ export default (function (_ref) {
223
222
  var bsValues = bsOrderBackFormValues(detail["bsOrder"], templateDetail);
224
223
  var wlnValues = wlnOrderBackFormValues(detail["wlnOrder"], templateDetail);
225
224
  var wdtValues = wdtOrderBackFormValues(detail["wdtOrder"], templateDetail);
226
- var bsE3Values = bsE3OrderBackFormValues(detail["bsE3Order"], templateDetail);
227
- console.log('bsE3Values', bsE3Values);
228
- return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, orderValues), jstValues), bsValues), wlnValues), wdtValues), bsE3Values);
225
+ return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, orderValues), jstValues), bsValues), wlnValues), wdtValues);
229
226
  });
@@ -3,7 +3,6 @@ var findNodeById = function findNodeById(tree) {
3
3
  var actived = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
4
4
  for (var i = 0; i < tree.length; i++) {
5
5
  if (tree[i].actived == actived) {
6
- tree[i].actived = String(tree[i].actived);
7
6
  return tree[i];
8
7
  }
9
8
  if (tree[i].children) {
@@ -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", "checkbox", "multSelect", "rate", "picture", "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", "bsSystemShowOrder", "bsSystemSelectIds", "bsE3SystemOrderNo", "bsE3SystemShowOrder", "bsE3SystemSelectIds", "bsE3Goods", "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", "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"].reduce(function (cur, nxt) {
2
+ return ["itemList", "itemId", "supplierName", "numIid", "aloneItemId", "aloneItemEncode", "jstItemList", "logisticsCompany", "logisticsCode", "supplyId", "supplyName", "sendId", "sendName", "dateTime", "basicMultSelect", "checkbox", "multSelect", "rate", "picture", "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", "bsSystemShowOrder", "bsSystemSelectIds", "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", "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"].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": "1.19.4-beta.0",
3
+ "version": "1.19.4",
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": "028de42b869ce07e95ab7a7166bf487cfdf0f93a",
44
+ "gitHead": "167a8b190ae6a8c52525e929e98fee86be390f4f",
45
45
  "gitHooks": {
46
46
  "pre-commit": "lint-staged"
47
47
  }
@@ -1,22 +0,0 @@
1
- export declare const BS_E3_BOOLEAN_STATUS_MAP: Record<number, string>;
2
- export declare const BS_E3_ORDER_STATUS_MAP: Record<number, string>;
3
- export declare const BS_E3_IS_GIFT_STATUS_MAP: Record<number, string>;
4
- export declare const updateBsE3GoodsHandle: (orders?: any[]) => any;
5
- export declare const bsE3OrderBackFormValues: (detail?: any, templateDetail?: any) => any;
6
- export declare const bsE3OrderTransform: (detail: any, form: any) => {
7
- bsE3SystemOrder: {
8
- orderNo: any;
9
- orders: any;
10
- selectIds: any;
11
- showOrderInfo: any;
12
- };
13
- bsE3Goods: {
14
- orders: any;
15
- orderNo: any;
16
- shopCode: any;
17
- bsE3Goods: any;
18
- };
19
- bsE3Logistics: any;
20
- bsE3SendGood: any;
21
- };
22
- export declare const filterBsE3Orders: (detail: any, order_no: string) => any;
@@ -1,321 +0,0 @@
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 ExpressData from "../expressData";
14
- import uuid from "./getUUid";
15
- export var BS_E3_BOOLEAN_STATUS_MAP = {
16
- 0: "否",
17
- 1: "是"
18
- };
19
- export var BS_E3_ORDER_STATUS_MAP = {
20
- 0: "未确认",
21
- 1: "已确认",
22
- 3: "已作废",
23
- 5: "已完成"
24
- };
25
- export var BS_E3_IS_GIFT_STATUS_MAP = {
26
- 0: "非赠品",
27
- 1: "赠品"
28
- };
29
- export var updateBsE3GoodsHandle = function updateBsE3GoodsHandle() {
30
- var orders = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
31
- var list = orders.reduce(function (prv, next) {
32
- var _next$orderDetailGets;
33
- var goods = next === null || next === void 0 ? void 0 : (_next$orderDetailGets = next.orderDetailGets) === null || _next$orderDetailGets === void 0 ? void 0 : _next$orderDetailGets.map(function (item) {
34
- return _objectSpread(_objectSpread({}, item), {}, {
35
- mark: "是",
36
- isGift: BS_E3_IS_GIFT_STATUS_MAP === null || BS_E3_IS_GIFT_STATUS_MAP === void 0 ? void 0 : BS_E3_IS_GIFT_STATUS_MAP[item.isGift],
37
- canDelete: true,
38
- uuid: uuid()
39
- });
40
- });
41
- prv.push.apply(prv, _toConsumableArray(goods));
42
- return prv;
43
- }, []);
44
- //如果数量大于1 商品标记为否
45
- if (list.length > 1) {
46
- list = list.map(function (item) {
47
- item.mark = "否";
48
- return item;
49
- });
50
- }
51
- return list;
52
- };
53
- var updateBsE3ItemListHandle = function updateBsE3ItemListHandle(list, type) {
54
- var _newList;
55
- var newList = list === null || list === void 0 ? void 0 : list.reduce(function (prv, next) {
56
- var items = ((next === null || next === void 0 ? void 0 : next.orderDetailGets) || []).map(function (t) {
57
- return {
58
- title: (t === null || t === void 0 ? void 0 : t.name) || "",
59
- picUrl: (t === null || t === void 0 ? void 0 : t.picPath) || "",
60
- platform: "bse3",
61
- skuId: (t === null || t === void 0 ? void 0 : t.skuId) || ""
62
- };
63
- });
64
- var advList = (next.advancedDistributionInfos || []).map(function (item) {
65
- var params = {
66
- items: items
67
- };
68
- if (type === "logistics") {
69
- params.logisticsCompany = ExpressData.getInstance().getExpressCodeByName(item.logisticCompany);
70
- params.logisticsCode = item === null || item === void 0 ? void 0 : item.deliveryNo;
71
- } else if (type === "send") {
72
- params.sendId = item.wareHouseRealCode;
73
- params.sendName = item.wareHouseRealName;
74
- }
75
- return params;
76
- });
77
- prv.push.apply(prv, _toConsumableArray(advList));
78
- return prv;
79
- }, []);
80
- if (!((_newList = newList) !== null && _newList !== void 0 && _newList.length)) {
81
- switch (type) {
82
- case "logistics":
83
- newList = [{
84
- logisticsCode: ""
85
- }];
86
- break;
87
- case "supply":
88
- newList = [{
89
- supplyId: ""
90
- }];
91
- break;
92
- case "send":
93
- newList = [{
94
- sendId: "",
95
- sendName: ""
96
- }];
97
- break;
98
- }
99
- }
100
- return newList;
101
- };
102
- var updateBsE3SystemItemListHandle = function updateBsE3SystemItemListHandle(list, type) {
103
- var _newList2;
104
- var newList = list === null || list === void 0 ? void 0 : list.reduce(function (prv, next) {
105
- prv.push({
106
- deliveryNo: next.wmsStockOutBillNo,
107
- systemOrderId: next.orderSn
108
- });
109
- return prv;
110
- }, []);
111
- if (!((_newList2 = newList) !== null && _newList2 !== void 0 && _newList2.length)) {
112
- switch (type) {
113
- case "delivery":
114
- newList = [{
115
- deliveryNo: "",
116
- systemOrderId: ""
117
- }];
118
- break;
119
- }
120
- }
121
- return newList;
122
- };
123
- var updateBsE3ItemListByConfigHandle = function updateBsE3ItemListByConfigHandle(list, type) {
124
- var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
125
- var showField = config.showField;
126
- return list === null || list === void 0 ? void 0 : list.reduce(function (prv, next) {
127
- if (type === "logistics") {
128
- if (!["logisticsCompany", ""].includes(showField || "")) {
129
- next.logisticsCompany = undefined;
130
- }
131
- if (!["logisticsCode", ""].includes(showField || "")) {
132
- next.logisticsCode = undefined;
133
- }
134
- } else if (type === "send") {
135
- if (!["sendId", "all"].includes(showField || "")) {
136
- next.sendId = undefined;
137
- }
138
- if (!["sendName", "all"].includes(showField || "")) {
139
- next.sendName = undefined;
140
- }
141
- }
142
- prv.push(next);
143
- return prv;
144
- }, []);
145
- };
146
- export var bsE3OrderBackFormValues = function bsE3OrderBackFormValues() {
147
- var detail = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
148
- var templateDetail = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
149
- return ((templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.componentDtoList) || []).reduce(function (prv, next) {
150
- var uniqueKey = next.uniqueKey;
151
- var config = next.componentConfig;
152
- switch (next.workOrderComponentType) {
153
- case "BS_E3_SYSTEM_ORDER":
154
- prv[uniqueKey] = detail === null || detail === void 0 ? void 0 : detail.bsE3SystemOrder;
155
- break;
156
- // case "BS_SIGNING_TIME":
157
- // prv[uniqueKey] = detail?.bsSingingTime;
158
- // break;
159
- // case "BS_SEND_TIME":
160
- // prv[uniqueKey] = detail?.bsSendTime;
161
- // break;
162
- // case "BS_TRADE_PAYMENT_TIME":
163
- // prv[uniqueKey] = detail?.bsTradePaymentTime;
164
- // break;
165
- // case "BS_DEPOSIT":
166
- // prv[uniqueKey] = detail?.bsDeposit;
167
- // break;
168
- // case "BS_NET_RECEIPTS":
169
- // prv[uniqueKey] = detail?.bsNetReceipts;
170
- // break;
171
- // case "BS_PACKAGE_WEIGHT":
172
- // prv[uniqueKey] = detail?.bsPackageWeight;
173
- // break;
174
- case "BS_E3_GOODS":
175
- prv[uniqueKey] = detail === null || detail === void 0 ? void 0 : detail.bsE3Goods;
176
- break;
177
- // case "BS_EXCHANGE_GOODS":
178
- // prv[uniqueKey] = detail?.bsExchangeGoods;
179
- // break;
180
- case "BS_E3_REISSUE_GOODS":
181
- prv[uniqueKey] = detail === null || detail === void 0 ? void 0 : detail.bsE3ReissueGoods;
182
- break;
183
- // case "BS_RETURN_GOODS":
184
- // prv[uniqueKey] = detail?.bsReturnGoods;
185
- // break;
186
- // case "BS_LOGISTICS":
187
- // prv[uniqueKey] = updateBsE3ItemListByConfigHandle(
188
- // detail?.bsLogistics,
189
- // "logistics",
190
- // config
191
- // );
192
- // break;
193
- // case "BS_SEND_GOOD":
194
- // prv[uniqueKey] = updateBsE3ItemListByConfigHandle(
195
- // detail?.bsSendGood,
196
- // "send",
197
- // config
198
- // );
199
-
200
- // break;
201
- // case "BS_DELIVERY_NO":
202
- // prv[uniqueKey] = detail?.bsDeliveryNo;
203
- // break;
204
- // case "BS_POSTING":
205
- // prv[uniqueKey] = detail?.bsPosting;
206
- // break;
207
- // case "LOGISTICS_TRAJECTORY_MORE":
208
- // if (config.isOpen) {
209
- // if (config.logisticsMapping.companyType === "BS_LOGISTICS") {
210
- // prv[uniqueKey] = detail?.bsLogistics.reduce((p: any, n: any) => {
211
- // p.push({
212
- // trajectoryCompany: n.logisticsCompany,
213
- // trajectoryCode: n.logisticsCode,
214
- // trajectoryPhone: "",
215
- // trajectorySnapshot: "",
216
- // });
217
- // return p;
218
- // }, []);
219
- // }
220
- // }
221
- // break;
222
- // case "LOGISTICS_INTERCEPTION_MORE":
223
- // if (config.isOpen) {
224
- // if (config.logisticsMapping.companyType === "BS_LOGISTICS") {
225
- // prv[uniqueKey] = detail?.bsLogistics.reduce((p: any, n: any) => {
226
- // const expressInterceptData: any =
227
- // ExpressInterceptData.getInstance().getExpressData();
228
- // const interceptCompany = expressInterceptData.find((t: any) => {
229
- // return t.value === n.logisticsCompany;
230
- // });
231
- // const returnValue = (
232
- // interceptCompany?.interceptionTypeList || []
233
- // ).find((item: { config?: any }) => {
234
- // return item?.config?.isDefault;
235
- // });
236
- // p.push({
237
- // interceptCompany: n.logisticsCompany,
238
- // interceptCode: n.logisticsCode,
239
- // interceptType: returnValue?.value,
240
- // interceptSenderMobile: undefined,
241
- // interceptAddress: [],
242
- // interceptDetail: undefined,
243
- // interceptReceiverName: undefined,
244
- // interceptReceiverMobile: undefined,
245
- // interceptStatus: undefined,
246
- // interceptOther: undefined,
247
- // interceptLogisticsSnapshot: undefined,
248
- // });
249
- // return p;
250
- // }, []);
251
- // }
252
- // }
253
- // break;
254
- }
255
-
256
- return prv;
257
- }, {});
258
- };
259
- //bsE3订单信息转换
260
- export var bsE3OrderTransform = function bsE3OrderTransform(detail, form) {
261
- var _form$getFieldValue, _orderList$find, _orderList$find$call;
262
- var orderNo = detail.orderNo,
263
- _detail$orderList = detail.orderList,
264
- orderList = _detail$orderList === void 0 ? [] : _detail$orderList,
265
- componentList = detail.componentList;
266
- var bsE3GoodsCom = (componentList || []).find(function (com) {
267
- return com.workOrderComponentType === "BS_E3_GOODS";
268
- });
269
- var isStrict = bsE3GoodsCom ? (_form$getFieldValue = form.getFieldValue(bsE3GoodsCom.uniqueKey)) === null || _form$getFieldValue === void 0 ? void 0 : _form$getFieldValue.isStrict : false;
270
- var newOrderList = orderList === null || orderList === void 0 ? void 0 : orderList.map(function (item) {
271
- var isSplit = item.isSplit,
272
- isSplitNew = item.isSplitNew,
273
- isCopy = item.isCopy,
274
- isExchangeOrder = item.isExchangeOrder,
275
- isCombineNew = item.isCombineNew,
276
- isCombine = item.isCombine,
277
- orderStatus = item.orderStatus;
278
- return _objectSpread(_objectSpread({}, item), {}, {
279
- orderStatus: BS_E3_ORDER_STATUS_MAP[orderStatus],
280
- isSplit: BS_E3_BOOLEAN_STATUS_MAP[isSplit],
281
- isSplitNew: BS_E3_BOOLEAN_STATUS_MAP[isSplitNew],
282
- isExchangeOrder: BS_E3_BOOLEAN_STATUS_MAP[isExchangeOrder],
283
- isCopy: BS_E3_BOOLEAN_STATUS_MAP[isCopy],
284
- isCombineNew: BS_E3_BOOLEAN_STATUS_MAP[isCombineNew],
285
- isCombine: BS_E3_BOOLEAN_STATUS_MAP[isCombine]
286
- });
287
- });
288
- return {
289
- bsE3SystemOrder: {
290
- orderNo: orderNo,
291
- orders: newOrderList,
292
- selectIds: (orderList === null || orderList === void 0 ? void 0 : orderList.length) === 1 ? orderList.map(function (item) {
293
- return item.orderSn;
294
- }) : [],
295
- showOrderInfo: newOrderList
296
- },
297
- bsE3Goods: {
298
- // 订单反填,要清空orders,存的是当前系统订单号勾选上的 订单
299
- orders: orderList || [],
300
- orderNo: orderNo,
301
- 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) {
302
- return item.sdCode;
303
- })) === null || _orderList$find$call === void 0 ? void 0 : _orderList$find$call.sdCode) || null,
304
- bsE3Goods: updateBsE3GoodsHandle(orderList).filter(function (good) {
305
- return !isStrict || !orderNo || good.originalDealCode === orderNo;
306
- })
307
- },
308
- bsE3Logistics: updateBsE3ItemListHandle(detail === null || detail === void 0 ? void 0 : detail.orderList, "logistics"),
309
- bsE3SendGood: updateBsE3ItemListHandle(detail === null || detail === void 0 ? void 0 : detail.orderList, "send")
310
- };
311
- };
312
- // WDT根据订单号请求返回的srcTid会有多个订单号组合在一起的数据 排除其他的,返回当前订单号
313
- export var filterBsE3Orders = function filterBsE3Orders(detail, order_no) {
314
- var currentTrades = ((detail === null || detail === void 0 ? void 0 : detail.orderList) || []).filter(function (item) {
315
- return (item.dealCode || "").split(",").includes(order_no);
316
- });
317
- if (currentTrades.length) {
318
- return currentTrades;
319
- }
320
- return [];
321
- };