@kmkf-fe-packages/basic-components 0.7.15-alpha.5 → 0.7.15-alpha.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -6951,7 +6951,7 @@ var ApaasUploadAsync$1 = function ApaasUploadAsync(_ref) {
6951
6951
  var beforeUpload = function beforeUpload(file) {
6952
6952
  console.log('beforeUpload', file);
6953
6953
  var size = file.size / 1024 / 1024 < maxSize;
6954
- if (value.length > maxCount) {
6954
+ if (value.length >= maxCount) {
6955
6955
  antd.message.error("\u6700\u591A\u6DFB\u52A0".concat(maxCount, "\u4E2A\u6587\u4EF6\uFF01"));
6956
6956
  return antd.Upload.LIST_IGNORE;
6957
6957
  }
@@ -6974,7 +6974,7 @@ var ApaasUploadAsync$1 = function ApaasUploadAsync(_ref) {
6974
6974
  className: styles$2.tips
6975
6975
  }, "\u5141\u8BB8\u4E0A\u4F20", maxCount, "\u4E2A\u6587\u4EF6"), /*#__PURE__*/React__default['default'].createElement(Dragger, _objectSpread2({
6976
6976
  disabled: disabled,
6977
- multiple: true,
6977
+ multiple: false,
6978
6978
  accept: accept,
6979
6979
  name: "file",
6980
6980
  maxCount: maxCount,
@@ -7163,7 +7163,8 @@ function ApaasRate(props) {
7163
7163
  var address = kmkfUtils.AddressData.getInstance();
7164
7164
  var bsAddress = kmkfUtils.BsAddressData.getInstance();
7165
7165
  var Province = function Province(props) {
7166
- var type = props.type;
7166
+ var _props$type = props.type,
7167
+ type = _props$type === void 0 ? 'workOrder' : _props$type;
7167
7168
  var _useState = React.useState([]),
7168
7169
  _useState2 = _slicedToArray(_useState, 2),
7169
7170
  option = _useState2[0],
@@ -7174,7 +7175,7 @@ var Province = function Province(props) {
7174
7175
  return _regeneratorRuntime().wrap(function _callee$(_context) {
7175
7176
  while (1) switch (_context.prev = _context.next) {
7176
7177
  case 0:
7177
- setOptions(type === 'workOrder' ? address.addressOptions || [] : bsAddress.addressOptions || []);
7178
+ setOptions(type !== 'bs' ? address.addressOptions || [] : bsAddress.addressOptions || []);
7178
7179
  case 1:
7179
7180
  case "end":
7180
7181
  return _context.stop();
@@ -7193,6 +7194,9 @@ var Province = function Province(props) {
7193
7194
  }, []);
7194
7195
  return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(antd.Cascader, _objectSpread2(_objectSpread2({}, props), {}, {
7195
7196
  options: option,
7197
+ style: {
7198
+ minWidth: '100px'
7199
+ },
7196
7200
  placeholder: "\u8BF7\u9009\u62E9\u7701\u5E02\u533A"
7197
7201
  })));
7198
7202
  };
@@ -7222,7 +7226,7 @@ var ParseLogistics = function ParseLogistics(props) {
7222
7226
  });
7223
7227
  };
7224
7228
  return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(TextArea, {
7225
- placeholder: "\u590D\u5236\u7269\u6D41\u4FE1\u606F\uFF0C\u70B9\u51FB\u667A\u80FD\u8BC6\u522B",
7229
+ placeholder: "\u590D\u5236\u4FE1\u606F\uFF0C\u70B9\u51FB\u667A\u80FD\u8BC6\u522B",
7226
7230
  rows: 3,
7227
7231
  value: value,
7228
7232
  onChange: function onChange(e) {
@@ -8958,31 +8962,43 @@ var Payment = function Payment(props) {
8958
8962
  name: 'enterprisePaymentTid',
8959
8963
  placeholder: '请输入订单编号',
8960
8964
  required: required,
8961
- show: true
8965
+ show: true,
8966
+ hidden: false
8962
8967
  }, {
8963
8968
  label: '打款金额',
8964
8969
  name: 'enterprisePaymentRefundFee',
8965
8970
  placeholder: '请输入打款金额',
8966
8971
  required: required,
8967
- show: true
8972
+ show: true,
8973
+ hidden: false
8968
8974
  }, {
8969
8975
  label: '买家昵称',
8970
8976
  name: 'enterprisePaymentBuyerNick',
8971
8977
  placeholder: '请输入买家昵称',
8972
8978
  required: false,
8973
- show: true
8979
+ show: true,
8980
+ hidden: false
8974
8981
  }, {
8975
8982
  label: '支付宝名称',
8976
8983
  name: 'enterprisePaymentAlipayNick',
8977
8984
  placeholder: '请输入支付宝名称',
8978
8985
  required: zhiFubaoRequired,
8979
- show: true
8986
+ show: true,
8987
+ hidden: false
8980
8988
  }, {
8981
8989
  label: '支付宝账号',
8982
8990
  name: 'enterprisePaymentAlipayNo',
8983
8991
  placeholder: '请输入支付宝账号',
8984
8992
  required: zhiFubaoRequired,
8985
- show: true
8993
+ show: true,
8994
+ hidden: false
8995
+ }, {
8996
+ label: '打款状态',
8997
+ name: 'enterprisePaymentStatus',
8998
+ placeholder: '',
8999
+ required: false,
9000
+ show: false,
9001
+ hidden: true
8986
9002
  }];
8987
9003
  return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, PaymentList.map(function (item) {
8988
9004
  return item.show && /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
@@ -9321,6 +9337,51 @@ var LogisticsTrajectory = function LogisticsTrajectory(props) {
9321
9337
  typeof onChange === 'function' && onChange(_objectSpread2(_objectSpread2({}, value), {}, {
9322
9338
  trajectoryCompany: val
9323
9339
  }));
9340
+ handleSearchSnapshot(val);
9341
+ };
9342
+ var handleSearchSnapshot = function handleSearchSnapshot(company) {
9343
+ var trajectoryCompany = value.trajectoryCompany,
9344
+ trajectoryCode = value.trajectoryCode,
9345
+ trajectoryPhone = value.trajectoryPhone;
9346
+ var newCompany = company ? company : trajectoryCompany;
9347
+ if (newCompany === 'SF' && !(newCompany && trajectoryCode && trajectoryPhone)) {
9348
+ return;
9349
+ } else if (!(newCompany && trajectoryCode)) {
9350
+ return;
9351
+ }
9352
+ try {
9353
+ extendRequest('/qy/logistics/logisticsTraceSearch', {
9354
+ method: 'post',
9355
+ data: {
9356
+ mailNo: trajectoryCode,
9357
+ cpCode: newCompany,
9358
+ mobile: trajectoryPhone
9359
+ }
9360
+ }).then(function (res) {
9361
+ var result = res.result,
9362
+ success = res.success,
9363
+ data = res.data,
9364
+ msg = res.message;
9365
+ if (result === 100 || success) {
9366
+ onChange(_objectSpread2(_objectSpread2({}, value), {}, {
9367
+ trajectorySnapshot: data === null || data === void 0 ? void 0 : data.logisticsStatusDesc,
9368
+ trajectoryCompany: newCompany
9369
+ }));
9370
+ } else {
9371
+ onChange(_objectSpread2(_objectSpread2({}, value), {}, {
9372
+ trajectorySnapshot: '',
9373
+ trajectoryCompany: newCompany
9374
+ }));
9375
+ msg && antd.message.error(msg);
9376
+ }
9377
+ });
9378
+ } catch (err) {
9379
+ onChange(_objectSpread2(_objectSpread2({}, value), {}, {
9380
+ trajectorySnapshot: '',
9381
+ trajectoryCompany: newCompany
9382
+ }));
9383
+ (err === null || err === void 0 ? void 0 : err.message) && antd.message.error(err === null || err === void 0 ? void 0 : err.message);
9384
+ }
9324
9385
  };
9325
9386
  //物流公司
9326
9387
  var LogisticsCompany = function LogisticsCompany() {
@@ -9343,20 +9404,40 @@ var LogisticsTrajectory = function LogisticsTrajectory(props) {
9343
9404
  //物流单号
9344
9405
  var LogisticsCode = function LogisticsCode() {
9345
9406
  return /*#__PURE__*/React__default['default'].createElement(antd.Input, {
9346
- style: {
9347
- marginBottom: '8px'
9348
- },
9349
9407
  disabled: disabled,
9350
9408
  placeholder: "\u7269\u6D41\u5355\u53F7",
9351
9409
  onChange: function onChange(e) {
9352
9410
  return handleInputChange(e, 'trajectoryCode');
9353
9411
  },
9354
- value: value === null || value === void 0 ? void 0 : value.trajectoryCode
9412
+ value: value === null || value === void 0 ? void 0 : value.trajectoryCode,
9413
+ onBlur: function onBlur() {
9414
+ return handleSearchSnapshot();
9415
+ }
9416
+ });
9417
+ };
9418
+ //sf手机号
9419
+ var LogisticsPhone = function LogisticsPhone() {
9420
+ return /*#__PURE__*/React__default['default'].createElement(antd.Input, {
9421
+ disabled: disabled,
9422
+ style: {
9423
+ marginTop: '8px'
9424
+ },
9425
+ placeholder: "\u624B\u673A\u53F7",
9426
+ onChange: function onChange(e) {
9427
+ return handleInputChange(e, 'trajectoryPhone');
9428
+ },
9429
+ value: value === null || value === void 0 ? void 0 : value.trajectoryPhone,
9430
+ onBlur: function onBlur() {
9431
+ return handleSearchSnapshot();
9432
+ }
9355
9433
  });
9356
9434
  };
9357
9435
  //物流快照
9358
9436
  var LogisticsSnapshot = function LogisticsSnapshot() {
9359
9437
  return /*#__PURE__*/React__default['default'].createElement(antd.Input, {
9438
+ style: {
9439
+ marginTop: '8px'
9440
+ },
9360
9441
  disabled: true,
9361
9442
  placeholder: "\u7269\u6D41\u5FEB\u7167",
9362
9443
  onChange: function onChange(e) {
@@ -9365,7 +9446,7 @@ var LogisticsTrajectory = function LogisticsTrajectory(props) {
9365
9446
  value: value === null || value === void 0 ? void 0 : value.trajectorySnapshot
9366
9447
  });
9367
9448
  };
9368
- return /*#__PURE__*/React__default['default'].createElement("div", null, LogisticsCompany(), LogisticsCode(), showField.includes('snapshot') ? /*#__PURE__*/React__default['default'].createElement(LogisticsSnapshot, null) : null);
9449
+ return /*#__PURE__*/React__default['default'].createElement("div", null, LogisticsCompany(), LogisticsCode(), (value === null || value === void 0 ? void 0 : value.trajectoryCompany) === 'SF' ? LogisticsPhone() : null, showField && showField.includes('snapshot') ? /*#__PURE__*/React__default['default'].createElement(LogisticsSnapshot, null) : null);
9369
9450
  };
9370
9451
 
9371
9452
  var jstGoods = function jstGoods(props) {
@@ -9379,7 +9460,7 @@ var jstGoods = function jstGoods(props) {
9379
9460
  _props$type = props.type,
9380
9461
  type = _props$type === void 0 ? 1 : _props$type,
9381
9462
  _props$showField = props.showField,
9382
- showField = _props$showField === void 0 ? 'all' : _props$showField;
9463
+ showField = _props$showField === void 0 ? '' : _props$showField;
9383
9464
  var _useState = React.useState(0),
9384
9465
  _useState2 = _slicedToArray(_useState, 2),
9385
9466
  changeIndex = _useState2[0],
@@ -9429,7 +9510,7 @@ var jstGoods = function jstGoods(props) {
9429
9510
  return setChangeIndex(index);
9430
9511
  }
9431
9512
  }, "\u5305\u88F9".concat(index + 1)));
9432
- }))) : null, value.length ? /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, type === 1 ? /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(antd.Select, {
9513
+ }))) : null, value.length ? /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, type === 1 ? /*#__PURE__*/React__default['default'].createElement(antd.Space, null, !showField || showField === 'logisticsCompany' ? /*#__PURE__*/React__default['default'].createElement(antd.Select, {
9433
9514
  disabled: disabled,
9434
9515
  placeholder: "\u7269\u6D41\u516C\u53F8",
9435
9516
  onChange: function onChange(val) {
@@ -9444,14 +9525,14 @@ var jstGoods = function jstGoods(props) {
9444
9525
  style: {
9445
9526
  minWidth: '100px'
9446
9527
  }
9447
- }), /*#__PURE__*/React__default['default'].createElement(antd.Input, {
9528
+ }) : null, !showField || showField === 'logisticsCode' ? /*#__PURE__*/React__default['default'].createElement(antd.Input, {
9448
9529
  disabled: disabled,
9449
9530
  placeholder: "\u7269\u6D41\u5355\u53F7",
9450
9531
  onChange: function onChange(e) {
9451
9532
  return changeInputHandle(e.target.value, 'logisticsCode');
9452
9533
  },
9453
9534
  value: (_value$changeIndex2 = value[changeIndex]) === null || _value$changeIndex2 === void 0 ? void 0 : _value$changeIndex2.logisticsCode
9454
- })) : null, type === 2 ? /*#__PURE__*/React__default['default'].createElement(antd.Space, null, ['supplyId', 'all'].includes(showField) && /*#__PURE__*/React__default['default'].createElement(antd.Input, {
9535
+ }) : null) : null, type === 2 ? /*#__PURE__*/React__default['default'].createElement(antd.Space, null, ['supplyId', 'all'].includes(showField) && /*#__PURE__*/React__default['default'].createElement(antd.Input, {
9455
9536
  disabled: disabled,
9456
9537
  placeholder: "\u8BF7\u8F93\u5165\u4F9B\u9500\u5546\u7F16\u7801",
9457
9538
  onChange: function onChange(e) {
@@ -9556,44 +9637,63 @@ var ItemList = function ItemList(props) {
9556
9637
  }, "\u6682\u4E0D\u652F\u6301\u6DFB\u52A0")) : null);
9557
9638
  };
9558
9639
 
9559
- var TabPane$1 = antd.Tabs.TabPane;
9560
9640
  var columns = [{
9561
- dataIndex: 'picUrl',
9562
- title: '主图',
9563
- render: function render(val) {
9564
- return /*#__PURE__*/React__default['default'].createElement(antd.Image, {
9565
- width: 60,
9566
- src: val
9567
- });
9641
+ dataIndex: 'index',
9642
+ title: '序号',
9643
+ // with: 70,
9644
+ ellipsis: true,
9645
+ render: function render(val, record, index) {
9646
+ return /*#__PURE__*/React__default['default'].createElement("span", null, index + 1);
9568
9647
  }
9569
9648
  }, {
9570
- dataIndex: 'outerId',
9571
- title: '款式编码'
9649
+ dataIndex: 'name',
9650
+ title: '商品名称',
9651
+ with: 200,
9652
+ ellipsis: true
9653
+ }, {
9654
+ dataIndex: 'goodsId',
9655
+ title: '商品id',
9656
+ with: 200,
9657
+ ellipsis: true
9572
9658
  }, {
9573
- dataIndex: 'numIid',
9574
- title: '商品编码'
9659
+ dataIndex: 'skuName',
9660
+ title: '商品sku名称',
9661
+ with: 200,
9662
+ ellipsis: true
9575
9663
  }, {
9576
- dataIndex: 'title',
9577
- title: '商品名称'
9664
+ dataIndex: 'code',
9665
+ title: '商品编码',
9666
+ with: 200,
9667
+ ellipsis: true
9578
9668
  }, {
9579
- dataIndex: 'skus',
9580
- title: '颜色及规格'
9669
+ dataIndex: 'skuCode',
9670
+ title: '商品sku编码',
9671
+ with: 200,
9672
+ ellipsis: true
9673
+ }, {
9674
+ dataIndex: 'marketPrice',
9675
+ title: '市场价',
9676
+ with: 200,
9677
+ ellipsis: true
9581
9678
  }];
9582
9679
  var GoodsModal$1 = function GoodsModal(props, ref) {
9583
9680
  React.useImperativeHandle(ref, function () {
9584
9681
  return {
9585
9682
  open: function open() {
9586
9683
  setVisible(true);
9684
+ setPageNo(1);
9587
9685
  setSelect([]);
9588
9686
  setSelectIds([]);
9589
9687
  queryItems();
9688
+ onReset();
9590
9689
  }
9591
9690
  };
9592
9691
  });
9593
9692
  var onSubmit = props.onSubmit,
9594
9693
  shopId = props.shopId,
9595
9694
  shopList = props.shopList,
9596
- width = props.width;
9695
+ width = props.width,
9696
+ shopCode = props.shopCode;
9597
9697
  var _useState = React.useState(false),
9598
9698
  _useState2 = _slicedToArray(_useState, 2),
9599
9699
  visible = _useState2[0],
@@ -9608,123 +9708,85 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
9608
9708
  setSelectIds = _useState6[1];
9609
9709
  var _useState7 = React.useState([]),
9610
9710
  _useState8 = _slicedToArray(_useState7, 2),
9611
- goodList = _useState8[0],
9612
- setGoodList = _useState8[1];
9613
- var _useState9 = React.useState(false),
9711
+ allList = _useState8[0],
9712
+ setAllList = _useState8[1]; //获取到的所有数据
9713
+ var _useState9 = React.useState([]),
9614
9714
  _useState10 = _slicedToArray(_useState9, 2),
9615
- loading = _useState10[0],
9616
- setLoading = _useState10[1];
9617
- var _useState11 = React.useState({
9618
- apiName: 'queryItems',
9619
- desc: true,
9620
- numIids: '',
9621
- orderBy: 'list_time',
9622
- pageNo: 1,
9623
- pageSize: 10,
9624
- shopId: shopId,
9625
- type: 'onSale',
9626
- cids: '',
9627
- title: ''
9628
- }),
9715
+ filterList = _useState10[0],
9716
+ setFilterList = _useState10[1]; //获取到的筛选数据
9717
+ var _useState11 = React.useState(1),
9629
9718
  _useState12 = _slicedToArray(_useState11, 2),
9630
- searchParams = _useState12[0],
9631
- setSearch = _useState12[1];
9632
- var _useState13 = React.useState(0),
9633
- _useState14 = _slicedToArray(_useState13, 2),
9634
- total = _useState14[0],
9635
- setTotal = _useState14[1];
9636
- var _useState15 = React.useState(''),
9719
+ pageNo = _useState12[0],
9720
+ setPageNo = _useState12[1];
9721
+ var _useState13 = React.useState(20),
9722
+ _useState14 = _slicedToArray(_useState13, 1),
9723
+ pageSize = _useState14[0];
9724
+ var _useState15 = React.useState([]),
9637
9725
  _useState16 = _slicedToArray(_useState15, 2),
9638
- platform = _useState16[0],
9639
- setPlatform = _useState16[1]; //平台 taobao=淘宝 fxg=抖音 pdd=拼多多 sph=微信视屏号
9640
- var _useState17 = React.useState({}),
9726
+ goodList = _useState16[0],
9727
+ setGoodList = _useState16[1];
9728
+ var _useState17 = React.useState(false),
9641
9729
  _useState18 = _slicedToArray(_useState17, 2),
9642
- shopInfo = _useState18[0],
9643
- setShopInfo = _useState18[1]; //店铺信息
9644
- var _useState19 = React.useState([{
9645
- tab: '所选商品',
9646
- key: 'onSale'
9647
- }
9648
- // { tab: '已选商品', key: 'select' },
9649
- ]),
9650
- _useState20 = _slicedToArray(_useState19, 1),
9651
- tabs = _useState20[0];
9730
+ loading = _useState18[0],
9731
+ setLoading = _useState18[1];
9732
+ var _useState19 = React.useState(0),
9733
+ _useState20 = _slicedToArray(_useState19, 2),
9734
+ total = _useState20[0],
9735
+ setTotal = _useState20[1];
9736
+ var _useState21 = React.useState(''),
9737
+ _useState22 = _slicedToArray(_useState21, 2),
9738
+ platform = _useState22[0],
9739
+ setPlatform = _useState22[1]; //平台 taobao=淘宝 fxg=抖音 pdd=拼多多 sph=微信视屏号
9740
+ var _useState23 = React.useState({}),
9741
+ _useState24 = _slicedToArray(_useState23, 2),
9742
+ shopInfo = _useState24[0],
9743
+ setShopInfo = _useState24[1]; //店铺信息
9744
+ var _Form$useForm = antd.Form.useForm(),
9745
+ _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
9746
+ form = _Form$useForm2[0];
9652
9747
  //选择页码
9653
- var pageChange = function pageChange(page, pageSize) {
9654
- setSearch(_objectSpread2(_objectSpread2({}, searchParams), {}, {
9655
- pageNo: page,
9656
- pageSize: pageSize
9657
- }));
9658
- };
9659
- /**
9660
- *
9661
- * @returns 获取查询参数
9662
- */
9663
- var queryPd = function queryPd() {
9664
- var params = {
9665
- apiName: 'queryItems',
9666
- desc: searchParams.desc,
9667
- productIds: searchParams.numIids,
9668
- orderBy: searchParams.orderBy,
9669
- pageNo: searchParams.pageNo,
9670
- pageSize: searchParams.pageSize,
9671
- shopId: shopId,
9672
- type: searchParams.type,
9673
- title: searchParams.title,
9674
- cids: searchParams.cids
9675
- };
9676
- return params;
9748
+ var pageChange = function pageChange(page) {
9749
+ setPageNo(page);
9750
+ setGoodList(_toConsumableArray(filterList).splice((page - 1) * pageSize, pageSize));
9677
9751
  };
9678
9752
  /**
9679
9753
  * 查询商品
9680
9754
  */
9681
- var queryItems = /*#__PURE__*/function () {
9682
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
9683
- var params, res, _ref2, list, _total, nextKey, newList;
9684
- return _regeneratorRuntime().wrap(function _callee$(_context) {
9685
- while (1) switch (_context.prev = _context.next) {
9686
- case 0:
9687
- _context.prev = 0;
9688
- setLoading(true);
9689
- params = _objectSpread2({}, queryPd());
9690
- params.shopName = shopInfo === null || shopInfo === void 0 ? void 0 : shopInfo.shopName;
9691
- params.platform = platform;
9692
- params.status = params.type === 'onSale' ? 1 : 0;
9693
- delete params.type;
9694
- _context.next = 9;
9695
- return extendRequest('/qy/gdfw/product/listProduct', {
9696
- method: 'post',
9697
- data: params
9698
- });
9699
- case 9:
9700
- res = _context.sent;
9701
- _ref2 = res.data || {
9702
- result: [],
9703
- total: 0
9704
- }, list = _ref2.result, _total = _ref2.total, nextKey = _ref2.nextKey;
9705
- newList = list || [];
9706
- newList.forEach(function (item) {
9707
- item.numIid = item.productId;
9708
- item.outerId = item.outId;
9709
- item.title = item.productName;
9710
- item.platform = platform;
9755
+ var queryItems = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
9756
+ var params, res, products, newProducts;
9757
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
9758
+ while (1) switch (_context.prev = _context.next) {
9759
+ case 0:
9760
+ _context.prev = 0;
9761
+ setLoading(true);
9762
+ params = {
9763
+ shopCode: shopCode
9764
+ };
9765
+ _context.next = 5;
9766
+ return extendRequest('/qy/gdfw/product/bsListProduct', {
9767
+ method: 'post',
9768
+ data: params
9769
+ });
9770
+ case 5:
9771
+ res = _context.sent;
9772
+ products = res.data.products;
9773
+ newProducts = products.map(function (item, index) {
9774
+ return _objectSpread2(_objectSpread2({}, item), {}, {
9775
+ index: index + 1
9711
9776
  });
9712
- setGoodList(newList);
9713
- setTotal(_total);
9714
- case 15:
9715
- _context.prev = 15;
9716
- setLoading(false);
9717
- return _context.finish(15);
9718
- case 18:
9719
- case "end":
9720
- return _context.stop();
9721
- }
9722
- }, _callee, null, [[0,, 15, 18]]);
9723
- }));
9724
- return function queryItems() {
9725
- return _ref.apply(this, arguments);
9726
- };
9727
- }();
9777
+ });
9778
+ setAllList(_toConsumableArray(newProducts));
9779
+ initData(_toConsumableArray(newProducts));
9780
+ case 10:
9781
+ _context.prev = 10;
9782
+ setLoading(false);
9783
+ return _context.finish(10);
9784
+ case 13:
9785
+ case "end":
9786
+ return _context.stop();
9787
+ }
9788
+ }, _callee, null, [[0,, 10, 13]]);
9789
+ })), [shopCode]);
9728
9790
  React.useEffect(function () {
9729
9791
  var shopInfo = shopList.find(function (item) {
9730
9792
  return shopId === item.shopId || shopId === item.shopName;
@@ -9735,12 +9797,19 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
9735
9797
  }, [shopId]);
9736
9798
  var rowSelection = {
9737
9799
  selectedRowKeys: selectIds,
9800
+ fixed: true,
9738
9801
  onChange: function onChange(selectedRowKeys, selectedRows, info) {
9739
9802
  console.log(selectedRowKeys, selectedRows, info);
9740
9803
  setSelectIds(selectedRowKeys);
9741
9804
  setSelect(_toConsumableArray(selectedRows));
9742
9805
  }
9743
9806
  };
9807
+ var initData = function initData(list) {
9808
+ setFilterList(_toConsumableArray(list));
9809
+ setGoodList(_toConsumableArray(list).splice(0, pageSize));
9810
+ setTotal(list.length);
9811
+ setPageNo(1);
9812
+ };
9744
9813
  var _onCancel = function onCancel() {
9745
9814
  setVisible(false);
9746
9815
  };
@@ -9748,8 +9817,23 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
9748
9817
  onSubmit(selectList);
9749
9818
  _onCancel();
9750
9819
  };
9820
+ var onFinish = function onFinish(value) {
9821
+ var newFilterList = [];
9822
+ Object.keys(value).forEach(function (key) {
9823
+ if (value[key]) {
9824
+ newFilterList = allList.filter(function (item) {
9825
+ return item[key].indexOf(value[key]) > -1;
9826
+ });
9827
+ }
9828
+ });
9829
+ initData(newFilterList);
9830
+ };
9831
+ var onReset = function onReset() {
9832
+ form.resetFields();
9833
+ initData(_toConsumableArray(allList));
9834
+ };
9751
9835
  return /*#__PURE__*/React__default['default'].createElement(antd.Modal, {
9752
- title: '选择商品编码',
9836
+ title: '选择商品',
9753
9837
  okText: '确认',
9754
9838
  cancelText: '取消',
9755
9839
  visible: visible,
@@ -9759,52 +9843,53 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
9759
9843
  },
9760
9844
  onOk: onOk,
9761
9845
  wrapClassName: "goodModal"
9762
- }, /*#__PURE__*/React__default['default'].createElement(antd.Tabs, {
9763
- type: "card",
9764
- activeKey: searchParams.type,
9765
- onChange: function onChange(e) {
9766
- var params = _objectSpread2(_objectSpread2({}, searchParams), {}, {
9767
- type: e,
9768
- pageNo: 1
9769
- });
9770
- setSearch(params);
9846
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Form, {
9847
+ layout: "inline",
9848
+ form: form,
9849
+ onFinish: onFinish
9850
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
9851
+ name: "name"
9852
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
9853
+ placeholder: "\u8BF7\u8F93\u5165\u5546\u54C1\u540D\u79F0",
9854
+ style: {
9855
+ width: 150
9771
9856
  }
9772
- }, tabs.map(function (tab) {
9773
- return /*#__PURE__*/React__default['default'].createElement(TabPane$1, {
9774
- tab: tab.tab + (tab.key === 'select' ? "(".concat(selectList.length, ")") : ''),
9775
- key: tab.key
9776
- });
9777
- })), /*#__PURE__*/React__default['default'].createElement("div", {
9778
- className: "searchBox",
9857
+ })), /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
9858
+ name: "code"
9859
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
9860
+ placeholder: "\u8BF7\u8F93\u5165\u5546\u54C1\u7F16\u7801",
9779
9861
  style: {
9780
- display: searchParams.type === 'select' ? 'none' : ''
9862
+ width: 150
9863
+ }
9864
+ })), /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
9865
+ name: "skuCode"
9866
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
9867
+ placeholder: "\u8BF7\u8F93\u5165\u5546\u54C1sku\u7F16\u7801",
9868
+ style: {
9869
+ width: 150
9781
9870
  }
9782
- }, /*#__PURE__*/React__default['default'].createElement(antd.Form, {
9783
- layout: "inline"
9784
- }, /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, null, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
9785
- placeholder: "\u6B3E\u5F0F\u7F16\u7801"
9786
- })), /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, null, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
9787
- placeholder: "\u5546\u54C1\u7F16\u7801"
9788
- })), /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, null, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
9789
- placeholder: "\u5546\u54C1\u540D\u79F0"
9790
9871
  })), /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, null, /*#__PURE__*/React__default['default'].createElement(antd.Button, {
9791
9872
  type: "primary",
9792
9873
  htmlType: "submit"
9793
- }, "\u67E5\u8BE2"), /*#__PURE__*/React__default['default'].createElement(antd.Button, null, "\u91CD\u7F6E")))), /*#__PURE__*/React__default['default'].createElement(antd.Spin, {
9874
+ }, "\u67E5\u8BE2"), /*#__PURE__*/React__default['default'].createElement(antd.Button, {
9875
+ onClick: onReset
9876
+ }, "\u91CD\u7F6E"))), /*#__PURE__*/React__default['default'].createElement(antd.Spin, {
9794
9877
  spinning: loading
9795
9878
  }, /*#__PURE__*/React__default['default'].createElement(antd.Table, {
9796
9879
  rowSelection: rowSelection,
9797
9880
  columns: columns,
9798
- rowKey: 'numIid',
9799
- dataSource: searchParams.type == 'select' ? selectList : goodList,
9881
+ rowKey: 'skuCode',
9882
+ dataSource: goodList,
9800
9883
  scroll: {
9884
+ x: true,
9801
9885
  y: 300
9802
9886
  },
9803
9887
  pagination: {
9804
9888
  size: 'small',
9805
9889
  total: total,
9806
- current: searchParams.pageNo,
9807
- pageSize: searchParams.pageSize,
9890
+ current: pageNo,
9891
+ pageSize: pageSize,
9892
+ pageSizeOptions: [],
9808
9893
  onChange: pageChange
9809
9894
  }
9810
9895
  })));
@@ -9823,8 +9908,8 @@ var GoodItem = function GoodItem(props) {
9823
9908
  value = _props$value === void 0 ? [] : _props$value,
9824
9909
  onChange = props.onChange,
9825
9910
  disabled = props.disabled,
9826
- _props$showField = props.showField,
9827
- showField = _props$showField === void 0 ? [] : _props$showField,
9911
+ _props$showHeader = props.showHeader,
9912
+ showHeader = _props$showHeader === void 0 ? [] : _props$showHeader,
9828
9913
  width = props.width,
9829
9914
  _props$shopList = props.shopList,
9830
9915
  shopList = _props$shopList === void 0 ? [] : _props$shopList,
@@ -9840,6 +9925,7 @@ var GoodItem = function GoodItem(props) {
9840
9925
  otherOperations = _props$otherOperation === void 0 ? null : _props$otherOperation,
9841
9926
  _props$canUpdateNumbe = props.canUpdateNumber,
9842
9927
  canUpdateNumber = _props$canUpdateNumbe === void 0 ? false : _props$canUpdateNumbe,
9928
+ shopCode = props.shopCode,
9843
9929
  onSelect = props.onSelect,
9844
9930
  onDelete = props.onDelete;
9845
9931
  var refModal = React.useRef();
@@ -9869,6 +9955,18 @@ var GoodItem = function GoodItem(props) {
9869
9955
  var GOODS_INFO_COLUMNS = function GOODS_INFO_COLUMNS() {
9870
9956
  var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
9871
9957
  return [{
9958
+ dataIndex: 'pic',
9959
+ title: "\u56FE\u7247",
9960
+ align: 'center',
9961
+ ellipsis: true,
9962
+ width: 100,
9963
+ render: function render(val) {
9964
+ return /*#__PURE__*/React__default['default'].createElement(antd.Image, {
9965
+ width: 60,
9966
+ src: val
9967
+ });
9968
+ }
9969
+ }, {
9872
9970
  dataIndex: 'name',
9873
9971
  title: "".concat(text, "\u540D\u79F0"),
9874
9972
  align: 'center',
@@ -9930,20 +10028,8 @@ var GoodItem = function GoodItem(props) {
9930
10028
  render: function render(val, record, index) {
9931
10029
  return /*#__PURE__*/React__default['default'].createElement("span", null, index + 1);
9932
10030
  }
9933
- }, {
9934
- dataIndex: 'pic',
9935
- title: "\u56FE\u7247",
9936
- align: 'center',
9937
- ellipsis: true,
9938
- width: 100,
9939
- render: function render(val) {
9940
- return /*#__PURE__*/React__default['default'].createElement(antd.Image, {
9941
- width: 60,
9942
- src: val
9943
- });
9944
- }
9945
10031
  }].concat(_toConsumableArray(GOODS_INFO_COLUMNS().filter(function (t) {
9946
- return showField.includes(t === null || t === void 0 ? void 0 : t.dataIndex);
10032
+ return showHeader.includes(t === null || t === void 0 ? void 0 : t.dataIndex);
9947
10033
  })));
9948
10034
  if (!disabled) {
9949
10035
  columnList.push({
@@ -9963,20 +10049,21 @@ var GoodItem = function GoodItem(props) {
9963
10049
  });
9964
10050
  }
9965
10051
  return columnList;
9966
- }, [showField, value, disabled]);
10052
+ }, [showHeader, value, disabled]);
9967
10053
  var onSubmit = function onSubmit(list) {
9968
10054
  var newList = list.map(function (item) {
9969
- var picUrl = item.picUrl,
9970
- title = item.title,
9971
- price = item.price,
9972
- numIid = item.numIid;
10055
+ var goodsId = item.goodsId,
10056
+ name = item.name,
10057
+ code = item.code,
10058
+ skuCode = item.skuCode,
10059
+ marketPrice = item.marketPrice;
9973
10060
  return {
9974
- id: numIid,
9975
- pic: picUrl,
9976
- name: title,
9977
- code: '',
9978
- sku: '',
9979
- money: price,
10061
+ id: goodsId,
10062
+ pic: '',
10063
+ name: name,
10064
+ code: code,
10065
+ sku: skuCode,
10066
+ money: marketPrice || 0,
9980
10067
  share: '',
9981
10068
  number: 1,
9982
10069
  type: '',
@@ -9989,7 +10076,7 @@ var GoodItem = function GoodItem(props) {
9989
10076
  var onSelectChange = function onSelectChange(newSelectedRowKeys) {
9990
10077
  setSelectedRowKeys(newSelectedRowKeys);
9991
10078
  onSelect === null || onSelect === void 0 ? void 0 : onSelect(value.filter(function (t) {
9992
- return newSelectedRowKeys.includes(t.id);
10079
+ return newSelectedRowKeys.includes(t.sku);
9993
10080
  }));
9994
10081
  };
9995
10082
  var handleChangeGoods = function handleChangeGoods() {
@@ -10017,7 +10104,7 @@ var GoodItem = function GoodItem(props) {
10017
10104
  }, "\u9009\u62E9\u5546\u54C1"), otherOperations), /*#__PURE__*/React__default['default'].createElement(antd.Table, _objectSpread2(_objectSpread2({}, tableConfig), {}, {
10018
10105
  columns: newColumns,
10019
10106
  dataSource: value,
10020
- rowKey: 'id',
10107
+ rowKey: 'sku',
10021
10108
  size: "small",
10022
10109
  pagination: false,
10023
10110
  scroll: {
@@ -10032,13 +10119,15 @@ var GoodItem = function GoodItem(props) {
10032
10119
  width: width,
10033
10120
  shopList: shopList,
10034
10121
  shopId: shopId,
10035
- maxLength: maxLength
10122
+ maxLength: maxLength,
10123
+ shopCode: shopCode
10036
10124
  }));
10037
10125
  };
10038
10126
 
10039
10127
  var BsGoods = function BsGoods(props) {
10040
10128
  var value = props.value,
10041
- disabled = props.disabled;
10129
+ disabled = props.disabled,
10130
+ onChange = props.onChange;
10042
10131
  var _useState = React.useState(false),
10043
10132
  _useState2 = _slicedToArray(_useState, 2),
10044
10133
  tableSelect = _useState2[0],
@@ -10054,17 +10143,19 @@ var BsGoods = function BsGoods(props) {
10054
10143
  var reissueRef = React.useRef();
10055
10144
  React.useEffect(function () {
10056
10145
  ref.current = pubsub__default['default'].subscribeOnce('type', function (type, val) {
10057
- console.log('goods', type, val, value);
10146
+ var _value$bsGoods;
10147
+ console.log(value);
10058
10148
  if (disabled) return;
10059
10149
  setWithInfo({
10060
10150
  type: type,
10061
10151
  val: val
10062
10152
  });
10063
10153
  setTableSelect(['2', '4'].includes(val));
10064
- if (['1', '3'].includes(val) && (value === null || value === void 0 ? void 0 : value.length)) {
10154
+ if (['1', '3'].includes(val) && (value === null || value === void 0 ? void 0 : (_value$bsGoods = value.bsGoods) === null || _value$bsGoods === void 0 ? void 0 : _value$bsGoods.length)) {
10155
+ var newGoods = lodash.cloneDeep(value === null || value === void 0 ? void 0 : value.bsGoods);
10065
10156
  pubsub__default['default'].publish('selectList', {
10066
10157
  type: val,
10067
- list: _toConsumableArray(value).map(function (item) {
10158
+ list: (newGoods || []).map(function (item) {
10068
10159
  item.canDelete = false;
10069
10160
  return item;
10070
10161
  })
@@ -10073,17 +10164,18 @@ var BsGoods = function BsGoods(props) {
10073
10164
  });
10074
10165
  //补发
10075
10166
  reissueRef.current = pubsub__default['default'].subscribeOnce('reissueType', function (type, val) {
10167
+ var _value$bsGoods2;
10076
10168
  if (disabled) return;
10077
- console.log('reissueType', type, val, value);
10078
10169
  setWithInfo({
10079
10170
  type: type,
10080
10171
  val: val
10081
10172
  });
10082
10173
  setTableSelect(['2', '4'].includes(val));
10083
- if (['1', '3'].includes(val) && (value === null || value === void 0 ? void 0 : value.length)) {
10174
+ if (['1', '3'].includes(val) && (value === null || value === void 0 ? void 0 : (_value$bsGoods2 = value.bsGoods) === null || _value$bsGoods2 === void 0 ? void 0 : _value$bsGoods2.length)) {
10175
+ var newGoods = lodash.cloneDeep(value === null || value === void 0 ? void 0 : value.bsGoods);
10084
10176
  pubsub__default['default'].publish('reissueSelectList', {
10085
10177
  type: val,
10086
- list: (value || []).map(function (item) {
10178
+ list: (newGoods || []).map(function (item) {
10087
10179
  item.canDelete = false;
10088
10180
  return item;
10089
10181
  })
@@ -10108,20 +10200,30 @@ var BsGoods = function BsGoods(props) {
10108
10200
  });
10109
10201
  }, [withInfo]);
10110
10202
  var _onDelete = function onDelete(item) {
10111
- var deleteId = item === null || item === void 0 ? void 0 : item.id;
10203
+ var deleteId = item === null || item === void 0 ? void 0 : item.sku;
10112
10204
  pubsub__default['default'].publish('deleteGood', deleteId);
10113
10205
  pubsub__default['default'].publish('reissueDeleteGood', deleteId);
10114
10206
  };
10207
+ var changeHandle = function changeHandle(list) {
10208
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, {
10209
+ bsGoods: list
10210
+ }));
10211
+ };
10115
10212
  return /*#__PURE__*/React__default['default'].createElement(GoodItem, _objectSpread2(_objectSpread2({
10116
- key: 'bsGoods',
10117
- disabled: disabled
10213
+ key: 'bsGoods'
10118
10214
  }, props), {}, {
10215
+ disabled: disabled,
10216
+ value: value === null || value === void 0 ? void 0 : value.bsGoods,
10217
+ shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
10119
10218
  tableSelect: tableSelect,
10120
10219
  onSelect: function onSelect(list) {
10121
10220
  return _onSelect(list);
10122
10221
  },
10123
10222
  onDelete: function onDelete(item) {
10124
10223
  return _onDelete(item);
10224
+ },
10225
+ onChange: function onChange(val) {
10226
+ return changeHandle(val);
10125
10227
  }
10126
10228
  }));
10127
10229
  };
@@ -10136,16 +10238,6 @@ var BsExchange = function BsExchange(props) {
10136
10238
  disabled = props.disabled,
10137
10239
  other = _objectWithoutProperties(props, _excluded$b);
10138
10240
  React.useEffect(function () {
10139
- pubsub__default['default'].subscribeOnce('selectList', function (_, data) {
10140
- if (disabled) return;
10141
- if (value) {
10142
- var newData = lodash.cloneDeep(data);
10143
- console.log('BsExchange', 'getListHandle', data, value, getListHandle(_toConsumableArray(newData.list), value));
10144
- onChange(_objectSpread2(_objectSpread2({}, value), {}, {
10145
- bsExchangeReturnGoods: getListHandle(_toConsumableArray(newData.list), value)
10146
- }));
10147
- }
10148
- });
10149
10241
  pubsub__default['default'].subscribeOnce('deleteGood', function (_, data) {
10150
10242
  if (disabled) return;
10151
10243
  if (value) {
@@ -10154,13 +10246,13 @@ var BsExchange = function BsExchange(props) {
10154
10246
  if (['2', '4'].includes((_value$bsExchangeType = value.bsExchangeType) === null || _value$bsExchangeType === void 0 ? void 0 : _value$bsExchangeType[0])) {
10155
10247
  newValue.bsExchangeReturnGoods = newValue.bsExchangeReturnGoods.map(function (item) {
10156
10248
  item.bsExchangeReturnGoods = item.bsExchangeReturnGoods.filter(function (t) {
10157
- return t.id !== data;
10249
+ return t.sku !== data;
10158
10250
  });
10159
10251
  return item;
10160
10252
  });
10161
10253
  } else if (['1', '3'].includes((_value$bsExchangeType2 = value.bsExchangeType) === null || _value$bsExchangeType2 === void 0 ? void 0 : _value$bsExchangeType2[0])) {
10162
10254
  newValue.bsExchangeReturnGoods = newValue.bsExchangeReturnGoods.filter(function (item) {
10163
- return item.id !== data;
10255
+ return item.sku !== data;
10164
10256
  });
10165
10257
  }
10166
10258
  onChange(newValue);
@@ -10168,11 +10260,10 @@ var BsExchange = function BsExchange(props) {
10168
10260
  });
10169
10261
  }, [value]);
10170
10262
  var getListHandle = function getListHandle(list, val) {
10171
- var _val$bsExchangeType;
10263
+ var _val$bsExchangeType, _val$bsExchangeType2;
10172
10264
  //如果是原单换
10173
10265
  if (['1', '3'].includes(val === null || val === void 0 ? void 0 : (_val$bsExchangeType = val.bsExchangeType) === null || _val$bsExchangeType === void 0 ? void 0 : _val$bsExchangeType[0])) {
10174
10266
  return list.reduce(function (prv, next) {
10175
- var _val$bsExchangeType2;
10176
10267
  next.canDelete = false;
10177
10268
  //数量大于1 拆开
10178
10269
  if (next.number > 1) {
@@ -10181,12 +10272,12 @@ var BsExchange = function BsExchange(props) {
10181
10272
  return t;
10182
10273
  });
10183
10274
  prv.push.apply(prv, _toConsumableArray(newList));
10184
- } else if (['2', '4'].includes(val === null || val === void 0 ? void 0 : (_val$bsExchangeType2 = val.bsExchangeType) === null || _val$bsExchangeType2 === void 0 ? void 0 : _val$bsExchangeType2[0])) {
10275
+ } else {
10185
10276
  prv.push(_objectSpread2({}, next));
10186
10277
  }
10187
10278
  return prv;
10188
10279
  }, []);
10189
- } else {
10280
+ } else if (['2', '4'].includes(val === null || val === void 0 ? void 0 : (_val$bsExchangeType2 = val.bsExchangeType) === null || _val$bsExchangeType2 === void 0 ? void 0 : _val$bsExchangeType2[0])) {
10190
10281
  //补发换货
10191
10282
  return list.reduce(function (prv, next, index) {
10192
10283
  next.canDelete = true;
@@ -10218,9 +10309,24 @@ var BsExchange = function BsExchange(props) {
10218
10309
  newValue.bsExchangeGiftGoods = [];
10219
10310
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10220
10311
  pubsub__default['default'].publish('type', val[0]);
10312
+ pubsub__default['default'].subscribe('selectList', function (_, data) {
10313
+ if (disabled) return;
10314
+ if (newValue) {
10315
+ var newData = lodash.cloneDeep(data);
10316
+ onChange(_objectSpread2(_objectSpread2({}, newValue), {}, {
10317
+ bsExchangeReturnGoods: getListHandle(_toConsumableArray(newData.list), newValue)
10318
+ }));
10319
+ }
10320
+ });
10221
10321
  };
10222
10322
  var changeHandle = function changeHandle(val, key) {
10223
10323
  var newValue = _objectSpread2({}, value);
10324
+ if (key === 'bsExchangeGiftGoods') {
10325
+ val = lodash.cloneDeep(val).map(function (t) {
10326
+ t.money = 0;
10327
+ return t;
10328
+ });
10329
+ }
10224
10330
  newValue[key] = val;
10225
10331
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10226
10332
  if (key === 'bsExchangeType') {
@@ -10278,15 +10384,22 @@ var BsExchange = function BsExchange(props) {
10278
10384
  disabled: disabled,
10279
10385
  showChangeBtn: false,
10280
10386
  value: value === null || value === void 0 ? void 0 : value.bsExchangeReturnGoods,
10387
+ shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
10281
10388
  onChange: function onChange(val) {
10282
10389
  return changeHandle(val, 'bsExchangeReturnGoods');
10283
10390
  }
10284
10391
  })) : /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, ((value === null || value === void 0 ? void 0 : value.bsExchangeReturnGoods) || []).map(function (item, index) {
10285
- return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("div", null, "\u9000\u56DE\u5546\u54C1"), /*#__PURE__*/React__default['default'].createElement(GoodItem, _objectSpread2(_objectSpread2({
10392
+ return /*#__PURE__*/React__default['default'].createElement("div", {
10393
+ style: {
10394
+ border: '1px dashed',
10395
+ marginBottom: '8px'
10396
+ }
10397
+ }, /*#__PURE__*/React__default['default'].createElement("div", null, "\u9000\u56DE\u5546\u54C1"), /*#__PURE__*/React__default['default'].createElement(GoodItem, _objectSpread2(_objectSpread2({
10286
10398
  key: 'bsReturnGoods'
10287
10399
  }, other), {}, {
10288
10400
  disabled: disabled,
10289
10401
  showChangeBtn: showChangeBtn,
10402
+ shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
10290
10403
  value: item === null || item === void 0 ? void 0 : item.bsExchangeReturnGoods,
10291
10404
  onChange: function onChange(val) {
10292
10405
  return changeReturnHandle(val, index, 'bsExchangeReturnGoods');
@@ -10298,6 +10411,7 @@ var BsExchange = function BsExchange(props) {
10298
10411
  showChangeBtn: showChangeBtn,
10299
10412
  otherOperations: copyGoods(index),
10300
10413
  value: item === null || item === void 0 ? void 0 : item.bsExchangeSwapOutGoods,
10414
+ shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
10301
10415
  onChange: function onChange(val) {
10302
10416
  return changeReturnHandle(val, index, 'bsExchangeSwapOutGoods');
10303
10417
  }
@@ -10305,7 +10419,8 @@ var BsExchange = function BsExchange(props) {
10305
10419
  })), ['3', '4'].includes(value === null || value === void 0 ? void 0 : (_value$bsExchangeType6 = value.bsExchangeType) === null || _value$bsExchangeType6 === void 0 ? void 0 : _value$bsExchangeType6[0]) ? /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("div", null, "\u8D60\u54C1\u4FE1\u606F"), /*#__PURE__*/React__default['default'].createElement(GoodItem, _objectSpread2(_objectSpread2({
10306
10420
  headerText: "\u8D60\u54C1",
10307
10421
  key: 'bsGiftGoods',
10308
- disabled: disabled
10422
+ disabled: disabled,
10423
+ shopCode: value === null || value === void 0 ? void 0 : value.shopCode
10309
10424
  }, other), {}, {
10310
10425
  value: value === null || value === void 0 ? void 0 : value.bsExchangeGiftGoods,
10311
10426
  onChange: function onChange(val) {
@@ -10323,26 +10438,12 @@ var BsReissue = function BsReissue(props) {
10323
10438
  disabled = props.disabled,
10324
10439
  other = _objectWithoutProperties(props, _excluded$c);
10325
10440
  React.useEffect(function () {
10326
- pubsub__default['default'].subscribeOnce('reissueSelectList', function (_, data) {
10327
- if (disabled) return;
10328
- console.log(data, value);
10329
- if (value) {
10330
- var newData = lodash.cloneDeep(data);
10331
- onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, {
10332
- bsReissueGoods: ((newData === null || newData === void 0 ? void 0 : newData.list) || []).map(function (item) {
10333
- item.money = 0;
10334
- item.canUpdateNumber = ['2', '4'].includes(newData === null || newData === void 0 ? void 0 : newData.type);
10335
- return item;
10336
- })
10337
- }));
10338
- }
10339
- });
10340
10441
  pubsub__default['default'].subscribeOnce('reissueDeleteGood', function (_, data) {
10341
10442
  if (disabled) return;
10342
10443
  if (value) {
10343
10444
  var newValue = _objectSpread2({}, value);
10344
10445
  newValue.bsReissueGoods = newValue.bsReissueGoods.filter(function (item) {
10345
- return item.id !== data;
10446
+ return item.sku !== data;
10346
10447
  });
10347
10448
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10348
10449
  }
@@ -10363,6 +10464,19 @@ var BsReissue = function BsReissue(props) {
10363
10464
  onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2({}, newValue));
10364
10465
  if (key === 'bsReissueType') {
10365
10466
  pubsub__default['default'].publish('reissueType', val[0]);
10467
+ pubsub__default['default'].subscribe('reissueSelectList', function (_, data) {
10468
+ if (disabled) return;
10469
+ if (value) {
10470
+ var newData = lodash.cloneDeep(data);
10471
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, newValue), {}, {
10472
+ bsReissueGoods: ((newData === null || newData === void 0 ? void 0 : newData.list) || []).map(function (item) {
10473
+ item.money = 0;
10474
+ item.canUpdateNumber = ['2', '4'].includes(newData === null || newData === void 0 ? void 0 : newData.type);
10475
+ return item;
10476
+ })
10477
+ }));
10478
+ }
10479
+ });
10366
10480
  }
10367
10481
  };
10368
10482
  //显示选择商品按钮 原单换不显示选择商品
@@ -10387,6 +10501,7 @@ var BsReissue = function BsReissue(props) {
10387
10501
  disabled: disabled,
10388
10502
  canUpdateNumber: showChangeBtn,
10389
10503
  showChangeBtn: showChangeBtn,
10504
+ shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
10390
10505
  value: value === null || value === void 0 ? void 0 : value.bsReissueGoods,
10391
10506
  onChange: function onChange(val) {
10392
10507
  return changeHandle(val, 'bsReissueGoods');
@@ -10397,7 +10512,7 @@ var BsReissue = function BsReissue(props) {
10397
10512
  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";
10398
10513
  styleInject(css_248z$9);
10399
10514
 
10400
- var TabPane$2 = antd.Tabs.TabPane;
10515
+ var TabPane$1 = antd.Tabs.TabPane;
10401
10516
  var Option$2 = antd.Select.Option;
10402
10517
  var Search$1 = antd.Input.Search;
10403
10518
  var GoodsModal$3 = function GoodsModal(props) {
@@ -10713,7 +10828,7 @@ var GoodsModal$3 = function GoodsModal(props) {
10713
10828
  }));
10714
10829
  }
10715
10830
  }, tabs.map(function (tab) {
10716
- return /*#__PURE__*/React__default['default'].createElement(TabPane$2, {
10831
+ return /*#__PURE__*/React__default['default'].createElement(TabPane$1, {
10717
10832
  tab: tab.tab + (tab.key === 'all' ? "(".concat(selectList.length, ")") : ''),
10718
10833
  key: tab.key
10719
10834
  });