@kmkf-fe-packages/kmkf-utils 2.2.21 → 2.2.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.
@@ -1,3 +1,9 @@
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); }
1
7
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
8
  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
9
  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); }
@@ -7,6 +13,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
7
13
  import ExpressData from "../expressData";
8
14
  import ExpressInterceptData from "../expressInterceptData";
9
15
  import uuid from "./getUUid";
16
+ import isNull from "./isNull";
10
17
  export var BS_SYSTEM_ORDER_CONFIG = {
11
18
  key: "bsSystemShowOrder",
12
19
  name: "百胜",
@@ -213,13 +220,37 @@ export var bsOrderBackFormValues = function bsOrderBackFormValues() {
213
220
  prv[uniqueKey] = detail === null || detail === void 0 ? void 0 : detail.bsGoods;
214
221
  break;
215
222
  case "BS_EXCHANGE_GOODS":
216
- prv[uniqueKey] = detail === null || detail === void 0 ? void 0 : detail.bsExchangeGoods;
223
+ {
224
+ var _detail$bsGoods, _detail$bsGoods2;
225
+ var initReason = !isNull(config === null || config === void 0 ? void 0 : config.initReason) ? Array.isArray(config.initReason) ? config.initReason : [config.initReason] : [];
226
+ prv[uniqueKey] = _objectSpread(_objectSpread({}, detail === null || detail === void 0 ? void 0 : detail.bsExchangeGoods), {}, {
227
+ bsExchangeType: initReason,
228
+ bsExchangeReturnGoods: ["2", "4"].includes(initReason[0]) ? [] : (detail === null || detail === void 0 ? void 0 : (_detail$bsGoods = detail.bsGoods) === null || _detail$bsGoods === void 0 ? void 0 : _detail$bsGoods.bsGoods) || [],
229
+ bsExchangeSwapOutGoods: ["2", "4"].includes(initReason[0]) ? [] : (detail === null || detail === void 0 ? void 0 : (_detail$bsGoods2 = detail.bsGoods) === null || _detail$bsGoods2 === void 0 ? void 0 : _detail$bsGoods2.bsGoods) || []
230
+ });
231
+ }
217
232
  break;
218
233
  case "BS_REISSUE_GOODS":
219
- prv[uniqueKey] = detail === null || detail === void 0 ? void 0 : detail.bsReissueGoods;
234
+ {
235
+ var _detail$bsGoods3;
236
+ var _initReason = !isNull(config === null || config === void 0 ? void 0 : config.initReason) ? Array.isArray(config.initReason) ? config.initReason : [config.initReason] : [];
237
+ prv[uniqueKey] = _objectSpread(_objectSpread({}, detail === null || detail === void 0 ? void 0 : detail.bsReissueGoods), {}, {
238
+ bsReissueType: _initReason,
239
+ bsReissueGoods: ["2", "4"].includes(_initReason[0]) ? [] : (detail === null || detail === void 0 ? void 0 : (_detail$bsGoods3 = detail.bsGoods) === null || _detail$bsGoods3 === void 0 ? void 0 : _detail$bsGoods3.bsGoods) || []
240
+ });
241
+ }
242
+ // prv[uniqueKey] = detail?.bsReissueGoods;
243
+
220
244
  break;
221
245
  case "BS_RETURN_GOODS":
222
- prv[uniqueKey] = detail === null || detail === void 0 ? void 0 : detail.bsReturnGoods;
246
+ {
247
+ var _detail$bsGoods4;
248
+ var _initReason2 = !isNull(config === null || config === void 0 ? void 0 : config.initReason) ? Array.isArray(config.initReason) ? config.initReason : [config.initReason] : [];
249
+ prv[uniqueKey] = _objectSpread(_objectSpread({}, detail === null || detail === void 0 ? void 0 : detail.bsReturnGoods), {}, {
250
+ bsReturnType: _initReason2,
251
+ bsReturnGoods: ["2"].includes(_initReason2[0]) ? [] : (detail === null || detail === void 0 ? void 0 : (_detail$bsGoods4 = detail.bsGoods) === null || _detail$bsGoods4 === void 0 ? void 0 : _detail$bsGoods4.bsGoods) || []
252
+ });
253
+ }
223
254
  break;
224
255
  case "BS_LOGISTICS":
225
256
  prv[uniqueKey] = updateBsItemListByConfigHandle(detail === null || detail === void 0 ? void 0 : detail.bsLogistics, "logistics", config);
@@ -0,0 +1,10 @@
1
+ declare type ShowHeaderObjType = {
2
+ title: string;
3
+ dataIndex: string;
4
+ show?: boolean;
5
+ };
6
+ declare const getSystemShowHead: ({ columns, showHeader, }: {
7
+ columns: any[];
8
+ showHeader: (string | ShowHeaderObjType)[];
9
+ }) => any[];
10
+ export default getSystemShowHead;
@@ -0,0 +1,25 @@
1
+ var getSystemShowHead = function getSystemShowHead(_ref) {
2
+ var columns = _ref.columns,
3
+ showHeader = _ref.showHeader;
4
+ var initBaseInfoColumns = columns || [];
5
+ var baseInfoColumns = initBaseInfoColumns || [];
6
+ var isStringArray = Array.isArray(showHeader) && typeof showHeader[0] === "string";
7
+ var isObjectArray = Array.isArray(showHeader) && Object.prototype.toString.call(showHeader[0]) === "[object Object]";
8
+ if (isStringArray) {
9
+ baseInfoColumns = initBaseInfoColumns.filter(function (col) {
10
+ return showHeader.includes(col.dataIndex);
11
+ });
12
+ } else if (isObjectArray) {
13
+ baseInfoColumns = showHeader.map(function (col) {
14
+ var currentCol = initBaseInfoColumns.find(function (item) {
15
+ return item.dataIndex === col.dataIndex;
16
+ }); // 如果列应该显示(show不为false),则返回对应的列配置
17
+ if (currentCol && col.show !== false) {
18
+ return currentCol;
19
+ }
20
+ return undefined;
21
+ }).filter(Boolean);
22
+ }
23
+ return baseInfoColumns || [];
24
+ };
25
+ export default getSystemShowHead;
@@ -27,3 +27,4 @@ export * as templateFn from "./template";
27
27
  export * as tree from "./multidimensionalFindChild";
28
28
  export { default as unTransField } from "./unTransField";
29
29
  export { fetchAll } from "./FetchAll";
30
+ export { default as getSystemShowHead } from "./getSystemShowHead";
@@ -30,4 +30,5 @@ export { _templateFn as templateFn };
30
30
  import * as _tree from "./multidimensionalFindChild";
31
31
  export { _tree as tree };
32
32
  export { default as unTransField } from "./unTransField";
33
- export { fetchAll } from "./FetchAll";
33
+ export { fetchAll } from "./FetchAll";
34
+ export { default as getSystemShowHead } from "./getSystemShowHead";
@@ -112,7 +112,7 @@ var updateJstItemListHandle = function updateJstItemListHandle(list, type, comLi
112
112
  params.logisticsCompany = next === null || next === void 0 ? void 0 : next.logisticsCompany;
113
113
  params.logisticsCode = next === null || next === void 0 ? void 0 : next.lId;
114
114
  } else if (type === "send") {
115
- var wmsCoId = (next === null || next === void 0 ? void 0 : next.wmsCoId) === "0" ? "" : next === null || next === void 0 ? void 0 : next.wmsCoId;
115
+ var wmsCoId = (next === null || next === void 0 ? void 0 : next.wmsCoId) === "0" ? "" : "".concat(next === null || next === void 0 ? void 0 : next.wmsCoId);
116
116
  params.sendId = wmsCoId;
117
117
  params.sendName = wmsCoId && SendDataCenter.getInstance("jst").getSendNameByCode(wmsCoId);
118
118
  params.sendSnapshotId = wmsCoId;
@@ -7,6 +7,7 @@ export declare const WDT_SYSTEM_ORDER_CONFIG: {
7
7
  title: string;
8
8
  dataIndex: string;
9
9
  width: number;
10
+ ellipsis: boolean;
10
11
  }[];
11
12
  };
12
13
  export declare const WDT_ORDER_TYPE_MAP: {
@@ -63,6 +63,20 @@ export var tradeStatusMap = {
63
63
  105: "部分打款",
64
64
  110: "已完成",
65
65
  113: "异常发货"
66
+ },
67
+ web: {
68
+ 4: "已取消(可恢复)",
69
+ 5: "已取消",
70
+ 25: "特殊单",
71
+ 29: "预订单",
72
+ 30: "待审核(已支付)",
73
+ 35: "待财审",
74
+ 50: "待发货",
75
+ 51: "待推送",
76
+ 52: "推送中",
77
+ 53: "推送失败",
78
+ 55: "已推送",
79
+ 95: "已发货"
66
80
  }
67
81
  };
68
82
  export var WDT_SYSTEM_ORDER_CONFIG = {
@@ -72,19 +86,48 @@ export var WDT_SYSTEM_ORDER_CONFIG = {
72
86
  columns: [{
73
87
  title: "订单类型",
74
88
  dataIndex: "billType",
75
- width: 150
89
+ width: 150,
90
+ ellipsis: true
76
91
  }, {
77
92
  title: "系统订单号",
78
93
  dataIndex: "billNo",
79
- width: 150
94
+ width: 150,
95
+ ellipsis: true
80
96
  }, {
81
97
  title: "订单状态",
82
98
  dataIndex: "tradeStatusValue",
83
- width: 150
99
+ width: 150,
100
+ ellipsis: true
84
101
  }, {
85
102
  title: "订单标签",
86
103
  dataIndex: "billTag",
87
- width: 150
104
+ width: 150,
105
+ ellipsis: true
106
+ }, {
107
+ title: "物流公司名称",
108
+ dataIndex: "logisticsName",
109
+ width: 150,
110
+ ellipsis: true
111
+ }, {
112
+ title: "物流公司编码",
113
+ dataIndex: "logisticsCode",
114
+ width: 200,
115
+ ellipsis: true
116
+ }, {
117
+ title: "物流单号",
118
+ dataIndex: "logisticsNo",
119
+ width: 200,
120
+ ellipsis: true
121
+ }, {
122
+ title: "发货仓名称",
123
+ dataIndex: "warehouseName",
124
+ width: 200,
125
+ ellipsis: true
126
+ }, {
127
+ title: "发货仓编码",
128
+ dataIndex: "warehouseNo",
129
+ width: 200,
130
+ ellipsis: true
88
131
  }]
89
132
  };
90
133
  export var WDT_ORDER_TYPE_MAP = {
@@ -114,6 +157,7 @@ export var updateWdtGoodsHandle = function updateWdtGoodsHandle() {
114
157
  item.goodId = item.goodsId;
115
158
  item.goodName = item.goodsName;
116
159
  item.goodNo = item.goodsNo;
160
+ item.orderPrice = item.orderPrice || item.price;
117
161
  item.canDelete = true;
118
162
  item.uuid = (_item$uuid = item.uuid) !== null && _item$uuid !== void 0 ? _item$uuid : uuid();
119
163
  item.systemOrderNo = cur === null || cur === void 0 ? void 0 : cur.tradeNo;
@@ -353,19 +397,21 @@ export var wdtOrderTransform = function wdtOrderTransform(detail, form) {
353
397
  return _objectSpread(_objectSpread({}, item), {}, {
354
398
  billNo: item.tradeNo,
355
399
  billType: WDT_ORDER_TYPE_MAP[item.tradeType],
356
- billTag: item.tagName
400
+ billTag: item.tagName || item.tags // 网页版取tags,其他版本用tagName
357
401
  });
358
402
  }),
403
+
359
404
  selectIds: onlyOneSystemOrder ? currentTrades.map(function (item) {
360
405
  return item.tradeNo;
361
406
  }) : [],
362
407
  showOrderInfo: currentTrades === null || currentTrades === void 0 ? void 0 : currentTrades.map(function (item) {
363
- return {
408
+ return _objectSpread(_objectSpread({}, item), {}, {
364
409
  billNo: item.tradeNo,
365
410
  billType: WDT_ORDER_TYPE_MAP[item.tradeType],
366
- billTag: item.tagName,
411
+ billTag: item.tagName || item.tags,
412
+ // 网页版取tags,其他版本用tagName
367
413
  tradeStatusValue: item.tradeStatusValue
368
- };
414
+ });
369
415
  })
370
416
  },
371
417
  wdtSystemOrderNo: onlyOneSystemOrder || isReissueDefaultSelect ? currentTrades === null || currentTrades === void 0 ? void 0 : (_currentTrades$ = currentTrades[0]) === null || _currentTrades$ === void 0 ? void 0 : _currentTrades$.tradeNo : undefined,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/kmkf-utils",
3
- "version": "2.2.21",
3
+ "version": "2.2.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": "1426042144c662d01ea92d1004e75b4b878668e9",
44
+ "gitHead": "35bc1e4833e1bcb1255c9c43cb3c807d2544e88c",
45
45
  "gitHooks": {
46
46
  "pre-commit": "lint-staged"
47
47
  }