@kmkf-fe-packages/kmkf-work-order-service-component 2.0.59 → 2.0.61

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.
Files changed (35) hide show
  1. package/dist/esm/common/utils/transformWorkOrderData.js +27 -21
  2. package/package.json +5 -5
  3. package/dist/esm/GlobalContext/hook/dist/useGetHasErpData.js +0 -52
  4. package/dist/esm/GlobalContext/orderQuery/dist/useGetErpAddressData.js +0 -180
  5. package/dist/esm/GlobalContext/orderQuery/dist/useGetErpLogisticsCompany.js +0 -186
  6. package/dist/esm/common/utils/dist/submitDataTransOldFormat.js +0 -899
  7. package/dist/esm/common/utils/dist/tools.js +0 -1326
  8. package/dist/esm/common/utils/dist/transformWorkOrderData.js +0 -965
  9. package/dist/esm/model/customizeWorkOrder/dist/api.js +0 -48
  10. package/dist/esm/model/customizeWorkOrder/dist/index.js +0 -370
  11. package/dist/esm/model/customizeWorkOrder/dist/selector.js +0 -63
  12. package/dist/esm/model/customizeWorkOrder/dist/types.js +0 -3
  13. package/dist/esm/model/dist/global.js +0 -44
  14. package/dist/esm/model/dist/hooks.js +0 -15
  15. package/dist/esm/model/dist/login.js +0 -245
  16. package/dist/esm/model/dist/store.js +0 -30
  17. package/dist/esm/model/dist/userData.js +0 -41
  18. package/dist/esm/model/dist/workOrder.js +0 -329
  19. package/dist/esm/model/flowTemplateDetail/dist/api.js +0 -192
  20. package/dist/esm/model/flowTemplateDetail/dist/types.js +0 -48
  21. package/dist/esm/model/logicFlow/dist/api.js +0 -14
  22. package/dist/esm/model/logicFlow/dist/index.js +0 -235
  23. package/dist/esm/model/logicFlow/dist/selector.js +0 -18
  24. package/dist/esm/model/logicFlow/dist/types.js +0 -3
  25. package/dist/esm/model/paymentWorkOrder/dist/index.js +0 -77
  26. package/dist/esm/model/paymentWorkOrder/dist/selector.js +0 -36
  27. package/dist/esm/model/paymentWorkOrder/dist/types.js +0 -3
  28. package/dist/esm/model/servers/dist/api.js +0 -545
  29. package/dist/esm/model/servers/dist/request.js +0 -63
  30. package/dist/esm/model/singleShopWorkOrder/dist/index.js +0 -216
  31. package/dist/esm/model/singleShopWorkOrder/dist/selector.js +0 -24
  32. package/dist/esm/model/singleShopWorkOrder/dist/types.js +0 -3
  33. package/dist/esm/model/types/dist/login.js +0 -3
  34. package/dist/esm/model/types/dist/singleWorkOrder.js +0 -3
  35. package/dist/esm/model/types/dist/workOrder.js +0 -3
@@ -56,6 +56,11 @@ var processSelect = function processSelect(getValue) {
56
56
  return _defineProperty({}, nex.uniqueKey, getValue("".concat(nex.uniqueKey, "_select")) || select);
57
57
  };
58
58
  };
59
+ var gyPaymentMethod = function gyPaymentMethod(getValue) {
60
+ return function (nex, config) {
61
+ return _defineProperty({}, nex.uniqueKey, getValue("".concat(nex.uniqueKey, "_gyPaymentMethod")));
62
+ };
63
+ };
59
64
  var processRate = function processRate(getValue) {
60
65
  return function (nex, config) {
61
66
  return _defineProperty({}, nex.uniqueKey, jsonParseSecurity(getValue("".concat(nex.uniqueKey, "_rate")), []));
@@ -92,11 +97,11 @@ var processBuyerNickInput = function processBuyerNickInput(getValue) {
92
97
  };
93
98
  var processAliPayInput = function processAliPayInput(getValue) {
94
99
  return function (nex, config) {
95
- var _ref10;
96
- return _ref10 = {}, _defineProperty(_ref10, nex.uniqueKey, {
100
+ var _ref11;
101
+ return _ref11 = {}, _defineProperty(_ref11, nex.uniqueKey, {
97
102
  name: getValue("".concat(nex.uniqueKey, "_alipayName")),
98
103
  user: getValue("".concat(nex.uniqueKey, "_alipayAccount"))
99
- }), _defineProperty(_ref10, "".concat(nex.uniqueKey, "_alipayName"), getValue("".concat(nex.uniqueKey, "_alipayName"))), _defineProperty(_ref10, "".concat(nex.uniqueKey, "_alipayAccount"), getValue("".concat(nex.uniqueKey, "_alipayAccount"))), _ref10;
104
+ }), _defineProperty(_ref11, "".concat(nex.uniqueKey, "_alipayName"), getValue("".concat(nex.uniqueKey, "_alipayName"))), _defineProperty(_ref11, "".concat(nex.uniqueKey, "_alipayAccount"), getValue("".concat(nex.uniqueKey, "_alipayAccount"))), _ref11;
100
105
  };
101
106
  };
102
107
  var processCheckbox = function processCheckbox(getValue) {
@@ -199,20 +204,20 @@ var processSubForm = function processSubForm(getValue) {
199
204
  };
200
205
  var processExpressLogisticsSelect = function processExpressLogisticsSelect(getValue) {
201
206
  return function (nex, config) {
202
- var _ref20;
203
- return _ref20 = {}, _defineProperty(_ref20, nex.uniqueKey, {
207
+ var _ref21;
208
+ return _ref21 = {}, _defineProperty(_ref21, nex.uniqueKey, {
204
209
  company: getValue("".concat(nex.uniqueKey, "_expressLogisticsCompany")),
205
210
  order: getValue("".concat(nex.uniqueKey, "_expressLogisticsCode"))
206
- }), _defineProperty(_ref20, "".concat(nex.uniqueKey, "_expressLogisticsCompany"), getValue("".concat(nex.uniqueKey, "_expressLogisticsCompany"))), _defineProperty(_ref20, "".concat(nex.uniqueKey, "_expressLogisticsCode"), getValue("".concat(nex.uniqueKey, "_expressLogisticsCode"))), _ref20;
211
+ }), _defineProperty(_ref21, "".concat(nex.uniqueKey, "_expressLogisticsCompany"), getValue("".concat(nex.uniqueKey, "_expressLogisticsCompany"))), _defineProperty(_ref21, "".concat(nex.uniqueKey, "_expressLogisticsCode"), getValue("".concat(nex.uniqueKey, "_expressLogisticsCode"))), _ref21;
207
212
  };
208
213
  };
209
214
  var processReturnLogisticsSelect = function processReturnLogisticsSelect(getValue) {
210
215
  return function (nex, config) {
211
- var _ref21;
212
- return _ref21 = {}, _defineProperty(_ref21, nex.uniqueKey, {
216
+ var _ref22;
217
+ return _ref22 = {}, _defineProperty(_ref22, nex.uniqueKey, {
213
218
  company: getValue("".concat(nex.uniqueKey, "_returnLogisticsCompany")),
214
219
  order: getValue("".concat(nex.uniqueKey, "_returnLogisticsCode"))
215
- }), _defineProperty(_ref21, "".concat(nex.uniqueKey, "_returnLogisticsCompany"), getValue("".concat(nex.uniqueKey, "_returnLogisticsCompany"))), _defineProperty(_ref21, "".concat(nex.uniqueKey, "_returnLogisticsCode"), getValue("".concat(nex.uniqueKey, "_returnLogisticsCode"))), _ref21;
220
+ }), _defineProperty(_ref22, "".concat(nex.uniqueKey, "_returnLogisticsCompany"), getValue("".concat(nex.uniqueKey, "_returnLogisticsCompany"))), _defineProperty(_ref22, "".concat(nex.uniqueKey, "_returnLogisticsCode"), getValue("".concat(nex.uniqueKey, "_returnLogisticsCode"))), _ref22;
216
221
  };
217
222
  };
218
223
  var processRemarkInput = function processRemarkInput(getValue) {
@@ -227,25 +232,25 @@ var processRemarkInput = function processRemarkInput(getValue) {
227
232
  };
228
233
  var processStatus = function processStatus(getValue) {
229
234
  return function (nex, config) {
230
- var _ref23;
235
+ var _ref24;
231
236
  var customerService = getValue("".concat(nex.uniqueKey, "_customerService"));
232
- return _ref23 = {}, _defineProperty(_ref23, nex.uniqueKey, {
237
+ return _ref24 = {}, _defineProperty(_ref24, nex.uniqueKey, {
233
238
  status: getValue("".concat(nex.uniqueKey, "_status")) || (config === null || config === void 0 ? void 0 : config.status),
234
239
  customerService: jsonParseSecurity(customerService, customerService)
235
- }), _defineProperty(_ref23, "".concat(nex.uniqueKey, "_processTime"), getValue('processTime')), _defineProperty(_ref23, "".concat(nex.uniqueKey, "_lastProcessingTime"), getValue('lastProcessingTime')), _ref23;
240
+ }), _defineProperty(_ref24, "".concat(nex.uniqueKey, "_processTime"), getValue('processTime')), _defineProperty(_ref24, "".concat(nex.uniqueKey, "_lastProcessingTime"), getValue('lastProcessingTime')), _ref24;
236
241
  };
237
242
  };
238
243
  var processOrdinaryInvoice = function processOrdinaryInvoice(getValue) {
239
244
  return function (nex, config) {
240
- var _ref24;
245
+ var _ref25;
241
246
  var ordinaryMoney = getValue("".concat(nex.uniqueKey, "_ordinaryMoney"));
242
247
  var ordinarySerial = getValue("".concat(nex.uniqueKey, "_ordinarySerial"));
243
248
  var ordinaryTaitou = getValue("".concat(nex.uniqueKey, "_ordinaryTaitou"));
244
- return _ref24 = {}, _defineProperty(_ref24, nex.uniqueKey, {
249
+ return _ref25 = {}, _defineProperty(_ref25, nex.uniqueKey, {
245
250
  ordinaryMoney: ordinaryMoney,
246
251
  ordinarySerial: ordinarySerial,
247
252
  ordinaryTaitou: ordinaryTaitou
248
- }), _defineProperty(_ref24, "".concat(nex.uniqueKey, "_ordinaryMoney"), ordinaryMoney ? Number(ordinaryMoney).toFixed(2) : null), _defineProperty(_ref24, "".concat(nex.uniqueKey, "_ordinarySerial"), ordinarySerial), _defineProperty(_ref24, "".concat(nex.uniqueKey, "_ordinaryTaitou"), ordinaryTaitou), _ref24;
253
+ }), _defineProperty(_ref25, "".concat(nex.uniqueKey, "_ordinaryMoney"), ordinaryMoney ? Number(ordinaryMoney).toFixed(2) : null), _defineProperty(_ref25, "".concat(nex.uniqueKey, "_ordinarySerial"), ordinarySerial), _defineProperty(_ref25, "".concat(nex.uniqueKey, "_ordinaryTaitou"), ordinaryTaitou), _ref25;
249
254
  };
250
255
  };
251
256
  var processLogisticsInterception = function processLogisticsInterception(getValue) {
@@ -302,12 +307,12 @@ var processItemSelectThird = function processItemSelectThird(getValue) {
302
307
  };
303
308
  var processEnterPrisePayment = function processEnterPrisePayment(getValue) {
304
309
  return function (nex, config) {
305
- var _ref31;
310
+ var _ref32;
306
311
  var subFields = ['enterprisePaymentAlipayNick', 'enterprisePaymentAlipayNo', 'enterprisePaymentBuyerNick', 'enterprisePaymentBuyerOpenUid', 'enterprisePaymentRefundFee', 'enterprisePaymentStatus', 'enterprisePaymentTid'];
307
312
  var map = subFields.reduce(function (cur, nxt) {
308
313
  return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, nxt, getValue("".concat(nex.uniqueKey, "_").concat(nxt))));
309
314
  }, {});
310
- return _ref31 = {}, _defineProperty(_ref31, nex.uniqueKey, map), _defineProperty(_ref31, "".concat(nex.uniqueKey, "_enterprisePaymentAlipayNick"), getValue("".concat(nex.uniqueKey, "_enterprisePaymentAlipayNick"))), _defineProperty(_ref31, "".concat(nex.uniqueKey, "_enterprisePaymentAlipayNo"), getValue("".concat(nex.uniqueKey, "_enterprisePaymentAlipayNo"))), _defineProperty(_ref31, "".concat(nex.uniqueKey, "_enterprisePaymentBuyerNick"), getValue("".concat(nex.uniqueKey, "_enterprisePaymentBuyerNick"))), _defineProperty(_ref31, "".concat(nex.uniqueKey, "_enterprisePaymentRefundFee"), getValue("".concat(nex.uniqueKey, "_enterprisePaymentRefundFee"))), _defineProperty(_ref31, "".concat(nex.uniqueKey, "_enterprisePaymentStatus"), getValue("".concat(nex.uniqueKey, "_enterprisePaymentStatus"))), _defineProperty(_ref31, "".concat(nex.uniqueKey, "_enterprisePaymentTime"), getValue("".concat(nex.uniqueKey, "_enterprisePaymentTime"))), _defineProperty(_ref31, "".concat(nex.uniqueKey, "_enterprisePaymentTid"), getValue("".concat(nex.uniqueKey, "_enterprisePaymentTid"))), _ref31;
315
+ return _ref32 = {}, _defineProperty(_ref32, nex.uniqueKey, map), _defineProperty(_ref32, "".concat(nex.uniqueKey, "_enterprisePaymentAlipayNick"), getValue("".concat(nex.uniqueKey, "_enterprisePaymentAlipayNick"))), _defineProperty(_ref32, "".concat(nex.uniqueKey, "_enterprisePaymentAlipayNo"), getValue("".concat(nex.uniqueKey, "_enterprisePaymentAlipayNo"))), _defineProperty(_ref32, "".concat(nex.uniqueKey, "_enterprisePaymentBuyerNick"), getValue("".concat(nex.uniqueKey, "_enterprisePaymentBuyerNick"))), _defineProperty(_ref32, "".concat(nex.uniqueKey, "_enterprisePaymentRefundFee"), getValue("".concat(nex.uniqueKey, "_enterprisePaymentRefundFee"))), _defineProperty(_ref32, "".concat(nex.uniqueKey, "_enterprisePaymentStatus"), getValue("".concat(nex.uniqueKey, "_enterprisePaymentStatus"))), _defineProperty(_ref32, "".concat(nex.uniqueKey, "_enterprisePaymentTime"), getValue("".concat(nex.uniqueKey, "_enterprisePaymentTime"))), _defineProperty(_ref32, "".concat(nex.uniqueKey, "_enterprisePaymentTid"), getValue("".concat(nex.uniqueKey, "_enterprisePaymentTid"))), _ref32;
311
316
  };
312
317
  };
313
318
  var processJstLogistics = function processJstLogistics(getValue) {
@@ -930,14 +935,14 @@ var processJstReturnGoods = function processJstReturnGoods(templateColumns) {
930
935
  };
931
936
  var processLabel = function processLabel(getValue) {
932
937
  return function (nex, config) {
933
- var _ref64;
934
- return _ref64 = {}, _defineProperty(_ref64, nex.uniqueKey, jsonParseSecurity(getValue("".concat(nex.uniqueKey, "_label")), [])), _defineProperty(_ref64, "".concat(nex.uniqueKey, "_label"), jsonParseSecurity(getValue("".concat(nex.uniqueKey, "_label")), [])), _ref64;
938
+ var _ref65;
939
+ return _ref65 = {}, _defineProperty(_ref65, nex.uniqueKey, jsonParseSecurity(getValue("".concat(nex.uniqueKey, "_label")), [])), _defineProperty(_ref65, "".concat(nex.uniqueKey, "_label"), jsonParseSecurity(getValue("".concat(nex.uniqueKey, "_label")), [])), _ref65;
935
940
  };
936
941
  };
937
942
  var processMemberLevel = function processMemberLevel(getValue) {
938
943
  return function (nex, config) {
939
- var _ref65;
940
- return _ref65 = {}, _defineProperty(_ref65, nex.uniqueKey, jsonParseSecurity(getValue("".concat(nex.uniqueKey, "_memberLevel")), [])), _defineProperty(_ref65, "".concat(nex.uniqueKey, "_memberLevel"), jsonParseSecurity(getValue("".concat(nex.uniqueKey, "_memberLevel")), [])), _ref65;
944
+ var _ref66;
945
+ return _ref66 = {}, _defineProperty(_ref66, nex.uniqueKey, jsonParseSecurity(getValue("".concat(nex.uniqueKey, "_memberLevel")), [])), _defineProperty(_ref66, "".concat(nex.uniqueKey, "_memberLevel"), jsonParseSecurity(getValue("".concat(nex.uniqueKey, "_memberLevel")), [])), _ref66;
941
946
  };
942
947
  };
943
948
  var processAfterSalesOrderId = function processAfterSalesOrderId(getValue) {
@@ -981,6 +986,7 @@ var transformWorkOrderData = function transformWorkOrderData(templateColumns) {
981
986
  NUMERICAL_CALCULATION: processNumericalCalculation,
982
987
  TEXTAREA: processTextarea,
983
988
  SELECT: processSelect,
989
+ GY_PAYMENT_METHOD: gyPaymentMethod,
984
990
  RATE: processRate,
985
991
  FILE: processFile,
986
992
  POSTING: processPosting,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/kmkf-work-order-service-component",
3
- "version": "2.0.59",
3
+ "version": "2.0.61",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
@@ -32,9 +32,9 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@ant-design/icons": "^4.7.0",
35
- "@kmkf-fe-packages/basic-components": "2.0.59",
36
- "@kmkf-fe-packages/kmkf-utils": "2.0.59",
37
- "@kmkf-fe-packages/services-components": "2.0.59",
35
+ "@kmkf-fe-packages/basic-components": "2.0.61",
36
+ "@kmkf-fe-packages/kmkf-utils": "2.0.61",
37
+ "@kmkf-fe-packages/services-components": "2.0.61",
38
38
  "@reduxjs/toolkit": "^1.8.5",
39
39
  "ahooks": "^3.7.4",
40
40
  "copy-to-clipboard": "^3.3.3",
@@ -73,7 +73,7 @@
73
73
  "publishConfig": {
74
74
  "access": "public"
75
75
  },
76
- "gitHead": "7068cde2c7d4d8654bf05bc65e17f7bcd775122a",
76
+ "gitHead": "ef08879d621387f54844cfea45999ff003326c7d",
77
77
  "gitHooks": {
78
78
  "pre-commit": "lint-staged"
79
79
  }
@@ -1,52 +0,0 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- var react_1 = require("react");
5
- var react_redux_1 = require("react-redux");
6
- var toolkit_1 = require("@reduxjs/toolkit");
7
- var getTemplate = function getTemplate(companyUserConfig) {
8
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
9
- return JSON.stringify({
10
- hasWln: (_c = (_b = (_a = companyUserConfig === null || companyUserConfig === void 0 ? void 0 : companyUserConfig.plugins) === null || _a === void 0 ? void 0 : _a.wln) === null || _b === void 0 ? void 0 : _b.show) !== null && _c !== void 0 ? _c : false,
11
- hasWdt: (_f = (_e = (_d = companyUserConfig === null || companyUserConfig === void 0 ? void 0 : companyUserConfig.plugins) === null || _d === void 0 ? void 0 : _d.wdt) === null || _e === void 0 ? void 0 : _e.show) !== null && _f !== void 0 ? _f : false,
12
- hasBs: (_j = (_h = (_g = companyUserConfig === null || companyUserConfig === void 0 ? void 0 : companyUserConfig.plugins) === null || _g === void 0 ? void 0 : _g.bs) === null || _h === void 0 ? void 0 : _h.show) !== null && _j !== void 0 ? _j : false,
13
- hasE3: (_m = (_l = (_k = companyUserConfig === null || companyUserConfig === void 0 ? void 0 : companyUserConfig.plugins) === null || _k === void 0 ? void 0 : _k.bse3) === null || _l === void 0 ? void 0 : _l.show) !== null && _m !== void 0 ? _m : false,
14
- hasJst: (_q = (_p = (_o = companyUserConfig === null || companyUserConfig === void 0 ? void 0 : companyUserConfig.plugins) === null || _o === void 0 ? void 0 : _o.jst) === null || _p === void 0 ? void 0 : _p.show) !== null && _q !== void 0 ? _q : false,
15
- hasGy: (_t = (_s = (_r = companyUserConfig === null || companyUserConfig === void 0 ? void 0 : companyUserConfig.plugins) === null || _r === void 0 ? void 0 : _r.gy) === null || _s === void 0 ? void 0 : _s.show) !== null && _t !== void 0 ? _t : false
16
- });
17
- };
18
- function useGetHasErpData() {
19
- var companyUserConfig = react_redux_1.useSelector(toolkit_1.createSelector([function (state) {
20
- var _a, _b, _c, _d;
21
- console.log("state--useSelector", state);
22
- /**
23
- * pc main
24
- * 端 workOrder
25
- * **/
26
- return (_d = (_b = (_a = state === null || state === void 0 ? void 0 : state.main) === null || _a === void 0 ? void 0 : _a.userInfo) !== null && _b !== void 0 ? _b : (_c = state === null || state === void 0 ? void 0 : state.workOrder) === null || _c === void 0 ? void 0 : _c.userInfo) !== null && _d !== void 0 ? _d : {};
27
- }], function (state) {
28
- var _a;
29
- var companyUserConfig = (_a = state === null || state === void 0 ? void 0 : state.companyUserConfig) !== null && _a !== void 0 ? _a : {};
30
- if (typeof companyUserConfig === "string") {
31
- try {
32
- companyUserConfig = JSON.parse(companyUserConfig);
33
- } catch (e) {
34
- console.error("companyUserConfig转换异常", companyUserConfig);
35
- companyUserConfig = {};
36
- }
37
- }
38
- return companyUserConfig;
39
- }));
40
- var _a = react_1.useState(getTemplate({})),
41
- hasErpDataJson = _a[0],
42
- setHasErpDataJson = _a[1];
43
- react_1.useEffect(function () {
44
- setHasErpDataJson(getTemplate(companyUserConfig));
45
- console.log("companyUserConfig---", companyUserConfig);
46
- }, [companyUserConfig]);
47
- var hasErpData = react_1.useMemo(function () {
48
- return JSON.parse(hasErpDataJson);
49
- }, [hasErpDataJson]);
50
- return hasErpData;
51
- }
52
- exports["default"] = useGetHasErpData;
@@ -1,180 +0,0 @@
1
- "use strict";
2
-
3
- var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
4
- function adopt(value) {
5
- return value instanceof P ? value : new P(function (resolve) {
6
- resolve(value);
7
- });
8
- }
9
- return new (P || (P = Promise))(function (resolve, reject) {
10
- function fulfilled(value) {
11
- try {
12
- step(generator.next(value));
13
- } catch (e) {
14
- reject(e);
15
- }
16
- }
17
- function rejected(value) {
18
- try {
19
- step(generator["throw"](value));
20
- } catch (e) {
21
- reject(e);
22
- }
23
- }
24
- function step(result) {
25
- result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
26
- }
27
- step((generator = generator.apply(thisArg, _arguments || [])).next());
28
- });
29
- };
30
- var __generator = this && this.__generator || function (thisArg, body) {
31
- var _ = {
32
- label: 0,
33
- sent: function sent() {
34
- if (t[0] & 1) throw t[1];
35
- return t[1];
36
- },
37
- trys: [],
38
- ops: []
39
- },
40
- f,
41
- y,
42
- t,
43
- g;
44
- return g = {
45
- next: verb(0),
46
- "throw": verb(1),
47
- "return": verb(2)
48
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
49
- return this;
50
- }), g;
51
- function verb(n) {
52
- return function (v) {
53
- return step([n, v]);
54
- };
55
- }
56
- function step(op) {
57
- if (f) throw new TypeError("Generator is already executing.");
58
- while (_) try {
59
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
60
- if (y = 0, t) op = [op[0] & 2, t.value];
61
- switch (op[0]) {
62
- case 0:
63
- case 1:
64
- t = op;
65
- break;
66
- case 4:
67
- _.label++;
68
- return {
69
- value: op[1],
70
- done: false
71
- };
72
- case 5:
73
- _.label++;
74
- y = op[1];
75
- op = [0];
76
- continue;
77
- case 7:
78
- op = _.ops.pop();
79
- _.trys.pop();
80
- continue;
81
- default:
82
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
83
- _ = 0;
84
- continue;
85
- }
86
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
87
- _.label = op[1];
88
- break;
89
- }
90
- if (op[0] === 6 && _.label < t[1]) {
91
- _.label = t[1];
92
- t = op;
93
- break;
94
- }
95
- if (t && _.label < t[2]) {
96
- _.label = t[2];
97
- _.ops.push(op);
98
- break;
99
- }
100
- if (t[2]) _.ops.pop();
101
- _.trys.pop();
102
- continue;
103
- }
104
- op = body.call(thisArg, _);
105
- } catch (e) {
106
- op = [6, e];
107
- y = 0;
108
- } finally {
109
- f = t = 0;
110
- }
111
- if (op[0] & 5) throw op[1];
112
- return {
113
- value: op[0] ? op[1] : void 0,
114
- done: true
115
- };
116
- }
117
- };
118
- exports.__esModule = true;
119
- var react_1 = require("react");
120
- var useGetHasErpData_1 = require("../hook/useGetHasErpData");
121
- var ahooks_1 = require("ahooks");
122
- var kmkf_utils_1 = require("@kmkf-fe-packages/kmkf-utils");
123
- function useGetErpAddressData(notJudgedErp) {
124
- var _this = this;
125
- var _a = react_1.useState("loading"),
126
- globalState = _a[0],
127
- setGlobalState = _a[1];
128
- var hasErpData = useGetHasErpData_1["default"]();
129
- ahooks_1.useUpdateEffect(function () {
130
- asyncQueryData(hasErpData, notJudgedErp);
131
- }, [hasErpData, notJudgedErp]);
132
- var asyncQueryData = function asyncQueryData(hasErpData, notJudgedErp) {
133
- return __awaiter(_this, void 0, void 0, function () {
134
- var hasBs, hasWdt, hasGy, promises, e_1;
135
- return __generator(this, function (_a) {
136
- switch (_a.label) {
137
- case 0:
138
- hasBs = hasErpData.hasBs, hasWdt = hasErpData.hasWdt, hasGy = hasErpData.hasGy;
139
- promises = [];
140
- if (hasBs || notJudgedErp) promises.push(kmkf_utils_1.servers.queryBsAddressData);
141
- if (hasWdt || notJudgedErp) promises.push(kmkf_utils_1.servers.queryWdtAddressData);
142
- if (hasGy || notJudgedErp) promises.push(kmkf_utils_1.servers.queryGyAddressData);
143
- _a.label = 1;
144
- case 1:
145
- _a.trys.push([1, 3,, 4]);
146
- return [4 /*yield*/, Promise.all(promises.map(function (promise) {
147
- return promise();
148
- }))];
149
- case 2:
150
- _a.sent();
151
- setGlobalState("success");
152
- return [3 /*break*/, 4];
153
- case 3:
154
- e_1 = _a.sent();
155
- setGlobalState("failed");
156
- return [3 /*break*/, 4];
157
- case 4:
158
- return [2 /*return*/];
159
- }
160
- });
161
- });
162
- };
163
-
164
- var onReload = function onReload() {
165
- return __awaiter(_this, void 0, void 0, function () {
166
- return __generator(this, function (_a) {
167
- switch (_a.label) {
168
- case 0:
169
- return [4 /*yield*/, asyncQueryData(hasErpData, notJudgedErp)];
170
- case 1:
171
- _a.sent();
172
- return [2 /*return*/];
173
- }
174
- });
175
- });
176
- };
177
-
178
- return [globalState, onReload];
179
- }
180
- exports["default"] = useGetErpAddressData;
@@ -1,186 +0,0 @@
1
- "use strict";
2
-
3
- var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
4
- function adopt(value) {
5
- return value instanceof P ? value : new P(function (resolve) {
6
- resolve(value);
7
- });
8
- }
9
- return new (P || (P = Promise))(function (resolve, reject) {
10
- function fulfilled(value) {
11
- try {
12
- step(generator.next(value));
13
- } catch (e) {
14
- reject(e);
15
- }
16
- }
17
- function rejected(value) {
18
- try {
19
- step(generator["throw"](value));
20
- } catch (e) {
21
- reject(e);
22
- }
23
- }
24
- function step(result) {
25
- result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
26
- }
27
- step((generator = generator.apply(thisArg, _arguments || [])).next());
28
- });
29
- };
30
- var __generator = this && this.__generator || function (thisArg, body) {
31
- var _ = {
32
- label: 0,
33
- sent: function sent() {
34
- if (t[0] & 1) throw t[1];
35
- return t[1];
36
- },
37
- trys: [],
38
- ops: []
39
- },
40
- f,
41
- y,
42
- t,
43
- g;
44
- return g = {
45
- next: verb(0),
46
- "throw": verb(1),
47
- "return": verb(2)
48
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
49
- return this;
50
- }), g;
51
- function verb(n) {
52
- return function (v) {
53
- return step([n, v]);
54
- };
55
- }
56
- function step(op) {
57
- if (f) throw new TypeError("Generator is already executing.");
58
- while (_) try {
59
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
60
- if (y = 0, t) op = [op[0] & 2, t.value];
61
- switch (op[0]) {
62
- case 0:
63
- case 1:
64
- t = op;
65
- break;
66
- case 4:
67
- _.label++;
68
- return {
69
- value: op[1],
70
- done: false
71
- };
72
- case 5:
73
- _.label++;
74
- y = op[1];
75
- op = [0];
76
- continue;
77
- case 7:
78
- op = _.ops.pop();
79
- _.trys.pop();
80
- continue;
81
- default:
82
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
83
- _ = 0;
84
- continue;
85
- }
86
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
87
- _.label = op[1];
88
- break;
89
- }
90
- if (op[0] === 6 && _.label < t[1]) {
91
- _.label = t[1];
92
- t = op;
93
- break;
94
- }
95
- if (t && _.label < t[2]) {
96
- _.label = t[2];
97
- _.ops.push(op);
98
- break;
99
- }
100
- if (t[2]) _.ops.pop();
101
- _.trys.pop();
102
- continue;
103
- }
104
- op = body.call(thisArg, _);
105
- } catch (e) {
106
- op = [6, e];
107
- y = 0;
108
- } finally {
109
- f = t = 0;
110
- }
111
- if (op[0] & 5) throw op[1];
112
- return {
113
- value: op[0] ? op[1] : void 0,
114
- done: true
115
- };
116
- }
117
- };
118
- exports.__esModule = true;
119
- var react_1 = require("react");
120
- var useGetHasErpData_1 = require("../hook/useGetHasErpData");
121
- var ahooks_1 = require("ahooks");
122
- var api_1 = require("../../../service/api");
123
- function useGetErpLogisticsCompany(notJudgedErp) {
124
- var _this = this;
125
- var _a = react_1.useState("loading"),
126
- globalState = _a[0],
127
- setGlobalState = _a[1];
128
- var hasErpData = useGetHasErpData_1["default"]();
129
- ahooks_1.useUpdateEffect(function () {
130
- asyncQueryData(hasErpData, notJudgedErp);
131
- }, [hasErpData, notJudgedErp]);
132
- var asyncQueryData = function asyncQueryData(hasErpData, notJudgedErp) {
133
- return __awaiter(_this, void 0, void 0, function () {
134
- var hasWdt, hasE3, hasJst, hasWln, promises, e_1;
135
- return __generator(this, function (_a) {
136
- switch (_a.label) {
137
- case 0:
138
- hasWdt = hasErpData.hasWdt, hasE3 = hasErpData.hasE3, hasJst = hasErpData.hasJst, hasWln = hasErpData.hasWln;
139
- promises = [api_1.queryKMLogisticsCompany];
140
- if (hasWdt || notJudgedErp) promises.push(api_1.queryWdtLogisticsCompany);
141
- if (hasE3 || notJudgedErp) promises.push(api_1.queryBsE3LogisticsCompany);
142
- if (hasJst || notJudgedErp) promises.push(api_1.queryJSTLogisticsCompany);
143
- if (hasWln || notJudgedErp) promises.push(api_1.queryWLNLogisticsCompany);
144
- if (!hasWdt && !hasE3 && !hasJst && !hasWln && !notJudgedErp) {
145
- setGlobalState("success");
146
- return [2 /*return*/];
147
- }
148
-
149
- _a.label = 1;
150
- case 1:
151
- _a.trys.push([1, 3,, 4]);
152
- return [4 /*yield*/, Promise.all(promises.map(function (promise) {
153
- return promise();
154
- }))];
155
- case 2:
156
- _a.sent();
157
- setGlobalState("success");
158
- return [3 /*break*/, 4];
159
- case 3:
160
- e_1 = _a.sent();
161
- setGlobalState("failed");
162
- return [3 /*break*/, 4];
163
- case 4:
164
- return [2 /*return*/];
165
- }
166
- });
167
- });
168
- };
169
-
170
- var onReload = function onReload() {
171
- return __awaiter(_this, void 0, void 0, function () {
172
- return __generator(this, function (_a) {
173
- switch (_a.label) {
174
- case 0:
175
- return [4 /*yield*/, asyncQueryData(hasErpData, notJudgedErp)];
176
- case 1:
177
- _a.sent();
178
- return [2 /*return*/];
179
- }
180
- });
181
- });
182
- };
183
-
184
- return [globalState, onReload];
185
- }
186
- exports["default"] = useGetErpLogisticsCompany;