@kmkf-fe-packages/basic-components 0.7.15-alpha.5 → 0.7.15-alpha.50
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 +352 -246
- package/dist/index.js +352 -246
- 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();
|
|
@@ -7182,6 +7183,9 @@ var Province = function Province(props) {
|
|
|
7182
7183
|
}, []);
|
|
7183
7184
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Cascader, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
7184
7185
|
options: option,
|
|
7186
|
+
style: {
|
|
7187
|
+
minWidth: '100px'
|
|
7188
|
+
},
|
|
7185
7189
|
placeholder: "\u8BF7\u9009\u62E9\u7701\u5E02\u533A"
|
|
7186
7190
|
})));
|
|
7187
7191
|
};
|
|
@@ -7211,7 +7215,7 @@ var ParseLogistics = function ParseLogistics(props) {
|
|
|
7211
7215
|
});
|
|
7212
7216
|
};
|
|
7213
7217
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(TextArea, {
|
|
7214
|
-
placeholder: "\u590D\u5236\
|
|
7218
|
+
placeholder: "\u590D\u5236\u4FE1\u606F\uFF0C\u70B9\u51FB\u667A\u80FD\u8BC6\u522B",
|
|
7215
7219
|
rows: 3,
|
|
7216
7220
|
value: value,
|
|
7217
7221
|
onChange: function onChange(e) {
|
|
@@ -8947,31 +8951,43 @@ var Payment = function Payment(props) {
|
|
|
8947
8951
|
name: 'enterprisePaymentTid',
|
|
8948
8952
|
placeholder: '请输入订单编号',
|
|
8949
8953
|
required: required,
|
|
8950
|
-
show: true
|
|
8954
|
+
show: true,
|
|
8955
|
+
hidden: false
|
|
8951
8956
|
}, {
|
|
8952
8957
|
label: '打款金额',
|
|
8953
8958
|
name: 'enterprisePaymentRefundFee',
|
|
8954
8959
|
placeholder: '请输入打款金额',
|
|
8955
8960
|
required: required,
|
|
8956
|
-
show: true
|
|
8961
|
+
show: true,
|
|
8962
|
+
hidden: false
|
|
8957
8963
|
}, {
|
|
8958
8964
|
label: '买家昵称',
|
|
8959
8965
|
name: 'enterprisePaymentBuyerNick',
|
|
8960
8966
|
placeholder: '请输入买家昵称',
|
|
8961
8967
|
required: false,
|
|
8962
|
-
show: true
|
|
8968
|
+
show: true,
|
|
8969
|
+
hidden: false
|
|
8963
8970
|
}, {
|
|
8964
8971
|
label: '支付宝名称',
|
|
8965
8972
|
name: 'enterprisePaymentAlipayNick',
|
|
8966
8973
|
placeholder: '请输入支付宝名称',
|
|
8967
8974
|
required: zhiFubaoRequired,
|
|
8968
|
-
show: true
|
|
8975
|
+
show: true,
|
|
8976
|
+
hidden: false
|
|
8969
8977
|
}, {
|
|
8970
8978
|
label: '支付宝账号',
|
|
8971
8979
|
name: 'enterprisePaymentAlipayNo',
|
|
8972
8980
|
placeholder: '请输入支付宝账号',
|
|
8973
8981
|
required: zhiFubaoRequired,
|
|
8974
|
-
show: true
|
|
8982
|
+
show: true,
|
|
8983
|
+
hidden: false
|
|
8984
|
+
}, {
|
|
8985
|
+
label: '打款状态',
|
|
8986
|
+
name: 'enterprisePaymentStatus',
|
|
8987
|
+
placeholder: '',
|
|
8988
|
+
required: false,
|
|
8989
|
+
show: false,
|
|
8990
|
+
hidden: true
|
|
8975
8991
|
}];
|
|
8976
8992
|
return /*#__PURE__*/React.createElement(React.Fragment, null, PaymentList.map(function (item) {
|
|
8977
8993
|
return item.show && /*#__PURE__*/React.createElement(Form.Item, {
|
|
@@ -9310,6 +9326,51 @@ var LogisticsTrajectory = function LogisticsTrajectory(props) {
|
|
|
9310
9326
|
typeof onChange === 'function' && onChange(_objectSpread2(_objectSpread2({}, value), {}, {
|
|
9311
9327
|
trajectoryCompany: val
|
|
9312
9328
|
}));
|
|
9329
|
+
handleSearchSnapshot(val);
|
|
9330
|
+
};
|
|
9331
|
+
var handleSearchSnapshot = function handleSearchSnapshot(company) {
|
|
9332
|
+
var trajectoryCompany = value.trajectoryCompany,
|
|
9333
|
+
trajectoryCode = value.trajectoryCode,
|
|
9334
|
+
trajectoryPhone = value.trajectoryPhone;
|
|
9335
|
+
var newCompany = company ? company : trajectoryCompany;
|
|
9336
|
+
if (newCompany === 'SF' && !(newCompany && trajectoryCode && trajectoryPhone)) {
|
|
9337
|
+
return;
|
|
9338
|
+
} else if (!(newCompany && trajectoryCode)) {
|
|
9339
|
+
return;
|
|
9340
|
+
}
|
|
9341
|
+
try {
|
|
9342
|
+
extendRequest('/qy/logistics/logisticsTraceSearch', {
|
|
9343
|
+
method: 'post',
|
|
9344
|
+
data: {
|
|
9345
|
+
mailNo: trajectoryCode,
|
|
9346
|
+
cpCode: newCompany,
|
|
9347
|
+
mobile: trajectoryPhone
|
|
9348
|
+
}
|
|
9349
|
+
}).then(function (res) {
|
|
9350
|
+
var result = res.result,
|
|
9351
|
+
success = res.success,
|
|
9352
|
+
data = res.data,
|
|
9353
|
+
msg = res.message;
|
|
9354
|
+
if (result === 100 || success) {
|
|
9355
|
+
onChange(_objectSpread2(_objectSpread2({}, value), {}, {
|
|
9356
|
+
trajectorySnapshot: data === null || data === void 0 ? void 0 : data.logisticsStatusDesc,
|
|
9357
|
+
trajectoryCompany: newCompany
|
|
9358
|
+
}));
|
|
9359
|
+
} else {
|
|
9360
|
+
onChange(_objectSpread2(_objectSpread2({}, value), {}, {
|
|
9361
|
+
trajectorySnapshot: '',
|
|
9362
|
+
trajectoryCompany: newCompany
|
|
9363
|
+
}));
|
|
9364
|
+
msg && message.error(msg);
|
|
9365
|
+
}
|
|
9366
|
+
});
|
|
9367
|
+
} catch (err) {
|
|
9368
|
+
onChange(_objectSpread2(_objectSpread2({}, value), {}, {
|
|
9369
|
+
trajectorySnapshot: '',
|
|
9370
|
+
trajectoryCompany: newCompany
|
|
9371
|
+
}));
|
|
9372
|
+
(err === null || err === void 0 ? void 0 : err.message) && message.error(err === null || err === void 0 ? void 0 : err.message);
|
|
9373
|
+
}
|
|
9313
9374
|
};
|
|
9314
9375
|
//物流公司
|
|
9315
9376
|
var LogisticsCompany = function LogisticsCompany() {
|
|
@@ -9332,20 +9393,40 @@ var LogisticsTrajectory = function LogisticsTrajectory(props) {
|
|
|
9332
9393
|
//物流单号
|
|
9333
9394
|
var LogisticsCode = function LogisticsCode() {
|
|
9334
9395
|
return /*#__PURE__*/React.createElement(Input, {
|
|
9335
|
-
style: {
|
|
9336
|
-
marginBottom: '8px'
|
|
9337
|
-
},
|
|
9338
9396
|
disabled: disabled,
|
|
9339
9397
|
placeholder: "\u7269\u6D41\u5355\u53F7",
|
|
9340
9398
|
onChange: function onChange(e) {
|
|
9341
9399
|
return handleInputChange(e, 'trajectoryCode');
|
|
9342
9400
|
},
|
|
9343
|
-
value: value === null || value === void 0 ? void 0 : value.trajectoryCode
|
|
9401
|
+
value: value === null || value === void 0 ? void 0 : value.trajectoryCode,
|
|
9402
|
+
onBlur: function onBlur() {
|
|
9403
|
+
return handleSearchSnapshot();
|
|
9404
|
+
}
|
|
9405
|
+
});
|
|
9406
|
+
};
|
|
9407
|
+
//sf手机号
|
|
9408
|
+
var LogisticsPhone = function LogisticsPhone() {
|
|
9409
|
+
return /*#__PURE__*/React.createElement(Input, {
|
|
9410
|
+
disabled: disabled,
|
|
9411
|
+
style: {
|
|
9412
|
+
marginTop: '8px'
|
|
9413
|
+
},
|
|
9414
|
+
placeholder: "\u624B\u673A\u53F7",
|
|
9415
|
+
onChange: function onChange(e) {
|
|
9416
|
+
return handleInputChange(e, 'trajectoryPhone');
|
|
9417
|
+
},
|
|
9418
|
+
value: value === null || value === void 0 ? void 0 : value.trajectoryPhone,
|
|
9419
|
+
onBlur: function onBlur() {
|
|
9420
|
+
return handleSearchSnapshot();
|
|
9421
|
+
}
|
|
9344
9422
|
});
|
|
9345
9423
|
};
|
|
9346
9424
|
//物流快照
|
|
9347
9425
|
var LogisticsSnapshot = function LogisticsSnapshot() {
|
|
9348
9426
|
return /*#__PURE__*/React.createElement(Input, {
|
|
9427
|
+
style: {
|
|
9428
|
+
marginTop: '8px'
|
|
9429
|
+
},
|
|
9349
9430
|
disabled: true,
|
|
9350
9431
|
placeholder: "\u7269\u6D41\u5FEB\u7167",
|
|
9351
9432
|
onChange: function onChange(e) {
|
|
@@ -9354,7 +9435,7 @@ var LogisticsTrajectory = function LogisticsTrajectory(props) {
|
|
|
9354
9435
|
value: value === null || value === void 0 ? void 0 : value.trajectorySnapshot
|
|
9355
9436
|
});
|
|
9356
9437
|
};
|
|
9357
|
-
return /*#__PURE__*/React.createElement("div", null, LogisticsCompany(), LogisticsCode(), showField.includes('snapshot') ? /*#__PURE__*/React.createElement(LogisticsSnapshot, null) : null);
|
|
9438
|
+
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
9439
|
};
|
|
9359
9440
|
|
|
9360
9441
|
var jstGoods = function jstGoods(props) {
|
|
@@ -9368,7 +9449,7 @@ var jstGoods = function jstGoods(props) {
|
|
|
9368
9449
|
_props$type = props.type,
|
|
9369
9450
|
type = _props$type === void 0 ? 1 : _props$type,
|
|
9370
9451
|
_props$showField = props.showField,
|
|
9371
|
-
showField = _props$showField === void 0 ? '
|
|
9452
|
+
showField = _props$showField === void 0 ? '' : _props$showField;
|
|
9372
9453
|
var _useState = useState(0),
|
|
9373
9454
|
_useState2 = _slicedToArray(_useState, 2),
|
|
9374
9455
|
changeIndex = _useState2[0],
|
|
@@ -9418,7 +9499,7 @@ var jstGoods = function jstGoods(props) {
|
|
|
9418
9499
|
return setChangeIndex(index);
|
|
9419
9500
|
}
|
|
9420
9501
|
}, "\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, {
|
|
9502
|
+
}))) : null, value.length ? /*#__PURE__*/React.createElement(React.Fragment, null, type === 1 ? /*#__PURE__*/React.createElement(Space, null, !showField || showField === 'logisticsCompany' ? /*#__PURE__*/React.createElement(Select, {
|
|
9422
9503
|
disabled: disabled,
|
|
9423
9504
|
placeholder: "\u7269\u6D41\u516C\u53F8",
|
|
9424
9505
|
onChange: function onChange(val) {
|
|
@@ -9433,14 +9514,14 @@ var jstGoods = function jstGoods(props) {
|
|
|
9433
9514
|
style: {
|
|
9434
9515
|
minWidth: '100px'
|
|
9435
9516
|
}
|
|
9436
|
-
}), /*#__PURE__*/React.createElement(Input, {
|
|
9517
|
+
}) : null, !showField || showField === 'logisticsCode' ? /*#__PURE__*/React.createElement(Input, {
|
|
9437
9518
|
disabled: disabled,
|
|
9438
9519
|
placeholder: "\u7269\u6D41\u5355\u53F7",
|
|
9439
9520
|
onChange: function onChange(e) {
|
|
9440
9521
|
return changeInputHandle(e.target.value, 'logisticsCode');
|
|
9441
9522
|
},
|
|
9442
9523
|
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, {
|
|
9524
|
+
}) : null) : null, type === 2 ? /*#__PURE__*/React.createElement(Space, null, ['supplyId', 'all'].includes(showField) && /*#__PURE__*/React.createElement(Input, {
|
|
9444
9525
|
disabled: disabled,
|
|
9445
9526
|
placeholder: "\u8BF7\u8F93\u5165\u4F9B\u9500\u5546\u7F16\u7801",
|
|
9446
9527
|
onChange: function onChange(e) {
|
|
@@ -9545,44 +9626,63 @@ var ItemList = function ItemList(props) {
|
|
|
9545
9626
|
}, "\u6682\u4E0D\u652F\u6301\u6DFB\u52A0")) : null);
|
|
9546
9627
|
};
|
|
9547
9628
|
|
|
9548
|
-
var TabPane$1 = Tabs.TabPane;
|
|
9549
9629
|
var columns = [{
|
|
9550
|
-
dataIndex: '
|
|
9551
|
-
title: '
|
|
9552
|
-
|
|
9553
|
-
|
|
9554
|
-
|
|
9555
|
-
|
|
9556
|
-
});
|
|
9630
|
+
dataIndex: 'index',
|
|
9631
|
+
title: '序号',
|
|
9632
|
+
// with: 70,
|
|
9633
|
+
ellipsis: true,
|
|
9634
|
+
render: function render(val, record, index) {
|
|
9635
|
+
return /*#__PURE__*/React.createElement("span", null, index + 1);
|
|
9557
9636
|
}
|
|
9558
9637
|
}, {
|
|
9559
|
-
dataIndex: '
|
|
9560
|
-
title: '
|
|
9638
|
+
dataIndex: 'name',
|
|
9639
|
+
title: '商品名称',
|
|
9640
|
+
with: 200,
|
|
9641
|
+
ellipsis: true
|
|
9642
|
+
}, {
|
|
9643
|
+
dataIndex: 'goodsId',
|
|
9644
|
+
title: '商品id',
|
|
9645
|
+
with: 200,
|
|
9646
|
+
ellipsis: true
|
|
9561
9647
|
}, {
|
|
9562
|
-
dataIndex: '
|
|
9563
|
-
title: '
|
|
9648
|
+
dataIndex: 'skuName',
|
|
9649
|
+
title: '商品sku名称',
|
|
9650
|
+
with: 200,
|
|
9651
|
+
ellipsis: true
|
|
9564
9652
|
}, {
|
|
9565
|
-
dataIndex: '
|
|
9566
|
-
title: '
|
|
9653
|
+
dataIndex: 'code',
|
|
9654
|
+
title: '商品编码',
|
|
9655
|
+
with: 200,
|
|
9656
|
+
ellipsis: true
|
|
9567
9657
|
}, {
|
|
9568
|
-
dataIndex: '
|
|
9569
|
-
title: '
|
|
9658
|
+
dataIndex: 'skuCode',
|
|
9659
|
+
title: '商品sku编码',
|
|
9660
|
+
with: 200,
|
|
9661
|
+
ellipsis: true
|
|
9662
|
+
}, {
|
|
9663
|
+
dataIndex: 'marketPrice',
|
|
9664
|
+
title: '市场价',
|
|
9665
|
+
with: 200,
|
|
9666
|
+
ellipsis: true
|
|
9570
9667
|
}];
|
|
9571
9668
|
var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
9572
9669
|
useImperativeHandle(ref, function () {
|
|
9573
9670
|
return {
|
|
9574
9671
|
open: function open() {
|
|
9575
9672
|
setVisible(true);
|
|
9673
|
+
setPageNo(1);
|
|
9576
9674
|
setSelect([]);
|
|
9577
9675
|
setSelectIds([]);
|
|
9578
9676
|
queryItems();
|
|
9677
|
+
onReset();
|
|
9579
9678
|
}
|
|
9580
9679
|
};
|
|
9581
9680
|
});
|
|
9582
9681
|
var onSubmit = props.onSubmit,
|
|
9583
9682
|
shopId = props.shopId,
|
|
9584
9683
|
shopList = props.shopList,
|
|
9585
|
-
width = props.width
|
|
9684
|
+
width = props.width,
|
|
9685
|
+
shopCode = props.shopCode;
|
|
9586
9686
|
var _useState = useState(false),
|
|
9587
9687
|
_useState2 = _slicedToArray(_useState, 2),
|
|
9588
9688
|
visible = _useState2[0],
|
|
@@ -9597,123 +9697,85 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
9597
9697
|
setSelectIds = _useState6[1];
|
|
9598
9698
|
var _useState7 = useState([]),
|
|
9599
9699
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
9600
|
-
|
|
9601
|
-
|
|
9602
|
-
var _useState9 = useState(
|
|
9700
|
+
allList = _useState8[0],
|
|
9701
|
+
setAllList = _useState8[1]; //获取到的所有数据
|
|
9702
|
+
var _useState9 = useState([]),
|
|
9603
9703
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
9604
|
-
|
|
9605
|
-
|
|
9606
|
-
var _useState11 = useState(
|
|
9607
|
-
apiName: 'queryItems',
|
|
9608
|
-
desc: true,
|
|
9609
|
-
numIids: '',
|
|
9610
|
-
orderBy: 'list_time',
|
|
9611
|
-
pageNo: 1,
|
|
9612
|
-
pageSize: 10,
|
|
9613
|
-
shopId: shopId,
|
|
9614
|
-
type: 'onSale',
|
|
9615
|
-
cids: '',
|
|
9616
|
-
title: ''
|
|
9617
|
-
}),
|
|
9704
|
+
filterList = _useState10[0],
|
|
9705
|
+
setFilterList = _useState10[1]; //获取到的筛选数据
|
|
9706
|
+
var _useState11 = useState(1),
|
|
9618
9707
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
9619
|
-
|
|
9620
|
-
|
|
9621
|
-
var _useState13 = useState(
|
|
9622
|
-
_useState14 = _slicedToArray(_useState13,
|
|
9623
|
-
|
|
9624
|
-
|
|
9625
|
-
var _useState15 = useState(''),
|
|
9708
|
+
pageNo = _useState12[0],
|
|
9709
|
+
setPageNo = _useState12[1];
|
|
9710
|
+
var _useState13 = useState(20),
|
|
9711
|
+
_useState14 = _slicedToArray(_useState13, 1),
|
|
9712
|
+
pageSize = _useState14[0];
|
|
9713
|
+
var _useState15 = useState([]),
|
|
9626
9714
|
_useState16 = _slicedToArray(_useState15, 2),
|
|
9627
|
-
|
|
9628
|
-
|
|
9629
|
-
var _useState17 = useState(
|
|
9715
|
+
goodList = _useState16[0],
|
|
9716
|
+
setGoodList = _useState16[1];
|
|
9717
|
+
var _useState17 = useState(false),
|
|
9630
9718
|
_useState18 = _slicedToArray(_useState17, 2),
|
|
9631
|
-
|
|
9632
|
-
|
|
9633
|
-
var _useState19 = useState(
|
|
9634
|
-
|
|
9635
|
-
|
|
9636
|
-
|
|
9637
|
-
|
|
9638
|
-
|
|
9639
|
-
|
|
9640
|
-
|
|
9719
|
+
loading = _useState18[0],
|
|
9720
|
+
setLoading = _useState18[1];
|
|
9721
|
+
var _useState19 = useState(0),
|
|
9722
|
+
_useState20 = _slicedToArray(_useState19, 2),
|
|
9723
|
+
total = _useState20[0],
|
|
9724
|
+
setTotal = _useState20[1];
|
|
9725
|
+
var _useState21 = useState(''),
|
|
9726
|
+
_useState22 = _slicedToArray(_useState21, 2),
|
|
9727
|
+
platform = _useState22[0],
|
|
9728
|
+
setPlatform = _useState22[1]; //平台 taobao=淘宝 fxg=抖音 pdd=拼多多 sph=微信视屏号
|
|
9729
|
+
var _useState23 = useState({}),
|
|
9730
|
+
_useState24 = _slicedToArray(_useState23, 2),
|
|
9731
|
+
shopInfo = _useState24[0],
|
|
9732
|
+
setShopInfo = _useState24[1]; //店铺信息
|
|
9733
|
+
var _Form$useForm = Form.useForm(),
|
|
9734
|
+
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
9735
|
+
form = _Form$useForm2[0];
|
|
9641
9736
|
//选择页码
|
|
9642
|
-
var pageChange = function pageChange(page
|
|
9643
|
-
|
|
9644
|
-
|
|
9645
|
-
pageSize: pageSize
|
|
9646
|
-
}));
|
|
9647
|
-
};
|
|
9648
|
-
/**
|
|
9649
|
-
*
|
|
9650
|
-
* @returns 获取查询参数
|
|
9651
|
-
*/
|
|
9652
|
-
var queryPd = function queryPd() {
|
|
9653
|
-
var params = {
|
|
9654
|
-
apiName: 'queryItems',
|
|
9655
|
-
desc: searchParams.desc,
|
|
9656
|
-
productIds: searchParams.numIids,
|
|
9657
|
-
orderBy: searchParams.orderBy,
|
|
9658
|
-
pageNo: searchParams.pageNo,
|
|
9659
|
-
pageSize: searchParams.pageSize,
|
|
9660
|
-
shopId: shopId,
|
|
9661
|
-
type: searchParams.type,
|
|
9662
|
-
title: searchParams.title,
|
|
9663
|
-
cids: searchParams.cids
|
|
9664
|
-
};
|
|
9665
|
-
return params;
|
|
9737
|
+
var pageChange = function pageChange(page) {
|
|
9738
|
+
setPageNo(page);
|
|
9739
|
+
setGoodList(_toConsumableArray(filterList).splice((page - 1) * pageSize, pageSize));
|
|
9666
9740
|
};
|
|
9667
9741
|
/**
|
|
9668
9742
|
* 查询商品
|
|
9669
9743
|
*/
|
|
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
|
-
result: [],
|
|
9692
|
-
total: 0
|
|
9693
|
-
}, list = _ref2.result, _total = _ref2.total, nextKey = _ref2.nextKey;
|
|
9694
|
-
newList = list || [];
|
|
9695
|
-
newList.forEach(function (item) {
|
|
9696
|
-
item.numIid = item.productId;
|
|
9697
|
-
item.outerId = item.outId;
|
|
9698
|
-
item.title = item.productName;
|
|
9699
|
-
item.platform = platform;
|
|
9744
|
+
var queryItems = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
9745
|
+
var params, res, products, newProducts;
|
|
9746
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
9747
|
+
while (1) switch (_context.prev = _context.next) {
|
|
9748
|
+
case 0:
|
|
9749
|
+
_context.prev = 0;
|
|
9750
|
+
setLoading(true);
|
|
9751
|
+
params = {
|
|
9752
|
+
shopCode: shopCode
|
|
9753
|
+
};
|
|
9754
|
+
_context.next = 5;
|
|
9755
|
+
return extendRequest('/qy/gdfw/product/bsListProduct', {
|
|
9756
|
+
method: 'post',
|
|
9757
|
+
data: params
|
|
9758
|
+
});
|
|
9759
|
+
case 5:
|
|
9760
|
+
res = _context.sent;
|
|
9761
|
+
products = res.data.products;
|
|
9762
|
+
newProducts = products.map(function (item, index) {
|
|
9763
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
9764
|
+
index: index + 1
|
|
9700
9765
|
});
|
|
9701
|
-
|
|
9702
|
-
|
|
9703
|
-
|
|
9704
|
-
|
|
9705
|
-
|
|
9706
|
-
|
|
9707
|
-
|
|
9708
|
-
|
|
9709
|
-
|
|
9710
|
-
|
|
9711
|
-
}
|
|
9712
|
-
})
|
|
9713
|
-
|
|
9714
|
-
return _ref.apply(this, arguments);
|
|
9715
|
-
};
|
|
9716
|
-
}();
|
|
9766
|
+
});
|
|
9767
|
+
setAllList(_toConsumableArray(newProducts));
|
|
9768
|
+
initData(_toConsumableArray(newProducts));
|
|
9769
|
+
case 10:
|
|
9770
|
+
_context.prev = 10;
|
|
9771
|
+
setLoading(false);
|
|
9772
|
+
return _context.finish(10);
|
|
9773
|
+
case 13:
|
|
9774
|
+
case "end":
|
|
9775
|
+
return _context.stop();
|
|
9776
|
+
}
|
|
9777
|
+
}, _callee, null, [[0,, 10, 13]]);
|
|
9778
|
+
})), [shopCode]);
|
|
9717
9779
|
useEffect(function () {
|
|
9718
9780
|
var shopInfo = shopList.find(function (item) {
|
|
9719
9781
|
return shopId === item.shopId || shopId === item.shopName;
|
|
@@ -9724,12 +9786,19 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
9724
9786
|
}, [shopId]);
|
|
9725
9787
|
var rowSelection = {
|
|
9726
9788
|
selectedRowKeys: selectIds,
|
|
9789
|
+
fixed: true,
|
|
9727
9790
|
onChange: function onChange(selectedRowKeys, selectedRows, info) {
|
|
9728
9791
|
console.log(selectedRowKeys, selectedRows, info);
|
|
9729
9792
|
setSelectIds(selectedRowKeys);
|
|
9730
9793
|
setSelect(_toConsumableArray(selectedRows));
|
|
9731
9794
|
}
|
|
9732
9795
|
};
|
|
9796
|
+
var initData = function initData(list) {
|
|
9797
|
+
setFilterList(_toConsumableArray(list));
|
|
9798
|
+
setGoodList(_toConsumableArray(list).splice(0, pageSize));
|
|
9799
|
+
setTotal(list.length);
|
|
9800
|
+
setPageNo(1);
|
|
9801
|
+
};
|
|
9733
9802
|
var _onCancel = function onCancel() {
|
|
9734
9803
|
setVisible(false);
|
|
9735
9804
|
};
|
|
@@ -9737,8 +9806,23 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
9737
9806
|
onSubmit(selectList);
|
|
9738
9807
|
_onCancel();
|
|
9739
9808
|
};
|
|
9809
|
+
var onFinish = function onFinish(value) {
|
|
9810
|
+
var newFilterList = [];
|
|
9811
|
+
Object.keys(value).forEach(function (key) {
|
|
9812
|
+
if (value[key]) {
|
|
9813
|
+
newFilterList = allList.filter(function (item) {
|
|
9814
|
+
return item[key].indexOf(value[key]) > -1;
|
|
9815
|
+
});
|
|
9816
|
+
}
|
|
9817
|
+
});
|
|
9818
|
+
initData(newFilterList);
|
|
9819
|
+
};
|
|
9820
|
+
var onReset = function onReset() {
|
|
9821
|
+
form.resetFields();
|
|
9822
|
+
initData(_toConsumableArray(allList));
|
|
9823
|
+
};
|
|
9740
9824
|
return /*#__PURE__*/React.createElement(Modal, {
|
|
9741
|
-
title: '
|
|
9825
|
+
title: '选择商品',
|
|
9742
9826
|
okText: '确认',
|
|
9743
9827
|
cancelText: '取消',
|
|
9744
9828
|
visible: visible,
|
|
@@ -9748,52 +9832,44 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
9748
9832
|
},
|
|
9749
9833
|
onOk: onOk,
|
|
9750
9834
|
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
9835
|
}, /*#__PURE__*/React.createElement(Form, {
|
|
9772
|
-
layout: "inline"
|
|
9773
|
-
|
|
9774
|
-
|
|
9775
|
-
}
|
|
9776
|
-
|
|
9777
|
-
}
|
|
9778
|
-
placeholder: "\u5546\u54C1\u540D\u79F0"
|
|
9836
|
+
layout: "inline",
|
|
9837
|
+
form: form,
|
|
9838
|
+
onFinish: onFinish
|
|
9839
|
+
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
9840
|
+
name: "name"
|
|
9841
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
9842
|
+
placeholder: "\u8BF7\u8F93\u5165\u5546\u54C1\u540D\u79F0"
|
|
9843
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
9844
|
+
name: "code"
|
|
9845
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
9846
|
+
placeholder: "\u8BF7\u8F93\u5165\u5546\u54C1\u7F16\u7801"
|
|
9847
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
9848
|
+
name: "skuCode"
|
|
9849
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
9850
|
+
placeholder: "\u8BF7\u8F93\u5165\u5546\u54C1sku\u7F16\u7801"
|
|
9779
9851
|
})), /*#__PURE__*/React.createElement(Form.Item, null, /*#__PURE__*/React.createElement(Button, {
|
|
9780
9852
|
type: "primary",
|
|
9781
9853
|
htmlType: "submit"
|
|
9782
|
-
}, "\u67E5\u8BE2"), /*#__PURE__*/React.createElement(Button,
|
|
9854
|
+
}, "\u67E5\u8BE2"), /*#__PURE__*/React.createElement(Button, {
|
|
9855
|
+
onClick: onReset
|
|
9856
|
+
}, "\u91CD\u7F6E"))), /*#__PURE__*/React.createElement(Spin, {
|
|
9783
9857
|
spinning: loading
|
|
9784
9858
|
}, /*#__PURE__*/React.createElement(Table, {
|
|
9785
9859
|
rowSelection: rowSelection,
|
|
9786
9860
|
columns: columns,
|
|
9787
|
-
rowKey: '
|
|
9788
|
-
dataSource:
|
|
9861
|
+
rowKey: 'skuCode',
|
|
9862
|
+
dataSource: goodList,
|
|
9789
9863
|
scroll: {
|
|
9864
|
+
x: true,
|
|
9790
9865
|
y: 300
|
|
9791
9866
|
},
|
|
9792
9867
|
pagination: {
|
|
9793
9868
|
size: 'small',
|
|
9794
9869
|
total: total,
|
|
9795
|
-
current:
|
|
9796
|
-
pageSize:
|
|
9870
|
+
current: pageNo,
|
|
9871
|
+
pageSize: pageSize,
|
|
9872
|
+
pageSizeOptions: [],
|
|
9797
9873
|
onChange: pageChange
|
|
9798
9874
|
}
|
|
9799
9875
|
})));
|
|
@@ -9812,8 +9888,8 @@ var GoodItem = function GoodItem(props) {
|
|
|
9812
9888
|
value = _props$value === void 0 ? [] : _props$value,
|
|
9813
9889
|
onChange = props.onChange,
|
|
9814
9890
|
disabled = props.disabled,
|
|
9815
|
-
_props$
|
|
9816
|
-
|
|
9891
|
+
_props$showHeader = props.showHeader,
|
|
9892
|
+
showHeader = _props$showHeader === void 0 ? [] : _props$showHeader,
|
|
9817
9893
|
width = props.width,
|
|
9818
9894
|
_props$shopList = props.shopList,
|
|
9819
9895
|
shopList = _props$shopList === void 0 ? [] : _props$shopList,
|
|
@@ -9829,6 +9905,7 @@ var GoodItem = function GoodItem(props) {
|
|
|
9829
9905
|
otherOperations = _props$otherOperation === void 0 ? null : _props$otherOperation,
|
|
9830
9906
|
_props$canUpdateNumbe = props.canUpdateNumber,
|
|
9831
9907
|
canUpdateNumber = _props$canUpdateNumbe === void 0 ? false : _props$canUpdateNumbe,
|
|
9908
|
+
shopCode = props.shopCode,
|
|
9832
9909
|
onSelect = props.onSelect,
|
|
9833
9910
|
onDelete = props.onDelete;
|
|
9834
9911
|
var refModal = useRef();
|
|
@@ -9858,6 +9935,18 @@ var GoodItem = function GoodItem(props) {
|
|
|
9858
9935
|
var GOODS_INFO_COLUMNS = function GOODS_INFO_COLUMNS() {
|
|
9859
9936
|
var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
9860
9937
|
return [{
|
|
9938
|
+
dataIndex: 'pic',
|
|
9939
|
+
title: "\u56FE\u7247",
|
|
9940
|
+
align: 'center',
|
|
9941
|
+
ellipsis: true,
|
|
9942
|
+
width: 100,
|
|
9943
|
+
render: function render(val) {
|
|
9944
|
+
return /*#__PURE__*/React.createElement(Image, {
|
|
9945
|
+
width: 60,
|
|
9946
|
+
src: val
|
|
9947
|
+
});
|
|
9948
|
+
}
|
|
9949
|
+
}, {
|
|
9861
9950
|
dataIndex: 'name',
|
|
9862
9951
|
title: "".concat(text, "\u540D\u79F0"),
|
|
9863
9952
|
align: 'center',
|
|
@@ -9919,20 +10008,8 @@ var GoodItem = function GoodItem(props) {
|
|
|
9919
10008
|
render: function render(val, record, index) {
|
|
9920
10009
|
return /*#__PURE__*/React.createElement("span", null, index + 1);
|
|
9921
10010
|
}
|
|
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
10011
|
}].concat(_toConsumableArray(GOODS_INFO_COLUMNS().filter(function (t) {
|
|
9935
|
-
return
|
|
10012
|
+
return showHeader.includes(t === null || t === void 0 ? void 0 : t.dataIndex);
|
|
9936
10013
|
})));
|
|
9937
10014
|
if (!disabled) {
|
|
9938
10015
|
columnList.push({
|
|
@@ -9952,20 +10029,21 @@ var GoodItem = function GoodItem(props) {
|
|
|
9952
10029
|
});
|
|
9953
10030
|
}
|
|
9954
10031
|
return columnList;
|
|
9955
|
-
}, [
|
|
10032
|
+
}, [showHeader, value, disabled]);
|
|
9956
10033
|
var onSubmit = function onSubmit(list) {
|
|
9957
10034
|
var newList = list.map(function (item) {
|
|
9958
|
-
var
|
|
9959
|
-
|
|
9960
|
-
|
|
9961
|
-
|
|
10035
|
+
var goodsId = item.goodsId,
|
|
10036
|
+
name = item.name,
|
|
10037
|
+
code = item.code,
|
|
10038
|
+
skuCode = item.skuCode,
|
|
10039
|
+
marketPrice = item.marketPrice;
|
|
9962
10040
|
return {
|
|
9963
|
-
id:
|
|
9964
|
-
pic:
|
|
9965
|
-
name:
|
|
9966
|
-
code:
|
|
9967
|
-
sku:
|
|
9968
|
-
money:
|
|
10041
|
+
id: goodsId,
|
|
10042
|
+
pic: '',
|
|
10043
|
+
name: name,
|
|
10044
|
+
code: code,
|
|
10045
|
+
sku: skuCode,
|
|
10046
|
+
money: marketPrice || 0,
|
|
9969
10047
|
share: '',
|
|
9970
10048
|
number: 1,
|
|
9971
10049
|
type: '',
|
|
@@ -9978,7 +10056,7 @@ var GoodItem = function GoodItem(props) {
|
|
|
9978
10056
|
var onSelectChange = function onSelectChange(newSelectedRowKeys) {
|
|
9979
10057
|
setSelectedRowKeys(newSelectedRowKeys);
|
|
9980
10058
|
onSelect === null || onSelect === void 0 ? void 0 : onSelect(value.filter(function (t) {
|
|
9981
|
-
return newSelectedRowKeys.includes(t.
|
|
10059
|
+
return newSelectedRowKeys.includes(t.sku);
|
|
9982
10060
|
}));
|
|
9983
10061
|
};
|
|
9984
10062
|
var handleChangeGoods = function handleChangeGoods() {
|
|
@@ -10006,7 +10084,7 @@ var GoodItem = function GoodItem(props) {
|
|
|
10006
10084
|
}, "\u9009\u62E9\u5546\u54C1"), otherOperations), /*#__PURE__*/React.createElement(Table, _objectSpread2(_objectSpread2({}, tableConfig), {}, {
|
|
10007
10085
|
columns: newColumns,
|
|
10008
10086
|
dataSource: value,
|
|
10009
|
-
rowKey: '
|
|
10087
|
+
rowKey: 'sku',
|
|
10010
10088
|
size: "small",
|
|
10011
10089
|
pagination: false,
|
|
10012
10090
|
scroll: {
|
|
@@ -10021,13 +10099,15 @@ var GoodItem = function GoodItem(props) {
|
|
|
10021
10099
|
width: width,
|
|
10022
10100
|
shopList: shopList,
|
|
10023
10101
|
shopId: shopId,
|
|
10024
|
-
maxLength: maxLength
|
|
10102
|
+
maxLength: maxLength,
|
|
10103
|
+
shopCode: shopCode
|
|
10025
10104
|
}));
|
|
10026
10105
|
};
|
|
10027
10106
|
|
|
10028
10107
|
var BsGoods = function BsGoods(props) {
|
|
10029
10108
|
var value = props.value,
|
|
10030
|
-
disabled = props.disabled
|
|
10109
|
+
disabled = props.disabled,
|
|
10110
|
+
onChange = props.onChange;
|
|
10031
10111
|
var _useState = useState(false),
|
|
10032
10112
|
_useState2 = _slicedToArray(_useState, 2),
|
|
10033
10113
|
tableSelect = _useState2[0],
|
|
@@ -10043,17 +10123,19 @@ var BsGoods = function BsGoods(props) {
|
|
|
10043
10123
|
var reissueRef = useRef();
|
|
10044
10124
|
useEffect(function () {
|
|
10045
10125
|
ref.current = pubsub.subscribeOnce('type', function (type, val) {
|
|
10046
|
-
|
|
10126
|
+
var _value$bsGoods;
|
|
10127
|
+
console.log(value);
|
|
10047
10128
|
if (disabled) return;
|
|
10048
10129
|
setWithInfo({
|
|
10049
10130
|
type: type,
|
|
10050
10131
|
val: val
|
|
10051
10132
|
});
|
|
10052
10133
|
setTableSelect(['2', '4'].includes(val));
|
|
10053
|
-
if (['1', '3'].includes(val) && (value === null || value === void 0 ? void 0 : value.length)) {
|
|
10134
|
+
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)) {
|
|
10135
|
+
var newGoods = cloneDeep(value === null || value === void 0 ? void 0 : value.bsGoods);
|
|
10054
10136
|
pubsub.publish('selectList', {
|
|
10055
10137
|
type: val,
|
|
10056
|
-
list:
|
|
10138
|
+
list: (newGoods || []).map(function (item) {
|
|
10057
10139
|
item.canDelete = false;
|
|
10058
10140
|
return item;
|
|
10059
10141
|
})
|
|
@@ -10062,17 +10144,18 @@ var BsGoods = function BsGoods(props) {
|
|
|
10062
10144
|
});
|
|
10063
10145
|
//补发
|
|
10064
10146
|
reissueRef.current = pubsub.subscribeOnce('reissueType', function (type, val) {
|
|
10147
|
+
var _value$bsGoods2;
|
|
10065
10148
|
if (disabled) return;
|
|
10066
|
-
console.log('reissueType', type, val, value);
|
|
10067
10149
|
setWithInfo({
|
|
10068
10150
|
type: type,
|
|
10069
10151
|
val: val
|
|
10070
10152
|
});
|
|
10071
10153
|
setTableSelect(['2', '4'].includes(val));
|
|
10072
|
-
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$bsGoods2 = value.bsGoods) === null || _value$bsGoods2 === void 0 ? void 0 : _value$bsGoods2.length)) {
|
|
10155
|
+
var newGoods = cloneDeep(value === null || value === void 0 ? void 0 : value.bsGoods);
|
|
10073
10156
|
pubsub.publish('reissueSelectList', {
|
|
10074
10157
|
type: val,
|
|
10075
|
-
list: (
|
|
10158
|
+
list: (newGoods || []).map(function (item) {
|
|
10076
10159
|
item.canDelete = false;
|
|
10077
10160
|
return item;
|
|
10078
10161
|
})
|
|
@@ -10101,16 +10184,26 @@ var BsGoods = function BsGoods(props) {
|
|
|
10101
10184
|
pubsub.publish('deleteGood', deleteId);
|
|
10102
10185
|
pubsub.publish('reissueDeleteGood', deleteId);
|
|
10103
10186
|
};
|
|
10187
|
+
var changeHandle = function changeHandle(list) {
|
|
10188
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, {
|
|
10189
|
+
bsGoods: list
|
|
10190
|
+
}));
|
|
10191
|
+
};
|
|
10104
10192
|
return /*#__PURE__*/React.createElement(GoodItem, _objectSpread2(_objectSpread2({
|
|
10105
|
-
key: 'bsGoods'
|
|
10106
|
-
disabled: disabled
|
|
10193
|
+
key: 'bsGoods'
|
|
10107
10194
|
}, props), {}, {
|
|
10195
|
+
disabled: disabled,
|
|
10196
|
+
value: value === null || value === void 0 ? void 0 : value.bsGoods,
|
|
10197
|
+
shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
|
|
10108
10198
|
tableSelect: tableSelect,
|
|
10109
10199
|
onSelect: function onSelect(list) {
|
|
10110
10200
|
return _onSelect(list);
|
|
10111
10201
|
},
|
|
10112
10202
|
onDelete: function onDelete(item) {
|
|
10113
10203
|
return _onDelete(item);
|
|
10204
|
+
},
|
|
10205
|
+
onChange: function onChange(val) {
|
|
10206
|
+
return changeHandle(val);
|
|
10114
10207
|
}
|
|
10115
10208
|
}));
|
|
10116
10209
|
};
|
|
@@ -10125,16 +10218,6 @@ var BsExchange = function BsExchange(props) {
|
|
|
10125
10218
|
disabled = props.disabled,
|
|
10126
10219
|
other = _objectWithoutProperties(props, _excluded$b);
|
|
10127
10220
|
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
10221
|
pubsub.subscribeOnce('deleteGood', function (_, data) {
|
|
10139
10222
|
if (disabled) return;
|
|
10140
10223
|
if (value) {
|
|
@@ -10157,11 +10240,10 @@ var BsExchange = function BsExchange(props) {
|
|
|
10157
10240
|
});
|
|
10158
10241
|
}, [value]);
|
|
10159
10242
|
var getListHandle = function getListHandle(list, val) {
|
|
10160
|
-
var _val$bsExchangeType;
|
|
10243
|
+
var _val$bsExchangeType, _val$bsExchangeType2;
|
|
10161
10244
|
//如果是原单换
|
|
10162
10245
|
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
10246
|
return list.reduce(function (prv, next) {
|
|
10164
|
-
var _val$bsExchangeType2;
|
|
10165
10247
|
next.canDelete = false;
|
|
10166
10248
|
//数量大于1 拆开
|
|
10167
10249
|
if (next.number > 1) {
|
|
@@ -10170,12 +10252,12 @@ var BsExchange = function BsExchange(props) {
|
|
|
10170
10252
|
return t;
|
|
10171
10253
|
});
|
|
10172
10254
|
prv.push.apply(prv, _toConsumableArray(newList));
|
|
10173
|
-
} else
|
|
10255
|
+
} else {
|
|
10174
10256
|
prv.push(_objectSpread2({}, next));
|
|
10175
10257
|
}
|
|
10176
10258
|
return prv;
|
|
10177
10259
|
}, []);
|
|
10178
|
-
} else {
|
|
10260
|
+
} 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
10261
|
//补发换货
|
|
10180
10262
|
return list.reduce(function (prv, next, index) {
|
|
10181
10263
|
next.canDelete = true;
|
|
@@ -10207,9 +10289,24 @@ var BsExchange = function BsExchange(props) {
|
|
|
10207
10289
|
newValue.bsExchangeGiftGoods = [];
|
|
10208
10290
|
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
10209
10291
|
pubsub.publish('type', val[0]);
|
|
10292
|
+
pubsub.subscribe('selectList', function (_, data) {
|
|
10293
|
+
if (disabled) return;
|
|
10294
|
+
if (newValue) {
|
|
10295
|
+
var newData = cloneDeep(data);
|
|
10296
|
+
onChange(_objectSpread2(_objectSpread2({}, newValue), {}, {
|
|
10297
|
+
bsExchangeReturnGoods: getListHandle(_toConsumableArray(newData.list), newValue)
|
|
10298
|
+
}));
|
|
10299
|
+
}
|
|
10300
|
+
});
|
|
10210
10301
|
};
|
|
10211
10302
|
var changeHandle = function changeHandle(val, key) {
|
|
10212
10303
|
var newValue = _objectSpread2({}, value);
|
|
10304
|
+
if (key === 'bsExchangeGiftGoods') {
|
|
10305
|
+
val = cloneDeep(val).map(function (t) {
|
|
10306
|
+
t.money = 0;
|
|
10307
|
+
return t;
|
|
10308
|
+
});
|
|
10309
|
+
}
|
|
10213
10310
|
newValue[key] = val;
|
|
10214
10311
|
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
10215
10312
|
if (key === 'bsExchangeType') {
|
|
@@ -10267,15 +10364,22 @@ var BsExchange = function BsExchange(props) {
|
|
|
10267
10364
|
disabled: disabled,
|
|
10268
10365
|
showChangeBtn: false,
|
|
10269
10366
|
value: value === null || value === void 0 ? void 0 : value.bsExchangeReturnGoods,
|
|
10367
|
+
shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
|
|
10270
10368
|
onChange: function onChange(val) {
|
|
10271
10369
|
return changeHandle(val, 'bsExchangeReturnGoods');
|
|
10272
10370
|
}
|
|
10273
10371
|
})) : /*#__PURE__*/React.createElement(React.Fragment, null, ((value === null || value === void 0 ? void 0 : value.bsExchangeReturnGoods) || []).map(function (item, index) {
|
|
10274
|
-
return /*#__PURE__*/React.createElement(
|
|
10372
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
10373
|
+
style: {
|
|
10374
|
+
border: '1px dashed',
|
|
10375
|
+
marginBottom: '8px'
|
|
10376
|
+
}
|
|
10377
|
+
}, /*#__PURE__*/React.createElement("div", null, "\u9000\u56DE\u5546\u54C1"), /*#__PURE__*/React.createElement(GoodItem, _objectSpread2(_objectSpread2({
|
|
10275
10378
|
key: 'bsReturnGoods'
|
|
10276
10379
|
}, other), {}, {
|
|
10277
10380
|
disabled: disabled,
|
|
10278
10381
|
showChangeBtn: showChangeBtn,
|
|
10382
|
+
shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
|
|
10279
10383
|
value: item === null || item === void 0 ? void 0 : item.bsExchangeReturnGoods,
|
|
10280
10384
|
onChange: function onChange(val) {
|
|
10281
10385
|
return changeReturnHandle(val, index, 'bsExchangeReturnGoods');
|
|
@@ -10287,6 +10391,7 @@ var BsExchange = function BsExchange(props) {
|
|
|
10287
10391
|
showChangeBtn: showChangeBtn,
|
|
10288
10392
|
otherOperations: copyGoods(index),
|
|
10289
10393
|
value: item === null || item === void 0 ? void 0 : item.bsExchangeSwapOutGoods,
|
|
10394
|
+
shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
|
|
10290
10395
|
onChange: function onChange(val) {
|
|
10291
10396
|
return changeReturnHandle(val, index, 'bsExchangeSwapOutGoods');
|
|
10292
10397
|
}
|
|
@@ -10294,7 +10399,8 @@ var BsExchange = function BsExchange(props) {
|
|
|
10294
10399
|
})), ['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.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, "\u8D60\u54C1\u4FE1\u606F"), /*#__PURE__*/React.createElement(GoodItem, _objectSpread2(_objectSpread2({
|
|
10295
10400
|
headerText: "\u8D60\u54C1",
|
|
10296
10401
|
key: 'bsGiftGoods',
|
|
10297
|
-
disabled: disabled
|
|
10402
|
+
disabled: disabled,
|
|
10403
|
+
shopCode: value === null || value === void 0 ? void 0 : value.shopCode
|
|
10298
10404
|
}, other), {}, {
|
|
10299
10405
|
value: value === null || value === void 0 ? void 0 : value.bsExchangeGiftGoods,
|
|
10300
10406
|
onChange: function onChange(val) {
|
|
@@ -10312,20 +10418,6 @@ var BsReissue = function BsReissue(props) {
|
|
|
10312
10418
|
disabled = props.disabled,
|
|
10313
10419
|
other = _objectWithoutProperties(props, _excluded$c);
|
|
10314
10420
|
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
10421
|
pubsub.subscribeOnce('reissueDeleteGood', function (_, data) {
|
|
10330
10422
|
if (disabled) return;
|
|
10331
10423
|
if (value) {
|
|
@@ -10352,6 +10444,19 @@ var BsReissue = function BsReissue(props) {
|
|
|
10352
10444
|
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2({}, newValue));
|
|
10353
10445
|
if (key === 'bsReissueType') {
|
|
10354
10446
|
pubsub.publish('reissueType', val[0]);
|
|
10447
|
+
pubsub.subscribe('reissueSelectList', function (_, data) {
|
|
10448
|
+
if (disabled) return;
|
|
10449
|
+
if (value) {
|
|
10450
|
+
var newData = cloneDeep(data);
|
|
10451
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, newValue), {}, {
|
|
10452
|
+
bsReissueGoods: ((newData === null || newData === void 0 ? void 0 : newData.list) || []).map(function (item) {
|
|
10453
|
+
item.money = 0;
|
|
10454
|
+
item.canUpdateNumber = ['2', '4'].includes(newData === null || newData === void 0 ? void 0 : newData.type);
|
|
10455
|
+
return item;
|
|
10456
|
+
})
|
|
10457
|
+
}));
|
|
10458
|
+
}
|
|
10459
|
+
});
|
|
10355
10460
|
}
|
|
10356
10461
|
};
|
|
10357
10462
|
//显示选择商品按钮 原单换不显示选择商品
|
|
@@ -10376,6 +10481,7 @@ var BsReissue = function BsReissue(props) {
|
|
|
10376
10481
|
disabled: disabled,
|
|
10377
10482
|
canUpdateNumber: showChangeBtn,
|
|
10378
10483
|
showChangeBtn: showChangeBtn,
|
|
10484
|
+
shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
|
|
10379
10485
|
value: value === null || value === void 0 ? void 0 : value.bsReissueGoods,
|
|
10380
10486
|
onChange: function onChange(val) {
|
|
10381
10487
|
return changeHandle(val, 'bsReissueGoods');
|
|
@@ -10386,7 +10492,7 @@ var BsReissue = function BsReissue(props) {
|
|
|
10386
10492
|
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
10493
|
styleInject(css_248z$9);
|
|
10388
10494
|
|
|
10389
|
-
var TabPane$
|
|
10495
|
+
var TabPane$1 = Tabs.TabPane;
|
|
10390
10496
|
var Option$2 = Select.Option;
|
|
10391
10497
|
var Search$1 = Input.Search;
|
|
10392
10498
|
var GoodsModal$3 = function GoodsModal(props) {
|
|
@@ -10702,7 +10808,7 @@ var GoodsModal$3 = function GoodsModal(props) {
|
|
|
10702
10808
|
}));
|
|
10703
10809
|
}
|
|
10704
10810
|
}, tabs.map(function (tab) {
|
|
10705
|
-
return /*#__PURE__*/React.createElement(TabPane$
|
|
10811
|
+
return /*#__PURE__*/React.createElement(TabPane$1, {
|
|
10706
10812
|
tab: tab.tab + (tab.key === 'all' ? "(".concat(selectList.length, ")") : ''),
|
|
10707
10813
|
key: tab.key
|
|
10708
10814
|
});
|