@kmkf-fe-packages/basic-components 2.10.24 → 2.10.25

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/dist/index.esm.js CHANGED
@@ -3,7 +3,7 @@ import { Cascader, DatePicker, Image, InputNumber, Input, Select, Upload, messag
3
3
  import { EyeOutlined, DeleteOutlined, CloseOutlined, PlusSquareOutlined, MinusCircleFilled, PlusCircleFilled, CopyOutlined, CloseCircleOutlined, CaretUpOutlined, UpOutlined, DownOutlined, PlusOutlined, VideoCameraTwoTone } from '@ant-design/icons';
4
4
  import request, { extend as extend$1 } from 'umi-request';
5
5
  import { CopyToClipboard } from 'react-copy-to-clipboard';
6
- import { AddressData, BsAddressData, WdtAddressData, GyAddressData, JstAddressData, request as request$1, ExpressData, isNull, imgResize, uuid, normalizeYouzanStar, servers, columnsGoodsList, LogisticsAddressData, SendDataCenter, kmSkuTypeMap, hasAddNullComponent, SUBMIT_TIME_ID, UPGRADE_TIME_ID, FINAL_TIME_ID, CUSTOM_TIME_ID, useStatus, finalFormData, transformList, dataSourceTrans, DATA_SPLIT_COMPONENT_FIELDS_MAP, findLabelBySelectValue, BS_E3_BOOLEAN_STATUS_MAP, DxdSuppliersData, filterWdtOrders, WDT_ORDER_TYPE_MAP, tradeStatusMap, warehouseTypeMap, filterBsE3Orders, filterGyOrders, GY_DELIVERY_STATE_MAPPING, filterJstOrders, filterJyOrders, JY_ORDER_TYPE_MAP, JY_ORDER_STATUS_MAP, filterJkyOrders, JKY_ORDER_FROM_MAP, JKY_ORDER_TYPE_MAP, JKY_ORDER_STATUS_MAP, getJkyLogisticInfo, filterKmOrders, getSystemShowHead, getIsPlatformCodesIncludeOrderNos, BS_SYSTEM_ORDER_CONFIG, KM_SYSTEM_ORDER_CONFIG, WLN_SYSTEM_ORDER_CONFIG, WDT_SYSTEM_ORDER_CONFIG, BS_E3_SYSTEM_ORDER_CONFIG, GY_SYSTEM_ORDER_CONFIG, JST_SYSTEM_ORDER_CONFIG, JY_SYSTEM_ORDER_CONFIG, JKY_SYSTEM_ORDER_CONFIG, WDT_RETURN_BILL_NO_CONFIG, PLATFORM_AFTER_SALES_ORDER_CONFIG, DXD_SYSTEM_ORDER_CONFIG, TTX_SYSTEM_ORDER_CONFIG, BS_E3_ORDER_STATUS_MAP, KM_ORDER_TYPE_MAP, KM_ORDER_STATUS, TTX_INTERNAL_ORDER_TYPE_MAP, TTX_STATUS_MAP, updateOrderSubFormGoodsHandle, updateWlnGoodsHandle, updateWdtGoodsHandle, updateBsE3GoodsHandle, updateGyGoodsHandle, updateJstGoodsHandle, updateKmGoodsHandle, updateJyGoodsHandle, updateJkyGoodsHandle, updateDxdGoodsHandle, updateTtxGoodsHandle, updateWdtAftersaleGoodsHandle, jstMergeIdenticalGoods, msgTypeCh, pushGyLog, skxSystemOrderBackValues, skxReturnSystemOrderBackValues, formatTrade, updateSkxGoodsHandle, formatReturnTrade, updateSkxReturnGoodsHandle } from '@kmkf-fe-packages/kmkf-utils';
6
+ import { AddressData, BsAddressData, WdtAddressData, GyAddressData, JstAddressData, request as request$1, ExpressData, isNull, imgResize, uuid, normalizeYouzanStar, servers, columnsGoodsList, LogisticsAddressData, isJdLogisticsCompany, getJdCustomerCodeOptions, SendDataCenter, kmSkuTypeMap, hasAddNullComponent, SUBMIT_TIME_ID, UPGRADE_TIME_ID, FINAL_TIME_ID, CUSTOM_TIME_ID, useStatus, finalFormData, transformList, dataSourceTrans, DATA_SPLIT_COMPONENT_FIELDS_MAP, findLabelBySelectValue, BS_E3_BOOLEAN_STATUS_MAP, DxdSuppliersData, filterWdtOrders, WDT_ORDER_TYPE_MAP, tradeStatusMap, warehouseTypeMap, filterBsE3Orders, filterGyOrders, GY_DELIVERY_STATE_MAPPING, filterJstOrders, filterJyOrders, JY_ORDER_TYPE_MAP, JY_ORDER_STATUS_MAP, filterJkyOrders, JKY_ORDER_FROM_MAP, JKY_ORDER_TYPE_MAP, JKY_ORDER_STATUS_MAP, getJkyLogisticInfo, filterKmOrders, getSystemShowHead, getIsPlatformCodesIncludeOrderNos, BS_SYSTEM_ORDER_CONFIG, KM_SYSTEM_ORDER_CONFIG, WLN_SYSTEM_ORDER_CONFIG, WDT_SYSTEM_ORDER_CONFIG, BS_E3_SYSTEM_ORDER_CONFIG, GY_SYSTEM_ORDER_CONFIG, JST_SYSTEM_ORDER_CONFIG, JY_SYSTEM_ORDER_CONFIG, JKY_SYSTEM_ORDER_CONFIG, WDT_RETURN_BILL_NO_CONFIG, PLATFORM_AFTER_SALES_ORDER_CONFIG, DXD_SYSTEM_ORDER_CONFIG, TTX_SYSTEM_ORDER_CONFIG, BS_E3_ORDER_STATUS_MAP, KM_ORDER_TYPE_MAP, KM_ORDER_STATUS, TTX_INTERNAL_ORDER_TYPE_MAP, TTX_STATUS_MAP, updateOrderSubFormGoodsHandle, updateWlnGoodsHandle, updateWdtGoodsHandle, updateBsE3GoodsHandle, updateGyGoodsHandle, updateJstGoodsHandle, updateKmGoodsHandle, updateJyGoodsHandle, updateJkyGoodsHandle, updateDxdGoodsHandle, updateTtxGoodsHandle, updateWdtAftersaleGoodsHandle, jstMergeIdenticalGoods, msgTypeCh, pushGyLog, skxSystemOrderBackValues, skxReturnSystemOrderBackValues, formatTrade, updateSkxGoodsHandle, formatReturnTrade, updateSkxReturnGoodsHandle } from '@kmkf-fe-packages/kmkf-utils';
7
7
  import every from 'lodash/every';
8
8
  import maxBy from 'lodash/maxBy';
9
9
  import { debounce, isNaN as isNaN$1, isNumber as isNumber$1, uniqBy, cloneDeep, difference, differenceWith, isBoolean, isEqual, takeRight, reject as reject$1, intersection, isEmpty } from 'lodash';
@@ -8635,7 +8635,7 @@ var processLogisticsInterception = function processLogisticsInterception(getValu
8635
8635
  address = every(address, function (item) {
8636
8636
  return !item;
8637
8637
  }) ? [] : address;
8638
- var subFields = ['interceptCompany', 'interceptCode', 'interceptType', 'interceptSenderMobile', 'interceptDetail', 'interceptReceiverName', 'interceptReceiverMobile', 'interceptLogisticsStatus', 'interceptLogisticsStatusOther', 'interceptLogisticsSnapshot', 'qySelfInterceptLogisticsStatus', 'interceptLogisticsUserKCode', 'interceptLogisticsUserSecretKey'];
8638
+ var subFields = ['interceptCompany', 'interceptCode', 'interceptType', 'interceptSenderMobile', 'interceptDetail', 'interceptReceiverName', 'interceptReceiverMobile', 'interceptLogisticsStatus', 'interceptLogisticsStatusOther', 'interceptLogisticsSnapshot', 'qySelfInterceptLogisticsStatus', 'interceptLogisticsUserKCode', 'interceptLogisticsUserSecretKey', 'interceptLogisticsCustomerCode'];
8639
8639
  var map = subFields.reduce(function (cur, nxt) {
8640
8640
  return _objectSpread2(_objectSpread2({}, cur), {}, _defineProperty({}, nxt, getValue("".concat(nex.uniqueKey, "_").concat(nxt))));
8641
8641
  }, {});
@@ -13536,7 +13536,6 @@ var Item = Form.Item;
13536
13536
  var LogisticsInterception = function LogisticsInterception(props) {
13537
13537
  var _value$interceptLogis3, _value$interceptLogis4, _value$interceptLogis5;
13538
13538
  var LogisticsAddress = LogisticsAddressData.getInstance();
13539
- var LogisticsAddressOptions = (LogisticsAddress === null || LogisticsAddress === void 0 ? void 0 : LogisticsAddress.getAddressData()) || [];
13540
13539
  var address = AddressData.getInstance();
13541
13540
  var _props$value = props.value,
13542
13541
  value = _props$value === void 0 ? {} : _props$value,
@@ -13574,6 +13573,12 @@ var LogisticsInterception = function LogisticsInterception(props) {
13574
13573
  _useState8 = _slicedToArray(_useState7, 2),
13575
13574
  isInterface = _useState8[0],
13576
13575
  setIsInterface = _useState8[1];
13576
+ var _useState9 = useState(function () {
13577
+ return (LogisticsAddress === null || LogisticsAddress === void 0 ? void 0 : LogisticsAddress.getAddressData()) || [];
13578
+ }),
13579
+ _useState10 = _slicedToArray(_useState9, 2),
13580
+ logisticsAddressData = _useState10[0],
13581
+ setLogisticsAddressData = _useState10[1];
13577
13582
  useEffect(function () {
13578
13583
  if (!(value === null || value === void 0 ? void 0 : value.interceptCompany)) {
13579
13584
  setTypeOptions([]);
@@ -13588,6 +13593,13 @@ var LogisticsInterception = function LogisticsInterception(props) {
13588
13593
  setStatusOptions((interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.logisticsStatusList) || []);
13589
13594
  setIsInterface(interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.isInterface);
13590
13595
  }, [value === null || value === void 0 ? void 0 : value.interceptCompany]);
13596
+ useEffect(function () {
13597
+ if (!isJdLogisticsCompany(value === null || value === void 0 ? void 0 : value.interceptCompany) && (value === null || value === void 0 ? void 0 : value.interceptLogisticsCustomerCode) !== undefined) {
13598
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, {
13599
+ interceptLogisticsCustomerCode: undefined
13600
+ }));
13601
+ }
13602
+ }, [value === null || value === void 0 ? void 0 : value.interceptCompany, value === null || value === void 0 ? void 0 : value.interceptLogisticsCustomerCode]);
13591
13603
  //拦截类型切换 需要清空派送地址
13592
13604
  useEffect(function () {
13593
13605
  if (!(value === null || value === void 0 ? void 0 : value.interceptCompany)) return;
@@ -13650,6 +13662,9 @@ var LogisticsInterception = function LogisticsInterception(props) {
13650
13662
  }
13651
13663
  return isShow;
13652
13664
  }, [value === null || value === void 0 ? void 0 : value.interceptCompany]);
13665
+ var showCustomerCode = useMemo(function () {
13666
+ return isJdLogisticsCompany(value === null || value === void 0 ? void 0 : value.interceptCompany);
13667
+ }, [value === null || value === void 0 ? void 0 : value.interceptCompany]);
13653
13668
  //判断是否能修改物流信息
13654
13669
  var isEdit = useMemo(function () {
13655
13670
  var company = expressInterceptData.find(function (item) {
@@ -13661,13 +13676,13 @@ var LogisticsInterception = function LogisticsInterception(props) {
13661
13676
  var baseFieldDisabled = disabled || isEdit && !canEditPreCreateBaseFields;
13662
13677
  //退回地址列表
13663
13678
  var logisticsAddressOptions = useMemo(function () {
13664
- return LogisticsAddressOptions === null || LogisticsAddressOptions === void 0 ? void 0 : LogisticsAddressOptions.filter(function (item) {
13679
+ return logisticsAddressData === null || logisticsAddressData === void 0 ? void 0 : logisticsAddressData.filter(function (item) {
13665
13680
  return item.cpCode === (value === null || value === void 0 ? void 0 : value.interceptCompany);
13666
13681
  });
13667
- }, [value === null || value === void 0 ? void 0 : value.interceptCompany]);
13682
+ }, [logisticsAddressData, value === null || value === void 0 ? void 0 : value.interceptCompany]);
13668
13683
  // K码列表
13669
13684
  var kCodeList = useMemo(function () {
13670
- return LogisticsAddressOptions === null || LogisticsAddressOptions === void 0 ? void 0 : LogisticsAddressOptions.filter(function (item) {
13685
+ return logisticsAddressData === null || logisticsAddressData === void 0 ? void 0 : logisticsAddressData.filter(function (item) {
13671
13686
  return item.cpCode === (value === null || value === void 0 ? void 0 : value.interceptCompany) && item.userKCode;
13672
13687
  }).map(function (item) {
13673
13688
  return _objectSpread2(_objectSpread2({}, item), {}, {
@@ -13675,7 +13690,44 @@ var LogisticsInterception = function LogisticsInterception(props) {
13675
13690
  label: item === null || item === void 0 ? void 0 : item.userKCode
13676
13691
  });
13677
13692
  });
13678
- }, [value === null || value === void 0 ? void 0 : value.interceptCompany]);
13693
+ }, [logisticsAddressData, value === null || value === void 0 ? void 0 : value.interceptCompany]);
13694
+ var customerCodeOptions = useMemo(function () {
13695
+ return getJdCustomerCodeOptions(logisticsAddressData);
13696
+ }, [logisticsAddressData]);
13697
+ var refreshLogisticsAddressOptions = /*#__PURE__*/function () {
13698
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
13699
+ var _yield$request, data, latestData;
13700
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
13701
+ while (1) switch (_context.prev = _context.next) {
13702
+ case 0:
13703
+ _context.prev = 0;
13704
+ _context.next = 3;
13705
+ return request$1({
13706
+ url: '/qy/userConfig/listLogisticsAddress',
13707
+ method: 'get',
13708
+ data: {}
13709
+ });
13710
+ case 3:
13711
+ _yield$request = _context.sent;
13712
+ data = _yield$request.data;
13713
+ latestData = data || [];
13714
+ LogisticsAddress.setaddressData(latestData);
13715
+ setLogisticsAddressData(latestData);
13716
+ _context.next = 12;
13717
+ break;
13718
+ case 10:
13719
+ _context.prev = 10;
13720
+ _context.t0 = _context["catch"](0);
13721
+ case 12:
13722
+ case "end":
13723
+ return _context.stop();
13724
+ }
13725
+ }, _callee, null, [[0, 10]]);
13726
+ }));
13727
+ return function refreshLogisticsAddressOptions() {
13728
+ return _ref.apply(this, arguments);
13729
+ };
13730
+ }();
13679
13731
  var returnValue = useMemo(function () {
13680
13732
  var _value$interceptAddre, _value$interceptAddre2, _value$interceptAddre3;
13681
13733
  var uk = LogisticsAddress === null || LogisticsAddress === void 0 ? void 0 : LogisticsAddress.getUkByInfo({
@@ -13731,9 +13783,6 @@ var LogisticsInterception = function LogisticsInterception(props) {
13731
13783
  // userSecretKey: '12345678',
13732
13784
  // },
13733
13785
  // ];
13734
- var matchKCodeList = LogisticsAddressOptions === null || LogisticsAddressOptions === void 0 ? void 0 : LogisticsAddressOptions.filter(function (item) {
13735
- return item.cpCode === val && item.userKCode;
13736
- });
13737
13786
  newValue = _objectSpread2(_objectSpread2({}, newValue), {}, {
13738
13787
  interceptCompany: val,
13739
13788
  interceptType: (_defaultInterceptType = defaultInterceptType) === null || _defaultInterceptType === void 0 ? void 0 : _defaultInterceptType.value,
@@ -13752,7 +13801,8 @@ var LogisticsInterception = function LogisticsInterception(props) {
13752
13801
  },
13753
13802
  interceptLogisticsApiStatusReason: undefined,
13754
13803
  interceptLogisticsUserKCode: undefined,
13755
- interceptLogisticsUserSecretKey: undefined
13804
+ interceptLogisticsUserSecretKey: undefined,
13805
+ interceptLogisticsCustomerCode: undefined
13756
13806
  });
13757
13807
  }
13758
13808
  if (type === 'interceptLogisticsApiStatus') {
@@ -13832,7 +13882,41 @@ var LogisticsInterception = function LogisticsInterception(props) {
13832
13882
  return _onBlur === null || _onBlur === void 0 ? void 0 : _onBlur((_e$target$value2 = e.target.value) === null || _e$target$value2 === void 0 ? void 0 : _e$target$value2.trim(), 'interceptCode');
13833
13883
  },
13834
13884
  value: value === null || value === void 0 ? void 0 : value.interceptCode
13835
- }))), /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Item, {
13885
+ }))), /*#__PURE__*/React.createElement(Item, {
13886
+ label: /*#__PURE__*/React.createElement("span", null, "\u5BA2\u6237\u7F16\u7801", platform === 'pc' ? /*#__PURE__*/React.createElement(React.Fragment, null, "\uFF1A", /*#__PURE__*/React.createElement(Typography.Link, {
13887
+ style: {
13888
+ cursor: 'pointer'
13889
+ },
13890
+ onClick: function onClick() {
13891
+ return onJumpPage && (onJumpPage === null || onJumpPage === void 0 ? void 0 : onJumpPage({
13892
+ type: 'interceptConfig',
13893
+ state: {
13894
+ tab: 'JDLCodeRelation'
13895
+ }
13896
+ }));
13897
+ }
13898
+ }, 'K码/EBU码配置>>')) : null),
13899
+ required: showCustomerCode,
13900
+ key: 'interceptLogisticsCustomerCode',
13901
+ hidden: !showCustomerCode
13902
+ }, /*#__PURE__*/React.createElement(Select, {
13903
+ disabled: disabled,
13904
+ placeholder: "\u9009\u62E9\u5BA2\u6237\u7F16\u7801",
13905
+ notFoundContent: "\u6682\u65E0\u5BA2\u6237\u7F16\u7801\u914D\u7F6E\uFF0C\u8BF7\u5148\u524D\u5F80K\u7801/EBU\u7801\u914D\u7F6E>>",
13906
+ showSearch: true,
13907
+ style: {
13908
+ width: '200px'
13909
+ },
13910
+ onChange: function onChange(val) {
13911
+ return changeHandle(val, 'interceptLogisticsCustomerCode');
13912
+ },
13913
+ onFocus: refreshLogisticsAddressOptions,
13914
+ options: customerCodeOptions,
13915
+ value: value === null || value === void 0 ? void 0 : value.interceptLogisticsCustomerCode,
13916
+ filterOption: function filterOption(input, option) {
13917
+ return option.label.includes(input);
13918
+ }
13919
+ })), /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Item, {
13836
13920
  label: /*#__PURE__*/React.createElement("span", null, "\u5BA2\u6237\u7F16\u7801\uFF08K\u7801\uFF09\uFF1A", platform === 'pc' ? /*#__PURE__*/React.createElement(Typography.Link, {
13837
13921
  style: {
13838
13922
  cursor: 'pointer'
@@ -13877,7 +13961,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
13877
13961
  value: value === null || value === void 0 ? void 0 : value.interceptLogisticsUserSecretKey
13878
13962
  }))), /*#__PURE__*/React.createElement(Item, {
13879
13963
  label: '拦截类型',
13880
- required: required,
13964
+ required: required && !showCustomerCode,
13881
13965
  key: 'interceptType'
13882
13966
  }, /*#__PURE__*/React.createElement(Select, {
13883
13967
  disabled: baseFieldDisabled,
@@ -19,6 +19,7 @@ interface LogisticsInterceptionValueType {
19
19
  interceptLogisticsApiStatusReason: string;
20
20
  interceptLogisticsUserKCode: string;
21
21
  interceptLogisticsUserSecretKey: string;
22
+ interceptLogisticsCustomerCode: string;
22
23
  }
23
24
  interface LogisticsInterceptionProps {
24
25
  value: Partial<LogisticsInterceptionValueType>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/basic-components",
3
- "version": "2.10.24",
3
+ "version": "2.10.25",
4
4
  "description": "> TODO: description",
5
5
  "homepage": "",
6
6
  "license": "ISC",
@@ -20,7 +20,7 @@
20
20
  "watch": "nodemon --ignore dist/ --ignore node_modules/ --watch src/ -C -e ts,tsx,less --debug -x 'yarn async'"
21
21
  },
22
22
  "dependencies": {
23
- "@kmkf-fe-packages/kmkf-utils": "2.10.24",
23
+ "@kmkf-fe-packages/kmkf-utils": "2.10.25",
24
24
  "ahooks": "^3.7.4",
25
25
  "ali-react-table": "2.6.1",
26
26
  "bignumber.js": "^9.1.2",
@@ -66,5 +66,5 @@
66
66
  "publishConfig": {
67
67
  "access": "public"
68
68
  },
69
- "gitHead": "44324b6b5ad4fdab5f2b2c8f9636860f687e1b4f"
69
+ "gitHead": "aa3cb81f3a8cd8e70b2c6d602e12fdff2b5887f4"
70
70
  }