@kmkf-fe-packages/basic-components 1.4.0-rc.0 → 1.4.0

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.js CHANGED
@@ -12,7 +12,6 @@ var zhCN = require('antd/lib/locale/zh_CN');
12
12
  var lodash = require('lodash');
13
13
  var ahooks = require('ahooks');
14
14
  var pubsub = require('pubsub-js');
15
- var BigNumber = require('bignumber.js');
16
15
 
17
16
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
18
17
 
@@ -20,7 +19,6 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
20
19
  var request__default = /*#__PURE__*/_interopDefaultLegacy(request);
21
20
  var zhCN__default = /*#__PURE__*/_interopDefaultLegacy(zhCN);
22
21
  var pubsub__default = /*#__PURE__*/_interopDefaultLegacy(pubsub);
23
- var BigNumber__default = /*#__PURE__*/_interopDefaultLegacy(BigNumber);
24
22
 
25
23
  function _iterableToArrayLimit(r, l) {
26
24
  var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
@@ -10457,7 +10455,7 @@ var jstGoods = function jstGoods(props) {
10457
10455
  var wdtSendOptions = kmkfUtils.WdtSendData.getInstance().wdtSendData || [];
10458
10456
  React.useEffect(function () {
10459
10457
  //没有值塞个默认值
10460
- if (!(value === null || value === void 0 ? void 0 : value.length) && type !== 1) {
10458
+ if (!(value === null || value === void 0 ? void 0 : value.length)) {
10461
10459
  onChange === null || onChange === void 0 ? void 0 : onChange(typeInitValueMap[type]);
10462
10460
  }
10463
10461
  }, [value, type]);
@@ -10520,7 +10518,7 @@ var jstGoods = function jstGoods(props) {
10520
10518
  return setChangeIndex(index);
10521
10519
  }
10522
10520
  }, "\u5305\u88F9".concat(index + 1)));
10523
- }))) : null, value.length || type === 1 ? /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, type === 1 ? /*#__PURE__*/React__default['default'].createElement(antd.Space, null, !showField || showField === 'logisticsCompany' ? /*#__PURE__*/React__default['default'].createElement(ApaasLogistics, {
10521
+ }))) : null, value.length ? /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, type === 1 ? /*#__PURE__*/React__default['default'].createElement(antd.Space, null, !showField || showField === 'logisticsCompany' ? /*#__PURE__*/React__default['default'].createElement(ApaasLogistics, {
10524
10522
  disabled: disabled,
10525
10523
  placeholder: "\u7269\u6D41\u516C\u53F8",
10526
10524
  onChange: function onChange(val) {
@@ -11677,34 +11675,9 @@ var GoodItem$1 = function GoodItem(props) {
11677
11675
  React.useEffect(function () {
11678
11676
  setSelectedRowKeys([]);
11679
11677
  }, [tableSelect, selectType]);
11680
- var updateHandle = function updateHandle(val, index, columnType) {
11678
+ var updateHandle = function updateHandle(val, index, type) {
11681
11679
  if (value === null || value === void 0 ? void 0 : value.length) {
11682
- value[index][columnType] = val;
11683
- if (type === 'WDT_RETURN_GOODS') {
11684
- if (['sharePrice', 'num'].includes(columnType)) {
11685
- var totalMoney = null;
11686
- if (columnType === 'num') {
11687
- totalMoney = new BigNumber__default['default'](value[index][columnType]).multipliedBy(new BigNumber__default['default'](value[index].sharePrice));
11688
- } else {
11689
- totalMoney = new BigNumber__default['default'](value[index][columnType]).multipliedBy(new BigNumber__default['default'](value[index].num));
11690
- }
11691
- if (totalMoney !== null) {
11692
- value[index]['returnPrice'] = totalMoney.toString();
11693
- }
11694
- }
11695
- } else if (type === 'WDT_EXCHANGE_GOODS') {
11696
- if (['price', 'num'].includes(columnType)) {
11697
- var _totalMoney = null;
11698
- if (columnType === 'num') {
11699
- _totalMoney = new BigNumber__default['default'](value[index][columnType]).multipliedBy(new BigNumber__default['default'](value[index].price));
11700
- } else {
11701
- _totalMoney = new BigNumber__default['default'](value[index][columnType]).multipliedBy(new BigNumber__default['default'](value[index].num));
11702
- }
11703
- if (_totalMoney !== null) {
11704
- value[index]['exchangePrice'] = _totalMoney.toString();
11705
- }
11706
- }
11707
- }
11680
+ value[index][type] = val;
11708
11681
  onChange === null || onChange === void 0 ? void 0 : onChange(_toConsumableArray(value));
11709
11682
  }
11710
11683
  };
@@ -11810,260 +11783,6 @@ var GoodItem$1 = function GoodItem(props) {
11810
11783
  }
11811
11784
  }];
11812
11785
  break;
11813
- case 'WDT_RETURN_GOODS':
11814
- {
11815
- columns = [{
11816
- dataIndex: 'goodId',
11817
- title: "SPUID",
11818
- align: 'center',
11819
- ellipsis: true,
11820
- width: 70
11821
- }, {
11822
- dataIndex: 'goodNo',
11823
- title: "\u5546\u54C1SPU\u7F16\u7801",
11824
- align: 'center',
11825
- ellipsis: true,
11826
- width: 180
11827
- }, {
11828
- dataIndex: 'goodName',
11829
- title: "".concat(text, "\u5546\u54C1\u540D\u79F0"),
11830
- align: 'center',
11831
- ellipsis: true,
11832
- width: 250
11833
- }, {
11834
- dataIndex: 'specId',
11835
- title: "".concat(text, "SKUID"),
11836
- align: 'center',
11837
- ellipsis: true,
11838
- width: 100
11839
- }, {
11840
- dataIndex: 'specNo',
11841
- title: "".concat(text, "\u5546\u54C1SKU\u7F16\u7801"),
11842
- align: 'center',
11843
- ellipsis: true,
11844
- width: 180
11845
- }, {
11846
- dataIndex: 'specName',
11847
- title: "".concat(text, "\u5546\u54C1SKU\u540D\u79F0"),
11848
- align: 'center',
11849
- ellipsis: true,
11850
- width: 250
11851
- }, {
11852
- dataIndex: 'num',
11853
- title: "".concat(text, "\u9000\u8D27\u6570\u91CF"),
11854
- align: 'center',
11855
- ellipsis: true,
11856
- width: 100,
11857
- render: function render(val, record, index) {
11858
- return !disabled ? /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, {
11859
- style: {
11860
- width: 70
11861
- },
11862
- value: val,
11863
- min: 1,
11864
- precision: 0,
11865
- onChange: function onChange(num) {
11866
- return updateHandle(num, index, 'num');
11867
- }
11868
- }) : /*#__PURE__*/React__default['default'].createElement("span", null, val);
11869
- }
11870
- }, {
11871
- dataIndex: 'sharePrice',
11872
- title: "\u5206\u644A\u4EF7",
11873
- align: 'center',
11874
- ellipsis: true,
11875
- width: 80,
11876
- render: function render(val, record, index) {
11877
- return !disabled ? /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, {
11878
- style: {
11879
- width: 70
11880
- },
11881
- value: val,
11882
- min: 0,
11883
- onChange: function onChange(value) {
11884
- return updateHandle(value, index, 'sharePrice');
11885
- }
11886
- }) : /*#__PURE__*/React__default['default'].createElement("span", null, val);
11887
- }
11888
- }, {
11889
- dataIndex: 'returnPrice',
11890
- title: "".concat(text, "\u9000\u8D27\u91D1\u989D"),
11891
- align: 'center',
11892
- ellipsis: true,
11893
- width: 100
11894
- }, {
11895
- dataIndex: 'giftType',
11896
- title: "\u8D60\u54C1\u65B9\u5F0F",
11897
- align: 'center',
11898
- ellipsis: true,
11899
- width: 100,
11900
- render: function render(val) {
11901
- var giftTypeMap = {
11902
- 0: '非赠品',
11903
- 1: '自动赠送',
11904
- 2: '手工赠送',
11905
- 3: '回购自动送赠品',
11906
- 4: '前N有礼送赠品',
11907
- 6: '天猫优仓赠品',
11908
- 7: '淘宝CRM会员送赠'
11909
- };
11910
- return /*#__PURE__*/React__default['default'].createElement("span", null, giftTypeMap[val]);
11911
- }
11912
- }, {
11913
- dataIndex: 'type',
11914
- title: "".concat(text, "\u5546\u54C1\u7C7B\u578B"),
11915
- align: 'center',
11916
- ellipsis: true,
11917
- width: 100,
11918
- render: function render(val, record, index) {
11919
- var options = [{
11920
- label: '单品',
11921
- value: '1'
11922
- }, {
11923
- label: '组合装',
11924
- value: '2'
11925
- }];
11926
- return !disabled ? /*#__PURE__*/React__default['default'].createElement(antd.Select, {
11927
- style: {
11928
- width: 70
11929
- },
11930
- options: options,
11931
- value: val,
11932
- onChange: function onChange(value) {
11933
- return updateHandle(value, index, 'type');
11934
- }
11935
- }) : /*#__PURE__*/React__default['default'].createElement("span", null, val);
11936
- }
11937
- }];
11938
- }
11939
- break;
11940
- case 'WDT_EXCHANGE_GOODS':
11941
- {
11942
- columns = [{
11943
- dataIndex: 'goodId',
11944
- title: "SPUID",
11945
- align: 'center',
11946
- ellipsis: true,
11947
- width: 70
11948
- }, {
11949
- dataIndex: 'goodNo',
11950
- title: "\u5546\u54C1SPU\u7F16\u7801",
11951
- align: 'center',
11952
- ellipsis: true,
11953
- width: 180
11954
- }, {
11955
- dataIndex: 'goodName',
11956
- title: "".concat(text, "\u5546\u54C1\u540D\u79F0"),
11957
- align: 'center',
11958
- ellipsis: true,
11959
- width: 250
11960
- }, {
11961
- dataIndex: 'specId',
11962
- title: "".concat(text, "SKUID"),
11963
- align: 'center',
11964
- ellipsis: true,
11965
- width: 100
11966
- }, {
11967
- dataIndex: 'specNo',
11968
- title: "".concat(text, "\u5546\u54C1SKU\u7F16\u7801"),
11969
- align: 'center',
11970
- ellipsis: true,
11971
- width: 180
11972
- }, {
11973
- dataIndex: 'specName',
11974
- title: "".concat(text, "\u5546\u54C1SKU\u540D\u79F0"),
11975
- align: 'center',
11976
- ellipsis: true,
11977
- width: 250
11978
- }, {
11979
- dataIndex: 'num',
11980
- title: "".concat(text, "\u6362\u51FA\u6570\u91CF"),
11981
- align: 'center',
11982
- ellipsis: true,
11983
- width: 100,
11984
- render: function render(val, record, index) {
11985
- return !disabled ? /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, {
11986
- style: {
11987
- width: 70
11988
- },
11989
- value: val,
11990
- min: 1,
11991
- precision: 0,
11992
- onChange: function onChange(num) {
11993
- return updateHandle(num, index, 'num');
11994
- }
11995
- }) : /*#__PURE__*/React__default['default'].createElement("span", null, val);
11996
- }
11997
- }, {
11998
- dataIndex: 'price',
11999
- title: "".concat(text, "\u5546\u54C1\u5355\u4EF7"),
12000
- align: 'center',
12001
- ellipsis: true,
12002
- width: 100,
12003
- render: function render(val, record, index) {
12004
- return !disabled ? /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, {
12005
- style: {
12006
- width: 70
12007
- },
12008
- value: val,
12009
- min: 0,
12010
- onChange: function onChange(value) {
12011
- return updateHandle(value, index, 'price');
12012
- }
12013
- }) : /*#__PURE__*/React__default['default'].createElement("span", null, val);
12014
- }
12015
- }, {
12016
- dataIndex: 'exchangePrice',
12017
- title: "".concat(text, "\u6362\u51FA\u91D1\u989D"),
12018
- align: 'center',
12019
- ellipsis: true,
12020
- width: 100
12021
- }, {
12022
- dataIndex: 'giftType',
12023
- title: "\u8D60\u54C1\u65B9\u5F0F",
12024
- align: 'center',
12025
- ellipsis: true,
12026
- width: 100,
12027
- render: function render(val) {
12028
- var giftTypeMap = {
12029
- 0: '非赠品',
12030
- 1: '自动赠送',
12031
- 2: '手工赠送',
12032
- 3: '回购自动送赠品',
12033
- 4: '前N有礼送赠品',
12034
- 6: '天猫优仓赠品',
12035
- 7: '淘宝CRM会员送赠'
12036
- };
12037
- return /*#__PURE__*/React__default['default'].createElement("span", null, giftTypeMap[val]);
12038
- }
12039
- }, {
12040
- dataIndex: 'type',
12041
- title: "".concat(text, "\u5546\u54C1\u7C7B\u578B"),
12042
- align: 'center',
12043
- ellipsis: true,
12044
- width: 100,
12045
- render: function render(val, record, index) {
12046
- var options = [{
12047
- label: '单品',
12048
- value: '1'
12049
- }, {
12050
- label: '组合装',
12051
- value: '2'
12052
- }];
12053
- return !disabled ? /*#__PURE__*/React__default['default'].createElement(antd.Select, {
12054
- style: {
12055
- width: 70
12056
- },
12057
- options: options,
12058
- value: val,
12059
- onChange: function onChange(value) {
12060
- return updateHandle(value, index, 'type');
12061
- }
12062
- }) : /*#__PURE__*/React__default['default'].createElement("span", null, val);
12063
- }
12064
- }];
12065
- }
12066
- break;
12067
11786
  default:
12068
11787
  columns = [{
12069
11788
  dataIndex: 'mark',
@@ -12205,7 +11924,7 @@ var GoodItem$1 = function GoodItem(props) {
12205
11924
  }, [showHeader, value, disabled]);
12206
11925
  var onSubmit = function onSubmit(list) {
12207
11926
  var newList = [];
12208
- if (['WDT_REISSUE_GOODS', 'WDT_GOODS', 'WDT_EXCHANGE_GOODS'].includes(type)) {
11927
+ if (['WDT_REISSUE_GOODS', 'WDT_GOODS'].includes(type)) {
12209
11928
  newList = list.map(function (item) {
12210
11929
  item.uuid = kmkfUtils.uuid();
12211
11930
  item.canDelete = true;
@@ -12213,10 +11932,6 @@ var GoodItem$1 = function GoodItem(props) {
12213
11932
  item.orderPrice = 0;
12214
11933
  item.sharePrice = 0;
12215
11934
  item.canUpdateNumber = canUpdateNumber;
12216
- if (type === 'WDT_EXCHANGE_GOODS') {
12217
- item.price = item.retailPrice;
12218
- item.type = '1';
12219
- }
12220
11935
  return item;
12221
11936
  });
12222
11937
  } else {
@@ -12287,7 +12002,7 @@ var GoodItem$1 = function GoodItem(props) {
12287
12002
  locale: {
12288
12003
  emptyText: '暂无数据'
12289
12004
  }
12290
- })), ['WDT_REISSUE_GOODS', 'WDT_GOODS', 'WDT_EXCHANGE_GOODS'].includes(type) ? /*#__PURE__*/React__default['default'].createElement(WdtGoodsModal, {
12005
+ })), ['WDT_REISSUE_GOODS', 'WDT_GOODS'].includes(type) ? /*#__PURE__*/React__default['default'].createElement(WdtGoodsModal, {
12291
12006
  ref: refModal,
12292
12007
  onSubmit: onSubmit,
12293
12008
  width: width,
@@ -13048,7 +12763,7 @@ var index$1 = (function (props) {
13048
12763
  }();
13049
12764
  var getWdtOrderList = /*#__PURE__*/function () {
13050
12765
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(orderNo) {
13051
- var _yield$request3, success, data, trades;
12766
+ var _yield$request3, success, data;
13052
12767
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
13053
12768
  while (1) switch (_context3.prev = _context3.next) {
13054
12769
  case 0:
@@ -13064,25 +12779,15 @@ var index$1 = (function (props) {
13064
12779
  success = _yield$request3.success;
13065
12780
  data = _yield$request3.data;
13066
12781
  if (success) {
13067
- trades = ((data === null || data === void 0 ? void 0 : data.trades) || []).filter(function (item) {
13068
- return (item.srcTid || '').split(',').includes(orderNo);
13069
- }).map(function (item) {
13070
- if (Array.isArray(item.goodDetails)) {
13071
- item.goodDetails = item.goodDetails.filter(function (good) {
13072
- return good.srcTid === orderNo;
13073
- });
13074
- }
13075
- return item;
13076
- });
13077
12782
  _onChange(_objectSpread2(_objectSpread2({}, value), {}, {
13078
- orders: trades.map(function (item) {
12783
+ orders: ((data === null || data === void 0 ? void 0 : data.trades) || []).map(function (item) {
13079
12784
  return _objectSpread2(_objectSpread2({}, item), {}, {
13080
12785
  billNo: item.tradeNo,
13081
12786
  billType: kmkfUtils.WDT_ORDER_TYPE_MAP[item.tradeType],
13082
12787
  billTag: item.tagName
13083
12788
  });
13084
12789
  }),
13085
- showOrderInfo: trades.map(function (item) {
12790
+ showOrderInfo: data === null || data === void 0 ? void 0 : data.trades.map(function (item) {
13086
12791
  return {
13087
12792
  billNo: item.tradeNo,
13088
12793
  billType: kmkfUtils.WDT_ORDER_TYPE_MAP[item.tradeType],
@@ -13172,10 +12877,8 @@ var componentMap$1 = {
13172
12877
  reissueType: 'wdtReissueType',
13173
12878
  returnType: 'wdtReturnType',
13174
12879
  returnSelectListReturn: 'wdtReturnSelectListReturn',
13175
- returnSelectList: 'wdtReturnSelectList',
13176
12880
  deleteGood: 'wdtDeleteGood',
13177
- returnDeleteGood: 'wdtReturnDeleteGood',
13178
- exchangeDeleteGood: 'wdtExchangeDeleteGood'
12881
+ returnDeleteGood: 'wdtReturnDeleteGood'
13179
12882
  }
13180
12883
  }
13181
12884
  };
@@ -13242,7 +12945,7 @@ var CommonGoods = function CommonGoods(props) {
13242
12945
  setTableSelect(['2', '4'].includes(data.val));
13243
12946
  if (['1', '3'].includes(data.val)) {
13244
12947
  var _valueRef$current5, _valueRef$current6;
13245
- pubsub__default['default'].publish(componentMap$1[compType].eventNameMap.returnSelectListReturn, {
12948
+ pubsub__default['default'].publish(componentMap$1[type].eventNameMap.returnSelectListReturn, {
13246
12949
  list: lodash.cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current5 = valueRef.current) === null || _valueRef$current5 === void 0 ? void 0 : _valueRef$current5[componentMap$1[compType].key]) || []),
13247
12950
  shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current6 = valueRef.current) === null || _valueRef$current6 === void 0 ? void 0 : _valueRef$current6.shopCode,
13248
12951
  goodValue: data === null || data === void 0 ? void 0 : data.goodValue
@@ -13260,15 +12963,15 @@ var CommonGoods = function CommonGoods(props) {
13260
12963
  };
13261
12964
  }, [disabled]);
13262
12965
  var _onSelect = function onSelect(list) {
13263
- var _typeMap, _withInfo$current, _withInfo$current2, _valueRef$current7;
12966
+ var _withInfo$current, _withInfo$current2, _valueRef$current7;
13264
12967
  if (disabled) return;
13265
12968
  var newList = lodash.cloneDeep(list);
13266
- var typeMap = (_typeMap = {
12969
+ var typeMap = _defineProperty({
13267
12970
  // type: componentMap[compType].eventNameMap.selectList,
13268
12971
  // returnType: componentMap[compType].eventNameMap.returnSelectList,
13269
12972
  // reissueType: componentMap[compType].eventNameMap.reissueSelectList,
13270
12973
  type: componentMap$1[compType].eventNameMap.selectList
13271
- }, _defineProperty(_typeMap, "".concat(componentMap$1[compType].type, "ReissueType"), componentMap$1[compType].eventNameMap.reissueSelectList), _defineProperty(_typeMap, "".concat(componentMap$1[compType].type, "ReturnType"), componentMap$1[compType].eventNameMap.returnSelectList), _typeMap);
12974
+ }, "".concat(componentMap$1[compType].type, "ReissueType"), componentMap$1[compType].eventNameMap.reissueSelectList);
13272
12975
  var type = typeMap[(_withInfo$current = withInfo.current) === null || _withInfo$current === void 0 ? void 0 : _withInfo$current.type];
13273
12976
  // console.log('onSelect', type, withInfo.current, newList);
13274
12977
  pubsub__default['default'].publish(type, {
@@ -13286,7 +12989,6 @@ var CommonGoods = function CommonGoods(props) {
13286
12989
  pubsub__default['default'].publish(componentMap$1[compType].eventNameMap.deleteGood, deleteId);
13287
12990
  pubsub__default['default'].publish(componentMap$1[compType].eventNameMap.reissueDeleteGood, deleteId);
13288
12991
  pubsub__default['default'].publish(componentMap$1[compType].eventNameMap.returnDeleteGood, deleteId);
13289
- pubsub__default['default'].publish(componentMap$1[compType].eventNameMap.exchangeDeleteGood, deleteId);
13290
12992
  };
13291
12993
  var changeHandle = function changeHandle(list) {
13292
12994
  onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, componentMap$1[compType].key, list)));
@@ -13311,263 +13013,6 @@ var CommonGoods = function CommonGoods(props) {
13311
13013
  }));
13312
13014
  };
13313
13015
 
13314
- var componentMap$2 = {
13315
- 'WDT_RETURN_GOODS': {
13316
- type: 'wdt',
13317
- valueKey: 'wdtReturnGoods',
13318
- returnTypeKey: 'wdtReturnType',
13319
- name: '旺店通',
13320
- eventNameMap: {
13321
- changeShopCode: 'wdtChangeShopCode',
13322
- returnType: 'wdtReturnType',
13323
- returnSelectListReturn: 'wdtReturnSelectListReturn',
13324
- returnDeleteGood: 'wdtReturnDeleteGood',
13325
- returnSelectList: 'wdtReturnSelectList',
13326
- exchangeCopyGood: 'wdtExchangeCopyGood',
13327
- exchangeBackCopyGood: 'wdtExchangeBackCopyGood'
13328
- }
13329
- }
13330
- };
13331
- var CommonReturnGoods = function CommonReturnGoods(props) {
13332
- var value = props.value,
13333
- onChange = props.onChange,
13334
- _props$reasonList = props.reasonList,
13335
- reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
13336
- disabled = props.disabled,
13337
- compType = props.type;
13338
- var valueRef = React.useRef({});
13339
- React.useEffect(function () {
13340
- var subscription = pubsub__default['default'].subscribe(componentMap$2[compType].eventNameMap.exchangeCopyGood, function () {
13341
- var _valueRef$current, _valueRef$current2;
13342
- pubsub__default['default'].publish(componentMap$2[compType].eventNameMap.exchangeBackCopyGood, {
13343
- list: lodash.cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current = valueRef.current) === null || _valueRef$current === void 0 ? void 0 : _valueRef$current[componentMap$2[compType].valueKey]) || []),
13344
- shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current2 = valueRef.current) === null || _valueRef$current2 === void 0 ? void 0 : _valueRef$current2.shopCode
13345
- });
13346
- });
13347
- return function () {
13348
- pubsub__default['default'].unsubscribe(subscription);
13349
- };
13350
- }, []);
13351
- React.useEffect(function () {
13352
- var subscription = pubsub__default['default'].subscribe(componentMap$2[compType].eventNameMap.returnSelectList, function (_, data) {
13353
- if (disabled) return;
13354
- var newValue = _objectSpread2(_objectSpread2({}, data.goodValue), {}, {
13355
- shopCode: data === null || data === void 0 ? void 0 : data.shopCode
13356
- });
13357
- if (compType === 'WDT_RETURN_GOODS') {
13358
- newValue[componentMap$2[compType].valueKey] = ((data === null || data === void 0 ? void 0 : data.list) || []).map(function (item) {
13359
- if (typeof item.type === 'undefined') {
13360
- item.type = '1';
13361
- }
13362
- if (typeof item.returnPrice === 'undefined') {
13363
- item.returnPrice = new BigNumber__default['default'](item.num).multipliedBy(new BigNumber__default['default'](item.sharePrice)).toString();
13364
- }
13365
- if (item.srcOid) {
13366
- item.oid = item.srcOid;
13367
- }
13368
- return item;
13369
- });
13370
- } else {
13371
- newValue[componentMap$2[compType].valueKey] = (data === null || data === void 0 ? void 0 : data.list) || [];
13372
- }
13373
- onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
13374
- });
13375
- return function () {
13376
- pubsub__default['default'].unsubscribe(subscription);
13377
- };
13378
- }, []);
13379
- React.useEffect(function () {
13380
- var subscription = pubsub__default['default'].subscribe(componentMap$2[compType].eventNameMap.returnSelectListReturn, function (_, data) {
13381
- if (disabled) return;
13382
- var newValue = _objectSpread2(_objectSpread2({}, data.goodValue), {}, {
13383
- shopCode: data === null || data === void 0 ? void 0 : data.shopCode
13384
- });
13385
- if (compType === 'WDT_RETURN_GOODS') {
13386
- newValue[componentMap$2[compType].valueKey] = ((data === null || data === void 0 ? void 0 : data.list) || []).map(function (item) {
13387
- if (typeof item.type === 'undefined') {
13388
- item.type = '1';
13389
- }
13390
- if (typeof item.returnPrice === 'undefined') {
13391
- item.returnPrice = new BigNumber__default['default'](item.num).multipliedBy(new BigNumber__default['default'](item.sharePrice)).toString();
13392
- }
13393
- if (item.srcOid) {
13394
- item.oid = item.srcOid;
13395
- }
13396
- return item;
13397
- });
13398
- } else {
13399
- newValue[componentMap$2[compType].valueKey] = (data === null || data === void 0 ? void 0 : data.list) || [];
13400
- }
13401
- onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
13402
- });
13403
- return function () {
13404
- pubsub__default['default'].unsubscribe(subscription);
13405
- };
13406
- }, []);
13407
- React.useEffect(function () {
13408
- valueRef.current = value;
13409
- pubsub__default['default'].subscribeOnce(componentMap$2[compType].eventNameMap.returnDeleteGood, function (_, data) {
13410
- if (disabled) return;
13411
- if (value) {
13412
- var newValue = _objectSpread2({}, value);
13413
- newValue[componentMap$2[compType].valueKey] = newValue[componentMap$2[compType].valueKey].filter(function (item) {
13414
- return item.sku !== data;
13415
- });
13416
- onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
13417
- }
13418
- });
13419
- pubsub__default['default'].subscribeOnce(componentMap$2[compType].eventNameMap.changeShopCode, function (type, data) {
13420
- onChange(_objectSpread2(_objectSpread2({}, value), {}, {
13421
- shopCode: data.shopCode
13422
- }));
13423
- });
13424
- }, [value, disabled]);
13425
- var changeTypeHandle = function changeTypeHandle(val) {
13426
- var newValue = _objectSpread2({}, value);
13427
- newValue[componentMap$2[compType].returnTypeKey] = val;
13428
- newValue[componentMap$2[compType].valueKey] = [];
13429
- if (['2'].includes(val[0])) {
13430
- onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
13431
- valueRef.current = newValue;
13432
- }
13433
- pubsub__default['default'].publish(componentMap$2[compType].eventNameMap.returnType, {
13434
- val: val[0],
13435
- goodValue: newValue
13436
- });
13437
- };
13438
- var changeGoodHandle = function changeGoodHandle(val) {
13439
- var newValue = _objectSpread2({}, value);
13440
- newValue[componentMap$2[compType].valueKey] = val;
13441
- onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
13442
- };
13443
- //显示选择商品按钮 原单换不显示选择商品
13444
- // const showChangeBtn = useMemo(() => {
13445
- // return ['2'].includes(value?.[componentMap[compType].returnTypeKey]?.[0]);
13446
- // }, [value?.[componentMap[compType].returnTypeKey]]);
13447
- return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(antd.Cascader, {
13448
- style: {
13449
- marginBottom: '8px'
13450
- },
13451
- disabled: disabled,
13452
- allowClear: false,
13453
- options: reasonList,
13454
- value: value === null || value === void 0 ? void 0 : value[componentMap$2[compType].returnTypeKey],
13455
- onChange: function onChange(val) {
13456
- return changeTypeHandle(val);
13457
- }
13458
- }), /*#__PURE__*/React__default['default'].createElement(GoodItem$1, _objectSpread2(_objectSpread2({
13459
- key: componentMap$2[compType].type
13460
- }, props), {}, {
13461
- disabled: disabled,
13462
- canUpdateNumber: true,
13463
- showChangeBtn: false,
13464
- shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
13465
- value: value === null || value === void 0 ? void 0 : value[componentMap$2[compType].valueKey],
13466
- onChange: function onChange(val) {
13467
- return changeGoodHandle(val);
13468
- }
13469
- })));
13470
- };
13471
-
13472
- var componentMap$3 = {
13473
- 'WDT_EXCHANGE_GOODS': {
13474
- type: 'wdt',
13475
- valueKey: 'wdtExchangeGoods',
13476
- returnTypeKey: 'wdtExchangeType',
13477
- name: '旺店通',
13478
- eventNameMap: {
13479
- changeShopCode: 'wdtChangeShopCode',
13480
- exchangeDeleteGood: 'wdtExchangeDeleteGood',
13481
- exchangeCopyGood: 'wdtExchangeCopyGood',
13482
- exchangeBackCopyGood: 'wdtExchangeBackCopyGood'
13483
- }
13484
- }
13485
- };
13486
- var CommonExchangeGoods = function CommonExchangeGoods(props) {
13487
- var value = props.value,
13488
- onChange = props.onChange,
13489
- disabled = props.disabled,
13490
- compType = props.type;
13491
- var valueRef = React.useRef({});
13492
- React.useEffect(function () {
13493
- var subscription = pubsub__default['default'].subscribe(componentMap$3[compType].eventNameMap.exchangeBackCopyGood, function (_, data) {
13494
- if (disabled) return;
13495
- var newValue = {
13496
- shopCode: data === null || data === void 0 ? void 0 : data.shopCode
13497
- };
13498
- if (compType === 'WDT_EXCHANGE_GOODS') {
13499
- newValue[componentMap$3[compType].valueKey] = ((data === null || data === void 0 ? void 0 : data.list) || []).map(function (item) {
13500
- if (typeof item.type === 'undefined') {
13501
- item.type = '1';
13502
- }
13503
- item.price = item.sharePrice;
13504
- if (typeof item.exchangePrice === 'undefined') {
13505
- item.exchangePrice = new BigNumber__default['default'](item.num).multipliedBy(new BigNumber__default['default'](item.price)).toString();
13506
- }
13507
- return item;
13508
- });
13509
- } else {
13510
- newValue[componentMap$3[compType].valueKey] = (data === null || data === void 0 ? void 0 : data.list) || [];
13511
- }
13512
- onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
13513
- });
13514
- return function () {
13515
- pubsub__default['default'].unsubscribe(subscription);
13516
- };
13517
- });
13518
- React.useEffect(function () {
13519
- valueRef.current = value;
13520
- pubsub__default['default'].subscribeOnce(componentMap$3[compType].eventNameMap.exchangeDeleteGood, function (_, data) {
13521
- if (disabled) return;
13522
- if (value) {
13523
- var newValue = _objectSpread2({}, value);
13524
- newValue[componentMap$3[compType].valueKey] = newValue[componentMap$3[compType].valueKey].filter(function (item) {
13525
- return item.sku !== data;
13526
- });
13527
- onChange(newValue);
13528
- }
13529
- });
13530
- pubsub__default['default'].subscribeOnce(componentMap$3[compType].eventNameMap.changeShopCode, function (type, data) {
13531
- onChange(_objectSpread2(_objectSpread2({}, value), {}, {
13532
- shopCode: data.shopCode
13533
- }));
13534
- });
13535
- }, [value]);
13536
- var changeGoodHandle = function changeGoodHandle(val) {
13537
- var newValue = _objectSpread2({}, value);
13538
- if (compType === 'WDT_EXCHANGE_GOODS') {
13539
- val = val.map(function (item) {
13540
- item.exchangePrice = new BigNumber__default['default'](item.num).multipliedBy(new BigNumber__default['default'](item.price)).toString();
13541
- return item;
13542
- });
13543
- }
13544
- newValue[componentMap$3[compType].valueKey] = val;
13545
- onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
13546
- };
13547
- var copyGoods = function copyGoods() {
13548
- var copyHandle = function copyHandle() {
13549
- pubsub__default['default'].publish(componentMap$3[compType].eventNameMap.exchangeCopyGood, 'WDT_EXCHANGE_GOODS');
13550
- };
13551
- return /*#__PURE__*/React__default['default'].createElement(antd.Button, {
13552
- type: "link",
13553
- onClick: copyHandle
13554
- }, "\u590D\u5236\u9000\u56DE\u5546\u54C1");
13555
- };
13556
- return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(GoodItem$1, _objectSpread2(_objectSpread2({
13557
- key: componentMap$3[compType].type
13558
- }, props), {}, {
13559
- disabled: disabled,
13560
- canUpdateNumber: true,
13561
- showChangeBtn: true,
13562
- shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
13563
- value: value === null || value === void 0 ? void 0 : value[componentMap$3[compType].valueKey],
13564
- otherOperations: copyGoods(),
13565
- onChange: function onChange(val) {
13566
- return changeGoodHandle(val);
13567
- }
13568
- })));
13569
- };
13570
-
13571
13016
  var _excluded$g = ["value", "onChange", "reasonList", "disabled", "type"];
13572
13017
  var typeMap$1 = {
13573
13018
  WDT_REISSUE_GOODS: {
@@ -14356,7 +13801,7 @@ var CommonSystemOrder = function CommonSystemOrder(props) {
14356
13801
  changeIndex = _useState2[0],
14357
13802
  setChangeIndex = _useState2[1]; //选中的包裹
14358
13803
  React.useEffect(function () {
14359
- if (!(value === null || value === void 0 ? void 0 : value.length) && type === 1) {
13804
+ if (!(value === null || value === void 0 ? void 0 : value.length)) {
14360
13805
  onChange === null || onChange === void 0 ? void 0 : onChange(typeInitValueMap$1[type].initValue);
14361
13806
  }
14362
13807
  }, [value, type]);
@@ -14395,7 +13840,7 @@ var CommonSystemOrder = function CommonSystemOrder(props) {
14395
13840
  return setChangeIndex(index);
14396
13841
  }
14397
13842
  }, "\u7CFB\u7EDF\u8BA2\u5355\u53F7".concat(index + 1)));
14398
- }))) : null, value.length || type !== 1 ? /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, type === 1 ? /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
13843
+ }))) : null, value.length ? /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, type === 1 ? /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
14399
13844
  disabled: disabled,
14400
13845
  placeholder: "\u8BF7\u8F93\u5165\u51FA\u5E93\u5355\u7F16\u53F7",
14401
13846
  onChange: function onChange(e) {
@@ -14410,18 +13855,12 @@ var CommonSystemOrder = function CommonSystemOrder(props) {
14410
13855
  },
14411
13856
  value: (_value$changeIndex2 = value[changeIndex]) === null || _value$changeIndex2 === void 0 ? void 0 : _value$changeIndex2.returnGoodsTradeId
14412
13857
  })) : null, type === 3 ? /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
14413
- disabled: disabled,
13858
+ disabled: true,
14414
13859
  placeholder: "\u8BF7\u8F93\u5165\u8865\u53D1\u5355id",
14415
- onChange: function onChange(e) {
14416
- return changeInputHandle(e.target.value, 'billNo');
14417
- },
14418
13860
  value: (_value$changeIndex3 = value[changeIndex]) === null || _value$changeIndex3 === void 0 ? void 0 : _value$changeIndex3.billNo
14419
13861
  })) : null, type === 4 ? /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
14420
- disabled: disabled,
13862
+ disabled: true,
14421
13863
  placeholder: "\u8BF7\u8F93\u5165\u6362\u8D27\u5355id",
14422
- onChange: function onChange(e) {
14423
- return changeInputHandle(e.target.value, 'billNo');
14424
- },
14425
13864
  value: (_value$changeIndex4 = value[changeIndex]) === null || _value$changeIndex4 === void 0 ? void 0 : _value$changeIndex4.billNo
14426
13865
  })) : null) : null);
14427
13866
  };
@@ -14483,7 +13922,7 @@ var CommonSystemOrder$1 = function CommonSystemOrder(props) {
14483
13922
  return setChangeIndex(index);
14484
13923
  }
14485
13924
  }, "\u7CFB\u7EDF\u8BA2\u5355\u53F7".concat(index + 1)));
14486
- }))) : null, /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(antd.Select, _objectSpread2(_objectSpread2({}, other), {}, {
13925
+ }))) : null, value.length && type === 1 || type === 2 ? /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(antd.Select, _objectSpread2(_objectSpread2({}, other), {}, {
14487
13926
  showSearch: true,
14488
13927
  value: (_value$changeIndex = value[changeIndex]) === null || _value$changeIndex === void 0 ? void 0 : _value$changeIndex.status,
14489
13928
  filterOption: function filterOption(input, option) {
@@ -14499,7 +13938,7 @@ var CommonSystemOrder$1 = function CommonSystemOrder(props) {
14499
13938
  }
14500
13939
  }))), ((_value$changeIndex2 = value[changeIndex]) === null || _value$changeIndex2 === void 0 ? void 0 : _value$changeIndex2.reason) ? /*#__PURE__*/React__default['default'].createElement("div", {
14501
13940
  className: "c-red"
14502
- }, "\u5931\u8D25\u539F\u56E0\uFF1A", (_value$changeIndex3 = value[changeIndex]) === null || _value$changeIndex3 === void 0 ? void 0 : _value$changeIndex3.reason) : null));
13941
+ }, "\u5931\u8D25\u539F\u56E0\uFF1A", (_value$changeIndex3 = value[changeIndex]) === null || _value$changeIndex3 === void 0 ? void 0 : _value$changeIndex3.reason) : null) : null);
14503
13942
  };
14504
13943
 
14505
13944
  var _excluded$j = ["value", "onChange", "disabled", "failValue", "type"];
@@ -14615,10 +14054,8 @@ exports.BsSystemOrder = index$1;
14615
14054
  exports.BuyerNick = BuyerNick;
14616
14055
  exports.CalculationInput = CalculationInput;
14617
14056
  exports.ChooseBaby = ChooseBaby;
14618
- exports.CommonExchangeGoods = CommonExchangeGoods;
14619
14057
  exports.CommonGoods = CommonGoods;
14620
14058
  exports.CommonMultiStatus = CommonSystemOrder$1;
14621
- exports.CommonReturnGoods = CommonReturnGoods;
14622
14059
  exports.CommonStatus = CommonStatus;
14623
14060
  exports.CommonSystemOrder = CommonSystemOrder;
14624
14061
  exports.ExpressLogistics = ExpressLogistics;