@kmkf-fe-packages/kmkf-work-order-service-component 0.21.4 → 0.22.0-alpha.2

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.
@@ -33,7 +33,7 @@ import styles from "./index.module.less";
33
33
  import { PlatForm } from "../../../WorkOrder/types";
34
34
  import { useSignal } from "../../../hooks/useSignal";
35
35
  var CurrentNode = function CurrentNode(props, ref) {
36
- var _currentNodeDetail$no, _currentNodeDetail$no2, _currentNodeDetail$no3, _currentNodeDetail$no4, _currentNodeDetail$wo10, _currentNodeDetail$wo11, _currentNodeDetail$wo12, _currentNodeDetail$wo13, _currentNodeDetail$wo14, _currentNodeDetail$wo15, _currentNodeDetail$wo16, _currentNodeDetail$wo17, _currentNodeDetail$no17, _currentNodeDetail$no18, _currentNodeDetail$wo18;
36
+ var _currentNodeDetail$no, _currentNodeDetail$no2, _currentNodeDetail$no3, _currentNodeDetail$no4, _currentNodeDetail$no16, _currentNodeDetail$wo10, _currentNodeDetail$wo11, _currentNodeDetail$wo12, _currentNodeDetail$wo13, _currentNodeDetail$wo14, _currentNodeDetail$wo15, _currentNodeDetail$wo16, _currentNodeDetail$wo17, _currentNodeDetail$no18, _currentNodeDetail$no19, _currentNodeDetail$wo18;
37
37
  var formRenderRef = useRef(null);
38
38
  useImperativeHandle(ref, function () {
39
39
  return {
@@ -137,7 +137,7 @@ var CurrentNode = function CurrentNode(props, ref) {
137
137
  if (plat.orderNo && NodeType.START_NODE === (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no15 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no15 === void 0 ? void 0 : _currentNodeDetail$no15.nodeType) && operateParams !== null && operateParams !== void 0 && operateParams.flowTemplateKey && tradeKey) {
138
138
  handleChangeTradeId(plat.orderNo);
139
139
  }
140
- }, [plat, operateParams, currentNodeDetail, tradeKey]);
140
+ }, [plat.orderNo, operateParams === null || operateParams === void 0 ? void 0 : operateParams.flowTemplateKey, currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no16 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no16 === void 0 ? void 0 : _currentNodeDetail$no16.nodeType, tradeKey]);
141
141
  var transData = useMemo(function () {
142
142
  if (flowStatus === FlowStatus.COMPLETED) {
143
143
  var _currentNodeDetail$wo6, _currentNodeDetail$wo7;
@@ -148,9 +148,9 @@ var CurrentNode = function CurrentNode(props, ref) {
148
148
  }
149
149
  }, [flowStatus, currentNodeDetail]);
150
150
  var handleWithdraw = function handleWithdraw() {
151
- var _currentNodeDetail$no16;
151
+ var _currentNodeDetail$no17;
152
152
  dispatch(setWithdrawWorkOrderDetail({
153
- nodeId: (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no16 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no16 === void 0 ? void 0 : _currentNodeDetail$no16.id) || ''
153
+ nodeId: (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no17 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no17 === void 0 ? void 0 : _currentNodeDetail$no17.id) || ''
154
154
  }));
155
155
  dispatch(setAction('withdraw'));
156
156
  };
@@ -230,14 +230,14 @@ var CurrentNode = function CurrentNode(props, ref) {
230
230
  handleSave: handleSave
231
231
  }), /*#__PURE__*/React.createElement("div", {
232
232
  className: styles.formRenderContainer
233
- }, [NodeType.START_NODE, NodeType.EXECUTE_NODE].includes(currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no17 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no17 === void 0 ? void 0 : _currentNodeDetail$no17.nodeType) && (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.workOrderTemplateInfo) && (flowStatus === FlowStatus.COMPLETED && !editing ? /*#__PURE__*/React.createElement(RenderDetail, {
233
+ }, [NodeType.START_NODE, NodeType.EXECUTE_NODE].includes(currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no18 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no18 === void 0 ? void 0 : _currentNodeDetail$no18.nodeType) && (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.workOrderTemplateInfo) && (flowStatus === FlowStatus.COMPLETED && !editing ? /*#__PURE__*/React.createElement(RenderDetail, {
234
234
  workOrderTemplateInfo: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.workOrderTemplateInfo,
235
235
  transData: transData,
236
236
  platform: plat.platform,
237
237
  onOpenWangWang: onOpenWangWang
238
238
  }) : /*#__PURE__*/React.createElement(FormRender, {
239
239
  ref: formRenderRef,
240
- isShowShopList: NodeType.START_NODE === (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no18 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no18 === void 0 ? void 0 : _currentNodeDetail$no18.nodeType) && PlatForm.PC === plat.platform,
240
+ isShowShopList: NodeType.START_NODE === (currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$no19 = currentNodeDetail.nodeInfo) === null || _currentNodeDetail$no19 === void 0 ? void 0 : _currentNodeDetail$no19.nodeType) && PlatForm.PC === plat.platform,
241
241
  plat: plat,
242
242
  templateDetail: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.workOrderTemplateInfo,
243
243
  shopList: shopList,
@@ -26,7 +26,9 @@ import { ConfigProvider, Form } from 'antd';
26
26
  import zhCN from 'antd/es/locale/zh_CN';
27
27
  import { get, some, set, every, cloneDeep, isEmpty, intersection, throttle } from 'lodash';
28
28
  import 'moment/locale/zh-cn';
29
- import { calcWorkOrderList, orderBack, getReplaceWarnValues, COMPONENT_MAP_NAME, reversalFormValues, bsSystemOrderBackValues, wlnSystemOrderBackValues, getMappingConfigByTemplateDetail } from "../../../common/utils/tools";
29
+ import { calcWorkOrderList, orderBack, getReplaceWarnValues, COMPONENT_MAP_NAME, EXCLUDE_REPLACE_TOP_COMPONENT,
30
+ // 重复检验不需要展示在顶部的
31
+ INNER_REPLACE_COMPONENT, reversalFormValues, bsSystemOrderBackValues, wlnSystemOrderBackValues, getMappingConfigByTemplateDetail } from "../../../common/utils/tools";
30
32
  import { replaceCheck, orderDetail } from "../../../model/servers/api";
31
33
  import { factory } from '@kmkf-fe-packages/services-components';
32
34
  import { AddressData, ExpressData, ExpressInterceptData, PlatData, LogisticsAddressData, getExpression, formatDisplayConfig, BsAddressData } from '@kmkf-fe-packages/kmkf-utils';
@@ -126,7 +128,34 @@ var FormRender = function FormRender(props, ref) {
126
128
  fillByShopId(get(transData, '0', {}).shopId);
127
129
  }
128
130
  }, [record]);
129
-
131
+ // 过滤打款组件订单与支付宝账号重复校验结果
132
+ var filterReplaceValue = useMemo(function () {
133
+ var obj = {};
134
+ Object.keys(replaceValue).forEach(function (key) {
135
+ if (!EXCLUDE_REPLACE_TOP_COMPONENT.includes(key)) {
136
+ obj[key] = replaceValue[key];
137
+ }
138
+ });
139
+ return obj;
140
+ }, [replaceValue]);
141
+ var innerReplaceValue = useMemo(function () {
142
+ var obj = {};
143
+ Object.keys(replaceValue).forEach(function (key) {
144
+ if (INNER_REPLACE_COMPONENT.includes(key)) {
145
+ obj[key] = replaceValue[key];
146
+ }
147
+ });
148
+ return obj;
149
+ }, [replaceValue]);
150
+ var innerReplaceValueCh = useMemo(function () {
151
+ var _Object$keys;
152
+ return (_Object$keys = Object.keys(innerReplaceValue)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.reduce(function (prev, next) {
153
+ if ((innerReplaceValue === null || innerReplaceValue === void 0 ? void 0 : innerReplaceValue[next]) > 0) {
154
+ prev[next] = "\u63D0\u793A\uFF1A\u8BE5".concat(COMPONENT_MAP_NAME[next], "\u9488\u5BF9\u6B64\u6A21\u677F\u5DF2\u521B\u5EFA\u8FC7\n ").concat(innerReplaceValue === null || innerReplaceValue === void 0 ? void 0 : innerReplaceValue[next], "\u6761\u5DE5\u5355\uFF01");
155
+ }
156
+ return prev;
157
+ }, {});
158
+ }, [innerReplaceValue]);
130
159
  //带*参数提示清空
131
160
  var filterStarValues = function filterStarValues() {
132
161
  var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -219,19 +248,29 @@ var FormRender = function FormRender(props, ref) {
219
248
  buyerNick = value.buyerNick,
220
249
  receiveMobile = value.receiveMobile,
221
250
  alipayAccount = value.alipayAccount,
251
+ enterprisePaymentAlipayNo = value.enterprisePaymentAlipayNo,
222
252
  expressLogisticsCode = value.expressLogisticsCode,
223
253
  _value$remark = value.remark,
224
254
  remark = _value$remark === void 0 ? '' : _value$remark,
225
255
  _value$flag = value.flag,
226
256
  flag = _value$flag === void 0 ? '' : _value$flag;
227
257
  onUpdateRemark === null || onUpdateRemark === void 0 ? void 0 : onUpdateRemark(remark, flag + '');
258
+ // 清空打款组件之前的重复校验
259
+ if (!enterprisePaymentAlipayNo) {
260
+ setReplaceValue(function (value) {
261
+ return _objectSpread(_objectSpread({}, value), {}, {
262
+ enterprisePaymentAlipayNo: 0
263
+ });
264
+ });
265
+ }
228
266
  queryReplaceCount({
229
267
  tradeId: orderNo,
230
268
  buyerNick: buyerNick,
231
269
  receiveMobile: receiveMobile,
232
270
  alipayAccount: alipayAccount,
233
271
  expressLogisticsCode: expressLogisticsCode,
234
- enterprisePaymentTid: orderNo
272
+ enterprisePaymentTid: orderNo,
273
+ enterprisePaymentAlipayNo: enterprisePaymentAlipayNo
235
274
  }, templateDetail);
236
275
  };
237
276
  var queryDetail = function queryDetail(_ref2) {
@@ -500,6 +539,7 @@ var FormRender = function FormRender(props, ref) {
500
539
  });
501
540
  }
502
541
  };
542
+
503
543
  //组件失焦事件
504
544
  var componentOnBlur = /*#__PURE__*/function () {
505
545
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(value, type) {
@@ -697,11 +737,6 @@ var FormRender = function FormRender(props, ref) {
697
737
  noStyle: true,
698
738
  shouldUpdate: function shouldUpdate(prevValues, currentValues) {
699
739
  return true; // TODO: 修复重复依赖的问题 https://tb.raycloud.com/task/64e4491e0b8b5c001e1099b9
700
- // 对所有依赖项进行是否需要更新判断,只有当当前组件的依赖项发生了变化的时候,我们才会进行渲染判断
701
- return Array.from(dependenciesFields).reduce(function (cur, nxt) {
702
- if (cur) return true;
703
- return cur || (prevValues === null || prevValues === void 0 ? void 0 : prevValues[nxt]) !== (currentValues === null || currentValues === void 0 ? void 0 : currentValues[nxt]);
704
- }, false);
705
740
  }
706
741
  }, function (_ref4) {
707
742
  var getFieldValue = _ref4.getFieldValue;
@@ -764,7 +799,8 @@ var FormRender = function FormRender(props, ref) {
764
799
  return componentOnValueChange(uniqueKey, value, workOrderComponentType);
765
800
  },
766
801
  hidden: !show || mappdingHideComponents.includes(uniqueKey),
767
- platform: platform
802
+ platform: platform,
803
+ innerReplaceValueCh: innerReplaceValueCh
768
804
  });
769
805
  });
770
806
  }
@@ -774,7 +810,8 @@ var FormRender = function FormRender(props, ref) {
774
810
  return componentOnValueChange(uniqueKey, value, workOrderComponentType);
775
811
  },
776
812
  hidden: mappdingHideComponents.includes(uniqueKey),
777
- platform: platform
813
+ platform: platform,
814
+ innerReplaceValueCh: innerReplaceValueCh
778
815
  });
779
816
  };
780
817
  };
@@ -812,7 +849,7 @@ var FormRender = function FormRender(props, ref) {
812
849
  return [].concat(_toConsumableArray(hiddenPreNode), [ShopName], _toConsumableArray(otherItems));
813
850
  }
814
851
  return [].concat(_toConsumableArray(hiddenPreNode), _toConsumableArray(otherItems));
815
- }, [templateDetail, shopList, shopId, record, mappdingHideComponents, currentShopId, look, handleChangeTradeId]);
852
+ }, [templateDetail, shopList, shopId, record, mappdingHideComponents, currentShopId, look, handleChangeTradeId, innerReplaceValue]);
816
853
  // TODO: 计算类型组件列表
817
854
  var calculationTypeComponentList = useMemo(function () {
818
855
  var _templateDetail$compo;
@@ -903,8 +940,8 @@ var FormRender = function FormRender(props, ref) {
903
940
  locale: zhCN
904
941
  }, /*#__PURE__*/React.createElement("div", {
905
942
  className: "tipBox"
906
- }, Object.keys(replaceValue).map(function (key) {
907
- return replaceValue[key] > 0 && /*#__PURE__*/React.createElement("div", null, "\u63D0\u793A\uFF1A\u8BE5", COMPONENT_MAP_NAME[key], "\u9488\u5BF9\u6B64\u6A21\u677F\u5DF2\u521B\u5EFA\u8FC7", replaceValue[key], "\u6761\u5DE5\u5355\uFF01");
943
+ }, Object.keys(filterReplaceValue).map(function (key) {
944
+ return filterReplaceValue[key] > 0 && /*#__PURE__*/React.createElement("div", null, "\u63D0\u793A\uFF1A\u8BE5", COMPONENT_MAP_NAME[key], "\u9488\u5BF9\u6B64\u6A21\u677F\u5DF2\u521B\u5EFA\u8FC7", replaceValue[key], "\u6761\u5DE5\u5355\uFF01");
908
945
  })), /*#__PURE__*/React.createElement(Form, _extends({
909
946
  form: preNodeForm
910
947
  }, formProps), preNodeFormItems), /*#__PURE__*/React.createElement(Form, _extends({
@@ -65,6 +65,8 @@ export declare const COMPONENT_MAP: {
65
65
  export declare const COMPONENT_MAP_NAME: {
66
66
  [key: string]: string;
67
67
  };
68
+ export declare const EXCLUDE_REPLACE_TOP_COMPONENT: string[];
69
+ export declare const INNER_REPLACE_COMPONENT: string[];
68
70
  export declare const getReplaceWarnValues: (templateDetail: {
69
71
  componentDtoList: any[];
70
72
  }, keyValues: {
@@ -1750,16 +1750,20 @@ export var COMPONENT_MAP = {
1750
1750
  receiveMobile: 'RECEIVER_MOBILE_INPUT',
1751
1751
  alipayAccount: 'ALI_PAY_INPUT',
1752
1752
  expressLogisticsCode: 'EXPRESS_LOGISTICS_SELECT',
1753
- enterprisePaymentTid: 'ENTERPRISE_PAYMENT'
1753
+ enterprisePaymentTid: 'ENTERPRISE_PAYMENT',
1754
+ enterprisePaymentAlipayNo: 'ENTERPRISE_PAYMENT'
1754
1755
  };
1755
1756
  export var COMPONENT_MAP_NAME = {
1756
1757
  tradeId: '订单号',
1757
1758
  buyerNick: '买家昵称',
1758
1759
  receiveMobile: '收件人手机号',
1759
1760
  alipayAccount: '支付宝账号',
1761
+ enterprisePaymentAlipayNo: '支付宝账号',
1760
1762
  expressLogisticsCode: '快递物流单号',
1761
1763
  enterprisePaymentTid: '打款订单号'
1762
1764
  };
1765
+ export var EXCLUDE_REPLACE_TOP_COMPONENT = ['enterprisePaymentAlipayNo', 'enterprisePaymentTid'];
1766
+ export var INNER_REPLACE_COMPONENT = ['enterprisePaymentAlipayNo', 'enterprisePaymentTid'];
1763
1767
  //数据唯一性校验提交数据组装
1764
1768
  export var getReplaceWarnValues = function getReplaceWarnValues(templateDetail, keyValues) {
1765
1769
  return templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.componentDtoList.reduce(function (prv, next) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/kmkf-work-order-service-component",
3
- "version": "0.21.4",
3
+ "version": "0.22.0-alpha.2",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
@@ -32,9 +32,9 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@ant-design/icons": "^4.7.0",
35
- "@kmkf-fe-packages/basic-components": "^0.21.4",
36
- "@kmkf-fe-packages/kmkf-utils": "^0.21.4",
37
- "@kmkf-fe-packages/services-components": "^0.21.4",
35
+ "@kmkf-fe-packages/basic-components": "^0.22.0-alpha.2",
36
+ "@kmkf-fe-packages/kmkf-utils": "^0.22.0-alpha.2",
37
+ "@kmkf-fe-packages/services-components": "^0.22.0-alpha.2",
38
38
  "@reduxjs/toolkit": "^1.8.5",
39
39
  "ahooks": "^3.7.4",
40
40
  "copy-to-clipboard": "^3.3.3",
@@ -74,7 +74,7 @@
74
74
  "publishConfig": {
75
75
  "access": "public"
76
76
  },
77
- "gitHead": "510c76d8426f214eb5653d9e75a59fa44e318939",
77
+ "gitHead": "4d837d058d55c1d265bc34262f9bcb9d44807cba",
78
78
  "gitHooks": {
79
79
  "pre-commit": "lint-staged"
80
80
  }