@kmkf-fe-packages/basic-components 2.0.12-beta.3 → 2.0.12-beta.30

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, InputNumber, Input, Select, Upload, Image, messag
3
3
  import { EyeOutlined, DeleteOutlined, CloseCircleOutlined, CaretUpOutlined } 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, request as request$1, ExpressData, uuid, columnsGoodsList, LogisticsAddressData, SendDataCenter, BS_E3_BOOLEAN_STATUS_MAP, isNull, filterWdtOrders, WDT_ORDER_TYPE_MAP, filterBsE3Orders, filterGyOrders, GY_DELIVERY_STATE_MAPPING, filterJstOrders, filterKmOrders, 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, updateWdtGoodsHandle, updateBsE3GoodsHandle, updateGyGoodsHandle, updateJstGoodsHandle, msgTypeCh } from '@kmkf-fe-packages/kmkf-utils';
6
+ import { AddressData, BsAddressData, WdtAddressData, GyAddressData, request as request$1, ExpressData, uuid, columnsGoodsList, LogisticsAddressData, SendDataCenter, BS_E3_BOOLEAN_STATUS_MAP, isNull, filterWdtOrders, WDT_ORDER_TYPE_MAP, filterBsE3Orders, filterGyOrders, GY_DELIVERY_STATE_MAPPING, filterJstOrders, filterKmOrders, 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, updateWdtGoodsHandle, updateBsE3GoodsHandle, updateGyGoodsHandle, updateJstGoodsHandle, jstMergeIdenticalGoods, msgTypeCh } from '@kmkf-fe-packages/kmkf-utils';
7
7
  import { debounce, isNaN as isNaN$1, isNumber as isNumber$1, cloneDeep, difference, differenceWith, takeRight, reject, isEmpty, intersection, uniqBy } from 'lodash';
8
8
  import { useUpdateEffect, useDebounceEffect, useAntdTable } from 'ahooks';
9
9
  import zhCN from 'antd/lib/locale/zh_CN';
@@ -12516,7 +12516,6 @@ var getTableData$2 = function getTableData(_ref, formData) {
12516
12516
  var current = _ref.current,
12517
12517
  pageSize = _ref.pageSize;
12518
12518
  var data = {
12519
- goodShortName: formData.goodShortName || null,
12520
12519
  goodNo: formData.goodNo || null,
12521
12520
  goodName: formData.goodName || null,
12522
12521
  skuCode: formData.skuCode || null,
@@ -12674,17 +12673,6 @@ var GoodList$2 = function GoodList(props, ref) {
12674
12673
  layout: "inline",
12675
12674
  form: form
12676
12675
  }, /*#__PURE__*/React.createElement(Form.Item, {
12677
- name: "goodShortName",
12678
- style: {
12679
- marginBottom: '12px'
12680
- }
12681
- }, /*#__PURE__*/React.createElement(Input, {
12682
- placeholder: "\u5546\u54C1\u7B80\u79F0",
12683
- allowClear: true,
12684
- style: {
12685
- width: 150
12686
- }
12687
- })), /*#__PURE__*/React.createElement(Form.Item, {
12688
12676
  name: "goodNo",
12689
12677
  style: {
12690
12678
  marginBottom: '12px'
@@ -14376,8 +14364,15 @@ var getColumns$4 = function getColumns(_ref) {
14376
14364
  };
14377
14365
  };
14378
14366
 
14379
- var getColumns$5 = function getColumns(_ref) {
14380
- var _ref$text = _ref.text,
14367
+ var fillAttrs = function fillAttrs(item) {
14368
+ if (!item.width) item.width = 150;
14369
+ if (typeof item.ellipsis !== 'boolean') item.ellipsis = true;
14370
+ if (!item.align) item.align = 'center';
14371
+ return item;
14372
+ };
14373
+ var getColumns$5 = function getColumns() {
14374
+ var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
14375
+ _ref$text = _ref.text,
14381
14376
  disabled = _ref.disabled,
14382
14377
  updateHandle = _ref.updateHandle;
14383
14378
  return {
@@ -14441,7 +14436,7 @@ var getColumns$5 = function getColumns(_ref) {
14441
14436
  min: 0,
14442
14437
  precision: 2,
14443
14438
  onChange: function onChange(num) {
14444
- return updateHandle(num, index, 'salePrice');
14439
+ return updateHandle === null || updateHandle === void 0 ? void 0 : updateHandle(num, index, 'salePrice');
14445
14440
  }
14446
14441
  }) : /*#__PURE__*/React.createElement("span", null, val || val === 0 ? Number(val).toFixed(2) : '');
14447
14442
  }
@@ -14460,7 +14455,7 @@ var getColumns$5 = function getColumns(_ref) {
14460
14455
  min: 1,
14461
14456
  precision: 0,
14462
14457
  onChange: function onChange(num) {
14463
- return updateHandle(num, index, 'qty');
14458
+ return updateHandle === null || updateHandle === void 0 ? void 0 : updateHandle(num, index, 'qty');
14464
14459
  }
14465
14460
  }) : /*#__PURE__*/React.createElement("span", null, val);
14466
14461
  }
@@ -14489,7 +14484,7 @@ var getColumns$5 = function getColumns(_ref) {
14489
14484
  return record.canEdit && !disabled ? /*#__PURE__*/React.createElement(Select, {
14490
14485
  value: val,
14491
14486
  onChange: function onChange(value) {
14492
- updateHandle(value, index, 'isGift');
14487
+ updateHandle === null || updateHandle === void 0 ? void 0 : updateHandle(value, index, 'isGift');
14493
14488
  },
14494
14489
  options: [{
14495
14490
  label: '是',
@@ -14567,7 +14562,7 @@ var getColumns$5 = function getColumns(_ref) {
14567
14562
  min: 0,
14568
14563
  precision: 2,
14569
14564
  onChange: function onChange(num) {
14570
- return updateHandle(num, index, 'salePrice');
14565
+ return updateHandle === null || updateHandle === void 0 ? void 0 : updateHandle(num, index, 'salePrice');
14571
14566
  }
14572
14567
  }) : /*#__PURE__*/React.createElement("span", null, val || val === 0 ? Number(val).toFixed(2) : '');
14573
14568
  }
@@ -14586,7 +14581,7 @@ var getColumns$5 = function getColumns(_ref) {
14586
14581
  min: 1,
14587
14582
  precision: 0,
14588
14583
  onChange: function onChange(num) {
14589
- return updateHandle(num, index, 'qty');
14584
+ return updateHandle === null || updateHandle === void 0 ? void 0 : updateHandle(num, index, 'qty');
14590
14585
  }
14591
14586
  }) : /*#__PURE__*/React.createElement("span", null, val);
14592
14587
  }
@@ -14600,7 +14595,7 @@ var getColumns$5 = function getColumns(_ref) {
14600
14595
  return record.canEdit && !disabled ? /*#__PURE__*/React.createElement(Select, {
14601
14596
  value: val,
14602
14597
  onChange: function onChange(value) {
14603
- updateHandle(value, index, 'isGift');
14598
+ updateHandle === null || updateHandle === void 0 ? void 0 : updateHandle(value, index, 'isGift');
14604
14599
  },
14605
14600
  options: [{
14606
14601
  label: '是',
@@ -14624,11 +14619,222 @@ var getColumns$5 = function getColumns(_ref) {
14624
14619
  },
14625
14620
  value: val,
14626
14621
  onChange: function onChange(e) {
14627
- return updateHandle(e.target.value, index, 'remark');
14622
+ return updateHandle === null || updateHandle === void 0 ? void 0 : updateHandle(e.target.value, index, 'remark');
14628
14623
  }
14629
14624
  }) : /*#__PURE__*/React.createElement("span", null, val);
14630
14625
  }
14631
- }]
14626
+ }],
14627
+ JST_RETURN_GOODS: [{
14628
+ dataIndex: 'name',
14629
+ title: '商品名称'
14630
+ }, {
14631
+ dataIndex: 'skuId',
14632
+ title: '商品编码'
14633
+ }, {
14634
+ dataIndex: 'iId',
14635
+ title: '款式编码'
14636
+ }, {
14637
+ dataIndex: 'pic',
14638
+ title: '商品图片',
14639
+ width: 100,
14640
+ render: function render(val) {
14641
+ return /*#__PURE__*/React.createElement(Image, {
14642
+ width: 60,
14643
+ src: val
14644
+ });
14645
+ }
14646
+ }, {
14647
+ dataIndex: 'propertiesValue',
14648
+ title: '规格值'
14649
+ }, {
14650
+ dataIndex: 'saleBasePrice',
14651
+ title: '原价',
14652
+ render: function render(price) {
14653
+ return price || price === 0 ? Number(price).toFixed(2) : '';
14654
+ }
14655
+ }, {
14656
+ dataIndex: 'salePrice',
14657
+ title: '单价',
14658
+ width: 120,
14659
+ render: function render(val, record, index) {
14660
+ return !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
14661
+ style: {
14662
+ width: 70
14663
+ },
14664
+ value: val,
14665
+ min: 0,
14666
+ precision: 2,
14667
+ onChange: function onChange(num) {
14668
+ return updateHandle === null || updateHandle === void 0 ? void 0 : updateHandle(num, index, 'salePrice');
14669
+ }
14670
+ }) : /*#__PURE__*/React.createElement("span", null, val || val === 0 ? Number(val).toFixed(2) : '');
14671
+ }
14672
+ }, {
14673
+ dataIndex: 'qty',
14674
+ title: '数量',
14675
+ width: 100,
14676
+ render: function render(val, record, index) {
14677
+ return !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
14678
+ style: {
14679
+ width: 70
14680
+ },
14681
+ value: val,
14682
+ min: 1,
14683
+ precision: 0,
14684
+ onChange: function onChange(num) {
14685
+ return updateHandle === null || updateHandle === void 0 ? void 0 : updateHandle(num, index, 'qty');
14686
+ }
14687
+ }) : /*#__PURE__*/React.createElement("span", null, val);
14688
+ }
14689
+ }, {
14690
+ dataIndex: 'saleAmount',
14691
+ title: '总金额',
14692
+ render: function render(val, record) {
14693
+ return (record.qty || 0) * (+record.salePrice || 0);
14694
+ }
14695
+ }, {
14696
+ dataIndex: 'batchId',
14697
+ title: '批次号'
14698
+ }, {
14699
+ dataIndex: 'isGift',
14700
+ title: '是否赠品',
14701
+ width: 100,
14702
+ render: function render(val, record, index) {
14703
+ return !disabled ? /*#__PURE__*/React.createElement(Select, {
14704
+ value: val,
14705
+ onChange: function onChange(value) {
14706
+ updateHandle === null || updateHandle === void 0 ? void 0 : updateHandle(value, index, 'isGift');
14707
+ },
14708
+ options: [{
14709
+ label: '是',
14710
+ value: true
14711
+ }, {
14712
+ label: '否',
14713
+ value: false
14714
+ }]
14715
+ }) : /*#__PURE__*/React.createElement("span", null, typeof val !== 'boolean' ? '' : val ? '是' : '否');
14716
+ }
14717
+ }, {
14718
+ dataIndex: 'remark',
14719
+ title: '备注',
14720
+ render: function render(val, record, index) {
14721
+ return !disabled ? /*#__PURE__*/React.createElement(Input, {
14722
+ style: {
14723
+ width: 70
14724
+ },
14725
+ value: val,
14726
+ onChange: function onChange(e) {
14727
+ return updateHandle === null || updateHandle === void 0 ? void 0 : updateHandle(e.target.value, index, 'remark');
14728
+ }
14729
+ }) : /*#__PURE__*/React.createElement("span", null, val);
14730
+ }
14731
+ }, {
14732
+ dataIndex: 'outerOiId',
14733
+ title: '子订单号',
14734
+ width: 240
14735
+ }].map(fillAttrs),
14736
+ JST_EXCHANGE_GOODS: [{
14737
+ dataIndex: 'name',
14738
+ title: '商品名称'
14739
+ }, {
14740
+ dataIndex: 'skuId',
14741
+ title: '商品编码'
14742
+ }, {
14743
+ dataIndex: 'iId',
14744
+ title: '款式编码'
14745
+ }, {
14746
+ dataIndex: 'pic',
14747
+ title: '商品图片',
14748
+ width: 100,
14749
+ render: function render(val) {
14750
+ return /*#__PURE__*/React.createElement(Image, {
14751
+ width: 60,
14752
+ src: val
14753
+ });
14754
+ }
14755
+ }, {
14756
+ dataIndex: 'propertiesValue',
14757
+ title: '规格值'
14758
+ }, {
14759
+ dataIndex: 'saleBasePrice',
14760
+ title: '原价',
14761
+ render: function render(price) {
14762
+ return price || price === 0 ? Number(price).toFixed(2) : '';
14763
+ }
14764
+ }, {
14765
+ dataIndex: 'salePrice',
14766
+ title: '单价',
14767
+ width: 120,
14768
+ render: function render(val, record, index) {
14769
+ return !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
14770
+ style: {
14771
+ width: 70
14772
+ },
14773
+ value: val,
14774
+ min: 0,
14775
+ precision: 2,
14776
+ onChange: function onChange(num) {
14777
+ return updateHandle === null || updateHandle === void 0 ? void 0 : updateHandle(num, index, 'salePrice');
14778
+ }
14779
+ }) : /*#__PURE__*/React.createElement("span", null, val || val === 0 ? Number(val).toFixed(2) : '');
14780
+ }
14781
+ }, {
14782
+ dataIndex: 'qty',
14783
+ title: '数量',
14784
+ width: 100,
14785
+ render: function render(val, record, index) {
14786
+ return !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
14787
+ style: {
14788
+ width: 70
14789
+ },
14790
+ value: val,
14791
+ min: 1,
14792
+ precision: 0,
14793
+ onChange: function onChange(num) {
14794
+ return updateHandle === null || updateHandle === void 0 ? void 0 : updateHandle(num, index, 'qty');
14795
+ }
14796
+ }) : /*#__PURE__*/React.createElement("span", null, val);
14797
+ }
14798
+ }, {
14799
+ dataIndex: 'saleAmount',
14800
+ title: '总金额',
14801
+ render: function render(val, record) {
14802
+ return (record.qty || 0) * (+record.salePrice || 0);
14803
+ }
14804
+ }, {
14805
+ dataIndex: 'isGift',
14806
+ title: '是否赠品',
14807
+ width: 100,
14808
+ render: function render(val, record, index) {
14809
+ return !disabled ? /*#__PURE__*/React.createElement(Select, {
14810
+ value: val,
14811
+ onChange: function onChange(value) {
14812
+ updateHandle === null || updateHandle === void 0 ? void 0 : updateHandle(value, index, 'isGift');
14813
+ },
14814
+ options: [{
14815
+ label: '是',
14816
+ value: true
14817
+ }, {
14818
+ label: '否',
14819
+ value: false
14820
+ }]
14821
+ }) : /*#__PURE__*/React.createElement("span", null, typeof val !== 'boolean' ? '' : val ? '是' : '否');
14822
+ }
14823
+ }, {
14824
+ dataIndex: 'remark',
14825
+ title: '备注',
14826
+ render: function render(val, record, index) {
14827
+ return !disabled ? /*#__PURE__*/React.createElement(Input, {
14828
+ style: {
14829
+ width: 70
14830
+ },
14831
+ value: val,
14832
+ onChange: function onChange(e) {
14833
+ return updateHandle === null || updateHandle === void 0 ? void 0 : updateHandle(e.target.value, index, 'remark');
14834
+ }
14835
+ }) : /*#__PURE__*/React.createElement("span", null, val);
14836
+ }
14837
+ }].map(fillAttrs)
14632
14838
  };
14633
14839
  };
14634
14840
 
@@ -14876,39 +15082,49 @@ var getBsE3ReissueGoodColumns = function getBsE3ReissueGoodColumns(_ref4) {
14876
15082
  };
14877
15083
 
14878
15084
  var GoodsModalMap = {
14879
- 'WDT_REISSUE_GOODS': WdtGoodsModal,
14880
- 'WDT_GOODS': WdtGoodsModal,
14881
- 'WDT_EXCHANGE_GOODS': WdtGoodsModal,
14882
- 'BS_E3_REISSUE_GOODS': BsE3GoodsModal,
14883
- 'BS_E3_GOODS': BsE3GoodsModal,
14884
- 'BS_E3_EXCHANGE_GOODS': BsE3GoodsModal,
14885
- 'GY_GOODS': GyGoodsModal$2,
14886
- 'GY_REISSUE_GOODS': GyGoodsModal$2,
14887
- 'JST_GOODS': JstGoodsModal,
14888
- 'JST_REISSUE_GOODS': JstGoodsModal,
14889
- 'OTHER_GOODS': GoodsModal$2
15085
+ WDT_REISSUE_GOODS: WdtGoodsModal,
15086
+ WDT_GOODS: WdtGoodsModal,
15087
+ WDT_EXCHANGE_GOODS: WdtGoodsModal,
15088
+ BS_E3_REISSUE_GOODS: BsE3GoodsModal,
15089
+ BS_E3_GOODS: BsE3GoodsModal,
15090
+ BS_E3_EXCHANGE_GOODS: BsE3GoodsModal,
15091
+ GY_GOODS: GyGoodsModal$2,
15092
+ GY_REISSUE_GOODS: GyGoodsModal$2,
15093
+ JST_GOODS: JstGoodsModal,
15094
+ JST_REISSUE_GOODS: JstGoodsModal,
15095
+ JST_RETURN_GOODS: JstGoodsModal,
15096
+ JST_EXCHANGE_GOODS: JstGoodsModal,
15097
+ OTHER_GOODS: GoodsModal$2
14890
15098
  };
14891
- var MAIN_FIELD = 'uuid';
14892
15099
  var SelectTradeGoods = function SelectTradeGoods(_ref) {
14893
15100
  var columns = _ref.columns,
14894
15101
  dataSource = _ref.dataSource,
15102
+ getDataSourceAsync = _ref.getDataSourceAsync,
14895
15103
  selectedRowKeys = _ref.selectedRowKeys,
14896
- onChangeSelectedKeys = _ref.onChangeSelectedKeys;
15104
+ onChangeSelectedKeys = _ref.onChangeSelectedKeys,
15105
+ _ref$uniqueKey = _ref.uniqueKey,
15106
+ uniqueKey = _ref$uniqueKey === void 0 ? 'uuid' : _ref$uniqueKey;
14897
15107
  var _useState = useState(false),
14898
15108
  _useState2 = _slicedToArray(_useState, 2),
14899
15109
  tradeGoodsVisible = _useState2[0],
14900
15110
  setTradeGoodsVisible = _useState2[1];
14901
15111
  var openModal = function openModal() {
14902
- return setTradeGoodsVisible(true);
15112
+ if (getDataSourceAsync) {
15113
+ getDataSourceAsync().then(function () {
15114
+ setTradeGoodsVisible(true);
15115
+ });
15116
+ } else {
15117
+ setTradeGoodsVisible(true);
15118
+ }
14903
15119
  };
14904
15120
  var closeModal = function closeModal() {
14905
15121
  return setTradeGoodsVisible(false);
14906
15122
  };
14907
15123
  var currentTradeOriginGoods = intersection(dataSource === null || dataSource === void 0 ? void 0 : dataSource.map(function (item) {
14908
- return item === null || item === void 0 ? void 0 : item[MAIN_FIELD];
15124
+ return item === null || item === void 0 ? void 0 : item[uniqueKey];
14909
15125
  }), selectedRowKeys);
14910
15126
  var unCurrentTradeOriginGoods = difference(selectedRowKeys, dataSource === null || dataSource === void 0 ? void 0 : dataSource.map(function (item) {
14911
- return item === null || item === void 0 ? void 0 : item[MAIN_FIELD];
15127
+ return item === null || item === void 0 ? void 0 : item[uniqueKey];
14912
15128
  }));
14913
15129
  var handleChangeSelectedKeys = function handleChangeSelectedKeys(keys) {
14914
15130
  console.log('handleChangeSelectedKeys', keys, unCurrentTradeOriginGoods);
@@ -14927,7 +15143,7 @@ var SelectTradeGoods = function SelectTradeGoods(_ref) {
14927
15143
  footer: null,
14928
15144
  onCancel: closeModal
14929
15145
  }, /*#__PURE__*/React.createElement(Table, {
14930
- rowKey: MAIN_FIELD,
15146
+ rowKey: uniqueKey,
14931
15147
  rowSelection: rowSelection,
14932
15148
  columns: columns,
14933
15149
  dataSource: dataSource,
@@ -14949,7 +15165,7 @@ var getButtonText = function getButtonText() {
14949
15165
  if (['GY_GOODS', 'GY_REISSUE_GOODS'].includes(type)) {
14950
15166
  return '选择管易ERP商品';
14951
15167
  }
14952
- if (['JST_GOODS', 'JST_REISSUE_GOODS'].includes(type)) {
15168
+ if (['JST_GOODS', 'JST_REISSUE_GOODS', 'JST_RETURN_GOODS', 'JST_EXCHANGE_GOODS'].includes(type)) {
14953
15169
  return '选择聚水潭ERP商品';
14954
15170
  }
14955
15171
  return '选择商品';
@@ -14971,6 +15187,8 @@ var GoodItem$1 = function GoodItem(props) {
14971
15187
  maxLength = _props$maxLength === void 0 ? 20 : _props$maxLength,
14972
15188
  _props$showChangeBtn = props.showChangeBtn,
14973
15189
  showChangeBtn = _props$showChangeBtn === void 0 ? true : _props$showChangeBtn,
15190
+ _props$showErpGoodsBt = props.showErpGoodsBtn,
15191
+ showErpGoodsBtn = _props$showErpGoodsBt === void 0 ? true : _props$showErpGoodsBt,
14974
15192
  _props$showModeBtn = props.showModeBtn,
14975
15193
  showModeBtn = _props$showModeBtn === void 0 ? false : _props$showModeBtn,
14976
15194
  _props$isStrict = props.isStrict,
@@ -14989,7 +15207,12 @@ var GoodItem$1 = function GoodItem(props) {
14989
15207
  onSelect = props.onSelect,
14990
15208
  onDelete = props.onDelete,
14991
15209
  onModeChange = props.onModeChange,
14992
- tradeGoods = props.tradeGoods;
15210
+ tradeGoods = props.tradeGoods,
15211
+ form = props.form;
15212
+ var uniqueKey = (tradeGoods === null || tradeGoods === void 0 ? void 0 : tradeGoods.uniqueKey) || 'uuid';
15213
+ // 监听聚水潭退货商品
15214
+ var jstReturnGoods = Form === null || Form === void 0 ? void 0 : Form.useWatch('3979edfd6d', form);
15215
+ var isShowSelectTradeGoods = jstReturnGoods === null || jstReturnGoods === void 0 ? void 0 : jstReturnGoods.jstSystemOrderNo;
14993
15216
  var refModal = useRef();
14994
15217
  console.debug('表格数据', value);
14995
15218
  var handleDelete = function handleDelete(record, index) {
@@ -15009,7 +15232,7 @@ var GoodItem$1 = function GoodItem(props) {
15009
15232
  // TODO: 商品订单中以选中商品
15010
15233
  var selectedGoods = useMemo(function () {
15011
15234
  return value === null || value === void 0 ? void 0 : value.map(function (v) {
15012
- return v === null || v === void 0 ? void 0 : v[MAIN_FIELD];
15235
+ return v === null || v === void 0 ? void 0 : v[uniqueKey];
15013
15236
  });
15014
15237
  }, [value]);
15015
15238
  var updateHandle = function updateHandle(val, index, columnType) {
@@ -15064,6 +15287,8 @@ var GoodItem$1 = function GoodItem(props) {
15064
15287
  case 'GY_GOODS':
15065
15288
  case 'JST_GOODS':
15066
15289
  case 'JST_REISSUE_GOODS':
15290
+ case 'JST_EXCHANGE_GOODS':
15291
+ case 'JST_RETURN_GOODS':
15067
15292
  case 'GY_REISSUE_GOODS':
15068
15293
  {
15069
15294
  columns = getColumnsMap({
@@ -15245,7 +15470,7 @@ var GoodItem$1 = function GoodItem(props) {
15245
15470
  originAmount: !isNull(retailPrice) ? Number(retailPrice) : null
15246
15471
  });
15247
15472
  });
15248
- } else if (['JST_GOODS', 'JST_REISSUE_GOODS'].includes(type)) {
15473
+ } else if (['JST_GOODS', 'JST_REISSUE_GOODS', 'JST_RETURN_GOODS', 'JST_EXCHANGE_GOODS'].includes(type)) {
15249
15474
  newList = list.map(function (item) {
15250
15475
  return {
15251
15476
  name: item.goodName,
@@ -15293,7 +15518,7 @@ var GoodItem$1 = function GoodItem(props) {
15293
15518
  var onSelectChange = function onSelectChange(newSelectedRowKeys) {
15294
15519
  setSelectedRowKeys(newSelectedRowKeys);
15295
15520
  onSelect === null || onSelect === void 0 ? void 0 : onSelect(value.filter(function (t) {
15296
- return newSelectedRowKeys.includes(t.uuid);
15521
+ return newSelectedRowKeys.includes(t[uniqueKey]);
15297
15522
  }));
15298
15523
  };
15299
15524
  var handleChangeGoods = function handleChangeGoods() {
@@ -15324,18 +15549,20 @@ var GoodItem$1 = function GoodItem(props) {
15324
15549
  }, showModeBtn && /*#__PURE__*/React.createElement(Checkbox, {
15325
15550
  checked: isStrict,
15326
15551
  onChange: handleCheckboxChange
15327
- }, "\u5408\u5E76\u5355\uFF0C\u52FE\u9009\u540E\u53EA\u5C55\u793A\u5F53\u524D\u5E73\u53F0\u8BA2\u5355\u5546\u54C1"), !isEmpty(tradeGoods) && /*#__PURE__*/React.createElement(SelectTradeGoods, {
15552
+ }, "\u5408\u5E76\u5355\uFF0C\u52FE\u9009\u540E\u53EA\u5C55\u793A\u5F53\u524D\u5E73\u53F0\u8BA2\u5355\u5546\u54C1"), !isEmpty(tradeGoods) && isShowSelectTradeGoods && /*#__PURE__*/React.createElement(SelectTradeGoods, {
15553
+ uniqueKey: uniqueKey,
15328
15554
  columns: orderColumns,
15329
15555
  dataSource: tradeGoods.originDataSource,
15556
+ getDataSourceAsync: tradeGoods.getDataSourceAsync,
15330
15557
  selectedRowKeys: selectedGoods,
15331
15558
  onChangeSelectedKeys: tradeGoods.selectedGoodsChange
15332
- }), /*#__PURE__*/React.createElement(Button, {
15559
+ }), showErpGoodsBtn && /*#__PURE__*/React.createElement(Button, {
15333
15560
  type: "link",
15334
15561
  onClick: handleChangeGoods
15335
15562
  }, getButtonText(type)), otherOperations), /*#__PURE__*/React.createElement(Table, _objectSpread2(_objectSpread2({}, tableConfig), {}, {
15336
15563
  columns: newColumns,
15337
15564
  dataSource: value,
15338
- rowKey: 'uuid',
15565
+ rowKey: uniqueKey,
15339
15566
  size: "small",
15340
15567
  pagination: false,
15341
15568
  scroll: {
@@ -16066,8 +16293,6 @@ var getGyOrderListSingleton = function getGyOrderListSingleton(orderNo) {
16066
16293
  billTag: item.tagName,
16067
16294
  tradeTagName: item.tradeTagName,
16068
16295
  deliveryState: item.deliveryState,
16069
- vipCode: item.vipCode,
16070
- shopCode: item.shopCode,
16071
16296
  deliveryStateName: GY_DELIVERY_STATE_MAPPING[item.deliveryState]
16072
16297
  });
16073
16298
  });
@@ -16170,7 +16395,6 @@ var kmUtils = {
16170
16395
  getOrderListSingleton: getOrderListSingleton
16171
16396
  };
16172
16397
 
16173
- var _excluded$g = ["billNo", "billType", "billTag", "tradeTagName", "deliveryState", "vipCode", "shopCode"];
16174
16398
  var columnsMap = {
16175
16399
  BS_SYSTEM_ORDER: BS_SYSTEM_ORDER_CONFIG.columns,
16176
16400
  KM_SYSTEM_ORDER: KM_SYSTEM_ORDER_CONFIG.columns,
@@ -16439,20 +16663,15 @@ var index$1 = (function (props) {
16439
16663
  billType = _ref10.billType,
16440
16664
  billTag = _ref10.billTag,
16441
16665
  tradeTagName = _ref10.tradeTagName,
16442
- deliveryState = _ref10.deliveryState,
16443
- vipCode = _ref10.vipCode,
16444
- shopCode = _ref10.shopCode,
16445
- rest = _objectWithoutProperties(_ref10, _excluded$g);
16446
- return _objectSpread2(_objectSpread2({}, rest), {}, {
16666
+ deliveryState = _ref10.deliveryState;
16667
+ return {
16447
16668
  billNo: billNo,
16448
16669
  billType: billType,
16449
16670
  billTag: billTag,
16450
16671
  tradeTagName: tradeTagName,
16451
16672
  deliveryState: deliveryState,
16452
- deliveryStateName: GY_DELIVERY_STATE_MAPPING[deliveryState],
16453
- vipCode: vipCode,
16454
- shopCode: shopCode
16455
- });
16673
+ deliveryStateName: GY_DELIVERY_STATE_MAPPING[deliveryState]
16674
+ };
16456
16675
  })
16457
16676
  }));
16458
16677
  });
@@ -16987,27 +17206,58 @@ var CommonReturnGoods = function CommonReturnGoods(props) {
16987
17206
  };
16988
17207
 
16989
17208
  var componentMap$3 = {
16990
- 'WDT_EXCHANGE_GOODS': {
17209
+ WDT_EXCHANGE_GOODS: {
16991
17210
  type: 'wdt',
16992
17211
  valueKey: 'wdtExchangeGoods',
16993
17212
  returnTypeKey: 'wdtExchangeType',
16994
17213
  name: '旺店通',
16995
17214
  eventNameMap: {
16996
- changeShopCode: 'wdtChangeShopCode',
16997
- exchangeDeleteGood: 'wdtExchangeDeleteGood',
17215
+ // pubsub 事件
16998
17216
  exchangeCopyGood: 'wdtExchangeCopyGood',
16999
17217
  exchangeBackCopyGood: 'wdtExchangeBackCopyGood'
17000
17218
  }
17219
+ },
17220
+ JST_EXCHANGE_GOODS: {
17221
+ type: 'jst',
17222
+ showChooseTradeGoodsBtn: true,
17223
+ valueKey: 'jstExchangeGoods',
17224
+ returnTypeKey: 'jstExchangeType',
17225
+ systemOrder: 'jstSystemOrder',
17226
+ systemOrderNo: 'jstSystemOrderNo',
17227
+ oIdKey: 'oId',
17228
+ goodDetailsKey: 'items',
17229
+ skuIdKey: 'skuId',
17230
+ outerOiIdKey: '',
17231
+ name: '聚水潭',
17232
+ updateGoodsHandle: updateJstGoodsHandle,
17233
+ eventNameMap: {
17234
+ // pubsub 事件
17235
+ exchangeCopyGood: 'jstExchangeCopyGood',
17236
+ exchangeBackCopyGood: 'jstExchangeBackCopyGood',
17237
+ returnGoodsSysorder: 'jstReturnGoodsSysorder',
17238
+ returnGoodsSysorderBack: 'jstReturnGoodsSysorderBack'
17239
+ }
17001
17240
  }
17002
17241
  };
17003
17242
  var CommonExchangeGoods = function CommonExchangeGoods(props) {
17243
+ var _componentMap$compTyp, _componentMap$compTyp4;
17004
17244
  var value = props.value,
17005
17245
  onChange = props.onChange,
17006
17246
  disabled = props.disabled,
17007
17247
  compType = props.type;
17248
+ var uniqueKey = (componentMap$3 === null || componentMap$3 === void 0 ? void 0 : (_componentMap$compTyp = componentMap$3[compType]) === null || _componentMap$compTyp === void 0 ? void 0 : _componentMap$compTyp.skuIdKey) || 'uuid';
17008
17249
  var valueRef = useRef({});
17250
+ // PS: 目前选择订单商品,只有聚水潭换出商品,而且聚水潭不用考虑合并单,所以这个值一直是 false
17251
+ var _useState = useState(false),
17252
+ _useState2 = _slicedToArray(_useState, 2),
17253
+ isStrict = _useState2[0],
17254
+ setIsStrict = _useState2[1];
17255
+ var _useState3 = useState([]),
17256
+ _useState4 = _slicedToArray(_useState3, 2),
17257
+ originDataSource = _useState4[0],
17258
+ setOriginDataSource = _useState4[1];
17009
17259
  useEffect(function () {
17010
- var subscription = pubsub.subscribe(componentMap$3[compType].eventNameMap.exchangeBackCopyGood, function (_, data) {
17260
+ var subscription = componentMap$3[compType].eventNameMap.exchangeBackCopyGood && pubsub.subscribe(componentMap$3[compType].eventNameMap.exchangeBackCopyGood, function (_, data) {
17011
17261
  if (disabled) return;
17012
17262
  var newValue = {
17013
17263
  shopCode: data === null || data === void 0 ? void 0 : data.shopCode
@@ -17029,26 +17279,11 @@ var CommonExchangeGoods = function CommonExchangeGoods(props) {
17029
17279
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
17030
17280
  });
17031
17281
  return function () {
17032
- pubsub.unsubscribe(subscription);
17282
+ subscription && pubsub.unsubscribe(subscription);
17033
17283
  };
17034
- });
17284
+ }, []);
17035
17285
  useEffect(function () {
17036
17286
  valueRef.current = value;
17037
- pubsub.subscribeOnce(componentMap$3[compType].eventNameMap.exchangeDeleteGood, function (_, data) {
17038
- if (disabled) return;
17039
- if (value) {
17040
- var newValue = _objectSpread2({}, value);
17041
- newValue[componentMap$3[compType].valueKey] = newValue[componentMap$3[compType].valueKey].filter(function (item) {
17042
- return item.sku !== data;
17043
- });
17044
- onChange(newValue);
17045
- }
17046
- });
17047
- pubsub.subscribeOnce(componentMap$3[compType].eventNameMap.changeShopCode, function (type, data) {
17048
- onChange(_objectSpread2(_objectSpread2({}, value), {}, {
17049
- shopCode: data.shopCode
17050
- }));
17051
- });
17052
17287
  }, [value]);
17053
17288
  var changeGoodHandle = function changeGoodHandle(val) {
17054
17289
  var newValue = _objectSpread2({}, value);
@@ -17063,13 +17298,53 @@ var CommonExchangeGoods = function CommonExchangeGoods(props) {
17063
17298
  };
17064
17299
  var copyGoods = function copyGoods() {
17065
17300
  var copyHandle = function copyHandle() {
17066
- pubsub.publish(componentMap$3[compType].eventNameMap.exchangeCopyGood, 'WDT_EXCHANGE_GOODS');
17301
+ pubsub.publish(componentMap$3[compType].eventNameMap.exchangeCopyGood, compType);
17067
17302
  };
17068
17303
  return /*#__PURE__*/React.createElement(Button, {
17069
17304
  type: "link",
17070
17305
  onClick: copyHandle
17071
17306
  }, "\u590D\u5236\u9000\u56DE\u5546\u54C1");
17072
17307
  };
17308
+ var selectedGoodsChange = useCallback(function (skuList) {
17309
+ var _componentMap$compTyp2, _componentMap$compTyp3, _uniqBy;
17310
+ var newValue = _objectSpread2({}, value);
17311
+ // 原订单商品
17312
+ var originTradeGoodList = originDataSource || [];
17313
+ // 当前选中的所有商品【包含了原订单+商品库】
17314
+ var currentSelectGoodList = (value === null || value === void 0 ? void 0 : value[componentMap$3 === null || componentMap$3 === void 0 ? void 0 : (_componentMap$compTyp2 = componentMap$3[compType]) === null || _componentMap$compTyp2 === void 0 ? void 0 : _componentMap$compTyp2.valueKey]) || [];
17315
+ newValue[componentMap$3 === null || componentMap$3 === void 0 ? void 0 : (_componentMap$compTyp3 = componentMap$3[compType]) === null || _componentMap$compTyp3 === void 0 ? void 0 : _componentMap$compTyp3.valueKey] = (_uniqBy = uniqBy(originTradeGoodList.concat(currentSelectGoodList), uniqueKey)) === null || _uniqBy === void 0 ? void 0 : _uniqBy.filter(function (item) {
17316
+ return skuList.includes(item[uniqueKey]);
17317
+ });
17318
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
17319
+ }, [value === null || value === void 0 ? void 0 : value[componentMap$3 === null || componentMap$3 === void 0 ? void 0 : (_componentMap$compTyp4 = componentMap$3[compType]) === null || _componentMap$compTyp4 === void 0 ? void 0 : _componentMap$compTyp4.valueKey], isStrict, originDataSource]);
17320
+ var getGoodDetails = function getGoodDetails(_ref) {
17321
+ var _componentMap$compTyp5, _componentMap$compTyp6, _order$componentMap$c, _componentMap$compTyp7;
17322
+ var returnGoodsValue = _ref.returnGoodsValue,
17323
+ mode = _ref.mode,
17324
+ sysOrderNo = _ref.sysOrderNo;
17325
+ var systemOrder = returnGoodsValue === null || returnGoodsValue === void 0 ? void 0 : returnGoodsValue[(_componentMap$compTyp5 = componentMap$3[compType]) === null || _componentMap$compTyp5 === void 0 ? void 0 : _componentMap$compTyp5.systemOrder];
17326
+ var systemOrderNo = sysOrderNo !== null && sysOrderNo !== void 0 ? sysOrderNo : returnGoodsValue === null || returnGoodsValue === void 0 ? void 0 : returnGoodsValue[(_componentMap$compTyp6 = componentMap$3[compType]) === null || _componentMap$compTyp6 === void 0 ? void 0 : _componentMap$compTyp6.systemOrderNo];
17327
+ var order = systemOrderNo && ((systemOrder === null || systemOrder === void 0 ? void 0 : systemOrder.orders) || []).find(function (order) {
17328
+ return order[componentMap$3[compType].oIdKey] === systemOrderNo;
17329
+ });
17330
+ var goodDetails = jstMergeIdenticalGoods((order === null || order === void 0 ? void 0 : (_order$componentMap$c = order[componentMap$3[compType].goodDetailsKey]) === null || _order$componentMap$c === void 0 ? void 0 : _order$componentMap$c.length) ? (_componentMap$compTyp7 = componentMap$3[compType]) === null || _componentMap$compTyp7 === void 0 ? void 0 : _componentMap$compTyp7.updateGoodsHandle([order], true) : []);
17331
+ var orderNo = systemOrder === null || systemOrder === void 0 ? void 0 : systemOrder.orderNo;
17332
+ return mode ? goodDetails.filter(function (goodItem) {
17333
+ return !orderNo || goodItem[componentMap$3[compType].outerOiIdKey] === orderNo;
17334
+ }) : goodDetails;
17335
+ };
17336
+ var getDataSourceAsync = function getDataSourceAsync() {
17337
+ return new Promise(function (resolve) {
17338
+ pubsub.subscribeOnce(componentMap$3[compType].eventNameMap.returnGoodsSysorderBack, function (_, data) {
17339
+ resolve(data);
17340
+ setOriginDataSource(getGoodDetails({
17341
+ returnGoodsValue: data,
17342
+ mode: isStrict
17343
+ }));
17344
+ });
17345
+ pubsub.publish(componentMap$3[compType].eventNameMap.returnGoodsSysorder, compType);
17346
+ });
17347
+ };
17073
17348
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(GoodItem$1, _objectSpread2(_objectSpread2({
17074
17349
  key: componentMap$3[compType].type
17075
17350
  }, props), {}, {
@@ -17079,13 +17354,19 @@ var CommonExchangeGoods = function CommonExchangeGoods(props) {
17079
17354
  shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
17080
17355
  value: value === null || value === void 0 ? void 0 : value[componentMap$3[compType].valueKey],
17081
17356
  otherOperations: copyGoods(),
17357
+ tradeGoods: componentMap$3[compType].showChooseTradeGoodsBtn ? {
17358
+ uniqueKey: uniqueKey,
17359
+ originDataSource: originDataSource,
17360
+ getDataSourceAsync: getDataSourceAsync,
17361
+ selectedGoodsChange: selectedGoodsChange
17362
+ } : void 0,
17082
17363
  onChange: function onChange(val) {
17083
17364
  return changeGoodHandle(val);
17084
17365
  }
17085
17366
  })));
17086
17367
  };
17087
17368
 
17088
- var _excluded$h = ["value", "onChange", "reasonList", "disabled", "type"];
17369
+ var _excluded$g = ["value", "onChange", "reasonList", "disabled", "type"];
17089
17370
  var typeMap$1 = {
17090
17371
  WDT_REISSUE_GOODS: {
17091
17372
  key: 'wdtReissueGoods',
@@ -17113,7 +17394,7 @@ var wdtReissue = function wdtReissue(props) {
17113
17394
  reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
17114
17395
  disabled = props.disabled,
17115
17396
  type = props.type,
17116
- other = _objectWithoutProperties(props, _excluded$h);
17397
+ other = _objectWithoutProperties(props, _excluded$g);
17117
17398
  var showModeBtn = ((value === null || value === void 0 ? void 0 : (_value$wdtSystemOrder = value.wdtSystemOrder) === null || _value$wdtSystemOrder === void 0 ? void 0 : _value$wdtSystemOrder.orders) || []).some(function (order) {
17118
17399
  var _order$srcTid;
17119
17400
  return order === null || order === void 0 ? void 0 : (_order$srcTid = order.srcTid) === null || _order$srcTid === void 0 ? void 0 : _order$srcTid.includes(',');
@@ -17357,9 +17638,10 @@ var wdtReissue = function wdtReissue(props) {
17357
17638
  })));
17358
17639
  };
17359
17640
 
17360
- var _excluded$i = ["value", "onChange", "reasonList", "disabled", "type"];
17641
+ var _excluded$h = ["value", "onChange", "reasonList", "disabled", "type"];
17361
17642
  var typeMap$2 = {
17362
17643
  JST_REISSUE_GOODS: {
17644
+ compType: '补发',
17363
17645
  key: 'jstReissueGoods',
17364
17646
  typeName: 'jstReissueType',
17365
17647
  systemOrder: 'jstSystemOrder',
@@ -17369,19 +17651,41 @@ var typeMap$2 = {
17369
17651
  updateGoodsHandle: updateJstGoodsHandle,
17370
17652
  orderTypeKey: 'orderType',
17371
17653
  oIdKey: 'oId',
17372
- outerOiIdKey: 'outerOiId',
17654
+ outerOiIdKey: '',
17373
17655
  goodDetailsKey: 'items'
17656
+ },
17657
+ JST_RETURN_GOODS: {
17658
+ compType: '退货',
17659
+ key: 'jstReturnGoods',
17660
+ typeName: 'jstReturnType',
17661
+ systemOrder: 'jstSystemOrder',
17662
+ systemOrderNo: 'jstSystemOrderNo',
17663
+ systemOrderBillType: 'jstSystemOrderBillType',
17664
+ getOrderList: jstUtils.getJstOrderListSingleton,
17665
+ updateGoodsHandle: updateJstGoodsHandle,
17666
+ orderTypeKey: 'orderType',
17667
+ oIdKey: 'oId',
17668
+ outerOiIdKey: '',
17669
+ goodDetailsKey: 'items',
17670
+ showErpGoodsBtn: false,
17671
+ eventNameMap: {
17672
+ // pubsub 事件
17673
+ exchangeCopyGood: 'jstExchangeCopyGood',
17674
+ exchangeBackCopyGood: 'jstExchangeBackCopyGood',
17675
+ returnGoodsSysorder: 'jstReturnGoodsSysorder',
17676
+ returnGoodsSysorderBack: 'jstReturnGoodsSysorderBack'
17677
+ }
17374
17678
  }
17375
17679
  };
17376
17680
  var PublicReissue = function PublicReissue(props) {
17377
- var _typeMap$type32, _typeMap$type35, _typeMap$type36, _typeMap$type37, _value$typeMap$type$s6, _typeMap$type38, _typeMap$type39, _typeMap$type40, _typeMap$type41, _typeMap$type42;
17681
+ var _typeMap$type31, _typeMap$type34, _typeMap$type35, _typeMap$type36, _typeMap$type37, _value$typeMap$type$s6, _typeMap$type38, _typeMap$type39, _typeMap$type40, _typeMap$type41, _typeMap$type42, _typeMap$type43;
17378
17682
  var value = props.value,
17379
17683
  onChange = props.onChange,
17380
17684
  _props$reasonList = props.reasonList,
17381
17685
  reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
17382
17686
  disabled = props.disabled,
17383
17687
  type = props.type,
17384
- other = _objectWithoutProperties(props, _excluded$i);
17688
+ other = _objectWithoutProperties(props, _excluded$h);
17385
17689
  var getOrderFlag = useRef(false);
17386
17690
  var _useState = useState(false),
17387
17691
  _useState2 = _slicedToArray(_useState, 2),
@@ -17397,6 +17701,30 @@ var PublicReissue = function PublicReissue(props) {
17397
17701
  }
17398
17702
  return;
17399
17703
  }, [value]);
17704
+ var valueRef = useRef({});
17705
+ useEffect(function () {
17706
+ valueRef.current = value;
17707
+ }, [value]);
17708
+ useEffect(function () {
17709
+ var subscription;
17710
+ var subscription2;
17711
+ if (typeMap$2[type].eventNameMap) {
17712
+ subscription = pubsub.subscribe(typeMap$2[type].eventNameMap.exchangeCopyGood, function () {
17713
+ var _valueRef$current, _valueRef$current2;
17714
+ pubsub.publish(typeMap$2[type].eventNameMap.exchangeBackCopyGood, {
17715
+ list: cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current = valueRef.current) === null || _valueRef$current === void 0 ? void 0 : _valueRef$current[typeMap$2[type].key]) || []),
17716
+ shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current2 = valueRef.current) === null || _valueRef$current2 === void 0 ? void 0 : _valueRef$current2.shopCode
17717
+ });
17718
+ });
17719
+ subscription2 = pubsub.subscribe(typeMap$2[type].eventNameMap.returnGoodsSysorder, function () {
17720
+ pubsub.publish(typeMap$2[type].eventNameMap.returnGoodsSysorderBack, cloneDeep(valueRef.current));
17721
+ });
17722
+ }
17723
+ return function () {
17724
+ subscription && pubsub.unsubscribe(subscription);
17725
+ subscription2 && pubsub.unsubscribe(subscription2);
17726
+ };
17727
+ }, []);
17400
17728
  var getOrderList = /*#__PURE__*/function () {
17401
17729
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(orderNo) {
17402
17730
  var _typeMap$type4;
@@ -17471,7 +17799,7 @@ var PublicReissue = function PublicReissue(props) {
17471
17799
  var order = systemOrderNo && ((systemOrder === null || systemOrder === void 0 ? void 0 : systemOrder.orders) || []).find(function (order) {
17472
17800
  return order[typeMap$2[type].oIdKey] === systemOrderNo;
17473
17801
  });
17474
- var goodDetails = (order === null || order === void 0 ? void 0 : (_order$typeMap$type$g = order[typeMap$2[type].goodDetailsKey]) === null || _order$typeMap$type$g === void 0 ? void 0 : _order$typeMap$type$g.length) ? (_typeMap$type19 = typeMap$2[type]) === null || _typeMap$type19 === void 0 ? void 0 : _typeMap$type19.updateGoodsHandle([order], true) : [];
17802
+ var goodDetails = jstMergeIdenticalGoods((order === null || order === void 0 ? void 0 : (_order$typeMap$type$g = order[typeMap$2[type].goodDetailsKey]) === null || _order$typeMap$type$g === void 0 ? void 0 : _order$typeMap$type$g.length) ? (_typeMap$type19 = typeMap$2[type]) === null || _typeMap$type19 === void 0 ? void 0 : _typeMap$type19.updateGoodsHandle([order], true) : []);
17475
17803
  var orderNo = systemOrder === null || systemOrder === void 0 ? void 0 : systemOrder.orderNo;
17476
17804
  return mode ? goodDetails.filter(function (goodItem) {
17477
17805
  return !orderNo || goodItem[typeMap$2[type].outerOiIdKey] === orderNo;
@@ -17508,29 +17836,26 @@ var PublicReissue = function PublicReissue(props) {
17508
17836
  }
17509
17837
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
17510
17838
  };
17511
- //显示选择商品按钮 原单换不显示选择商品
17512
- var showChangeBtn = useMemo(function () {
17513
- var _typeMap$type31;
17514
- return !!(value === null || value === void 0 ? void 0 : value[(_typeMap$type31 = typeMap$2[type]) === null || _typeMap$type31 === void 0 ? void 0 : _typeMap$type31.systemOrderNo]);
17515
- }, [value === null || value === void 0 ? void 0 : value[(_typeMap$type32 = typeMap$2[type]) === null || _typeMap$type32 === void 0 ? void 0 : _typeMap$type32.systemOrderNo]]);
17839
+ //显示选择商品按钮
17840
+ var showChangeBtn = !!(value === null || value === void 0 ? void 0 : value[(_typeMap$type31 = typeMap$2[type]) === null || _typeMap$type31 === void 0 ? void 0 : _typeMap$type31.systemOrderNo]);
17516
17841
  var selectedGoodsChange = useCallback(function (skuList) {
17517
- var _typeMap$type33, _typeMap$type34, _uniqBy;
17842
+ var _typeMap$type32, _typeMap$type33, _uniqBy;
17518
17843
  var newValue = _objectSpread2({}, value);
17519
17844
  // 原订单商品
17520
17845
  var originTradeGoodList = getGoodDetails({
17521
17846
  mode: isStrict
17522
17847
  }) || [];
17523
17848
  // 当前选中的所有商品【包含了原订单+商品库】
17524
- var currentSelectGoodList = (value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type33 = typeMap$2[type]) === null || _typeMap$type33 === void 0 ? void 0 : _typeMap$type33.key)]) || [];
17525
- newValue["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type34 = typeMap$2[type]) === null || _typeMap$type34 === void 0 ? void 0 : _typeMap$type34.key)] = (_uniqBy = uniqBy(originTradeGoodList.concat(currentSelectGoodList), 'uuid')) === null || _uniqBy === void 0 ? void 0 : _uniqBy.filter(function (item) {
17849
+ var currentSelectGoodList = (value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type32 = typeMap$2[type]) === null || _typeMap$type32 === void 0 ? void 0 : _typeMap$type32.key)]) || [];
17850
+ newValue["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type33 = typeMap$2[type]) === null || _typeMap$type33 === void 0 ? void 0 : _typeMap$type33.key)] = (_uniqBy = uniqBy(originTradeGoodList.concat(currentSelectGoodList), 'uuid')) === null || _uniqBy === void 0 ? void 0 : _uniqBy.filter(function (item) {
17526
17851
  return skuList.includes(item.uuid);
17527
17852
  });
17528
17853
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
17529
- }, [value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type35 = typeMap$2[type]) === null || _typeMap$type35 === void 0 ? void 0 : _typeMap$type35.key)], isStrict]);
17854
+ }, [value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type34 = typeMap$2[type]) === null || _typeMap$type34 === void 0 ? void 0 : _typeMap$type34.key)], isStrict]);
17530
17855
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Row, {
17531
17856
  gutter: 8,
17532
17857
  wrap: true,
17533
- id: (typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type36 = typeMap$2[type]) === null || _typeMap$type36 === void 0 ? void 0 : _typeMap$type36.key) || "".concat(Date.now())
17858
+ id: (typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type35 = typeMap$2[type]) === null || _typeMap$type35 === void 0 ? void 0 : _typeMap$type35.key) || "".concat(Date.now())
17534
17859
  }, /*#__PURE__*/React.createElement(Col, {
17535
17860
  className: "gutter-row",
17536
17861
  xs: {
@@ -17545,11 +17870,11 @@ var PublicReissue = function PublicReissue(props) {
17545
17870
  },
17546
17871
  disabled: disabled,
17547
17872
  allowClear: false,
17548
- value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type37 = typeMap$2[type]) === null || _typeMap$type37 === void 0 ? void 0 : _typeMap$type37.systemOrderNo)],
17873
+ value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type36 = typeMap$2[type]) === null || _typeMap$type36 === void 0 ? void 0 : _typeMap$type36.systemOrderNo)],
17549
17874
  onChange: function onChange(val) {
17550
17875
  return changeSystemOrderHandle(val);
17551
17876
  },
17552
- placeholder: "\u9009\u62E9\u8865\u53D1\u7CFB\u7EDF\u5355"
17877
+ placeholder: "\u9009\u62E9".concat((typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type37 = typeMap$2[type]) === null || _typeMap$type37 === void 0 ? void 0 : _typeMap$type37.compType) || '', "\u7CFB\u7EDF\u5355")
17553
17878
  }, ((value === null || value === void 0 ? void 0 : (_value$typeMap$type$s6 = value[(_typeMap$type38 = typeMap$2[type]) === null || _typeMap$type38 === void 0 ? void 0 : _typeMap$type38.systemOrder]) === null || _value$typeMap$type$s6 === void 0 ? void 0 : _value$typeMap$type$s6.showOrderInfo) || []).map(function (item) {
17554
17879
  return /*#__PURE__*/React.createElement(Select.Option, {
17555
17880
  key: item[typeMap$2[type].oIdKey],
@@ -17594,8 +17919,9 @@ var PublicReissue = function PublicReissue(props) {
17594
17919
  disabled: disabled,
17595
17920
  canUpdateNumber: showChangeBtn,
17596
17921
  showChangeBtn: showChangeBtn,
17922
+ showErpGoodsBtn: typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type42 = typeMap$2[type]) === null || _typeMap$type42 === void 0 ? void 0 : _typeMap$type42.showErpGoodsBtn,
17597
17923
  shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
17598
- value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type42 = typeMap$2[type]) === null || _typeMap$type42 === void 0 ? void 0 : _typeMap$type42.key)],
17924
+ value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type43 = typeMap$2[type]) === null || _typeMap$type43 === void 0 ? void 0 : _typeMap$type43.key)],
17599
17925
  onChange: function onChange(val) {
17600
17926
  return changeGoodHandle(val);
17601
17927
  },
@@ -18087,12 +18413,12 @@ var Goods$1 = function Goods(props, ref) {
18087
18413
  };
18088
18414
  var index$2 = /*#__PURE__*/forwardRef(Goods$1);
18089
18415
 
18090
- var _excluded$j = ["onChange", "value", "failValue"];
18416
+ var _excluded$i = ["onChange", "value", "failValue"];
18091
18417
  function CommonStatus(props) {
18092
18418
  var onChange = props.onChange,
18093
18419
  value = props.value,
18094
18420
  failValue = props.failValue,
18095
- other = _objectWithoutProperties(props, _excluded$j);
18421
+ other = _objectWithoutProperties(props, _excluded$i);
18096
18422
  var changeHandle = function changeHandle(val) {
18097
18423
  onChange === null || onChange === void 0 ? void 0 : onChange({
18098
18424
  status: val,
@@ -18229,7 +18555,7 @@ var CommonSystemOrder = function CommonSystemOrder(props) {
18229
18555
  })) : null) : null);
18230
18556
  };
18231
18557
 
18232
- var _excluded$k = ["value", "onChange", "disabled", "failValue", "type"];
18558
+ var _excluded$j = ["value", "onChange", "disabled", "failValue", "type"];
18233
18559
  var CommonSystemOrder$1 = function CommonSystemOrder(props) {
18234
18560
  var _value$changeIndex, _value$changeIndex2, _value$changeIndex3;
18235
18561
  var _props$value = props.value,
@@ -18239,7 +18565,7 @@ var CommonSystemOrder$1 = function CommonSystemOrder(props) {
18239
18565
  failValue = props.failValue,
18240
18566
  _props$type = props.type,
18241
18567
  type = _props$type === void 0 ? 1 : _props$type,
18242
- other = _objectWithoutProperties(props, _excluded$k);
18568
+ other = _objectWithoutProperties(props, _excluded$j);
18243
18569
  var _useState = useState(0),
18244
18570
  _useState2 = _slicedToArray(_useState, 2),
18245
18571
  changeIndex = _useState2[0],
@@ -18305,7 +18631,7 @@ var CommonSystemOrder$1 = function CommonSystemOrder(props) {
18305
18631
  }, "\u5931\u8D25\u539F\u56E0\uFF1A", (_value$changeIndex3 = value[changeIndex]) === null || _value$changeIndex3 === void 0 ? void 0 : _value$changeIndex3.reason) : null));
18306
18632
  };
18307
18633
 
18308
- var _excluded$l = ["value", "onChange", "disabled", "failValue", "type"];
18634
+ var _excluded$k = ["value", "onChange", "disabled", "failValue", "type"];
18309
18635
  var MsgStatus = function MsgStatus(props) {
18310
18636
  var _value$changeIndex, _value$changeIndex2, _value$changeIndex3;
18311
18637
  var _props$value = props.value,
@@ -18315,7 +18641,7 @@ var MsgStatus = function MsgStatus(props) {
18315
18641
  failValue = props.failValue,
18316
18642
  _props$type = props.type,
18317
18643
  type = _props$type === void 0 ? 1 : _props$type,
18318
- other = _objectWithoutProperties(props, _excluded$l);
18644
+ other = _objectWithoutProperties(props, _excluded$k);
18319
18645
  var _useState = useState(0),
18320
18646
  _useState2 = _slicedToArray(_useState, 2),
18321
18647
  changeIndex = _useState2[0],
@@ -18346,7 +18672,7 @@ var MsgStatus = function MsgStatus(props) {
18346
18672
  onClick: function onClick() {
18347
18673
  return setChangeIndex(index);
18348
18674
  }
18349
- }, msgTypeCh[key] || key, item.ruleName);
18675
+ }, msgTypeCh[key], item.ruleName);
18350
18676
  }))) : null, type === 1 ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Select, _objectSpread2(_objectSpread2({}, other), {}, {
18351
18677
  showSearch: true,
18352
18678
  value: (_value$changeIndex = value[changeIndex]) === null || _value$changeIndex === void 0 ? void 0 : _value$changeIndex.status,
@@ -18384,7 +18710,7 @@ var CalculationInput = function CalculationInput(props) {
18384
18710
  }, config === null || config === void 0 ? void 0 : config.unit));
18385
18711
  };
18386
18712
 
18387
- var _excluded$m = ["value", "onChange", "reasonList", "disabled", "type"];
18713
+ var _excluded$l = ["value", "onChange", "reasonList", "disabled", "type"];
18388
18714
  var typeMap$3 = {
18389
18715
  BS_E3_REISSUE_GOODS: {
18390
18716
  key: 'bsE3ReissueGoods',
@@ -18402,7 +18728,7 @@ var bsE3Reissue = function bsE3Reissue(props) {
18402
18728
  reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
18403
18729
  disabled = props.disabled,
18404
18730
  type = props.type,
18405
- other = _objectWithoutProperties(props, _excluded$m);
18731
+ other = _objectWithoutProperties(props, _excluded$l);
18406
18732
  var getOrderFlag = useRef(false);
18407
18733
  var _useState = useState(false),
18408
18734
  _useState2 = _slicedToArray(_useState, 2),
@@ -18618,8 +18944,8 @@ var bsE3Reissue = function bsE3Reissue(props) {
18618
18944
  })));
18619
18945
  };
18620
18946
 
18621
- var _excluded$n = ["value", "onChange", "reasonList", "disabled", "type"],
18622
- _excluded2 = ["billNo", "billType", "billTag", "tradeTagName", "deliveryState", "vipCode", "shopCode"];
18947
+ var _excluded$m = ["value", "onChange", "reasonList", "disabled", "type"],
18948
+ _excluded2 = ["billNo", "billType", "billTag", "tradeTagName", "deliveryState"];
18623
18949
  var typeMap$4 = {
18624
18950
  GY_REISSUE_GOODS: {
18625
18951
  key: 'gyReissueGoods',
@@ -18647,7 +18973,7 @@ var GyReissue = function GyReissue(props) {
18647
18973
  reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
18648
18974
  disabled = props.disabled,
18649
18975
  type = props.type,
18650
- other = _objectWithoutProperties(props, _excluded$n);
18976
+ other = _objectWithoutProperties(props, _excluded$m);
18651
18977
  var showModeBtn = ((value === null || value === void 0 ? void 0 : (_value$gySystemOrder = value.gySystemOrder) === null || _value$gySystemOrder === void 0 ? void 0 : _value$gySystemOrder.orders) || []).some(function (order) {
18652
18978
  var _order$platformCode;
18653
18979
  return order === null || order === void 0 ? void 0 : (_order$platformCode = order.platformCode) === null || _order$platformCode === void 0 ? void 0 : _order$platformCode.includes(';');
@@ -18681,8 +19007,6 @@ var GyReissue = function GyReissue(props) {
18681
19007
  billTag = _ref2.billTag,
18682
19008
  tradeTagName = _ref2.tradeTagName,
18683
19009
  deliveryState = _ref2.deliveryState,
18684
- vipCode = _ref2.vipCode,
18685
- shopCode = _ref2.shopCode,
18686
19010
  rest = _objectWithoutProperties(_ref2, _excluded2);
18687
19011
  return _objectSpread2(_objectSpread2({}, rest), {}, {
18688
19012
  billNo: billNo,
@@ -18690,9 +19014,7 @@ var GyReissue = function GyReissue(props) {
18690
19014
  billTag: billTag,
18691
19015
  tradeTagName: tradeTagName,
18692
19016
  deliveryState: deliveryState,
18693
- deliveryStateName: GY_DELIVERY_STATE_MAPPING[deliveryState],
18694
- vipCode: vipCode,
18695
- shopCode: shopCode
19017
+ deliveryStateName: GY_DELIVERY_STATE_MAPPING[deliveryState]
18696
19018
  });
18697
19019
  });
18698
19020
  onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, (_typeMap$type5 = typeMap$4[type]) === null || _typeMap$type5 === void 0 ? void 0 : _typeMap$type5.systemOrder, _objectSpread2(_objectSpread2({}, value[(_typeMap$type6 = typeMap$4[type]) === null || _typeMap$type6 === void 0 ? void 0 : _typeMap$type6.systemOrder]), {}, {
@@ -18871,4 +19193,4 @@ var GyReissue = function GyReissue(props) {
18871
19193
  })));
18872
19194
  };
18873
19195
 
18874
- 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, bsE3Reissue as BsE3Reissue, 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, GyReissue, IdentifyAddress, Invoice, jstGoods as JstGoods, ItemList as JstItemList, LogisticsInterception, LogisticsMoreInterception, LogisticsMoreTrajectory, LogisticsTrajectory, MsgStatus, ParseLogistics, Payment, PublicReissue, RemarkInput as Remark, ExpressLogistics as ReturnLogistics, ShopNameSelect as ShopName, Status, SubForm, Supplier, TBGoodId, TBGoodSerial, TradeId, WdtGoodList, wdtReissue as WdtReissue, WlnGoods, columnsBaseInfoMap };
19196
+ 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, bsE3Reissue as BsE3Reissue, 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, GyReissue, IdentifyAddress, Invoice, jstGoods as JstGoods, ItemList as JstItemList, LogisticsInterception, LogisticsMoreInterception, LogisticsMoreTrajectory, LogisticsTrajectory, MsgStatus, ParseLogistics, Payment, PublicReissue, RemarkInput as Remark, ExpressLogistics as ReturnLogistics, ShopNameSelect as ShopName, Status, SubForm, Supplier, TBGoodId, TBGoodSerial, TradeId, WdtGoodList, wdtReissue as WdtReissue, WlnGoods, columnsBaseInfoMap, getColumns$5 as getJstColumns };