@bit-sun/business-component 2.0.2 → 2.0.3
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.d.ts +1 -0
- package/dist/index.esm.js +506 -82
- package/dist/index.js +506 -81
- package/package.json +1 -1
- package/src/components/Business/AddSelectBusiness/index.md +37 -0
- package/src/components/Business/AddSelectBusiness/index.tsx +295 -0
- package/src/components/Business/CommodityEntry/index.tsx +5 -2
- package/src/components/Functional/AddSelect/index.less +10 -1
- package/src/components/Functional/AddSelect/index.tsx +102 -15
- package/src/components/Functional/DataImport/index.tsx +0 -1
- package/src/components/Functional/DataValidation/index.tsx +8 -1
- package/src/index.ts +1 -0
package/dist/index.esm.js
CHANGED
|
@@ -2363,16 +2363,26 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
|
|
|
2363
2363
|
var _this$props = _this.props,
|
|
2364
2364
|
validDataUrl = _this$props.validDataUrl,
|
|
2365
2365
|
updateData = _this$props.updateData,
|
|
2366
|
-
columns = _this$props.columns
|
|
2366
|
+
columns = _this$props.columns,
|
|
2367
|
+
isBrandAuth = _this$props.isBrandAuth;
|
|
2367
2368
|
|
|
2368
2369
|
var resultData = _this.getData().filter(function (d) {
|
|
2369
2370
|
return _.compact(Object.values(d)).length;
|
|
2370
|
-
});
|
|
2371
|
+
}); // 处理业务参数
|
|
2371
2372
|
|
|
2372
|
-
|
|
2373
|
+
|
|
2374
|
+
var otherParams = {};
|
|
2375
|
+
|
|
2376
|
+
if (isBrandAuth) {
|
|
2377
|
+
otherParams = {
|
|
2378
|
+
brandAuth: 'ctl-withAuth'
|
|
2379
|
+
};
|
|
2380
|
+
}
|
|
2381
|
+
|
|
2382
|
+
axios.post(validDataUrl, _objectSpread2(_objectSpread2({}, otherParams), {}, {
|
|
2373
2383
|
columns: columns,
|
|
2374
2384
|
data: resultData
|
|
2375
|
-
}).then(function (result) {
|
|
2385
|
+
})).then(function (result) {
|
|
2376
2386
|
result = result.data;
|
|
2377
2387
|
|
|
2378
2388
|
if (result.status !== '0') {
|
|
@@ -2962,7 +2972,6 @@ var DataImport = /*#__PURE__*/function (_React$Component) {
|
|
|
2962
2972
|
console.time();
|
|
2963
2973
|
var sheetData = luckysheet$1.getSheetData();
|
|
2964
2974
|
var data = JSON.parse(JSON.stringify(sheetData)).filter(function (item) {
|
|
2965
|
-
debugger;
|
|
2966
2975
|
return item[0];
|
|
2967
2976
|
}).map(function (item) {
|
|
2968
2977
|
var obj = {};
|
|
@@ -4386,9 +4395,72 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
4386
4395
|
}), " \u5168\u9009\u6240\u6709\u9875\u9762") : '')))));
|
|
4387
4396
|
};
|
|
4388
4397
|
|
|
4389
|
-
var css_248z$4 = ".add_select_show {\n display: flex;\n}\n.add_select_expand_button {\n position: relative;\n width: 30px;\n color: #ffffff;\n cursor: pointer;\n}\n.add_select_expand_button span {\n position: absolute;\n height: 20px;\n line-height: 14px;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n}\n.add_select_header {\n border-bottom: 1px solid #D9D9D9;\n height: 24px;\n height: 40px;\n font-family: PingFangSC-Medium;\n font-weight: 500;\n font-size: 18px;\n color: #000000;\n letter-spacing: 0;\n line-height: 40px;\n margin-bottom: 10px;\n padding-left: 10px;\n}\n.add_select_header > span {\n margin-left: 20px;\n font-weight: 400;\n font-size: 12px;\n color: #666666;\n letter-spacing: 0;\n line-height: 40px;\n}\n.add_select_header > span > span {\n color: #ff0000;\n}\n.add_select_header_close span {\n position: absolute;\n color: black !important;\n right: 10px;\n top: 10px;\n}\n.add_select_wrapper {\n position: relative;\n display: flex;\n max-height: 60vh;\n overflow: hidden;\n font-size: 14px;\n margin: 5px 10px;\n}\n.add_select_wrapper .ant-table-pagination.ant-pagination {\n margin: 5px;\n padding-right: 5px;\n}\n.add_select_wrapper .ant-checkbox-wrapper {\n justify-content: center;\n}\n.add_select_wrapper .ant-table-thead th {\n height: 20px !important;\n padding: 0px 8px !important;\n font-size: 12px !important;\n font-weight: 600 !important;\n line-height: 20px !important;\n}\n.add_select_wrapper .ant-modal-body {\n padding: 10px;\n}\n.add_select_wrapper .ant-table-wrapper {\n padding: 0px !important;\n}\n.add_select_wrapper .row-class {\n height: 24px;\n}\n.add_select_wrapper .row-class td {\n font-size: 12px !important;\n height: 24px !important;\n padding: 0px 8px !important;\n line-height: 20px !important;\n}\n.add_select_wrapper .ant-table-body {\n height: 240px;\n overflow-y: auto !important;\n}\n.add_select_wrapper .ant-row.ant-form-item {\n margin-bottom: 10px;\n}\n.add_select_wrapper_click_flag {\n position: absolute;\n z-index: 10;\n}\n.add_select_wrapper_click_flag_arrow {\n transform: rotate(0deg);\n transition: transform 0.5s;\n}\n.add_select_wrapper_click_flag_arrow_1 {\n transform: rotate(-180deg);\n transition: transform 0.5s;\n}\n.add_select_wrapper_left {\n flex-basis: 298px;\n width: 298px;\n overflow-y: hidden;\n transition: all 0.3s;\n margin-right: 10px;\n border: 1px solid #D9D9D9;\n border-radius: 5px;\n}\n.add_select_wrapper_left1 {\n width: 0;\n height: 0;\n transition: all 0.3s;\n display: none;\n}\n.add_select_wrapper_right {\n width: 872px;\n border: 1px solid #D9D9D9;\n border-radius: 5px;\n}\n.add_select_wrapper_right1 {\n width: 100%;\n margin-left: 10px;\n}\n.add_select_wrapper_right,\n.add_select_wrapper_right1 {\n overflow-x: auto;\n}\n.add_select_wrapper .select_list_columns {\n height: 272px;\n overflow-y: auto;\n border-bottom: 1px solid #D9D9D9;\n}\n.add_select_wrapper .select_list_columns_tips {\n background: #eee;\n padding: 6px 20px;\n margin-bottom: 10px;\n}\n.add_select_wrapper .select_list_columns_formItems {\n padding: 10px;\n}\n.add_select_wrapper .select_list_searchButton {\n display: flex;\n margin: 10px;\n justify-content: flex-end;\n}\n.add_select_wrapper .select_list_button_space {\n margin-right: 10px;\n}\n.add_select_wrapper .select_list_selectTips {\n display: flex;\n justify-content: space-between;\n height: 24px;\n font-size: 12px;\n line-height: 24px;\n background: #F7F8FB;\n padding: 0 5px;\n border-bottom: 1px solid #D9D9D9;\n}\n.add_select_wrapper .select_list_selectAll {\n position: relative;\n top: -40px;\n left: 20px;\n width: 160px;\n}\n.add_select_wrapper_select {\n margin-top: 4px;\n border: 1px solid #D9D9D9;\n border-radius: 5px;\n margin: 5px 10px;\n}\n.add_select_wrapper_select .ant-table-pagination.ant-pagination {\n margin: 9px;\n padding-right: 5px;\n}\n.add_select_wrapper_select .ant-modal-body {\n padding: 10px;\n}\n.add_select_wrapper_select .ant-table-wrapper {\n padding: 0px !important;\n}\n.add_select_wrapper_select .ant-table-thead th {\n height: 23px !important;\n padding: 0px 8px !important;\n font-size: 12px !important;\n font-weight: 600 !important;\n line-height: 23px !important;\n}\n.add_select_wrapper_select .ant-modal-close-x {\n height: 30px;\n}\n.add_select_wrapper_select .row-class {\n height: 30px;\n}\n.add_select_wrapper_select .row-class td {\n font-size: 12px !important;\n height: 30px !important;\n padding: 4px 8px !important;\n}\n.add_select_wrapper_select .ant-table-body {\n height: 200px;\n overflow-y: auto !important;\n}\n.add_select_wrapper_select .ant-row.ant-form-item {\n margin-bottom: 10px;\n}\n.add_select_wrapper_select .ant-input-number-input {\n height: auto;\n}\n.add_select_wrapper_select .select_list_selectTips {\n display: flex;\n justify-content: space-between;\n height: 24px;\n font-size: 12px;\n line-height: 24px;\n background: #F7F8FB;\n padding: 0 3px;\n border-bottom: 1px solid #D9D9D9;\n}\n";
|
|
4398
|
+
var css_248z$4 = ".add_select_show {\n display: flex;\n}\n.add_select_expand_button {\n position: relative;\n width: 30px;\n color: #ffffff;\n cursor: pointer;\n}\n.add_select_expand_button span {\n position: absolute;\n height: 20px;\n line-height: 14px;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n}\n.add_select_header {\n border-bottom: 1px solid #D9D9D9;\n height: 24px;\n height: 40px;\n font-family: PingFangSC-Medium;\n font-weight: 500;\n font-size: 18px;\n color: #000000;\n letter-spacing: 0;\n line-height: 40px;\n margin-bottom: 10px;\n padding-left: 10px;\n}\n.add_select_header > span {\n margin-left: 20px;\n font-weight: 400;\n font-size: 12px;\n color: #666666;\n letter-spacing: 0;\n line-height: 40px;\n}\n.add_select_header > span > span {\n color: #ff0000;\n}\n.add_select_header_close span {\n position: absolute;\n color: black !important;\n right: 10px;\n top: 10px;\n}\n.add_select_wrapper {\n position: relative;\n display: flex;\n max-height: 60vh;\n overflow: hidden;\n font-size: 14px;\n margin: 5px 10px;\n}\n.add_select_wrapper .ant-table-pagination.ant-pagination {\n margin: 5px;\n padding-right: 5px;\n}\n.add_select_wrapper .ant-checkbox-wrapper {\n justify-content: center;\n}\n.add_select_wrapper .ant-form-item-label {\n padding: 0PX;\n line-height: 23px !important;\n}\n.add_select_wrapper .ant-form-item-label > label {\n font-size: 12px;\n}\n.add_select_wrapper .ant-table-thead th {\n height: 20px !important;\n padding: 0px 8px !important;\n font-size: 12px !important;\n font-weight: 600 !important;\n line-height: 20px !important;\n}\n.add_select_wrapper .ant-modal-body {\n padding: 10px;\n}\n.add_select_wrapper .ant-table-wrapper {\n padding: 0px !important;\n}\n.add_select_wrapper .row-class {\n height: 24px;\n}\n.add_select_wrapper .row-class td {\n font-size: 12px !important;\n height: 24px !important;\n padding: 0px 8px !important;\n line-height: 20px !important;\n}\n.add_select_wrapper .ant-table-body {\n height: 240px;\n overflow-y: auto !important;\n}\n.add_select_wrapper .ant-row.ant-form-item {\n margin-bottom: 10px;\n}\n.add_select_wrapper_click_flag {\n position: absolute;\n z-index: 10;\n}\n.add_select_wrapper_click_flag_arrow {\n transform: rotate(0deg);\n transition: transform 0.5s;\n}\n.add_select_wrapper_click_flag_arrow_1 {\n transform: rotate(-180deg);\n transition: transform 0.5s;\n}\n.add_select_wrapper_left {\n flex-basis: 298px;\n width: 298px;\n overflow-y: hidden;\n transition: all 0.3s;\n margin-right: 10px;\n border: 1px solid #D9D9D9;\n border-radius: 5px;\n}\n.add_select_wrapper_left1 {\n width: 0;\n height: 0;\n transition: all 0.3s;\n display: none;\n}\n.add_select_wrapper_right {\n width: 872px;\n border: 1px solid #D9D9D9;\n border-radius: 5px;\n}\n.add_select_wrapper_right1 {\n width: 100%;\n margin-left: 10px;\n}\n.add_select_wrapper_right,\n.add_select_wrapper_right1 {\n overflow-x: auto;\n}\n.add_select_wrapper .select_list_columns {\n height: 272px;\n overflow-y: auto;\n border-bottom: 1px solid #D9D9D9;\n}\n.add_select_wrapper .select_list_columns_tips {\n background: #eee;\n padding: 6px 20px;\n margin-bottom: 10px;\n}\n.add_select_wrapper .select_list_columns_formItems {\n padding: 7px 10px;\n}\n.add_select_wrapper .select_list_searchButton {\n display: flex;\n margin: 10px;\n justify-content: flex-end;\n}\n.add_select_wrapper .select_list_button_space {\n margin-right: 10px;\n}\n.add_select_wrapper .select_list_selectTips {\n display: flex;\n justify-content: space-between;\n height: 24px;\n font-size: 12px;\n line-height: 24px;\n background: #F7F8FB;\n padding: 0 5px;\n border-bottom: 1px solid #D9D9D9;\n}\n.add_select_wrapper .select_list_selectAll {\n position: relative;\n top: -40px;\n left: 20px;\n width: 160px;\n}\n.add_select_wrapper_select {\n margin-top: 4px;\n border: 1px solid #D9D9D9;\n border-radius: 5px;\n margin: 5px 10px;\n}\n.add_select_wrapper_select .ant-table-pagination.ant-pagination {\n margin: 9px;\n padding-right: 5px;\n}\n.add_select_wrapper_select .ant-modal-body {\n padding: 10px;\n}\n.add_select_wrapper_select .ant-table-wrapper {\n padding: 0px !important;\n}\n.add_select_wrapper_select .ant-table-thead th {\n height: 23px !important;\n padding: 0px 8px !important;\n font-size: 12px !important;\n font-weight: 600 !important;\n line-height: 23px !important;\n}\n.add_select_wrapper_select .ant-modal-close-x {\n height: 30px;\n}\n.add_select_wrapper_select .row-class {\n height: 30px;\n}\n.add_select_wrapper_select .row-class td {\n font-size: 12px !important;\n height: 30px !important;\n padding: 4px 8px !important;\n}\n.add_select_wrapper_select .ant-table-body {\n height: 200px;\n overflow-y: auto !important;\n}\n.add_select_wrapper_select .ant-row.ant-form-item {\n margin-bottom: 10px;\n}\n.add_select_wrapper_select .ant-input-number-input {\n height: auto;\n}\n.add_select_wrapper_select .select_list_selectTips {\n display: flex;\n justify-content: space-between;\n height: 24px;\n font-size: 12px;\n line-height: 24px;\n background: #F7F8FB;\n padding: 0 3px;\n border-bottom: 1px solid #D9D9D9;\n}\n";
|
|
4390
4399
|
styleInject(css_248z$4);
|
|
4391
4400
|
|
|
4401
|
+
var loadSelectSource = function loadSelectSource(url, params) {
|
|
4402
|
+
return new Promise(function (resolve, reject) {
|
|
4403
|
+
axios.get("".concat(url, "?").concat(stringify(params))).then(function (result) {
|
|
4404
|
+
var _result, _result2;
|
|
4405
|
+
|
|
4406
|
+
result = result.data;
|
|
4407
|
+
|
|
4408
|
+
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') {
|
|
4409
|
+
message.error(result.msg);
|
|
4410
|
+
return;
|
|
4411
|
+
}
|
|
4412
|
+
|
|
4413
|
+
resolve(result);
|
|
4414
|
+
}).catch(function (err) {
|
|
4415
|
+
reject(err);
|
|
4416
|
+
});
|
|
4417
|
+
});
|
|
4418
|
+
};
|
|
4419
|
+
|
|
4420
|
+
var formatSource = function formatSource(reData, position, changePosition, changeSearchForm) {
|
|
4421
|
+
var _reData$position;
|
|
4422
|
+
|
|
4423
|
+
var resKeyValue = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : ['code', 'name'];
|
|
4424
|
+
var data = reData && ((_reData$position = reData[position]) === null || _reData$position === void 0 ? void 0 : _reData$position.data);
|
|
4425
|
+
var list = Array.isArray(data) ? data : (data === null || data === void 0 ? void 0 : data.items) || (data === null || data === void 0 ? void 0 : data.list) || (data === null || data === void 0 ? void 0 : data.children) || [];
|
|
4426
|
+
var formatData = (list === null || list === void 0 ? void 0 : list.length) ? list.map(function (v) {
|
|
4427
|
+
return {
|
|
4428
|
+
text: v[resKeyValue[1]],
|
|
4429
|
+
value: v[resKeyValue[0]]
|
|
4430
|
+
};
|
|
4431
|
+
}) : [];
|
|
4432
|
+
changeSearchForm[changePosition] = _objectSpread2(_objectSpread2({}, changeSearchForm[changePosition]), {}, {
|
|
4433
|
+
initialSource: formatData
|
|
4434
|
+
});
|
|
4435
|
+
}; // 格式化树选择器数据源
|
|
4436
|
+
|
|
4437
|
+
|
|
4438
|
+
var mapSearchTree = function mapSearchTree(treeDataItem, resKeyValue) {
|
|
4439
|
+
var haveChildren = Array.isArray(treeDataItem.children) && treeDataItem.children.length > 0;
|
|
4440
|
+
return {
|
|
4441
|
+
title: treeDataItem[resKeyValue[1]],
|
|
4442
|
+
value: treeDataItem[resKeyValue[0]],
|
|
4443
|
+
parentId: treeDataItem.parent,
|
|
4444
|
+
data: _objectSpread2({}, treeDataItem),
|
|
4445
|
+
isLeaf: !haveChildren,
|
|
4446
|
+
disabled: haveChildren,
|
|
4447
|
+
children: haveChildren ? treeDataItem.children.map(function (i) {
|
|
4448
|
+
return mapSearchTree(i, resKeyValue);
|
|
4449
|
+
}) : []
|
|
4450
|
+
};
|
|
4451
|
+
};
|
|
4452
|
+
|
|
4453
|
+
var formatTreeDataSource = function formatTreeDataSource(reData, position, changePosition, changeSearchForm) {
|
|
4454
|
+
var _reData$position2;
|
|
4455
|
+
|
|
4456
|
+
var resKeyValue = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : ['id', 'name'];
|
|
4457
|
+
var data = reData && ((_reData$position2 = reData[position]) === null || _reData$position2 === void 0 ? void 0 : _reData$position2.data);
|
|
4458
|
+
var formatData = data && Array.isArray(data) && data.length && data.map(function (ites) {
|
|
4459
|
+
return mapSearchTree(ites, resKeyValue);
|
|
4460
|
+
}) || [];
|
|
4461
|
+
changeSearchForm[changePosition].field.props.treeData = formatData;
|
|
4462
|
+
};
|
|
4463
|
+
|
|
4392
4464
|
var Option$1 = Select.Option;
|
|
4393
4465
|
|
|
4394
4466
|
var AddSelect = function AddSelect(props) {
|
|
@@ -4406,7 +4478,9 @@ var AddSelect = function AddSelect(props) {
|
|
|
4406
4478
|
_props$needModalTable = props.needModalTable,
|
|
4407
4479
|
needModalTable = _props$needModalTable === void 0 ? true : _props$needModalTable,
|
|
4408
4480
|
_props$getPopupContai = props.getPopupContainer,
|
|
4409
|
-
onSaveCallback = props.onSaveCallback
|
|
4481
|
+
onSaveCallback = props.onSaveCallback,
|
|
4482
|
+
_props$buttonText = props.buttonText,
|
|
4483
|
+
buttonText = _props$buttonText === void 0 ? '添加' : _props$buttonText;
|
|
4410
4484
|
|
|
4411
4485
|
var _ref = requestConfig || {},
|
|
4412
4486
|
url = _ref.url,
|
|
@@ -4508,51 +4582,56 @@ var AddSelect = function AddSelect(props) {
|
|
|
4508
4582
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
4509
4583
|
form = _Form$useForm2[0];
|
|
4510
4584
|
|
|
4511
|
-
var _useState17 = useState(
|
|
4585
|
+
var _useState17 = useState(modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.tableSearchForm),
|
|
4512
4586
|
_useState18 = _slicedToArray(_useState17, 2),
|
|
4513
|
-
|
|
4514
|
-
|
|
4587
|
+
tableSearchForm = _useState18[0],
|
|
4588
|
+
setTableSearchForm = _useState18[1];
|
|
4515
4589
|
|
|
4516
|
-
var _useState19 = useState(
|
|
4590
|
+
var _useState19 = useState(true),
|
|
4517
4591
|
_useState20 = _slicedToArray(_useState19, 2),
|
|
4518
|
-
|
|
4519
|
-
|
|
4592
|
+
caretLeftFlag = _useState20[0],
|
|
4593
|
+
setCaretLeftFlag = _useState20[1];
|
|
4520
4594
|
|
|
4521
|
-
var _useState21 = useState(
|
|
4595
|
+
var _useState21 = useState([]),
|
|
4596
|
+
_useState22 = _slicedToArray(_useState21, 2),
|
|
4597
|
+
tableData = _useState22[0],
|
|
4598
|
+
setTableData = _useState22[1];
|
|
4599
|
+
|
|
4600
|
+
var _useState23 = useState({
|
|
4522
4601
|
total: 0,
|
|
4523
4602
|
size: "small",
|
|
4524
4603
|
current: 1,
|
|
4525
4604
|
pageSize: tableInitPageSize
|
|
4526
4605
|
}),
|
|
4527
|
-
_useState22 = _slicedToArray(_useState21, 2),
|
|
4528
|
-
tablePagination = _useState22[0],
|
|
4529
|
-
setTablePagination = _useState22[1];
|
|
4530
|
-
|
|
4531
|
-
var _useState23 = useState([]),
|
|
4532
4606
|
_useState24 = _slicedToArray(_useState23, 2),
|
|
4533
|
-
|
|
4534
|
-
|
|
4607
|
+
tablePagination = _useState24[0],
|
|
4608
|
+
setTablePagination = _useState24[1];
|
|
4535
4609
|
|
|
4536
4610
|
var _useState25 = useState([]),
|
|
4537
4611
|
_useState26 = _slicedToArray(_useState25, 2),
|
|
4538
|
-
|
|
4539
|
-
|
|
4612
|
+
selectedRowKeys = _useState26[0],
|
|
4613
|
+
setSelectedRowKeys = _useState26[1];
|
|
4540
4614
|
|
|
4541
|
-
|
|
4542
|
-
var _useState27 = useState(false),
|
|
4615
|
+
var _useState27 = useState([]),
|
|
4543
4616
|
_useState28 = _slicedToArray(_useState27, 2),
|
|
4544
|
-
|
|
4545
|
-
|
|
4617
|
+
doubleArr = _useState28[0],
|
|
4618
|
+
setDoubleArr = _useState28[1]; // 存放双数组的数组
|
|
4619
|
+
|
|
4546
4620
|
|
|
4547
4621
|
var _useState29 = useState(false),
|
|
4548
4622
|
_useState30 = _slicedToArray(_useState29, 2),
|
|
4549
|
-
|
|
4550
|
-
|
|
4623
|
+
checkedAll = _useState30[0],
|
|
4624
|
+
setCheckedAll = _useState30[1];
|
|
4551
4625
|
|
|
4552
|
-
var _useState31 = useState(
|
|
4626
|
+
var _useState31 = useState(false),
|
|
4553
4627
|
_useState32 = _slicedToArray(_useState31, 2),
|
|
4554
|
-
|
|
4555
|
-
|
|
4628
|
+
indeterminate = _useState32[0],
|
|
4629
|
+
setIndeterminate = _useState32[1];
|
|
4630
|
+
|
|
4631
|
+
var _useState33 = useState({}),
|
|
4632
|
+
_useState34 = _slicedToArray(_useState33, 2),
|
|
4633
|
+
tableFormParams = _useState34[0],
|
|
4634
|
+
setTableFormParams = _useState34[1]; // 获取数据源 (type: 1下拉框 2弹框 不传值默认为下拉框)
|
|
4556
4635
|
|
|
4557
4636
|
|
|
4558
4637
|
var getData = function getData() {
|
|
@@ -4677,12 +4756,12 @@ var AddSelect = function AddSelect(props) {
|
|
|
4677
4756
|
}, otherParams), fixedParam), params);
|
|
4678
4757
|
|
|
4679
4758
|
axios.get("".concat(url, "?").concat(stringify(queryParams))).then(function (result) {
|
|
4680
|
-
var
|
|
4759
|
+
var _result3, _result4;
|
|
4681
4760
|
|
|
4682
4761
|
setFetching(false);
|
|
4683
4762
|
result = result.data;
|
|
4684
4763
|
|
|
4685
|
-
if (((
|
|
4764
|
+
if (((_result3 = result) === null || _result3 === void 0 ? void 0 : _result3.status) && result.status !== '0' || ((_result4 = result) === null || _result4 === void 0 ? void 0 : _result4.code) && result.code !== '000000') {
|
|
4686
4765
|
message.error(result.msg);
|
|
4687
4766
|
return;
|
|
4688
4767
|
}
|
|
@@ -4766,7 +4845,18 @@ var AddSelect = function AddSelect(props) {
|
|
|
4766
4845
|
};
|
|
4767
4846
|
|
|
4768
4847
|
useEffect(function () {
|
|
4769
|
-
run('init')
|
|
4848
|
+
// run('init')
|
|
4849
|
+
Promise.all([loadSelectSource("/items/brand/queryBrandList", {
|
|
4850
|
+
pageSize: 5000,
|
|
4851
|
+
currentPage: 1,
|
|
4852
|
+
'ctl-withAuth': true
|
|
4853
|
+
}), loadSelectSource("/items/category/queryCategoryTree", {
|
|
4854
|
+
pageSize: 5000,
|
|
4855
|
+
currentPage: 1
|
|
4856
|
+
})]).then(function (x) {
|
|
4857
|
+
formatSource(x, 0, 2, tableSearchForm, ['id', 'name']);
|
|
4858
|
+
formatTreeDataSource(x, 1, 3, tableSearchForm);
|
|
4859
|
+
});
|
|
4770
4860
|
}, []);
|
|
4771
4861
|
useEffect(function () {
|
|
4772
4862
|
if (value) {
|
|
@@ -4778,10 +4868,7 @@ var AddSelect = function AddSelect(props) {
|
|
|
4778
4868
|
}, [sourceName]);
|
|
4779
4869
|
|
|
4780
4870
|
var showModal = function showModal() {
|
|
4781
|
-
getData({
|
|
4782
|
-
pageSize: tableInitPageSize,
|
|
4783
|
-
currentPage: 1
|
|
4784
|
-
}, 2);
|
|
4871
|
+
// getData({ pageSize: tableInitPageSize, currentPage: 1 }, 2)
|
|
4785
4872
|
setIsModalVisible(true); // 回显
|
|
4786
4873
|
|
|
4787
4874
|
if (value) {
|
|
@@ -4815,6 +4902,12 @@ var AddSelect = function AddSelect(props) {
|
|
|
4815
4902
|
}]);
|
|
4816
4903
|
}
|
|
4817
4904
|
}
|
|
4905
|
+
|
|
4906
|
+
setTimeout(function () {
|
|
4907
|
+
var _document$getElementB;
|
|
4908
|
+
|
|
4909
|
+
(_document$getElementB = document.getElementById("first-query")) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.focus();
|
|
4910
|
+
}, 50);
|
|
4818
4911
|
};
|
|
4819
4912
|
|
|
4820
4913
|
var handleOk = function handleOk(isContinue) {
|
|
@@ -4827,8 +4920,11 @@ var AddSelect = function AddSelect(props) {
|
|
|
4827
4920
|
if (onSaveCallback) {
|
|
4828
4921
|
onSaveCallback(popvalue).then(function (res) {
|
|
4829
4922
|
{
|
|
4923
|
+
var _document$getElementB2;
|
|
4924
|
+
|
|
4830
4925
|
message.success('保存成功');
|
|
4831
4926
|
deleteSelectRows();
|
|
4927
|
+
(_document$getElementB2 = document.getElementById('first-query')) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.focus();
|
|
4832
4928
|
!isContinue && handleCancel();
|
|
4833
4929
|
}
|
|
4834
4930
|
}).catch(function (Error) {
|
|
@@ -4843,10 +4939,9 @@ var AddSelect = function AddSelect(props) {
|
|
|
4843
4939
|
form.resetFields();
|
|
4844
4940
|
setTableFormParams({});
|
|
4845
4941
|
setIsModalVisible(false);
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
|
|
4849
|
-
}
|
|
4942
|
+
setTableData([]); // if (selectMode) {
|
|
4943
|
+
// run();
|
|
4944
|
+
// }
|
|
4850
4945
|
};
|
|
4851
4946
|
|
|
4852
4947
|
var onSearchTable = function onSearchTable() {
|
|
@@ -4878,6 +4973,14 @@ var AddSelect = function AddSelect(props) {
|
|
|
4878
4973
|
}; // 扁平化二维数组的方法
|
|
4879
4974
|
|
|
4880
4975
|
var onChangeSelectedKeys = function onChangeSelectedKeys(selectKeys, selectRows) {
|
|
4976
|
+
if (selectKeys.length - selectedRowKeys.length > 0) {
|
|
4977
|
+
if (selectKeys.length - selectedRowKeys.length === 1) {
|
|
4978
|
+
selectRows[selectRows.length - 1]['needFocus'] = true;
|
|
4979
|
+
} else {
|
|
4980
|
+
selectRows[selectedRowKeys.length]['needFocus'] = true;
|
|
4981
|
+
}
|
|
4982
|
+
}
|
|
4983
|
+
|
|
4881
4984
|
setPopValue(selectRows);
|
|
4882
4985
|
setSelectedRowKeys(selectKeys); // setIndeterminate(!!filterRows.length && filterRows.length < tablePagination?.total);
|
|
4883
4986
|
// setCheckedAll(filterRows.length === tablePagination?.total);
|
|
@@ -4984,10 +5087,15 @@ var AddSelect = function AddSelect(props) {
|
|
|
4984
5087
|
label: i.label,
|
|
4985
5088
|
key: i.name
|
|
4986
5089
|
}, /*#__PURE__*/React.createElement(Input, _objectSpread2({
|
|
4987
|
-
id: index === 0 ? "
|
|
5090
|
+
id: index === 0 ? "first-query" : 'index',
|
|
4988
5091
|
style: {
|
|
4989
5092
|
width: '100%'
|
|
4990
5093
|
},
|
|
5094
|
+
onKeyDown: function onKeyDown(e) {
|
|
5095
|
+
if (e.keyCode === 13) {
|
|
5096
|
+
onSearchTable();
|
|
5097
|
+
}
|
|
5098
|
+
},
|
|
4991
5099
|
placeholder: "\u8BF7\u8F93\u5165",
|
|
4992
5100
|
allowClear: true,
|
|
4993
5101
|
maxLength: 100
|
|
@@ -5023,12 +5131,16 @@ var AddSelect = function AddSelect(props) {
|
|
|
5023
5131
|
inputIndex++;
|
|
5024
5132
|
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
5025
5133
|
render: function render(text, record, index) {
|
|
5134
|
+
// let
|
|
5135
|
+
if (record.needFocus === true && currentIndex === 0) ;
|
|
5136
|
+
|
|
5026
5137
|
return /*#__PURE__*/React.createElement(InputNumber, {
|
|
5027
5138
|
defaultValue: text || 0,
|
|
5028
5139
|
min: 0,
|
|
5140
|
+
autoFocus: record.needFocus,
|
|
5029
5141
|
keyboard: false,
|
|
5030
5142
|
onChange: function onChange(value) {
|
|
5031
|
-
record[
|
|
5143
|
+
record[item.dataIndex] = value;
|
|
5032
5144
|
},
|
|
5033
5145
|
// onFocus={(e)=> {
|
|
5034
5146
|
// let dom1 = e.currentTarget;
|
|
@@ -5037,10 +5149,10 @@ var AddSelect = function AddSelect(props) {
|
|
|
5037
5149
|
// }}
|
|
5038
5150
|
onKeyDown: function onKeyDown(e) {
|
|
5039
5151
|
if (e.keyCode === 13 && e.ctrlKey) {
|
|
5040
|
-
var _document$
|
|
5152
|
+
var _document$getElementB3;
|
|
5041
5153
|
|
|
5042
5154
|
handleOk(true);
|
|
5043
|
-
(_document$
|
|
5155
|
+
(_document$getElementB3 = document.getElementById("first-query")) === null || _document$getElementB3 === void 0 ? void 0 : _document$getElementB3.focus();
|
|
5044
5156
|
}
|
|
5045
5157
|
|
|
5046
5158
|
if (e.keyCode === 8 && e.ctrlKey) {
|
|
@@ -5147,14 +5259,18 @@ var AddSelect = function AddSelect(props) {
|
|
|
5147
5259
|
return item;
|
|
5148
5260
|
})), [{
|
|
5149
5261
|
title: '操作',
|
|
5150
|
-
width:
|
|
5262
|
+
width: 50,
|
|
5151
5263
|
fixed: 'right',
|
|
5152
5264
|
render: function render(text, record, index) {
|
|
5153
|
-
return /*#__PURE__*/React.createElement(
|
|
5265
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
5266
|
+
style: {
|
|
5267
|
+
cursor: 'pointer',
|
|
5268
|
+
color: '#005CFF'
|
|
5269
|
+
},
|
|
5154
5270
|
onClick: function onClick() {
|
|
5155
5271
|
deleteRecord(record);
|
|
5156
5272
|
},
|
|
5157
|
-
type: "
|
|
5273
|
+
type: "text"
|
|
5158
5274
|
}, "\u5220\u9664");
|
|
5159
5275
|
}
|
|
5160
5276
|
}]);
|
|
@@ -5166,7 +5282,7 @@ var AddSelect = function AddSelect(props) {
|
|
|
5166
5282
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
5167
5283
|
onClick: showModal,
|
|
5168
5284
|
type: "primary"
|
|
5169
|
-
},
|
|
5285
|
+
}, buttonText)), needModalTable && isModalVisible && /*#__PURE__*/React.createElement(Modal, {
|
|
5170
5286
|
width: '1200px',
|
|
5171
5287
|
style: {
|
|
5172
5288
|
top: 20
|
|
@@ -5221,7 +5337,7 @@ var AddSelect = function AddSelect(props) {
|
|
|
5221
5337
|
form: form,
|
|
5222
5338
|
layout: 'vertical',
|
|
5223
5339
|
key: 'modalForm'
|
|
5224
|
-
}, formItem(
|
|
5340
|
+
}, formItem(tableSearchForm)))), /*#__PURE__*/React.createElement("div", {
|
|
5225
5341
|
className: 'select_list_searchButton'
|
|
5226
5342
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
5227
5343
|
key: 'reset',
|
|
@@ -5380,7 +5496,7 @@ var getDictionaryTextByValue = function getDictionaryTextByValue(dicCode, value)
|
|
|
5380
5496
|
return dicItemArray[0].text;
|
|
5381
5497
|
};
|
|
5382
5498
|
|
|
5383
|
-
var loadSelectSource = function loadSelectSource(url, params) {
|
|
5499
|
+
var loadSelectSource$1 = function loadSelectSource(url, params) {
|
|
5384
5500
|
return new Promise(function (resolve, reject) {
|
|
5385
5501
|
axios.get("".concat(url, "?").concat(stringify(params))).then(function (result) {
|
|
5386
5502
|
var _result, _result2;
|
|
@@ -5587,14 +5703,14 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
|
|
|
5587
5703
|
label: '共享类型',
|
|
5588
5704
|
initialSource: sharingTypeDataList
|
|
5589
5705
|
}];
|
|
5590
|
-
Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/company"), {
|
|
5706
|
+
Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/company"), {
|
|
5591
5707
|
pageSize: 5000,
|
|
5592
5708
|
currentPage: 1,
|
|
5593
5709
|
'qp-companyType-eq': '30'
|
|
5594
|
-
}), loadSelectSource("".concat(prefixUrl.formSelectFix, "/accountingSubject"), {
|
|
5710
|
+
}), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/accountingSubject"), {
|
|
5595
5711
|
pageSize: 5000,
|
|
5596
5712
|
currentPage: 1
|
|
5597
|
-
}), loadSelectSource("".concat(prefixUrl.formSelectFix, "/company"), {
|
|
5713
|
+
}), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/company"), {
|
|
5598
5714
|
pageSize: 5000,
|
|
5599
5715
|
currentPage: 1,
|
|
5600
5716
|
'qp-companyType-eq': '20'
|
|
@@ -5682,7 +5798,7 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
|
|
|
5682
5798
|
}
|
|
5683
5799
|
}
|
|
5684
5800
|
}];
|
|
5685
|
-
Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/org/listNoPage"), {}), loadSelectSource("".concat(prefixUrl.formSelectFix, "/org/listNoPage"), {})]).then(function (x) {
|
|
5801
|
+
Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/org/listNoPage"), {}), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/org/listNoPage"), {})]).then(function (x) {
|
|
5686
5802
|
formatSource(x, 0, 2, tableSearchForm);
|
|
5687
5803
|
formatSource(x, 1, 3, tableSearchForm);
|
|
5688
5804
|
});
|
|
@@ -5912,14 +6028,14 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
|
|
|
5912
6028
|
}
|
|
5913
6029
|
}
|
|
5914
6030
|
}];
|
|
5915
|
-
Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/brand/queryBrandList"), {
|
|
6031
|
+
Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/brand/queryBrandList"), {
|
|
5916
6032
|
pageSize: 5000,
|
|
5917
6033
|
currentPage: 1,
|
|
5918
6034
|
'ctl-withAuth': true
|
|
5919
|
-
}), loadSelectSource("".concat(prefixUrl.formSelectFix, "/category/queryCategoryTree"), {
|
|
6035
|
+
}), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/category/queryCategoryTree"), {
|
|
5920
6036
|
pageSize: 5000,
|
|
5921
6037
|
currentPage: 1
|
|
5922
|
-
}), loadSelectSource("".concat(prefixUrl.formSelectFix, "/class/withProperty"), {
|
|
6038
|
+
}), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/class/withProperty"), {
|
|
5923
6039
|
pageSize: 5000,
|
|
5924
6040
|
currentPage: 1
|
|
5925
6041
|
})]).then(function (x) {
|
|
@@ -6075,14 +6191,14 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
|
|
|
6075
6191
|
}
|
|
6076
6192
|
}
|
|
6077
6193
|
}];
|
|
6078
|
-
Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/brand/queryBrandList"), {
|
|
6194
|
+
Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/brand/queryBrandList"), {
|
|
6079
6195
|
pageSize: 5000,
|
|
6080
6196
|
currentPage: 1,
|
|
6081
6197
|
'ctl-withAuth': true
|
|
6082
|
-
}), loadSelectSource("".concat(prefixUrl.formSelectFix, "/category/queryCategoryTree"), {
|
|
6198
|
+
}), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/category/queryCategoryTree"), {
|
|
6083
6199
|
pageSize: 5000,
|
|
6084
6200
|
currentPage: 1
|
|
6085
|
-
}), loadSelectSource("".concat(prefixUrl.formSelectFix, "/class/withProperty"), {
|
|
6201
|
+
}), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/class/withProperty"), {
|
|
6086
6202
|
pageSize: 5000,
|
|
6087
6203
|
currentPage: 1
|
|
6088
6204
|
})]).then(function (x) {
|
|
@@ -6173,7 +6289,7 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
|
|
|
6173
6289
|
}
|
|
6174
6290
|
}
|
|
6175
6291
|
}];
|
|
6176
|
-
Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/company"), {
|
|
6292
|
+
Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/company"), {
|
|
6177
6293
|
pageSize: 5000,
|
|
6178
6294
|
currentPage: 1,
|
|
6179
6295
|
'qp-companyType-eq': 20
|
|
@@ -6361,14 +6477,14 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
|
|
|
6361
6477
|
label: '共享类型',
|
|
6362
6478
|
initialSource: sharingTypeDataList
|
|
6363
6479
|
}];
|
|
6364
|
-
Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/company"), {
|
|
6480
|
+
Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/company"), {
|
|
6365
6481
|
pageSize: 5000,
|
|
6366
6482
|
currentPage: 1,
|
|
6367
6483
|
'qp-companyType-eq': '30'
|
|
6368
|
-
}), loadSelectSource("".concat(prefixUrl.formSelectFix, "/accountingSubject"), {
|
|
6484
|
+
}), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/accountingSubject"), {
|
|
6369
6485
|
pageSize: 5000,
|
|
6370
6486
|
currentPage: 1
|
|
6371
|
-
}), loadSelectSource("".concat(prefixUrl.formSelectFix, "/company"), {
|
|
6487
|
+
}), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/company"), {
|
|
6372
6488
|
pageSize: 5000,
|
|
6373
6489
|
currentPage: 1,
|
|
6374
6490
|
'qp-companyType-eq': '20'
|
|
@@ -6466,7 +6582,7 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
|
|
|
6466
6582
|
}
|
|
6467
6583
|
}
|
|
6468
6584
|
}];
|
|
6469
|
-
Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/org/listNoPage"), {}), loadSelectSource("".concat(prefixUrl.formSelectFix, "/org/listNoPage"), {})]).then(function (x) {
|
|
6585
|
+
Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/org/listNoPage"), {}), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/org/listNoPage"), {})]).then(function (x) {
|
|
6470
6586
|
formatSource(x, 0, 2, tableSearchForm);
|
|
6471
6587
|
formatSource(x, 1, 3, tableSearchForm);
|
|
6472
6588
|
});
|
|
@@ -6589,19 +6705,19 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
|
|
|
6589
6705
|
}
|
|
6590
6706
|
}
|
|
6591
6707
|
}];
|
|
6592
|
-
Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/company"), {
|
|
6708
|
+
Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/company"), {
|
|
6593
6709
|
pageSize: 5000,
|
|
6594
6710
|
currentPage: 1,
|
|
6595
6711
|
'qp-companyType-eq': '30'
|
|
6596
|
-
}), loadSelectSource("".concat(prefixUrl.formSelectFix, "/company"), {
|
|
6712
|
+
}), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/company"), {
|
|
6597
6713
|
pageSize: 5000,
|
|
6598
6714
|
currentPage: 1,
|
|
6599
6715
|
'qp-companyType-eq': '20'
|
|
6600
|
-
}), loadSelectSource("".concat(prefixUrl.formSelectFix, "/platformRecord/getPlatformRecordList"), {
|
|
6716
|
+
}), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/platformRecord/getPlatformRecordList"), {
|
|
6601
6717
|
// pageSize: 5000,
|
|
6602
6718
|
// currentPage: 1,
|
|
6603
6719
|
'qp-status-eq': '1'
|
|
6604
|
-
}), loadSelectSource("".concat(prefixUrl.formSelectFix, "/accountingSubject"), {
|
|
6720
|
+
}), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/accountingSubject"), {
|
|
6605
6721
|
pageSize: 5000,
|
|
6606
6722
|
currentPage: 1
|
|
6607
6723
|
})]).then(function (x) {
|
|
@@ -6689,7 +6805,7 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
|
|
|
6689
6805
|
}
|
|
6690
6806
|
}
|
|
6691
6807
|
}];
|
|
6692
|
-
Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/orgView/getTree/sales-organizational-view"), {
|
|
6808
|
+
Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/orgView/getTree/sales-organizational-view"), {
|
|
6693
6809
|
'qp-employeeCode-eq': (_JSON$parse = JSON.parse(localStorage.getItem('userInfo') || '{}')) === null || _JSON$parse === void 0 ? void 0 : (_JSON$parse$employeeR = _JSON$parse.employeeResVo) === null || _JSON$parse$employeeR === void 0 ? void 0 : _JSON$parse$employeeR.employeeNumber,
|
|
6694
6810
|
'qp-realOrg-eq': true,
|
|
6695
6811
|
'qp-status-eq': 10
|
|
@@ -6816,7 +6932,7 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
|
|
|
6816
6932
|
name: 'qp-officeTelephone-like',
|
|
6817
6933
|
label: '手机号'
|
|
6818
6934
|
}];
|
|
6819
|
-
Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/company"), {
|
|
6935
|
+
Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/company"), {
|
|
6820
6936
|
pageSize: 5000,
|
|
6821
6937
|
currentPage: 1,
|
|
6822
6938
|
'qp-companyType-eq': 20
|
|
@@ -6891,7 +7007,7 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
|
|
|
6891
7007
|
name: 'qp-officeTelephone-like',
|
|
6892
7008
|
label: '手机号'
|
|
6893
7009
|
}];
|
|
6894
|
-
Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/org/listNoPage"), {})]).then(function (x) {
|
|
7010
|
+
Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/org/listNoPage"), {})]).then(function (x) {
|
|
6895
7011
|
formatSource(x, 0, 2, tableSearchForm);
|
|
6896
7012
|
});
|
|
6897
7013
|
modalTableProps = _objectSpread2({
|
|
@@ -6987,10 +7103,10 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
|
|
|
6987
7103
|
name: 'qp-remark-like',
|
|
6988
7104
|
label: '备注'
|
|
6989
7105
|
}];
|
|
6990
|
-
Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/logisCompany"), {
|
|
7106
|
+
Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/logisCompany"), {
|
|
6991
7107
|
pageSize: 5000,
|
|
6992
7108
|
currentPage: 1
|
|
6993
|
-
}), loadSelectSource("".concat(prefixUrl.formSelectFix, "/printTemplate"), {
|
|
7109
|
+
}), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/printTemplate"), {
|
|
6994
7110
|
pageSize: 5000,
|
|
6995
7111
|
currentPage: 1
|
|
6996
7112
|
})]).then(function (x) {
|
|
@@ -7078,18 +7194,325 @@ var BusinessSearchSelect$1 = /*#__PURE__*/React.memo(BusinessSearchSelect, funct
|
|
|
7078
7194
|
return true;
|
|
7079
7195
|
});
|
|
7080
7196
|
|
|
7197
|
+
var AddSkuSelect = function AddSkuSelect(parProps) {
|
|
7198
|
+
var selectProps = {
|
|
7199
|
+
mode: 'multiple'
|
|
7200
|
+
};
|
|
7201
|
+
|
|
7202
|
+
var _useState = useState((selectProps === null || selectProps === void 0 ? void 0 : selectProps.mode) ? [] : null),
|
|
7203
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
7204
|
+
value = _useState2[0],
|
|
7205
|
+
setValue = _useState2[1];
|
|
7206
|
+
|
|
7207
|
+
var props = {
|
|
7208
|
+
buttonText: parProps.buttonText || '新增',
|
|
7209
|
+
value: value,
|
|
7210
|
+
// labelInValue: true, // 非必填 默认为false
|
|
7211
|
+
requestConfig: {
|
|
7212
|
+
url: "/items/sku/pager/v2",
|
|
7213
|
+
filter: 'qp-name-like',
|
|
7214
|
+
otherParams: {},
|
|
7215
|
+
mappingTextField: 'name',
|
|
7216
|
+
mappingValueField: 'skuCode'
|
|
7217
|
+
},
|
|
7218
|
+
selectProps: selectProps,
|
|
7219
|
+
onChange: function onChange(value) {
|
|
7220
|
+
console.log(value);
|
|
7221
|
+
setValue(value);
|
|
7222
|
+
},
|
|
7223
|
+
onSaveCallback: parProps.onSaveCallback // onSaveCallback: (rows) => {
|
|
7224
|
+
// console.log('save call', rows);
|
|
7225
|
+
// // return Promise.resolve(true);
|
|
7226
|
+
// // return Promise.reject('FAILE')
|
|
7227
|
+
// }
|
|
7228
|
+
|
|
7229
|
+
};
|
|
7230
|
+
var modalTableProps = {
|
|
7231
|
+
modalTableTitle: '选择商品',
|
|
7232
|
+
tableSearchForm: [{
|
|
7233
|
+
name: 'qp-skuCode-like',
|
|
7234
|
+
label: 'SKU编码'
|
|
7235
|
+
}, {
|
|
7236
|
+
name: 'qp-skuName-like',
|
|
7237
|
+
label: 'SKU名称'
|
|
7238
|
+
}, {
|
|
7239
|
+
name: 'qp-brandId-in',
|
|
7240
|
+
type: 'select',
|
|
7241
|
+
label: '品牌',
|
|
7242
|
+
field: {
|
|
7243
|
+
type: 'select',
|
|
7244
|
+
props: {
|
|
7245
|
+
mode: 'multiple',
|
|
7246
|
+
notFoundContent: '暂无数据',
|
|
7247
|
+
allowClear: true,
|
|
7248
|
+
showSearch: true,
|
|
7249
|
+
showArrow: true,
|
|
7250
|
+
maxTagCount: 1,
|
|
7251
|
+
optionFilterProp: 'children',
|
|
7252
|
+
filterOption: function filterOption(input, option) {
|
|
7253
|
+
return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
|
7254
|
+
}
|
|
7255
|
+
}
|
|
7256
|
+
}
|
|
7257
|
+
}, {
|
|
7258
|
+
name: 'qp-categoryId-in',
|
|
7259
|
+
type: 'treeSelect',
|
|
7260
|
+
label: '类目',
|
|
7261
|
+
field: {
|
|
7262
|
+
type: 'treeSelect',
|
|
7263
|
+
props: {
|
|
7264
|
+
treeData: [],
|
|
7265
|
+
treeCheckable: true,
|
|
7266
|
+
showSearch: true,
|
|
7267
|
+
allowClear: true,
|
|
7268
|
+
showArrow: true,
|
|
7269
|
+
treeNodeFilterProp: 'title',
|
|
7270
|
+
treeDefaultExpandAll: true,
|
|
7271
|
+
maxTagCount: 1,
|
|
7272
|
+
placeholder: '请选择',
|
|
7273
|
+
style: {
|
|
7274
|
+
width: '100%'
|
|
7275
|
+
},
|
|
7276
|
+
dropdownStyle: {
|
|
7277
|
+
maxHeight: 400,
|
|
7278
|
+
maxWidth: 100,
|
|
7279
|
+
overflow: 'auto'
|
|
7280
|
+
}
|
|
7281
|
+
}
|
|
7282
|
+
}
|
|
7283
|
+
}],
|
|
7284
|
+
tableColumns: [{
|
|
7285
|
+
title: 'SKU编码',
|
|
7286
|
+
width: 150,
|
|
7287
|
+
dataIndex: 'skuCode'
|
|
7288
|
+
}, {
|
|
7289
|
+
title: 'SKU名称',
|
|
7290
|
+
width: 200,
|
|
7291
|
+
ellipsis: {
|
|
7292
|
+
showTitle: false
|
|
7293
|
+
},
|
|
7294
|
+
render: function render(text) {
|
|
7295
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
7296
|
+
placement: "topLeft",
|
|
7297
|
+
title: text
|
|
7298
|
+
}, text);
|
|
7299
|
+
},
|
|
7300
|
+
dataIndex: 'name'
|
|
7301
|
+
}, {
|
|
7302
|
+
title: '国际条码',
|
|
7303
|
+
width: 100,
|
|
7304
|
+
ellipsis: {
|
|
7305
|
+
showTitle: false
|
|
7306
|
+
},
|
|
7307
|
+
dataIndex: 'barCode',
|
|
7308
|
+
render: function render(text) {
|
|
7309
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
7310
|
+
placement: "topLeft",
|
|
7311
|
+
title: text
|
|
7312
|
+
}, text);
|
|
7313
|
+
}
|
|
7314
|
+
}, {
|
|
7315
|
+
title: '所属SPU名称',
|
|
7316
|
+
width: 100,
|
|
7317
|
+
ellipsis: {
|
|
7318
|
+
showTitle: false
|
|
7319
|
+
},
|
|
7320
|
+
dataIndex: 'itemName',
|
|
7321
|
+
render: function render(text) {
|
|
7322
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
7323
|
+
placement: "topLeft",
|
|
7324
|
+
title: text
|
|
7325
|
+
}, text);
|
|
7326
|
+
}
|
|
7327
|
+
}, {
|
|
7328
|
+
title: '所属SPU编码',
|
|
7329
|
+
width: 100,
|
|
7330
|
+
ellipsis: {
|
|
7331
|
+
showTitle: false
|
|
7332
|
+
},
|
|
7333
|
+
dataIndex: 'itemCode',
|
|
7334
|
+
render: function render(text) {
|
|
7335
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
7336
|
+
placement: "topLeft",
|
|
7337
|
+
title: text
|
|
7338
|
+
}, text);
|
|
7339
|
+
}
|
|
7340
|
+
}, {
|
|
7341
|
+
title: '外部编码',
|
|
7342
|
+
width: 100,
|
|
7343
|
+
ellipsis: {
|
|
7344
|
+
showTitle: false
|
|
7345
|
+
},
|
|
7346
|
+
render: function render(text) {
|
|
7347
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
7348
|
+
placement: "topLeft",
|
|
7349
|
+
title: text
|
|
7350
|
+
}, text);
|
|
7351
|
+
},
|
|
7352
|
+
dataIndex: 'externalCode'
|
|
7353
|
+
}, {
|
|
7354
|
+
title: '规格',
|
|
7355
|
+
width: 100,
|
|
7356
|
+
ellipsis: {
|
|
7357
|
+
showTitle: false
|
|
7358
|
+
},
|
|
7359
|
+
render: function render(text) {
|
|
7360
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
7361
|
+
placement: "topLeft",
|
|
7362
|
+
title: text
|
|
7363
|
+
}, text);
|
|
7364
|
+
},
|
|
7365
|
+
dataIndex: 'propertyNameAndValue'
|
|
7366
|
+
}, {
|
|
7367
|
+
title: '类目',
|
|
7368
|
+
width: 100,
|
|
7369
|
+
ellipsis: {
|
|
7370
|
+
showTitle: false
|
|
7371
|
+
},
|
|
7372
|
+
render: function render(text) {
|
|
7373
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
7374
|
+
placement: "topLeft",
|
|
7375
|
+
title: text
|
|
7376
|
+
}, text);
|
|
7377
|
+
},
|
|
7378
|
+
dataIndex: 'categoryName'
|
|
7379
|
+
}, {
|
|
7380
|
+
title: '品类',
|
|
7381
|
+
width: 100,
|
|
7382
|
+
ellipsis: {
|
|
7383
|
+
showTitle: false
|
|
7384
|
+
},
|
|
7385
|
+
render: function render(text) {
|
|
7386
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
7387
|
+
placement: "topLeft",
|
|
7388
|
+
title: text
|
|
7389
|
+
}, text);
|
|
7390
|
+
},
|
|
7391
|
+
dataIndex: 'className'
|
|
7392
|
+
}, {
|
|
7393
|
+
title: '品牌',
|
|
7394
|
+
width: 100,
|
|
7395
|
+
ellipsis: {
|
|
7396
|
+
showTitle: false
|
|
7397
|
+
},
|
|
7398
|
+
render: function render(text) {
|
|
7399
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
7400
|
+
placement: "topLeft",
|
|
7401
|
+
title: text
|
|
7402
|
+
}, text);
|
|
7403
|
+
},
|
|
7404
|
+
dataIndex: 'brandName'
|
|
7405
|
+
}],
|
|
7406
|
+
selectColumn: [{
|
|
7407
|
+
title: 'SKU编码',
|
|
7408
|
+
width: 150,
|
|
7409
|
+
dataIndex: 'skuCode'
|
|
7410
|
+
}, {
|
|
7411
|
+
title: 'SKU名称',
|
|
7412
|
+
width: 200,
|
|
7413
|
+
ellipsis: {
|
|
7414
|
+
showTitle: false
|
|
7415
|
+
},
|
|
7416
|
+
render: function render(text) {
|
|
7417
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
7418
|
+
placement: "topLeft",
|
|
7419
|
+
title: text
|
|
7420
|
+
}, text);
|
|
7421
|
+
},
|
|
7422
|
+
dataIndex: 'name'
|
|
7423
|
+
}, {
|
|
7424
|
+
title: '数量',
|
|
7425
|
+
width: 100,
|
|
7426
|
+
isInputItem: true,
|
|
7427
|
+
dataIndex: 'count'
|
|
7428
|
+
}, {
|
|
7429
|
+
title: '单位',
|
|
7430
|
+
dataIndex: 'selectUnitCode',
|
|
7431
|
+
width: 80,
|
|
7432
|
+
ellipsis: {
|
|
7433
|
+
showTitle: false
|
|
7434
|
+
},
|
|
7435
|
+
render: function render(text, record) {
|
|
7436
|
+
var baseUnitCode = '';
|
|
7437
|
+
|
|
7438
|
+
if (record === null || record === void 0 ? void 0 : record.packingUnitList) {
|
|
7439
|
+
var base = record.packingUnitList.filter(function (item) {
|
|
7440
|
+
return item.unitCode;
|
|
7441
|
+
});
|
|
7442
|
+
|
|
7443
|
+
if (base.length) {
|
|
7444
|
+
baseUnitCode = base[0].unitCode;
|
|
7445
|
+
record.selectUnitCode = base[0].unitCode;
|
|
7446
|
+
}
|
|
7447
|
+
}
|
|
7448
|
+
|
|
7449
|
+
if (baseUnitCode) {
|
|
7450
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Select, {
|
|
7451
|
+
defaultValue: baseUnitCode,
|
|
7452
|
+
onChange: function onChange(value) {
|
|
7453
|
+
record.selectUnitCode = value;
|
|
7454
|
+
},
|
|
7455
|
+
style: {
|
|
7456
|
+
width: '60px'
|
|
7457
|
+
}
|
|
7458
|
+
}, record.packingUnitList && record.packingUnitList.map(function (item) {
|
|
7459
|
+
return /*#__PURE__*/React.createElement(Select.Option, {
|
|
7460
|
+
value: item.unitCode
|
|
7461
|
+
}, item.name);
|
|
7462
|
+
})));
|
|
7463
|
+
}
|
|
7464
|
+
|
|
7465
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
7466
|
+
}
|
|
7467
|
+
}, {
|
|
7468
|
+
title: '所属SPU编码',
|
|
7469
|
+
width: 150,
|
|
7470
|
+
ellipsis: {
|
|
7471
|
+
showTitle: false
|
|
7472
|
+
},
|
|
7473
|
+
dataIndex: 'itemCode',
|
|
7474
|
+
render: function render(text) {
|
|
7475
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
7476
|
+
placement: "topLeft",
|
|
7477
|
+
title: text
|
|
7478
|
+
}, text);
|
|
7479
|
+
}
|
|
7480
|
+
}, {
|
|
7481
|
+
title: '规格',
|
|
7482
|
+
width: 200,
|
|
7483
|
+
ellipsis: {
|
|
7484
|
+
showTitle: false
|
|
7485
|
+
},
|
|
7486
|
+
render: function render(text) {
|
|
7487
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
7488
|
+
placement: "topLeft",
|
|
7489
|
+
title: text
|
|
7490
|
+
}, text);
|
|
7491
|
+
},
|
|
7492
|
+
dataIndex: 'propertyNameAndValue'
|
|
7493
|
+
}]
|
|
7494
|
+
};
|
|
7495
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(AddSelect, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
7496
|
+
modalTableProps: modalTableProps
|
|
7497
|
+
})));
|
|
7498
|
+
};
|
|
7499
|
+
|
|
7081
7500
|
var CommodityEntry = function CommodityEntry(props) {
|
|
7082
7501
|
var dataValidationRef = useRef();
|
|
7083
7502
|
var _props$buttonName = props.buttonName,
|
|
7084
7503
|
buttonName = _props$buttonName === void 0 ? ' + 录入商品' : _props$buttonName,
|
|
7085
7504
|
_props$modalTitle = props.modalTitle,
|
|
7086
7505
|
modalTitle = _props$modalTitle === void 0 ? '录入商品' : _props$modalTitle,
|
|
7506
|
+
_props$buttonProps = props.buttonProps,
|
|
7507
|
+
buttonProps = _props$buttonProps === void 0 ? {} : _props$buttonProps,
|
|
7087
7508
|
callbackHideModal = props.callbackHideModal,
|
|
7088
7509
|
callbackHandleOk = props.callbackHandleOk,
|
|
7089
7510
|
_props$columns = props.columns,
|
|
7090
7511
|
columns = _props$columns === void 0 ? ["skuCode", "quantity", "price"] : _props$columns,
|
|
7091
7512
|
_props$validDataUrl = props.validDataUrl,
|
|
7092
|
-
validDataUrl = _props$validDataUrl === void 0 ? "/items/
|
|
7513
|
+
validDataUrl = _props$validDataUrl === void 0 ? "/items/sku/import/check" : _props$validDataUrl,
|
|
7514
|
+
_props$isBrandAuth = props.isBrandAuth,
|
|
7515
|
+
isBrandAuth = _props$isBrandAuth === void 0 ? true : _props$isBrandAuth;
|
|
7093
7516
|
|
|
7094
7517
|
var _useState = useState({
|
|
7095
7518
|
maskClosable: false,
|
|
@@ -7140,9 +7563,9 @@ var CommodityEntry = function CommodityEntry(props) {
|
|
|
7140
7563
|
modalProps.hideModal();
|
|
7141
7564
|
};
|
|
7142
7565
|
|
|
7143
|
-
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
|
|
7566
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, _objectSpread2({
|
|
7144
7567
|
onClick: handleShowModal
|
|
7145
|
-
}, buttonName), modalProps.visible && /*#__PURE__*/React.createElement(Modal, _objectSpread2(_objectSpread2({}, modalProps), {}, {
|
|
7568
|
+
}, buttonProps), buttonName), modalProps.visible && /*#__PURE__*/React.createElement(Modal, _objectSpread2(_objectSpread2({}, modalProps), {}, {
|
|
7146
7569
|
onOk: handleOk,
|
|
7147
7570
|
onCancel: handleCancel,
|
|
7148
7571
|
destroyOnClose: true,
|
|
@@ -7152,7 +7575,8 @@ var CommodityEntry = function CommodityEntry(props) {
|
|
|
7152
7575
|
dataValidationRef = ref;
|
|
7153
7576
|
},
|
|
7154
7577
|
columns: columns,
|
|
7155
|
-
validDataUrl: validDataUrl
|
|
7578
|
+
validDataUrl: validDataUrl,
|
|
7579
|
+
isBrandAuth: isBrandAuth
|
|
7156
7580
|
})) || '');
|
|
7157
7581
|
};
|
|
7158
7582
|
|
|
@@ -7544,4 +7968,4 @@ if (localStorage.getItem('x-user-auth-context')) {
|
|
|
7544
7968
|
axios.defaults.headers.common['x-user-auth-context'] = localStorage.getItem('x-user-auth-context');
|
|
7545
7969
|
}
|
|
7546
7970
|
|
|
7547
|
-
export { AddSelect, BusinessSearchSelect$1 as BusinessSearchSelect, index$1 as BusinessTreeSearchSelect, index as CheckOneUser, CommodityEntry, DataImport, DataValidation, QueryMutipleInput, SearchSelect, TreeSearchSelect };
|
|
7971
|
+
export { AddSelect, AddSkuSelect, BusinessSearchSelect$1 as BusinessSearchSelect, index$1 as BusinessTreeSearchSelect, index as CheckOneUser, CommodityEntry, DataImport, DataValidation, QueryMutipleInput, SearchSelect, TreeSearchSelect };
|