@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.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
|
|
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:
|
|
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
|
|
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\
|
|
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 ? '
|
|
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: '
|
|
9562
|
-
title: '
|
|
9563
|
-
|
|
9564
|
-
|
|
9565
|
-
|
|
9566
|
-
|
|
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: '
|
|
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: '
|
|
9574
|
-
title: '
|
|
9659
|
+
dataIndex: 'skuName',
|
|
9660
|
+
title: '商品sku名称',
|
|
9661
|
+
with: 200,
|
|
9662
|
+
ellipsis: true
|
|
9575
9663
|
}, {
|
|
9576
|
-
dataIndex: '
|
|
9577
|
-
title: '
|
|
9664
|
+
dataIndex: 'code',
|
|
9665
|
+
title: '商品编码',
|
|
9666
|
+
with: 200,
|
|
9667
|
+
ellipsis: true
|
|
9578
9668
|
}, {
|
|
9579
|
-
dataIndex: '
|
|
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
|
-
|
|
9612
|
-
|
|
9613
|
-
var _useState9 = React.useState(
|
|
9711
|
+
allList = _useState8[0],
|
|
9712
|
+
setAllList = _useState8[1]; //获取到的所有数据
|
|
9713
|
+
var _useState9 = React.useState([]),
|
|
9614
9714
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
9615
|
-
|
|
9616
|
-
|
|
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
|
-
|
|
9631
|
-
|
|
9632
|
-
var _useState13 = React.useState(
|
|
9633
|
-
_useState14 = _slicedToArray(_useState13,
|
|
9634
|
-
|
|
9635
|
-
|
|
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
|
-
|
|
9639
|
-
|
|
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
|
-
|
|
9643
|
-
|
|
9644
|
-
var _useState19 = React.useState(
|
|
9645
|
-
|
|
9646
|
-
|
|
9647
|
-
|
|
9648
|
-
|
|
9649
|
-
|
|
9650
|
-
|
|
9651
|
-
|
|
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
|
|
9654
|
-
|
|
9655
|
-
|
|
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
|
|
9683
|
-
|
|
9684
|
-
|
|
9685
|
-
|
|
9686
|
-
|
|
9687
|
-
|
|
9688
|
-
|
|
9689
|
-
|
|
9690
|
-
|
|
9691
|
-
|
|
9692
|
-
|
|
9693
|
-
|
|
9694
|
-
|
|
9695
|
-
|
|
9696
|
-
|
|
9697
|
-
|
|
9698
|
-
|
|
9699
|
-
|
|
9700
|
-
|
|
9701
|
-
|
|
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
|
-
|
|
9713
|
-
|
|
9714
|
-
|
|
9715
|
-
|
|
9716
|
-
|
|
9717
|
-
|
|
9718
|
-
|
|
9719
|
-
|
|
9720
|
-
|
|
9721
|
-
|
|
9722
|
-
}
|
|
9723
|
-
})
|
|
9724
|
-
|
|
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,44 @@ 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);
|
|
9771
|
-
}
|
|
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",
|
|
9779
|
-
style: {
|
|
9780
|
-
display: searchParams.type === 'select' ? 'none' : ''
|
|
9781
|
-
}
|
|
9782
9846
|
}, /*#__PURE__*/React__default['default'].createElement(antd.Form, {
|
|
9783
|
-
layout: "inline"
|
|
9784
|
-
|
|
9785
|
-
|
|
9786
|
-
}
|
|
9787
|
-
|
|
9788
|
-
}
|
|
9789
|
-
placeholder: "\u5546\u54C1\u540D\u79F0"
|
|
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
|
+
})), /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
|
|
9855
|
+
name: "code"
|
|
9856
|
+
}, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
|
|
9857
|
+
placeholder: "\u8BF7\u8F93\u5165\u5546\u54C1\u7F16\u7801"
|
|
9858
|
+
})), /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
|
|
9859
|
+
name: "skuCode"
|
|
9860
|
+
}, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
|
|
9861
|
+
placeholder: "\u8BF7\u8F93\u5165\u5546\u54C1sku\u7F16\u7801"
|
|
9790
9862
|
})), /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, null, /*#__PURE__*/React__default['default'].createElement(antd.Button, {
|
|
9791
9863
|
type: "primary",
|
|
9792
9864
|
htmlType: "submit"
|
|
9793
|
-
}, "\u67E5\u8BE2"), /*#__PURE__*/React__default['default'].createElement(antd.Button,
|
|
9865
|
+
}, "\u67E5\u8BE2"), /*#__PURE__*/React__default['default'].createElement(antd.Button, {
|
|
9866
|
+
onClick: onReset
|
|
9867
|
+
}, "\u91CD\u7F6E"))), /*#__PURE__*/React__default['default'].createElement(antd.Spin, {
|
|
9794
9868
|
spinning: loading
|
|
9795
9869
|
}, /*#__PURE__*/React__default['default'].createElement(antd.Table, {
|
|
9796
9870
|
rowSelection: rowSelection,
|
|
9797
9871
|
columns: columns,
|
|
9798
|
-
rowKey: '
|
|
9799
|
-
dataSource:
|
|
9872
|
+
rowKey: 'skuCode',
|
|
9873
|
+
dataSource: goodList,
|
|
9800
9874
|
scroll: {
|
|
9875
|
+
x: true,
|
|
9801
9876
|
y: 300
|
|
9802
9877
|
},
|
|
9803
9878
|
pagination: {
|
|
9804
9879
|
size: 'small',
|
|
9805
9880
|
total: total,
|
|
9806
|
-
current:
|
|
9807
|
-
pageSize:
|
|
9881
|
+
current: pageNo,
|
|
9882
|
+
pageSize: pageSize,
|
|
9883
|
+
pageSizeOptions: [],
|
|
9808
9884
|
onChange: pageChange
|
|
9809
9885
|
}
|
|
9810
9886
|
})));
|
|
@@ -9823,8 +9899,8 @@ var GoodItem = function GoodItem(props) {
|
|
|
9823
9899
|
value = _props$value === void 0 ? [] : _props$value,
|
|
9824
9900
|
onChange = props.onChange,
|
|
9825
9901
|
disabled = props.disabled,
|
|
9826
|
-
_props$
|
|
9827
|
-
|
|
9902
|
+
_props$showHeader = props.showHeader,
|
|
9903
|
+
showHeader = _props$showHeader === void 0 ? [] : _props$showHeader,
|
|
9828
9904
|
width = props.width,
|
|
9829
9905
|
_props$shopList = props.shopList,
|
|
9830
9906
|
shopList = _props$shopList === void 0 ? [] : _props$shopList,
|
|
@@ -9840,6 +9916,7 @@ var GoodItem = function GoodItem(props) {
|
|
|
9840
9916
|
otherOperations = _props$otherOperation === void 0 ? null : _props$otherOperation,
|
|
9841
9917
|
_props$canUpdateNumbe = props.canUpdateNumber,
|
|
9842
9918
|
canUpdateNumber = _props$canUpdateNumbe === void 0 ? false : _props$canUpdateNumbe,
|
|
9919
|
+
shopCode = props.shopCode,
|
|
9843
9920
|
onSelect = props.onSelect,
|
|
9844
9921
|
onDelete = props.onDelete;
|
|
9845
9922
|
var refModal = React.useRef();
|
|
@@ -9869,6 +9946,18 @@ var GoodItem = function GoodItem(props) {
|
|
|
9869
9946
|
var GOODS_INFO_COLUMNS = function GOODS_INFO_COLUMNS() {
|
|
9870
9947
|
var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
9871
9948
|
return [{
|
|
9949
|
+
dataIndex: 'pic',
|
|
9950
|
+
title: "\u56FE\u7247",
|
|
9951
|
+
align: 'center',
|
|
9952
|
+
ellipsis: true,
|
|
9953
|
+
width: 100,
|
|
9954
|
+
render: function render(val) {
|
|
9955
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Image, {
|
|
9956
|
+
width: 60,
|
|
9957
|
+
src: val
|
|
9958
|
+
});
|
|
9959
|
+
}
|
|
9960
|
+
}, {
|
|
9872
9961
|
dataIndex: 'name',
|
|
9873
9962
|
title: "".concat(text, "\u540D\u79F0"),
|
|
9874
9963
|
align: 'center',
|
|
@@ -9930,20 +10019,8 @@ var GoodItem = function GoodItem(props) {
|
|
|
9930
10019
|
render: function render(val, record, index) {
|
|
9931
10020
|
return /*#__PURE__*/React__default['default'].createElement("span", null, index + 1);
|
|
9932
10021
|
}
|
|
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
10022
|
}].concat(_toConsumableArray(GOODS_INFO_COLUMNS().filter(function (t) {
|
|
9946
|
-
return
|
|
10023
|
+
return showHeader.includes(t === null || t === void 0 ? void 0 : t.dataIndex);
|
|
9947
10024
|
})));
|
|
9948
10025
|
if (!disabled) {
|
|
9949
10026
|
columnList.push({
|
|
@@ -9963,20 +10040,21 @@ var GoodItem = function GoodItem(props) {
|
|
|
9963
10040
|
});
|
|
9964
10041
|
}
|
|
9965
10042
|
return columnList;
|
|
9966
|
-
}, [
|
|
10043
|
+
}, [showHeader, value, disabled]);
|
|
9967
10044
|
var onSubmit = function onSubmit(list) {
|
|
9968
10045
|
var newList = list.map(function (item) {
|
|
9969
|
-
var
|
|
9970
|
-
|
|
9971
|
-
|
|
9972
|
-
|
|
10046
|
+
var goodsId = item.goodsId,
|
|
10047
|
+
name = item.name,
|
|
10048
|
+
code = item.code,
|
|
10049
|
+
skuCode = item.skuCode,
|
|
10050
|
+
marketPrice = item.marketPrice;
|
|
9973
10051
|
return {
|
|
9974
|
-
id:
|
|
9975
|
-
pic:
|
|
9976
|
-
name:
|
|
9977
|
-
code:
|
|
9978
|
-
sku:
|
|
9979
|
-
money:
|
|
10052
|
+
id: goodsId,
|
|
10053
|
+
pic: '',
|
|
10054
|
+
name: name,
|
|
10055
|
+
code: code,
|
|
10056
|
+
sku: skuCode,
|
|
10057
|
+
money: marketPrice || 0,
|
|
9980
10058
|
share: '',
|
|
9981
10059
|
number: 1,
|
|
9982
10060
|
type: '',
|
|
@@ -9989,7 +10067,7 @@ var GoodItem = function GoodItem(props) {
|
|
|
9989
10067
|
var onSelectChange = function onSelectChange(newSelectedRowKeys) {
|
|
9990
10068
|
setSelectedRowKeys(newSelectedRowKeys);
|
|
9991
10069
|
onSelect === null || onSelect === void 0 ? void 0 : onSelect(value.filter(function (t) {
|
|
9992
|
-
return newSelectedRowKeys.includes(t.
|
|
10070
|
+
return newSelectedRowKeys.includes(t.sku);
|
|
9993
10071
|
}));
|
|
9994
10072
|
};
|
|
9995
10073
|
var handleChangeGoods = function handleChangeGoods() {
|
|
@@ -10017,7 +10095,7 @@ var GoodItem = function GoodItem(props) {
|
|
|
10017
10095
|
}, "\u9009\u62E9\u5546\u54C1"), otherOperations), /*#__PURE__*/React__default['default'].createElement(antd.Table, _objectSpread2(_objectSpread2({}, tableConfig), {}, {
|
|
10018
10096
|
columns: newColumns,
|
|
10019
10097
|
dataSource: value,
|
|
10020
|
-
rowKey: '
|
|
10098
|
+
rowKey: 'sku',
|
|
10021
10099
|
size: "small",
|
|
10022
10100
|
pagination: false,
|
|
10023
10101
|
scroll: {
|
|
@@ -10032,13 +10110,15 @@ var GoodItem = function GoodItem(props) {
|
|
|
10032
10110
|
width: width,
|
|
10033
10111
|
shopList: shopList,
|
|
10034
10112
|
shopId: shopId,
|
|
10035
|
-
maxLength: maxLength
|
|
10113
|
+
maxLength: maxLength,
|
|
10114
|
+
shopCode: shopCode
|
|
10036
10115
|
}));
|
|
10037
10116
|
};
|
|
10038
10117
|
|
|
10039
10118
|
var BsGoods = function BsGoods(props) {
|
|
10040
10119
|
var value = props.value,
|
|
10041
|
-
disabled = props.disabled
|
|
10120
|
+
disabled = props.disabled,
|
|
10121
|
+
onChange = props.onChange;
|
|
10042
10122
|
var _useState = React.useState(false),
|
|
10043
10123
|
_useState2 = _slicedToArray(_useState, 2),
|
|
10044
10124
|
tableSelect = _useState2[0],
|
|
@@ -10054,17 +10134,19 @@ var BsGoods = function BsGoods(props) {
|
|
|
10054
10134
|
var reissueRef = React.useRef();
|
|
10055
10135
|
React.useEffect(function () {
|
|
10056
10136
|
ref.current = pubsub__default['default'].subscribeOnce('type', function (type, val) {
|
|
10057
|
-
|
|
10137
|
+
var _value$bsGoods;
|
|
10138
|
+
console.log(value);
|
|
10058
10139
|
if (disabled) return;
|
|
10059
10140
|
setWithInfo({
|
|
10060
10141
|
type: type,
|
|
10061
10142
|
val: val
|
|
10062
10143
|
});
|
|
10063
10144
|
setTableSelect(['2', '4'].includes(val));
|
|
10064
|
-
if (['1', '3'].includes(val) && (value === null || value === void 0 ? void 0 : value.length)) {
|
|
10145
|
+
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)) {
|
|
10146
|
+
var newGoods = lodash.cloneDeep(value === null || value === void 0 ? void 0 : value.bsGoods);
|
|
10065
10147
|
pubsub__default['default'].publish('selectList', {
|
|
10066
10148
|
type: val,
|
|
10067
|
-
list:
|
|
10149
|
+
list: (newGoods || []).map(function (item) {
|
|
10068
10150
|
item.canDelete = false;
|
|
10069
10151
|
return item;
|
|
10070
10152
|
})
|
|
@@ -10073,17 +10155,18 @@ var BsGoods = function BsGoods(props) {
|
|
|
10073
10155
|
});
|
|
10074
10156
|
//补发
|
|
10075
10157
|
reissueRef.current = pubsub__default['default'].subscribeOnce('reissueType', function (type, val) {
|
|
10158
|
+
var _value$bsGoods2;
|
|
10076
10159
|
if (disabled) return;
|
|
10077
|
-
console.log('reissueType', type, val, value);
|
|
10078
10160
|
setWithInfo({
|
|
10079
10161
|
type: type,
|
|
10080
10162
|
val: val
|
|
10081
10163
|
});
|
|
10082
10164
|
setTableSelect(['2', '4'].includes(val));
|
|
10083
|
-
if (['1', '3'].includes(val) && (value === null || value === void 0 ? void 0 : value.length)) {
|
|
10165
|
+
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)) {
|
|
10166
|
+
var newGoods = lodash.cloneDeep(value === null || value === void 0 ? void 0 : value.bsGoods);
|
|
10084
10167
|
pubsub__default['default'].publish('reissueSelectList', {
|
|
10085
10168
|
type: val,
|
|
10086
|
-
list: (
|
|
10169
|
+
list: (newGoods || []).map(function (item) {
|
|
10087
10170
|
item.canDelete = false;
|
|
10088
10171
|
return item;
|
|
10089
10172
|
})
|
|
@@ -10112,16 +10195,26 @@ var BsGoods = function BsGoods(props) {
|
|
|
10112
10195
|
pubsub__default['default'].publish('deleteGood', deleteId);
|
|
10113
10196
|
pubsub__default['default'].publish('reissueDeleteGood', deleteId);
|
|
10114
10197
|
};
|
|
10198
|
+
var changeHandle = function changeHandle(list) {
|
|
10199
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, {
|
|
10200
|
+
bsGoods: list
|
|
10201
|
+
}));
|
|
10202
|
+
};
|
|
10115
10203
|
return /*#__PURE__*/React__default['default'].createElement(GoodItem, _objectSpread2(_objectSpread2({
|
|
10116
|
-
key: 'bsGoods'
|
|
10117
|
-
disabled: disabled
|
|
10204
|
+
key: 'bsGoods'
|
|
10118
10205
|
}, props), {}, {
|
|
10206
|
+
disabled: disabled,
|
|
10207
|
+
value: value === null || value === void 0 ? void 0 : value.bsGoods,
|
|
10208
|
+
shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
|
|
10119
10209
|
tableSelect: tableSelect,
|
|
10120
10210
|
onSelect: function onSelect(list) {
|
|
10121
10211
|
return _onSelect(list);
|
|
10122
10212
|
},
|
|
10123
10213
|
onDelete: function onDelete(item) {
|
|
10124
10214
|
return _onDelete(item);
|
|
10215
|
+
},
|
|
10216
|
+
onChange: function onChange(val) {
|
|
10217
|
+
return changeHandle(val);
|
|
10125
10218
|
}
|
|
10126
10219
|
}));
|
|
10127
10220
|
};
|
|
@@ -10136,16 +10229,6 @@ var BsExchange = function BsExchange(props) {
|
|
|
10136
10229
|
disabled = props.disabled,
|
|
10137
10230
|
other = _objectWithoutProperties(props, _excluded$b);
|
|
10138
10231
|
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
10232
|
pubsub__default['default'].subscribeOnce('deleteGood', function (_, data) {
|
|
10150
10233
|
if (disabled) return;
|
|
10151
10234
|
if (value) {
|
|
@@ -10168,11 +10251,10 @@ var BsExchange = function BsExchange(props) {
|
|
|
10168
10251
|
});
|
|
10169
10252
|
}, [value]);
|
|
10170
10253
|
var getListHandle = function getListHandle(list, val) {
|
|
10171
|
-
var _val$bsExchangeType;
|
|
10254
|
+
var _val$bsExchangeType, _val$bsExchangeType2;
|
|
10172
10255
|
//如果是原单换
|
|
10173
10256
|
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
10257
|
return list.reduce(function (prv, next) {
|
|
10175
|
-
var _val$bsExchangeType2;
|
|
10176
10258
|
next.canDelete = false;
|
|
10177
10259
|
//数量大于1 拆开
|
|
10178
10260
|
if (next.number > 1) {
|
|
@@ -10181,12 +10263,12 @@ var BsExchange = function BsExchange(props) {
|
|
|
10181
10263
|
return t;
|
|
10182
10264
|
});
|
|
10183
10265
|
prv.push.apply(prv, _toConsumableArray(newList));
|
|
10184
|
-
} else
|
|
10266
|
+
} else {
|
|
10185
10267
|
prv.push(_objectSpread2({}, next));
|
|
10186
10268
|
}
|
|
10187
10269
|
return prv;
|
|
10188
10270
|
}, []);
|
|
10189
|
-
} else {
|
|
10271
|
+
} 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
10272
|
//补发换货
|
|
10191
10273
|
return list.reduce(function (prv, next, index) {
|
|
10192
10274
|
next.canDelete = true;
|
|
@@ -10218,9 +10300,24 @@ var BsExchange = function BsExchange(props) {
|
|
|
10218
10300
|
newValue.bsExchangeGiftGoods = [];
|
|
10219
10301
|
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
10220
10302
|
pubsub__default['default'].publish('type', val[0]);
|
|
10303
|
+
pubsub__default['default'].subscribe('selectList', function (_, data) {
|
|
10304
|
+
if (disabled) return;
|
|
10305
|
+
if (newValue) {
|
|
10306
|
+
var newData = lodash.cloneDeep(data);
|
|
10307
|
+
onChange(_objectSpread2(_objectSpread2({}, newValue), {}, {
|
|
10308
|
+
bsExchangeReturnGoods: getListHandle(_toConsumableArray(newData.list), newValue)
|
|
10309
|
+
}));
|
|
10310
|
+
}
|
|
10311
|
+
});
|
|
10221
10312
|
};
|
|
10222
10313
|
var changeHandle = function changeHandle(val, key) {
|
|
10223
10314
|
var newValue = _objectSpread2({}, value);
|
|
10315
|
+
if (key === 'bsExchangeGiftGoods') {
|
|
10316
|
+
val = lodash.cloneDeep(val).map(function (t) {
|
|
10317
|
+
t.money = 0;
|
|
10318
|
+
return t;
|
|
10319
|
+
});
|
|
10320
|
+
}
|
|
10224
10321
|
newValue[key] = val;
|
|
10225
10322
|
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
10226
10323
|
if (key === 'bsExchangeType') {
|
|
@@ -10278,15 +10375,22 @@ var BsExchange = function BsExchange(props) {
|
|
|
10278
10375
|
disabled: disabled,
|
|
10279
10376
|
showChangeBtn: false,
|
|
10280
10377
|
value: value === null || value === void 0 ? void 0 : value.bsExchangeReturnGoods,
|
|
10378
|
+
shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
|
|
10281
10379
|
onChange: function onChange(val) {
|
|
10282
10380
|
return changeHandle(val, 'bsExchangeReturnGoods');
|
|
10283
10381
|
}
|
|
10284
10382
|
})) : /*#__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(
|
|
10383
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
10384
|
+
style: {
|
|
10385
|
+
border: '1px dashed',
|
|
10386
|
+
marginBottom: '8px'
|
|
10387
|
+
}
|
|
10388
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", null, "\u9000\u56DE\u5546\u54C1"), /*#__PURE__*/React__default['default'].createElement(GoodItem, _objectSpread2(_objectSpread2({
|
|
10286
10389
|
key: 'bsReturnGoods'
|
|
10287
10390
|
}, other), {}, {
|
|
10288
10391
|
disabled: disabled,
|
|
10289
10392
|
showChangeBtn: showChangeBtn,
|
|
10393
|
+
shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
|
|
10290
10394
|
value: item === null || item === void 0 ? void 0 : item.bsExchangeReturnGoods,
|
|
10291
10395
|
onChange: function onChange(val) {
|
|
10292
10396
|
return changeReturnHandle(val, index, 'bsExchangeReturnGoods');
|
|
@@ -10298,6 +10402,7 @@ var BsExchange = function BsExchange(props) {
|
|
|
10298
10402
|
showChangeBtn: showChangeBtn,
|
|
10299
10403
|
otherOperations: copyGoods(index),
|
|
10300
10404
|
value: item === null || item === void 0 ? void 0 : item.bsExchangeSwapOutGoods,
|
|
10405
|
+
shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
|
|
10301
10406
|
onChange: function onChange(val) {
|
|
10302
10407
|
return changeReturnHandle(val, index, 'bsExchangeSwapOutGoods');
|
|
10303
10408
|
}
|
|
@@ -10305,7 +10410,8 @@ var BsExchange = function BsExchange(props) {
|
|
|
10305
10410
|
})), ['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
10411
|
headerText: "\u8D60\u54C1",
|
|
10307
10412
|
key: 'bsGiftGoods',
|
|
10308
|
-
disabled: disabled
|
|
10413
|
+
disabled: disabled,
|
|
10414
|
+
shopCode: value === null || value === void 0 ? void 0 : value.shopCode
|
|
10309
10415
|
}, other), {}, {
|
|
10310
10416
|
value: value === null || value === void 0 ? void 0 : value.bsExchangeGiftGoods,
|
|
10311
10417
|
onChange: function onChange(val) {
|
|
@@ -10323,20 +10429,6 @@ var BsReissue = function BsReissue(props) {
|
|
|
10323
10429
|
disabled = props.disabled,
|
|
10324
10430
|
other = _objectWithoutProperties(props, _excluded$c);
|
|
10325
10431
|
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
10432
|
pubsub__default['default'].subscribeOnce('reissueDeleteGood', function (_, data) {
|
|
10341
10433
|
if (disabled) return;
|
|
10342
10434
|
if (value) {
|
|
@@ -10363,6 +10455,19 @@ var BsReissue = function BsReissue(props) {
|
|
|
10363
10455
|
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2({}, newValue));
|
|
10364
10456
|
if (key === 'bsReissueType') {
|
|
10365
10457
|
pubsub__default['default'].publish('reissueType', val[0]);
|
|
10458
|
+
pubsub__default['default'].subscribe('reissueSelectList', function (_, data) {
|
|
10459
|
+
if (disabled) return;
|
|
10460
|
+
if (value) {
|
|
10461
|
+
var newData = lodash.cloneDeep(data);
|
|
10462
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, newValue), {}, {
|
|
10463
|
+
bsReissueGoods: ((newData === null || newData === void 0 ? void 0 : newData.list) || []).map(function (item) {
|
|
10464
|
+
item.money = 0;
|
|
10465
|
+
item.canUpdateNumber = ['2', '4'].includes(newData === null || newData === void 0 ? void 0 : newData.type);
|
|
10466
|
+
return item;
|
|
10467
|
+
})
|
|
10468
|
+
}));
|
|
10469
|
+
}
|
|
10470
|
+
});
|
|
10366
10471
|
}
|
|
10367
10472
|
};
|
|
10368
10473
|
//显示选择商品按钮 原单换不显示选择商品
|
|
@@ -10387,6 +10492,7 @@ var BsReissue = function BsReissue(props) {
|
|
|
10387
10492
|
disabled: disabled,
|
|
10388
10493
|
canUpdateNumber: showChangeBtn,
|
|
10389
10494
|
showChangeBtn: showChangeBtn,
|
|
10495
|
+
shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
|
|
10390
10496
|
value: value === null || value === void 0 ? void 0 : value.bsReissueGoods,
|
|
10391
10497
|
onChange: function onChange(val) {
|
|
10392
10498
|
return changeHandle(val, 'bsReissueGoods');
|
|
@@ -10397,7 +10503,7 @@ var BsReissue = function BsReissue(props) {
|
|
|
10397
10503
|
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
10504
|
styleInject(css_248z$9);
|
|
10399
10505
|
|
|
10400
|
-
var TabPane$
|
|
10506
|
+
var TabPane$1 = antd.Tabs.TabPane;
|
|
10401
10507
|
var Option$2 = antd.Select.Option;
|
|
10402
10508
|
var Search$1 = antd.Input.Search;
|
|
10403
10509
|
var GoodsModal$3 = function GoodsModal(props) {
|
|
@@ -10713,7 +10819,7 @@ var GoodsModal$3 = function GoodsModal(props) {
|
|
|
10713
10819
|
}));
|
|
10714
10820
|
}
|
|
10715
10821
|
}, tabs.map(function (tab) {
|
|
10716
|
-
return /*#__PURE__*/React__default['default'].createElement(TabPane$
|
|
10822
|
+
return /*#__PURE__*/React__default['default'].createElement(TabPane$1, {
|
|
10717
10823
|
tab: tab.tab + (tab.key === 'all' ? "(".concat(selectList.length, ")") : ''),
|
|
10718
10824
|
key: tab.key
|
|
10719
10825
|
});
|