@kmkf-fe-packages/basic-components 0.7.15-alpha.4 → 0.7.15-alpha.40
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 +346 -234
- package/dist/index.js +346 -234
- package/dist/src/bs/component/GoodItem/index.d.ts +2 -1
- package/dist/src/bs/component/GoodsModal.d.ts +1 -0
- package/package.json +4 -3
package/dist/index.esm.js
CHANGED
|
@@ -6940,7 +6940,7 @@ var ApaasUploadAsync$1 = function ApaasUploadAsync(_ref) {
|
|
|
6940
6940
|
var beforeUpload = function beforeUpload(file) {
|
|
6941
6941
|
console.log('beforeUpload', file);
|
|
6942
6942
|
var size = file.size / 1024 / 1024 < maxSize;
|
|
6943
|
-
if (value.length
|
|
6943
|
+
if (value.length >= maxCount) {
|
|
6944
6944
|
message.error("\u6700\u591A\u6DFB\u52A0".concat(maxCount, "\u4E2A\u6587\u4EF6\uFF01"));
|
|
6945
6945
|
return Upload.LIST_IGNORE;
|
|
6946
6946
|
}
|
|
@@ -6963,7 +6963,7 @@ var ApaasUploadAsync$1 = function ApaasUploadAsync(_ref) {
|
|
|
6963
6963
|
className: styles$2.tips
|
|
6964
6964
|
}, "\u5141\u8BB8\u4E0A\u4F20", maxCount, "\u4E2A\u6587\u4EF6"), /*#__PURE__*/React.createElement(Dragger, _objectSpread2({
|
|
6965
6965
|
disabled: disabled,
|
|
6966
|
-
multiple:
|
|
6966
|
+
multiple: false,
|
|
6967
6967
|
accept: accept,
|
|
6968
6968
|
name: "file",
|
|
6969
6969
|
maxCount: maxCount,
|
|
@@ -7152,7 +7152,8 @@ function ApaasRate(props) {
|
|
|
7152
7152
|
var address = AddressData.getInstance();
|
|
7153
7153
|
var bsAddress = BsAddressData.getInstance();
|
|
7154
7154
|
var Province = function Province(props) {
|
|
7155
|
-
var type = props.type
|
|
7155
|
+
var _props$type = props.type,
|
|
7156
|
+
type = _props$type === void 0 ? 'workOrder' : _props$type;
|
|
7156
7157
|
var _useState = useState([]),
|
|
7157
7158
|
_useState2 = _slicedToArray(_useState, 2),
|
|
7158
7159
|
option = _useState2[0],
|
|
@@ -7163,7 +7164,7 @@ var Province = function Province(props) {
|
|
|
7163
7164
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
7164
7165
|
while (1) switch (_context.prev = _context.next) {
|
|
7165
7166
|
case 0:
|
|
7166
|
-
setOptions(type
|
|
7167
|
+
setOptions(type !== 'bs' ? address.addressOptions || [] : bsAddress.addressOptions || []);
|
|
7167
7168
|
case 1:
|
|
7168
7169
|
case "end":
|
|
7169
7170
|
return _context.stop();
|
|
@@ -7211,7 +7212,7 @@ var ParseLogistics = function ParseLogistics(props) {
|
|
|
7211
7212
|
});
|
|
7212
7213
|
};
|
|
7213
7214
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(TextArea, {
|
|
7214
|
-
placeholder: "\u590D\u5236\
|
|
7215
|
+
placeholder: "\u590D\u5236\u4FE1\u606F\uFF0C\u70B9\u51FB\u667A\u80FD\u8BC6\u522B",
|
|
7215
7216
|
rows: 3,
|
|
7216
7217
|
value: value,
|
|
7217
7218
|
onChange: function onChange(e) {
|
|
@@ -8947,31 +8948,43 @@ var Payment = function Payment(props) {
|
|
|
8947
8948
|
name: 'enterprisePaymentTid',
|
|
8948
8949
|
placeholder: '请输入订单编号',
|
|
8949
8950
|
required: required,
|
|
8950
|
-
show: true
|
|
8951
|
+
show: true,
|
|
8952
|
+
hidden: false
|
|
8951
8953
|
}, {
|
|
8952
8954
|
label: '打款金额',
|
|
8953
8955
|
name: 'enterprisePaymentRefundFee',
|
|
8954
8956
|
placeholder: '请输入打款金额',
|
|
8955
8957
|
required: required,
|
|
8956
|
-
show: true
|
|
8958
|
+
show: true,
|
|
8959
|
+
hidden: false
|
|
8957
8960
|
}, {
|
|
8958
8961
|
label: '买家昵称',
|
|
8959
8962
|
name: 'enterprisePaymentBuyerNick',
|
|
8960
8963
|
placeholder: '请输入买家昵称',
|
|
8961
8964
|
required: false,
|
|
8962
|
-
show: true
|
|
8965
|
+
show: true,
|
|
8966
|
+
hidden: false
|
|
8963
8967
|
}, {
|
|
8964
8968
|
label: '支付宝名称',
|
|
8965
8969
|
name: 'enterprisePaymentAlipayNick',
|
|
8966
8970
|
placeholder: '请输入支付宝名称',
|
|
8967
8971
|
required: zhiFubaoRequired,
|
|
8968
|
-
show: true
|
|
8972
|
+
show: true,
|
|
8973
|
+
hidden: false
|
|
8969
8974
|
}, {
|
|
8970
8975
|
label: '支付宝账号',
|
|
8971
8976
|
name: 'enterprisePaymentAlipayNo',
|
|
8972
8977
|
placeholder: '请输入支付宝账号',
|
|
8973
8978
|
required: zhiFubaoRequired,
|
|
8974
|
-
show: true
|
|
8979
|
+
show: true,
|
|
8980
|
+
hidden: false
|
|
8981
|
+
}, {
|
|
8982
|
+
label: '打款状态',
|
|
8983
|
+
name: 'enterprisePaymentStatus',
|
|
8984
|
+
placeholder: '',
|
|
8985
|
+
required: false,
|
|
8986
|
+
show: false,
|
|
8987
|
+
hidden: true
|
|
8975
8988
|
}];
|
|
8976
8989
|
return /*#__PURE__*/React.createElement(React.Fragment, null, PaymentList.map(function (item) {
|
|
8977
8990
|
return item.show && /*#__PURE__*/React.createElement(Form.Item, {
|
|
@@ -9310,6 +9323,47 @@ var LogisticsTrajectory = function LogisticsTrajectory(props) {
|
|
|
9310
9323
|
typeof onChange === 'function' && onChange(_objectSpread2(_objectSpread2({}, value), {}, {
|
|
9311
9324
|
trajectoryCompany: val
|
|
9312
9325
|
}));
|
|
9326
|
+
handleSearchSnapshot(val);
|
|
9327
|
+
};
|
|
9328
|
+
var handleSearchSnapshot = function handleSearchSnapshot(company) {
|
|
9329
|
+
var trajectoryCompany = value.trajectoryCompany,
|
|
9330
|
+
trajectoryCode = value.trajectoryCode,
|
|
9331
|
+
trajectoryPhone = value.trajectoryPhone;
|
|
9332
|
+
var newCompany = company ? company : trajectoryCompany;
|
|
9333
|
+
if (newCompany === 'SF' && !(newCompany && trajectoryCode && trajectoryPhone)) {
|
|
9334
|
+
return;
|
|
9335
|
+
} else if (!(newCompany && trajectoryCode)) {
|
|
9336
|
+
return;
|
|
9337
|
+
}
|
|
9338
|
+
try {
|
|
9339
|
+
extendRequest('/qy/logistics/logisticsTraceSearch', {
|
|
9340
|
+
method: 'post',
|
|
9341
|
+
data: {
|
|
9342
|
+
mailNo: trajectoryCode,
|
|
9343
|
+
cpCode: newCompany,
|
|
9344
|
+
mobile: trajectoryPhone
|
|
9345
|
+
}
|
|
9346
|
+
}).then(function (res) {
|
|
9347
|
+
var result = res.result,
|
|
9348
|
+
success = res.success,
|
|
9349
|
+
data = res.data,
|
|
9350
|
+
msg = res.message;
|
|
9351
|
+
if (result === 100 || success) {
|
|
9352
|
+
onChange(_objectSpread2(_objectSpread2({}, value), {}, {
|
|
9353
|
+
trajectorySnapshot: data === null || data === void 0 ? void 0 : data.logisticsStatusDesc,
|
|
9354
|
+
trajectoryCompany: newCompany
|
|
9355
|
+
}));
|
|
9356
|
+
} else {
|
|
9357
|
+
msg && message.error(msg);
|
|
9358
|
+
}
|
|
9359
|
+
});
|
|
9360
|
+
} catch (err) {
|
|
9361
|
+
onChange(_objectSpread2(_objectSpread2({}, value), {}, {
|
|
9362
|
+
trajectorySnapshot: '',
|
|
9363
|
+
trajectoryCompany: newCompany
|
|
9364
|
+
}));
|
|
9365
|
+
(err === null || err === void 0 ? void 0 : err.message) && message.error(err === null || err === void 0 ? void 0 : err.message);
|
|
9366
|
+
}
|
|
9313
9367
|
};
|
|
9314
9368
|
//物流公司
|
|
9315
9369
|
var LogisticsCompany = function LogisticsCompany() {
|
|
@@ -9332,20 +9386,40 @@ var LogisticsTrajectory = function LogisticsTrajectory(props) {
|
|
|
9332
9386
|
//物流单号
|
|
9333
9387
|
var LogisticsCode = function LogisticsCode() {
|
|
9334
9388
|
return /*#__PURE__*/React.createElement(Input, {
|
|
9335
|
-
style: {
|
|
9336
|
-
marginBottom: '8px'
|
|
9337
|
-
},
|
|
9338
9389
|
disabled: disabled,
|
|
9339
9390
|
placeholder: "\u7269\u6D41\u5355\u53F7",
|
|
9340
9391
|
onChange: function onChange(e) {
|
|
9341
9392
|
return handleInputChange(e, 'trajectoryCode');
|
|
9342
9393
|
},
|
|
9343
|
-
value: value === null || value === void 0 ? void 0 : value.trajectoryCode
|
|
9394
|
+
value: value === null || value === void 0 ? void 0 : value.trajectoryCode,
|
|
9395
|
+
onBlur: function onBlur() {
|
|
9396
|
+
return handleSearchSnapshot();
|
|
9397
|
+
}
|
|
9398
|
+
});
|
|
9399
|
+
};
|
|
9400
|
+
//sf手机号
|
|
9401
|
+
var LogisticsPhone = function LogisticsPhone() {
|
|
9402
|
+
return /*#__PURE__*/React.createElement(Input, {
|
|
9403
|
+
disabled: disabled,
|
|
9404
|
+
style: {
|
|
9405
|
+
marginTop: '8px'
|
|
9406
|
+
},
|
|
9407
|
+
placeholder: "\u624B\u673A\u53F7",
|
|
9408
|
+
onChange: function onChange(e) {
|
|
9409
|
+
return handleInputChange(e, 'trajectoryPhone');
|
|
9410
|
+
},
|
|
9411
|
+
value: value === null || value === void 0 ? void 0 : value.trajectoryPhone,
|
|
9412
|
+
onBlur: function onBlur() {
|
|
9413
|
+
return handleSearchSnapshot();
|
|
9414
|
+
}
|
|
9344
9415
|
});
|
|
9345
9416
|
};
|
|
9346
9417
|
//物流快照
|
|
9347
9418
|
var LogisticsSnapshot = function LogisticsSnapshot() {
|
|
9348
9419
|
return /*#__PURE__*/React.createElement(Input, {
|
|
9420
|
+
style: {
|
|
9421
|
+
marginTop: '8px'
|
|
9422
|
+
},
|
|
9349
9423
|
disabled: true,
|
|
9350
9424
|
placeholder: "\u7269\u6D41\u5FEB\u7167",
|
|
9351
9425
|
onChange: function onChange(e) {
|
|
@@ -9354,7 +9428,7 @@ var LogisticsTrajectory = function LogisticsTrajectory(props) {
|
|
|
9354
9428
|
value: value === null || value === void 0 ? void 0 : value.trajectorySnapshot
|
|
9355
9429
|
});
|
|
9356
9430
|
};
|
|
9357
|
-
return /*#__PURE__*/React.createElement("div", null, LogisticsCompany(), LogisticsCode(), showField.includes('snapshot') ? /*#__PURE__*/React.createElement(LogisticsSnapshot, null) : null);
|
|
9431
|
+
return /*#__PURE__*/React.createElement("div", null, LogisticsCompany(), LogisticsCode(), (value === null || value === void 0 ? void 0 : value.trajectoryCompany) === 'SF' ? LogisticsPhone() : null, showField && showField.includes('snapshot') ? /*#__PURE__*/React.createElement(LogisticsSnapshot, null) : null);
|
|
9358
9432
|
};
|
|
9359
9433
|
|
|
9360
9434
|
var jstGoods = function jstGoods(props) {
|
|
@@ -9368,7 +9442,7 @@ var jstGoods = function jstGoods(props) {
|
|
|
9368
9442
|
_props$type = props.type,
|
|
9369
9443
|
type = _props$type === void 0 ? 1 : _props$type,
|
|
9370
9444
|
_props$showField = props.showField,
|
|
9371
|
-
showField = _props$showField === void 0 ? '
|
|
9445
|
+
showField = _props$showField === void 0 ? '' : _props$showField;
|
|
9372
9446
|
var _useState = useState(0),
|
|
9373
9447
|
_useState2 = _slicedToArray(_useState, 2),
|
|
9374
9448
|
changeIndex = _useState2[0],
|
|
@@ -9418,7 +9492,7 @@ var jstGoods = function jstGoods(props) {
|
|
|
9418
9492
|
return setChangeIndex(index);
|
|
9419
9493
|
}
|
|
9420
9494
|
}, "\u5305\u88F9".concat(index + 1)));
|
|
9421
|
-
}))) : null, value.length ? /*#__PURE__*/React.createElement(React.Fragment, null, type === 1 ? /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Select, {
|
|
9495
|
+
}))) : null, value.length ? /*#__PURE__*/React.createElement(React.Fragment, null, type === 1 ? /*#__PURE__*/React.createElement(Space, null, !showField || showField === 'logisticsCompany' ? /*#__PURE__*/React.createElement(Select, {
|
|
9422
9496
|
disabled: disabled,
|
|
9423
9497
|
placeholder: "\u7269\u6D41\u516C\u53F8",
|
|
9424
9498
|
onChange: function onChange(val) {
|
|
@@ -9433,14 +9507,14 @@ var jstGoods = function jstGoods(props) {
|
|
|
9433
9507
|
style: {
|
|
9434
9508
|
minWidth: '100px'
|
|
9435
9509
|
}
|
|
9436
|
-
}), /*#__PURE__*/React.createElement(Input, {
|
|
9510
|
+
}) : null, !showField || showField === 'logisticsCode' ? /*#__PURE__*/React.createElement(Input, {
|
|
9437
9511
|
disabled: disabled,
|
|
9438
9512
|
placeholder: "\u7269\u6D41\u5355\u53F7",
|
|
9439
9513
|
onChange: function onChange(e) {
|
|
9440
9514
|
return changeInputHandle(e.target.value, 'logisticsCode');
|
|
9441
9515
|
},
|
|
9442
9516
|
value: (_value$changeIndex2 = value[changeIndex]) === null || _value$changeIndex2 === void 0 ? void 0 : _value$changeIndex2.logisticsCode
|
|
9443
|
-
})) : null, type === 2 ? /*#__PURE__*/React.createElement(Space, null, ['supplyId', 'all'].includes(showField) && /*#__PURE__*/React.createElement(Input, {
|
|
9517
|
+
}) : null) : null, type === 2 ? /*#__PURE__*/React.createElement(Space, null, ['supplyId', 'all'].includes(showField) && /*#__PURE__*/React.createElement(Input, {
|
|
9444
9518
|
disabled: disabled,
|
|
9445
9519
|
placeholder: "\u8BF7\u8F93\u5165\u4F9B\u9500\u5546\u7F16\u7801",
|
|
9446
9520
|
onChange: function onChange(e) {
|
|
@@ -9545,44 +9619,47 @@ var ItemList = function ItemList(props) {
|
|
|
9545
9619
|
}, "\u6682\u4E0D\u652F\u6301\u6DFB\u52A0")) : null);
|
|
9546
9620
|
};
|
|
9547
9621
|
|
|
9548
|
-
var TabPane$1 = Tabs.TabPane;
|
|
9549
9622
|
var columns = [{
|
|
9550
|
-
dataIndex: '
|
|
9551
|
-
title: '
|
|
9552
|
-
|
|
9553
|
-
|
|
9554
|
-
|
|
9555
|
-
src: val
|
|
9556
|
-
});
|
|
9623
|
+
dataIndex: '',
|
|
9624
|
+
title: '序号',
|
|
9625
|
+
width: 100,
|
|
9626
|
+
render: function render(value, record, index) {
|
|
9627
|
+
return /*#__PURE__*/React.createElement("span", null, index);
|
|
9557
9628
|
}
|
|
9558
9629
|
}, {
|
|
9559
|
-
dataIndex: '
|
|
9560
|
-
title: '
|
|
9630
|
+
dataIndex: 'name',
|
|
9631
|
+
title: '商品名称'
|
|
9561
9632
|
}, {
|
|
9562
|
-
dataIndex: '
|
|
9563
|
-
title: '
|
|
9633
|
+
dataIndex: 'goodsId',
|
|
9634
|
+
title: '商品id'
|
|
9564
9635
|
}, {
|
|
9565
|
-
dataIndex: '
|
|
9566
|
-
title: '
|
|
9636
|
+
dataIndex: 'name',
|
|
9637
|
+
title: '商品sku名称'
|
|
9567
9638
|
}, {
|
|
9568
|
-
dataIndex: '
|
|
9569
|
-
title: '
|
|
9639
|
+
dataIndex: 'code',
|
|
9640
|
+
title: '商品编码'
|
|
9641
|
+
}, {
|
|
9642
|
+
dataIndex: 'skuCode',
|
|
9643
|
+
title: '商品sku编码'
|
|
9570
9644
|
}];
|
|
9571
9645
|
var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
9572
9646
|
useImperativeHandle(ref, function () {
|
|
9573
9647
|
return {
|
|
9574
9648
|
open: function open() {
|
|
9575
9649
|
setVisible(true);
|
|
9650
|
+
setPageNo(1);
|
|
9576
9651
|
setSelect([]);
|
|
9577
9652
|
setSelectIds([]);
|
|
9578
9653
|
queryItems();
|
|
9654
|
+
onReset();
|
|
9579
9655
|
}
|
|
9580
9656
|
};
|
|
9581
9657
|
});
|
|
9582
9658
|
var onSubmit = props.onSubmit,
|
|
9583
9659
|
shopId = props.shopId,
|
|
9584
9660
|
shopList = props.shopList,
|
|
9585
|
-
width = props.width
|
|
9661
|
+
width = props.width,
|
|
9662
|
+
shopCode = props.shopCode;
|
|
9586
9663
|
var _useState = useState(false),
|
|
9587
9664
|
_useState2 = _slicedToArray(_useState, 2),
|
|
9588
9665
|
visible = _useState2[0],
|
|
@@ -9597,13 +9674,28 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
9597
9674
|
setSelectIds = _useState6[1];
|
|
9598
9675
|
var _useState7 = useState([]),
|
|
9599
9676
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
9600
|
-
|
|
9601
|
-
|
|
9602
|
-
var _useState9 = useState(
|
|
9677
|
+
allList = _useState8[0],
|
|
9678
|
+
setAllList = _useState8[1]; //获取到的所有数据
|
|
9679
|
+
var _useState9 = useState([]),
|
|
9603
9680
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
9604
|
-
|
|
9605
|
-
|
|
9606
|
-
var _useState11 = useState(
|
|
9681
|
+
filterList = _useState10[0],
|
|
9682
|
+
setFilterList = _useState10[1]; //获取到的筛选数据
|
|
9683
|
+
var _useState11 = useState(1),
|
|
9684
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
9685
|
+
pageNo = _useState12[0],
|
|
9686
|
+
setPageNo = _useState12[1];
|
|
9687
|
+
var _useState13 = useState(20),
|
|
9688
|
+
_useState14 = _slicedToArray(_useState13, 1),
|
|
9689
|
+
pageSize = _useState14[0];
|
|
9690
|
+
var _useState15 = useState([]),
|
|
9691
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
9692
|
+
goodList = _useState16[0],
|
|
9693
|
+
setGoodList = _useState16[1];
|
|
9694
|
+
var _useState17 = useState(false),
|
|
9695
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
9696
|
+
loading = _useState18[0],
|
|
9697
|
+
setLoading = _useState18[1];
|
|
9698
|
+
var _useState19 = useState({
|
|
9607
9699
|
apiName: 'queryItems',
|
|
9608
9700
|
desc: true,
|
|
9609
9701
|
numIids: '',
|
|
@@ -9615,105 +9707,100 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
9615
9707
|
cids: '',
|
|
9616
9708
|
title: ''
|
|
9617
9709
|
}),
|
|
9618
|
-
|
|
9619
|
-
searchParams =
|
|
9620
|
-
setSearch =
|
|
9621
|
-
var
|
|
9622
|
-
|
|
9623
|
-
total =
|
|
9624
|
-
setTotal =
|
|
9625
|
-
var
|
|
9626
|
-
|
|
9627
|
-
platform =
|
|
9628
|
-
setPlatform =
|
|
9629
|
-
var
|
|
9630
|
-
|
|
9631
|
-
shopInfo =
|
|
9632
|
-
setShopInfo =
|
|
9633
|
-
var
|
|
9634
|
-
|
|
9635
|
-
|
|
9636
|
-
}
|
|
9637
|
-
// { tab: '已选商品', key: 'select' },
|
|
9638
|
-
]),
|
|
9639
|
-
_useState20 = _slicedToArray(_useState19, 1),
|
|
9640
|
-
tabs = _useState20[0];
|
|
9710
|
+
_useState20 = _slicedToArray(_useState19, 2),
|
|
9711
|
+
searchParams = _useState20[0],
|
|
9712
|
+
setSearch = _useState20[1];
|
|
9713
|
+
var _useState21 = useState(0),
|
|
9714
|
+
_useState22 = _slicedToArray(_useState21, 2),
|
|
9715
|
+
total = _useState22[0],
|
|
9716
|
+
setTotal = _useState22[1];
|
|
9717
|
+
var _useState23 = useState(''),
|
|
9718
|
+
_useState24 = _slicedToArray(_useState23, 2),
|
|
9719
|
+
platform = _useState24[0],
|
|
9720
|
+
setPlatform = _useState24[1]; //平台 taobao=淘宝 fxg=抖音 pdd=拼多多 sph=微信视屏号
|
|
9721
|
+
var _useState25 = useState({}),
|
|
9722
|
+
_useState26 = _slicedToArray(_useState25, 2),
|
|
9723
|
+
shopInfo = _useState26[0],
|
|
9724
|
+
setShopInfo = _useState26[1]; //店铺信息
|
|
9725
|
+
var _Form$useForm = Form.useForm(),
|
|
9726
|
+
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
9727
|
+
form = _Form$useForm2[0];
|
|
9641
9728
|
//选择页码
|
|
9642
|
-
var pageChange = function pageChange(page
|
|
9643
|
-
|
|
9644
|
-
|
|
9645
|
-
pageSize: pageSize
|
|
9646
|
-
}));
|
|
9729
|
+
var pageChange = function pageChange(page) {
|
|
9730
|
+
setPageNo(page);
|
|
9731
|
+
setGoodList(allList.splice((page - 1) * pageSize, pageSize));
|
|
9647
9732
|
};
|
|
9648
9733
|
/**
|
|
9649
|
-
*
|
|
9650
|
-
* @returns 获取查询参数
|
|
9734
|
+
* 查询商品
|
|
9651
9735
|
*/
|
|
9652
|
-
|
|
9653
|
-
|
|
9654
|
-
|
|
9655
|
-
|
|
9656
|
-
|
|
9657
|
-
|
|
9658
|
-
|
|
9659
|
-
|
|
9660
|
-
|
|
9661
|
-
|
|
9662
|
-
|
|
9663
|
-
|
|
9664
|
-
|
|
9665
|
-
|
|
9666
|
-
|
|
9736
|
+
// const queryItems = useCallback(async () => {
|
|
9737
|
+
// try {
|
|
9738
|
+
// setLoading(true);
|
|
9739
|
+
// const params: any = {
|
|
9740
|
+
// ...queryPd(),
|
|
9741
|
+
// };
|
|
9742
|
+
// params.shopName = shopInfo?.shopName;
|
|
9743
|
+
// params.platform = platform;
|
|
9744
|
+
// params.status = params.type === 'onSale' ? 1 : 0;
|
|
9745
|
+
// delete params.type;
|
|
9746
|
+
// const res = await request('/qy/gdfw/product/listProduct', {
|
|
9747
|
+
// method: 'post',
|
|
9748
|
+
// data: params,
|
|
9749
|
+
// });
|
|
9750
|
+
// const {
|
|
9751
|
+
// result: list,
|
|
9752
|
+
// total,
|
|
9753
|
+
// nextKey,
|
|
9754
|
+
// } = res.data || { result: [], total: 0 };
|
|
9755
|
+
// const newList = list || [];
|
|
9756
|
+
// newList.forEach((item: any) => {
|
|
9757
|
+
// item.numIid = item.productId;
|
|
9758
|
+
// item.outerId = item.outId;
|
|
9759
|
+
// item.title = item.productName;
|
|
9760
|
+
// item.platform = platform;
|
|
9761
|
+
// });
|
|
9762
|
+
// setGoodList(newList);
|
|
9763
|
+
// setTotal(total);
|
|
9764
|
+
// } finally {
|
|
9765
|
+
// setLoading(false);
|
|
9766
|
+
// }
|
|
9767
|
+
// }, [searchParams]);
|
|
9667
9768
|
/**
|
|
9668
9769
|
* 查询商品
|
|
9669
9770
|
*/
|
|
9670
|
-
var queryItems = /*#__PURE__*/function () {
|
|
9671
|
-
var
|
|
9672
|
-
|
|
9673
|
-
|
|
9674
|
-
|
|
9675
|
-
|
|
9676
|
-
|
|
9677
|
-
|
|
9678
|
-
|
|
9679
|
-
|
|
9680
|
-
|
|
9681
|
-
|
|
9682
|
-
|
|
9683
|
-
|
|
9684
|
-
|
|
9685
|
-
|
|
9686
|
-
|
|
9687
|
-
|
|
9688
|
-
|
|
9689
|
-
|
|
9690
|
-
|
|
9691
|
-
|
|
9692
|
-
|
|
9693
|
-
|
|
9694
|
-
|
|
9695
|
-
|
|
9696
|
-
|
|
9697
|
-
|
|
9698
|
-
|
|
9699
|
-
|
|
9700
|
-
|
|
9701
|
-
|
|
9702
|
-
|
|
9703
|
-
case 15:
|
|
9704
|
-
_context.prev = 15;
|
|
9705
|
-
setLoading(false);
|
|
9706
|
-
return _context.finish(15);
|
|
9707
|
-
case 18:
|
|
9708
|
-
case "end":
|
|
9709
|
-
return _context.stop();
|
|
9710
|
-
}
|
|
9711
|
-
}, _callee, null, [[0,, 15, 18]]);
|
|
9712
|
-
}));
|
|
9713
|
-
return function queryItems() {
|
|
9714
|
-
return _ref.apply(this, arguments);
|
|
9715
|
-
};
|
|
9716
|
-
}();
|
|
9771
|
+
var queryItems = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
9772
|
+
var params, res, products;
|
|
9773
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
9774
|
+
while (1) switch (_context.prev = _context.next) {
|
|
9775
|
+
case 0:
|
|
9776
|
+
_context.prev = 0;
|
|
9777
|
+
setLoading(true);
|
|
9778
|
+
params = {
|
|
9779
|
+
shopCode: shopCode
|
|
9780
|
+
};
|
|
9781
|
+
_context.next = 5;
|
|
9782
|
+
return extendRequest('/qy/gdfw/product/bsListProduct', {
|
|
9783
|
+
method: 'post',
|
|
9784
|
+
data: params
|
|
9785
|
+
});
|
|
9786
|
+
case 5:
|
|
9787
|
+
res = _context.sent;
|
|
9788
|
+
products = res.data.products;
|
|
9789
|
+
console.log(products.length);
|
|
9790
|
+
setAllList(_toConsumableArray(products));
|
|
9791
|
+
setFilterList(_toConsumableArray(products));
|
|
9792
|
+
setGoodList(products.splice(0, pageSize));
|
|
9793
|
+
setTotal(products.length);
|
|
9794
|
+
case 12:
|
|
9795
|
+
_context.prev = 12;
|
|
9796
|
+
setLoading(false);
|
|
9797
|
+
return _context.finish(12);
|
|
9798
|
+
case 15:
|
|
9799
|
+
case "end":
|
|
9800
|
+
return _context.stop();
|
|
9801
|
+
}
|
|
9802
|
+
}, _callee, null, [[0,, 12, 15]]);
|
|
9803
|
+
})), [shopCode]);
|
|
9717
9804
|
useEffect(function () {
|
|
9718
9805
|
var shopInfo = shopList.find(function (item) {
|
|
9719
9806
|
return shopId === item.shopId || shopId === item.shopName;
|
|
@@ -9737,8 +9824,26 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
9737
9824
|
onSubmit(selectList);
|
|
9738
9825
|
_onCancel();
|
|
9739
9826
|
};
|
|
9827
|
+
var onFinish = function onFinish(value) {
|
|
9828
|
+
console.log(value);
|
|
9829
|
+
var filterList = allList.filter(function (item) {
|
|
9830
|
+
return Object.keys(value).some(function (key) {
|
|
9831
|
+
return value[key] && item[key].indexOf(value[key]) > -1;
|
|
9832
|
+
});
|
|
9833
|
+
});
|
|
9834
|
+
console.log(filterList);
|
|
9835
|
+
setFilterList(filterList);
|
|
9836
|
+
setTotal(filterList.length);
|
|
9837
|
+
setPageNo(1);
|
|
9838
|
+
};
|
|
9839
|
+
var onReset = function onReset() {
|
|
9840
|
+
form.resetFields();
|
|
9841
|
+
setFilterList(allList);
|
|
9842
|
+
setTotal(allList.length);
|
|
9843
|
+
setPageNo(1);
|
|
9844
|
+
};
|
|
9740
9845
|
return /*#__PURE__*/React.createElement(Modal, {
|
|
9741
|
-
title: '
|
|
9846
|
+
title: '选择商品',
|
|
9742
9847
|
okText: '确认',
|
|
9743
9848
|
cancelText: '取消',
|
|
9744
9849
|
visible: visible,
|
|
@@ -9748,52 +9853,43 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
9748
9853
|
},
|
|
9749
9854
|
onOk: onOk,
|
|
9750
9855
|
wrapClassName: "goodModal"
|
|
9751
|
-
}, /*#__PURE__*/React.createElement(Tabs, {
|
|
9752
|
-
type: "card",
|
|
9753
|
-
activeKey: searchParams.type,
|
|
9754
|
-
onChange: function onChange(e) {
|
|
9755
|
-
var params = _objectSpread2(_objectSpread2({}, searchParams), {}, {
|
|
9756
|
-
type: e,
|
|
9757
|
-
pageNo: 1
|
|
9758
|
-
});
|
|
9759
|
-
setSearch(params);
|
|
9760
|
-
}
|
|
9761
|
-
}, tabs.map(function (tab) {
|
|
9762
|
-
return /*#__PURE__*/React.createElement(TabPane$1, {
|
|
9763
|
-
tab: tab.tab + (tab.key === 'select' ? "(".concat(selectList.length, ")") : ''),
|
|
9764
|
-
key: tab.key
|
|
9765
|
-
});
|
|
9766
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
9767
|
-
className: "searchBox",
|
|
9768
|
-
style: {
|
|
9769
|
-
display: searchParams.type === 'select' ? 'none' : ''
|
|
9770
|
-
}
|
|
9771
9856
|
}, /*#__PURE__*/React.createElement(Form, {
|
|
9772
|
-
layout: "inline"
|
|
9773
|
-
|
|
9774
|
-
|
|
9775
|
-
}
|
|
9776
|
-
|
|
9777
|
-
}
|
|
9778
|
-
placeholder: "\u5546\u54C1\u540D\u79F0"
|
|
9857
|
+
layout: "inline",
|
|
9858
|
+
form: form,
|
|
9859
|
+
onFinish: onFinish
|
|
9860
|
+
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
9861
|
+
name: "goodsName"
|
|
9862
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
9863
|
+
placeholder: "\u8BF7\u8F93\u5165\u5546\u54C1\u540D\u79F0"
|
|
9864
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
9865
|
+
name: "goodsCode"
|
|
9866
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
9867
|
+
placeholder: "\u8BF7\u8F93\u5165\u5546\u54C1\u7F16\u7801"
|
|
9868
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
9869
|
+
name: "code"
|
|
9870
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
9871
|
+
placeholder: "\u8BF7\u8F93\u5165\u5546\u54C1sku\u7F16\u7801"
|
|
9779
9872
|
})), /*#__PURE__*/React.createElement(Form.Item, null, /*#__PURE__*/React.createElement(Button, {
|
|
9780
9873
|
type: "primary",
|
|
9781
9874
|
htmlType: "submit"
|
|
9782
|
-
}, "\u67E5\u8BE2"), /*#__PURE__*/React.createElement(Button,
|
|
9875
|
+
}, "\u67E5\u8BE2"), /*#__PURE__*/React.createElement(Button, {
|
|
9876
|
+
onClick: onReset
|
|
9877
|
+
}, "\u91CD\u7F6E"))), /*#__PURE__*/React.createElement(Spin, {
|
|
9783
9878
|
spinning: loading
|
|
9784
9879
|
}, /*#__PURE__*/React.createElement(Table, {
|
|
9785
9880
|
rowSelection: rowSelection,
|
|
9786
9881
|
columns: columns,
|
|
9787
|
-
rowKey: '
|
|
9788
|
-
dataSource:
|
|
9882
|
+
rowKey: 'id',
|
|
9883
|
+
dataSource: goodList,
|
|
9789
9884
|
scroll: {
|
|
9790
9885
|
y: 300
|
|
9791
9886
|
},
|
|
9792
9887
|
pagination: {
|
|
9793
9888
|
size: 'small',
|
|
9794
9889
|
total: total,
|
|
9795
|
-
current:
|
|
9796
|
-
pageSize:
|
|
9890
|
+
current: pageNo,
|
|
9891
|
+
pageSize: pageSize,
|
|
9892
|
+
pageSizeOptions: [],
|
|
9797
9893
|
onChange: pageChange
|
|
9798
9894
|
}
|
|
9799
9895
|
})));
|
|
@@ -9812,8 +9908,8 @@ var GoodItem = function GoodItem(props) {
|
|
|
9812
9908
|
value = _props$value === void 0 ? [] : _props$value,
|
|
9813
9909
|
onChange = props.onChange,
|
|
9814
9910
|
disabled = props.disabled,
|
|
9815
|
-
_props$
|
|
9816
|
-
|
|
9911
|
+
_props$showHeader = props.showHeader,
|
|
9912
|
+
showHeader = _props$showHeader === void 0 ? [] : _props$showHeader,
|
|
9817
9913
|
width = props.width,
|
|
9818
9914
|
_props$shopList = props.shopList,
|
|
9819
9915
|
shopList = _props$shopList === void 0 ? [] : _props$shopList,
|
|
@@ -9829,6 +9925,7 @@ var GoodItem = function GoodItem(props) {
|
|
|
9829
9925
|
otherOperations = _props$otherOperation === void 0 ? null : _props$otherOperation,
|
|
9830
9926
|
_props$canUpdateNumbe = props.canUpdateNumber,
|
|
9831
9927
|
canUpdateNumber = _props$canUpdateNumbe === void 0 ? false : _props$canUpdateNumbe,
|
|
9928
|
+
shopCode = props.shopCode,
|
|
9832
9929
|
onSelect = props.onSelect,
|
|
9833
9930
|
onDelete = props.onDelete;
|
|
9834
9931
|
var refModal = useRef();
|
|
@@ -9858,6 +9955,18 @@ var GoodItem = function GoodItem(props) {
|
|
|
9858
9955
|
var GOODS_INFO_COLUMNS = function GOODS_INFO_COLUMNS() {
|
|
9859
9956
|
var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
9860
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.createElement(Image, {
|
|
9965
|
+
width: 60,
|
|
9966
|
+
src: val
|
|
9967
|
+
});
|
|
9968
|
+
}
|
|
9969
|
+
}, {
|
|
9861
9970
|
dataIndex: 'name',
|
|
9862
9971
|
title: "".concat(text, "\u540D\u79F0"),
|
|
9863
9972
|
align: 'center',
|
|
@@ -9919,20 +10028,8 @@ var GoodItem = function GoodItem(props) {
|
|
|
9919
10028
|
render: function render(val, record, index) {
|
|
9920
10029
|
return /*#__PURE__*/React.createElement("span", null, index + 1);
|
|
9921
10030
|
}
|
|
9922
|
-
}, {
|
|
9923
|
-
dataIndex: 'pic',
|
|
9924
|
-
title: "\u56FE\u7247",
|
|
9925
|
-
align: 'center',
|
|
9926
|
-
ellipsis: true,
|
|
9927
|
-
width: 100,
|
|
9928
|
-
render: function render(val) {
|
|
9929
|
-
return /*#__PURE__*/React.createElement(Image, {
|
|
9930
|
-
width: 60,
|
|
9931
|
-
src: val
|
|
9932
|
-
});
|
|
9933
|
-
}
|
|
9934
10031
|
}].concat(_toConsumableArray(GOODS_INFO_COLUMNS().filter(function (t) {
|
|
9935
|
-
return
|
|
10032
|
+
return showHeader.includes(t === null || t === void 0 ? void 0 : t.dataIndex);
|
|
9936
10033
|
})));
|
|
9937
10034
|
if (!disabled) {
|
|
9938
10035
|
columnList.push({
|
|
@@ -9952,20 +10049,22 @@ var GoodItem = function GoodItem(props) {
|
|
|
9952
10049
|
});
|
|
9953
10050
|
}
|
|
9954
10051
|
return columnList;
|
|
9955
|
-
}, [
|
|
10052
|
+
}, [showHeader, value, disabled]);
|
|
9956
10053
|
var onSubmit = function onSubmit(list) {
|
|
9957
10054
|
var newList = list.map(function (item) {
|
|
9958
|
-
var
|
|
9959
|
-
|
|
9960
|
-
|
|
9961
|
-
|
|
10055
|
+
var id = item.id,
|
|
10056
|
+
goodsName = item.goodsName,
|
|
10057
|
+
goodsId = item.goodsId,
|
|
10058
|
+
name = item.name,
|
|
10059
|
+
code = item.code,
|
|
10060
|
+
skuCode = item.skuCode;
|
|
9962
10061
|
return {
|
|
9963
|
-
id:
|
|
9964
|
-
pic:
|
|
9965
|
-
name:
|
|
9966
|
-
code:
|
|
9967
|
-
sku:
|
|
9968
|
-
money:
|
|
10062
|
+
id: goodsId,
|
|
10063
|
+
pic: '',
|
|
10064
|
+
name: goodsName,
|
|
10065
|
+
code: code,
|
|
10066
|
+
sku: skuCode,
|
|
10067
|
+
money: '',
|
|
9969
10068
|
share: '',
|
|
9970
10069
|
number: 1,
|
|
9971
10070
|
type: '',
|
|
@@ -10021,13 +10120,15 @@ var GoodItem = function GoodItem(props) {
|
|
|
10021
10120
|
width: width,
|
|
10022
10121
|
shopList: shopList,
|
|
10023
10122
|
shopId: shopId,
|
|
10024
|
-
maxLength: maxLength
|
|
10123
|
+
maxLength: maxLength,
|
|
10124
|
+
shopCode: shopCode
|
|
10025
10125
|
}));
|
|
10026
10126
|
};
|
|
10027
10127
|
|
|
10028
10128
|
var BsGoods = function BsGoods(props) {
|
|
10029
10129
|
var value = props.value,
|
|
10030
|
-
disabled = props.disabled
|
|
10130
|
+
disabled = props.disabled,
|
|
10131
|
+
onChange = props.onChange;
|
|
10031
10132
|
var _useState = useState(false),
|
|
10032
10133
|
_useState2 = _slicedToArray(_useState, 2),
|
|
10033
10134
|
tableSelect = _useState2[0],
|
|
@@ -10043,17 +10144,17 @@ var BsGoods = function BsGoods(props) {
|
|
|
10043
10144
|
var reissueRef = useRef();
|
|
10044
10145
|
useEffect(function () {
|
|
10045
10146
|
ref.current = pubsub.subscribeOnce('type', function (type, val) {
|
|
10046
|
-
|
|
10147
|
+
var _value$bsGoods;
|
|
10047
10148
|
if (disabled) return;
|
|
10048
10149
|
setWithInfo({
|
|
10049
10150
|
type: type,
|
|
10050
10151
|
val: val
|
|
10051
10152
|
});
|
|
10052
10153
|
setTableSelect(['2', '4'].includes(val));
|
|
10053
|
-
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)) {
|
|
10054
10155
|
pubsub.publish('selectList', {
|
|
10055
10156
|
type: val,
|
|
10056
|
-
list:
|
|
10157
|
+
list: ((value === null || value === void 0 ? void 0 : value.bsGoods) || []).map(function (item) {
|
|
10057
10158
|
item.canDelete = false;
|
|
10058
10159
|
return item;
|
|
10059
10160
|
})
|
|
@@ -10062,17 +10163,17 @@ var BsGoods = function BsGoods(props) {
|
|
|
10062
10163
|
});
|
|
10063
10164
|
//补发
|
|
10064
10165
|
reissueRef.current = pubsub.subscribeOnce('reissueType', function (type, val) {
|
|
10166
|
+
var _value$bsGoods2;
|
|
10065
10167
|
if (disabled) return;
|
|
10066
|
-
console.log('reissueType', type, val, value);
|
|
10067
10168
|
setWithInfo({
|
|
10068
10169
|
type: type,
|
|
10069
10170
|
val: val
|
|
10070
10171
|
});
|
|
10071
10172
|
setTableSelect(['2', '4'].includes(val));
|
|
10072
|
-
if (['1', '3'].includes(val) && (value === null || value === void 0 ? void 0 : value.length)) {
|
|
10173
|
+
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)) {
|
|
10073
10174
|
pubsub.publish('reissueSelectList', {
|
|
10074
10175
|
type: val,
|
|
10075
|
-
list: (value || []).map(function (item) {
|
|
10176
|
+
list: ((value === null || value === void 0 ? void 0 : value.bsGoods) || []).map(function (item) {
|
|
10076
10177
|
item.canDelete = false;
|
|
10077
10178
|
return item;
|
|
10078
10179
|
})
|
|
@@ -10101,16 +10202,26 @@ var BsGoods = function BsGoods(props) {
|
|
|
10101
10202
|
pubsub.publish('deleteGood', deleteId);
|
|
10102
10203
|
pubsub.publish('reissueDeleteGood', deleteId);
|
|
10103
10204
|
};
|
|
10205
|
+
var changeHandle = function changeHandle(list) {
|
|
10206
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, {
|
|
10207
|
+
bsGoods: list
|
|
10208
|
+
}));
|
|
10209
|
+
};
|
|
10104
10210
|
return /*#__PURE__*/React.createElement(GoodItem, _objectSpread2(_objectSpread2({
|
|
10105
|
-
key: 'bsGoods'
|
|
10106
|
-
disabled: disabled
|
|
10211
|
+
key: 'bsGoods'
|
|
10107
10212
|
}, props), {}, {
|
|
10213
|
+
disabled: disabled,
|
|
10214
|
+
value: value === null || value === void 0 ? void 0 : value.bsGoods,
|
|
10215
|
+
shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
|
|
10108
10216
|
tableSelect: tableSelect,
|
|
10109
10217
|
onSelect: function onSelect(list) {
|
|
10110
10218
|
return _onSelect(list);
|
|
10111
10219
|
},
|
|
10112
10220
|
onDelete: function onDelete(item) {
|
|
10113
10221
|
return _onDelete(item);
|
|
10222
|
+
},
|
|
10223
|
+
onChange: function onChange(val) {
|
|
10224
|
+
return changeHandle(val);
|
|
10114
10225
|
}
|
|
10115
10226
|
}));
|
|
10116
10227
|
};
|
|
@@ -10125,16 +10236,6 @@ var BsExchange = function BsExchange(props) {
|
|
|
10125
10236
|
disabled = props.disabled,
|
|
10126
10237
|
other = _objectWithoutProperties(props, _excluded$b);
|
|
10127
10238
|
useEffect(function () {
|
|
10128
|
-
pubsub.subscribeOnce('selectList', function (_, data) {
|
|
10129
|
-
if (disabled) return;
|
|
10130
|
-
if (value) {
|
|
10131
|
-
var newData = cloneDeep(data);
|
|
10132
|
-
console.log('BsExchange', 'getListHandle', data, value, getListHandle(_toConsumableArray(newData.list), value));
|
|
10133
|
-
onChange(_objectSpread2(_objectSpread2({}, value), {}, {
|
|
10134
|
-
bsExchangeReturnGoods: getListHandle(_toConsumableArray(newData.list), value)
|
|
10135
|
-
}));
|
|
10136
|
-
}
|
|
10137
|
-
});
|
|
10138
10239
|
pubsub.subscribeOnce('deleteGood', function (_, data) {
|
|
10139
10240
|
if (disabled) return;
|
|
10140
10241
|
if (value) {
|
|
@@ -10157,11 +10258,10 @@ var BsExchange = function BsExchange(props) {
|
|
|
10157
10258
|
});
|
|
10158
10259
|
}, [value]);
|
|
10159
10260
|
var getListHandle = function getListHandle(list, val) {
|
|
10160
|
-
var _val$bsExchangeType;
|
|
10261
|
+
var _val$bsExchangeType, _val$bsExchangeType2;
|
|
10161
10262
|
//如果是原单换
|
|
10162
10263
|
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])) {
|
|
10163
10264
|
return list.reduce(function (prv, next) {
|
|
10164
|
-
var _val$bsExchangeType2;
|
|
10165
10265
|
next.canDelete = false;
|
|
10166
10266
|
//数量大于1 拆开
|
|
10167
10267
|
if (next.number > 1) {
|
|
@@ -10170,12 +10270,12 @@ var BsExchange = function BsExchange(props) {
|
|
|
10170
10270
|
return t;
|
|
10171
10271
|
});
|
|
10172
10272
|
prv.push.apply(prv, _toConsumableArray(newList));
|
|
10173
|
-
} else
|
|
10273
|
+
} else {
|
|
10174
10274
|
prv.push(_objectSpread2({}, next));
|
|
10175
10275
|
}
|
|
10176
10276
|
return prv;
|
|
10177
10277
|
}, []);
|
|
10178
|
-
} else {
|
|
10278
|
+
} 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])) {
|
|
10179
10279
|
//补发换货
|
|
10180
10280
|
return list.reduce(function (prv, next, index) {
|
|
10181
10281
|
next.canDelete = true;
|
|
@@ -10207,6 +10307,15 @@ var BsExchange = function BsExchange(props) {
|
|
|
10207
10307
|
newValue.bsExchangeGiftGoods = [];
|
|
10208
10308
|
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
10209
10309
|
pubsub.publish('type', val[0]);
|
|
10310
|
+
pubsub.subscribeOnce('selectList', function (_, data) {
|
|
10311
|
+
if (disabled) return;
|
|
10312
|
+
if (newValue) {
|
|
10313
|
+
var newData = cloneDeep(data);
|
|
10314
|
+
onChange(_objectSpread2(_objectSpread2({}, newValue), {}, {
|
|
10315
|
+
bsExchangeReturnGoods: getListHandle(_toConsumableArray(newData.list), newValue)
|
|
10316
|
+
}));
|
|
10317
|
+
}
|
|
10318
|
+
});
|
|
10210
10319
|
};
|
|
10211
10320
|
var changeHandle = function changeHandle(val, key) {
|
|
10212
10321
|
var newValue = _objectSpread2({}, value);
|
|
@@ -10267,6 +10376,7 @@ var BsExchange = function BsExchange(props) {
|
|
|
10267
10376
|
disabled: disabled,
|
|
10268
10377
|
showChangeBtn: false,
|
|
10269
10378
|
value: value === null || value === void 0 ? void 0 : value.bsExchangeReturnGoods,
|
|
10379
|
+
shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
|
|
10270
10380
|
onChange: function onChange(val) {
|
|
10271
10381
|
return changeHandle(val, 'bsExchangeReturnGoods');
|
|
10272
10382
|
}
|
|
@@ -10276,6 +10386,7 @@ var BsExchange = function BsExchange(props) {
|
|
|
10276
10386
|
}, other), {}, {
|
|
10277
10387
|
disabled: disabled,
|
|
10278
10388
|
showChangeBtn: showChangeBtn,
|
|
10389
|
+
shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
|
|
10279
10390
|
value: item === null || item === void 0 ? void 0 : item.bsExchangeReturnGoods,
|
|
10280
10391
|
onChange: function onChange(val) {
|
|
10281
10392
|
return changeReturnHandle(val, index, 'bsExchangeReturnGoods');
|
|
@@ -10287,6 +10398,7 @@ var BsExchange = function BsExchange(props) {
|
|
|
10287
10398
|
showChangeBtn: showChangeBtn,
|
|
10288
10399
|
otherOperations: copyGoods(index),
|
|
10289
10400
|
value: item === null || item === void 0 ? void 0 : item.bsExchangeSwapOutGoods,
|
|
10401
|
+
shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
|
|
10290
10402
|
onChange: function onChange(val) {
|
|
10291
10403
|
return changeReturnHandle(val, index, 'bsExchangeSwapOutGoods');
|
|
10292
10404
|
}
|
|
@@ -10312,20 +10424,6 @@ var BsReissue = function BsReissue(props) {
|
|
|
10312
10424
|
disabled = props.disabled,
|
|
10313
10425
|
other = _objectWithoutProperties(props, _excluded$c);
|
|
10314
10426
|
useEffect(function () {
|
|
10315
|
-
pubsub.subscribeOnce('reissueSelectList', function (_, data) {
|
|
10316
|
-
if (disabled) return;
|
|
10317
|
-
console.log(data, value);
|
|
10318
|
-
if (value) {
|
|
10319
|
-
var newData = cloneDeep(data);
|
|
10320
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, {
|
|
10321
|
-
bsReissueGoods: ((newData === null || newData === void 0 ? void 0 : newData.list) || []).map(function (item) {
|
|
10322
|
-
item.money = 0;
|
|
10323
|
-
item.canUpdateNumber = ['2', '4'].includes(newData === null || newData === void 0 ? void 0 : newData.type);
|
|
10324
|
-
return item;
|
|
10325
|
-
})
|
|
10326
|
-
}));
|
|
10327
|
-
}
|
|
10328
|
-
});
|
|
10329
10427
|
pubsub.subscribeOnce('reissueDeleteGood', function (_, data) {
|
|
10330
10428
|
if (disabled) return;
|
|
10331
10429
|
if (value) {
|
|
@@ -10348,10 +10446,23 @@ var BsReissue = function BsReissue(props) {
|
|
|
10348
10446
|
newValue[key] = val;
|
|
10349
10447
|
if (key === 'bsReissueType') {
|
|
10350
10448
|
newValue.bsReissueGoods = [];
|
|
10449
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2({}, newValue));
|
|
10351
10450
|
}
|
|
10352
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2({}, newValue));
|
|
10353
10451
|
if (key === 'bsReissueType') {
|
|
10354
10452
|
pubsub.publish('reissueType', val[0]);
|
|
10453
|
+
pubsub.subscribeOnce('reissueSelectList', function (_, data) {
|
|
10454
|
+
if (disabled) return;
|
|
10455
|
+
if (value) {
|
|
10456
|
+
var newData = cloneDeep(data);
|
|
10457
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, newValue), {}, {
|
|
10458
|
+
bsReissueGoods: ((newData === null || newData === void 0 ? void 0 : newData.list) || []).map(function (item) {
|
|
10459
|
+
item.money = 0;
|
|
10460
|
+
item.canUpdateNumber = ['2', '4'].includes(newData === null || newData === void 0 ? void 0 : newData.type);
|
|
10461
|
+
return item;
|
|
10462
|
+
})
|
|
10463
|
+
}));
|
|
10464
|
+
}
|
|
10465
|
+
});
|
|
10355
10466
|
}
|
|
10356
10467
|
};
|
|
10357
10468
|
//显示选择商品按钮 原单换不显示选择商品
|
|
@@ -10376,6 +10487,7 @@ var BsReissue = function BsReissue(props) {
|
|
|
10376
10487
|
disabled: disabled,
|
|
10377
10488
|
canUpdateNumber: showChangeBtn,
|
|
10378
10489
|
showChangeBtn: showChangeBtn,
|
|
10490
|
+
shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
|
|
10379
10491
|
value: value === null || value === void 0 ? void 0 : value.bsReissueGoods,
|
|
10380
10492
|
onChange: function onChange(val) {
|
|
10381
10493
|
return changeHandle(val, 'bsReissueGoods');
|
|
@@ -10386,7 +10498,7 @@ var BsReissue = function BsReissue(props) {
|
|
|
10386
10498
|
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";
|
|
10387
10499
|
styleInject(css_248z$9);
|
|
10388
10500
|
|
|
10389
|
-
var TabPane$
|
|
10501
|
+
var TabPane$1 = Tabs.TabPane;
|
|
10390
10502
|
var Option$2 = Select.Option;
|
|
10391
10503
|
var Search$1 = Input.Search;
|
|
10392
10504
|
var GoodsModal$3 = function GoodsModal(props) {
|
|
@@ -10702,7 +10814,7 @@ var GoodsModal$3 = function GoodsModal(props) {
|
|
|
10702
10814
|
}));
|
|
10703
10815
|
}
|
|
10704
10816
|
}, tabs.map(function (tab) {
|
|
10705
|
-
return /*#__PURE__*/React.createElement(TabPane$
|
|
10817
|
+
return /*#__PURE__*/React.createElement(TabPane$1, {
|
|
10706
10818
|
tab: tab.tab + (tab.key === 'all' ? "(".concat(selectList.length, ")") : ''),
|
|
10707
10819
|
key: tab.key
|
|
10708
10820
|
});
|