@kmkf-fe-packages/kmkf-utils 0.23.1-beta.1 → 0.23.1-beta.3

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.
package/README.md CHANGED
@@ -1 +1 @@
1
- 1122334
1
+ 11223344
@@ -5,8 +5,10 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
5
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
6
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
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 Monitor from "kmkf-monitor";
8
9
  import request from "../request";
9
10
  import { toTree } from "../utils";
11
+ import moment from "moment";
10
12
  var BsAddressData = /*#__PURE__*/function () {
11
13
  function BsAddressData() {
12
14
  var _this = this;
@@ -15,8 +17,31 @@ var BsAddressData = /*#__PURE__*/function () {
15
17
  _defineProperty(this, "addrNameMap", {});
16
18
  _defineProperty(this, "addressOptions", []);
17
19
  _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
+ // if (Object.keys(this.addrData)?.length > 0) return;
21
+ try {
22
+ var list = JSON.parse(localStorage.getItem("bsAddressData") || "[]");
23
+ var dataTime = localStorage.getItem("bsAddressDataEndTime") ? Number(localStorage.getItem("bsAddressDataEndTime")) : 0;
24
+ var isTimeout = dataTime ? (new Date().getTime() - dataTime) / 3600 / 24 > 5 : true;
25
+ if (list.length && !isTimeout) {
26
+ var map = {};
27
+ var res = {};
28
+ for (var i = 0; i < list.length; i++) {
29
+ res[list[i]["id"]] = [list[i]["name"], list[i]["parentId"]];
30
+ map[list[i]["name"]] = list[i]["id"];
31
+ }
32
+ _this.addrData = res;
33
+ _this.addrNameMap = map;
34
+ _this.addressOptions = toTree(list, 1);
35
+ window.bsAddress = _this;
36
+ return;
37
+ }
38
+ } catch (e) {
39
+ var _Object$keys;
40
+ if (((_Object$keys = Object.keys(_this.addrData)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length) > 0) return;
41
+ }
42
+ Monitor.automaticReport({
43
+ message: "bs\u5730\u5740-\u5F00\u59CB\u8BF7\u6C42\uFF1A".concat(moment().format("YYYY-MM-DD hh:mm:ss"))
44
+ });
20
45
  request({
21
46
  url: "/qy/gdfw/template/queryBsAreas",
22
47
  method: "get",
@@ -26,13 +51,19 @@ var BsAddressData = /*#__PURE__*/function () {
26
51
  var res = {};
27
52
  var _resp$data = resp.data,
28
53
  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"];
54
+ localStorage.setItem("bsAddressData", JSON.stringify(list));
55
+ localStorage.setItem("bsAddressDataEndTime", JSON.stringify(new Date().getTime()));
56
+ for (var _i = 0; _i < list.length; _i++) {
57
+ res[list[_i]["id"]] = [list[_i]["name"], list[_i]["parentId"]];
58
+ map[list[_i]["name"]] = list[_i]["id"];
32
59
  }
33
60
  _this.addrData = res;
34
61
  _this.addrNameMap = map;
35
62
  _this.addressOptions = toTree(list, 1);
63
+ window.bsAddress = _this;
64
+ Monitor.automaticReport({
65
+ message: "bs\u5730\u5740-\u83B7\u53D6\u6570\u636E\uFF1A".concat(moment().format("YYYY-MM-DD hh:mm:ss"))
66
+ });
36
67
  });
37
68
  });
38
69
  _defineProperty(this, "parseData", function (addrCode) {
@@ -193,6 +193,21 @@ export var bsOrderBackFormValues = function bsOrderBackFormValues() {
193
193
  case "BS_POSTING":
194
194
  prv[uniqueKey] = detail === null || detail === void 0 ? void 0 : detail.bsPosting;
195
195
  break;
196
+ case "LOGISTICS_TRAJECTORY_MORE":
197
+ if (config.isOpen) {
198
+ if (config.logisticsMapping.companyType === "BS_LOGISTICS") {
199
+ prv[uniqueKey] = detail === null || detail === void 0 ? void 0 : detail.bsLogistics.reduce(function (p, n) {
200
+ p.push({
201
+ trajectoryCompany: n.logisticsCompany,
202
+ trajectoryCode: n.logisticsCode,
203
+ trajectoryPhone: "",
204
+ trajectorySnapshot: ""
205
+ });
206
+ return p;
207
+ }, []);
208
+ }
209
+ }
210
+ break;
196
211
  }
197
212
  return prv;
198
213
  }, {});
@@ -72,6 +72,7 @@ export default (function (_ref) {
72
72
  fromQNCreateWorkOrderByOrderNo = _ref$fromQNCreateWork === void 0 ? false : _ref$fromQNCreateWork;
73
73
  var orderValues = ((templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.componentDtoList) || []).reduce(function (prv, next) {
74
74
  var uniqueKey = next.uniqueKey;
75
+ var config = next.componentConfig;
75
76
  var city = null,
76
77
  town = null;
77
78
  switch (next.workOrderComponentType) {
@@ -182,6 +183,16 @@ export default (function (_ref) {
182
183
  case "SYSTEM_ORDER_NO":
183
184
  prv[uniqueKey] = detail["sid"];
184
185
  break;
186
+ case "LOGISTICS_TRAJECTORY_MORE":
187
+ if (config.isOpen) {
188
+ if (config.logisticsMapping.companyType === "EXPRESS_LOGISTICS_SELECT") {
189
+ prv[uniqueKey] = [{
190
+ trajectoryCompany: ExpressData.getInstance().getExpressCodeByName(detail["expressLogisticsCompany"]),
191
+ trajectoryCode: detail["expressLogisticsCode"]
192
+ }];
193
+ }
194
+ }
195
+ break;
185
196
  }
186
197
  return prv;
187
198
  }, {});
@@ -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', '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'].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.23.1-beta.1",
3
+ "version": "0.23.1-beta.3",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
@@ -8,9 +8,9 @@
8
8
  ],
9
9
  "scripts": {
10
10
  "build": "yarn run lint && father build",
11
+ "jest:init": "jest --init",
11
12
  "lint": "eslint . --ext .ts",
12
13
  "lint:fix": "npx eslint . --ext .ts --fix",
13
- "jest:init": "jest --init",
14
14
  "test": "jest"
15
15
  },
16
16
  "lint-staged": {
@@ -22,6 +22,7 @@
22
22
  ]
23
23
  },
24
24
  "dependencies": {
25
+ "kmkf-monitor": "^0.8.8",
25
26
  "lodash": "^4.17.21",
26
27
  "umi-request": "^1.4.0"
27
28
  },
@@ -39,8 +40,8 @@
39
40
  "publishConfig": {
40
41
  "access": "public"
41
42
  },
43
+ "gitHead": "0402084934b9b8e089b5d0f6b0679059653bf189",
42
44
  "gitHooks": {
43
45
  "pre-commit": "lint-staged"
44
- },
45
- "gitHead": "7767b6fb6b50a7f3db6e12b0d6b5bcf643e5e89e"
46
+ }
46
47
  }