@kmkf-fe-packages/services-components 2.2.40 → 2.2.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import LogisticsInterception from "../components/LogisticsInterception";
2
2
  import LogisticsMoreInterception from "../components/LogisticsMoreInterception";
3
- export declare const newRenderColumnItem: (effects: any) => (item: any) => import("../components/AfterSalesOrderId").default | import("../components/BS/BsGoods").default | import("../components/BS/BsLogistics").default | import("../components/BS/BsSystemOrder").default | import("../components/BsE3/BsReissueE3").default | import("../components/BuyerNick").default | import("../components/Checkbox").default | import("../components/CommonDataTime").default | import("../components/CommonMultiStatus").default | import("../components/CommonSystemOrder").default | import("../components/EItemEnCode").default | import("../components/TradeId").default | import("../components/Input").default | import("../components/TypeInput").default | import("../components/Address").default | import("../components/Cascader").default | import("../components/DataTime").default | import("../components/Select").default | import("../components/SelectOption").default | import("../components/Radio").default | import("../components/TextArea").default | import("../components/Picture").default | import("../components/PicturePro").default | import("../components/MultSelect").default | import("../components/Grade").default | import("../components/Rate").default | import("../components/File").default | import("../components/PostIng").default | import("../components/SubForm").default | import("../components/ShopName").default | import("../components/ReceiverName").default | import("../components/ReceiverMobile").default | import("../components/ReceiverAddress").default | import("../components/TradeDateTime").default | import("../components/Logistics").default | import("../components/ReturnLogistics").default | import("../components/ActualPayment").default | import("../components/Remark").default | import("../components/Alipay").default | import("../components/EItemSelect").default | import("../components/EItemId").default | import("../components/SystemOrderNo").default | import("../components/Ordinary").default | import("../components/ThirdItemSelect").default | import("../components/Payment").default | import("../components/Reissue/Logistics").default | import("../components/JST/JstItemSelect").default | import("../components/JST/JstSendGood").default | import("../components/JST/JstSupply").default | import("../components/BsE3/BsGoods").default | import("../components/Public/Goods").default | import("../components/Public/ReissueGoods").default | import("../components/Public/Exchange").default | import("../components/BS/BsExchange").default | import("../components/BS/BsReissue").default | import("../components/BS/BsReturn").default | import("../components/FlowStatusSelect").default | import("../components/FlowMarkSelect").default | import("../components/FlowTag").default | import("../components/TemplateSelect").default | import("../components/WorkOrderId").default | LogisticsInterception | LogisticsMoreInterception | import("../components/LogisticsTrajectory").default | import("../components/LogisticsMoreTrajectory").default | import("../components/PlatForm").default | import("../components/ShopInput").default | import("../components/Submitter").default | import("../components/PrevSubmitter").default | import("../components/FlowCreator").default | import("../components/Handler").default | import("../components/CompletedUser").default | import("../components/FlowWorkOrderId").default | import("../components/StatusSelect").default | import("../components/Calculation").default | import("../components/NodeDeadLine").default | import("../components/HandlerDeadLine").default | import("../components/NodeStayDuration").default | import("../components/WLN/WlnGoods").default | import("../components/BS/BsPosting").default | import("../components/NodeInput").default | import("../components/FlowWorkOrderStatus").default | import("../components/MsgStatus").default | import("../components/WDT/WdtGoods").default | import("../components/WDT/WdtRessuie").default | import("../components/WDT/WdtReturn").default | import("../components/WDT/WdtExchange").default | import("../components/WDT/WdtShopSelect").default | import("../components/KM/KmVideo").default | import("../components/CommonInput").default | import("../components/PaymentVoucherCode").default | import("../components/Label").default | import("../components/MemberLevel").default | import("../components/GY/GyGoods").default | import("../components/GY/GyReissue").default | import("../components/GY/GyReturn").default | import("../components/Public/AsyncSelect").default | import("../components/SKX/SkxIdInputSelect").default | import("../components/SKX/SkxGoods").default | import("../components/OrderSubForm").default | import("../components/FlowOverallStatusSelect").default;
3
+ export declare const newRenderColumnItem: (effects: any) => (item: any) => import("../components/BS/BsLogistics").default | import("../components/TradeId").default | import("../components/Input").default | import("../components/TypeInput").default | import("../components/Address").default | import("../components/Cascader").default | import("../components/Checkbox").default | import("../components/DataTime").default | import("../components/Select").default | import("../components/SelectOption").default | import("../components/Radio").default | import("../components/TextArea").default | import("../components/Picture").default | import("../components/PicturePro").default | import("../components/MultSelect").default | import("../components/Grade").default | import("../components/Rate").default | import("../components/File").default | import("../components/PostIng").default | import("../components/SubForm").default | import("../components/CommonDataTime").default | import("../components/ShopName").default | import("../components/BuyerNick").default | import("../components/ReceiverName").default | import("../components/ReceiverMobile").default | import("../components/ReceiverAddress").default | import("../components/TradeDateTime").default | import("../components/Logistics").default | import("../components/ReturnLogistics").default | import("../components/ActualPayment").default | import("../components/Remark").default | import("../components/Alipay").default | import("../components/EItemSelect").default | import("../components/EItemId").default | import("../components/EItemEnCode").default | import("../components/SystemOrderNo").default | import("../components/Ordinary").default | import("../components/ThirdItemSelect").default | import("../components/Payment").default | import("../components/Reissue/Logistics").default | import("../components/JST/JstItemSelect").default | import("../components/JST/JstSendGood").default | import("../components/JST/JstSupply").default | import("../components/BS/BsSystemOrder").default | import("../components/BS/BsGoods").default | import("../components/BsE3/BsGoods").default | import("../components/Public/Goods").default | import("../components/Public/ReissueGoods").default | import("../components/Public/Exchange").default | import("../components/BsE3/BsReissueE3").default | import("../components/BS/BsExchange").default | import("../components/BS/BsReissue").default | import("../components/BS/BsReturn").default | import("../components/FlowStatusSelect").default | import("../components/FlowMarkSelect").default | import("../components/FlowTag").default | import("../components/TemplateSelect").default | import("../components/WorkOrderId").default | LogisticsInterception | LogisticsMoreInterception | import("../components/LogisticsTrajectory").default | import("../components/LogisticsMoreTrajectory").default | import("../components/PlatForm").default | import("../components/ShopInput").default | import("../components/Submitter").default | import("../components/PrevSubmitter").default | import("../components/FlowCreator").default | import("../components/Handler").default | import("../components/CompletedUser").default | import("../components/FlowWorkOrderId").default | import("../components/StatusSelect").default | import("../components/Calculation").default | import("../components/CommonSystemOrder").default | import("../components/CommonMultiStatus").default | import("../components/NodeDeadLine").default | import("../components/HandlerDeadLine").default | import("../components/NodeStayDuration").default | import("../components/WLN/WlnGoods").default | import("../components/BS/BsPosting").default | import("../components/NodeInput").default | import("../components/FlowWorkOrderStatus").default | import("../components/MsgStatus").default | import("../components/WDT/WdtGoods").default | import("../components/WDT/WdtRessuie").default | import("../components/WDT/WdtReturn").default | import("../components/WDT/WdtExchange").default | import("../components/WDT/WdtShopSelect").default | import("../components/KM/KmVideo").default | import("../components/CommonInput").default | import("../components/PaymentVoucherCode").default | import("../components/Label").default | import("../components/MemberLevel").default | import("../components/AfterSalesOrderId").default | import("../components/GY/GyGoods").default | import("../components/GY/GyReissue").default | import("../components/GY/GyReturn").default | import("../components/Public/AsyncSelect").default | import("../components/SKX/SkxIdInputSelect").default | import("../components/SKX/SkxGoods").default | import("../components/OrderSubForm").default;
4
4
  export declare const useColumnsConfig: ({ queryWorkOrderDetail, flatTemplateList, shopList, sortState, onChangeSort, handleReset, handleSubmit, handleChangeSingleWorkOrderMark, userList, tbAppKey, isShare, openSingleColumnsFilter, openSingleColumnsSort, }: {
5
5
  queryWorkOrderDetail?: ((p: any) => void) | undefined;
6
6
  flatTemplateList?: any;
@@ -17,6 +17,14 @@ var INPUT_MAP = {
17
17
  key: "businessOrderNo",
18
18
  disabled: true,
19
19
  placeholder: "自动获取无需填写"
20
+ },
21
+ REPAIR_ORDER_SN: {
22
+ key: "repairOrderSn",
23
+ placeholder: "请输入维修单编号"
24
+ },
25
+ REPAIR_ORDER_ID: {
26
+ key: "repairOrderId",
27
+ placeholder: "请输入维修单id"
20
28
  }
21
29
  };
22
30
  var CommonInput = /*#__PURE__*/_createClass(function CommonInput(options) {
@@ -62,7 +70,7 @@ var CommonInput = /*#__PURE__*/_createClass(function CommonInput(options) {
62
70
  return (_record = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(INPUT_MAP[_this.type].key)]) !== null && _record !== void 0 ? _record : "--";
63
71
  });
64
72
  _defineProperty(this, "editRender", function (p) {
65
- var _this$componentConfig, _this$componentConfig2, _this$componentConfig3, _this$componentConfig4;
73
+ var _this$componentConfig, _this$componentConfig2, _this$componentConfig3, _this$componentConfig4, _this$componentConfig5;
66
74
  return /*#__PURE__*/React.createElement(GetFormItem, {
67
75
  title: _this.name,
68
76
  name: _this.id,
@@ -70,10 +78,10 @@ var CommonInput = /*#__PURE__*/_createClass(function CommonInput(options) {
70
78
  hidden: p === null || p === void 0 ? void 0 : p.hidden,
71
79
  display: p === null || p === void 0 ? void 0 : p.display,
72
80
  required: (_this$componentConfig = (_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.required) !== null && _this$componentConfig !== void 0 ? _this$componentConfig : false,
73
- tooltip: (_this$componentConfig3 = _this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.showTooltip ? (_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.tooltip : '',
81
+ tooltip: (_this$componentConfig3 = _this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.showTooltip ? (_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.tooltip : "",
74
82
  component: /*#__PURE__*/React.createElement(Input, _extends({}, _this.componentConfig, {
75
83
  placeholder: INPUT_MAP[_this.type].placeholder || "\u8BF7\u8F93\u5165".concat(_this.name),
76
- disabled: INPUT_MAP[_this.type].disabled
84
+ disabled: INPUT_MAP[_this.type].disabled || ((_this$componentConfig5 = _this.componentConfig) === null || _this$componentConfig5 === void 0 ? void 0 : _this$componentConfig5.disabled)
77
85
  }))
78
86
  });
79
87
  });
@@ -28,7 +28,14 @@ declare class OrderSubForm implements ComponentInterface {
28
28
  expressDateInstance: InstanceType<typeof ExpressData>;
29
29
  children: ComponentInterface[];
30
30
  dataType: ComponentInterface["dataType"];
31
+ sortChildField: {
32
+ name: string;
33
+ key: string;
34
+ dataType: string;
35
+ [key: string]: any;
36
+ }[];
31
37
  constructor(options: PickOption);
38
+ getSortChildFields: () => any;
32
39
  renderTransformItem: (item: subConfigType, val: any) => any;
33
40
  getNewTableHeader: () => any;
34
41
  renderTabel: (list: any) => React.JSX.Element;
@@ -48,6 +48,19 @@ function OrderSubForm(options) {
48
48
  _defineProperty(this, "expressDateInstance", void 0);
49
49
  _defineProperty(this, "children", void 0);
50
50
  _defineProperty(this, "dataType", void 0);
51
+ _defineProperty(this, "sortChildField", void 0);
52
+ _defineProperty(this, "getSortChildFields", function () {
53
+ var orderSubformColumns = getOrderSubformColumns();
54
+ return orderSubformColumns.filter(function (item) {
55
+ return !["picUrl"].includes(item.dataIndex);
56
+ }).map(function (item) {
57
+ return {
58
+ name: item.title,
59
+ key: "".concat(_this.id, "_").concat(item.dataIndex),
60
+ dataType: "arrayObject"
61
+ };
62
+ });
63
+ });
51
64
  _defineProperty(this, "renderTransformItem", function (item, val) {
52
65
  var _getSelectWidgetMap;
53
66
  var mapValue = (_getSelectWidgetMap = getSelectWidgetMap(_this.expressDateInstance)) === null || _getSelectWidgetMap === void 0 ? void 0 : _getSelectWidgetMap[item.dataIndex];
@@ -267,5 +280,6 @@ function OrderSubForm(options) {
267
280
  });
268
281
  this.dataType = "object";
269
282
  this.expressDateInstance = ExpressData.getInstance();
283
+ this.sortChildField = this.getSortChildFields();
270
284
  });
271
285
  export default OrderSubForm;
@@ -36,6 +36,10 @@ var selectTypeMap = {
36
36
  key: "agreeRefundStatusValue",
37
37
  info: "agreeRefundStatusReason"
38
38
  }),
39
+ REPAIR_ORDER_STATUS: getSelectTypeAttribute({
40
+ key: "repairOrderStatusValue",
41
+ info: "repairOrderStatusReason"
42
+ }),
39
43
  REJECT_REFUND_STATUS: getSelectTypeAttribute({
40
44
  key: "rejectRefundStatusValue",
41
45
  info: "rejectRefundStatusReason"
@@ -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, AsyncSelect, WdtShopSelect, KmVideo, BasicTypeInput, SkxIdInputSelect, SkxGoods, BasicSelectOption, OrderSubForm, FlowOverallStatusSelect } from "./index";
2
2
  import { PickOption } from "./type";
3
- export declare const factory: (type: string, options: PickOption) => BsLogistics | CommonInput | BasicInput | JstSendGood | MsgStatus | OrderSubForm | StatusSelect | SubForm | BasicTypeInput | BasicAddress | BasicCascader | BasicCheckbox | BasicDataTime | BasicSelect | BasicSelectOption | BasicRadio | BasicTextArea | BasicPicture | BasicPicturePro | BasicMultSelect | BasicGrade | BasicRate | BasicFile | BasicPosting | CommonDataTime | TradeId | ShopName | BuyerNick | ReceiverName | ReceiverMobile | ReceiverAddress | TradeDateTime | Logistics | ReturnLogistics | ActualPayment | ERemark | AliPay | ItemSelect | ItemId | ItemEnCode | SystemOrderNo | Ordinary | ThirdItemSelect | Payment | ReissueLogistics | 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 | Calculation | CommonSystemOrder | CommonMultiStatus | NodeDeadLine | HandlerDeadLine | NodeStayDuration | WlnGoods | BsPosting | NodeInput | FlowWorkOrderStatus | WdtGoods | WdtReissue | WdtReturn | WdtExchange | WdtShopSelect | KmVideo | PaymentVoucherCode | Label | MemberLevel | AfterSalesOrderId | GyGoods | GyReissue | GyReturn | AsyncSelect | SkxIdInputSelect | SkxGoods | FlowOverallStatusSelect;
3
+ export declare const factory: (type: string, options: PickOption) => BsLogistics | BsSystemOrder | CommonInput | BasicInput | JstSendGood | MsgStatus | OrderSubForm | BasicPosting | PublicGoods | StatusSelect | SubForm | BasicTypeInput | BasicAddress | BasicCascader | BasicCheckbox | BasicDataTime | BasicSelect | BasicSelectOption | BasicRadio | BasicTextArea | BasicPicture | BasicPicturePro | BasicMultSelect | BasicGrade | BasicRate | BasicFile | CommonDataTime | TradeId | ShopName | BuyerNick | ReceiverName | ReceiverMobile | ReceiverAddress | TradeDateTime | Logistics | ReturnLogistics | ActualPayment | ERemark | AliPay | ItemSelect | ItemId | ItemEnCode | SystemOrderNo | Ordinary | ThirdItemSelect | Payment | ReissueLogistics | JstItemSelect | JstSupply | BsGoods | BsE3Goods | PublicReissueGoods | PublicExchange | BsE3Reissue | BsExchange | BsReissue | BsReturn | 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 | WdtGoods | WdtReissue | WdtReturn | WdtExchange | WdtShopSelect | KmVideo | PaymentVoucherCode | Label | MemberLevel | AfterSalesOrderId | GyGoods | GyReissue | GyReturn | AsyncSelect | SkxIdInputSelect | SkxGoods | FlowOverallStatusSelect;
@@ -228,6 +228,7 @@ export var factory = function factory(type, options) {
228
228
  case "AGREE_RETURN_GOODS_STATUS":
229
229
  case "REJECT_RETURN_GOODS_STATUS":
230
230
  case "RETURN_EXCHANGE_GOODS_REVIEW_STATUS":
231
+ case "REPAIR_ORDER_STATUS":
231
232
  return new StatusSelect(options);
232
233
  case "RETURN_GOODS_STATUS":
233
234
  case "EXCHANGE_STATUS":
@@ -264,6 +265,8 @@ export var factory = function factory(type, options) {
264
265
  // 万里牛商品
265
266
  return new WdtGoods(options);
266
267
  case "BUSINESS_ORDER_NO":
268
+ case "REPAIR_ORDER_SN":
269
+ case "REPAIR_ORDER_ID":
267
270
  return new CommonInput(options);
268
271
  case "PAYMENT_VOUCHER_CODE":
269
272
  return new PaymentVoucherCode(options);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/services-components",
3
- "version": "2.2.40",
3
+ "version": "2.2.43",
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.2.40",
25
- "@kmkf-fe-packages/kmkf-utils": "2.2.40",
24
+ "@kmkf-fe-packages/basic-components": "2.2.43",
25
+ "@kmkf-fe-packages/kmkf-utils": "2.2.43",
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": "7dbd9242917aa827ddbd4d2d87f598edac8325fb",
44
+ "gitHead": "4fdc844c8c20fb2075c5e576453f63a52cdcc26f",
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;
@@ -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;