@kmkf-fe-packages/kmkf-utils 0.24.2-beta.7 → 0.25.0

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.
@@ -51,9 +51,6 @@ var BsAddressData = /*#__PURE__*/function () {
51
51
  var res = {};
52
52
  var _resp$data = resp.data,
53
53
  list = _resp$data === void 0 ? [] : _resp$data;
54
- Monitor.automaticReport({
55
- message: "bs\u5730\u5740-\u63A5\u53E3\u6570\u636E\uFF1A".concat(list.length)
56
- });
57
54
  localStorage.setItem("bsAddressData", JSON.stringify(list));
58
55
  localStorage.setItem("bsAddressDataEndTime", JSON.stringify(new Date().getTime()));
59
56
  for (var _i = 0; _i < list.length; _i++) {
@@ -41,7 +41,6 @@ declare enum TComponentType {
41
41
  ENTERPRISE_PAYMENT = "ENTERPRISE_PAYMENT",
42
42
  SYSTEM_ORDER_NO = "SYSTEM_ORDER_NO",
43
43
  LOGISTICS_INTERCEPTION = "LOGISTICS_INTERCEPTION",
44
- LOGISTICS_INTERCEPTION_MORE = "LOGISTICS_INTERCEPTION_MORE",
45
44
  WORK_ORDER_ID_INPUT = "WORK_ORDER_ID_INPUT",
46
45
  FLOW_STATUS_SELECT = "FLOW_STATUS_SELECT",
47
46
  FLOW_MARK_SELECT = "FLOW_MARK_SELECT",
@@ -74,9 +73,6 @@ declare enum TComponentType {
74
73
  WLN_GOODS = "WLN_GOODS",
75
74
  WLN_LOGISTICS = "WLN_LOGISTICS",
76
75
  WLN_SEND_GOOD = "WLN_SEND_GOOD",
77
- WDT_LOGISTICS = "WDT_LOGISTICS",
78
- WDT_SEND_GOOD = "WDR_SEND_GOOD",
79
- WDT_SYSTEM_ORDER = "WDT_SYSTEM_ORDER",
80
76
  }
81
77
 
82
78
  declare enum PlatForm {
@@ -2,7 +2,6 @@ export { default as ExpressData } from "./expressData";
2
2
  export { default as ExpressInterceptData } from "./expressInterceptData";
3
3
  export { default as AddressData } from "./addressData";
4
4
  export { default as BsAddressData } from "./bsAddressData";
5
- export { default as WdtAddressData } from "./wdtAddressData";
6
5
  export { default as PlatData } from "./platData";
7
6
  export { default as LogisticsAddressData } from "./logisticsAddressData";
8
7
  export { default as request } from "./request";
package/dist/esm/index.js CHANGED
@@ -2,7 +2,6 @@ export { default as ExpressData } from "./expressData";
2
2
  export { default as ExpressInterceptData } from "./expressInterceptData";
3
3
  export { default as AddressData } from "./addressData";
4
4
  export { default as BsAddressData } from "./bsAddressData";
5
- export { default as WdtAddressData } from "./wdtAddressData";
6
5
  export { default as PlatData } from "./platData";
7
6
  export { default as LogisticsAddressData } from "./logisticsAddressData";
8
7
  export { default as request } from "./request";
@@ -208,27 +208,6 @@ export var bsOrderBackFormValues = function bsOrderBackFormValues() {
208
208
  }
209
209
  }
210
210
  break;
211
- case "LOGISTICS_INTERCEPTION_MORE":
212
- if (config.isOpen) {
213
- if (config.logisticsMapping.companyType === "BS_LOGISTICS") {
214
- prv[uniqueKey] = detail === null || detail === void 0 ? void 0 : detail.bsLogistics.reduce(function (p, n) {
215
- p.push({
216
- interceptCompany: n.logisticsCompany,
217
- interceptCode: n.logisticsCode,
218
- interceptType: undefined,
219
- interceptSenderMobile: undefined,
220
- interceptAddress: [],
221
- interceptDetail: undefined,
222
- interceptReceiverName: undefined,
223
- interceptReceiverMobile: undefined,
224
- interceptStatus: undefined,
225
- interceptOther: undefined
226
- });
227
- return p;
228
- }, []);
229
- }
230
- }
231
- break;
232
211
  }
233
212
  return prv;
234
213
  }, {});
@@ -8,7 +8,6 @@ export { default as formatDisplayConfig } from "./formatDisplayConfig";
8
8
  export { default as orderBackFormValues } from "./orderBackFormValues";
9
9
  export { bsOrderBackFormValues, bsOrderTransform, } from "./bsOrderBackFormValues";
10
10
  export { wlnOrderBackFormValues, wlnOrderTransform, } from "./wlnOrderBackFormValues";
11
- export { wdtOrderBackFormValues, wdtOrderTransform, WDT_ORDER_TYPE_MAP } from "./wdtOrderBackFormValues";
12
11
  export { default as jstOrderBackFormValues } from "./jstOrderBackFormValues";
13
12
  export { default as uuid } from "./getUUid";
14
13
  export * as filterFn from "./filterFn";
@@ -8,7 +8,6 @@ export { default as formatDisplayConfig } from "./formatDisplayConfig";
8
8
  export { default as orderBackFormValues } from "./orderBackFormValues";
9
9
  export { bsOrderBackFormValues, bsOrderTransform } from "./bsOrderBackFormValues";
10
10
  export { wlnOrderBackFormValues, wlnOrderTransform } from "./wlnOrderBackFormValues";
11
- export { wdtOrderBackFormValues, wdtOrderTransform, WDT_ORDER_TYPE_MAP } from "./wdtOrderBackFormValues";
12
11
  export { default as jstOrderBackFormValues } from "./jstOrderBackFormValues";
13
12
  export { default as uuid } from "./getUUid";
14
13
  import * as _filterFn from "./filterFn";
@@ -12,7 +12,6 @@ import isNull from "./isNull";
12
12
  import { bsOrderBackFormValues } from "./bsOrderBackFormValues";
13
13
  import { wlnOrderBackFormValues } from "./wlnOrderBackFormValues";
14
14
  import jstOrderBackFormValues from "./jstOrderBackFormValues";
15
- import { wdtOrderBackFormValues } from "./wdtOrderBackFormValues";
16
15
 
17
16
  // 淘宝商品组件信息处理
18
17
 
@@ -196,30 +195,11 @@ export default (function (_ref) {
196
195
  }
197
196
  }
198
197
  break;
199
- case "LOGISTICS_INTERCEPTION_MORE":
200
- if (config.isOpen) {
201
- if (config.logisticsMapping.companyType === "EXPRESS_LOGISTICS_SELECT") {
202
- prv[uniqueKey] = [{
203
- interceptCompany: ExpressData.getInstance().getExpressCodeByName(detail["expressLogisticsCompany"]),
204
- interceptCode: detail["expressLogisticsCode"],
205
- interceptType: undefined,
206
- interceptSenderMobile: undefined,
207
- interceptAddress: [],
208
- interceptDetail: undefined,
209
- interceptReceiverName: undefined,
210
- interceptReceiverMobile: undefined,
211
- interceptStatus: undefined,
212
- interceptOther: undefined
213
- }];
214
- }
215
- }
216
- break;
217
198
  }
218
199
  return prv;
219
200
  }, {});
220
201
  var jstValues = jstOrderBackFormValues(detail["jstItemList"], templateDetail);
221
202
  var bsValues = bsOrderBackFormValues(detail["bsOrder"], templateDetail);
222
203
  var wlnValues = wlnOrderBackFormValues(detail["wlnOrder"], templateDetail);
223
- var wdtValues = wdtOrderBackFormValues(detail["wdtOrder"], templateDetail);
224
- return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, orderValues), jstValues), bsValues), wlnValues), wdtValues);
204
+ return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, orderValues), jstValues), bsValues), wlnValues);
225
205
  });
@@ -3,5 +3,5 @@ interface TreeOption {
3
3
  value: string;
4
4
  children?: TreeOption[];
5
5
  }
6
- declare const _default: (list: any[] | undefined, parId: number, valueKey?: string) => TreeOption[];
6
+ declare const _default: (list: any[] | undefined, parId: number) => TreeOption[];
7
7
  export default _default;
@@ -7,7 +7,6 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
7
7
  export default (function () {
8
8
  var list = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
9
9
  var parId = arguments.length > 1 ? arguments[1] : undefined;
10
- var valueKey = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'id';
11
10
  var len = list === null || list === void 0 ? void 0 : list.length;
12
11
  function loop(parId) {
13
12
  var res = [];
@@ -17,7 +16,7 @@ export default (function () {
17
16
  item.children = loop(Number(item.id));
18
17
  res.push(_objectSpread(_objectSpread({}, item), {}, {
19
18
  label: item.name,
20
- value: valueKey === 'id' ? Number(item.id) : item.name
19
+ value: Number(item.id)
21
20
  }));
22
21
  }
23
22
  }
@@ -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", "wdtSendGood", "wdtSendId", "wdtSendName", "wdtLogisticsCode", "wdtLogisticsCompany", "wdtLogisticsList", "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", "logisticsInterceptSnapshotList"].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", "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"].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": "0.24.2-beta.7",
3
+ "version": "0.25.0",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
@@ -40,7 +40,7 @@
40
40
  "publishConfig": {
41
41
  "access": "public"
42
42
  },
43
- "gitHead": "5a6b4943077fcfdbd99fd09141aa4633151793ea",
43
+ "gitHead": "356a8047a0b59ea8ad5c74cedf392f0f3fa71df2",
44
44
  "gitHooks": {
45
45
  "pre-commit": "lint-staged"
46
46
  }
@@ -1,32 +0,0 @@
1
- export declare const WDT_ORDER_TYPE_MAP: {
2
- 1: string;
3
- 2: string;
4
- 3: string;
5
- 4: string;
6
- 5: string;
7
- 6: string;
8
- 7: string;
9
- 8: string;
10
- 101: string;
11
- 102: string;
12
- 103: string;
13
- 104: string;
14
- 105: string;
15
- 106: string;
16
- 107: string;
17
- 108: string;
18
- };
19
- export declare const wdtOrderBackFormValues: (detail?: any, templateDetail?: any) => any;
20
- export declare const wdtOrderTransform: (detail: any) => {
21
- wdtSystemOrder: {
22
- orderNo: any;
23
- orders: any;
24
- selectIds: any;
25
- showOrderInfo: any;
26
- };
27
- wdtGoods: {
28
- wdtGoods: any;
29
- };
30
- wdtLogistics: any;
31
- wdtSendGood: any;
32
- };
@@ -1,276 +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 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
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
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."); }
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); }
10
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
11
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
12
- 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; }
13
- import ExpressData from "../expressData";
14
- import uuid from "./getUUid";
15
- export var WDT_ORDER_TYPE_MAP = {
16
- 1: '网店销售',
17
- 2: '线下零售',
18
- 3: '售后换货',
19
- 4: '批发业务',
20
- 5: '保修换新',
21
- 6: '保修完成',
22
- 7: '订单补发',
23
- 8: '供销补发',
24
- 101: '自定义类型1',
25
- 102: '自定义类型2',
26
- 103: '自定义类型3',
27
- 104: '自定义类型4',
28
- 105: '自定义类型5',
29
- 106: '自定义类型6',
30
- 107: '自定义属性7',
31
- 108: '自定义属性8'
32
- };
33
- var updateWdtGoodsHandle = function updateWdtGoodsHandle() {
34
- var orders = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
35
- return orders === null || orders === void 0 ? void 0 : orders.reduce(function (acc, cur) {
36
- if (Array.isArray(cur.goodDetails)) {
37
- acc.push.apply(acc, _toConsumableArray(cur.goodDetails.map(function (item) {
38
- item.goodId = item.goodsId;
39
- item.goodName = item.goodsName;
40
- item.goodNo = item.goodsNo;
41
- item.canDelete = true;
42
- item.uuid = uuid();
43
- return item;
44
- })));
45
- }
46
- return acc;
47
- }, []);
48
- };
49
- var updateWdtItemListHandle = function updateWdtItemListHandle(list, type) {
50
- var _newList;
51
- var newList = list === null || list === void 0 ? void 0 : list.reduce(function (prv, next) {
52
- var items = (next.goodDetails || []).map(function (t) {
53
- return {
54
- title: (t === null || t === void 0 ? void 0 : t.goodsName) || "",
55
- picUrl: (t === null || t === void 0 ? void 0 : t.imageUrl) || "",
56
- platform: "wdt",
57
- skuId: (t === null || t === void 0 ? void 0 : t.specId) || ""
58
- };
59
- });
60
- var params = {
61
- items: items
62
- };
63
- if (type === "logistics") {
64
- params.logisticsCompany = ExpressData.getInstance().getExpressCodeByName(next.logisticsName);
65
- params.logisticsCode = next === null || next === void 0 ? void 0 : next.logisticsNo;
66
- } else if (type === "send") {
67
- params.sendId = next.warehouseNo;
68
- params.sendName = next.warehouseName;
69
- }
70
- prv.push(params);
71
- return prv;
72
- }, []);
73
- if (!((_newList = newList) !== null && _newList !== void 0 && _newList.length)) {
74
- switch (type) {
75
- case "logistics":
76
- newList = [{
77
- logisticsCode: ""
78
- }];
79
- break;
80
- case "supply":
81
- newList = [{
82
- supplyId: ""
83
- }];
84
- break;
85
- case "send":
86
- newList = [{
87
- sendId: "",
88
- sendName: ""
89
- }];
90
- break;
91
- }
92
- }
93
- return newList;
94
- };
95
- var updateWdtSystemItemListHandle = function updateWdtSystemItemListHandle(list, type) {
96
- var _newList2;
97
- var newList = list === null || list === void 0 ? void 0 : list.reduce(function (prv, next) {
98
- prv.push({
99
- deliveryNo: next.wmsStockOutBillNo,
100
- systemOrderId: next.billNo
101
- });
102
- return prv;
103
- }, []);
104
- if (!((_newList2 = newList) !== null && _newList2 !== void 0 && _newList2.length)) {
105
- switch (type) {
106
- case "delivery":
107
- newList = [{
108
- deliveryNo: "",
109
- systemOrderId: ""
110
- }];
111
- break;
112
- }
113
- }
114
- return newList;
115
- };
116
- var updateWdtItemListByConfigHandle = function updateWdtItemListByConfigHandle(list, type) {
117
- var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
118
- var showField = config.showField;
119
- return list === null || list === void 0 ? void 0 : list.reduce(function (prv, next) {
120
- if (type === "logistics") {
121
- if (!["logisticsCompany", ""].includes(showField || "")) {
122
- next.logisticsCompany = undefined;
123
- }
124
- if (!["logisticsCode", ""].includes(showField || "")) {
125
- next.logisticsCode = undefined;
126
- }
127
- } else if (type === "send") {
128
- if (!["sendId", "all"].includes(showField || "")) {
129
- next.sendId = undefined;
130
- }
131
- if (!["sendName", "all"].includes(showField || "")) {
132
- next.sendName = undefined;
133
- }
134
- }
135
- prv.push(next);
136
- return prv;
137
- }, []);
138
- };
139
- export var wdtOrderBackFormValues = function wdtOrderBackFormValues() {
140
- var detail = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
141
- var templateDetail = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
142
- return ((templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.componentDtoList) || []).reduce(function (prv, next) {
143
- var uniqueKey = next.uniqueKey;
144
- var config = next.componentConfig;
145
- switch (next.workOrderComponentType) {
146
- case "WDT_SYSTEM_ORDER":
147
- prv[uniqueKey] = detail === null || detail === void 0 ? void 0 : detail.wdtSystemOrder;
148
- break;
149
- case "WDT_GOODS":
150
- prv[uniqueKey] = detail === null || detail === void 0 ? void 0 : detail.wdtGoods;
151
- break;
152
- case "WDT_REISSUE_GOODS":
153
- prv[uniqueKey] = detail === null || detail === void 0 ? void 0 : detail.wdtReissueGoods;
154
- break;
155
- case "WDT_LOGISTICS":
156
- prv[uniqueKey] = updateWdtItemListByConfigHandle(detail === null || detail === void 0 ? void 0 : detail.wdtLogistics, "logistics", config);
157
- break;
158
- case "WDT_SEND_GOOD":
159
- prv[uniqueKey] = updateWdtItemListByConfigHandle(detail === null || detail === void 0 ? void 0 : detail.wdtSendGood, "send", config);
160
- // case "WDT_SIGNING_TIME":
161
- // prv[uniqueKey] = detail?.wdtSingingTime;
162
- // break;
163
- // case "WDT_SEND_TIME":
164
- // prv[uniqueKey] = detail?.wdtSendTime;
165
- // break;
166
- // case "WDT_TRADE_PAYMENT_TIME":
167
- // prv[uniqueKey] = detail?.wdtTradePaymentTime;
168
- // break;
169
- // case "WDT_DEPOSIT":
170
- // prv[uniqueKey] = detail?.wdtDeposit;
171
- // break;
172
- // case "WDT_NET_RECEIPTS":
173
- // prv[uniqueKey] = detail?.wdtNetReceipts;
174
- // break;
175
- // case "WDT_PACKAGE_WEIGHT":
176
- // prv[uniqueKey] = detail?.wdtPackageWeight;
177
- // break;
178
- // case "WDT_EXCHANGE_GOODS":
179
- // prv[uniqueKey] = detail?.wdtExchangeGoods;
180
- // break;
181
- // case "WDT_RETURN_GOODS":
182
- // prv[uniqueKey] = detail?.wdtReturnGoods;
183
- // break;
184
- // break;
185
- // case "WDT_DELIVERY_NO":
186
- // prv[uniqueKey] = detail?.wdtDeliveryNo;
187
- // break;
188
- // case "WDT_POSTING":
189
- // prv[uniqueKey] = detail?.wdtPosting;
190
- // break;
191
- }
192
-
193
- return prv;
194
- }, {});
195
- };
196
- //wdt订单信息转换
197
- export var wdtOrderTransform = function wdtOrderTransform(detail) {
198
- var _detail$trades, _detail$trades$find, _detail$trades2, _ref;
199
- // const advItem: any =
200
- // detail?.orders?.[0]?.advancedDistributionInfos?.[0] || {};
201
- return {
202
- wdtSystemOrder: {
203
- orderNo: (detail === null || detail === void 0 ? void 0 : (_detail$trades = detail.trades) === null || _detail$trades === void 0 ? void 0 : (_detail$trades$find = _detail$trades.find(function (item) {
204
- return item.srcTid;
205
- })) === null || _detail$trades$find === void 0 ? void 0 : _detail$trades$find.srcTid) || '',
206
- orders: ((detail === null || detail === void 0 ? void 0 : detail.trades) || []).map(function (item) {
207
- return _objectSpread(_objectSpread({}, item), {}, {
208
- billNo: item.tradeNo,
209
- billType: WDT_ORDER_TYPE_MAP[item.tradeType],
210
- billTag: item.tagName
211
- });
212
- }),
213
- selectIds: (detail === null || detail === void 0 ? void 0 : (_detail$trades2 = detail.trades) === null || _detail$trades2 === void 0 ? void 0 : _detail$trades2.length) === 1 ? detail === null || detail === void 0 ? void 0 : detail.trades.map(function (item) {
214
- return item.tradeNo;
215
- }) : [],
216
- showOrderInfo: (_ref = (detail === null || detail === void 0 ? void 0 : detail.trades) || []) === null || _ref === void 0 ? void 0 : _ref.map(function (item) {
217
- return {
218
- billNo: item.tradeNo,
219
- billType: WDT_ORDER_TYPE_MAP[item.tradeType],
220
- billTag: item.tagName
221
- };
222
- })
223
- },
224
- wdtGoods: {
225
- // shopCode: detail?.shopCode,
226
- wdtGoods: updateWdtGoodsHandle(detail === null || detail === void 0 ? void 0 : detail.trades)
227
- },
228
- wdtLogistics: updateWdtItemListHandle(detail === null || detail === void 0 ? void 0 : detail.trades, "logistics"),
229
- wdtSendGood: updateWdtItemListHandle(detail === null || detail === void 0 ? void 0 : detail.trades, "send")
230
- // wdtSingingTime: detail?.receiptDate,
231
- // wdtSendTime:
232
- // detail?.orders?.[0]?.advancedDistributionInfos?.[0]?.deliveryDate,
233
- // wdtTradePaymentTime: detail?.payDate,
234
- // wdtDeposit: detail?.amountPaid,
235
- // wdtNetReceipts: detail?.merchantRealIncome,
236
- // wdtPackageWeight:
237
- // (detail?.orders || []).reduce((prv: any, next: any) => {
238
- // const number = (next?.advancedDistributionInfos || []).reduce(
239
- // (p: any, n: any) => {
240
- // p += n.orderWeight || 0;
241
- // return p;
242
- // },
243
- // 0
244
- // );
245
- // prv += number || 0;
246
- // return prv;
247
- // }, 0) || null,
248
- // wdtExchangeGoods: {
249
- // shopCode: detail?.shopCode,
250
- // wdtExchangeType: [],
251
- // wdtExchangeReturnGoods: [],
252
- // wdtExchangeSwapOutGoods: [],
253
- // wdtExchangeGiftGoods: [],
254
- // },
255
- // wdtReissueGoods: {
256
- // shopCode: detail?.shopCode,
257
- // wdtReissueType: [],
258
- // wdtReissueGoods: [],
259
- // },
260
- // wdtReturnGoods: {
261
- // shopCode: detail?.shopCode,
262
- // wdtReturnType: [],
263
- // wdtReturnGoods: [],
264
- // },
265
- // wdtDeliveryNo: updateWdtSystemItemListHandle(detail?.orders, "delivery"),
266
- // wdtPosting: {
267
- // postingAddress:
268
- // advItem?.provinceId || advItem?.cityId || advItem?.districtId
269
- // ? [advItem?.provinceId, advItem?.cityId, advItem?.districtId]
270
- // : [],
271
- // postingDetail: advItem?.address,
272
- // postingReceiverName: advItem?.receiver,
273
- // postingReceiverMobile: advItem?.receiverTel,
274
- // },
275
- };
276
- };
@@ -1,34 +0,0 @@
1
- interface TreeOption {
2
- label: string;
3
- value: string;
4
- children?: TreeOption[];
5
- }
6
- export default class WdtAddressData {
7
- private static instance;
8
- addrData: Record<string, [string, string | number]>;
9
- addrNameMap: Record<string, string>;
10
- addressOptions: TreeOption[];
11
- constructor();
12
- initData: () => void;
13
- parseData: (addrCode: string | number) => {
14
- label: string;
15
- value: string;
16
- }[];
17
- getProvinceByCode: (countryIndex: string | number) => {
18
- label: string;
19
- value: string;
20
- }[];
21
- getCityByProCode: (countryIndex: string | number) => {
22
- label: string;
23
- value: string;
24
- }[];
25
- getAreaByCityCode: (countryIndex: string | number) => {
26
- label: string;
27
- value: string;
28
- }[];
29
- getProCodeByName: (proName: string) => number | undefined;
30
- getNameByCode: (code: string | number) => string;
31
- static getInstance(): WdtAddressData;
32
- }
33
- export declare type WdtAddressDataClass = WdtAddressData;
34
- export {};
@@ -1,89 +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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
4
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
5
- 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; }
6
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
- 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); }
8
- import request from "../request";
9
- import { toTree } from "../utils";
10
- var WdtAddressData = /*#__PURE__*/function () {
11
- function WdtAddressData() {
12
- var _this = this;
13
- _classCallCheck(this, WdtAddressData);
14
- _defineProperty(this, "addrData", {});
15
- _defineProperty(this, "addrNameMap", {});
16
- _defineProperty(this, "addressOptions", []);
17
- _defineProperty(this, "initData", function () {
18
- var _Object$keys;
19
- if (((_Object$keys = Object.keys(_this.addrData)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length) > 0) return;
20
- request({
21
- url: "/qy/gdfw/template/queryWdtAreas",
22
- method: "get",
23
- data: {}
24
- }).then(function (resp) {
25
- var map = {};
26
- var res = {};
27
- var _resp$data = resp.data,
28
- list = _resp$data === void 0 ? [] : _resp$data;
29
- for (var i = 0; i < list.length; i++) {
30
- res[list[i]["id"]] = [list[i]["name"], list[i]["parentId"]];
31
- map[list[i]["name"]] = list[i]["id"];
32
- }
33
- _this.addrData = res;
34
- _this.addrNameMap = map;
35
- _this.addressOptions = toTree(list, 1);
36
- });
37
- });
38
- _defineProperty(this, "parseData", function (addrCode) {
39
- var nameCode = {},
40
- arr = [];
41
- for (var key in _this.addrData) {
42
- if (Object.prototype.hasOwnProperty.call(_this.addrData, key)) {
43
- var valueArray = _this.addrData[key];
44
- if (valueArray[1] === Number(addrCode)) {
45
- nameCode[valueArray[0]] = key;
46
- arr.push({
47
- label: valueArray[0],
48
- value: key
49
- });
50
- }
51
- }
52
- }
53
- return arr;
54
- });
55
- _defineProperty(this, "getProvinceByCode", function (countryIndex) {
56
- return _this.parseData(countryIndex);
57
- });
58
- _defineProperty(this, "getCityByProCode", function (countryIndex) {
59
- return _this.parseData(countryIndex);
60
- });
61
- _defineProperty(this, "getAreaByCityCode", function (countryIndex) {
62
- return _this.parseData(countryIndex);
63
- });
64
- _defineProperty(this, "getProCodeByName", function (proName) {
65
- for (var key in _this.addrData) {
66
- if (_this.addrData[key][0] === proName) {
67
- return Number(key);
68
- }
69
- }
70
- });
71
- _defineProperty(this, "getNameByCode", function (code) {
72
- var _ref;
73
- return (_ref = (_this.addrData || {})[code] || []) === null || _ref === void 0 ? void 0 : _ref[0];
74
- });
75
- this.initData();
76
- }
77
- _createClass(WdtAddressData, null, [{
78
- key: "getInstance",
79
- value: function getInstance() {
80
- if (!WdtAddressData.instance) {
81
- WdtAddressData.instance = new WdtAddressData();
82
- }
83
- return WdtAddressData.instance;
84
- }
85
- }]);
86
- return WdtAddressData;
87
- }();
88
- _defineProperty(WdtAddressData, "instance", void 0);
89
- export { WdtAddressData as default };