@kmkf-fe-packages/basic-components 0.7.15-alpha.0 → 0.7.15-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -4,6 +4,7 @@ import { EyeOutlined, DeleteOutlined, InboxOutlined } from '@ant-design/icons';
4
4
  import request, { extend } from 'umi-request';
5
5
  import { AddressData, request as request$1, LogisticsAddressData } from '@kmkf-fe-packages/kmkf-utils';
6
6
  import zhCN from 'antd/lib/locale/zh_CN';
7
+ import pubsub from 'pubsub-js';
7
8
 
8
9
  function _iterableToArrayLimit(arr, i) {
9
10
  var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
@@ -1552,7 +1553,10 @@ var IdentifyAddress = function IdentifyAddress(props) {
1552
1553
  var value = props.value,
1553
1554
  onChange = props.onChange,
1554
1555
  _props$disabled = props.disabled,
1555
- disabled = _props$disabled === void 0 ? false : _props$disabled;
1556
+ disabled = _props$disabled === void 0 ? false : _props$disabled,
1557
+ _props$showIdentify = props.showIdentify,
1558
+ showIdentify = _props$showIdentify === void 0 ? true : _props$showIdentify,
1559
+ type = props.type;
1556
1560
  var changeHandle = function changeHandle(val, type) {
1557
1561
  onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, type, val)));
1558
1562
  };
@@ -1568,7 +1572,7 @@ var IdentifyAddress = function IdentifyAddress(props) {
1568
1572
  }
1569
1573
  onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2({}, params));
1570
1574
  };
1571
- return /*#__PURE__*/React.createElement(React.Fragment, null, !disabled && /*#__PURE__*/React.createElement(ParseLogistics, {
1575
+ return /*#__PURE__*/React.createElement(React.Fragment, null, !disabled && showIdentify && /*#__PURE__*/React.createElement(ParseLogistics, {
1572
1576
  onChange: handleParseLogistics
1573
1577
  }), /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Province, {
1574
1578
  value: value.address,
@@ -1576,7 +1580,8 @@ var IdentifyAddress = function IdentifyAddress(props) {
1576
1580
  return changeHandle(val, 'address');
1577
1581
  },
1578
1582
  options: [],
1579
- disabled: disabled
1583
+ disabled: disabled,
1584
+ type: type
1580
1585
  }), /*#__PURE__*/React.createElement(Input, {
1581
1586
  value: value.detail,
1582
1587
  disabled: disabled,
@@ -1606,6 +1611,8 @@ function ApaasPosting(props) {
1606
1611
  value = _props$value === void 0 ? {} : _props$value,
1607
1612
  _props$disabled = props.disabled,
1608
1613
  disabled = _props$disabled === void 0 ? false : _props$disabled,
1614
+ _props$type = props.type,
1615
+ type = _props$type === void 0 ? 'workOrder' : _props$type,
1609
1616
  onChange = props.onChange;
1610
1617
  var handleChange = function handleChange(val) {
1611
1618
  //智能识别返填
@@ -1625,7 +1632,9 @@ function ApaasPosting(props) {
1625
1632
  receiverName: (value === null || value === void 0 ? void 0 : value.postingReceiverName) || '',
1626
1633
  receiverMobile: (value === null || value === void 0 ? void 0 : value.postingReceiverMobile) || ''
1627
1634
  },
1628
- onChange: handleChange
1635
+ onChange: handleChange,
1636
+ type: type,
1637
+ showIdentify: type !== 'bs'
1629
1638
  });
1630
1639
  }
1631
1640
 
@@ -3616,6 +3625,64 @@ var LogisticsInterception = function LogisticsInterception(props) {
3616
3625
  })));
3617
3626
  };
3618
3627
 
3628
+ var LogisticsTrajectory = function LogisticsTrajectory(props) {
3629
+ var options = props.options,
3630
+ showField = props.showField,
3631
+ _props$value = props.value,
3632
+ value = _props$value === void 0 ? {} : _props$value,
3633
+ disabled = props.disabled,
3634
+ onChange = props.onChange;
3635
+ var handleInputChange = function handleInputChange(e, type) {
3636
+ var val = e.target.value;
3637
+ typeof onChange === 'function' && onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, type, val)));
3638
+ };
3639
+ var handelSelectChange = function handelSelectChange(val) {
3640
+ typeof onChange === 'function' && onChange(_objectSpread2(_objectSpread2({}, value), {}, {
3641
+ company: val
3642
+ }));
3643
+ };
3644
+ //物流公司
3645
+ var LogisticsCompany = function LogisticsCompany() {
3646
+ return /*#__PURE__*/React.createElement(Select, {
3647
+ disabled: disabled,
3648
+ placeholder: "\u7269\u6D41\u516C\u53F8",
3649
+ onChange: handelSelectChange,
3650
+ value: (value === null || value === void 0 ? void 0 : value.company) === '' ? undefined : value === null || value === void 0 ? void 0 : value.company,
3651
+ options: options,
3652
+ showSearch: true,
3653
+ style: {
3654
+ width: '100%'
3655
+ },
3656
+ filterOption: function filterOption(input, option) {
3657
+ return option.label.includes(input);
3658
+ }
3659
+ });
3660
+ };
3661
+ //物流单号
3662
+ var LogisticsCode = function LogisticsCode() {
3663
+ return /*#__PURE__*/React.createElement(Input, {
3664
+ disabled: disabled,
3665
+ placeholder: "\u7269\u6D41\u5355\u53F7",
3666
+ onChange: function onChange(e) {
3667
+ return handleInputChange(e, 'order');
3668
+ },
3669
+ value: value === null || value === void 0 ? void 0 : value.order
3670
+ });
3671
+ };
3672
+ //物流快照
3673
+ var LogisticsSnapshot = function LogisticsSnapshot() {
3674
+ return /*#__PURE__*/React.createElement(Input, {
3675
+ disabled: true,
3676
+ placeholder: "\u7269\u6D41\u5FEB\u7167",
3677
+ onChange: function onChange(e) {
3678
+ return handleInputChange(e, 'snapshot');
3679
+ },
3680
+ value: value === null || value === void 0 ? void 0 : value.snapshot
3681
+ });
3682
+ };
3683
+ return /*#__PURE__*/React.createElement("div", null, ['all', 'EXPRESS_COMPANY'].includes(showField) ? LogisticsCompany() : null, LogisticsCode(), ['all', 'EXPRESS_SNAPSHOT'].includes(showField) ? LogisticsSnapshot() : null);
3684
+ };
3685
+
3619
3686
  var jstGoods = function jstGoods(props) {
3620
3687
  var _value$changeIndex, _value$changeIndex2, _value$changeIndex3, _value$changeIndex4, _value$changeIndex5, _value$changeIndex6;
3621
3688
  var _props$value = props.value,
@@ -3830,19 +3897,14 @@ var columns = [{
3830
3897
  var GoodsModal$1 = function GoodsModal(props, ref) {
3831
3898
  useImperativeHandle(ref, function () {
3832
3899
  return {
3833
- open: function open(_ref) {
3834
- var list = _ref.list;
3900
+ open: function open() {
3835
3901
  setVisible(true);
3836
- setSelect(list);
3837
- var ids = list.map(function (item) {
3838
- return item.numIid;
3839
- });
3840
- setSelectIds(ids);
3902
+ setSelect([]);
3903
+ setSelectIds([]);
3841
3904
  }
3842
3905
  };
3843
3906
  });
3844
3907
  var onSubmit = props.onSubmit,
3845
- _onCancel = props.onCancel,
3846
3908
  shopId = props.shopId,
3847
3909
  shopList = props.shopList,
3848
3910
  width = props.width;
@@ -3893,10 +3955,9 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
3893
3955
  var _useState17 = useState([{
3894
3956
  tab: '所选商品',
3895
3957
  key: 'onSale'
3896
- }, {
3897
- tab: '已选商品',
3898
- key: 'select'
3899
- }]),
3958
+ }
3959
+ // { tab: '已选商品', key: 'select' },
3960
+ ]),
3900
3961
  _useState18 = _slicedToArray(_useState17, 1),
3901
3962
  tabs = _useState18[0];
3902
3963
  //选择页码
@@ -3967,8 +4028,8 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
3967
4028
  * 查询商品
3968
4029
  */
3969
4030
  var queryItems = /*#__PURE__*/function () {
3970
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(platform) {
3971
- var res, _ref3, items, totalCount;
4031
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(platform) {
4032
+ var res, _ref2, items, totalCount;
3972
4033
  return _regeneratorRuntime().wrap(function _callee$(_context) {
3973
4034
  while (1) switch (_context.prev = _context.next) {
3974
4035
  case 0:
@@ -3981,10 +4042,10 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
3981
4042
  });
3982
4043
  case 4:
3983
4044
  res = _context.sent;
3984
- _ref3 = res.data || {
4045
+ _ref2 = res.data || {
3985
4046
  items: [],
3986
4047
  totalCount: 0
3987
- }, items = _ref3.items, totalCount = _ref3.totalCount;
4048
+ }, items = _ref2.items, totalCount = _ref2.totalCount;
3988
4049
  items.forEach(function (item) {
3989
4050
  item.platform = platform;
3990
4051
  item.key = item.numIid;
@@ -4002,7 +4063,7 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
4002
4063
  }, _callee, null, [[0,, 9, 12]]);
4003
4064
  }));
4004
4065
  return function queryItems(_x) {
4005
- return _ref2.apply(this, arguments);
4066
+ return _ref.apply(this, arguments);
4006
4067
  };
4007
4068
  }();
4008
4069
  var getItem = function getItem(searchParams, platform) {
@@ -4026,7 +4087,6 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
4026
4087
  }, [searchParams, platform]);
4027
4088
  var rowSelection = {
4028
4089
  selectedRowKeys: selectIds,
4029
- // type: 'radio',
4030
4090
  onChange: function onChange(selectedRowKeys, selectedRows, info) {
4031
4091
  console.log(selectedRowKeys, selectedRows, info);
4032
4092
  setSelectIds(selectedRowKeys);
@@ -4039,6 +4099,13 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
4039
4099
  // },
4040
4100
  };
4041
4101
 
4102
+ var _onCancel = function onCancel() {
4103
+ setVisible(false);
4104
+ };
4105
+ var onOk = function onOk() {
4106
+ onSubmit(selectList);
4107
+ _onCancel();
4108
+ };
4042
4109
  return /*#__PURE__*/React.createElement(Modal, {
4043
4110
  title: '选择商品编码',
4044
4111
  okText: '确认',
@@ -4048,9 +4115,7 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
4048
4115
  onCancel: function onCancel() {
4049
4116
  _onCancel();
4050
4117
  },
4051
- onOk: function onOk() {
4052
- onSubmit(selectList);
4053
- },
4118
+ onOk: onOk,
4054
4119
  wrapClassName: "goodModal"
4055
4120
  }, /*#__PURE__*/React.createElement(Tabs, {
4056
4121
  type: "card",
@@ -4105,18 +4170,16 @@ var GoodsModal$2 = /*#__PURE__*/forwardRef(GoodsModal$1);
4105
4170
 
4106
4171
  // interface GoodsItem {
4107
4172
  // title: string;
4108
- // picUrl: string;
4173
+ // pic: string;
4109
4174
  // platform: string;
4110
4175
  // skuId: string;
4111
4176
  // styleId: string;
4112
4177
  // }
4113
- var BsGoods = function BsGoods(props) {
4178
+ var GoodItem = function GoodItem(props) {
4114
4179
  var _props$value = props.value,
4115
4180
  value = _props$value === void 0 ? [] : _props$value,
4116
4181
  onChange = props.onChange,
4117
4182
  disabled = props.disabled,
4118
- _props$type = props.type,
4119
- type = _props$type === void 0 ? 1 : _props$type,
4120
4183
  _props$showField = props.showField,
4121
4184
  showField = _props$showField === void 0 ? [] : _props$showField,
4122
4185
  width = props.width,
@@ -4125,64 +4188,98 @@ var BsGoods = function BsGoods(props) {
4125
4188
  _props$shopId = props.shopId,
4126
4189
  shopId = _props$shopId === void 0 ? '' : _props$shopId,
4127
4190
  _props$maxLength = props.maxLength,
4128
- maxLength = _props$maxLength === void 0 ? 20 : _props$maxLength;
4129
- var _useState = useState(false),
4130
- _useState2 = _slicedToArray(_useState, 2),
4131
- visible = _useState2[0],
4132
- setVisible = _useState2[1];
4133
- var handleDelete = function handleDelete(record) {
4134
- var newList = value.filter(function (item) {
4135
- return item.numIid !== record.numIid;
4191
+ maxLength = _props$maxLength === void 0 ? 20 : _props$maxLength,
4192
+ _props$showChangeBtn = props.showChangeBtn,
4193
+ showChangeBtn = _props$showChangeBtn === void 0 ? true : _props$showChangeBtn,
4194
+ _props$tableSelect = props.tableSelect,
4195
+ tableSelect = _props$tableSelect === void 0 ? false : _props$tableSelect,
4196
+ _props$otherOperation = props.otherOperations,
4197
+ otherOperations = _props$otherOperation === void 0 ? null : _props$otherOperation,
4198
+ _props$canUpdateNumbe = props.canUpdateNumber,
4199
+ canUpdateNumber = _props$canUpdateNumbe === void 0 ? false : _props$canUpdateNumbe,
4200
+ onSelect = props.onSelect;
4201
+ var refModal = useRef();
4202
+ var handleDelete = function handleDelete(index) {
4203
+ var newList = value.filter(function (item, i) {
4204
+ return index !== i;
4136
4205
  });
4137
4206
  onChange === null || onChange === void 0 ? void 0 : onChange(newList);
4138
4207
  };
4208
+ var _useState = useState([]),
4209
+ _useState2 = _slicedToArray(_useState, 2),
4210
+ selectedRowKeys = _useState2[0],
4211
+ setSelectedRowKeys = _useState2[1];
4212
+ var updateHandle = function updateHandle(val, index, type) {
4213
+ value[index][type] = val;
4214
+ onChange === null || onChange === void 0 ? void 0 : onChange(_toConsumableArray(value));
4215
+ };
4139
4216
  //商品信息
4140
- var GOODS_INFO_COLUMNS = function GOODS_INFO_COLUMNS(text) {
4217
+ var GOODS_INFO_COLUMNS = function GOODS_INFO_COLUMNS() {
4141
4218
  return [{
4142
- dataIndex: 'picUrl',
4143
- title: "bs".concat(text, "\u56FE\u7247"),
4144
- render: function render(val) {
4145
- return /*#__PURE__*/React.createElement(Image, {
4146
- width: 60,
4147
- src: val
4148
- });
4149
- }
4150
- }, {
4151
- dataIndex: 'title',
4152
- title: "bs".concat(text, "\u540D\u79F0")
4219
+ dataIndex: 'name',
4220
+ title: "bs\u540D\u79F0",
4221
+ width: 200
4153
4222
  }, {
4154
- dataIndex: 'skuName',
4155
- title: "bs".concat(text, "\u7F16\u7801")
4223
+ dataIndex: 'code',
4224
+ title: "bs\u7F16\u7801",
4225
+ width: 200
4156
4226
  }, {
4157
4227
  dataIndex: 'skuId',
4158
- title: "bs".concat(text, "sku\u7F16\u7801")
4228
+ title: "bssku\u7F16\u7801",
4229
+ width: 200
4159
4230
  }, {
4160
4231
  dataIndex: 'money',
4161
- title: "bs".concat(text, "\u5B9E\u4ED8\u91D1\u989D")
4232
+ title: "bs\u5B9E\u4ED8\u91D1\u989D",
4233
+ width: 200
4162
4234
  }, {
4163
4235
  dataIndex: 'number',
4164
- title: "bs".concat(text, "\u6570\u91CF")
4236
+ title: "bs\u6570\u91CF",
4237
+ width: 200,
4238
+ render: function render(val, record, index) {
4239
+ return canUpdateNumber ? /*#__PURE__*/React.createElement(InputNumber, {
4240
+ value: val,
4241
+ onChange: function onChange(num) {
4242
+ return updateHandle(num, index, 'number');
4243
+ }
4244
+ }) : /*#__PURE__*/React.createElement("span", null, val);
4245
+ }
4165
4246
  }, {
4247
+ dataIndex: 'share',
4248
+ title: "bs\u5206\u644A\u4EF7",
4249
+ width: 200
4250
+ }, {
4251
+ dataIndex: 'type',
4252
+ title: "bs\u8D60\u54C1\u7C7B\u578B",
4253
+ width: 200
4254
+ }];
4255
+ };
4256
+ var newColumns = useMemo(function () {
4257
+ return [{
4258
+ dataIndex: 'pic',
4259
+ title: "bs\u56FE\u7247",
4260
+ width: 200,
4261
+ render: function render(val) {
4262
+ return /*#__PURE__*/React.createElement(Image, {
4263
+ width: 60,
4264
+ src: val
4265
+ });
4266
+ }
4267
+ }].concat(_toConsumableArray(GOODS_INFO_COLUMNS().filter(function (t) {
4268
+ return showField.includes(t === null || t === void 0 ? void 0 : t.dataIndex);
4269
+ })), [{
4166
4270
  dataIndex: '',
4167
4271
  title: "\u64CD\u4F5C",
4168
- render: function render(val, record) {
4169
- return /*#__PURE__*/React.createElement(Button, {
4272
+ render: function render(val, record, index) {
4273
+ return record.canDelete ? /*#__PURE__*/React.createElement(Button, {
4170
4274
  type: "link",
4171
4275
  onClick: function onClick() {
4172
- return handleDelete(record);
4276
+ return handleDelete(index);
4173
4277
  }
4174
- }, "\u5220\u9664");
4278
+ }, "\u5220\u9664") : null;
4175
4279
  }
4176
- }];
4177
- };
4178
- var newColumns = useMemo(function () {
4179
- return GOODS_INFO_COLUMNS('商品').filter(function (t) {
4180
- return showField.includes(t === null || t === void 0 ? void 0 : t.dataIndex);
4181
- });
4280
+ }]);
4182
4281
  }, [showField]);
4183
- console.log(newColumns);
4184
4282
  var onSubmit = function onSubmit(list) {
4185
- console.log(list);
4186
4283
  var newList = list.map(function (item) {
4187
4284
  var picUrl = item.picUrl,
4188
4285
  numIid = item.numIid,
@@ -4191,39 +4288,214 @@ var BsGoods = function BsGoods(props) {
4191
4288
  price = item.price,
4192
4289
  platform = item.platform;
4193
4290
  return {
4194
- picUrl: picUrl,
4291
+ pic: picUrl,
4195
4292
  numIid: numIid,
4196
4293
  outerId: outerId,
4197
4294
  title: title,
4198
4295
  price: price,
4199
- platform: platform
4296
+ platform: platform,
4297
+ number: 10,
4298
+ canDelete: true
4200
4299
  };
4201
4300
  });
4202
- onChange === null || onChange === void 0 ? void 0 : onChange(newList);
4203
- setVisible(false);
4301
+ onChange === null || onChange === void 0 ? void 0 : onChange([].concat(_toConsumableArray(value), _toConsumableArray(newList)));
4302
+ };
4303
+ var onSelectChange = function onSelectChange(newSelectedRowKeys) {
4304
+ setSelectedRowKeys(newSelectedRowKeys);
4305
+ onSelect === null || onSelect === void 0 ? void 0 : onSelect(value.filter(function (t) {
4306
+ return newSelectedRowKeys.includes(t);
4307
+ }));
4204
4308
  };
4205
4309
  var handleChangeGoods = function handleChangeGoods() {
4206
- setVisible(true);
4310
+ refModal.current.open();
4207
4311
  };
4208
- return /*#__PURE__*/React.createElement(React.Fragment, null, !disabled && /*#__PURE__*/React.createElement(Button, {
4312
+ var rowSelection = {
4313
+ selectedRowKeys: selectedRowKeys,
4314
+ onChange: onSelectChange
4315
+ };
4316
+ var tableConfig = useMemo(function () {
4317
+ var params = {
4318
+ columns: newColumns,
4319
+ dataSource: value
4320
+ };
4321
+ if (tableSelect) {
4322
+ params.rowSelection = rowSelection;
4323
+ }
4324
+ return params;
4325
+ }, [tableSelect, newColumns, value]);
4326
+ return /*#__PURE__*/React.createElement(React.Fragment, null, !disabled && showChangeBtn && /*#__PURE__*/React.createElement(Space, {
4327
+ align: "end"
4328
+ }, /*#__PURE__*/React.createElement(Button, {
4209
4329
  type: "link",
4210
4330
  onClick: handleChangeGoods
4211
- }, "\u9009\u62E9\u5546\u54C1"), /*#__PURE__*/React.createElement(Table, {
4212
- columns: GOODS_INFO_COLUMNS('商品'),
4213
- dataSource: value
4214
- }), /*#__PURE__*/React.createElement(GoodsModal$2, {
4331
+ }, "\u9009\u62E9\u5546\u54C1"), otherOperations), /*#__PURE__*/React.createElement("div", {
4332
+ style: {
4333
+ width: '100%',
4334
+ overflowX: 'auto'
4335
+ }
4336
+ }, /*#__PURE__*/React.createElement(Table, _objectSpread2(_objectSpread2({}, tableConfig), {}, {
4337
+ pagination: false
4338
+ }))), /*#__PURE__*/React.createElement(GoodsModal$2, {
4339
+ ref: refModal,
4215
4340
  onSubmit: onSubmit,
4216
4341
  width: width,
4217
- type: type,
4218
4342
  shopList: shopList,
4219
4343
  shopId: shopId,
4220
- maxLength: maxLength,
4221
- onCancel: function onCancel() {
4222
- setVisible(false);
4223
- }
4344
+ maxLength: maxLength
4224
4345
  }));
4225
4346
  };
4226
4347
 
4348
+ var BsGoods = function BsGoods(props) {
4349
+ var value = props.value;
4350
+ var _useState = useState(false),
4351
+ _useState2 = _slicedToArray(_useState, 2),
4352
+ tableSelect = _useState2[0],
4353
+ setTableSelect = _useState2[1];
4354
+ var ref = useRef();
4355
+ useEffect(function () {
4356
+ ref.current = pubsub.subscribe('type', function (_, val) {
4357
+ setTableSelect(['2', '4'].includes(val));
4358
+ if (['1', '3'].includes(val)) {
4359
+ pubsub.publish('selectList', {
4360
+ type: val,
4361
+ list: _toConsumableArray(value).map(function (item) {
4362
+ item.canDelete = false;
4363
+ })
4364
+ });
4365
+ }
4366
+ });
4367
+ return function () {
4368
+ pubsub.unsubscribe(ref.current);
4369
+ };
4370
+ }, []);
4371
+ var onSelect = function onSelect(list) {
4372
+ pubsub.publish('selectList', list.map(function (item) {
4373
+ item.canDelete = true;
4374
+ }));
4375
+ };
4376
+ return /*#__PURE__*/React.createElement(GoodItem, _objectSpread2(_objectSpread2({}, props), {}, {
4377
+ tableSelect: tableSelect,
4378
+ onSelect: onSelect
4379
+ }));
4380
+ };
4381
+
4382
+ var _excluded$b = ["value", "onChange", "reasonList", "disabled"];
4383
+ var BsExchange = function BsExchange(props) {
4384
+ var _value$bsExchangeType2, _value$bsExchangeType3;
4385
+ var value = props.value,
4386
+ onChange = props.onChange,
4387
+ _props$reasonList = props.reasonList,
4388
+ reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
4389
+ disabled = props.disabled,
4390
+ other = _objectWithoutProperties(props, _excluded$b);
4391
+ useEffect(function () {
4392
+ pubsub.subscribe('selectList', function (_, list) {
4393
+ onChange(_objectSpread2(_objectSpread2({}, value), {}, {
4394
+ bsExchangeReturnGoods: list
4395
+ }));
4396
+ });
4397
+ }, []);
4398
+ var changeHandle = function changeHandle(val, key) {
4399
+ var newValue = _objectSpread2({}, value);
4400
+ newValue[key] = val;
4401
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
4402
+ if (key === 'bsExchangeType') {
4403
+ console.log(val);
4404
+ pubsub.publish('type', val[0]);
4405
+ }
4406
+ };
4407
+ //显示选择商品按钮 原单换不显示选择商品
4408
+ var showChangeBtn = useMemo(function () {
4409
+ var _value$bsExchangeType;
4410
+ return ['2', '4'].includes(value === null || value === void 0 ? void 0 : (_value$bsExchangeType = value.bsExchangeType) === null || _value$bsExchangeType === void 0 ? void 0 : _value$bsExchangeType[0]) || disabled;
4411
+ }, [value === null || value === void 0 ? void 0 : value.bsExchangeType]);
4412
+ var copyGoods = function copyGoods() {
4413
+ var copyHandle = function copyHandle() {
4414
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, {
4415
+ bsExchangeSwapOutGoods: [].concat(_toConsumableArray((value === null || value === void 0 ? void 0 : value.bsExchangeSwapOutGoods) || []), _toConsumableArray((value === null || value === void 0 ? void 0 : value.bsExchangeReturnGoods) || []))
4416
+ }));
4417
+ };
4418
+ return /*#__PURE__*/React.createElement(Button, {
4419
+ type: "link",
4420
+ onClick: copyHandle
4421
+ }, "\u590D\u5236\u9000\u56DE\u5546\u54C1");
4422
+ };
4423
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Cascader, {
4424
+ options: reasonList,
4425
+ value: value === null || value === void 0 ? void 0 : value.bsExchangeType,
4426
+ onChange: function onChange(val) {
4427
+ return changeHandle(val, 'bsExchangeType');
4428
+ }
4429
+ }), /*#__PURE__*/React.createElement("p", null, "\u9000\u56DE\u5546\u54C1"), /*#__PURE__*/React.createElement(GoodItem, _objectSpread2(_objectSpread2({}, other), {}, {
4430
+ disabled: disabled,
4431
+ showChangeBtn: showChangeBtn,
4432
+ value: value === null || value === void 0 ? void 0 : value.bsExchangeReturnGoods,
4433
+ onChange: function onChange(val) {
4434
+ return changeHandle(val, 'bsExchangeReturnGoods');
4435
+ }
4436
+ })), /*#__PURE__*/React.createElement("p", null, "\u6362\u51FA\u5546\u54C1"), /*#__PURE__*/React.createElement(GoodItem, _objectSpread2(_objectSpread2({}, other), {}, {
4437
+ disabled: disabled,
4438
+ otherOperations: ['2', '4'].includes(value === null || value === void 0 ? void 0 : (_value$bsExchangeType2 = value.bsExchangeType) === null || _value$bsExchangeType2 === void 0 ? void 0 : _value$bsExchangeType2[0]) ? copyGoods() : null,
4439
+ value: value === null || value === void 0 ? void 0 : value.bsExchangeSwapOutGoods,
4440
+ onChange: function onChange(val) {
4441
+ return changeHandle(val, 'bsExchangeSwapOutGoods');
4442
+ }
4443
+ })), ['3', '4'].includes(value === null || value === void 0 ? void 0 : (_value$bsExchangeType3 = value.bsExchangeType) === null || _value$bsExchangeType3 === void 0 ? void 0 : _value$bsExchangeType3[0]) ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("p", null, "\u8D60\u54C1\u4FE1\u606F"), /*#__PURE__*/React.createElement(GoodItem, _objectSpread2(_objectSpread2({
4444
+ disabled: disabled
4445
+ }, other), {}, {
4446
+ value: value === null || value === void 0 ? void 0 : value.bsExchangeGiftGoods,
4447
+ onChange: function onChange(val) {
4448
+ return changeHandle(val, 'bsExchangeGiftGoods');
4449
+ }
4450
+ }))) : null);
4451
+ };
4452
+
4453
+ var _excluded$c = ["value", "onChange", "reasonList"];
4454
+ var BsReissue = function BsReissue(props) {
4455
+ var value = props.value,
4456
+ onChange = props.onChange,
4457
+ _props$reasonList = props.reasonList,
4458
+ reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
4459
+ other = _objectWithoutProperties(props, _excluded$c);
4460
+ useEffect(function () {
4461
+ pubsub.subscribe('selectList', function (_, list) {
4462
+ onChange(_objectSpread2(_objectSpread2({}, value), {}, {
4463
+ bsReissueGoods: list.map(function (item) {
4464
+ item.money = 0;
4465
+ return item;
4466
+ })
4467
+ }));
4468
+ });
4469
+ }, []);
4470
+ var changeHandle = function changeHandle(val, key) {
4471
+ var newValue = _objectSpread2({}, value);
4472
+ newValue[key] = val;
4473
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
4474
+ if (key === 'bsReissueType') {
4475
+ pubsub.publish('type', val);
4476
+ }
4477
+ };
4478
+ //显示选择商品按钮 原单换不显示选择商品
4479
+ var showChangeBtn = useMemo(function () {
4480
+ var _value$bsReissueType;
4481
+ return ['2', '4'].includes(value === null || value === void 0 ? void 0 : (_value$bsReissueType = value.bsReissueType) === null || _value$bsReissueType === void 0 ? void 0 : _value$bsReissueType[0]);
4482
+ }, [value === null || value === void 0 ? void 0 : value.bsReissueType]);
4483
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Cascader, {
4484
+ options: reasonList,
4485
+ value: value === null || value === void 0 ? void 0 : value.bsReissueType,
4486
+ onChange: function onChange(val) {
4487
+ return changeHandle(val, 'bsReissueType');
4488
+ }
4489
+ }), /*#__PURE__*/React.createElement("p", null, "\u9000\u56DE\u5546\u54C1"), /*#__PURE__*/React.createElement(GoodItem, _objectSpread2(_objectSpread2({}, other), {}, {
4490
+ canUpdateNumber: true,
4491
+ showChangeBtn: showChangeBtn,
4492
+ value: value === null || value === void 0 ? void 0 : value.bsReissueGoods,
4493
+ onChange: function onChange(val) {
4494
+ return changeHandle(val, 'bsReissueGoods');
4495
+ }
4496
+ })));
4497
+ };
4498
+
4227
4499
  var css_248z$9 = ".goodsBox {\n display: flex;\n flex-wrap: wrap;\n}\n.goods-imgBox {\n position: relative;\n width: 80px;\n height: 80px;\n border: 1px solid #F2F3F5;\n margin: 0 10px 10px 0;\n text-align: center;\n}\n.icon-close {\n position: absolute;\n top: -5px;\n right: -5px;\n width: 13px;\n height: 13px;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n z-index: 3;\n background-color: #fff;\n cursor: pointer;\n}\n.img {\n width: 100%;\n height: 100%;\n -o-object-fit: contain;\n object-fit: contain;\n}\n.goods-title {\n margin: 0 0 10px 5px;\n color: #4E5969;\n}\n.deg90 {\n transform: rotate(90deg);\n}\n.goodMain {\n display: flex;\n flex-wrap: wrap;\n height: 265px;\n overflow-y: auto;\n margin-bottom: 10px;\n}\n.goodMain .goodItem {\n width: 140px;\n height: 175px;\n padding: 11px 10px 0;\n text-align: center;\n display: inline-block;\n vertical-align: top;\n margin-bottom: 10px;\n margin-right: 30px;\n border: 1px solid #e6e6e6;\n cursor: pointer;\n transition: border 0.3s;\n}\n.goodMain .goodItem .goodImg {\n width: 120px;\n height: 120px;\n}\n.goodMain .goodItem .goodText {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.goodMain .goodItem.active {\n border: 1px solid #3089dc;\n}\n.right-context {\n display: flex;\n flex-direction: column;\n}\n";
4228
4500
  styleInject(css_248z$9);
4229
4501
 
@@ -4700,4 +4972,4 @@ var Goods$1 = function Goods(props, ref) {
4700
4972
  };
4701
4973
  var index = /*#__PURE__*/forwardRef(Goods$1);
4702
4974
 
4703
- export { ApaasAddress as Address, AliPay, Province as ApaasAddress, ApaasCascader, ApaasCheckbox, ApaasDate, withFormItem as ApaasHoc, ApaasInput, ApaasInputNumber, ApaasMultipleSelect, ApaasPosting, ApaasRadio, ApaasRate, ApaasSelect, ApaasSlider, ApaasTextArea, ApaasUpload, ApaasUploadAsync, ApaasUploadAsync$1 as ApaasUploadFile, BsGoods, BuyerNick, ChooseBaby, ExpressLogistics, Goods, index as GoodsTable, IdentifyAddress, Invoice, jstGoods as JstGoods, ItemList as JstItemList, LogisticsInterception, ParseLogistics, Payment, RemarkInput as Remark, ExpressLogistics as ReturnLogistics, ShopNameSelect as ShopName, Status, Supplier, TBGoodId, TBGoodSerial, TradeId };
4975
+ export { ApaasAddress as Address, AliPay, Province as ApaasAddress, ApaasCascader, ApaasCheckbox, ApaasDate, withFormItem as ApaasHoc, ApaasInput, ApaasInputNumber, ApaasMultipleSelect, ApaasPosting, ApaasRadio, ApaasRate, ApaasSelect, ApaasSlider, ApaasTextArea, ApaasUpload, ApaasUploadAsync, ApaasUploadAsync$1 as ApaasUploadFile, BsExchange, BsGoods, BsReissue, BuyerNick, ChooseBaby, ExpressLogistics, Goods, index as GoodsTable, IdentifyAddress, Invoice, jstGoods as JstGoods, ItemList as JstItemList, LogisticsInterception, LogisticsTrajectory, ParseLogistics, Payment, RemarkInput as Remark, ExpressLogistics as ReturnLogistics, ShopNameSelect as ShopName, Status, Supplier, TBGoodId, TBGoodSerial, TradeId };