@kmkf-fe-packages/kmkf-work-order-service-component 2.2.31-beta.5 → 2.2.31-beta.52

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 (67) hide show
  1. package/dist/esm/FlowTemplateDetailV2/components/AutoTaskDetail/index.d.ts +3 -1
  2. package/dist/esm/FlowTemplateDetailV2/components/AutoTaskDetail/index.js +59 -3
  3. package/dist/esm/FlowTemplateDetailV2/components/CurrentNode/index.js +3 -2
  4. package/dist/esm/FlowTemplateDetailV2/components/Item/index.js +3 -2
  5. package/dist/esm/FlowTemplateDetailV2/components/JumpBuyer/index.d.ts +0 -1
  6. package/dist/esm/FlowTemplateDetailV2/components/JumpBuyer/index.js +27 -13
  7. package/dist/esm/FlowTemplateDetailV2/index.js +6 -6
  8. package/dist/esm/GlobalContext/hook/dist/useGetHasErpData.js +52 -0
  9. package/dist/esm/GlobalContext/orderQuery/dist/useGetErpAddressData.js +180 -0
  10. package/dist/esm/GlobalContext/orderQuery/dist/useGetErpLogisticsCompany.js +186 -0
  11. package/dist/esm/LBOrderDetail/detail/OrderInfo.d.ts +17 -0
  12. package/dist/esm/LBOrderDetail/detail/OrderInfo.js +529 -0
  13. package/dist/esm/LBOrderDetail/detail/ServiceProgress.d.ts +11 -0
  14. package/dist/esm/LBOrderDetail/detail/ServiceProgress.js +437 -0
  15. package/dist/esm/LBOrderDetail/detail/index.d.ts +12 -0
  16. package/dist/esm/LBOrderDetail/detail/index.js +45 -0
  17. package/dist/esm/LBOrderDetail/detail/index.module.less +63 -0
  18. package/dist/esm/LBOrderDetail/detail/services.d.ts +3 -0
  19. package/dist/esm/LBOrderDetail/detail/services.js +19 -0
  20. package/dist/esm/LBOrderDetail/detail/types.d.ts +361 -0
  21. package/dist/esm/LBOrderDetail/detail/types.js +1 -0
  22. package/dist/esm/LBOrderDetail/index.d.ts +14 -0
  23. package/dist/esm/LBOrderDetail/index.js +63 -0
  24. package/dist/esm/WorkOrder/components/WorkOrderList/components/CustomizeWorkOrderCard/index.js +5 -5
  25. package/dist/esm/WorkOrder/components/WorkOrderList/index.js +3 -1
  26. package/dist/esm/WorkOrder/index.js +0 -1
  27. package/dist/esm/common/utils/constant.js +8 -0
  28. package/dist/esm/common/utils/dist/submitDataTransOldFormat.js +899 -0
  29. package/dist/esm/common/utils/dist/tools.js +1326 -0
  30. package/dist/esm/common/utils/dist/transformWorkOrderData.js +965 -0
  31. package/dist/esm/common/utils/submitDataTransOldFormat.js +3 -0
  32. package/dist/esm/common/utils/tools.js +3 -1
  33. package/dist/esm/common/utils/transformWorkOrderData.js +7 -0
  34. package/dist/esm/index.d.ts +3 -0
  35. package/dist/esm/index.js +3 -0
  36. package/dist/esm/model/customizeWorkOrder/dist/api.js +48 -0
  37. package/dist/esm/model/customizeWorkOrder/dist/index.js +370 -0
  38. package/dist/esm/model/customizeWorkOrder/dist/selector.js +63 -0
  39. package/dist/esm/model/customizeWorkOrder/dist/types.js +3 -0
  40. package/dist/esm/model/dist/global.js +44 -0
  41. package/dist/esm/model/dist/hooks.js +15 -0
  42. package/dist/esm/model/dist/login.js +245 -0
  43. package/dist/esm/model/dist/store.js +30 -0
  44. package/dist/esm/model/dist/userData.js +41 -0
  45. package/dist/esm/model/dist/workOrder.js +329 -0
  46. package/dist/esm/model/flowTemplateDetail/dist/api.js +192 -0
  47. package/dist/esm/model/flowTemplateDetail/dist/types.js +48 -0
  48. package/dist/esm/model/logicFlow/dist/api.js +14 -0
  49. package/dist/esm/model/logicFlow/dist/index.js +235 -0
  50. package/dist/esm/model/logicFlow/dist/selector.js +18 -0
  51. package/dist/esm/model/logicFlow/dist/types.js +3 -0
  52. package/dist/esm/model/logicFlow/selector.d.ts +0 -3
  53. package/dist/esm/model/paymentWorkOrder/dist/index.js +77 -0
  54. package/dist/esm/model/paymentWorkOrder/dist/selector.js +36 -0
  55. package/dist/esm/model/paymentWorkOrder/dist/types.js +3 -0
  56. package/dist/esm/model/paymentWorkOrder/selector.d.ts +0 -9
  57. package/dist/esm/model/servers/dist/api.js +545 -0
  58. package/dist/esm/model/servers/dist/request.js +63 -0
  59. package/dist/esm/model/singleShopWorkOrder/dist/index.js +216 -0
  60. package/dist/esm/model/singleShopWorkOrder/dist/selector.js +24 -0
  61. package/dist/esm/model/singleShopWorkOrder/dist/types.js +3 -0
  62. package/dist/esm/model/singleShopWorkOrder/selector.d.ts +0 -5
  63. package/dist/esm/model/types/dist/login.js +3 -0
  64. package/dist/esm/model/types/dist/singleWorkOrder.js +3 -0
  65. package/dist/esm/model/types/dist/workOrder.js +3 -0
  66. package/dist/esm/model/types/login.d.ts +1 -0
  67. package/package.json +6 -5
@@ -1,4 +1,6 @@
1
1
  import React from 'react';
2
- export declare const AutoTaskDetail: ({ flowEventData }: {
2
+ import type { Shop } from '../../../model/types/login';
3
+ export declare const AutoTaskDetail: ({ flowEventData, shopList, }: {
3
4
  flowEventData: any;
5
+ shopList: Shop[];
4
6
  }) => React.JSX.Element;
@@ -1,8 +1,10 @@
1
1
  import React from 'react';
2
2
  import { isNumber } from 'lodash';
3
- import { Divider } from 'antd';
3
+ import { Divider, Button } from 'antd';
4
+ import { LB } from '@kmkf-fe-packages/kmkf-work-order-service-component';
4
5
  export var AutoTaskDetail = function AutoTaskDetail(_ref) {
5
- var flowEventData = _ref.flowEventData;
6
+ var flowEventData = _ref.flowEventData,
7
+ shopList = _ref.shopList;
6
8
  var mapping = {
7
9
  0: '执行中',
8
10
  1: '部分成功',
@@ -13,6 +15,28 @@ export var AutoTaskDetail = function AutoTaskDetail(_ref) {
13
15
  6: '同时存在成功和失败且已完结',
14
16
  7: '等待业务执行'
15
17
  };
18
+ var repairOrderMapList = [{
19
+ name: '安装/维修单订单编号',
20
+ value: 'repairOrderNumber'
21
+ }, {
22
+ name: '安装/维修单订单id',
23
+ value: 'repairOrderId'
24
+ }, {
25
+ name: '服务类型',
26
+ value: 'serviceType'
27
+ }, {
28
+ name: '服务状态',
29
+ value: 'serviceStatus'
30
+ }, {
31
+ name: '最新服务进度',
32
+ value: 'latestServiceProgress'
33
+ }, {
34
+ name: '最新服务进度时间',
35
+ value: 'latestServiceProgressTime'
36
+ }, {
37
+ name: '下单时间',
38
+ value: 'orderTime'
39
+ }];
16
40
  var eventStatus = flowEventData === null || flowEventData === void 0 ? void 0 : flowEventData.eventStatus;
17
41
  var renderRules = function renderRules() {
18
42
  var _flowEventData$eventD, _flowEventData$eventD2;
@@ -28,8 +52,40 @@ export var AutoTaskDetail = function AutoTaskDetail(_ref) {
28
52
  }))), /*#__PURE__*/React.createElement("p", null, item.remark));
29
53
  }));
30
54
  };
55
+ var renderRepairResult = function renderRepairResult() {
56
+ var _flowEventData$eventD6, _flowEventData$eventD7;
57
+ var repairData = (flowEventData === null || flowEventData === void 0 ? void 0 : (_flowEventData$eventD6 = flowEventData.eventData) === null || _flowEventData$eventD6 === void 0 ? void 0 : (_flowEventData$eventD7 = _flowEventData$eventD6.otherBusinessData) === null || _flowEventData$eventD7 === void 0 ? void 0 : _flowEventData$eventD7.repairData) || {};
58
+ var repairOrderStatus = repairData.repairOrderStatus,
59
+ id = repairData.id;
60
+ var isSuccess = repairOrderStatus === '成功';
61
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LB.LBOrder, {
62
+ id: id,
63
+ activeKey: "orderInfo",
64
+ shopList: shopList,
65
+ btn: /*#__PURE__*/React.createElement(Button, {
66
+ style: {
67
+ padding: '4px 0'
68
+ },
69
+ type: "link"
70
+ }, "\u67E5\u770B\u8BE6\u60C5>>")
71
+ }), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", {
72
+ style: {
73
+ marginBottom: '8px'
74
+ }
75
+ }, "\u5B89\u88C5/\u7EF4\u4FEE\u5355\u72B6\u6001:", /*#__PURE__*/React.createElement("span", {
76
+ style: {
77
+ color: isSuccess ? '#70B603' : '#D9001B'
78
+ }
79
+ }, repairOrderStatus)), isSuccess && (repairOrderMapList === null || repairOrderMapList === void 0 ? void 0 : repairOrderMapList.map(function (item) {
80
+ return /*#__PURE__*/React.createElement("p", {
81
+ style: {
82
+ marginBottom: '8px'
83
+ }
84
+ }, item.name, ": ", repairData === null || repairData === void 0 ? void 0 : repairData[item.value]);
85
+ }))));
86
+ };
31
87
  // const renderReason = () => {
32
88
  // return <p>{ flowEventData?.eventData?.businessStatus?.map((item: any) => item?.remark)?.join(',') }</p>
33
89
  // }
34
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", null, isNumber(eventStatus) && "\u6267\u884C\u72B6\u6001: ".concat(mapping[eventStatus])), renderRules());
90
+ return /*#__PURE__*/React.createElement("div", null, (flowEventData === null || flowEventData === void 0 ? void 0 : flowEventData.eventType) === 'LBDJ_ONE_PRICE_ORDER' ? renderRepairResult() : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("p", null, isNumber(eventStatus) && "\u6267\u884C\u72B6\u6001: ".concat(mapping[eventStatus])), renderRules()));
35
91
  };
@@ -284,7 +284,7 @@ var CurrentNode = function CurrentNode(props, ref) {
284
284
  }();
285
285
  var isArtificialNode = tag === 'artificial';
286
286
  var isAutoNode = tag === 'auto';
287
- var isShowAutoNodeDetail = isAutoNode && ['ORDER_MEMO_MANY_RULES', 'AFTER_SALE_AUTO_RETURN_GOODS_AGREE_REJECT', 'AFTER_SALE_AUTO_REFUND_REJECT', 'LOGISTICS_INTERCEPT_MULTI_RULE', 'MESSAGE_NOTIFY_EVENT', 'DING_TALK_ROBOT_NOTIFY', 'HTTP_INVOKE', 'ORDER_MEMO'].includes(currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$fl = currentNodeDetail.flowEventData) === null || _currentNodeDetail$fl === void 0 ? void 0 : _currentNodeDetail$fl.eventType);
287
+ var isShowAutoNodeDetail = isAutoNode && ['ORDER_MEMO_MANY_RULES', 'AFTER_SALE_AUTO_RETURN_GOODS_AGREE_REJECT', 'AFTER_SALE_AUTO_REFUND_REJECT', 'LOGISTICS_INTERCEPT_MULTI_RULE', 'MESSAGE_NOTIFY_EVENT', 'DING_TALK_ROBOT_NOTIFY', 'HTTP_INVOKE', 'ORDER_MEMO', 'LBDJ_ONE_PRICE_ORDER'].includes(currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$fl = currentNodeDetail.flowEventData) === null || _currentNodeDetail$fl === void 0 ? void 0 : _currentNodeDetail$fl.eventType);
288
288
  var showEdit = isArtificialNode && isCurrentNodeHandler && !readonly && (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo12 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo12 === void 0 ? void 0 : _currentNodeDetail$wo12.flowStatus) === FlowStatus.COMPLETED;
289
289
  // TODO: 决策节点给后端修复数据加了一个入口
290
290
  // @ts-ignore
@@ -341,7 +341,8 @@ var CurrentNode = function CurrentNode(props, ref) {
341
341
  firstOrderBackfill: flowStatus !== FlowStatus.COMPLETED,
342
342
  autoSubmit: autoSubmit
343
343
  })), isShowAutoNodeDetail && /*#__PURE__*/React.createElement(AutoTaskDetail, {
344
- flowEventData: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.flowEventData
344
+ flowEventData: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.flowEventData,
345
+ shopList: shopList
345
346
  })));
346
347
  };
347
348
  export default /*#__PURE__*/forwardRef(CurrentNode);
@@ -274,7 +274,7 @@ var NodeItem = function NodeItem(props) {
274
274
  isAllStaff: data === null || data === void 0 ? void 0 : (_data$data11 = data.data) === null || _data$data11 === void 0 ? void 0 : (_data$data11$nodeInfo = _data$data11.nodeInfo) === null || _data$data11$nodeInfo === void 0 ? void 0 : (_data$data11$nodeInfo2 = _data$data11$nodeInfo.assistants) === null || _data$data11$nodeInfo2 === void 0 ? void 0 : _data$data11$nodeInfo2.isAllStaff
275
275
  });
276
276
  }, [data, plat.userKey, assistantMap]);
277
- var isShowAutoNodeDetail = isAutoNode && ['ORDER_MEMO_MANY_RULES', 'AFTER_SALE_AUTO_RETURN_GOODS_AGREE_REJECT', 'AFTER_SALE_AUTO_REFUND_REJECT', 'LOGISTICS_INTERCEPT_MULTI_RULE', 'MESSAGE_NOTIFY_EVENT', 'DING_TALK_ROBOT_NOTIFY', 'HTTP_INVOKE', 'ORDER_MEMO', 'WDT_STORE_STATUS', 'BS_E3_RETAIL_RETURN_IN_STOCK_SYNC', 'RETAIL_RETURN_IN_STOCK_SYNC'].includes(eventNodeType);
277
+ var isShowAutoNodeDetail = isAutoNode && ['ORDER_MEMO_MANY_RULES', 'AFTER_SALE_AUTO_RETURN_GOODS_AGREE_REJECT', 'AFTER_SALE_AUTO_REFUND_REJECT', 'LOGISTICS_INTERCEPT_MULTI_RULE', 'MESSAGE_NOTIFY_EVENT', 'DING_TALK_ROBOT_NOTIFY', 'HTTP_INVOKE', 'ORDER_MEMO', 'WDT_STORE_STATUS', 'BS_E3_RETAIL_RETURN_IN_STOCK_SYNC', 'RETAIL_RETURN_IN_STOCK_SYNC', 'LBDJ_ONE_PRICE_ORDER'].includes(eventNodeType);
278
278
  // 人工节点+打开状态+当前工单提交人是当前完成人+状态是待处理
279
279
  var showEdit = isArtificialNode && open && isCurrentNodeHandler && !readonly && [FlowStatus.PROCESSING, FlowStatus.COMPLETED].includes(flowStatus);
280
280
 
@@ -346,7 +346,8 @@ var NodeItem = function NodeItem(props) {
346
346
  platform: plat.platform,
347
347
  onOpenWangWang: onOpenWangWang
348
348
  })), isShowAutoNodeDetail && /*#__PURE__*/React.createElement(AutoTaskDetail, {
349
- flowEventData: data === null || data === void 0 ? void 0 : (_data$data22 = data.data) === null || _data$data22 === void 0 ? void 0 : _data$data22.flowEventData
349
+ flowEventData: data === null || data === void 0 ? void 0 : (_data$data22 = data.data) === null || _data$data22 === void 0 ? void 0 : _data$data22.flowEventData,
350
+ shopList: shopList
350
351
  })));
351
352
  };
352
353
  export default NodeItem;
@@ -4,7 +4,6 @@ interface JumpBuyerProps {
4
4
  buyer?: string;
5
5
  shop: string;
6
6
  order_number?: string;
7
- flowTemplateKey: string;
8
7
  }
9
8
  declare const JumpBuyer: (param: JumpBuyerProps) => React.JSX.Element;
10
9
  export default JumpBuyer;
@@ -1,33 +1,47 @@
1
1
  import React from 'react';
2
- import { Image, message } from 'antd';
2
+ import { Image } from 'antd';
3
+ import { Base64 } from 'js-base64';
3
4
  import contact from "../../../common/imgs/contact.png";
4
5
  //工单通需要加一个联系买家按钮跳转到买家聊天框
6
+ // platformType:
7
+ // 1_千牛
8
+ // 2_咚咚
9
+ // 3_拼多多
10
+ // 4_飞鸽
11
+ // 5_快手
12
+ // 6_小红书
13
+ // 7_唯品会
14
+ // 8_得物
15
+ // 9_微信小店
16
+ // 10_美团
5
17
  var JumpBuyer = function JumpBuyer(param) {
6
18
  var platformType = param.platformType,
7
19
  buyer = param.buyer,
8
20
  shop = param.shop,
9
- order_number = param.order_number,
10
- flowTemplateKey = param.flowTemplateKey;
21
+ order_number = param.order_number;
11
22
  var onClick = function onClick() {
12
- var _window, _window$xiaozhiSDK;
23
+ var _window;
13
24
  var info = {
14
25
  event: 'open_buyers',
15
26
  param: {
16
- platformType: platformType,
27
+ platformType: Number(platformType),
17
28
  buyer: buyer,
18
29
  shop: shop,
19
30
  order_number: order_number
20
31
  }
21
32
  };
22
- if (!order_number) {
23
- return message.error('缺少订单信息无法跳转');
33
+ var jsonString = JSON.stringify(info);
34
+ // 使用安全的 Base64 编码
35
+ var base64String = Base64.encodeURL(jsonString);
36
+ console.log('jumpBuyer', info, "zxd:/".concat(base64String));
37
+ if ((_window = window) !== null && _window !== void 0 && _window.xiaozhiSDK) {
38
+ var _window2, _window2$xiaozhiSDK;
39
+ (_window2 = window) === null || _window2 === void 0 ? void 0 : (_window2$xiaozhiSDK = _window2.xiaozhiSDK) === null || _window2$xiaozhiSDK === void 0 ? void 0 : _window2$xiaozhiSDK.openUrlWithDefault({
40
+ param: {
41
+ url: "zxd:/".concat(base64String)
42
+ }
43
+ });
24
44
  }
25
- console.log('jumpBuyer', info, "zxd:/".concat(btoa(encodeURIComponent(JSON.stringify(info)))));
26
- (_window = window) === null || _window === void 0 ? void 0 : (_window$xiaozhiSDK = _window.xiaozhiSDK) === null || _window$xiaozhiSDK === void 0 ? void 0 : _window$xiaozhiSDK.openUrlWithDefault({
27
- param: {
28
- url: "zxd:/".concat(btoa(encodeURIComponent(JSON.stringify(info))))
29
- }
30
- });
31
45
  };
32
46
  return /*#__PURE__*/React.createElement("span", {
33
47
  onClick: onClick,
@@ -62,7 +62,7 @@ import { PlatForm } from "../WorkOrder/types";
62
62
  var Text = Typography.Text,
63
63
  Link = Typography.Link;
64
64
  var FlowTemplateDetail = function FlowTemplateDetail(props) {
65
- var _currentNodeDetail$wo, _currentNodeDetail$no, _currentNodeDetail$wo2, _currentNodeDetail$no14, _shopList$find, _JSON$parse, _currentNodeDetail$wo31, _currentNodeDetail$wo32, _currentNodeDetail$wo33, _currentNodeDetail$wo34, _currentNodeDetail$no27, _currentNodeDetail$no28, _currentNodeDetail$no29, _currentNodeDetail$no30;
65
+ var _currentNodeDetail$wo, _currentNodeDetail$no, _currentNodeDetail$wo2, _currentNodeDetail$no14, _shopList$find, _currentNodeDetail$wo31, _currentNodeDetail$wo32, _JSON$parse, _currentNodeDetail$wo33, _currentNodeDetail$wo34, _currentNodeDetail$wo35, _currentNodeDetail$wo36, _currentNodeDetail$no27, _currentNodeDetail$no28, _currentNodeDetail$no29, _currentNodeDetail$no30;
66
66
  var flowTemplateKey = props.flowTemplateKey,
67
67
  _props$shopList = props.shopList,
68
68
  shopList = _props$shopList === void 0 ? [] : _props$shopList,
@@ -1311,14 +1311,14 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
1311
1311
  }), shopItem === null || shopItem === void 0 ? void 0 : shopItem.shopName, "-"), /*#__PURE__*/React.createElement("span", null, flowWorkOrderId), !['created', 'edit'].includes(privilege) && /*#__PURE__*/React.createElement(Button, {
1312
1312
  type: "link",
1313
1313
  onClick: handleFollow
1314
- }, !follow ? '关注' : '已关注'), plat.platform === PlatForm.XIAOZHI && /*#__PURE__*/React.createElement(JumpBuyer, {
1314
+ }, !follow ? '关注' : '已关注'), plat.platform === PlatForm.XIAOZHI && ['2'].includes(String(otherInfo === null || otherInfo === void 0 ? void 0 : otherInfo.xzClientPlatformType)) && ((otherInfo === null || otherInfo === void 0 ? void 0 : otherInfo.buyerOpenUid) || (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo31 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo31 === void 0 ? void 0 : _currentNodeDetail$wo31.buyerOpenUid)) && /*#__PURE__*/React.createElement(JumpBuyer, {
1315
1315
  order_number: tid,
1316
1316
  shop: (otherInfo === null || otherInfo === void 0 ? void 0 : otherInfo.taobaoNick) || '',
1317
- platformType: otherInfo === null || otherInfo === void 0 ? void 0 : otherInfo.xzClientPlatformType,
1318
- flowTemplateKey: flowTemplateKey
1319
- })), /*#__PURE__*/React.createElement("div", null, (_JSON$parse = JSON.parse((currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo31 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo31 === void 0 ? void 0 : (_currentNodeDetail$wo32 = _currentNodeDetail$wo31.jsonMap) === null || _currentNodeDetail$wo32 === void 0 ? void 0 : _currentNodeDetail$wo32.flowTags) || '[]')) !== null && _JSON$parse !== void 0 && _JSON$parse.includes('AI_BUILD') ? /*#__PURE__*/React.createElement(Tag, {
1317
+ buyer: (otherInfo === null || otherInfo === void 0 ? void 0 : otherInfo.buyerOpenUid) || (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo32 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo32 === void 0 ? void 0 : _currentNodeDetail$wo32.buyerOpenUid),
1318
+ platformType: otherInfo === null || otherInfo === void 0 ? void 0 : otherInfo.xzClientPlatformType
1319
+ })), /*#__PURE__*/React.createElement("div", null, (_JSON$parse = JSON.parse((currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo33 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo33 === void 0 ? void 0 : (_currentNodeDetail$wo34 = _currentNodeDetail$wo33.jsonMap) === null || _currentNodeDetail$wo34 === void 0 ? void 0 : _currentNodeDetail$wo34.flowTags) || '[]')) !== null && _JSON$parse !== void 0 && _JSON$parse.includes('AI_BUILD') ? /*#__PURE__*/React.createElement(Tag, {
1320
1320
  color: "blue"
1321
- }, "AI\u81EA\u52A8\u5EFA\u5355-".concat(WORK_ORDER_STATUS_AI_BUILD[currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo33 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo33 === void 0 ? void 0 : (_currentNodeDetail$wo34 = _currentNodeDetail$wo33.jsonMap) === null || _currentNodeDetail$wo34 === void 0 ? void 0 : _currentNodeDetail$wo34.flowStatus])) : null)), flowStatus && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Row, {
1321
+ }, "AI\u81EA\u52A8\u5EFA\u5355-".concat(WORK_ORDER_STATUS_AI_BUILD[currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo35 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo35 === void 0 ? void 0 : (_currentNodeDetail$wo36 = _currentNodeDetail$wo35.jsonMap) === null || _currentNodeDetail$wo36 === void 0 ? void 0 : _currentNodeDetail$wo36.flowStatus])) : null)), flowStatus && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Row, {
1322
1322
  justify: 'space-between',
1323
1323
  className: "header"
1324
1324
  }, /*#__PURE__*/React.createElement(Col, null, /*#__PURE__*/React.createElement("div", {
@@ -0,0 +1,52 @@
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;
@@ -0,0 +1,180 @@
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;
@@ -0,0 +1,186 @@
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;