@kmkf-fe-packages/basic-components 1.0.6-rc.7 → 1.0.6-wzg.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/README.md CHANGED
@@ -17,5 +17,4 @@ yarn start
17
17
  - business 快麦工单业务组件
18
18
  - common 公共组件
19
19
  - config 公共方法
20
- - assets 静态资源
21
- -
20
+ - assets 静态资源
package/dist/index.esm.js CHANGED
@@ -8,7 +8,6 @@ import zhCN from 'antd/lib/locale/zh_CN';
8
8
  import { cloneDeep, difference, differenceWith } from 'lodash';
9
9
  import { useDebounceEffect } from 'ahooks';
10
10
  import pubsub from 'pubsub-js';
11
- import BigNumber from 'bignumber.js';
12
11
 
13
12
  function _iterableToArrayLimit(arr, i) {
14
13
  var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
@@ -11663,34 +11662,9 @@ var GoodItem$1 = function GoodItem(props) {
11663
11662
  useEffect(function () {
11664
11663
  setSelectedRowKeys([]);
11665
11664
  }, [tableSelect, selectType]);
11666
- var updateHandle = function updateHandle(val, index, columnType) {
11665
+ var updateHandle = function updateHandle(val, index, type) {
11667
11666
  if (value === null || value === void 0 ? void 0 : value.length) {
11668
- value[index][columnType] = val;
11669
- if (type === 'WDT_RETURN_GOODS') {
11670
- if (['sharePrice', 'num'].includes(columnType)) {
11671
- var totalMoney = null;
11672
- if (columnType === 'num') {
11673
- totalMoney = new BigNumber(value[index][columnType]).multipliedBy(new BigNumber(value[index].sharePrice));
11674
- } else {
11675
- totalMoney = new BigNumber(value[index][columnType]).multipliedBy(new BigNumber(value[index].num));
11676
- }
11677
- if (totalMoney !== null) {
11678
- value[index]['returnPrice'] = totalMoney.toString();
11679
- }
11680
- }
11681
- } else if (type === 'WDT_EXCHANGE_GOODS') {
11682
- if (['price', 'num'].includes(columnType)) {
11683
- var _totalMoney = null;
11684
- if (columnType === 'num') {
11685
- _totalMoney = new BigNumber(value[index][columnType]).multipliedBy(new BigNumber(value[index].price));
11686
- } else {
11687
- _totalMoney = new BigNumber(value[index][columnType]).multipliedBy(new BigNumber(value[index].num));
11688
- }
11689
- if (_totalMoney !== null) {
11690
- value[index]['exchangePrice'] = _totalMoney.toString();
11691
- }
11692
- }
11693
- }
11667
+ value[index][type] = val;
11694
11668
  onChange === null || onChange === void 0 ? void 0 : onChange(_toConsumableArray(value));
11695
11669
  }
11696
11670
  };
@@ -11796,260 +11770,6 @@ var GoodItem$1 = function GoodItem(props) {
11796
11770
  }
11797
11771
  }];
11798
11772
  break;
11799
- case 'WDT_RETURN_GOODS':
11800
- {
11801
- columns = [{
11802
- dataIndex: 'goodId',
11803
- title: "SPUID",
11804
- align: 'center',
11805
- ellipsis: true,
11806
- width: 70
11807
- }, {
11808
- dataIndex: 'goodNo',
11809
- title: "\u5546\u54C1SPU\u7F16\u7801",
11810
- align: 'center',
11811
- ellipsis: true,
11812
- width: 180
11813
- }, {
11814
- dataIndex: 'goodName',
11815
- title: "".concat(text, "\u5546\u54C1\u540D\u79F0"),
11816
- align: 'center',
11817
- ellipsis: true,
11818
- width: 250
11819
- }, {
11820
- dataIndex: 'specId',
11821
- title: "".concat(text, "SKUID"),
11822
- align: 'center',
11823
- ellipsis: true,
11824
- width: 100
11825
- }, {
11826
- dataIndex: 'specNo',
11827
- title: "".concat(text, "\u5546\u54C1SKU\u7F16\u7801"),
11828
- align: 'center',
11829
- ellipsis: true,
11830
- width: 180
11831
- }, {
11832
- dataIndex: 'specName',
11833
- title: "".concat(text, "\u5546\u54C1SKU\u540D\u79F0"),
11834
- align: 'center',
11835
- ellipsis: true,
11836
- width: 250
11837
- }, {
11838
- dataIndex: 'num',
11839
- title: "".concat(text, "\u9000\u8D27\u6570\u91CF"),
11840
- align: 'center',
11841
- ellipsis: true,
11842
- width: 100,
11843
- render: function render(val, record, index) {
11844
- return !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
11845
- style: {
11846
- width: 70
11847
- },
11848
- value: val,
11849
- min: 1,
11850
- precision: 0,
11851
- onChange: function onChange(num) {
11852
- return updateHandle(num, index, 'num');
11853
- }
11854
- }) : /*#__PURE__*/React.createElement("span", null, val);
11855
- }
11856
- }, {
11857
- dataIndex: 'sharePrice',
11858
- title: "\u5206\u644A\u4EF7",
11859
- align: 'center',
11860
- ellipsis: true,
11861
- width: 80,
11862
- render: function render(val, record, index) {
11863
- return !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
11864
- style: {
11865
- width: 70
11866
- },
11867
- value: val,
11868
- min: 0,
11869
- onChange: function onChange(value) {
11870
- return updateHandle(value, index, 'sharePrice');
11871
- }
11872
- }) : /*#__PURE__*/React.createElement("span", null, val);
11873
- }
11874
- }, {
11875
- dataIndex: 'returnPrice',
11876
- title: "".concat(text, "\u9000\u8D27\u91D1\u989D"),
11877
- align: 'center',
11878
- ellipsis: true,
11879
- width: 100
11880
- }, {
11881
- dataIndex: 'giftType',
11882
- title: "\u8D60\u54C1\u65B9\u5F0F",
11883
- align: 'center',
11884
- ellipsis: true,
11885
- width: 100,
11886
- render: function render(val) {
11887
- var giftTypeMap = {
11888
- 0: '非赠品',
11889
- 1: '自动赠送',
11890
- 2: '手工赠送',
11891
- 3: '回购自动送赠品',
11892
- 4: '前N有礼送赠品',
11893
- 6: '天猫优仓赠品',
11894
- 7: '淘宝CRM会员送赠'
11895
- };
11896
- return /*#__PURE__*/React.createElement("span", null, giftTypeMap[val]);
11897
- }
11898
- }, {
11899
- dataIndex: 'type',
11900
- title: "".concat(text, "\u5546\u54C1\u7C7B\u578B"),
11901
- align: 'center',
11902
- ellipsis: true,
11903
- width: 100,
11904
- render: function render(val, record, index) {
11905
- var options = [{
11906
- label: '单品',
11907
- value: '1'
11908
- }, {
11909
- label: '组合装',
11910
- value: '2'
11911
- }];
11912
- return !disabled ? /*#__PURE__*/React.createElement(Select, {
11913
- style: {
11914
- width: 70
11915
- },
11916
- options: options,
11917
- value: val,
11918
- onChange: function onChange(value) {
11919
- return updateHandle(value, index, 'type');
11920
- }
11921
- }) : /*#__PURE__*/React.createElement("span", null, val);
11922
- }
11923
- }];
11924
- }
11925
- break;
11926
- case 'WDT_EXCHANGE_GOODS':
11927
- {
11928
- columns = [{
11929
- dataIndex: 'goodId',
11930
- title: "SPUID",
11931
- align: 'center',
11932
- ellipsis: true,
11933
- width: 70
11934
- }, {
11935
- dataIndex: 'goodNo',
11936
- title: "\u5546\u54C1SPU\u7F16\u7801",
11937
- align: 'center',
11938
- ellipsis: true,
11939
- width: 180
11940
- }, {
11941
- dataIndex: 'goodName',
11942
- title: "".concat(text, "\u5546\u54C1\u540D\u79F0"),
11943
- align: 'center',
11944
- ellipsis: true,
11945
- width: 250
11946
- }, {
11947
- dataIndex: 'specId',
11948
- title: "".concat(text, "SKUID"),
11949
- align: 'center',
11950
- ellipsis: true,
11951
- width: 100
11952
- }, {
11953
- dataIndex: 'specNo',
11954
- title: "".concat(text, "\u5546\u54C1SKU\u7F16\u7801"),
11955
- align: 'center',
11956
- ellipsis: true,
11957
- width: 180
11958
- }, {
11959
- dataIndex: 'specName',
11960
- title: "".concat(text, "\u5546\u54C1SKU\u540D\u79F0"),
11961
- align: 'center',
11962
- ellipsis: true,
11963
- width: 250
11964
- }, {
11965
- dataIndex: 'num',
11966
- title: "".concat(text, "\u6362\u51FA\u6570\u91CF"),
11967
- align: 'center',
11968
- ellipsis: true,
11969
- width: 100,
11970
- render: function render(val, record, index) {
11971
- return !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
11972
- style: {
11973
- width: 70
11974
- },
11975
- value: val,
11976
- min: 1,
11977
- precision: 0,
11978
- onChange: function onChange(num) {
11979
- return updateHandle(num, index, 'num');
11980
- }
11981
- }) : /*#__PURE__*/React.createElement("span", null, val);
11982
- }
11983
- }, {
11984
- dataIndex: 'price',
11985
- title: "".concat(text, "\u5546\u54C1\u5355\u4EF7"),
11986
- align: 'center',
11987
- ellipsis: true,
11988
- width: 100,
11989
- render: function render(val, record, index) {
11990
- return !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
11991
- style: {
11992
- width: 70
11993
- },
11994
- value: val,
11995
- min: 0,
11996
- onChange: function onChange(value) {
11997
- return updateHandle(value, index, 'price');
11998
- }
11999
- }) : /*#__PURE__*/React.createElement("span", null, val);
12000
- }
12001
- }, {
12002
- dataIndex: 'exchangePrice',
12003
- title: "".concat(text, "\u6362\u51FA\u91D1\u989D"),
12004
- align: 'center',
12005
- ellipsis: true,
12006
- width: 100
12007
- }, {
12008
- dataIndex: 'giftType',
12009
- title: "\u8D60\u54C1\u65B9\u5F0F",
12010
- align: 'center',
12011
- ellipsis: true,
12012
- width: 100,
12013
- render: function render(val) {
12014
- var giftTypeMap = {
12015
- 0: '非赠品',
12016
- 1: '自动赠送',
12017
- 2: '手工赠送',
12018
- 3: '回购自动送赠品',
12019
- 4: '前N有礼送赠品',
12020
- 6: '天猫优仓赠品',
12021
- 7: '淘宝CRM会员送赠'
12022
- };
12023
- return /*#__PURE__*/React.createElement("span", null, giftTypeMap[val]);
12024
- }
12025
- }, {
12026
- dataIndex: 'type',
12027
- title: "".concat(text, "\u5546\u54C1\u7C7B\u578B"),
12028
- align: 'center',
12029
- ellipsis: true,
12030
- width: 100,
12031
- render: function render(val, record, index) {
12032
- var options = [{
12033
- label: '单品',
12034
- value: '1'
12035
- }, {
12036
- label: '组合装',
12037
- value: '2'
12038
- }];
12039
- return !disabled ? /*#__PURE__*/React.createElement(Select, {
12040
- style: {
12041
- width: 70
12042
- },
12043
- options: options,
12044
- value: val,
12045
- onChange: function onChange(value) {
12046
- return updateHandle(value, index, 'type');
12047
- }
12048
- }) : /*#__PURE__*/React.createElement("span", null, val);
12049
- }
12050
- }];
12051
- }
12052
- break;
12053
11773
  default:
12054
11774
  columns = [{
12055
11775
  dataIndex: 'mark',
@@ -12191,7 +11911,7 @@ var GoodItem$1 = function GoodItem(props) {
12191
11911
  }, [showHeader, value, disabled]);
12192
11912
  var onSubmit = function onSubmit(list) {
12193
11913
  var newList = [];
12194
- if (['WDT_REISSUE_GOODS', 'WDT_GOODS', 'WDT_EXCHANGE_GOODS'].includes(type)) {
11914
+ if (['WDT_REISSUE_GOODS', 'WDT_GOODS'].includes(type)) {
12195
11915
  newList = list.map(function (item) {
12196
11916
  item.uuid = uuid();
12197
11917
  item.canDelete = true;
@@ -12199,10 +11919,6 @@ var GoodItem$1 = function GoodItem(props) {
12199
11919
  item.orderPrice = 0;
12200
11920
  item.sharePrice = 0;
12201
11921
  item.canUpdateNumber = canUpdateNumber;
12202
- if (type === 'WDT_EXCHANGE_GOODS') {
12203
- item.price = item.retailPrice;
12204
- item.type = '1';
12205
- }
12206
11922
  return item;
12207
11923
  });
12208
11924
  } else {
@@ -12273,7 +11989,7 @@ var GoodItem$1 = function GoodItem(props) {
12273
11989
  locale: {
12274
11990
  emptyText: '暂无数据'
12275
11991
  }
12276
- })), ['WDT_REISSUE_GOODS', 'WDT_GOODS', 'WDT_EXCHANGE_GOODS'].includes(type) ? /*#__PURE__*/React.createElement(WdtGoodsModal, {
11992
+ })), ['WDT_REISSUE_GOODS', 'WDT_GOODS'].includes(type) ? /*#__PURE__*/React.createElement(WdtGoodsModal, {
12277
11993
  ref: refModal,
12278
11994
  onSubmit: onSubmit,
12279
11995
  width: width,
@@ -13143,10 +12859,8 @@ var componentMap$1 = {
13143
12859
  reissueType: 'wdtReissueType',
13144
12860
  returnType: 'wdtReturnType',
13145
12861
  returnSelectListReturn: 'wdtReturnSelectListReturn',
13146
- returnSelectList: 'wdtReturnSelectList',
13147
12862
  deleteGood: 'wdtDeleteGood',
13148
- returnDeleteGood: 'wdtReturnDeleteGood',
13149
- exchangeDeleteGood: 'wdtExchangeDeleteGood'
12863
+ returnDeleteGood: 'wdtReturnDeleteGood'
13150
12864
  }
13151
12865
  }
13152
12866
  };
@@ -13213,7 +12927,7 @@ var CommonGoods = function CommonGoods(props) {
13213
12927
  setTableSelect(['2', '4'].includes(data.val));
13214
12928
  if (['1', '3'].includes(data.val)) {
13215
12929
  var _valueRef$current5, _valueRef$current6;
13216
- pubsub.publish(componentMap$1[compType].eventNameMap.returnSelectListReturn, {
12930
+ pubsub.publish(componentMap$1[type].eventNameMap.returnSelectListReturn, {
13217
12931
  list: 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]) || []),
13218
12932
  shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current6 = valueRef.current) === null || _valueRef$current6 === void 0 ? void 0 : _valueRef$current6.shopCode,
13219
12933
  goodValue: data === null || data === void 0 ? void 0 : data.goodValue
@@ -13231,15 +12945,15 @@ var CommonGoods = function CommonGoods(props) {
13231
12945
  };
13232
12946
  }, [disabled]);
13233
12947
  var _onSelect = function onSelect(list) {
13234
- var _typeMap, _withInfo$current, _withInfo$current2, _valueRef$current7;
12948
+ var _withInfo$current, _withInfo$current2, _valueRef$current7;
13235
12949
  if (disabled) return;
13236
12950
  var newList = cloneDeep(list);
13237
- var typeMap = (_typeMap = {
12951
+ var typeMap = _defineProperty({
13238
12952
  // type: componentMap[compType].eventNameMap.selectList,
13239
12953
  // returnType: componentMap[compType].eventNameMap.returnSelectList,
13240
12954
  // reissueType: componentMap[compType].eventNameMap.reissueSelectList,
13241
12955
  type: componentMap$1[compType].eventNameMap.selectList
13242
- }, _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);
12956
+ }, "".concat(componentMap$1[compType].type, "ReissueType"), componentMap$1[compType].eventNameMap.reissueSelectList);
13243
12957
  var type = typeMap[(_withInfo$current = withInfo.current) === null || _withInfo$current === void 0 ? void 0 : _withInfo$current.type];
13244
12958
  // console.log('onSelect', type, withInfo.current, newList);
13245
12959
  pubsub.publish(type, {
@@ -13257,7 +12971,6 @@ var CommonGoods = function CommonGoods(props) {
13257
12971
  pubsub.publish(componentMap$1[compType].eventNameMap.deleteGood, deleteId);
13258
12972
  pubsub.publish(componentMap$1[compType].eventNameMap.reissueDeleteGood, deleteId);
13259
12973
  pubsub.publish(componentMap$1[compType].eventNameMap.returnDeleteGood, deleteId);
13260
- pubsub.publish(componentMap$1[compType].eventNameMap.exchangeDeleteGood, deleteId);
13261
12974
  };
13262
12975
  var changeHandle = function changeHandle(list) {
13263
12976
  onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, componentMap$1[compType].key, list)));
@@ -13282,263 +12995,6 @@ var CommonGoods = function CommonGoods(props) {
13282
12995
  }));
13283
12996
  };
13284
12997
 
13285
- var componentMap$2 = {
13286
- 'WDT_RETURN_GOODS': {
13287
- type: 'wdt',
13288
- valueKey: 'wdtReturnGoods',
13289
- returnTypeKey: 'wdtReturnType',
13290
- name: '旺店通',
13291
- eventNameMap: {
13292
- changeShopCode: 'wdtChangeShopCode',
13293
- returnType: 'wdtReturnType',
13294
- returnSelectListReturn: 'wdtReturnSelectListReturn',
13295
- returnDeleteGood: 'wdtReturnDeleteGood',
13296
- returnSelectList: 'wdtReturnSelectList',
13297
- exchangeCopyGood: 'wdtExchangeCopyGood',
13298
- exchangeBackCopyGood: 'wdtExchangeBackCopyGood'
13299
- }
13300
- }
13301
- };
13302
- var CommonReturnGoods = function CommonReturnGoods(props) {
13303
- var value = props.value,
13304
- onChange = props.onChange,
13305
- _props$reasonList = props.reasonList,
13306
- reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
13307
- disabled = props.disabled,
13308
- compType = props.type;
13309
- var valueRef = useRef({});
13310
- useEffect(function () {
13311
- var subscription = pubsub.subscribe(componentMap$2[compType].eventNameMap.exchangeCopyGood, function () {
13312
- var _valueRef$current, _valueRef$current2;
13313
- pubsub.publish(componentMap$2[compType].eventNameMap.exchangeBackCopyGood, {
13314
- list: 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]) || []),
13315
- shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current2 = valueRef.current) === null || _valueRef$current2 === void 0 ? void 0 : _valueRef$current2.shopCode
13316
- });
13317
- });
13318
- return function () {
13319
- pubsub.unsubscribe(subscription);
13320
- };
13321
- }, []);
13322
- useEffect(function () {
13323
- var subscription = pubsub.subscribe(componentMap$2[compType].eventNameMap.returnSelectList, function (_, data) {
13324
- if (disabled) return;
13325
- var newValue = _objectSpread2(_objectSpread2({}, data.goodValue), {}, {
13326
- shopCode: data === null || data === void 0 ? void 0 : data.shopCode
13327
- });
13328
- if (compType === 'WDT_RETURN_GOODS') {
13329
- newValue[componentMap$2[compType].valueKey] = ((data === null || data === void 0 ? void 0 : data.list) || []).map(function (item) {
13330
- if (typeof item.type === 'undefined') {
13331
- item.type = '1';
13332
- }
13333
- if (typeof item.returnPrice === 'undefined') {
13334
- item.returnPrice = new BigNumber(item.num).multipliedBy(new BigNumber(item.sharePrice)).toString();
13335
- }
13336
- if (item.srcOid) {
13337
- item.oid = item.srcOid;
13338
- }
13339
- return item;
13340
- });
13341
- } else {
13342
- newValue[componentMap$2[compType].valueKey] = (data === null || data === void 0 ? void 0 : data.list) || [];
13343
- }
13344
- onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
13345
- });
13346
- return function () {
13347
- pubsub.unsubscribe(subscription);
13348
- };
13349
- }, []);
13350
- useEffect(function () {
13351
- var subscription = pubsub.subscribe(componentMap$2[compType].eventNameMap.returnSelectListReturn, function (_, data) {
13352
- if (disabled) return;
13353
- var newValue = _objectSpread2(_objectSpread2({}, data.goodValue), {}, {
13354
- shopCode: data === null || data === void 0 ? void 0 : data.shopCode
13355
- });
13356
- if (compType === 'WDT_RETURN_GOODS') {
13357
- newValue[componentMap$2[compType].valueKey] = ((data === null || data === void 0 ? void 0 : data.list) || []).map(function (item) {
13358
- if (typeof item.type === 'undefined') {
13359
- item.type = '1';
13360
- }
13361
- if (typeof item.returnPrice === 'undefined') {
13362
- item.returnPrice = new BigNumber(item.num).multipliedBy(new BigNumber(item.sharePrice)).toString();
13363
- }
13364
- if (item.srcOid) {
13365
- item.oid = item.srcOid;
13366
- }
13367
- return item;
13368
- });
13369
- } else {
13370
- newValue[componentMap$2[compType].valueKey] = (data === null || data === void 0 ? void 0 : data.list) || [];
13371
- }
13372
- onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
13373
- });
13374
- return function () {
13375
- pubsub.unsubscribe(subscription);
13376
- };
13377
- }, []);
13378
- useEffect(function () {
13379
- valueRef.current = value;
13380
- pubsub.subscribeOnce(componentMap$2[compType].eventNameMap.returnDeleteGood, function (_, data) {
13381
- if (disabled) return;
13382
- if (value) {
13383
- var newValue = _objectSpread2({}, value);
13384
- newValue[componentMap$2[compType].valueKey] = newValue[componentMap$2[compType].valueKey].filter(function (item) {
13385
- return item.sku !== data;
13386
- });
13387
- onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
13388
- }
13389
- });
13390
- pubsub.subscribeOnce(componentMap$2[compType].eventNameMap.changeShopCode, function (type, data) {
13391
- onChange(_objectSpread2(_objectSpread2({}, value), {}, {
13392
- shopCode: data.shopCode
13393
- }));
13394
- });
13395
- }, [value, disabled]);
13396
- var changeTypeHandle = function changeTypeHandle(val) {
13397
- var newValue = _objectSpread2({}, value);
13398
- newValue[componentMap$2[compType].returnTypeKey] = val;
13399
- newValue[componentMap$2[compType].valueKey] = [];
13400
- if (['2'].includes(val[0])) {
13401
- onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
13402
- valueRef.current = newValue;
13403
- }
13404
- pubsub.publish(componentMap$2[compType].eventNameMap.returnType, {
13405
- val: val[0],
13406
- goodValue: newValue
13407
- });
13408
- };
13409
- var changeGoodHandle = function changeGoodHandle(val) {
13410
- var newValue = _objectSpread2({}, value);
13411
- newValue[componentMap$2[compType].valueKey] = val;
13412
- onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
13413
- };
13414
- //显示选择商品按钮 原单换不显示选择商品
13415
- // const showChangeBtn = useMemo(() => {
13416
- // return ['2'].includes(value?.[componentMap[compType].returnTypeKey]?.[0]);
13417
- // }, [value?.[componentMap[compType].returnTypeKey]]);
13418
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Cascader, {
13419
- style: {
13420
- marginBottom: '8px'
13421
- },
13422
- disabled: disabled,
13423
- allowClear: false,
13424
- options: reasonList,
13425
- value: value === null || value === void 0 ? void 0 : value[componentMap$2[compType].returnTypeKey],
13426
- onChange: function onChange(val) {
13427
- return changeTypeHandle(val);
13428
- }
13429
- }), /*#__PURE__*/React.createElement(GoodItem$1, _objectSpread2(_objectSpread2({
13430
- key: componentMap$2[compType].type
13431
- }, props), {}, {
13432
- disabled: disabled,
13433
- canUpdateNumber: true,
13434
- showChangeBtn: false,
13435
- shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
13436
- value: value === null || value === void 0 ? void 0 : value[componentMap$2[compType].valueKey],
13437
- onChange: function onChange(val) {
13438
- return changeGoodHandle(val);
13439
- }
13440
- })));
13441
- };
13442
-
13443
- var componentMap$3 = {
13444
- 'WDT_EXCHANGE_GOODS': {
13445
- type: 'wdt',
13446
- valueKey: 'wdtExchangeGoods',
13447
- returnTypeKey: 'wdtExchangeType',
13448
- name: '旺店通',
13449
- eventNameMap: {
13450
- changeShopCode: 'wdtChangeShopCode',
13451
- exchangeDeleteGood: 'wdtExchangeDeleteGood',
13452
- exchangeCopyGood: 'wdtExchangeCopyGood',
13453
- exchangeBackCopyGood: 'wdtExchangeBackCopyGood'
13454
- }
13455
- }
13456
- };
13457
- var CommonExchangeGoods = function CommonExchangeGoods(props) {
13458
- var value = props.value,
13459
- onChange = props.onChange,
13460
- disabled = props.disabled,
13461
- compType = props.type;
13462
- var valueRef = useRef({});
13463
- useEffect(function () {
13464
- var subscription = pubsub.subscribe(componentMap$3[compType].eventNameMap.exchangeBackCopyGood, function (_, data) {
13465
- if (disabled) return;
13466
- var newValue = {
13467
- shopCode: data === null || data === void 0 ? void 0 : data.shopCode
13468
- };
13469
- if (compType === 'WDT_EXCHANGE_GOODS') {
13470
- newValue[componentMap$3[compType].valueKey] = ((data === null || data === void 0 ? void 0 : data.list) || []).map(function (item) {
13471
- if (typeof item.type === 'undefined') {
13472
- item.type = '1';
13473
- }
13474
- item.price = item.sharePrice;
13475
- if (typeof item.exchangePrice === 'undefined') {
13476
- item.exchangePrice = new BigNumber(item.num).multipliedBy(new BigNumber(item.price)).toString();
13477
- }
13478
- return item;
13479
- });
13480
- } else {
13481
- newValue[componentMap$3[compType].valueKey] = (data === null || data === void 0 ? void 0 : data.list) || [];
13482
- }
13483
- onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
13484
- });
13485
- return function () {
13486
- pubsub.unsubscribe(subscription);
13487
- };
13488
- });
13489
- useEffect(function () {
13490
- valueRef.current = value;
13491
- pubsub.subscribeOnce(componentMap$3[compType].eventNameMap.exchangeDeleteGood, function (_, data) {
13492
- if (disabled) return;
13493
- if (value) {
13494
- var newValue = _objectSpread2({}, value);
13495
- newValue[componentMap$3[compType].valueKey] = newValue[componentMap$3[compType].valueKey].filter(function (item) {
13496
- return item.sku !== data;
13497
- });
13498
- onChange(newValue);
13499
- }
13500
- });
13501
- pubsub.subscribeOnce(componentMap$3[compType].eventNameMap.changeShopCode, function (type, data) {
13502
- onChange(_objectSpread2(_objectSpread2({}, value), {}, {
13503
- shopCode: data.shopCode
13504
- }));
13505
- });
13506
- }, [value]);
13507
- var changeGoodHandle = function changeGoodHandle(val) {
13508
- var newValue = _objectSpread2({}, value);
13509
- if (compType === 'WDT_EXCHANGE_GOODS') {
13510
- val = val.map(function (item) {
13511
- item.exchangePrice = new BigNumber(item.num).multipliedBy(new BigNumber(item.price)).toString();
13512
- return item;
13513
- });
13514
- }
13515
- newValue[componentMap$3[compType].valueKey] = val;
13516
- onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
13517
- };
13518
- var copyGoods = function copyGoods() {
13519
- var copyHandle = function copyHandle() {
13520
- pubsub.publish(componentMap$3[compType].eventNameMap.exchangeCopyGood, 'WDT_EXCHANGE_GOODS');
13521
- };
13522
- return /*#__PURE__*/React.createElement(Button, {
13523
- type: "link",
13524
- onClick: copyHandle
13525
- }, "\u590D\u5236\u9000\u56DE\u5546\u54C1");
13526
- };
13527
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(GoodItem$1, _objectSpread2(_objectSpread2({
13528
- key: componentMap$3[compType].type
13529
- }, props), {}, {
13530
- disabled: disabled,
13531
- canUpdateNumber: true,
13532
- showChangeBtn: true,
13533
- shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
13534
- value: value === null || value === void 0 ? void 0 : value[componentMap$3[compType].valueKey],
13535
- otherOperations: copyGoods(),
13536
- onChange: function onChange(val) {
13537
- return changeGoodHandle(val);
13538
- }
13539
- })));
13540
- };
13541
-
13542
12998
  var _excluded$g = ["value", "onChange", "reasonList", "disabled", "type"];
13543
12999
  var typeMap$1 = {
13544
13000
  WDT_REISSUE_GOODS: {
@@ -14381,11 +13837,11 @@ var CommonSystemOrder = function CommonSystemOrder(props) {
14381
13837
  },
14382
13838
  value: (_value$changeIndex2 = value[changeIndex]) === null || _value$changeIndex2 === void 0 ? void 0 : _value$changeIndex2.returnGoodsTradeId
14383
13839
  })) : null, type === 3 ? /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Input, {
14384
- disabled: disabled,
13840
+ disabled: true,
14385
13841
  placeholder: "\u8BF7\u8F93\u5165\u8865\u53D1\u5355id",
14386
13842
  value: (_value$changeIndex3 = value[changeIndex]) === null || _value$changeIndex3 === void 0 ? void 0 : _value$changeIndex3.billNo
14387
13843
  })) : null, type === 4 ? /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Input, {
14388
- disabled: disabled,
13844
+ disabled: true,
14389
13845
  placeholder: "\u8BF7\u8F93\u5165\u6362\u8D27\u5355id",
14390
13846
  value: (_value$changeIndex4 = value[changeIndex]) === null || _value$changeIndex4 === void 0 ? void 0 : _value$changeIndex4.billNo
14391
13847
  })) : null) : null);
@@ -14552,4 +14008,4 @@ var CalculationInput = function CalculationInput(props) {
14552
14008
  }, config === null || config === void 0 ? void 0 : config.unit));
14553
14009
  };
14554
14010
 
14555
- export { ApaasAddress as Address, AliPay, Province as ApaasAddress, ApaasCascader, ApaasCheckbox, ApaasDate, withFormItem as ApaasHoc, ApaasInput, ApaasInputNumber, ApaasLogistics, ApaasMultipleSelect, ApaasPosting, ApaasRadio, ApaasRate, ApaasSelect, ApaasSlider, ApaasTextArea, ApaasUpload, index as ApaasUploadAsync, ApaasUploadFile, BsExchange, BsGoods, BsReissue, BsReturnGoods as BsReturn, index$1 as BsSystemOrder, BuyerNick, CalculationInput, ChooseBaby, CommonExchangeGoods, CommonGoods, CommonSystemOrder$1 as CommonMultiStatus, CommonReturnGoods, CommonStatus, CommonSystemOrder, ExpressLogistics, Goods, index$2 as GoodsTable, IdentifyAddress, Invoice, jstGoods as JstGoods, ItemList as JstItemList, LogisticsInterception, LogisticsMoreInterception, LogisticsMoreTrajectory, LogisticsTrajectory, MsgStatus, ParseLogistics, Payment, RemarkInput as Remark, ExpressLogistics as ReturnLogistics, ShopNameSelect as ShopName, Status, Supplier, TBGoodId, TBGoodSerial, TradeId, WdtGoodList, wdtReissue as WdtReissue, WlnGoods };
14011
+ export { ApaasAddress as Address, AliPay, Province as ApaasAddress, ApaasCascader, ApaasCheckbox, ApaasDate, withFormItem as ApaasHoc, ApaasInput, ApaasInputNumber, ApaasLogistics, ApaasMultipleSelect, ApaasPosting, ApaasRadio, ApaasRate, ApaasSelect, ApaasSlider, ApaasTextArea, ApaasUpload, index as ApaasUploadAsync, ApaasUploadFile, BsExchange, BsGoods, BsReissue, BsReturnGoods as BsReturn, index$1 as BsSystemOrder, BuyerNick, CalculationInput, ChooseBaby, CommonGoods, CommonSystemOrder$1 as CommonMultiStatus, CommonStatus, CommonSystemOrder, ExpressLogistics, Goods, index$2 as GoodsTable, IdentifyAddress, Invoice, jstGoods as JstGoods, ItemList as JstItemList, LogisticsInterception, LogisticsMoreInterception, LogisticsMoreTrajectory, LogisticsTrajectory, MsgStatus, ParseLogistics, Payment, RemarkInput as Remark, ExpressLogistics as ReturnLogistics, ShopNameSelect as ShopName, Status, Supplier, TBGoodId, TBGoodSerial, TradeId, WdtGoodList, wdtReissue as WdtReissue, WlnGoods };