@kmkf-fe-packages/services-components 2.0.57 → 2.0.58

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.
@@ -10,7 +10,7 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
10
10
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
11
  import { useEffect, useState } from "react";
12
12
  import useGetHasErpData from "../hook/useGetHasErpData";
13
- import { queryWdtLogisticsCompany, queryBsE3LogisticsCompany, queryJSTLogisticsCompany, queryWLNLogisticsCompany } from "../../../service/api";
13
+ import { queryWdtLogisticsCompany, queryBsE3LogisticsCompany, queryJSTLogisticsCompany, queryWLNLogisticsCompany, queryGYLogisticsCompany } from "../../../service/api";
14
14
  function useGetErpLogisticsCompany(reduxData, notJudgedErp) {
15
15
  var _useState = useState("loading"),
16
16
  _useState2 = _slicedToArray(_useState, 2),
@@ -22,37 +22,38 @@ function useGetErpLogisticsCompany(reduxData, notJudgedErp) {
22
22
  }, [hasErpData, notJudgedErp]);
23
23
  var asyncQueryData = /*#__PURE__*/function () {
24
24
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(hasErpData, notJudgedErp, isReload) {
25
- var hasWdt, hasE3, hasJst, hasWln, promises;
25
+ var hasWdt, hasE3, hasJst, hasWln, hasGy, promises;
26
26
  return _regeneratorRuntime().wrap(function _callee$(_context) {
27
27
  while (1) switch (_context.prev = _context.next) {
28
28
  case 0:
29
29
  if (!isReload) {
30
30
  setGlobalState("loading");
31
31
  }
32
- hasWdt = hasErpData.hasWdt, hasE3 = hasErpData.hasE3, hasJst = hasErpData.hasJst, hasWln = hasErpData.hasWln;
32
+ hasWdt = hasErpData.hasWdt, hasE3 = hasErpData.hasE3, hasJst = hasErpData.hasJst, hasWln = hasErpData.hasWln, hasGy = hasErpData.hasGy;
33
33
  promises = [];
34
34
  if (hasWdt || notJudgedErp) promises.push(queryWdtLogisticsCompany);
35
35
  if (hasE3 || notJudgedErp) promises.push(queryBsE3LogisticsCompany);
36
36
  if (hasJst || notJudgedErp) promises.push(queryJSTLogisticsCompany);
37
37
  if (hasWln || notJudgedErp) promises.push(queryWLNLogisticsCompany);
38
- _context.prev = 7;
39
- _context.next = 10;
38
+ if (hasGy || notJudgedErp) promises.push(queryGYLogisticsCompany);
39
+ _context.prev = 8;
40
+ _context.next = 11;
40
41
  return Promise.all(promises.map(function (promise) {
41
42
  return promise();
42
43
  }));
43
- case 10:
44
+ case 11:
44
45
  setGlobalState("success");
45
- _context.next = 16;
46
+ _context.next = 17;
46
47
  break;
47
- case 13:
48
- _context.prev = 13;
49
- _context.t0 = _context["catch"](7);
48
+ case 14:
49
+ _context.prev = 14;
50
+ _context.t0 = _context["catch"](8);
50
51
  setGlobalState("failed");
51
- case 16:
52
+ case 17:
52
53
  case "end":
53
54
  return _context.stop();
54
55
  }
55
- }, _callee, null, [[7, 13]]);
56
+ }, _callee, null, [[8, 14]]);
56
57
  }));
57
58
  return function asyncQueryData(_x2, _x3, _x4) {
58
59
  return _ref.apply(this, arguments);
@@ -66,6 +66,14 @@ var typeMap = {
66
66
  code: "kmLogisticsCode",
67
67
  platformType: "km",
68
68
  companyDataType: "whetherItIncludes"
69
+ },
70
+ GY_LOGISTICS: {
71
+ key: "gyLogisticsList",
72
+ name: "管易",
73
+ company: "gyLogisticsCompany",
74
+ code: "gyLogisticsCode",
75
+ platformType: "gy",
76
+ companyDataType: "arrayObject"
69
77
  }
70
78
  };
71
79
  var BsLogistics = /*#__PURE__*/_createClass(function BsLogistics(_options) {
@@ -33,6 +33,9 @@ var typeMap = {
33
33
  },
34
34
  KM_LOGISTICS: {
35
35
  key: "kmLogisticsItem"
36
+ },
37
+ GY_LOGISTICS: {
38
+ key: "gyLogisticsItem"
36
39
  }
37
40
  };
38
41
  var ExpressCode = /*#__PURE__*/_createClass(function ExpressCode(options) {
@@ -34,6 +34,9 @@ var typeMap = {
34
34
  },
35
35
  KM_LOGISTICS: {
36
36
  key: "kmLogisticsItem"
37
+ },
38
+ GY_LOGISTICS: {
39
+ key: "gyLogisticsItem"
37
40
  }
38
41
  };
39
42
  var Express = /*#__PURE__*/_createClass(function Express(options) {
@@ -267,7 +267,8 @@ export var JstGoodImage = function JstGoodImage(_ref6) {
267
267
  return list !== null && list !== void 0 && list.length ? (list || []).map(function (item, index) {
268
268
  var logisticsCompany = item.logisticsCompany,
269
269
  logisticsCompanyName = item.logisticsCompanyName;
270
- var company = platformType === "gy" ? logisticsCompanyName : ExpressData.getInstance(platformType).getExpressNameByCode(logisticsCompany);
270
+ // 管易为了兼容之前的补发物流信息,若不存在logisticsCompanyName值则去匹配物流映射列表展示物流公司名称
271
+ var company = platformType === "gy" ? ExpressData.getInstance(platformType).getExpressNameByCode(logisticsCompany, false) || logisticsCompanyName : ExpressData.getInstance(platformType).getExpressNameByCode(logisticsCompany);
271
272
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Popover, {
272
273
  content: content(item, index),
273
274
  overlayStyle: {
@@ -21,7 +21,6 @@ declare class Logistics implements ComponentInterface {
21
21
  canSort: boolean;
22
22
  children: ComponentInterface[];
23
23
  dataType: ComponentInterface["dataType"];
24
- logisticsType: string;
25
24
  constructor(options: PickOption);
26
25
  getSortChildFields: (type: string, options: PickOption) => any;
27
26
  renderClient: (record: any) => React.JSX.Element | null;
@@ -31,15 +30,6 @@ declare class Logistics implements ComponentInterface {
31
30
  renderExport: (value: any, record: any) => any;
32
31
  editRender: (p: any) => React.JSX.Element;
33
32
  filterConfig: (item: ColumnConfig) => ({
34
- searchDefaultConditions: "like";
35
- type: string;
36
- id: string;
37
- name: string;
38
- filterComponentType: "Input";
39
- filterFn: (value: string) => (i: Record) => boolean;
40
- formatFilterValue: (input: string) => string;
41
- props?: undefined;
42
- } | {
43
33
  searchDefaultConditions: "in";
44
34
  type: string;
45
35
  id: string;
@@ -66,8 +56,8 @@ declare class Logistics implements ComponentInterface {
66
56
  name: string;
67
57
  filterComponentType: "Input";
68
58
  filterFn: (value: string) => (i: Record) => boolean;
69
- formatFilterValue?: undefined;
70
59
  props?: undefined;
60
+ formatFilterValue?: undefined;
71
61
  })[];
72
62
  }
73
63
  export default Logistics;
@@ -37,8 +37,7 @@ var Logistics = /*#__PURE__*/_createClass(function Logistics(_options) {
37
37
  _typeMap$_options$typ2,
38
38
  _this$componentConfig9,
39
39
  _this$componentConfig11,
40
- _this$componentConfig12,
41
- _this$componentConfig13;
40
+ _this$componentConfig12;
42
41
  _classCallCheck(this, Logistics);
43
42
  _defineProperty(this, "name", void 0);
44
43
  _defineProperty(this, "id", void 0);
@@ -54,7 +53,6 @@ var Logistics = /*#__PURE__*/_createClass(function Logistics(_options) {
54
53
  _defineProperty(this, "canSort", void 0);
55
54
  _defineProperty(this, "children", void 0);
56
55
  _defineProperty(this, "dataType", void 0);
57
- _defineProperty(this, "logisticsType", void 0);
58
56
  _defineProperty(this, "getSortChildFields", function (type, options) {
59
57
  var _typeMap$options$type, _typeMap$options$type2;
60
58
  return [{
@@ -113,51 +111,33 @@ var Logistics = /*#__PURE__*/_createClass(function Logistics(_options) {
113
111
  var _typeMap$_this$type4;
114
112
  var list = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat((_typeMap$_this$type4 = typeMap[_this.type]) === null || _typeMap$_this$type4 === void 0 ? void 0 : _typeMap$_this$type4.key)];
115
113
  return (list || []).map(function (item) {
116
- var _item$logisticsCompan;
117
- return [_this.logisticsType === "input" ? (_item$logisticsCompan = item === null || item === void 0 ? void 0 : item.logisticsCompanyName) !== null && _item$logisticsCompan !== void 0 ? _item$logisticsCompan : "" : _this.expressDateInstance.getExpressNameByCode(item === null || item === void 0 ? void 0 : item.logisticsCompany), item === null || item === void 0 ? void 0 : item.logisticsCode].join("/");
114
+ var _this$componentConfig3, _ref;
115
+ return [((_this$componentConfig3 = _this.componentConfig) === null || _this$componentConfig3 === void 0 ? void 0 : _this$componentConfig3.logistics) === "gy" ? (_ref = _this.expressDateInstance.getExpressNameByCode(item === null || item === void 0 ? void 0 : item.logisticsCompany, false) || (item === null || item === void 0 ? void 0 : item.logisticsCompanyName)) !== null && _ref !== void 0 ? _ref : "" : _this.expressDateInstance.getExpressNameByCode(item === null || item === void 0 ? void 0 : item.logisticsCompany), item === null || item === void 0 ? void 0 : item.logisticsCode].join("/");
118
116
  }).join(",");
119
117
  });
120
118
  _defineProperty(this, "editRender", function (p) {
121
- var _this$componentConfig3, _this$componentConfig4, _this$componentConfig5, _this$componentConfig6, _this$componentConfig7;
119
+ var _this$componentConfig4, _this$componentConfig5, _this$componentConfig6, _this$componentConfig7, _this$componentConfig8;
122
120
  return /*#__PURE__*/React.createElement(GetFormItem, {
123
121
  title: _this.name,
124
122
  name: _this.id,
125
123
  rules: _this.rules,
126
124
  hidden: p === null || p === void 0 ? void 0 : p.hidden,
127
125
  display: p === null || p === void 0 ? void 0 : p.display,
128
- required: (_this$componentConfig3 = (_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.required) !== null && _this$componentConfig3 !== void 0 ? _this$componentConfig3 : false,
129
- tooltip: (_this$componentConfig5 = _this.componentConfig) !== null && _this$componentConfig5 !== void 0 && _this$componentConfig5.showTooltip ? (_this$componentConfig6 = _this.componentConfig) === null || _this$componentConfig6 === void 0 ? void 0 : _this$componentConfig6.tooltip : "",
126
+ required: (_this$componentConfig4 = (_this$componentConfig5 = _this.componentConfig) === null || _this$componentConfig5 === void 0 ? void 0 : _this$componentConfig5.required) !== null && _this$componentConfig4 !== void 0 ? _this$componentConfig4 : false,
127
+ tooltip: (_this$componentConfig6 = _this.componentConfig) !== null && _this$componentConfig6 !== void 0 && _this$componentConfig6.showTooltip ? (_this$componentConfig7 = _this.componentConfig) === null || _this$componentConfig7 === void 0 ? void 0 : _this$componentConfig7.tooltip : "",
130
128
  component: /*#__PURE__*/React.createElement(JstGoods, _extends({}, _this.componentConfig, {
131
129
  type: 1,
132
130
  options: _this.expressDateInstance.getExpressData(),
133
- platformType: (_this$componentConfig7 = _this.componentConfig) === null || _this$componentConfig7 === void 0 ? void 0 : _this$componentConfig7.logistics
131
+ platformType: (_this$componentConfig8 = _this.componentConfig) === null || _this$componentConfig8 === void 0 ? void 0 : _this$componentConfig8.logistics
134
132
  }))
135
133
  });
136
134
  });
137
135
  _defineProperty(this, "filterConfig", function (item) {
138
- var _this$componentConfig8, _typeMap$_this$type5, _typeMap$_this$type6, _typeMap$_this$type7, _typeMap$_this$type8;
139
- var logisticsType = ((_this$componentConfig8 = _this.componentConfig) === null || _this$componentConfig8 === void 0 ? void 0 : _this$componentConfig8.logistics) === "gy" ? "input" : "select";
140
- return [logisticsType === "input" ? {
141
- searchDefaultConditions: SYMBOL.like,
142
- type: item.type,
143
- id: "".concat(item.id, "_").concat((_typeMap$_this$type5 = typeMap[_this.type]) === null || _typeMap$_this$type5 === void 0 ? void 0 : _typeMap$_this$type5.key),
144
- name: "".concat(_this.name, "\u7269\u6D41\u516C\u53F8"),
145
- filterComponentType: "Input",
146
- filterFn: function filterFn(value) {
147
- return function (i) {
148
- return _filterFn.filterSplitComma(_filterFn.filterTableListItemColumnValue(i, item.id, "logisticsCode"), value);
149
- };
150
- },
151
- formatFilterValue: function formatFilterValue(input) {
152
- var value = batchInput(input);
153
- // console.log("formatFilterValue---", value);
154
-
155
- return value && Array.isArray(value) ? value.join("") : value;
156
- }
157
- } : {
136
+ var _typeMap$_this$type5, _typeMap$_this$type6, _typeMap$_this$type7;
137
+ return [{
158
138
  searchDefaultConditions: SYMBOL.in,
159
139
  type: item.type,
160
- id: "".concat(item.id, "_").concat((_typeMap$_this$type6 = typeMap[_this.type]) === null || _typeMap$_this$type6 === void 0 ? void 0 : _typeMap$_this$type6.company),
140
+ id: "".concat(item.id, "_").concat((_typeMap$_this$type5 = typeMap[_this.type]) === null || _typeMap$_this$type5 === void 0 ? void 0 : _typeMap$_this$type5.company),
161
141
  name: "".concat(_this.name, "\u7269\u6D41\u516C\u53F8"),
162
142
  filterComponentType: "MultipleSelect",
163
143
  props: {
@@ -165,8 +145,8 @@ var Logistics = /*#__PURE__*/_createClass(function Logistics(_options) {
165
145
  },
166
146
  filterFn: function filterFn(value) {
167
147
  return function (i) {
168
- var _ref;
169
- return (_ref = _filterFn.filterTableListItemColumnValue(i, item.id, "logisticsCompany").split(",") || []) === null || _ref === void 0 ? void 0 : _ref.some(function (item) {
148
+ var _ref2;
149
+ return (_ref2 = _filterFn.filterTableListItemColumnValue(i, item.id, "logisticsCompany").split(",") || []) === null || _ref2 === void 0 ? void 0 : _ref2.some(function (item) {
170
150
  var _String;
171
151
  var logisticsCompany = item ? (_String = String(item)) === null || _String === void 0 ? void 0 : _String.includes(value) : false;
172
152
  return logisticsCompany;
@@ -176,7 +156,7 @@ var Logistics = /*#__PURE__*/_createClass(function Logistics(_options) {
176
156
  }, _this.type === "REISSUE_LOGISTICS" ? {
177
157
  searchDefaultConditions: SYMBOL.in,
178
158
  type: item.type,
179
- id: "".concat(item.id, "_").concat((_typeMap$_this$type7 = typeMap[_this.type]) === null || _typeMap$_this$type7 === void 0 ? void 0 : _typeMap$_this$type7.code),
159
+ id: "".concat(item.id, "_").concat((_typeMap$_this$type6 = typeMap[_this.type]) === null || _typeMap$_this$type6 === void 0 ? void 0 : _typeMap$_this$type6.code),
180
160
  name: "".concat(_this.name, "\u7269\u6D41\u5355\u53F7"),
181
161
  filterComponentType: "Input",
182
162
  filterFn: function filterFn(value) {
@@ -190,7 +170,7 @@ var Logistics = /*#__PURE__*/_createClass(function Logistics(_options) {
190
170
  } : {
191
171
  searchDefaultConditions: SYMBOL.like,
192
172
  type: item.type,
193
- id: "".concat(item.id, "_").concat((_typeMap$_this$type8 = typeMap[_this.type]) === null || _typeMap$_this$type8 === void 0 ? void 0 : _typeMap$_this$type8.code),
173
+ id: "".concat(item.id, "_").concat((_typeMap$_this$type7 = typeMap[_this.type]) === null || _typeMap$_this$type7 === void 0 ? void 0 : _typeMap$_this$type7.code),
194
174
  name: "".concat(_this.name, "\u7269\u6D41\u5355\u53F7"),
195
175
  filterComponentType: "Input",
196
176
  filterFn: function filterFn(value) {
@@ -216,7 +196,7 @@ var Logistics = /*#__PURE__*/_createClass(function Logistics(_options) {
216
196
  var hasNo = (value || []).some(function (item) {
217
197
  var _this$componentConfig10;
218
198
  if (((_this$componentConfig10 = _this.componentConfig) === null || _this$componentConfig10 === void 0 ? void 0 : _this$componentConfig10.logistics) === "gy") {
219
- return item.logisticsCompanyName && item.logisticsCode;
199
+ return (item.logisticsCompany || item.logisticsCompanyName) && item.logisticsCode;
220
200
  }
221
201
  return item.logisticsCompany && item.logisticsCode;
222
202
  });
@@ -229,6 +209,5 @@ var Logistics = /*#__PURE__*/_createClass(function Logistics(_options) {
229
209
  this.align = "left";
230
210
  this.expressDateInstance = ExpressData.getInstance((_this$componentConfig11 = this.componentConfig) === null || _this$componentConfig11 === void 0 ? void 0 : _this$componentConfig11.logistics);
231
211
  this.sortChildField = this.getSortChildFields(((_this$componentConfig12 = this.componentConfig) === null || _this$componentConfig12 === void 0 ? void 0 : _this$componentConfig12.showField) || "", _options);
232
- this.logisticsType = ((_this$componentConfig13 = this.componentConfig) === null || _this$componentConfig13 === void 0 ? void 0 : _this$componentConfig13.logistics) === "gy" ? "input" : "select";
233
212
  });
234
213
  export default Logistics;
@@ -1,3 +1,3 @@
1
1
  import { ReissueLogistics, JstItemSelect, JstSupply, JstSendGood, BasicInput, BasicAddress, BasicCascader, BasicCheckbox, BasicDataTime, BasicSelect, BasicRadio, BasicTextArea, BasicPicture, BasicPicturePro, BasicMultSelect, BasicGrade, BasicRate, BasicFile, BasicPosting, SubForm, CommonDataTime, TradeId, ShopName, BuyerNick, ReceiverName, ReceiverMobile, ReceiverAddress, TradeDateTime, Logistics, ReturnLogistics, ActualPayment, ERemark, AliPay, ItemSelect, ItemId, ItemEnCode, SystemOrderNo, Ordinary, ThirdItemSelect, FlowStatusSelect, FlowMarkSelect, FlowTag, Payment, TemplateSelect, WorkOrderId, PlatForm, ShopInput, Submitter, PrevSubmitter, FlowCreator, Handler, CompletedUser, LogisticsInterception, LogisticsMoreInterception, LogisticsTrajectory, LogisticsMoreTrajectory, FlowWorkOrderId, BsGoods, BsExchange, BsReissue, BsReturn, BsSystemOrder, BsLogistics, StatusSelect, CommonSystemOrder, CommonMultiStatus, Calculation, NodeDeadLine, HandlerDeadLine, NodeStayDuration, WlnGoods, BsPosting, MsgStatus, NodeInput, FlowWorkOrderStatus, WdtGoods, WdtReturn, WdtExchange, CommonInput, PaymentVoucherCode, Label, WdtReissue, GyReissue, AfterSalesOrderId, BsE3Goods, PublicGoods, PublicReissueGoods, PublicExchange, GyGoods, BsE3Reissue, MemberLevel, GyReturn } from "./index";
2
2
  import { PickOption } from "./type";
3
- export declare const factory: (type: string, options: PickOption) => GyReissue | GyReturn | BasicPicture | BasicPicturePro | BasicPosting | PublicExchange | PublicReissueGoods | ReissueLogistics | BasicSelect | StatusSelect | BasicDataTime | TradeDateTime | TradeId | BasicInput | BasicAddress | BasicCascader | BasicCheckbox | BasicRadio | BasicTextArea | BasicMultSelect | BasicGrade | BasicRate | BasicFile | SubForm | CommonDataTime | ShopName | BuyerNick | ReceiverName | ReceiverMobile | ReceiverAddress | Logistics | ReturnLogistics | ActualPayment | ERemark | AliPay | ItemSelect | ItemId | ItemEnCode | SystemOrderNo | Ordinary | ThirdItemSelect | Payment | JstItemSelect | JstSendGood | JstSupply | BsSystemOrder | BsGoods | BsE3Goods | PublicGoods | BsE3Reissue | BsExchange | BsReissue | BsReturn | BsLogistics | FlowStatusSelect | FlowMarkSelect | FlowTag | TemplateSelect | WorkOrderId | LogisticsInterception | LogisticsMoreInterception | LogisticsTrajectory | LogisticsMoreTrajectory | PlatForm | ShopInput | Submitter | PrevSubmitter | FlowCreator | Handler | CompletedUser | FlowWorkOrderId | Calculation | CommonSystemOrder | CommonMultiStatus | NodeDeadLine | HandlerDeadLine | NodeStayDuration | WlnGoods | BsPosting | NodeInput | FlowWorkOrderStatus | MsgStatus | WdtGoods | WdtReissue | WdtReturn | WdtExchange | CommonInput | PaymentVoucherCode | Label | MemberLevel | AfterSalesOrderId | GyGoods;
3
+ export declare const factory: (type: string, options: PickOption) => BsLogistics | GyReissue | GyReturn | JstSendGood | MsgStatus | ReissueLogistics | BasicInput | BasicAddress | BasicCascader | BasicCheckbox | BasicDataTime | BasicSelect | BasicRadio | BasicTextArea | BasicPicture | BasicPicturePro | BasicMultSelect | BasicGrade | BasicRate | BasicFile | BasicPosting | SubForm | CommonDataTime | TradeId | ShopName | BuyerNick | ReceiverName | ReceiverMobile | ReceiverAddress | TradeDateTime | Logistics | ReturnLogistics | ActualPayment | ERemark | AliPay | ItemSelect | ItemId | ItemEnCode | SystemOrderNo | Ordinary | ThirdItemSelect | Payment | JstItemSelect | JstSupply | BsSystemOrder | BsGoods | BsE3Goods | PublicGoods | PublicReissueGoods | PublicExchange | BsE3Reissue | BsExchange | BsReissue | BsReturn | FlowStatusSelect | FlowMarkSelect | FlowTag | TemplateSelect | WorkOrderId | LogisticsInterception | LogisticsMoreInterception | LogisticsTrajectory | LogisticsMoreTrajectory | PlatForm | ShopInput | Submitter | PrevSubmitter | FlowCreator | Handler | CompletedUser | FlowWorkOrderId | StatusSelect | Calculation | CommonSystemOrder | CommonMultiStatus | NodeDeadLine | HandlerDeadLine | NodeStayDuration | WlnGoods | BsPosting | NodeInput | FlowWorkOrderStatus | WdtGoods | WdtReissue | WdtReturn | WdtExchange | CommonInput | PaymentVoucherCode | Label | MemberLevel | AfterSalesOrderId | GyGoods;
@@ -195,6 +195,7 @@ export var factory = function factory(type, options) {
195
195
  case "WDT_LOGISTICS":
196
196
  case "JST_LOGISTICS":
197
197
  case "KM_LOGISTICS":
198
+ case "GY_LOGISTICS":
198
199
  return new BsLogistics(options);
199
200
  case "FLOW_WORK_ORDER_ID_INPUT":
200
201
  return new FlowWorkOrderId(options);
@@ -9,6 +9,7 @@ export declare const queryAllLogisticsCompany: () => Promise<void>;
9
9
  export declare const queryWdtLogisticsCompany: () => Promise<void>;
10
10
  export declare const queryBsE3LogisticsCompany: () => Promise<void>;
11
11
  export declare const queryJSTLogisticsCompany: () => Promise<void>;
12
+ export declare const queryGYLogisticsCompany: () => Promise<void>;
12
13
  export declare const queryWLNLogisticsCompany: () => Promise<void>;
13
14
  export declare const queryKMLogisticsCompany: () => Promise<void>;
14
15
  export declare const getAlipayBillReceipt: (data: any) => Promise<any>;
@@ -269,6 +269,12 @@ export var queryJSTLogisticsCompany = function queryJSTLogisticsCompany() {
269
269
  instance.expressData = data;
270
270
  }).catch(console.log);
271
271
  };
272
+ export var queryGYLogisticsCompany = function queryGYLogisticsCompany() {
273
+ var instance = ExpressData.getInstance("gy");
274
+ return servers.GY.getLogisticsDataAsync().then(function (data) {
275
+ instance.expressData = data;
276
+ }).catch(console.log);
277
+ };
272
278
  export var queryWLNLogisticsCompany = function queryWLNLogisticsCompany() {
273
279
  var instance = ExpressData.getInstance("wln");
274
280
  return servers.WLN.getLogisticsDataAsync().then(function (data) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/services-components",
3
- "version": "2.0.57",
3
+ "version": "2.0.58",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
@@ -21,8 +21,8 @@
21
21
  ]
22
22
  },
23
23
  "dependencies": {
24
- "@kmkf-fe-packages/basic-components": "2.0.57",
25
- "@kmkf-fe-packages/kmkf-utils": "2.0.57",
24
+ "@kmkf-fe-packages/basic-components": "2.0.58",
25
+ "@kmkf-fe-packages/kmkf-utils": "2.0.58",
26
26
  "b64-to-blob": "^1.2.19",
27
27
  "html2canvas": "^1.4.1",
28
28
  "react-pdf-js": "^5.1.0"
@@ -41,7 +41,7 @@
41
41
  "publishConfig": {
42
42
  "access": "public"
43
43
  },
44
- "gitHead": "35082852f84a4850071c5789da827e0084eedd67",
44
+ "gitHead": "5a517395de7da7ba6f8549f5cbd199ba4a7c05fa",
45
45
  "gitHooks": {
46
46
  "pre-commit": "lint-staged"
47
47
  }
@@ -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;