@kmkf-fe-packages/basic-components 0.7.15-alpha.0 → 0.7.15-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +354 -82
- package/dist/index.js +357 -81
- package/dist/src/apaas/ApaasAddress/index.d.ts +1 -0
- package/dist/src/apaas/ApaasPosting/index.d.ts +1 -0
- package/dist/src/bs/Exchange/index.d.ts +3 -0
- package/dist/src/bs/Goods/index.d.ts +1 -13
- package/dist/src/bs/Reissue/index.d.ts +3 -0
- package/dist/src/bs/component/GoodItem/index.d.ts +20 -0
- package/dist/src/bs/component/GoodsModal.d.ts +0 -2
- package/dist/src/business/LogisticsTrajectory/index.d.ts +3 -0
- package/dist/src/common/IdentifyAddress/index.d.ts +2 -0
- package/dist/src/index.d.ts +3 -0
- package/package.json +4 -2
package/dist/index.js
CHANGED
|
@@ -8,12 +8,14 @@ var icons = require('@ant-design/icons');
|
|
|
8
8
|
var request = require('umi-request');
|
|
9
9
|
var kmkfUtils = require('@kmkf-fe-packages/kmkf-utils');
|
|
10
10
|
var zhCN = require('antd/lib/locale/zh_CN');
|
|
11
|
+
var pubsub = require('pubsub-js');
|
|
11
12
|
|
|
12
13
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
14
|
|
|
14
15
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
15
16
|
var request__default = /*#__PURE__*/_interopDefaultLegacy(request);
|
|
16
17
|
var zhCN__default = /*#__PURE__*/_interopDefaultLegacy(zhCN);
|
|
18
|
+
var pubsub__default = /*#__PURE__*/_interopDefaultLegacy(pubsub);
|
|
17
19
|
|
|
18
20
|
function _iterableToArrayLimit(arr, i) {
|
|
19
21
|
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
@@ -1562,7 +1564,10 @@ var IdentifyAddress = function IdentifyAddress(props) {
|
|
|
1562
1564
|
var value = props.value,
|
|
1563
1565
|
onChange = props.onChange,
|
|
1564
1566
|
_props$disabled = props.disabled,
|
|
1565
|
-
disabled = _props$disabled === void 0 ? false : _props$disabled
|
|
1567
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
1568
|
+
_props$showIdentify = props.showIdentify,
|
|
1569
|
+
showIdentify = _props$showIdentify === void 0 ? true : _props$showIdentify,
|
|
1570
|
+
type = props.type;
|
|
1566
1571
|
var changeHandle = function changeHandle(val, type) {
|
|
1567
1572
|
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, type, val)));
|
|
1568
1573
|
};
|
|
@@ -1578,7 +1583,7 @@ var IdentifyAddress = function IdentifyAddress(props) {
|
|
|
1578
1583
|
}
|
|
1579
1584
|
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2({}, params));
|
|
1580
1585
|
};
|
|
1581
|
-
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, !disabled && /*#__PURE__*/React__default['default'].createElement(ParseLogistics, {
|
|
1586
|
+
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, !disabled && showIdentify && /*#__PURE__*/React__default['default'].createElement(ParseLogistics, {
|
|
1582
1587
|
onChange: handleParseLogistics
|
|
1583
1588
|
}), /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(Province, {
|
|
1584
1589
|
value: value.address,
|
|
@@ -1586,7 +1591,8 @@ var IdentifyAddress = function IdentifyAddress(props) {
|
|
|
1586
1591
|
return changeHandle(val, 'address');
|
|
1587
1592
|
},
|
|
1588
1593
|
options: [],
|
|
1589
|
-
disabled: disabled
|
|
1594
|
+
disabled: disabled,
|
|
1595
|
+
type: type
|
|
1590
1596
|
}), /*#__PURE__*/React__default['default'].createElement(antd.Input, {
|
|
1591
1597
|
value: value.detail,
|
|
1592
1598
|
disabled: disabled,
|
|
@@ -1616,6 +1622,8 @@ function ApaasPosting(props) {
|
|
|
1616
1622
|
value = _props$value === void 0 ? {} : _props$value,
|
|
1617
1623
|
_props$disabled = props.disabled,
|
|
1618
1624
|
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
1625
|
+
_props$type = props.type,
|
|
1626
|
+
type = _props$type === void 0 ? 'workOrder' : _props$type,
|
|
1619
1627
|
onChange = props.onChange;
|
|
1620
1628
|
var handleChange = function handleChange(val) {
|
|
1621
1629
|
//智能识别返填
|
|
@@ -1635,7 +1643,9 @@ function ApaasPosting(props) {
|
|
|
1635
1643
|
receiverName: (value === null || value === void 0 ? void 0 : value.postingReceiverName) || '',
|
|
1636
1644
|
receiverMobile: (value === null || value === void 0 ? void 0 : value.postingReceiverMobile) || ''
|
|
1637
1645
|
},
|
|
1638
|
-
onChange: handleChange
|
|
1646
|
+
onChange: handleChange,
|
|
1647
|
+
type: type,
|
|
1648
|
+
showIdentify: type !== 'bs'
|
|
1639
1649
|
});
|
|
1640
1650
|
}
|
|
1641
1651
|
|
|
@@ -3626,6 +3636,64 @@ var LogisticsInterception = function LogisticsInterception(props) {
|
|
|
3626
3636
|
})));
|
|
3627
3637
|
};
|
|
3628
3638
|
|
|
3639
|
+
var LogisticsTrajectory = function LogisticsTrajectory(props) {
|
|
3640
|
+
var options = props.options,
|
|
3641
|
+
showField = props.showField,
|
|
3642
|
+
_props$value = props.value,
|
|
3643
|
+
value = _props$value === void 0 ? {} : _props$value,
|
|
3644
|
+
disabled = props.disabled,
|
|
3645
|
+
onChange = props.onChange;
|
|
3646
|
+
var handleInputChange = function handleInputChange(e, type) {
|
|
3647
|
+
var val = e.target.value;
|
|
3648
|
+
typeof onChange === 'function' && onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, type, val)));
|
|
3649
|
+
};
|
|
3650
|
+
var handelSelectChange = function handelSelectChange(val) {
|
|
3651
|
+
typeof onChange === 'function' && onChange(_objectSpread2(_objectSpread2({}, value), {}, {
|
|
3652
|
+
company: val
|
|
3653
|
+
}));
|
|
3654
|
+
};
|
|
3655
|
+
//物流公司
|
|
3656
|
+
var LogisticsCompany = function LogisticsCompany() {
|
|
3657
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Select, {
|
|
3658
|
+
disabled: disabled,
|
|
3659
|
+
placeholder: "\u7269\u6D41\u516C\u53F8",
|
|
3660
|
+
onChange: handelSelectChange,
|
|
3661
|
+
value: (value === null || value === void 0 ? void 0 : value.company) === '' ? undefined : value === null || value === void 0 ? void 0 : value.company,
|
|
3662
|
+
options: options,
|
|
3663
|
+
showSearch: true,
|
|
3664
|
+
style: {
|
|
3665
|
+
width: '100%'
|
|
3666
|
+
},
|
|
3667
|
+
filterOption: function filterOption(input, option) {
|
|
3668
|
+
return option.label.includes(input);
|
|
3669
|
+
}
|
|
3670
|
+
});
|
|
3671
|
+
};
|
|
3672
|
+
//物流单号
|
|
3673
|
+
var LogisticsCode = function LogisticsCode() {
|
|
3674
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Input, {
|
|
3675
|
+
disabled: disabled,
|
|
3676
|
+
placeholder: "\u7269\u6D41\u5355\u53F7",
|
|
3677
|
+
onChange: function onChange(e) {
|
|
3678
|
+
return handleInputChange(e, 'order');
|
|
3679
|
+
},
|
|
3680
|
+
value: value === null || value === void 0 ? void 0 : value.order
|
|
3681
|
+
});
|
|
3682
|
+
};
|
|
3683
|
+
//物流快照
|
|
3684
|
+
var LogisticsSnapshot = function LogisticsSnapshot() {
|
|
3685
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Input, {
|
|
3686
|
+
disabled: true,
|
|
3687
|
+
placeholder: "\u7269\u6D41\u5FEB\u7167",
|
|
3688
|
+
onChange: function onChange(e) {
|
|
3689
|
+
return handleInputChange(e, 'snapshot');
|
|
3690
|
+
},
|
|
3691
|
+
value: value === null || value === void 0 ? void 0 : value.snapshot
|
|
3692
|
+
});
|
|
3693
|
+
};
|
|
3694
|
+
return /*#__PURE__*/React__default['default'].createElement("div", null, ['all', 'EXPRESS_COMPANY'].includes(showField) ? LogisticsCompany() : null, LogisticsCode(), ['all', 'EXPRESS_SNAPSHOT'].includes(showField) ? LogisticsSnapshot() : null);
|
|
3695
|
+
};
|
|
3696
|
+
|
|
3629
3697
|
var jstGoods = function jstGoods(props) {
|
|
3630
3698
|
var _value$changeIndex, _value$changeIndex2, _value$changeIndex3, _value$changeIndex4, _value$changeIndex5, _value$changeIndex6;
|
|
3631
3699
|
var _props$value = props.value,
|
|
@@ -3840,19 +3908,14 @@ var columns = [{
|
|
|
3840
3908
|
var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
3841
3909
|
React.useImperativeHandle(ref, function () {
|
|
3842
3910
|
return {
|
|
3843
|
-
open: function open(
|
|
3844
|
-
var list = _ref.list;
|
|
3911
|
+
open: function open() {
|
|
3845
3912
|
setVisible(true);
|
|
3846
|
-
setSelect(
|
|
3847
|
-
|
|
3848
|
-
return item.numIid;
|
|
3849
|
-
});
|
|
3850
|
-
setSelectIds(ids);
|
|
3913
|
+
setSelect([]);
|
|
3914
|
+
setSelectIds([]);
|
|
3851
3915
|
}
|
|
3852
3916
|
};
|
|
3853
3917
|
});
|
|
3854
3918
|
var onSubmit = props.onSubmit,
|
|
3855
|
-
_onCancel = props.onCancel,
|
|
3856
3919
|
shopId = props.shopId,
|
|
3857
3920
|
shopList = props.shopList,
|
|
3858
3921
|
width = props.width;
|
|
@@ -3903,10 +3966,9 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
3903
3966
|
var _useState17 = React.useState([{
|
|
3904
3967
|
tab: '所选商品',
|
|
3905
3968
|
key: 'onSale'
|
|
3906
|
-
}
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
}]),
|
|
3969
|
+
}
|
|
3970
|
+
// { tab: '已选商品', key: 'select' },
|
|
3971
|
+
]),
|
|
3910
3972
|
_useState18 = _slicedToArray(_useState17, 1),
|
|
3911
3973
|
tabs = _useState18[0];
|
|
3912
3974
|
//选择页码
|
|
@@ -3977,8 +4039,8 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
3977
4039
|
* 查询商品
|
|
3978
4040
|
*/
|
|
3979
4041
|
var queryItems = /*#__PURE__*/function () {
|
|
3980
|
-
var
|
|
3981
|
-
var res,
|
|
4042
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(platform) {
|
|
4043
|
+
var res, _ref2, items, totalCount;
|
|
3982
4044
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
3983
4045
|
while (1) switch (_context.prev = _context.next) {
|
|
3984
4046
|
case 0:
|
|
@@ -3991,10 +4053,10 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
3991
4053
|
});
|
|
3992
4054
|
case 4:
|
|
3993
4055
|
res = _context.sent;
|
|
3994
|
-
|
|
4056
|
+
_ref2 = res.data || {
|
|
3995
4057
|
items: [],
|
|
3996
4058
|
totalCount: 0
|
|
3997
|
-
}, items =
|
|
4059
|
+
}, items = _ref2.items, totalCount = _ref2.totalCount;
|
|
3998
4060
|
items.forEach(function (item) {
|
|
3999
4061
|
item.platform = platform;
|
|
4000
4062
|
item.key = item.numIid;
|
|
@@ -4012,7 +4074,7 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
4012
4074
|
}, _callee, null, [[0,, 9, 12]]);
|
|
4013
4075
|
}));
|
|
4014
4076
|
return function queryItems(_x) {
|
|
4015
|
-
return
|
|
4077
|
+
return _ref.apply(this, arguments);
|
|
4016
4078
|
};
|
|
4017
4079
|
}();
|
|
4018
4080
|
var getItem = function getItem(searchParams, platform) {
|
|
@@ -4036,7 +4098,6 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
4036
4098
|
}, [searchParams, platform]);
|
|
4037
4099
|
var rowSelection = {
|
|
4038
4100
|
selectedRowKeys: selectIds,
|
|
4039
|
-
// type: 'radio',
|
|
4040
4101
|
onChange: function onChange(selectedRowKeys, selectedRows, info) {
|
|
4041
4102
|
console.log(selectedRowKeys, selectedRows, info);
|
|
4042
4103
|
setSelectIds(selectedRowKeys);
|
|
@@ -4049,6 +4110,13 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
4049
4110
|
// },
|
|
4050
4111
|
};
|
|
4051
4112
|
|
|
4113
|
+
var _onCancel = function onCancel() {
|
|
4114
|
+
setVisible(false);
|
|
4115
|
+
};
|
|
4116
|
+
var onOk = function onOk() {
|
|
4117
|
+
onSubmit(selectList);
|
|
4118
|
+
_onCancel();
|
|
4119
|
+
};
|
|
4052
4120
|
return /*#__PURE__*/React__default['default'].createElement(antd.Modal, {
|
|
4053
4121
|
title: '选择商品编码',
|
|
4054
4122
|
okText: '确认',
|
|
@@ -4058,9 +4126,7 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
4058
4126
|
onCancel: function onCancel() {
|
|
4059
4127
|
_onCancel();
|
|
4060
4128
|
},
|
|
4061
|
-
onOk:
|
|
4062
|
-
onSubmit(selectList);
|
|
4063
|
-
},
|
|
4129
|
+
onOk: onOk,
|
|
4064
4130
|
wrapClassName: "goodModal"
|
|
4065
4131
|
}, /*#__PURE__*/React__default['default'].createElement(antd.Tabs, {
|
|
4066
4132
|
type: "card",
|
|
@@ -4115,18 +4181,16 @@ var GoodsModal$2 = /*#__PURE__*/React.forwardRef(GoodsModal$1);
|
|
|
4115
4181
|
|
|
4116
4182
|
// interface GoodsItem {
|
|
4117
4183
|
// title: string;
|
|
4118
|
-
//
|
|
4184
|
+
// pic: string;
|
|
4119
4185
|
// platform: string;
|
|
4120
4186
|
// skuId: string;
|
|
4121
4187
|
// styleId: string;
|
|
4122
4188
|
// }
|
|
4123
|
-
var
|
|
4189
|
+
var GoodItem = function GoodItem(props) {
|
|
4124
4190
|
var _props$value = props.value,
|
|
4125
4191
|
value = _props$value === void 0 ? [] : _props$value,
|
|
4126
4192
|
onChange = props.onChange,
|
|
4127
4193
|
disabled = props.disabled,
|
|
4128
|
-
_props$type = props.type,
|
|
4129
|
-
type = _props$type === void 0 ? 1 : _props$type,
|
|
4130
4194
|
_props$showField = props.showField,
|
|
4131
4195
|
showField = _props$showField === void 0 ? [] : _props$showField,
|
|
4132
4196
|
width = props.width,
|
|
@@ -4135,64 +4199,98 @@ var BsGoods = function BsGoods(props) {
|
|
|
4135
4199
|
_props$shopId = props.shopId,
|
|
4136
4200
|
shopId = _props$shopId === void 0 ? '' : _props$shopId,
|
|
4137
4201
|
_props$maxLength = props.maxLength,
|
|
4138
|
-
maxLength = _props$maxLength === void 0 ? 20 : _props$maxLength
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4202
|
+
maxLength = _props$maxLength === void 0 ? 20 : _props$maxLength,
|
|
4203
|
+
_props$showChangeBtn = props.showChangeBtn,
|
|
4204
|
+
showChangeBtn = _props$showChangeBtn === void 0 ? true : _props$showChangeBtn,
|
|
4205
|
+
_props$tableSelect = props.tableSelect,
|
|
4206
|
+
tableSelect = _props$tableSelect === void 0 ? false : _props$tableSelect,
|
|
4207
|
+
_props$otherOperation = props.otherOperations,
|
|
4208
|
+
otherOperations = _props$otherOperation === void 0 ? null : _props$otherOperation,
|
|
4209
|
+
_props$canUpdateNumbe = props.canUpdateNumber,
|
|
4210
|
+
canUpdateNumber = _props$canUpdateNumbe === void 0 ? false : _props$canUpdateNumbe,
|
|
4211
|
+
onSelect = props.onSelect;
|
|
4212
|
+
var refModal = React.useRef();
|
|
4213
|
+
var handleDelete = function handleDelete(index) {
|
|
4214
|
+
var newList = value.filter(function (item, i) {
|
|
4215
|
+
return index !== i;
|
|
4146
4216
|
});
|
|
4147
4217
|
onChange === null || onChange === void 0 ? void 0 : onChange(newList);
|
|
4148
4218
|
};
|
|
4219
|
+
var _useState = React.useState([]),
|
|
4220
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
4221
|
+
selectedRowKeys = _useState2[0],
|
|
4222
|
+
setSelectedRowKeys = _useState2[1];
|
|
4223
|
+
var updateHandle = function updateHandle(val, index, type) {
|
|
4224
|
+
value[index][type] = val;
|
|
4225
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(_toConsumableArray(value));
|
|
4226
|
+
};
|
|
4149
4227
|
//商品信息
|
|
4150
|
-
var GOODS_INFO_COLUMNS = function GOODS_INFO_COLUMNS(
|
|
4228
|
+
var GOODS_INFO_COLUMNS = function GOODS_INFO_COLUMNS() {
|
|
4151
4229
|
return [{
|
|
4152
|
-
dataIndex: '
|
|
4153
|
-
title: "bs
|
|
4154
|
-
|
|
4155
|
-
return /*#__PURE__*/React__default['default'].createElement(antd.Image, {
|
|
4156
|
-
width: 60,
|
|
4157
|
-
src: val
|
|
4158
|
-
});
|
|
4159
|
-
}
|
|
4160
|
-
}, {
|
|
4161
|
-
dataIndex: 'title',
|
|
4162
|
-
title: "bs".concat(text, "\u540D\u79F0")
|
|
4230
|
+
dataIndex: 'name',
|
|
4231
|
+
title: "bs\u540D\u79F0",
|
|
4232
|
+
width: 200
|
|
4163
4233
|
}, {
|
|
4164
|
-
dataIndex: '
|
|
4165
|
-
title: "bs
|
|
4234
|
+
dataIndex: 'code',
|
|
4235
|
+
title: "bs\u7F16\u7801",
|
|
4236
|
+
width: 200
|
|
4166
4237
|
}, {
|
|
4167
4238
|
dataIndex: 'skuId',
|
|
4168
|
-
title: "
|
|
4239
|
+
title: "bssku\u7F16\u7801",
|
|
4240
|
+
width: 200
|
|
4169
4241
|
}, {
|
|
4170
4242
|
dataIndex: 'money',
|
|
4171
|
-
title: "bs
|
|
4243
|
+
title: "bs\u5B9E\u4ED8\u91D1\u989D",
|
|
4244
|
+
width: 200
|
|
4172
4245
|
}, {
|
|
4173
4246
|
dataIndex: 'number',
|
|
4174
|
-
title: "bs
|
|
4247
|
+
title: "bs\u6570\u91CF",
|
|
4248
|
+
width: 200,
|
|
4249
|
+
render: function render(val, record, index) {
|
|
4250
|
+
return canUpdateNumber ? /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, {
|
|
4251
|
+
value: val,
|
|
4252
|
+
onChange: function onChange(num) {
|
|
4253
|
+
return updateHandle(num, index, 'number');
|
|
4254
|
+
}
|
|
4255
|
+
}) : /*#__PURE__*/React__default['default'].createElement("span", null, val);
|
|
4256
|
+
}
|
|
4175
4257
|
}, {
|
|
4258
|
+
dataIndex: 'share',
|
|
4259
|
+
title: "bs\u5206\u644A\u4EF7",
|
|
4260
|
+
width: 200
|
|
4261
|
+
}, {
|
|
4262
|
+
dataIndex: 'type',
|
|
4263
|
+
title: "bs\u8D60\u54C1\u7C7B\u578B",
|
|
4264
|
+
width: 200
|
|
4265
|
+
}];
|
|
4266
|
+
};
|
|
4267
|
+
var newColumns = React.useMemo(function () {
|
|
4268
|
+
return [{
|
|
4269
|
+
dataIndex: 'pic',
|
|
4270
|
+
title: "bs\u56FE\u7247",
|
|
4271
|
+
width: 200,
|
|
4272
|
+
render: function render(val) {
|
|
4273
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Image, {
|
|
4274
|
+
width: 60,
|
|
4275
|
+
src: val
|
|
4276
|
+
});
|
|
4277
|
+
}
|
|
4278
|
+
}].concat(_toConsumableArray(GOODS_INFO_COLUMNS().filter(function (t) {
|
|
4279
|
+
return showField.includes(t === null || t === void 0 ? void 0 : t.dataIndex);
|
|
4280
|
+
})), [{
|
|
4176
4281
|
dataIndex: '',
|
|
4177
4282
|
title: "\u64CD\u4F5C",
|
|
4178
|
-
render: function render(val, record) {
|
|
4179
|
-
return /*#__PURE__*/React__default['default'].createElement(antd.Button, {
|
|
4283
|
+
render: function render(val, record, index) {
|
|
4284
|
+
return record.canDelete ? /*#__PURE__*/React__default['default'].createElement(antd.Button, {
|
|
4180
4285
|
type: "link",
|
|
4181
4286
|
onClick: function onClick() {
|
|
4182
|
-
return handleDelete(
|
|
4287
|
+
return handleDelete(index);
|
|
4183
4288
|
}
|
|
4184
|
-
}, "\u5220\u9664");
|
|
4289
|
+
}, "\u5220\u9664") : null;
|
|
4185
4290
|
}
|
|
4186
|
-
}];
|
|
4187
|
-
};
|
|
4188
|
-
var newColumns = React.useMemo(function () {
|
|
4189
|
-
return GOODS_INFO_COLUMNS('商品').filter(function (t) {
|
|
4190
|
-
return showField.includes(t === null || t === void 0 ? void 0 : t.dataIndex);
|
|
4191
|
-
});
|
|
4291
|
+
}]);
|
|
4192
4292
|
}, [showField]);
|
|
4193
|
-
console.log(newColumns);
|
|
4194
4293
|
var onSubmit = function onSubmit(list) {
|
|
4195
|
-
console.log(list);
|
|
4196
4294
|
var newList = list.map(function (item) {
|
|
4197
4295
|
var picUrl = item.picUrl,
|
|
4198
4296
|
numIid = item.numIid,
|
|
@@ -4201,39 +4299,214 @@ var BsGoods = function BsGoods(props) {
|
|
|
4201
4299
|
price = item.price,
|
|
4202
4300
|
platform = item.platform;
|
|
4203
4301
|
return {
|
|
4204
|
-
|
|
4302
|
+
pic: picUrl,
|
|
4205
4303
|
numIid: numIid,
|
|
4206
4304
|
outerId: outerId,
|
|
4207
4305
|
title: title,
|
|
4208
4306
|
price: price,
|
|
4209
|
-
platform: platform
|
|
4307
|
+
platform: platform,
|
|
4308
|
+
number: 10,
|
|
4309
|
+
canDelete: true
|
|
4210
4310
|
};
|
|
4211
4311
|
});
|
|
4212
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(newList);
|
|
4213
|
-
|
|
4312
|
+
onChange === null || onChange === void 0 ? void 0 : onChange([].concat(_toConsumableArray(value), _toConsumableArray(newList)));
|
|
4313
|
+
};
|
|
4314
|
+
var onSelectChange = function onSelectChange(newSelectedRowKeys) {
|
|
4315
|
+
setSelectedRowKeys(newSelectedRowKeys);
|
|
4316
|
+
onSelect === null || onSelect === void 0 ? void 0 : onSelect(value.filter(function (t) {
|
|
4317
|
+
return newSelectedRowKeys.includes(t);
|
|
4318
|
+
}));
|
|
4214
4319
|
};
|
|
4215
4320
|
var handleChangeGoods = function handleChangeGoods() {
|
|
4216
|
-
|
|
4321
|
+
refModal.current.open();
|
|
4217
4322
|
};
|
|
4218
|
-
|
|
4323
|
+
var rowSelection = {
|
|
4324
|
+
selectedRowKeys: selectedRowKeys,
|
|
4325
|
+
onChange: onSelectChange
|
|
4326
|
+
};
|
|
4327
|
+
var tableConfig = React.useMemo(function () {
|
|
4328
|
+
var params = {
|
|
4329
|
+
columns: newColumns,
|
|
4330
|
+
dataSource: value
|
|
4331
|
+
};
|
|
4332
|
+
if (tableSelect) {
|
|
4333
|
+
params.rowSelection = rowSelection;
|
|
4334
|
+
}
|
|
4335
|
+
return params;
|
|
4336
|
+
}, [tableSelect, newColumns, value]);
|
|
4337
|
+
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, !disabled && showChangeBtn && /*#__PURE__*/React__default['default'].createElement(antd.Space, {
|
|
4338
|
+
align: "end"
|
|
4339
|
+
}, /*#__PURE__*/React__default['default'].createElement(antd.Button, {
|
|
4219
4340
|
type: "link",
|
|
4220
4341
|
onClick: handleChangeGoods
|
|
4221
|
-
}, "\u9009\u62E9\u5546\u54C1"), /*#__PURE__*/React__default['default'].createElement(
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4342
|
+
}, "\u9009\u62E9\u5546\u54C1"), otherOperations), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
4343
|
+
style: {
|
|
4344
|
+
width: '100%',
|
|
4345
|
+
overflowX: 'auto'
|
|
4346
|
+
}
|
|
4347
|
+
}, /*#__PURE__*/React__default['default'].createElement(antd.Table, _objectSpread2(_objectSpread2({}, tableConfig), {}, {
|
|
4348
|
+
pagination: false
|
|
4349
|
+
}))), /*#__PURE__*/React__default['default'].createElement(GoodsModal$2, {
|
|
4350
|
+
ref: refModal,
|
|
4225
4351
|
onSubmit: onSubmit,
|
|
4226
4352
|
width: width,
|
|
4227
|
-
type: type,
|
|
4228
4353
|
shopList: shopList,
|
|
4229
4354
|
shopId: shopId,
|
|
4230
|
-
maxLength: maxLength
|
|
4231
|
-
onCancel: function onCancel() {
|
|
4232
|
-
setVisible(false);
|
|
4233
|
-
}
|
|
4355
|
+
maxLength: maxLength
|
|
4234
4356
|
}));
|
|
4235
4357
|
};
|
|
4236
4358
|
|
|
4359
|
+
var BsGoods = function BsGoods(props) {
|
|
4360
|
+
var value = props.value;
|
|
4361
|
+
var _useState = React.useState(false),
|
|
4362
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
4363
|
+
tableSelect = _useState2[0],
|
|
4364
|
+
setTableSelect = _useState2[1];
|
|
4365
|
+
var ref = React.useRef();
|
|
4366
|
+
React.useEffect(function () {
|
|
4367
|
+
ref.current = pubsub__default['default'].subscribe('type', function (_, val) {
|
|
4368
|
+
setTableSelect(['2', '4'].includes(val));
|
|
4369
|
+
if (['1', '3'].includes(val)) {
|
|
4370
|
+
pubsub__default['default'].publish('selectList', {
|
|
4371
|
+
type: val,
|
|
4372
|
+
list: _toConsumableArray(value).map(function (item) {
|
|
4373
|
+
item.canDelete = false;
|
|
4374
|
+
})
|
|
4375
|
+
});
|
|
4376
|
+
}
|
|
4377
|
+
});
|
|
4378
|
+
return function () {
|
|
4379
|
+
pubsub__default['default'].unsubscribe(ref.current);
|
|
4380
|
+
};
|
|
4381
|
+
}, []);
|
|
4382
|
+
var onSelect = function onSelect(list) {
|
|
4383
|
+
pubsub__default['default'].publish('selectList', list.map(function (item) {
|
|
4384
|
+
item.canDelete = true;
|
|
4385
|
+
}));
|
|
4386
|
+
};
|
|
4387
|
+
return /*#__PURE__*/React__default['default'].createElement(GoodItem, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
4388
|
+
tableSelect: tableSelect,
|
|
4389
|
+
onSelect: onSelect
|
|
4390
|
+
}));
|
|
4391
|
+
};
|
|
4392
|
+
|
|
4393
|
+
var _excluded$b = ["value", "onChange", "reasonList", "disabled"];
|
|
4394
|
+
var BsExchange = function BsExchange(props) {
|
|
4395
|
+
var _value$bsExchangeType2, _value$bsExchangeType3;
|
|
4396
|
+
var value = props.value,
|
|
4397
|
+
onChange = props.onChange,
|
|
4398
|
+
_props$reasonList = props.reasonList,
|
|
4399
|
+
reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
|
|
4400
|
+
disabled = props.disabled,
|
|
4401
|
+
other = _objectWithoutProperties(props, _excluded$b);
|
|
4402
|
+
React.useEffect(function () {
|
|
4403
|
+
pubsub__default['default'].subscribe('selectList', function (_, list) {
|
|
4404
|
+
onChange(_objectSpread2(_objectSpread2({}, value), {}, {
|
|
4405
|
+
bsExchangeReturnGoods: list
|
|
4406
|
+
}));
|
|
4407
|
+
});
|
|
4408
|
+
}, []);
|
|
4409
|
+
var changeHandle = function changeHandle(val, key) {
|
|
4410
|
+
var newValue = _objectSpread2({}, value);
|
|
4411
|
+
newValue[key] = val;
|
|
4412
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
4413
|
+
if (key === 'bsExchangeType') {
|
|
4414
|
+
console.log(val);
|
|
4415
|
+
pubsub__default['default'].publish('type', val[0]);
|
|
4416
|
+
}
|
|
4417
|
+
};
|
|
4418
|
+
//显示选择商品按钮 原单换不显示选择商品
|
|
4419
|
+
var showChangeBtn = React.useMemo(function () {
|
|
4420
|
+
var _value$bsExchangeType;
|
|
4421
|
+
return ['2', '4'].includes(value === null || value === void 0 ? void 0 : (_value$bsExchangeType = value.bsExchangeType) === null || _value$bsExchangeType === void 0 ? void 0 : _value$bsExchangeType[0]) || disabled;
|
|
4422
|
+
}, [value === null || value === void 0 ? void 0 : value.bsExchangeType]);
|
|
4423
|
+
var copyGoods = function copyGoods() {
|
|
4424
|
+
var copyHandle = function copyHandle() {
|
|
4425
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, {
|
|
4426
|
+
bsExchangeSwapOutGoods: [].concat(_toConsumableArray((value === null || value === void 0 ? void 0 : value.bsExchangeSwapOutGoods) || []), _toConsumableArray((value === null || value === void 0 ? void 0 : value.bsExchangeReturnGoods) || []))
|
|
4427
|
+
}));
|
|
4428
|
+
};
|
|
4429
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Button, {
|
|
4430
|
+
type: "link",
|
|
4431
|
+
onClick: copyHandle
|
|
4432
|
+
}, "\u590D\u5236\u9000\u56DE\u5546\u54C1");
|
|
4433
|
+
};
|
|
4434
|
+
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(antd.Cascader, {
|
|
4435
|
+
options: reasonList,
|
|
4436
|
+
value: value === null || value === void 0 ? void 0 : value.bsExchangeType,
|
|
4437
|
+
onChange: function onChange(val) {
|
|
4438
|
+
return changeHandle(val, 'bsExchangeType');
|
|
4439
|
+
}
|
|
4440
|
+
}), /*#__PURE__*/React__default['default'].createElement("p", null, "\u9000\u56DE\u5546\u54C1"), /*#__PURE__*/React__default['default'].createElement(GoodItem, _objectSpread2(_objectSpread2({}, other), {}, {
|
|
4441
|
+
disabled: disabled,
|
|
4442
|
+
showChangeBtn: showChangeBtn,
|
|
4443
|
+
value: value === null || value === void 0 ? void 0 : value.bsExchangeReturnGoods,
|
|
4444
|
+
onChange: function onChange(val) {
|
|
4445
|
+
return changeHandle(val, 'bsExchangeReturnGoods');
|
|
4446
|
+
}
|
|
4447
|
+
})), /*#__PURE__*/React__default['default'].createElement("p", null, "\u6362\u51FA\u5546\u54C1"), /*#__PURE__*/React__default['default'].createElement(GoodItem, _objectSpread2(_objectSpread2({}, other), {}, {
|
|
4448
|
+
disabled: disabled,
|
|
4449
|
+
otherOperations: ['2', '4'].includes(value === null || value === void 0 ? void 0 : (_value$bsExchangeType2 = value.bsExchangeType) === null || _value$bsExchangeType2 === void 0 ? void 0 : _value$bsExchangeType2[0]) ? copyGoods() : null,
|
|
4450
|
+
value: value === null || value === void 0 ? void 0 : value.bsExchangeSwapOutGoods,
|
|
4451
|
+
onChange: function onChange(val) {
|
|
4452
|
+
return changeHandle(val, 'bsExchangeSwapOutGoods');
|
|
4453
|
+
}
|
|
4454
|
+
})), ['3', '4'].includes(value === null || value === void 0 ? void 0 : (_value$bsExchangeType3 = value.bsExchangeType) === null || _value$bsExchangeType3 === void 0 ? void 0 : _value$bsExchangeType3[0]) ? /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("p", null, "\u8D60\u54C1\u4FE1\u606F"), /*#__PURE__*/React__default['default'].createElement(GoodItem, _objectSpread2(_objectSpread2({
|
|
4455
|
+
disabled: disabled
|
|
4456
|
+
}, other), {}, {
|
|
4457
|
+
value: value === null || value === void 0 ? void 0 : value.bsExchangeGiftGoods,
|
|
4458
|
+
onChange: function onChange(val) {
|
|
4459
|
+
return changeHandle(val, 'bsExchangeGiftGoods');
|
|
4460
|
+
}
|
|
4461
|
+
}))) : null);
|
|
4462
|
+
};
|
|
4463
|
+
|
|
4464
|
+
var _excluded$c = ["value", "onChange", "reasonList"];
|
|
4465
|
+
var BsReissue = function BsReissue(props) {
|
|
4466
|
+
var value = props.value,
|
|
4467
|
+
onChange = props.onChange,
|
|
4468
|
+
_props$reasonList = props.reasonList,
|
|
4469
|
+
reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
|
|
4470
|
+
other = _objectWithoutProperties(props, _excluded$c);
|
|
4471
|
+
React.useEffect(function () {
|
|
4472
|
+
pubsub__default['default'].subscribe('selectList', function (_, list) {
|
|
4473
|
+
onChange(_objectSpread2(_objectSpread2({}, value), {}, {
|
|
4474
|
+
bsReissueGoods: list.map(function (item) {
|
|
4475
|
+
item.money = 0;
|
|
4476
|
+
return item;
|
|
4477
|
+
})
|
|
4478
|
+
}));
|
|
4479
|
+
});
|
|
4480
|
+
}, []);
|
|
4481
|
+
var changeHandle = function changeHandle(val, key) {
|
|
4482
|
+
var newValue = _objectSpread2({}, value);
|
|
4483
|
+
newValue[key] = val;
|
|
4484
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
4485
|
+
if (key === 'bsReissueType') {
|
|
4486
|
+
pubsub__default['default'].publish('type', val);
|
|
4487
|
+
}
|
|
4488
|
+
};
|
|
4489
|
+
//显示选择商品按钮 原单换不显示选择商品
|
|
4490
|
+
var showChangeBtn = React.useMemo(function () {
|
|
4491
|
+
var _value$bsReissueType;
|
|
4492
|
+
return ['2', '4'].includes(value === null || value === void 0 ? void 0 : (_value$bsReissueType = value.bsReissueType) === null || _value$bsReissueType === void 0 ? void 0 : _value$bsReissueType[0]);
|
|
4493
|
+
}, [value === null || value === void 0 ? void 0 : value.bsReissueType]);
|
|
4494
|
+
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(antd.Cascader, {
|
|
4495
|
+
options: reasonList,
|
|
4496
|
+
value: value === null || value === void 0 ? void 0 : value.bsReissueType,
|
|
4497
|
+
onChange: function onChange(val) {
|
|
4498
|
+
return changeHandle(val, 'bsReissueType');
|
|
4499
|
+
}
|
|
4500
|
+
}), /*#__PURE__*/React__default['default'].createElement("p", null, "\u9000\u56DE\u5546\u54C1"), /*#__PURE__*/React__default['default'].createElement(GoodItem, _objectSpread2(_objectSpread2({}, other), {}, {
|
|
4501
|
+
canUpdateNumber: true,
|
|
4502
|
+
showChangeBtn: showChangeBtn,
|
|
4503
|
+
value: value === null || value === void 0 ? void 0 : value.bsReissueGoods,
|
|
4504
|
+
onChange: function onChange(val) {
|
|
4505
|
+
return changeHandle(val, 'bsReissueGoods');
|
|
4506
|
+
}
|
|
4507
|
+
})));
|
|
4508
|
+
};
|
|
4509
|
+
|
|
4237
4510
|
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";
|
|
4238
4511
|
styleInject(css_248z$9);
|
|
4239
4512
|
|
|
@@ -4729,7 +5002,9 @@ exports.ApaasTextArea = ApaasTextArea;
|
|
|
4729
5002
|
exports.ApaasUpload = ApaasUpload;
|
|
4730
5003
|
exports.ApaasUploadAsync = ApaasUploadAsync;
|
|
4731
5004
|
exports.ApaasUploadFile = ApaasUploadAsync$1;
|
|
5005
|
+
exports.BsExchange = BsExchange;
|
|
4732
5006
|
exports.BsGoods = BsGoods;
|
|
5007
|
+
exports.BsReissue = BsReissue;
|
|
4733
5008
|
exports.BuyerNick = BuyerNick;
|
|
4734
5009
|
exports.ChooseBaby = ChooseBaby;
|
|
4735
5010
|
exports.ExpressLogistics = ExpressLogistics;
|
|
@@ -4740,6 +5015,7 @@ exports.Invoice = Invoice;
|
|
|
4740
5015
|
exports.JstGoods = jstGoods;
|
|
4741
5016
|
exports.JstItemList = ItemList;
|
|
4742
5017
|
exports.LogisticsInterception = LogisticsInterception;
|
|
5018
|
+
exports.LogisticsTrajectory = LogisticsTrajectory;
|
|
4743
5019
|
exports.ParseLogistics = ParseLogistics;
|
|
4744
5020
|
exports.Payment = Payment;
|
|
4745
5021
|
exports.Remark = RemarkInput;
|
|
@@ -1,15 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
value: any[];
|
|
4
|
-
type: number;
|
|
5
|
-
options: any[];
|
|
6
|
-
disabled: boolean;
|
|
7
|
-
onChange: (val: any[]) => void;
|
|
8
|
-
showField: string[];
|
|
9
|
-
width?: number;
|
|
10
|
-
shopList: any[];
|
|
11
|
-
shopId: string | number;
|
|
12
|
-
maxLength: number;
|
|
13
|
-
}
|
|
14
|
-
declare const BsGoods: (props: Partial<BsGoodsProps>) => React.JSX.Element;
|
|
2
|
+
declare const BsGoods: (props: any) => React.JSX.Element;
|
|
15
3
|
export default BsGoods;
|