@kmkf-fe-packages/kmkf-work-order-service-component 0.29.2-rc.6 → 1.0.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.
package/README.md CHANGED
@@ -66,3 +66,4 @@ const Text = ()=>{
66
66
  ```
67
67
 
68
68
  | 字段 | 说明 | 数据类型 | | ----------------- | ---------------- | ------------------------------------ | | platform | 平台 | TAOBAO =淘宝\|FXG=抖音\|PDD=拼多多\| | | shopId | 店铺 ID | number | | buyerNick | 买家昵称 | string | | buyerId | 买家 id | string | | orderNo | 订单 id | string | | onEmpowerCallback | 授权弹框点击回调 | function |
69
+
@@ -28,7 +28,7 @@ import { get, some, set, every, cloneDeep, isEmpty, intersection, throttle } fro
28
28
  import 'moment/locale/zh-cn';
29
29
  import { calcWorkOrderList, orderBack, getReplaceWarnValues, COMPONENT_MAP_NAME, EXCLUDE_REPLACE_TOP_COMPONENT,
30
30
  // 重复检验不需要展示在顶部的
31
- INNER_REPLACE_COMPONENT, reversalFormValues, bsSystemOrderBackValues, wlnSystemOrderBackValues, getMappingConfigByTemplateDetail, wdtSystemOrderBackValues, setLogisticsInfo, COMPONENT_MAP } from "../../../common/utils/tools";
31
+ INNER_REPLACE_COMPONENT, reversalFormValues, bsSystemOrderBackValues, wlnSystemOrderBackValues, getMappingConfigByTemplateDetail, wdtSystemOrderBackValues, setLogisticsInfo } from "../../../common/utils/tools";
32
32
  import { replaceCheck, orderDetail } from "../../../model/servers/api";
33
33
  import { factory } from '@kmkf-fe-packages/services-components';
34
34
  import { getExpression, formatDisplayConfig, isNull } from '@kmkf-fe-packages/kmkf-utils';
@@ -179,7 +179,7 @@ var FormRender = function FormRender(props, ref) {
179
179
  var obj = {};
180
180
  Object.keys(params).forEach(function (key) {
181
181
  var _params$key;
182
- if (params[key] && typeof params[key] === 'string' && ((_params$key = params[key]) === null || _params$key === void 0 ? void 0 : _params$key.indexOf('*')) > -1) {
182
+ if (params[key] && ((_params$key = params[key]) === null || _params$key === void 0 ? void 0 : _params$key.indexOf('*')) > -1) {
183
183
  obj[key] = 0;
184
184
  }
185
185
  });
@@ -432,45 +432,8 @@ var FormRender = function FormRender(props, ref) {
432
432
  (antFormEl === null || antFormEl === void 0 ? void 0 : antFormEl.length) > 0 && set(antFormEl, '0.scrollTop', 0);
433
433
  resetMappdingHideComponents();
434
434
  };
435
- var repeatWarningDataSchema = function repeatWarningDataSchema(formValue, templateDetail) {
436
- var getKeyByValue = function getKeyByValue(value) {
437
- return Object.keys(COMPONENT_MAP).find(function (key) {
438
- return COMPONENT_MAP[key] === value;
439
- });
440
- };
441
- var needRepeatWarnComponent = Object.values(COMPONENT_MAP);
442
- return templateDetail.componentDtoList.reduce(function (cur, nxt) {
443
- if (needRepeatWarnComponent !== null && needRepeatWarnComponent !== void 0 && needRepeatWarnComponent.includes(nxt === null || nxt === void 0 ? void 0 : nxt.workOrderComponentType)) {
444
- var instance = factory(nxt.workOrderComponentType, {
445
- id: nxt.uniqueKey,
446
- name: nxt.name,
447
- componentConfig: nxt.componentConfig,
448
- effects: {},
449
- type: nxt.workOrderComponentType
450
- });
451
- var _id = instance === null || instance === void 0 ? void 0 : instance.id;
452
- var value = formValue[_id];
453
- var _key = getKeyByValue(nxt.workOrderComponentType);
454
- // TODO: 如果是订单号组件, 将值设置为orderNo
455
- if (nxt.workOrderComponentType === 'TRADE_ID_INPUT') {
456
- _key = 'orderNo';
457
- }
458
- if (_key) {
459
- cur[_key] = value;
460
- }
461
- }
462
- return cur;
463
- }, {});
464
- };
465
435
  useEffect(function () {
466
- if (isErpUse && templateDetail) {
467
- var formValue = form.getFieldsValue(true);
468
- console.debug('表单内容值', formValue);
469
- // TODO: 拼装需要重复提醒的组件数据格式
470
- var value = repeatWarningDataSchema(formValue, templateDetail);
471
- console.debug('重复提醒转换之后数据', value);
472
- return orderBackReplace(value, templateDetail);
473
- }
436
+ if (isErpUse) return;
474
437
  queryDetail({
475
438
  workOrderId: workOrderId,
476
439
  shopId: shopId,
@@ -480,7 +443,7 @@ var FormRender = function FormRender(props, ref) {
480
443
  buyerId: buyerId,
481
444
  buyerNick: buyerNick
482
445
  });
483
- }, [workOrderId, record, shopId, isErpUse, templateDetail]);
446
+ }, [workOrderId, record, shopId, isErpUse]);
484
447
 
485
448
  // 重置映射隐藏的组件, 目前只有单选、下拉组件可能会因为映射关系隐藏
486
449
  var resetMappdingHideComponents = function resetMappdingHideComponents() {
@@ -511,8 +474,8 @@ var FormRender = function FormRender(props, ref) {
511
474
 
512
475
  // 批量映射
513
476
  var batchFillByMapping = function batchFillByMapping(values) {
514
- for (var _key2 in values) {
515
- fillByMapping(_key2, values[_key2]);
477
+ for (var _key in values) {
478
+ fillByMapping(_key, values[_key]);
516
479
  }
517
480
  };
518
481
  // 组件映射
@@ -525,8 +488,8 @@ var FormRender = function FormRender(props, ref) {
525
488
  form.setFieldsValue(mapping === null || mapping === void 0 ? void 0 : mapping[triggerValue]);
526
489
  } else {
527
490
  var resetSet = new Set();
528
- for (var _key3 in mapping) {
529
- for (var uniqueKey in mapping[_key3]) {
491
+ for (var _key2 in mapping) {
492
+ for (var uniqueKey in mapping[_key2]) {
530
493
  resetSet.add(uniqueKey);
531
494
  }
532
495
  }
@@ -85,7 +85,7 @@ function ModifyModal(props) {
85
85
  var handleOk = function handleOk() {
86
86
  form.validateFields().then( /*#__PURE__*/function () {
87
87
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(values) {
88
- var _record$shopList$find;
88
+ var _shopList$find;
89
89
  var shopSource, newValue, api, shopId, shopName, _shopList, other, _yield$api, success;
90
90
  return _regeneratorRuntime().wrap(function _callee$(_context) {
91
91
  while (1) switch (_context.prev = _context.next) {
@@ -102,9 +102,9 @@ function ModifyModal(props) {
102
102
  message.error('支付宝姓名/账号都要填写');
103
103
  return _context.abrupt("return");
104
104
  case 5:
105
- shopSource = (_record$shopList$find = record.shopList.find(function (t) {
105
+ shopSource = (_shopList$find = shopList.find(function (t) {
106
106
  return t.shopId === record.shopId;
107
- })) === null || _record$shopList$find === void 0 ? void 0 : _record$shopList$find.shopSource;
107
+ })) === null || _shopList$find === void 0 ? void 0 : _shopList$find.shopSource;
108
108
  newValue = {};
109
109
  api = type === 'edit' ? editRemitOrder : addPaymentOrder;
110
110
  if (type === 'edit') {
@@ -189,11 +189,11 @@ function ModifyModal(props) {
189
189
  };
190
190
  }();
191
191
  var TidChangeHandle = function TidChangeHandle(e) {
192
- var _shopList$find;
192
+ var _shopList$find2;
193
193
  var order_no = e.target.value;
194
- var taobaoId = (_shopList$find = shopList.find(function (item) {
194
+ var taobaoId = (_shopList$find2 = shopList.find(function (item) {
195
195
  return item.shopSourceStr === 'TAOBAO' && item.shopId == platformInfo.shopId;
196
- })) === null || _shopList$find === void 0 ? void 0 : _shopList$find.taobaoId;
196
+ })) === null || _shopList$find2 === void 0 ? void 0 : _shopList$find2.taobaoId;
197
197
 
198
198
  //淘宝订单买家id返填
199
199
  if (taobaoId) {
@@ -286,7 +286,7 @@ export var submitDataTransOldFormat = function submitDataTransOldFormat(nowData,
286
286
  if (interceptCompany && !ExpressData.getInstance().getExpressNameByCode(interceptCompany, false)) {
287
287
  needTransForm = true;
288
288
  }
289
- var interceptValuesMap = ['interceptCompany', 'interceptCode', 'interceptSenderMobile', 'interceptType', 'interceptDetail', 'interceptReceiverName', 'interceptReceiverMobile', 'interceptLogisticsStatus', 'interceptLogisticsStatusOther', 'interceptLogisticsSnapshot', 'qySelfInterceptLogisticsStatus'];
289
+ var interceptValuesMap = ['interceptCompany', 'interceptCode', 'interceptSenderMobile', 'interceptType', 'interceptDetail', 'interceptReceiverName', 'interceptReceiverMobile', 'interceptLogisticsStatus', 'interceptLogisticsStatusOther', 'interceptLogisticsSnapshot'];
290
290
  interceptValuesMap.forEach(function (t) {
291
291
  contentVoList.push({
292
292
  uniqueKey: "".concat(item.uniqueKey, "_").concat(t),
@@ -936,8 +936,7 @@ export var submitDataTransOldFormat = function submitDataTransOldFormat(nowData,
936
936
  WDT_REISSUE_GOODS: {
937
937
  type: 'wdtReissueType',
938
938
  goods: 'wdtReissueGoods',
939
- shopCode: 'shopCode',
940
- systemOrderNo: 'wdtSystemOrderNo'
939
+ shopCode: 'shopCode'
941
940
  }
942
941
  };
943
942
  var reissue = get(nowData, "".concat(item.uniqueKey), {});
@@ -956,13 +955,6 @@ export var submitDataTransOldFormat = function submitDataTransOldFormat(nowData,
956
955
  content: (reissue === null || reissue === void 0 ? void 0 : reissue.shopCode) || '',
957
956
  name: item.name
958
957
  });
959
- if (item.workOrderComponentType === 'WDT_REISSUE_GOODS') {
960
- contentVoList.push({
961
- uniqueKey: "".concat(item.uniqueKey, "_").concat(reissueMap[item.workOrderComponentType].systemOrderNo),
962
- content: (reissue === null || reissue === void 0 ? void 0 : reissue[reissueMap[item.workOrderComponentType].systemOrderNo]) || '',
963
- name: item.name
964
- });
965
- }
966
958
  } else if (item.workOrderComponentType === 'BS_RETURN_GOODS') {
967
959
  var bsReturn = get(nowData, "".concat(item.uniqueKey), {});
968
960
  contentVoList.push({
@@ -1303,8 +1295,7 @@ var transDataSource = function transDataSource(templateColumns) {
1303
1295
  interceptReceiverMobile: item.jsonMap["".concat(nex.uniqueKey, "_interceptReceiverMobile")],
1304
1296
  interceptLogisticsStatus: item.jsonMap["".concat(nex.uniqueKey, "_interceptLogisticsStatus")],
1305
1297
  interceptLogisticsStatusOther: item.jsonMap["".concat(nex.uniqueKey, "_interceptLogisticsStatusOther")],
1306
- interceptLogisticsSnapshot: item.jsonMap["".concat(nex.uniqueKey, "_interceptLogisticsSnapshot")],
1307
- qySelfInterceptLogisticsStatus: item.jsonMap["".concat(nex.uniqueKey, "_qySelfInterceptLogisticsStatus")]
1298
+ interceptLogisticsSnapshot: item.jsonMap["".concat(nex.uniqueKey, "_interceptLogisticsSnapshot")]
1308
1299
  }));
1309
1300
  } else if (nex.workOrderComponentType === 'LOGISTICS_INTERCEPTION_MORE') {
1310
1301
  return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), jsonParseSecurity(item.jsonMap["".concat(nex.uniqueKey, "_logisticsInterceptList")], [{}])));
@@ -1607,8 +1598,7 @@ var transDataSource = function transDataSource(templateColumns) {
1607
1598
  return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), {
1608
1599
  wdtReissueType: jsonParseSecurity(item.jsonMap["".concat(nex.uniqueKey, "_wdtReissueType")], []),
1609
1600
  wdtReissueGoods: jsonParseSecurity(item.jsonMap["".concat(nex.uniqueKey, "_wdtReissueGoods")], []),
1610
- shopCode: item.jsonMap["".concat(nex.uniqueKey, "_shopCode")],
1611
- wdtSystemOrderNo: item.jsonMap["".concat(nex.uniqueKey, "_wdtSystemOrderNo")]
1601
+ shopCode: item.jsonMap["".concat(nex.uniqueKey, "_shopCode")]
1612
1602
  }));
1613
1603
  }
1614
1604
  }, {});
@@ -1631,7 +1621,7 @@ export var calcWorkOrderList = function calcWorkOrderList(source, templateColumn
1631
1621
  //订单返填
1632
1622
  export var orderBack = /*#__PURE__*/function () {
1633
1623
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
1634
- var order_no, form, shopId, shopList, templateDetail, _ref$type, type, callback, fromQNCreateWorkOrderByOrderNo, _ref$plat, plat, JOIN_SHOP, hasBs, hasWdt, hasWln, _ref3, shopSourceStr, _ref3$thirdUserNick, thirdUserNick, _data$value, _jstOrder$value, _jstOrder$value$data, _bsOrder$value, _wlnOrder$value, _wdtOrder$value, _bsOrders$orders, _wlnOrders$orders, _wdtOrders$orders, promise, hasJst, _yield$Promise$allSet, _yield$Promise$allSet2, data, jstOrder, bsOrder, wlnOrder, wdtOrder, orderInfo, jstInfo, bsOrders, wlnOrders, wdtOrders, bsInfo, wlnInfo, wdtInfo, formValue, detail, hasSelectItem, erpPromiseList, list, promises, _detail$itemList, values, _templateDetail$compo, paymentUniqueKey, cacheOrderInfo, _objectSpread55, _cacheOrderInfo;
1624
+ var order_no, form, shopId, shopList, templateDetail, _ref$type, type, callback, fromQNCreateWorkOrderByOrderNo, _ref$plat, plat, JOIN_SHOP, hasBs, hasWdt, hasWln, _ref3, shopSourceStr, _ref3$thirdUserNick, thirdUserNick, _data$value, _jstOrder$value, _jstOrder$value$data, _bsOrder$value, _wlnOrder$value, _wdtOrder$value, _bsOrders$orders, _wlnOrders$orders, promise, hasJst, _yield$Promise$allSet, _yield$Promise$allSet2, data, jstOrder, bsOrder, wlnOrder, wdtOrder, orderInfo, jstInfo, bsOrders, wlnOrders, wdtOrders, bsInfo, wlnInfo, wdtInfo, formValue, detail, hasSelectItem, erpPromiseList, list, promises, _detail$itemList, values, _templateDetail$compo, paymentUniqueKey, cacheOrderInfo, _objectSpread55, _cacheOrderInfo;
1635
1625
  return _regeneratorRuntime().wrap(function _callee$(_context) {
1636
1626
  while (1) switch (_context.prev = _context.next) {
1637
1627
  case 0:
@@ -1776,20 +1766,15 @@ export var orderBack = /*#__PURE__*/function () {
1776
1766
  sendName: ''
1777
1767
  }];
1778
1768
  }
1779
- if ((wdtOrders === null || wdtOrders === void 0 ? void 0 : (_wdtOrders$orders = wdtOrders.orders) === null || _wdtOrders$orders === void 0 ? void 0 : _wdtOrders$orders.length) > 1) {
1780
- wdtInfo.wdtGoods = _objectSpread(_objectSpread({}, wdtInfo.wdtGoods), {}, {
1781
- wdtGoods: []
1782
- });
1783
- wdtInfo.wdtLogistics = [{
1784
- logisticsCompany: null,
1785
- logisticsCode: ''
1786
- }];
1787
- wdtInfo.wdtSendGood = [{
1788
- sendId: '',
1789
- sendName: ''
1790
- }];
1791
- // wdtInfo.wdtDeliveryNo = [{ deliveryNo: '' }];
1792
- }
1769
+ // if (wdtOrders?.orders?.length > 1) {
1770
+ // wdtInfo.bsGoods = {
1771
+ // ...wdtInfo.bsGoods,
1772
+ // bsGoods: [],
1773
+ // };
1774
+ // wdtInfo.bsLogistics = [{ logisticsCompany: null, logisticsCode: '' }];
1775
+ // wdtInfo.bsSendGood = [{ sendId: '', sendName: '' }];
1776
+ // wdtInfo.bsDeliveryNo = [{ deliveryNo: '' }];
1777
+ // }
1793
1778
 
1794
1779
  //获取当前表单字段
1795
1780
  formValue = form.getFieldsValue();
@@ -1808,7 +1793,7 @@ export var orderBack = /*#__PURE__*/function () {
1808
1793
  hasSelectItem = HasErpItemSelectHandle(templateDetail);
1809
1794
  erpPromiseList = [];
1810
1795
  if (!(shopSourceStr === 'TAOBAO' && hasSelectItem)) {
1811
- _context.next = 56;
1796
+ _context.next = 55;
1812
1797
  break;
1813
1798
  }
1814
1799
  list = detail['itemList'];
@@ -1826,10 +1811,10 @@ export var orderBack = /*#__PURE__*/function () {
1826
1811
  resolve({});
1827
1812
  });
1828
1813
  });
1829
- _context.prev = 46;
1830
- _context.next = 49;
1814
+ _context.prev = 45;
1815
+ _context.next = 48;
1831
1816
  return Promise.all(promises);
1832
- case 49:
1817
+ case 48:
1833
1818
  erpPromiseList = _context.sent;
1834
1819
  detail['itemList'] = (_detail$itemList = detail['itemList']) === null || _detail$itemList === void 0 ? void 0 : _detail$itemList.map(function (item, index) {
1835
1820
  return _objectSpread(_objectSpread({}, item), {}, {
@@ -1839,13 +1824,13 @@ export var orderBack = /*#__PURE__*/function () {
1839
1824
  })
1840
1825
  });
1841
1826
  });
1842
- _context.next = 56;
1827
+ _context.next = 55;
1843
1828
  break;
1844
- case 53:
1845
- _context.prev = 53;
1846
- _context.t0 = _context["catch"](46);
1829
+ case 52:
1830
+ _context.prev = 52;
1831
+ _context.t0 = _context["catch"](45);
1847
1832
  console.error('调用erp获取宝贝编码错误', _context.t0);
1848
- case 56:
1833
+ case 55:
1849
1834
  // console.log('detail', detail);
1850
1835
  values = orderBackFormValues({
1851
1836
  detail: detail,
@@ -1876,17 +1861,17 @@ export var orderBack = /*#__PURE__*/function () {
1876
1861
  // console.log('orderback', values);
1877
1862
  form.setFieldsValue(_objectSpread(_objectSpread({}, formValue), values));
1878
1863
  callback === null || callback === void 0 ? void 0 : callback(detail, templateDetail);
1879
- _context.next = 65;
1864
+ _context.next = 64;
1880
1865
  break;
1881
- case 62:
1882
- _context.prev = 62;
1866
+ case 61:
1867
+ _context.prev = 61;
1883
1868
  _context.t1 = _context["catch"](8);
1884
1869
  console.error(_context.t1);
1885
- case 65:
1870
+ case 64:
1886
1871
  case "end":
1887
1872
  return _context.stop();
1888
1873
  }
1889
- }, _callee, null, [[8, 62], [46, 53]]);
1874
+ }, _callee, null, [[8, 61], [45, 52]]);
1890
1875
  }));
1891
1876
  return function orderBack(_x) {
1892
1877
  return _ref2.apply(this, arguments);
@@ -2297,7 +2282,7 @@ export var wdtSystemOrderBackValues = function wdtSystemOrderBackValues(_ref8) {
2297
2282
  //如果没有选择的值不返填,会有两种情况 1.有值为空 2.没有值 为空的时候需要返填
2298
2283
  if (!(value !== null && value !== void 0 && value.selectedRows)) return;
2299
2284
  var wdtGoodsComponent = (_templateList$compone3 = templateList.componentDtoList) === null || _templateList$compone3 === void 0 ? void 0 : _templateList$compone3.filter(function (item) {
2300
- return ['WDT_GOODS', 'WDT_DELIVERY_NO', 'WDT_SEND_GOOD', 'WDT_LOGISTICS'].includes(item.workOrderComponentType) && !item.notOrderBack;
2285
+ return ['WDT_GOODS', 'WDT_DELIVERY_NO', 'WDT_SEND_GOOD', 'WDT_LOGISTICS'].includes(item.workOrderComponentType);
2301
2286
  });
2302
2287
  if (!(wdtGoodsComponent !== null && wdtGoodsComponent !== void 0 && wdtGoodsComponent.length)) return;
2303
2288
  var wdtGoodsValue = form.getFieldValue(wdtGoodsComponent[0].uniqueKey);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/kmkf-work-order-service-component",
3
- "version": "0.29.2-rc.6",
3
+ "version": "1.0.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.29.2-rc.0",
36
- "@kmkf-fe-packages/kmkf-utils": "^0.29.2-rc.0",
37
- "@kmkf-fe-packages/services-components": "^0.29.2-rc.0",
35
+ "@kmkf-fe-packages/basic-components": "^1.0.0",
36
+ "@kmkf-fe-packages/kmkf-utils": "^1.0.0",
37
+ "@kmkf-fe-packages/services-components": "^1.0.0",
38
38
  "@reduxjs/toolkit": "^1.8.5",
39
39
  "ahooks": "^3.7.4",
40
40
  "copy-to-clipboard": "^3.3.3",
@@ -73,7 +73,7 @@
73
73
  "publishConfig": {
74
74
  "access": "public"
75
75
  },
76
- "gitHead": "419c7447da06c025cc9dddf9f7cf9f844581efe5",
76
+ "gitHead": "54173aeb0947642595d098bff2526c29ccb5a54f",
77
77
  "gitHooks": {
78
78
  "pre-commit": "lint-staged"
79
79
  }