@kmkf-fe-packages/kmkf-work-order-service-component 2.0.71 → 2.0.73

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 (51) hide show
  1. package/dist/esm/FlowTemplateDetailV2/components/FormRender/common.js +1 -0
  2. package/dist/esm/FlowTemplateDetailV2/components/FormRender/constants.d.ts +9 -0
  3. package/dist/esm/FlowTemplateDetailV2/components/FormRender/constants.js +27 -0
  4. package/dist/esm/FlowTemplateDetailV2/components/FormRender/index.js +73 -72
  5. package/dist/esm/FlowTemplateDetailV2/components/FormRender/onBlur.d.ts +14 -0
  6. package/dist/esm/FlowTemplateDetailV2/components/FormRender/onBlur.js +137 -0
  7. package/dist/esm/FlowTemplateDetailV2/index.js +3 -2
  8. package/dist/esm/FlowTemplateDetailV2/store/reducers.d.ts +2 -0
  9. package/dist/esm/FlowTemplateDetailV2/store/reducers.js +47 -41
  10. package/dist/esm/FlowTemplateDetailV2/store/selector.d.ts +1 -0
  11. package/dist/esm/FlowTemplateDetailV2/store/selector.js +3 -0
  12. package/dist/esm/GlobalContext/hook/dist/useGetHasErpData.js +52 -0
  13. package/dist/esm/GlobalContext/orderQuery/dist/useGetErpAddressData.js +180 -0
  14. package/dist/esm/GlobalContext/orderQuery/dist/useGetErpLogisticsCompany.js +186 -0
  15. package/dist/esm/common/utils/dist/submitDataTransOldFormat.js +899 -0
  16. package/dist/esm/common/utils/dist/tools.js +1326 -0
  17. package/dist/esm/common/utils/dist/transformWorkOrderData.js +965 -0
  18. package/dist/esm/common/utils/orderBackKm.d.ts +12 -0
  19. package/dist/esm/common/utils/orderBackKm.js +31 -0
  20. package/dist/esm/common/utils/submitDataTransOldFormat.js +166 -156
  21. package/dist/esm/common/utils/tools.js +62 -38
  22. package/dist/esm/common/utils/transformWorkOrderData.js +28 -22
  23. package/dist/esm/model/customizeWorkOrder/dist/api.js +48 -0
  24. package/dist/esm/model/customizeWorkOrder/dist/index.js +370 -0
  25. package/dist/esm/model/customizeWorkOrder/dist/selector.js +63 -0
  26. package/dist/esm/model/customizeWorkOrder/dist/types.js +3 -0
  27. package/dist/esm/model/dist/global.js +44 -0
  28. package/dist/esm/model/dist/hooks.js +15 -0
  29. package/dist/esm/model/dist/login.js +245 -0
  30. package/dist/esm/model/dist/store.js +30 -0
  31. package/dist/esm/model/dist/userData.js +41 -0
  32. package/dist/esm/model/dist/workOrder.js +329 -0
  33. package/dist/esm/model/flowTemplateDetail/dist/api.js +192 -0
  34. package/dist/esm/model/flowTemplateDetail/dist/types.js +48 -0
  35. package/dist/esm/model/flowTemplateDetail/types.d.ts +1 -0
  36. package/dist/esm/model/logicFlow/dist/api.js +14 -0
  37. package/dist/esm/model/logicFlow/dist/index.js +235 -0
  38. package/dist/esm/model/logicFlow/dist/selector.js +18 -0
  39. package/dist/esm/model/logicFlow/dist/types.js +3 -0
  40. package/dist/esm/model/paymentWorkOrder/dist/index.js +77 -0
  41. package/dist/esm/model/paymentWorkOrder/dist/selector.js +36 -0
  42. package/dist/esm/model/paymentWorkOrder/dist/types.js +3 -0
  43. package/dist/esm/model/servers/dist/api.js +545 -0
  44. package/dist/esm/model/servers/dist/request.js +63 -0
  45. package/dist/esm/model/singleShopWorkOrder/dist/index.js +216 -0
  46. package/dist/esm/model/singleShopWorkOrder/dist/selector.js +24 -0
  47. package/dist/esm/model/singleShopWorkOrder/dist/types.js +3 -0
  48. package/dist/esm/model/types/dist/login.js +3 -0
  49. package/dist/esm/model/types/dist/singleWorkOrder.js +3 -0
  50. package/dist/esm/model/types/dist/workOrder.js +3 -0
  51. package/package.json +5 -5
@@ -11,6 +11,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
11
11
  function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
12
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
13
  import { cloneDeep } from 'lodash';
14
+
14
15
  // 针对前置组件按照节点id分组
15
16
  export var groupByPreNode = function groupByPreNode(list) {
16
17
  var map = new Map();
@@ -0,0 +1,9 @@
1
+ import { FormInstance } from 'antd';
2
+ /***
3
+ * 根据快麦补发商品信息返填收寄信息
4
+ */
5
+ export declare const orderBackKmAddress: ({ value, templateDetail, form, }: {
6
+ value: any;
7
+ templateDetail: any;
8
+ form: FormInstance;
9
+ }) => void;
@@ -0,0 +1,27 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
4
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
5
+ import { handleKmAddressIdentify } from '@kmkf-fe-packages/kmkf-utils';
6
+ /***
7
+ * 根据快麦补发商品信息返填收寄信息
8
+ */
9
+ export var orderBackKmAddress = function orderBackKmAddress(_ref) {
10
+ var value = _ref.value,
11
+ templateDetail = _ref.templateDetail,
12
+ form = _ref.form;
13
+ var kmSystemOrderNo = value.kmSystemOrderNo,
14
+ orders = value.kmSystemOrder.orders;
15
+ var data = orders.find(function (item) {
16
+ return item.billNo === kmSystemOrderNo;
17
+ });
18
+ var postingComponent = templateDetail.componentDtoList.find(function (item) {
19
+ return item.workOrderComponentType === 'POSTING';
20
+ });
21
+ if (data && postingComponent && postingComponent.componentConfig.showField === 'km') {
22
+ var postingComponentUniqueKey = postingComponent.uniqueKey;
23
+ var kmPosting = handleKmAddressIdentify(data);
24
+ console.log('kmPosting--手动返填--', kmPosting);
25
+ form.setFieldsValue(_defineProperty({}, postingComponentUniqueKey, kmPosting));
26
+ }
27
+ };
@@ -30,9 +30,9 @@ import 'moment/locale/zh-cn';
30
30
  import { calcWorkOrderList, orderBack, getReplaceWarnValues, COMPONENT_MAP_NAME, EXCLUDE_REPLACE_TOP_COMPONENT,
31
31
  // 重复检验不需要展示在顶部的
32
32
  INNER_REPLACE_COMPONENT, reversalFormValues, bsSystemOrderBackValues, kmSystemOrderBackValues, bsE3SystemOrderBackValues, wlnSystemOrderBackValues, gySystemOrderBackValues, jstSystemOrderBackValues, getMappingConfigByTemplateDetail, wdtSystemOrderBackValues, setLogisticsInfo, getMappingTargetValue } from "../../../common/utils/tools";
33
- import { replaceCheck, orderDetail, queryLabelByTradeId, queryMemberLevel, queryTidByOutSid } from "../../../model/servers/api";
33
+ import { replaceCheck, orderDetail, queryLabelByTradeId, queryMemberLevel } from "../../../model/servers/api";
34
34
  import { factory } from '@kmkf-fe-packages/services-components';
35
- import { getExpression, formatDisplayConfig, isNull, LabelData, setSessionStorage } from '@kmkf-fe-packages/kmkf-utils';
35
+ import { getExpression, formatDisplayConfig, isNull, LabelData, setSessionStorage, hasQualityValue } from '@kmkf-fe-packages/kmkf-utils';
36
36
  import ShopName from "../ShopName";
37
37
  import { PlatForm } from "../../../model/flowTemplateDetail/types";
38
38
  import { groupByPreNode, getCurrentNodeModifiedShowHideRule } from "./common";
@@ -42,6 +42,8 @@ import { CHILD_FIELD_TYPE, CHILD_FIELD_VALUE } from "../../../common/constant";
42
42
  import { jsonParseSecurity, findComponentUniqueKeyByType } from "../../../common/utils/tools";
43
43
  import { NEED_CLEAR_FIELDS_WHEN_SHOP_ID_CHANGE } from "../../constant";
44
44
  import { Context } from "../../context";
45
+ import { orderBackKmAddress } from "./constants";
46
+ import { onBlurExpressLogisticsCode, onBlurErpAfterSaleTradeId } from "./onBlur";
45
47
  // 记录显隐触发隐藏的组件。显示后,重新出发一遍映射规则
46
48
  // TODO: 用useState会有bug, 不确定是哪里导致的
47
49
  var hideByXYComponentsMap = {};
@@ -61,6 +63,12 @@ var FormRender = function FormRender(props, ref) {
61
63
  payload: flag
62
64
  });
63
65
  };
66
+ var setKmLoading = function setKmLoading(flag) {
67
+ dispatch({
68
+ type: 'setOrderBackKmLoading',
69
+ payload: flag
70
+ });
71
+ };
64
72
  var shopList = props.shopList,
65
73
  look = props.look,
66
74
  currentShopId = props.shopId,
@@ -750,7 +758,35 @@ var FormRender = function FormRender(props, ref) {
750
758
  };
751
759
  }();
752
760
  // 组件值变化
753
- var componentOnValueChange = function componentOnValueChange(uniqueKey, value, workOrderComponentType) {
761
+ var componentOnValueChange = function componentOnValueChange(uniqueKey, value, workOrderComponentType, type, componentConfig) {
762
+ // 花西子定制问题场景处理
763
+ if (componentConfig) {
764
+ var hasQuality = hasQualityValue(value, uniqueKey, componentConfig);
765
+ if (hasQuality) {
766
+ var _templateDetail$compo3;
767
+ var bsGoods = templateDetail === null || templateDetail === void 0 ? void 0 : (_templateDetail$compo3 = templateDetail.componentDtoList) === null || _templateDetail$compo3 === void 0 ? void 0 : _templateDetail$compo3.find(function (item) {
768
+ return ['BS_GOODS'].includes(item.workOrderComponentType);
769
+ });
770
+ if (bsGoods) {
771
+ var _bsGoodsValue$bsGoods;
772
+ var bsGoodsValue = cloneDeep(form.getFieldValue(bsGoods === null || bsGoods === void 0 ? void 0 : bsGoods.uniqueKey));
773
+ bsGoodsValue === null || bsGoodsValue === void 0 ? void 0 : (_bsGoodsValue$bsGoods = bsGoodsValue.bsGoods) === null || _bsGoodsValue$bsGoods === void 0 ? void 0 : _bsGoodsValue$bsGoods.forEach(function (good) {
774
+ good.mark = '是';
775
+ });
776
+ form.setFieldsValue(_defineProperty({}, bsGoods === null || bsGoods === void 0 ? void 0 : bsGoods.uniqueKey, bsGoodsValue));
777
+ }
778
+ }
779
+ }
780
+ if (workOrderComponentType === 'KM_REISSUE_GOODS') {
781
+ var _value$kmSystemOrder, _value$kmSystemOrder$;
782
+ if (value !== null && value !== void 0 && value.kmSystemOrderNo && value !== null && value !== void 0 && (_value$kmSystemOrder = value.kmSystemOrder) !== null && _value$kmSystemOrder !== void 0 && (_value$kmSystemOrder$ = _value$kmSystemOrder.orders) !== null && _value$kmSystemOrder$ !== void 0 && _value$kmSystemOrder$.length && type === 'kmSystemOrder') {
783
+ orderBackKmAddress({
784
+ value: value,
785
+ form: form,
786
+ templateDetail: templateDetail
787
+ });
788
+ }
789
+ }
754
790
  if (mappingConfig.config[uniqueKey]) {
755
791
  // PS: 目前只有string 和 { value: string, other: ''}这两种类型,后面其他组件如果需要在调整
756
792
  fillByMapping(uniqueKey, value);
@@ -818,76 +854,41 @@ var FormRender = function FormRender(props, ref) {
818
854
  //组件失焦事件
819
855
  var componentOnBlur = /*#__PURE__*/function () {
820
856
  var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(value, type) {
821
- var hasTradeIdComponent, _res$data4, hasKm, userInfo, _userInfo$companyUser, _companyUserConfig$pl, _companyUserConfig, _companyUserConfig$pl2, _companyUserConfig$pl3, companyUserConfig, oldValue, res, tradeId, blurPromise, promises;
857
+ var promises;
822
858
  return _regeneratorRuntime().wrap(function _callee5$(_context5) {
823
859
  while (1) switch (_context5.prev = _context5.next) {
824
860
  case 0:
825
- hasTradeIdComponent = templateDetail.componentDtoList.some(function (item) {
826
- return item.workOrderComponentType === 'TRADE_ID_INPUT';
827
- });
828
- if (!(type === 'expressLogisticsCode' && hasTradeIdComponent)) {
829
- _context5.next = 21;
861
+ if (!(type === 'erpAfterSaleTradeId')) {
862
+ _context5.next = 5;
830
863
  break;
831
864
  }
832
- hasKm = false;
833
- try {
834
- userInfo = JSON.parse(localStorage.getItem('reduxData_userInfo') || '{}');
835
- if (isNull(userInfo)) {
836
- hasKm = true;
837
- } else {
838
- companyUserConfig = (_userInfo$companyUser = userInfo === null || userInfo === void 0 ? void 0 : userInfo.companyUserConfig) !== null && _userInfo$companyUser !== void 0 ? _userInfo$companyUser : {};
839
- if (typeof companyUserConfig === 'string') {
840
- companyUserConfig = JSON.parse(companyUserConfig);
841
- }
842
- hasKm = (_companyUserConfig$pl = (_companyUserConfig = companyUserConfig) === null || _companyUserConfig === void 0 ? void 0 : (_companyUserConfig$pl2 = _companyUserConfig.plugins) === null || _companyUserConfig$pl2 === void 0 ? void 0 : (_companyUserConfig$pl3 = _companyUserConfig$pl2.km) === null || _companyUserConfig$pl3 === void 0 ? void 0 : _companyUserConfig$pl3.show) !== null && _companyUserConfig$pl !== void 0 ? _companyUserConfig$pl : false;
843
- }
844
- } catch (error) {
845
- console.error(error);
846
- }
847
- console.log('---组件失焦事件--expressLogisticsCode', {
848
- type: type,
865
+ _context5.next = 3;
866
+ return onBlurErpAfterSaleTradeId({
867
+ form: form,
849
868
  value: value,
850
869
  templateDetail: templateDetail,
851
- hasTradeIdComponent: hasTradeIdComponent,
852
- oldValue: form.getFieldsValue(),
853
- hasKm: hasKm,
854
- form: form
870
+ setKmLoading: setKmLoading
855
871
  });
856
- if (hasKm) {
857
- _context5.next = 7;
872
+ case 3:
873
+ _context5.next = 22;
874
+ break;
875
+ case 5:
876
+ if (!(type === 'expressLogisticsCode')) {
877
+ _context5.next = 10;
858
878
  break;
859
879
  }
860
- return _context5.abrupt("return");
861
- case 7:
862
- oldValue = form.getFieldValue('0eVTfMGEyd');
863
- _context5.next = 10;
864
- return queryTidByOutSid({
865
- outSid: value
880
+ _context5.next = 8;
881
+ return onBlurExpressLogisticsCode({
882
+ form: form,
883
+ value: value,
884
+ templateDetail: templateDetail,
885
+ setKmLoading: setKmLoading,
886
+ componentOnBlur: componentOnBlur
866
887
  });
888
+ case 8:
889
+ _context5.next = 22;
890
+ break;
867
891
  case 10:
868
- res = _context5.sent;
869
- tradeId = res === null || res === void 0 ? void 0 : (_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : _res$data4.tid;
870
- if (tradeId) {
871
- _context5.next = 14;
872
- break;
873
- }
874
- return _context5.abrupt("return");
875
- case 14:
876
- form.setFieldsValue({
877
- m3ap1EvEyd: tradeId
878
- });
879
- // 创建一个异步操作的Promise
880
- blurPromise = componentOnBlur(tradeId, 'tradeId'); // 等待异步操作完成后再执行setTimeout
881
- _context5.next = 18;
882
- return blurPromise;
883
- case 18:
884
- // 所有异步操作完成后执行
885
- console.log('[组件失焦事件]---set', oldValue);
886
- form.setFieldsValue({
887
- '0eVTfMGEyd': oldValue
888
- });
889
- return _context5.abrupt("return");
890
- case 21:
891
892
  // 收集所有需要执行的异步操作
892
893
  promises = [];
893
894
  if (type === 'tradeId') {
@@ -899,7 +900,7 @@ var FormRender = function FormRender(props, ref) {
899
900
  promises.push(handleChangeTradeId(value));
900
901
  }
901
902
  if (value) {
902
- _context5.next = 28;
903
+ _context5.next = 17;
903
904
  break;
904
905
  }
905
906
  setReplaceValue(function (prev) {
@@ -907,18 +908,18 @@ var FormRender = function FormRender(props, ref) {
907
908
  });
908
909
  replaceValueRef.current = _objectSpread(_objectSpread({}, replaceValue), {}, _defineProperty({}, type, 0));
909
910
  return _context5.abrupt("return");
910
- case 28:
911
+ case 17:
911
912
  promises.push(queryReplaceCount(_defineProperty({}, type, value), templateDetail));
912
913
  // TODO: ERP不走订单反弹逻辑
913
914
  if ((type === 'tradeId' || type === 'enterprisePaymentTid') && !isErpUse) {
914
915
  promises.push(changeHandle(value));
915
916
  }
916
917
  // 等待所有异步操作完成
917
- _context5.next = 32;
918
+ _context5.next = 21;
918
919
  return Promise.all(promises);
919
- case 32:
920
+ case 21:
920
921
  return _context5.abrupt("return", Promise.resolve());
921
- case 33:
922
+ case 22:
922
923
  case "end":
923
924
  return _context5.stop();
924
925
  }
@@ -1221,8 +1222,8 @@ var FormRender = function FormRender(props, ref) {
1221
1222
  checkFillMapping(show, uniqueKey, workOrderComponentType);
1222
1223
  return instance.editRender({
1223
1224
  onBlur: componentOnBlur,
1224
- onChange: function onChange(value) {
1225
- return componentOnValueChange(uniqueKey, value, workOrderComponentType);
1225
+ onChange: function onChange(value, type) {
1226
+ return componentOnValueChange(uniqueKey, value, workOrderComponentType, type, componentConfig);
1226
1227
  },
1227
1228
  hidden: !show || mappingHideComponents.includes(uniqueKey),
1228
1229
  platform: platform,
@@ -1233,8 +1234,8 @@ var FormRender = function FormRender(props, ref) {
1233
1234
  }
1234
1235
  return instance.editRender({
1235
1236
  onBlur: componentOnBlur,
1236
- onChange: function onChange(value) {
1237
- return componentOnValueChange(uniqueKey, value, workOrderComponentType);
1237
+ onChange: function onChange(value, type) {
1238
+ return componentOnValueChange(uniqueKey, value, workOrderComponentType, type, componentConfig);
1238
1239
  },
1239
1240
  hidden: mappingHideComponents.includes(uniqueKey),
1240
1241
  platform: platform,
@@ -1283,8 +1284,8 @@ var FormRender = function FormRender(props, ref) {
1283
1284
  }, [platform, templateDetail, shopList, shopId, record, mappingHideComponents, currentShopId, look, handleChangeTradeId, innerReplaceValue]);
1284
1285
  // TODO: 计算类型组件列表
1285
1286
  var calculationTypeComponentList = useMemo(function () {
1286
- var _templateDetail$compo3;
1287
- return templateDetail === null || templateDetail === void 0 ? void 0 : (_templateDetail$compo3 = templateDetail.componentDtoList) === null || _templateDetail$compo3 === void 0 ? void 0 : _templateDetail$compo3.filter(function (item) {
1287
+ var _templateDetail$compo4;
1288
+ return templateDetail === null || templateDetail === void 0 ? void 0 : (_templateDetail$compo4 = templateDetail.componentDtoList) === null || _templateDetail$compo4 === void 0 ? void 0 : _templateDetail$compo4.filter(function (item) {
1288
1289
  return item.workOrderComponentType === 'NUMERICAL_CALCULATION';
1289
1290
  });
1290
1291
  }, [templateDetail]);
@@ -0,0 +1,14 @@
1
+ import { FormInstance } from 'antd';
2
+ export declare const onBlurErpAfterSaleTradeId: ({ form, value, templateDetail, setKmLoading, }: {
3
+ form: FormInstance;
4
+ value: string;
5
+ templateDetail: any;
6
+ setKmLoading: (loading: boolean) => void;
7
+ }) => Promise<void>;
8
+ export declare const onBlurExpressLogisticsCode: ({ form, value, templateDetail, setKmLoading, componentOnBlur, }: {
9
+ form: FormInstance;
10
+ value: string;
11
+ templateDetail: any;
12
+ setKmLoading: (loading: boolean) => void;
13
+ componentOnBlur: (value: any, type: string) => Promise<void>;
14
+ }) => Promise<void>;
@@ -0,0 +1,137 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
3
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
4
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
5
+ import { orderBackKmVideoByLogisticsCode } from "../../../common/utils/orderBackKm";
6
+ import { isNull } from '@kmkf-fe-packages/kmkf-utils';
7
+ import { queryTidByOutSid } from "../../../model/servers/api";
8
+ export var onBlurErpAfterSaleTradeId = /*#__PURE__*/function () {
9
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
10
+ var _kmErpVideoComponent$;
11
+ var form, value, templateDetail, setKmLoading, kmErpVideoComponent;
12
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
13
+ while (1) switch (_context.prev = _context.next) {
14
+ case 0:
15
+ form = _ref.form, value = _ref.value, templateDetail = _ref.templateDetail, setKmLoading = _ref.setKmLoading;
16
+ kmErpVideoComponent = templateDetail.componentDtoList.find(function (item) {
17
+ return item.workOrderComponentType === 'KM_VIDEO';
18
+ });
19
+ if (!(value && kmErpVideoComponent && (kmErpVideoComponent === null || kmErpVideoComponent === void 0 ? void 0 : (_kmErpVideoComponent$ = kmErpVideoComponent.componentConfig) === null || _kmErpVideoComponent$ === void 0 ? void 0 : _kmErpVideoComponent$.orderBackRule) === 'afterSaleOrderNumber')) {
20
+ _context.next = 5;
21
+ break;
22
+ }
23
+ _context.next = 5;
24
+ return orderBackKmVideoByLogisticsCode({
25
+ form: form,
26
+ params: {
27
+ afterSaleOrderNumber: value
28
+ },
29
+ setLoading: setKmLoading
30
+ });
31
+ case 5:
32
+ case "end":
33
+ return _context.stop();
34
+ }
35
+ }, _callee);
36
+ }));
37
+ return function onBlurErpAfterSaleTradeId(_x) {
38
+ return _ref2.apply(this, arguments);
39
+ };
40
+ }();
41
+ export var onBlurExpressLogisticsCode = /*#__PURE__*/function () {
42
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref3) {
43
+ var _kmErpVideoComponent$2;
44
+ var form, value, templateDetail, setKmLoading, componentOnBlur, hasTradeIdComponent, kmErpVideoComponent, _res$data, hasKm, userInfo, _userInfo$companyUser, _companyUserConfig$pl, _companyUserConfig, _companyUserConfig$pl2, _companyUserConfig$pl3, companyUserConfig, oldValue, res, tradeId, blurPromise;
45
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
46
+ while (1) switch (_context2.prev = _context2.next) {
47
+ case 0:
48
+ form = _ref3.form, value = _ref3.value, templateDetail = _ref3.templateDetail, setKmLoading = _ref3.setKmLoading, componentOnBlur = _ref3.componentOnBlur;
49
+ hasTradeIdComponent = templateDetail.componentDtoList.some(function (item) {
50
+ return item.workOrderComponentType === 'TRADE_ID_INPUT';
51
+ });
52
+ kmErpVideoComponent = templateDetail.componentDtoList.find(function (item) {
53
+ return item.workOrderComponentType === 'KM_VIDEO';
54
+ });
55
+ if (!(value && kmErpVideoComponent && (kmErpVideoComponent === null || kmErpVideoComponent === void 0 ? void 0 : (_kmErpVideoComponent$2 = kmErpVideoComponent.componentConfig) === null || _kmErpVideoComponent$2 === void 0 ? void 0 : _kmErpVideoComponent$2.orderBackRule) === 'outSid')) {
56
+ _context2.next = 6;
57
+ break;
58
+ }
59
+ _context2.next = 6;
60
+ return orderBackKmVideoByLogisticsCode({
61
+ form: form,
62
+ params: {
63
+ outSid: value
64
+ },
65
+ setLoading: setKmLoading
66
+ });
67
+ case 6:
68
+ if (!hasTradeIdComponent) {
69
+ _context2.next = 24;
70
+ break;
71
+ }
72
+ hasKm = false;
73
+ try {
74
+ userInfo = JSON.parse(localStorage.getItem('reduxData_userInfo') || '{}');
75
+ if (isNull(userInfo)) {
76
+ hasKm = true;
77
+ } else {
78
+ companyUserConfig = (_userInfo$companyUser = userInfo === null || userInfo === void 0 ? void 0 : userInfo.companyUserConfig) !== null && _userInfo$companyUser !== void 0 ? _userInfo$companyUser : {};
79
+ if (typeof companyUserConfig === 'string') {
80
+ companyUserConfig = JSON.parse(companyUserConfig);
81
+ }
82
+ hasKm = (_companyUserConfig$pl = (_companyUserConfig = companyUserConfig) === null || _companyUserConfig === void 0 ? void 0 : (_companyUserConfig$pl2 = _companyUserConfig.plugins) === null || _companyUserConfig$pl2 === void 0 ? void 0 : (_companyUserConfig$pl3 = _companyUserConfig$pl2.km) === null || _companyUserConfig$pl3 === void 0 ? void 0 : _companyUserConfig$pl3.show) !== null && _companyUserConfig$pl !== void 0 ? _companyUserConfig$pl : false;
83
+ }
84
+ } catch (error) {
85
+ console.error(error);
86
+ }
87
+ // console.log('---组件失焦事件--expressLogisticsCode', {
88
+ // value,
89
+ // templateDetail,
90
+ // hasTradeIdComponent,
91
+ // oldValue: form.getFieldsValue(),
92
+ // hasKm,
93
+ // form,
94
+ // });
95
+ if (hasKm) {
96
+ _context2.next = 11;
97
+ break;
98
+ }
99
+ return _context2.abrupt("return");
100
+ case 11:
101
+ oldValue = form.getFieldValue('0eVTfMGEyd');
102
+ _context2.next = 14;
103
+ return queryTidByOutSid({
104
+ outSid: value
105
+ });
106
+ case 14:
107
+ res = _context2.sent;
108
+ tradeId = res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.tid;
109
+ if (tradeId) {
110
+ _context2.next = 18;
111
+ break;
112
+ }
113
+ return _context2.abrupt("return");
114
+ case 18:
115
+ form.setFieldsValue({
116
+ m3ap1EvEyd: tradeId
117
+ });
118
+ // 创建一个异步操作的Promise
119
+ blurPromise = componentOnBlur(tradeId, 'tradeId'); // 等待异步操作完成后再执行setTimeout
120
+ _context2.next = 22;
121
+ return blurPromise;
122
+ case 22:
123
+ // 所有异步操作完成后执行
124
+ console.log('[组件失焦事件]---set', oldValue);
125
+ form.setFieldsValue({
126
+ '0eVTfMGEyd': oldValue
127
+ });
128
+ case 24:
129
+ case "end":
130
+ return _context2.stop();
131
+ }
132
+ }, _callee2);
133
+ }));
134
+ return function onBlurExpressLogisticsCode(_x2) {
135
+ return _ref4.apply(this, arguments);
136
+ };
137
+ }();
@@ -27,7 +27,7 @@ import { calcWorkOrderList, deleteCacheOrder, submitParams } from "../common/uti
27
27
  import { useMemoizedFn } from 'ahooks';
28
28
  import moment from 'moment';
29
29
  import { fetchPanelInfo, fetchAllFlowOperateRecord, fetchCollectOrder } from "./store/reducers";
30
- import { selectFlowRecordList, selectRemarkRecordList, selectCurrentNodeDetail, selectTid, selectShopUniqueKey, selectOperateParams, selectFlowStatus, selectCurrentTradeIdWOrkOrderNumber, selectFlowTemplateId, selectLoading, selectOrderBackLoading, selectWithDrawOrder, selectNodeAssistantMap, selectFlowTemplateType, selectFollow } from "./store/selector";
30
+ import { selectFlowRecordList, selectRemarkRecordList, selectCurrentNodeDetail, selectTid, selectShopUniqueKey, selectOperateParams, selectFlowStatus, selectCurrentTradeIdWOrkOrderNumber, selectFlowTemplateId, selectLoading, selectOrderBackLoading, selectOrderBackKmLoading, selectWithDrawOrder, selectNodeAssistantMap, selectFlowTemplateType, selectFollow } from "./store/selector";
31
31
  import { NodeType, FlowStatus, FlowType } from "../model/flowTemplateDetail/types";
32
32
  import NodeItem from "./components/Item";
33
33
  import CurrentNode from "./components/CurrentNode";
@@ -94,6 +94,7 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
94
94
  var currentTradeIdLinkWorkOrderId = useSelector(selectCurrentTradeIdWOrkOrderNumber);
95
95
  var loading = useSelector(selectLoading);
96
96
  var orderBackLoading = useSelector(selectOrderBackLoading);
97
+ var orderBackKmLoading = useSelector(selectOrderBackKmLoading);
97
98
  var withdrawWorkOrderDetail = useSelector(selectWithDrawOrder);
98
99
  var assistantMap = useSelector(selectNodeAssistantMap);
99
100
  var flowTemplateType = useSelector(selectFlowTemplateType);
@@ -1212,7 +1213,7 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
1212
1213
  }));
1213
1214
  };
1214
1215
  return /*#__PURE__*/React.createElement(Spin, {
1215
- spinning: loading || orderBackLoading
1216
+ spinning: loading || orderBackLoading || orderBackKmLoading
1216
1217
  }, /*#__PURE__*/React.createElement("div", {
1217
1218
  className: "flowWorkOrderDetail"
1218
1219
  }, flowWorkOrderId && /*#__PURE__*/React.createElement("div", null, plat.platform === 'pc' && /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(PlatformAvatar, {
@@ -12,6 +12,7 @@ export declare const setNodeAssistantInfo: (state: FlowTemplateDetailState, { pa
12
12
  }>) => void;
13
13
  export declare const setLoading: (state: FlowTemplateDetailState, { payload }: PayloadAction<boolean>) => void;
14
14
  export declare const setOrderBackLoading: (state: FlowTemplateDetailState, { payload }: PayloadAction<boolean>) => void;
15
+ export declare const setOrderBackKmLoading: (state: FlowTemplateDetailState, { payload }: PayloadAction<boolean>) => void;
15
16
  export declare const setFlowList: (state: FlowTemplateDetailState, { payload }: PayloadAction<Array<Line>>) => void;
16
17
  export declare const setTid: (state: FlowTemplateDetailState, { payload }: PayloadAction<string>) => void;
17
18
  export declare const setShopUniqueKey: (state: FlowTemplateDetailState, { payload }: PayloadAction<string>) => void;
@@ -45,6 +46,7 @@ declare const reducers: (state: FlowTemplateDetailState | undefined, action: {
45
46
  }) => {
46
47
  loading: boolean;
47
48
  orderBackLoading: boolean;
49
+ orderBackKmLoading: boolean;
48
50
  flowList: Line[];
49
51
  assistantMap: {
50
52
  [nodeId: string]: Assistant[];