@bit-sun/business-component 2.2.9 → 2.2.10
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/components/Business/AddSelectBusiness/index.d.ts +1 -0
- package/dist/index.esm.js +551 -27
- package/dist/index.js +551 -26
- package/package.json +1 -1
- package/src/components/Business/AddSelectBusiness/index.md +33 -3
- package/src/components/Business/AddSelectBusiness/index.tsx +260 -3
- package/src/components/Business/CommodityEntry/index.md +1 -1
- package/src/components/Business/SearchSelect/BusinessUtils.ts +137 -0
- package/src/components/Business/SearchSelect/index.md +56 -0
- package/src/components/Business/SearchSelect/utils.ts +1 -1
- package/src/components/Functional/AddSelect/index.tsx +117 -24
- package/src/utils/requestUtils.ts +2 -0
package/dist/index.js
CHANGED
|
@@ -105,7 +105,10 @@ function handleRequestAuthHeader(config) {
|
|
|
105
105
|
}
|
|
106
106
|
// 处理请求头
|
|
107
107
|
var handleRequestHeader = function handleRequestHeader(config) {
|
|
108
|
+
var _resposne$accountPers, _resposne$employeeRes;
|
|
108
109
|
config.headers['sso-sessionid'] = (resposne === null || resposne === void 0 ? void 0 : resposne.sessionId) || '';
|
|
110
|
+
config.headers['x-account-id'] = (resposne === null || resposne === void 0 ? void 0 : (_resposne$accountPers = resposne.accountPersonDetail) === null || _resposne$accountPers === void 0 ? void 0 : _resposne$accountPers.accountId) || -1;
|
|
111
|
+
config.headers['x-employee-id'] = (resposne === null || resposne === void 0 ? void 0 : (_resposne$employeeRes = resposne.employeeResVo) === null || _resposne$employeeRes === void 0 ? void 0 : _resposne$employeeRes.id) || 2;
|
|
109
112
|
config.headers['x-tenant-id'] = getCurrentTenantId() || 1;
|
|
110
113
|
if (localStorage.getItem('x-user-auth-context')) {
|
|
111
114
|
config.headers['x-user-auth-context'] = localStorage.getItem('x-user-auth-context');
|
|
@@ -9910,7 +9913,11 @@ var AddSelect = function AddSelect(props) {
|
|
|
9910
9913
|
buttonProps = _props$buttonProps === void 0 ? {} : _props$buttonProps,
|
|
9911
9914
|
beforeShowModal = props.beforeShowModal,
|
|
9912
9915
|
_props$tableCodeList = props.tableCodeList,
|
|
9913
|
-
tableCodeList = _props$tableCodeList === void 0 ? [] : _props$tableCodeList
|
|
9916
|
+
tableCodeList = _props$tableCodeList === void 0 ? [] : _props$tableCodeList,
|
|
9917
|
+
_props$businessType = props.businessType,
|
|
9918
|
+
businessType = _props$businessType === void 0 ? 'sku' : _props$businessType,
|
|
9919
|
+
_props$isAllowRepeate = props.isAllowRepeatedSelect,
|
|
9920
|
+
isAllowRepeatedSelect = _props$isAllowRepeate === void 0 ? false : _props$isAllowRepeate;
|
|
9914
9921
|
var _ref = requestConfig || {},
|
|
9915
9922
|
url = _ref.url,
|
|
9916
9923
|
otherParams = _ref.otherParams,
|
|
@@ -9927,6 +9934,7 @@ var AddSelect = function AddSelect(props) {
|
|
|
9927
9934
|
var realButtonProps = _objectSpread2({
|
|
9928
9935
|
type: "primary"
|
|
9929
9936
|
}, buttonProps);
|
|
9937
|
+
var selectRowKey = isAllowRepeatedSelect ? 'uuid' : mappingValueField;
|
|
9930
9938
|
var selectMode = selectProps === null || selectProps === void 0 ? void 0 : selectProps.mode; // 设定当前选择器 为单选或者多选模式 无设定为单选模式(默认)
|
|
9931
9939
|
var initVal = value || (selectMode ? [] : null);
|
|
9932
9940
|
var pageSize = 100; // 下拉框默认分页 条数
|
|
@@ -10078,7 +10086,9 @@ var AddSelect = function AddSelect(props) {
|
|
|
10078
10086
|
var _record$packingUnitLi, _record$packingUnitLi2;
|
|
10079
10087
|
// let
|
|
10080
10088
|
if (record.needFocus === true && currentIndex === 0) ;
|
|
10081
|
-
var precisionObj = {
|
|
10089
|
+
var precisionObj = businessType == 'skc' ? {
|
|
10090
|
+
precision: 0
|
|
10091
|
+
} : {};
|
|
10082
10092
|
var unitAccuracy = (_record$packingUnitLi = record.packingUnitList) === null || _record$packingUnitLi === void 0 ? void 0 : (_record$packingUnitLi2 = _record$packingUnitLi[0]) === null || _record$packingUnitLi2 === void 0 ? void 0 : _record$packingUnitLi2.unitAccuracy;
|
|
10083
10093
|
var isCountUnitAccuracyCheck = item.dataIndex == 'count' && unitAccuracy !== undefined;
|
|
10084
10094
|
if (isCountUnitAccuracyCheck) {
|
|
@@ -10202,6 +10212,53 @@ var AddSelect = function AddSelect(props) {
|
|
|
10202
10212
|
}
|
|
10203
10213
|
});
|
|
10204
10214
|
}
|
|
10215
|
+
var selectLength = modalTableProps.selectColumn.filter(function (item) {
|
|
10216
|
+
return item.isSelectItem;
|
|
10217
|
+
}).length;
|
|
10218
|
+
if (item.isSelectItem) {
|
|
10219
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
10220
|
+
render: function render(text, record, index) {
|
|
10221
|
+
var _item$dataSource;
|
|
10222
|
+
if ((_item$dataSource = item.dataSource) === null || _item$dataSource === void 0 ? void 0 : _item$dataSource.length) {
|
|
10223
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Select, {
|
|
10224
|
+
value: text || null,
|
|
10225
|
+
onChange: function onChange(value) {
|
|
10226
|
+
if (businessType == 'skc' && popvalue.some(function (i) {
|
|
10227
|
+
return i.code == record.code && i[item.dataIndex] == value;
|
|
10228
|
+
})) {
|
|
10229
|
+
antd.message.warning('相同skc配码不可设置相同哦');
|
|
10230
|
+
record[item.dataIndex] = null;
|
|
10231
|
+
var _newPopValue = popvalue.map(function (i, innerIndex) {
|
|
10232
|
+
if (innerIndex == index) {
|
|
10233
|
+
i[item.dataIndex] = record[item.dataIndex];
|
|
10234
|
+
}
|
|
10235
|
+
return i;
|
|
10236
|
+
});
|
|
10237
|
+
setPopValue(_newPopValue);
|
|
10238
|
+
return false;
|
|
10239
|
+
}
|
|
10240
|
+
record[item.dataIndex] = value;
|
|
10241
|
+
var newPopValue = popvalue.map(function (i, innerIndex) {
|
|
10242
|
+
if (innerIndex == index) {
|
|
10243
|
+
i[item.dataIndex] = record[item.dataIndex];
|
|
10244
|
+
}
|
|
10245
|
+
return i;
|
|
10246
|
+
});
|
|
10247
|
+
setPopValue(newPopValue);
|
|
10248
|
+
},
|
|
10249
|
+
style: {
|
|
10250
|
+
width: '160px'
|
|
10251
|
+
}
|
|
10252
|
+
}, item.dataSource.map(function (item) {
|
|
10253
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Select.Option, {
|
|
10254
|
+
value: item.code
|
|
10255
|
+
}, item.name);
|
|
10256
|
+
}));
|
|
10257
|
+
}
|
|
10258
|
+
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
10259
|
+
}
|
|
10260
|
+
});
|
|
10261
|
+
}
|
|
10205
10262
|
return item;
|
|
10206
10263
|
})), [{
|
|
10207
10264
|
title: '操作',
|
|
@@ -10408,18 +10465,42 @@ var AddSelect = function AddSelect(props) {
|
|
|
10408
10465
|
};
|
|
10409
10466
|
|
|
10410
10467
|
React.useEffect(function () {
|
|
10411
|
-
|
|
10412
|
-
|
|
10413
|
-
|
|
10414
|
-
|
|
10415
|
-
|
|
10416
|
-
|
|
10417
|
-
|
|
10418
|
-
|
|
10419
|
-
|
|
10420
|
-
|
|
10421
|
-
|
|
10422
|
-
|
|
10468
|
+
if (businessType == 'sku') {
|
|
10469
|
+
Promise.all([loadSelectSource("/items/brand/queryBrandList", {
|
|
10470
|
+
pageSize: 5000,
|
|
10471
|
+
currentPage: 1,
|
|
10472
|
+
'ctl-withAuth': true
|
|
10473
|
+
}), loadSelectSource("/items/category/queryCategoryTree", {
|
|
10474
|
+
pageSize: 5000,
|
|
10475
|
+
currentPage: 1
|
|
10476
|
+
})]).then(function (x) {
|
|
10477
|
+
formatSource(x, 0, 2, tableSearchForm, ['id', 'name']);
|
|
10478
|
+
formatTreeDataSource(x, 1, 3, tableSearchForm);
|
|
10479
|
+
});
|
|
10480
|
+
}
|
|
10481
|
+
if (businessType == 'skc') {
|
|
10482
|
+
Promise.all([loadSelectSource("/items/item/propertyValue", {
|
|
10483
|
+
pageSize: 5000,
|
|
10484
|
+
currentPage: 1,
|
|
10485
|
+
'qp-propertyId-eq': '1467042217951883265'
|
|
10486
|
+
}), loadSelectSource("/items/category/queryCategoryTree", {
|
|
10487
|
+
pageSize: 5000,
|
|
10488
|
+
currentPage: 1
|
|
10489
|
+
}), loadSelectSource("/items/class/withProperty", {
|
|
10490
|
+
pageSize: 5000,
|
|
10491
|
+
currentPage: 1
|
|
10492
|
+
}), loadSelectSource("/items/brand/queryBrandList", {
|
|
10493
|
+
pageSize: 5000,
|
|
10494
|
+
currentPage: 1,
|
|
10495
|
+
'ctl-withAuth': true
|
|
10496
|
+
})]).then(function (x) {
|
|
10497
|
+
formatSource(x, 0, 3, tableSearchForm, ['value', 'value']);
|
|
10498
|
+
formatTreeDataSource(x, 1, 4, tableSearchForm);
|
|
10499
|
+
formatSource(x, 2, 5, tableSearchForm, ['id', 'name']);
|
|
10500
|
+
formatSource(x, 3, 6, tableSearchForm, ['id', 'name']);
|
|
10501
|
+
});
|
|
10502
|
+
}
|
|
10503
|
+
}, [businessType]);
|
|
10423
10504
|
React.useEffect(function () {
|
|
10424
10505
|
if (value) {
|
|
10425
10506
|
setPopValue(value);
|
|
@@ -10549,8 +10630,18 @@ var AddSelect = function AddSelect(props) {
|
|
|
10549
10630
|
selectRows[selectedRowKeys.length]['needFocus'] = true;
|
|
10550
10631
|
}
|
|
10551
10632
|
}
|
|
10552
|
-
|
|
10553
|
-
|
|
10633
|
+
if (isAllowRepeatedSelect) {
|
|
10634
|
+
var list = popvalue.concat(selectRows).map(function (i) {
|
|
10635
|
+
return _objectSpread2(_objectSpread2({}, i), {}, {
|
|
10636
|
+
uuid: i.uuid || uuid()
|
|
10637
|
+
});
|
|
10638
|
+
});
|
|
10639
|
+
setPopValue(list);
|
|
10640
|
+
setSelectedRowKeys([]);
|
|
10641
|
+
} else {
|
|
10642
|
+
setPopValue(selectRows);
|
|
10643
|
+
setSelectedRowKeys(selectKeys);
|
|
10644
|
+
}
|
|
10554
10645
|
// setIndeterminate(!!filterRows.length && filterRows.length < tablePagination?.total);
|
|
10555
10646
|
// setCheckedAll(filterRows.length === tablePagination?.total);
|
|
10556
10647
|
};
|
|
@@ -10667,12 +10758,19 @@ var AddSelect = function AddSelect(props) {
|
|
|
10667
10758
|
setSelectedRowKeys([]);
|
|
10668
10759
|
};
|
|
10669
10760
|
var deleteRecord = function deleteRecord(record) {
|
|
10670
|
-
|
|
10671
|
-
|
|
10672
|
-
|
|
10673
|
-
|
|
10674
|
-
|
|
10675
|
-
}
|
|
10761
|
+
if (isAllowRepeatedSelect) {
|
|
10762
|
+
setPopValue(popvalue.filter(function (item) {
|
|
10763
|
+
return item.uuid !== record.uuid;
|
|
10764
|
+
}));
|
|
10765
|
+
setSelectedRowKeys([]);
|
|
10766
|
+
} else {
|
|
10767
|
+
setPopValue(popvalue.filter(function (item) {
|
|
10768
|
+
return item.skuCode !== record.skuCode;
|
|
10769
|
+
}));
|
|
10770
|
+
setSelectedRowKeys(_toConsumableArray(selectedRowKeys.filter(function (item) {
|
|
10771
|
+
return item !== record.skuCode;
|
|
10772
|
+
})));
|
|
10773
|
+
}
|
|
10676
10774
|
};
|
|
10677
10775
|
var inputIndex = 0;
|
|
10678
10776
|
React.useEffect(function () {
|
|
@@ -10744,6 +10842,7 @@ var AddSelect = function AddSelect(props) {
|
|
|
10744
10842
|
handleColumns(showSelectedCol, [], function (res) {
|
|
10745
10843
|
return setShowColumnsCallback(res);
|
|
10746
10844
|
});
|
|
10845
|
+
var selectLength = isAllowRepeatedSelect ? (popvalue === null || popvalue === void 0 ? void 0 : popvalue.length) || 0 : (selectedRowKeys === null || selectedRowKeys === void 0 ? void 0 : selectedRowKeys.length) || 0;
|
|
10747
10846
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
10748
10847
|
className: 'add_select'
|
|
10749
10848
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
@@ -10829,7 +10928,7 @@ var AddSelect = function AddSelect(props) {
|
|
|
10829
10928
|
style: themeColor
|
|
10830
10929
|
}, (tablePagination === null || tablePagination === void 0 ? void 0 : tablePagination.total) || 0), "\xA0\u9879", selectMode ? /*#__PURE__*/React__default['default'].createElement("span", null, "\uFF0C \u672C\u6B21\u5DF2\u9009\xA0", /*#__PURE__*/React__default['default'].createElement("span", {
|
|
10831
10930
|
style: themeColor
|
|
10832
|
-
},
|
|
10931
|
+
}, selectLength), "\xA0\u9879") : ''), /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
10833
10932
|
style: {
|
|
10834
10933
|
marginRight: 8
|
|
10835
10934
|
}
|
|
@@ -10872,7 +10971,7 @@ var AddSelect = function AddSelect(props) {
|
|
|
10872
10971
|
}
|
|
10873
10972
|
}, /*#__PURE__*/React__default['default'].createElement("span", null, "\u672C\u6B21\u5DF2\u9009\xA0", /*#__PURE__*/React__default['default'].createElement("span", {
|
|
10874
10973
|
style: themeColor
|
|
10875
|
-
},
|
|
10974
|
+
}, selectLength), "\xA0\u9879")), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
10876
10975
|
style: {
|
|
10877
10976
|
display: 'flex'
|
|
10878
10977
|
}
|
|
@@ -10906,7 +11005,7 @@ var AddSelect = function AddSelect(props) {
|
|
|
10906
11005
|
dataSource: popvalue,
|
|
10907
11006
|
pagination: false,
|
|
10908
11007
|
// onChange={handleTableChange}
|
|
10909
|
-
rowKey:
|
|
11008
|
+
rowKey: selectRowKey,
|
|
10910
11009
|
rowClassName: 'row-class',
|
|
10911
11010
|
scroll: {
|
|
10912
11011
|
y: 500
|
|
@@ -11956,6 +12055,7 @@ var handleDefaultPrefixUrl = function handleDefaultPrefixUrl(type) {
|
|
|
11956
12055
|
case 'skuCommodity':
|
|
11957
12056
|
case 'skuPropertyValue':
|
|
11958
12057
|
case 'spuCommodity':
|
|
12058
|
+
case 'skcCommodity':
|
|
11959
12059
|
result = '/items';
|
|
11960
12060
|
break;
|
|
11961
12061
|
case 'physicalWarehouse':
|
|
@@ -12655,6 +12755,155 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
|
|
|
12655
12755
|
}]
|
|
12656
12756
|
}, modalTableBusProps);
|
|
12657
12757
|
}
|
|
12758
|
+
// 商品选择器skc
|
|
12759
|
+
if (type === 'skcCommodity') {
|
|
12760
|
+
requestConfig = _objectSpread2({
|
|
12761
|
+
url: "".concat(prefixUrl.selectPrefix, "/skc/skcSelect"),
|
|
12762
|
+
filter: 'qp-code,name-orGroup,like',
|
|
12763
|
+
mappingTextField: 'name',
|
|
12764
|
+
mappingValueField: 'code',
|
|
12765
|
+
sourceName: 'qp-skcCode-eq'
|
|
12766
|
+
}, requestConfigProp);
|
|
12767
|
+
tableSearchForm = [{
|
|
12768
|
+
name: 'qp-code-like',
|
|
12769
|
+
label: 'SKC编码'
|
|
12770
|
+
}, {
|
|
12771
|
+
name: 'qp-skcName-like',
|
|
12772
|
+
label: 'SKC名称'
|
|
12773
|
+
}, {
|
|
12774
|
+
name: 'qp-itemName-like',
|
|
12775
|
+
label: '商品名称'
|
|
12776
|
+
}, {
|
|
12777
|
+
name: 'qp-colorName-in',
|
|
12778
|
+
type: 'select',
|
|
12779
|
+
label: '颜色',
|
|
12780
|
+
field: {
|
|
12781
|
+
type: 'select',
|
|
12782
|
+
props: {
|
|
12783
|
+
mode: 'multiple',
|
|
12784
|
+
notFoundContent: '暂无数据',
|
|
12785
|
+
allowClear: true,
|
|
12786
|
+
showSearch: true,
|
|
12787
|
+
showArrow: true,
|
|
12788
|
+
maxTagCount: 1,
|
|
12789
|
+
optionFilterProp: 'children',
|
|
12790
|
+
filterOption: function filterOption(input, option) {
|
|
12791
|
+
return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
|
12792
|
+
}
|
|
12793
|
+
}
|
|
12794
|
+
}
|
|
12795
|
+
}, {
|
|
12796
|
+
name: 'qp-categoryId-in',
|
|
12797
|
+
type: 'treeSelect',
|
|
12798
|
+
label: '类目',
|
|
12799
|
+
field: {
|
|
12800
|
+
type: 'treeSelect',
|
|
12801
|
+
props: {
|
|
12802
|
+
treeData: [],
|
|
12803
|
+
treeCheckable: true,
|
|
12804
|
+
showSearch: true,
|
|
12805
|
+
allowClear: true,
|
|
12806
|
+
showArrow: true,
|
|
12807
|
+
treeNodeFilterProp: 'title',
|
|
12808
|
+
treeDefaultExpandAll: true,
|
|
12809
|
+
maxTagCount: 1,
|
|
12810
|
+
placeholder: '请选择',
|
|
12811
|
+
style: {
|
|
12812
|
+
width: '100%'
|
|
12813
|
+
},
|
|
12814
|
+
dropdownStyle: {
|
|
12815
|
+
maxHeight: 400,
|
|
12816
|
+
maxWidth: 100,
|
|
12817
|
+
overflow: 'auto'
|
|
12818
|
+
}
|
|
12819
|
+
}
|
|
12820
|
+
}
|
|
12821
|
+
}, {
|
|
12822
|
+
name: 'qp-classId-in',
|
|
12823
|
+
type: 'select',
|
|
12824
|
+
label: '品类',
|
|
12825
|
+
field: {
|
|
12826
|
+
type: 'select',
|
|
12827
|
+
props: {
|
|
12828
|
+
mode: 'multiple',
|
|
12829
|
+
notFoundContent: '暂无数据',
|
|
12830
|
+
allowClear: true,
|
|
12831
|
+
showSearch: true,
|
|
12832
|
+
showArrow: true,
|
|
12833
|
+
maxTagCount: 1,
|
|
12834
|
+
optionFilterProp: 'children',
|
|
12835
|
+
filterOption: function filterOption(input, option) {
|
|
12836
|
+
return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
|
12837
|
+
}
|
|
12838
|
+
}
|
|
12839
|
+
}
|
|
12840
|
+
}, {
|
|
12841
|
+
name: 'qp-brandId-in',
|
|
12842
|
+
type: 'select',
|
|
12843
|
+
label: '品牌',
|
|
12844
|
+
field: {
|
|
12845
|
+
type: 'select',
|
|
12846
|
+
props: {
|
|
12847
|
+
mode: 'multiple',
|
|
12848
|
+
notFoundContent: '暂无数据',
|
|
12849
|
+
allowClear: true,
|
|
12850
|
+
showSearch: true,
|
|
12851
|
+
showArrow: true,
|
|
12852
|
+
maxTagCount: 1,
|
|
12853
|
+
optionFilterProp: 'children',
|
|
12854
|
+
filterOption: function filterOption(input, option) {
|
|
12855
|
+
return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
|
12856
|
+
}
|
|
12857
|
+
}
|
|
12858
|
+
}
|
|
12859
|
+
}];
|
|
12860
|
+
Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/item/propertyValue"), {
|
|
12861
|
+
pageSize: 5000,
|
|
12862
|
+
currentPage: 1,
|
|
12863
|
+
'qp-propertyId-eq': '1467042217951883265'
|
|
12864
|
+
}), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/category/queryCategoryTree"), {
|
|
12865
|
+
pageSize: 5000,
|
|
12866
|
+
currentPage: 1
|
|
12867
|
+
}), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/class/withProperty"), {
|
|
12868
|
+
pageSize: 5000,
|
|
12869
|
+
currentPage: 1
|
|
12870
|
+
}), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/brand/queryBrandList"), {
|
|
12871
|
+
pageSize: 5000,
|
|
12872
|
+
currentPage: 1,
|
|
12873
|
+
'ctl-withAuth': true
|
|
12874
|
+
})]).then(function (x) {
|
|
12875
|
+
formatSource(x, 0, 3, tableSearchForm, ['value', 'value']);
|
|
12876
|
+
formatTreeDataSource(x, 1, 4, tableSearchForm);
|
|
12877
|
+
formatSource(x, 2, 5, tableSearchForm, ['id', 'name']);
|
|
12878
|
+
formatSource(x, 3, 6, tableSearchForm, ['id', 'name']);
|
|
12879
|
+
});
|
|
12880
|
+
modalTableProps = _objectSpread2({
|
|
12881
|
+
modalTableTitle: '选择SKC',
|
|
12882
|
+
tableSearchForm: tableSearchForm,
|
|
12883
|
+
tableColumns: [{
|
|
12884
|
+
title: 'SKC编码',
|
|
12885
|
+
dataIndex: 'code'
|
|
12886
|
+
}, {
|
|
12887
|
+
title: 'SKC名称',
|
|
12888
|
+
dataIndex: 'name'
|
|
12889
|
+
}, {
|
|
12890
|
+
title: '商品名称',
|
|
12891
|
+
dataIndex: 'itemName'
|
|
12892
|
+
}, {
|
|
12893
|
+
title: '颜色',
|
|
12894
|
+
dataIndex: 'colorName'
|
|
12895
|
+
}, {
|
|
12896
|
+
title: '类目',
|
|
12897
|
+
dataIndex: 'categoryText'
|
|
12898
|
+
}, {
|
|
12899
|
+
title: '品类',
|
|
12900
|
+
dataIndex: 'className'
|
|
12901
|
+
}, {
|
|
12902
|
+
title: '品牌',
|
|
12903
|
+
dataIndex: 'brandName'
|
|
12904
|
+
}]
|
|
12905
|
+
}, modalTableBusProps);
|
|
12906
|
+
}
|
|
12658
12907
|
// 商品规格选择器(无弹窗)
|
|
12659
12908
|
if (type === 'skuPropertyValue') {
|
|
12660
12909
|
requestConfig = _objectSpread2({
|
|
@@ -13884,7 +14133,8 @@ var AddSkuSelect = function AddSkuSelect(parProps) {
|
|
|
13884
14133
|
setValue(value);
|
|
13885
14134
|
},
|
|
13886
14135
|
beforeShowModal: parProps === null || parProps === void 0 ? void 0 : parProps.beforeShowModal,
|
|
13887
|
-
onSaveCallback: parProps.onSaveCallback
|
|
14136
|
+
onSaveCallback: parProps.onSaveCallback,
|
|
14137
|
+
businessType: 'sku'
|
|
13888
14138
|
// onSaveCallback: (rows) => {
|
|
13889
14139
|
// console.log('save call', rows);
|
|
13890
14140
|
// // return Promise.resolve(true);
|
|
@@ -14090,6 +14340,280 @@ var AddSkuSelect = function AddSkuSelect(parProps) {
|
|
|
14090
14340
|
modalTableProps: modalTableProps
|
|
14091
14341
|
})));
|
|
14092
14342
|
};
|
|
14343
|
+
var AddSkcSelect = function AddSkcSelect(parProps) {
|
|
14344
|
+
var selectProps = {
|
|
14345
|
+
mode: 'multiple'
|
|
14346
|
+
};
|
|
14347
|
+
var _useState3 = React.useState((selectProps === null || selectProps === void 0 ? void 0 : selectProps.mode) ? [] : null),
|
|
14348
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
14349
|
+
value = _useState4[0],
|
|
14350
|
+
setValue = _useState4[1];
|
|
14351
|
+
var _useState5 = React.useState([]),
|
|
14352
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
14353
|
+
propertyList = _useState6[0],
|
|
14354
|
+
setPropertyList = _useState6[1];
|
|
14355
|
+
React.useEffect(function () {
|
|
14356
|
+
axios__default['default'].get("/items/itemPropertyValueGroup/listNoPage").then(function (result) {
|
|
14357
|
+
var _result, _result2;
|
|
14358
|
+
result = result.data;
|
|
14359
|
+
if (((_result = result) === null || _result === void 0 ? void 0 : _result.status) && result.status !== '0' || ((_result2 = result) === null || _result2 === void 0 ? void 0 : _result2.code) && result.code !== '000000') {
|
|
14360
|
+
antd.message.error(result.msg);
|
|
14361
|
+
return;
|
|
14362
|
+
}
|
|
14363
|
+
var data = result.data || [];
|
|
14364
|
+
setPropertyList(data);
|
|
14365
|
+
}).catch(function (err) {});
|
|
14366
|
+
}, []);
|
|
14367
|
+
var initialSelectColumn = [{
|
|
14368
|
+
title: 'SKC编码',
|
|
14369
|
+
width: 150,
|
|
14370
|
+
dataIndex: 'code'
|
|
14371
|
+
}, {
|
|
14372
|
+
title: 'SKC名称',
|
|
14373
|
+
width: 200,
|
|
14374
|
+
ellipsis: {
|
|
14375
|
+
showTitle: false
|
|
14376
|
+
},
|
|
14377
|
+
render: function render(text) {
|
|
14378
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
|
|
14379
|
+
placement: "topLeft",
|
|
14380
|
+
title: text
|
|
14381
|
+
}, text);
|
|
14382
|
+
},
|
|
14383
|
+
dataIndex: 'name'
|
|
14384
|
+
}, {
|
|
14385
|
+
title: '颜色',
|
|
14386
|
+
width: 200,
|
|
14387
|
+
ellipsis: {
|
|
14388
|
+
showTitle: false
|
|
14389
|
+
},
|
|
14390
|
+
render: function render(text) {
|
|
14391
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
|
|
14392
|
+
placement: "topLeft",
|
|
14393
|
+
title: text
|
|
14394
|
+
}, text);
|
|
14395
|
+
},
|
|
14396
|
+
dataIndex: 'colorName'
|
|
14397
|
+
}, {
|
|
14398
|
+
title: '配码',
|
|
14399
|
+
dataIndex: 'selectPropertyGroupCode',
|
|
14400
|
+
width: 160,
|
|
14401
|
+
isSelectItem: true,
|
|
14402
|
+
dataSource: propertyList
|
|
14403
|
+
}, {
|
|
14404
|
+
title: '数量',
|
|
14405
|
+
width: 100,
|
|
14406
|
+
isInputItem: true,
|
|
14407
|
+
dataIndex: 'count'
|
|
14408
|
+
}];
|
|
14409
|
+
var mTpSelectColumn = handleSelectColumn(initialSelectColumn, parProps);
|
|
14410
|
+
var props = {
|
|
14411
|
+
buttonText: parProps.buttonText || '新增',
|
|
14412
|
+
buttonProps: parProps.buttonProps || {},
|
|
14413
|
+
tableCodeList: parProps.tableCodeList || ['skcSelect-tableOptionsToChoosePartCode', 'skcSelect-tableSelectedItemPartCode'],
|
|
14414
|
+
value: value,
|
|
14415
|
+
// labelInValue: true, // 非必填 默认为false
|
|
14416
|
+
requestConfig: _objectSpread2({
|
|
14417
|
+
url: "/items/skc/skcSelect",
|
|
14418
|
+
filter: 'qp-name-like',
|
|
14419
|
+
otherParams: {},
|
|
14420
|
+
mappingTextField: 'name',
|
|
14421
|
+
mappingValueField: 'code'
|
|
14422
|
+
}, parProps.requestConfig),
|
|
14423
|
+
selectProps: selectProps,
|
|
14424
|
+
onChange: function onChange(value) {
|
|
14425
|
+
console.log(value);
|
|
14426
|
+
setValue(value);
|
|
14427
|
+
},
|
|
14428
|
+
beforeShowModal: parProps === null || parProps === void 0 ? void 0 : parProps.beforeShowModal,
|
|
14429
|
+
onSaveCallback: parProps.onSaveCallback,
|
|
14430
|
+
businessType: 'skc',
|
|
14431
|
+
isAllowRepeatedSelect: true
|
|
14432
|
+
};
|
|
14433
|
+
var modalTableProps = {
|
|
14434
|
+
modalTableTitle: '选择商品',
|
|
14435
|
+
tableSearchForm: [{
|
|
14436
|
+
name: 'qp-code-like',
|
|
14437
|
+
label: 'SKC编码'
|
|
14438
|
+
}, {
|
|
14439
|
+
name: 'qp-skcName-like',
|
|
14440
|
+
label: 'SKC名称'
|
|
14441
|
+
}, {
|
|
14442
|
+
name: 'qp-itemName-like',
|
|
14443
|
+
label: '商品名称'
|
|
14444
|
+
}, {
|
|
14445
|
+
name: 'qp-colorName-in',
|
|
14446
|
+
type: 'select',
|
|
14447
|
+
label: '颜色',
|
|
14448
|
+
field: {
|
|
14449
|
+
type: 'select',
|
|
14450
|
+
props: {
|
|
14451
|
+
mode: 'multiple',
|
|
14452
|
+
notFoundContent: '暂无数据',
|
|
14453
|
+
allowClear: true,
|
|
14454
|
+
showSearch: true,
|
|
14455
|
+
showArrow: true,
|
|
14456
|
+
maxTagCount: 1,
|
|
14457
|
+
optionFilterProp: 'children',
|
|
14458
|
+
filterOption: function filterOption(input, option) {
|
|
14459
|
+
return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
|
14460
|
+
}
|
|
14461
|
+
}
|
|
14462
|
+
}
|
|
14463
|
+
}, {
|
|
14464
|
+
name: 'qp-categoryId-in',
|
|
14465
|
+
type: 'treeSelect',
|
|
14466
|
+
label: '类目',
|
|
14467
|
+
field: {
|
|
14468
|
+
type: 'treeSelect',
|
|
14469
|
+
props: {
|
|
14470
|
+
treeData: [],
|
|
14471
|
+
treeCheckable: true,
|
|
14472
|
+
showSearch: true,
|
|
14473
|
+
allowClear: true,
|
|
14474
|
+
showArrow: true,
|
|
14475
|
+
treeNodeFilterProp: 'title',
|
|
14476
|
+
treeDefaultExpandAll: true,
|
|
14477
|
+
maxTagCount: 1,
|
|
14478
|
+
placeholder: '请选择',
|
|
14479
|
+
style: {
|
|
14480
|
+
width: '100%'
|
|
14481
|
+
},
|
|
14482
|
+
dropdownStyle: {
|
|
14483
|
+
maxHeight: 400,
|
|
14484
|
+
maxWidth: 100,
|
|
14485
|
+
overflow: 'auto'
|
|
14486
|
+
}
|
|
14487
|
+
}
|
|
14488
|
+
}
|
|
14489
|
+
}, {
|
|
14490
|
+
name: 'qp-classId-in',
|
|
14491
|
+
type: 'select',
|
|
14492
|
+
label: '品类',
|
|
14493
|
+
field: {
|
|
14494
|
+
type: 'select',
|
|
14495
|
+
props: {
|
|
14496
|
+
mode: 'multiple',
|
|
14497
|
+
notFoundContent: '暂无数据',
|
|
14498
|
+
allowClear: true,
|
|
14499
|
+
showSearch: true,
|
|
14500
|
+
showArrow: true,
|
|
14501
|
+
maxTagCount: 1,
|
|
14502
|
+
optionFilterProp: 'children',
|
|
14503
|
+
filterOption: function filterOption(input, option) {
|
|
14504
|
+
return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
|
14505
|
+
}
|
|
14506
|
+
}
|
|
14507
|
+
}
|
|
14508
|
+
}, {
|
|
14509
|
+
name: 'qp-brandId-in',
|
|
14510
|
+
type: 'select',
|
|
14511
|
+
label: '品牌',
|
|
14512
|
+
field: {
|
|
14513
|
+
type: 'select',
|
|
14514
|
+
props: {
|
|
14515
|
+
mode: 'multiple',
|
|
14516
|
+
notFoundContent: '暂无数据',
|
|
14517
|
+
allowClear: true,
|
|
14518
|
+
showSearch: true,
|
|
14519
|
+
showArrow: true,
|
|
14520
|
+
maxTagCount: 1,
|
|
14521
|
+
optionFilterProp: 'children',
|
|
14522
|
+
filterOption: function filterOption(input, option) {
|
|
14523
|
+
return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
|
14524
|
+
}
|
|
14525
|
+
}
|
|
14526
|
+
}
|
|
14527
|
+
}],
|
|
14528
|
+
tableColumns: [{
|
|
14529
|
+
title: 'SKC编码',
|
|
14530
|
+
width: 150,
|
|
14531
|
+
dataIndex: 'code'
|
|
14532
|
+
}, {
|
|
14533
|
+
title: 'SKC名称',
|
|
14534
|
+
width: 200,
|
|
14535
|
+
ellipsis: {
|
|
14536
|
+
showTitle: false
|
|
14537
|
+
},
|
|
14538
|
+
render: function render(text) {
|
|
14539
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
|
|
14540
|
+
placement: "topLeft",
|
|
14541
|
+
title: text
|
|
14542
|
+
}, text);
|
|
14543
|
+
},
|
|
14544
|
+
dataIndex: 'name'
|
|
14545
|
+
}, {
|
|
14546
|
+
title: '商品名称',
|
|
14547
|
+
width: 100,
|
|
14548
|
+
ellipsis: {
|
|
14549
|
+
showTitle: false
|
|
14550
|
+
},
|
|
14551
|
+
dataIndex: 'itemName',
|
|
14552
|
+
render: function render(text) {
|
|
14553
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
|
|
14554
|
+
placement: "topLeft",
|
|
14555
|
+
title: text
|
|
14556
|
+
}, text);
|
|
14557
|
+
}
|
|
14558
|
+
}, {
|
|
14559
|
+
title: '颜色',
|
|
14560
|
+
width: 100,
|
|
14561
|
+
ellipsis: {
|
|
14562
|
+
showTitle: false
|
|
14563
|
+
},
|
|
14564
|
+
render: function render(text) {
|
|
14565
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
|
|
14566
|
+
placement: "topLeft",
|
|
14567
|
+
title: text
|
|
14568
|
+
}, text);
|
|
14569
|
+
},
|
|
14570
|
+
dataIndex: 'colorName'
|
|
14571
|
+
}, {
|
|
14572
|
+
title: '类目',
|
|
14573
|
+
width: 100,
|
|
14574
|
+
ellipsis: {
|
|
14575
|
+
showTitle: false
|
|
14576
|
+
},
|
|
14577
|
+
render: function render(text) {
|
|
14578
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
|
|
14579
|
+
placement: "topLeft",
|
|
14580
|
+
title: text
|
|
14581
|
+
}, text);
|
|
14582
|
+
},
|
|
14583
|
+
dataIndex: 'categoryName'
|
|
14584
|
+
}, {
|
|
14585
|
+
title: '品类',
|
|
14586
|
+
width: 100,
|
|
14587
|
+
ellipsis: {
|
|
14588
|
+
showTitle: false
|
|
14589
|
+
},
|
|
14590
|
+
render: function render(text) {
|
|
14591
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
|
|
14592
|
+
placement: "topLeft",
|
|
14593
|
+
title: text
|
|
14594
|
+
}, text);
|
|
14595
|
+
},
|
|
14596
|
+
dataIndex: 'className'
|
|
14597
|
+
}, {
|
|
14598
|
+
title: '品牌',
|
|
14599
|
+
width: 100,
|
|
14600
|
+
ellipsis: {
|
|
14601
|
+
showTitle: false
|
|
14602
|
+
},
|
|
14603
|
+
render: function render(text) {
|
|
14604
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
|
|
14605
|
+
placement: "topLeft",
|
|
14606
|
+
title: text
|
|
14607
|
+
}, text);
|
|
14608
|
+
},
|
|
14609
|
+
dataIndex: 'brandName'
|
|
14610
|
+
}],
|
|
14611
|
+
selectColumn: mTpSelectColumn
|
|
14612
|
+
};
|
|
14613
|
+
return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(AddSelect, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
14614
|
+
modalTableProps: modalTableProps
|
|
14615
|
+
})));
|
|
14616
|
+
};
|
|
14093
14617
|
|
|
14094
14618
|
var CommodityEntry = function CommodityEntry(props) {
|
|
14095
14619
|
var dataValidationRef = React.useRef();
|
|
@@ -29948,6 +30472,7 @@ var JsonQueryTable = /*#__PURE__*/React__default['default'].memo(function (props
|
|
|
29948
30472
|
});
|
|
29949
30473
|
|
|
29950
30474
|
exports.AddSelect = AddSelect;
|
|
30475
|
+
exports.AddSkcSelect = AddSkcSelect;
|
|
29951
30476
|
exports.AddSkuSelect = AddSkuSelect;
|
|
29952
30477
|
exports.BillEntry = BillEntry;
|
|
29953
30478
|
exports.BsLayout = index$5;
|