@bit-sun/business-component 1.1.25 → 1.1.28
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/SearchSelect/BusinessUtils.d.ts +3 -21
- package/dist/components/Business/SearchSelect/index.d.ts +3 -2
- package/dist/index.esm.js +137 -120
- package/dist/index.js +137 -120
- package/package.json +1 -1
- package/src/components/Business/SearchSelect/BusinessUtils.ts +31 -10
- package/src/components/Business/SearchSelect/index.md +4 -7
- package/src/components/Business/SearchSelect/index.tsx +28 -11
- package/src/components/Functional/SearchSelect/index.tsx +70 -66
package/dist/index.js
CHANGED
|
@@ -305,9 +305,10 @@ function ownKeys$1(object, enumerableOnly) {
|
|
|
305
305
|
|
|
306
306
|
if (Object.getOwnPropertySymbols) {
|
|
307
307
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
308
|
-
enumerableOnly
|
|
308
|
+
if (enumerableOnly) symbols = symbols.filter(function (sym) {
|
|
309
309
|
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
310
|
-
})
|
|
310
|
+
});
|
|
311
|
+
keys.push.apply(keys, symbols);
|
|
311
312
|
}
|
|
312
313
|
|
|
313
314
|
return keys;
|
|
@@ -315,12 +316,19 @@ function ownKeys$1(object, enumerableOnly) {
|
|
|
315
316
|
|
|
316
317
|
function _objectSpread2$1(target) {
|
|
317
318
|
for (var i = 1; i < arguments.length; i++) {
|
|
318
|
-
var source =
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
319
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
320
|
+
|
|
321
|
+
if (i % 2) {
|
|
322
|
+
ownKeys$1(Object(source), true).forEach(function (key) {
|
|
323
|
+
_defineProperty$1(target, key, source[key]);
|
|
324
|
+
});
|
|
325
|
+
} else if (Object.getOwnPropertyDescriptors) {
|
|
326
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
327
|
+
} else {
|
|
328
|
+
ownKeys$1(Object(source)).forEach(function (key) {
|
|
329
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
330
|
+
});
|
|
331
|
+
}
|
|
324
332
|
}
|
|
325
333
|
|
|
326
334
|
return target;
|
|
@@ -331,17 +339,14 @@ function _arrayWithHoles$1(arr) {
|
|
|
331
339
|
}
|
|
332
340
|
|
|
333
341
|
function _iterableToArrayLimit$1(arr, i) {
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
if (_i == null) return;
|
|
342
|
+
if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
|
|
337
343
|
var _arr = [];
|
|
338
344
|
var _n = true;
|
|
339
345
|
var _d = false;
|
|
340
|
-
|
|
341
|
-
var _s, _e;
|
|
346
|
+
var _e = undefined;
|
|
342
347
|
|
|
343
348
|
try {
|
|
344
|
-
for (_i =
|
|
349
|
+
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
|
|
345
350
|
_arr.push(_s.value);
|
|
346
351
|
|
|
347
352
|
if (i && _arr.length === i) break;
|
|
@@ -424,11 +429,17 @@ function _objectWithoutProperties$1(source, excluded) {
|
|
|
424
429
|
function _typeof(obj) {
|
|
425
430
|
"@babel/helpers - typeof";
|
|
426
431
|
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
}
|
|
432
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
433
|
+
_typeof = function _typeof(obj) {
|
|
434
|
+
return typeof obj;
|
|
435
|
+
};
|
|
436
|
+
} else {
|
|
437
|
+
_typeof = function _typeof(obj) {
|
|
438
|
+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
439
|
+
};
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
return _typeof(obj);
|
|
432
443
|
}
|
|
433
444
|
|
|
434
445
|
/**
|
|
@@ -2418,7 +2429,9 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
2418
2429
|
ctx = props.ctx,
|
|
2419
2430
|
sourceName = props.sourceName,
|
|
2420
2431
|
_props$needModalTable = props.needModalTable,
|
|
2421
|
-
needModalTable = _props$needModalTable === void 0 ? true : _props$needModalTable
|
|
2432
|
+
needModalTable = _props$needModalTable === void 0 ? true : _props$needModalTable,
|
|
2433
|
+
_props$getPopupContai = props.getPopupContainer,
|
|
2434
|
+
_getPopupContainer = _props$getPopupContai === void 0 ? undefined : _props$getPopupContai;
|
|
2422
2435
|
|
|
2423
2436
|
var _ref = requestConfig || {},
|
|
2424
2437
|
url = _ref.url,
|
|
@@ -2817,18 +2830,21 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
2817
2830
|
}
|
|
2818
2831
|
};
|
|
2819
2832
|
|
|
2820
|
-
var
|
|
2821
|
-
if (
|
|
2833
|
+
var handleSelectOver = function handleSelectOver(selectedValue) {
|
|
2834
|
+
if (selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.length) {
|
|
2822
2835
|
var _ctx$form2;
|
|
2823
2836
|
|
|
2824
|
-
formaData(
|
|
2837
|
+
formaData(selectedValue); // 解决选择最后1页的sku,返回后,不显示名称问题
|
|
2825
2838
|
|
|
2826
|
-
var source = ___default['default'].uniqBy(items.concat(
|
|
2839
|
+
var source = ___default['default'].uniqBy(items.concat(selectedValue), 'value');
|
|
2827
2840
|
|
|
2828
2841
|
ctx === null || ctx === void 0 ? void 0 : (_ctx$form2 = ctx.form) === null || _ctx$form2 === void 0 ? void 0 : _ctx$form2.setFieldSource(resultSourceKey, source);
|
|
2829
2842
|
setItems(source);
|
|
2830
2843
|
}
|
|
2844
|
+
};
|
|
2831
2845
|
|
|
2846
|
+
var handleOk = function handleOk() {
|
|
2847
|
+
handleSelectOver(popvalue);
|
|
2832
2848
|
handleCancel();
|
|
2833
2849
|
};
|
|
2834
2850
|
|
|
@@ -2975,7 +2991,9 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
2975
2991
|
filterRows = selectRows;
|
|
2976
2992
|
sksResult = selectRows.map(function (i) {
|
|
2977
2993
|
return i.value;
|
|
2978
|
-
});
|
|
2994
|
+
}); // 单选直接选中 不需要确定
|
|
2995
|
+
|
|
2996
|
+
handleSelectOver(filterRows);
|
|
2979
2997
|
}
|
|
2980
2998
|
|
|
2981
2999
|
setSelectedRowKeys(sksResult);
|
|
@@ -3072,23 +3090,19 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3072
3090
|
}
|
|
3073
3091
|
};
|
|
3074
3092
|
|
|
3075
|
-
var
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
var newValue = JSON.parse(JSON.stringify(value)).filter(function (i) {
|
|
3086
|
-
return i !== item.value;
|
|
3087
|
-
});
|
|
3088
|
-
onChange(newValue);
|
|
3089
|
-
};
|
|
3093
|
+
var maxTagPlaceholder = function maxTagPlaceholder(selectedValues) {
|
|
3094
|
+
var _onClose = function onClose(e, item) {
|
|
3095
|
+
e.preventDefault();
|
|
3096
|
+
var newValue = labelInValue ? JSON.parse(JSON.stringify(value)).filter(function (i) {
|
|
3097
|
+
return i.value !== item.value;
|
|
3098
|
+
}) : JSON.parse(JSON.stringify(value)).filter(function (i) {
|
|
3099
|
+
return i !== item.value;
|
|
3100
|
+
});
|
|
3101
|
+
onChange(newValue);
|
|
3102
|
+
};
|
|
3090
3103
|
|
|
3091
|
-
|
|
3104
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
|
|
3105
|
+
title: selectedValues.map(function (i) {
|
|
3092
3106
|
return /*#__PURE__*/React__default['default'].createElement(antd.Tag, {
|
|
3093
3107
|
closable: true,
|
|
3094
3108
|
onClose: function onClose(e) {
|
|
@@ -3100,13 +3114,9 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3100
3114
|
height: '24px',
|
|
3101
3115
|
border: '1px solid #f0f0f0'
|
|
3102
3116
|
}
|
|
3103
|
-
}, i.
|
|
3104
|
-
})
|
|
3105
|
-
}
|
|
3106
|
-
setTooltipVisible(false);
|
|
3107
|
-
}
|
|
3108
|
-
|
|
3109
|
-
return '';
|
|
3117
|
+
}, i.label);
|
|
3118
|
+
})
|
|
3119
|
+
}, "+ ".concat(selectedValues === null || selectedValues === void 0 ? void 0 : selectedValues.length));
|
|
3110
3120
|
};
|
|
3111
3121
|
|
|
3112
3122
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
@@ -3114,15 +3124,6 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3114
3124
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3115
3125
|
className: "search_select_show",
|
|
3116
3126
|
id: "search_select_div_".concat(uniqueValue)
|
|
3117
|
-
}, /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
|
|
3118
|
-
title: TooltipContent,
|
|
3119
|
-
visible: tooltipVisible,
|
|
3120
|
-
trigger: 'hover',
|
|
3121
|
-
onVisibleChange: function onVisibleChange(visible) {
|
|
3122
|
-
if (selectMode && value && (value === null || value === void 0 ? void 0 : value.length)) {
|
|
3123
|
-
setTooltipVisible(visible);
|
|
3124
|
-
}
|
|
3125
|
-
}
|
|
3126
3127
|
}, /*#__PURE__*/React__default['default'].createElement(antd.Select, _objectSpread2(_objectSpread2({
|
|
3127
3128
|
virtual: true,
|
|
3128
3129
|
labelInValue: labelInValue,
|
|
@@ -3169,10 +3170,11 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3169
3170
|
style: {
|
|
3170
3171
|
width: needModalTable ? 'calc(100% - 30px)' : 'calc(100%)'
|
|
3171
3172
|
},
|
|
3172
|
-
placeholder: "\u8BF7\u9009\u62E9"
|
|
3173
|
+
placeholder: "\u8BF7\u9009\u62E9",
|
|
3174
|
+
maxTagPlaceholder: maxTagPlaceholder
|
|
3173
3175
|
}, currentSelectProps), {}, {
|
|
3174
3176
|
getPopupContainer: function getPopupContainer() {
|
|
3175
|
-
return document.getElementById("search_select_div_".concat(uniqueValue));
|
|
3177
|
+
return _getPopupContainer && _getPopupContainer() || document.getElementById("search_select_div_".concat(uniqueValue));
|
|
3176
3178
|
}
|
|
3177
3179
|
}), items.map(function (item) {
|
|
3178
3180
|
return /*#__PURE__*/React__default['default'].createElement(Option, {
|
|
@@ -3182,7 +3184,7 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3182
3184
|
text: "".concat(item.textShowKey, " ").concat(item.text),
|
|
3183
3185
|
filterTxt: searchValue
|
|
3184
3186
|
}));
|
|
3185
|
-
}))
|
|
3187
|
+
})), needModalTable && /*#__PURE__*/React__default['default'].createElement(antd.Button, {
|
|
3186
3188
|
style: {
|
|
3187
3189
|
width: '30px',
|
|
3188
3190
|
padding: '2px',
|
|
@@ -3196,7 +3198,7 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3196
3198
|
visible: isModalVisible,
|
|
3197
3199
|
onOk: handleOk,
|
|
3198
3200
|
onCancel: handleCancel,
|
|
3199
|
-
footer: [/*#__PURE__*/React__default['default'].createElement(antd.Button, {
|
|
3201
|
+
footer: selectMode ? [/*#__PURE__*/React__default['default'].createElement(antd.Button, {
|
|
3200
3202
|
key: "back",
|
|
3201
3203
|
onClick: handleCancel
|
|
3202
3204
|
}, "\u53D6\u6D88"), /*#__PURE__*/React__default['default'].createElement(antd.Button, {
|
|
@@ -3204,7 +3206,7 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3204
3206
|
type: "primary",
|
|
3205
3207
|
onClick: handleOk,
|
|
3206
3208
|
disabled: !tableData.length || (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled) || (props === null || props === void 0 ? void 0 : props.disabled)
|
|
3207
|
-
}, "\u786E\u5B9A")]
|
|
3209
|
+
}, "\u786E\u5B9A")] : null
|
|
3208
3210
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3209
3211
|
className: 'search_select_wrapper'
|
|
3210
3212
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
@@ -3370,16 +3372,15 @@ var loadSelectSource = function loadSelectSource(url, params) {
|
|
|
3370
3372
|
var _getDictionarySource;
|
|
3371
3373
|
var hasDictSharingType = (_getDictionarySource = getDictionarySource('UC000013')) === null || _getDictionarySource === void 0 ? void 0 : _getDictionarySource.length;
|
|
3372
3374
|
var sharingTypeDataList = hasDictSharingType && getDictionarySource('UC000013') || sharingType;
|
|
3373
|
-
function commonFun(type, prefixUrl) {
|
|
3375
|
+
function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
|
|
3374
3376
|
// 默认type === 'supplier' 供应商选择器
|
|
3375
|
-
var requestConfig = {
|
|
3377
|
+
var requestConfig = _objectSpread2({
|
|
3376
3378
|
url: "".concat(prefixUrl.selectPrefix, "/supplier"),
|
|
3377
3379
|
filter: 'qp-name,code-orGroup,like',
|
|
3378
3380
|
otherParams: {
|
|
3379
3381
|
sorter: 'desc-id'
|
|
3380
|
-
}
|
|
3381
|
-
|
|
3382
|
-
};
|
|
3382
|
+
}
|
|
3383
|
+
}, requestConfigProp);
|
|
3383
3384
|
/*
|
|
3384
3385
|
* 处理 格式化下拉框数据源
|
|
3385
3386
|
* reData 必传 promise返回响应的数据 格式为[{},{},{},...] Promise.all第一个参数数组有多少个数组长度就是多少,其中每个对象为每次请求的结果数据
|
|
@@ -3389,6 +3390,7 @@ function commonFun(type, prefixUrl) {
|
|
|
3389
3390
|
* changeSearchForm 必传 为搜索表单Form数据
|
|
3390
3391
|
* */
|
|
3391
3392
|
|
|
3393
|
+
|
|
3392
3394
|
var formatSource = function formatSource(reData, position, changePosition, changeSearchForm) {
|
|
3393
3395
|
var _reData$position;
|
|
3394
3396
|
|
|
@@ -3523,7 +3525,7 @@ function commonFun(type, prefixUrl) {
|
|
|
3523
3525
|
});
|
|
3524
3526
|
}
|
|
3525
3527
|
|
|
3526
|
-
var modalTableProps = {
|
|
3528
|
+
var modalTableProps = _objectSpread2({
|
|
3527
3529
|
modalTableTitle: '选择供应商',
|
|
3528
3530
|
tableSearchForm: tableSearchForm,
|
|
3529
3531
|
tableColumns: [{
|
|
@@ -3552,11 +3554,12 @@ function commonFun(type, prefixUrl) {
|
|
|
3552
3554
|
})) === null || _sharingType$find === void 0 ? void 0 : _sharingType$find.text;
|
|
3553
3555
|
}
|
|
3554
3556
|
}]
|
|
3555
|
-
};
|
|
3557
|
+
}, modalTableBusProps);
|
|
3558
|
+
|
|
3556
3559
|
var needModalTable = true; // 商品选择器
|
|
3557
3560
|
|
|
3558
3561
|
if (type === 'skuCommodity') {
|
|
3559
|
-
requestConfig = {
|
|
3562
|
+
requestConfig = _objectSpread2({
|
|
3560
3563
|
url: "".concat(prefixUrl.selectPrefix, "/sku"),
|
|
3561
3564
|
filter: 'qp-name,skuCode-orGroup,like',
|
|
3562
3565
|
mappingTextField: 'name',
|
|
@@ -3566,7 +3569,7 @@ function commonFun(type, prefixUrl) {
|
|
|
3566
3569
|
sorter: 'desc-id'
|
|
3567
3570
|
},
|
|
3568
3571
|
sourceName: 'skuCode'
|
|
3569
|
-
};
|
|
3572
|
+
}, requestConfigProp);
|
|
3570
3573
|
tableSearchForm = [{
|
|
3571
3574
|
name: 'qp-name-like',
|
|
3572
3575
|
label: 'SKU名称'
|
|
@@ -3661,7 +3664,7 @@ function commonFun(type, prefixUrl) {
|
|
|
3661
3664
|
formatTreeDataSource(x, 1, 6, tableSearchForm);
|
|
3662
3665
|
formatSource(x, 2, 7, tableSearchForm, ['id', 'name']);
|
|
3663
3666
|
});
|
|
3664
|
-
modalTableProps = {
|
|
3667
|
+
modalTableProps = _objectSpread2({
|
|
3665
3668
|
modalTableTitle: '选择SKU',
|
|
3666
3669
|
tableSearchForm: tableSearchForm,
|
|
3667
3670
|
tableColumns: [{
|
|
@@ -3689,12 +3692,12 @@ function commonFun(type, prefixUrl) {
|
|
|
3689
3692
|
title: '条形码',
|
|
3690
3693
|
dataIndex: 'barCode'
|
|
3691
3694
|
}]
|
|
3692
|
-
};
|
|
3695
|
+
}, modalTableBusProps);
|
|
3693
3696
|
} // 仓库选择器(物理、逻辑仓)
|
|
3694
3697
|
|
|
3695
3698
|
|
|
3696
3699
|
if (type === 'physicalWarehouse') {
|
|
3697
|
-
requestConfig = {
|
|
3700
|
+
requestConfig = _objectSpread2({
|
|
3698
3701
|
url: "".concat(prefixUrl.selectPrefix, "/physicalWarehouse"),
|
|
3699
3702
|
filter: 'qp-physicalWarehouseName,physicalWarehouseCode-orGroup,like',
|
|
3700
3703
|
mappingTextField: 'physicalWarehouseName',
|
|
@@ -3705,7 +3708,7 @@ function commonFun(type, prefixUrl) {
|
|
|
3705
3708
|
sorter: 'desc-id'
|
|
3706
3709
|
},
|
|
3707
3710
|
sourceName: 'warehouseIds'
|
|
3708
|
-
};
|
|
3711
|
+
}, requestConfigProp);
|
|
3709
3712
|
tableSearchForm = [{
|
|
3710
3713
|
name: 'qp-physicalWarehouseName-like',
|
|
3711
3714
|
label: '物理仓名称'
|
|
@@ -3744,7 +3747,7 @@ function commonFun(type, prefixUrl) {
|
|
|
3744
3747
|
})]).then(function (x) {
|
|
3745
3748
|
formatSource(x, 0, 3, tableSearchForm);
|
|
3746
3749
|
});
|
|
3747
|
-
modalTableProps = {
|
|
3750
|
+
modalTableProps = _objectSpread2({
|
|
3748
3751
|
modalTableTitle: '选择物理仓',
|
|
3749
3752
|
tableSearchForm: tableSearchForm,
|
|
3750
3753
|
tableColumns: [{
|
|
@@ -3763,11 +3766,11 @@ function commonFun(type, prefixUrl) {
|
|
|
3763
3766
|
title: '所属公司',
|
|
3764
3767
|
dataIndex: 'companyName'
|
|
3765
3768
|
}]
|
|
3766
|
-
};
|
|
3769
|
+
}, modalTableBusProps);
|
|
3767
3770
|
}
|
|
3768
3771
|
|
|
3769
3772
|
if (type === 'realWarehouse') {
|
|
3770
|
-
requestConfig = {
|
|
3773
|
+
requestConfig = _objectSpread2({
|
|
3771
3774
|
url: "".concat(prefixUrl.selectPrefix, "/realWarehouse"),
|
|
3772
3775
|
filter: 'qp-realWarehouseName,realWarehouseCode-orGroup,like',
|
|
3773
3776
|
mappingTextField: 'realWarehouseName',
|
|
@@ -3778,7 +3781,7 @@ function commonFun(type, prefixUrl) {
|
|
|
3778
3781
|
sorter: 'desc-id'
|
|
3779
3782
|
},
|
|
3780
3783
|
sourceName: 'warehouseIds'
|
|
3781
|
-
};
|
|
3784
|
+
}, requestConfigProp);
|
|
3782
3785
|
tableSearchForm = [{
|
|
3783
3786
|
name: 'qp-realWarehouseName-like',
|
|
3784
3787
|
label: '逻辑仓名称'
|
|
@@ -3791,7 +3794,7 @@ function commonFun(type, prefixUrl) {
|
|
|
3791
3794
|
label: '逻辑仓类型',
|
|
3792
3795
|
initialSource: getDictionarySource('SC00004')
|
|
3793
3796
|
}];
|
|
3794
|
-
modalTableProps = {
|
|
3797
|
+
modalTableProps = _objectSpread2({
|
|
3795
3798
|
modalTableTitle: '选择逻辑仓',
|
|
3796
3799
|
tableSearchForm: tableSearchForm,
|
|
3797
3800
|
tableColumns: [{
|
|
@@ -3807,12 +3810,12 @@ function commonFun(type, prefixUrl) {
|
|
|
3807
3810
|
return getDictionaryTextByValue('SC00004', text);
|
|
3808
3811
|
}
|
|
3809
3812
|
}]
|
|
3810
|
-
};
|
|
3813
|
+
}, modalTableBusProps);
|
|
3811
3814
|
} // 仓库选择器(虚拟、渠道仓)(无弹窗)
|
|
3812
3815
|
|
|
3813
3816
|
|
|
3814
3817
|
if (type === 'virtualWarehouse') {
|
|
3815
|
-
requestConfig = {
|
|
3818
|
+
requestConfig = _objectSpread2({
|
|
3816
3819
|
url: "".concat(prefixUrl.selectPrefix, "/virtualWarehouse"),
|
|
3817
3820
|
filter: 'qp-virtualWarehouseName,virtualWarehouseCode-orGroup,like',
|
|
3818
3821
|
mappingTextField: 'virtualWarehouseName',
|
|
@@ -3823,12 +3826,12 @@ function commonFun(type, prefixUrl) {
|
|
|
3823
3826
|
sorter: 'desc-id'
|
|
3824
3827
|
},
|
|
3825
3828
|
sourceName: 'warehouseIds'
|
|
3826
|
-
};
|
|
3829
|
+
}, requestConfigProp);
|
|
3827
3830
|
needModalTable = false;
|
|
3828
3831
|
}
|
|
3829
3832
|
|
|
3830
3833
|
if (type === 'channelWarehouse') {
|
|
3831
|
-
requestConfig = {
|
|
3834
|
+
requestConfig = _objectSpread2({
|
|
3832
3835
|
url: "".concat(prefixUrl.selectPrefix, "/channelWarehouse"),
|
|
3833
3836
|
filter: 'qp-channelWarehouseName,channelWarehouseCode-orGroup,like',
|
|
3834
3837
|
mappingTextField: 'channelWarehouseName',
|
|
@@ -3839,13 +3842,13 @@ function commonFun(type, prefixUrl) {
|
|
|
3839
3842
|
sorter: 'desc-id'
|
|
3840
3843
|
},
|
|
3841
3844
|
sourceName: 'warehouseIds'
|
|
3842
|
-
};
|
|
3845
|
+
}, requestConfigProp);
|
|
3843
3846
|
needModalTable = false;
|
|
3844
3847
|
} // 客户选择器
|
|
3845
3848
|
|
|
3846
3849
|
|
|
3847
3850
|
if (type === 'customer') {
|
|
3848
|
-
requestConfig = {
|
|
3851
|
+
requestConfig = _objectSpread2({
|
|
3849
3852
|
url: "".concat(prefixUrl.selectPrefix, "/uc/customer/v2"),
|
|
3850
3853
|
filter: 'qp-name,code-orGroup,like',
|
|
3851
3854
|
mappingTextField: 'name',
|
|
@@ -3854,7 +3857,7 @@ function commonFun(type, prefixUrl) {
|
|
|
3854
3857
|
sorter: 'desc-id'
|
|
3855
3858
|
},
|
|
3856
3859
|
sourceName: 'customCode'
|
|
3857
|
-
};
|
|
3860
|
+
}, requestConfigProp);
|
|
3858
3861
|
tableSearchForm = [{
|
|
3859
3862
|
name: 'qp-name-like',
|
|
3860
3863
|
label: '客户名称'
|
|
@@ -3940,7 +3943,7 @@ function commonFun(type, prefixUrl) {
|
|
|
3940
3943
|
formatSource(x, 1, 3, tableSearchForm);
|
|
3941
3944
|
formatSource(x, 2, 4, tableSearchForm);
|
|
3942
3945
|
});
|
|
3943
|
-
modalTableProps = {
|
|
3946
|
+
modalTableProps = _objectSpread2({
|
|
3944
3947
|
modalTableTitle: '选择客户',
|
|
3945
3948
|
tableSearchForm: tableSearchForm,
|
|
3946
3949
|
tableColumns: [{
|
|
@@ -3969,12 +3972,12 @@ function commonFun(type, prefixUrl) {
|
|
|
3969
3972
|
})) === null || _sharingType$find2 === void 0 ? void 0 : _sharingType$find2.text;
|
|
3970
3973
|
}
|
|
3971
3974
|
}]
|
|
3972
|
-
};
|
|
3975
|
+
}, modalTableBusProps);
|
|
3973
3976
|
} // 店铺选择器
|
|
3974
3977
|
|
|
3975
3978
|
|
|
3976
3979
|
if (type === 'shopFile') {
|
|
3977
|
-
requestConfig = {
|
|
3980
|
+
requestConfig = _objectSpread2({
|
|
3978
3981
|
url: "".concat(prefixUrl.selectPrefix, "/store"),
|
|
3979
3982
|
filter: 'qp-name,code-orGroup,like',
|
|
3980
3983
|
mappingTextField: 'name',
|
|
@@ -3983,7 +3986,7 @@ function commonFun(type, prefixUrl) {
|
|
|
3983
3986
|
sorter: 'desc-id'
|
|
3984
3987
|
},
|
|
3985
3988
|
sourceName: 'code'
|
|
3986
|
-
};
|
|
3989
|
+
}, requestConfigProp);
|
|
3987
3990
|
tableSearchForm = [{
|
|
3988
3991
|
name: 'qp-name-like',
|
|
3989
3992
|
label: '店铺名称'
|
|
@@ -4093,7 +4096,7 @@ function commonFun(type, prefixUrl) {
|
|
|
4093
4096
|
formatSource(x, 2, 5, tableSearchForm);
|
|
4094
4097
|
formatSource(x, 3, 6, tableSearchForm);
|
|
4095
4098
|
});
|
|
4096
|
-
modalTableProps = {
|
|
4099
|
+
modalTableProps = _objectSpread2({
|
|
4097
4100
|
modalTableTitle: '选择店铺',
|
|
4098
4101
|
tableSearchForm: tableSearchForm,
|
|
4099
4102
|
tableColumns: [{
|
|
@@ -4125,12 +4128,12 @@ function commonFun(type, prefixUrl) {
|
|
|
4125
4128
|
title: '归属核算主体',
|
|
4126
4129
|
dataIndex: 'accountingName'
|
|
4127
4130
|
}]
|
|
4128
|
-
};
|
|
4131
|
+
}, modalTableBusProps);
|
|
4129
4132
|
} // 核算主体选择器(无弹窗)
|
|
4130
4133
|
|
|
4131
4134
|
|
|
4132
4135
|
if (type === 'accountingSubject') {
|
|
4133
|
-
requestConfig = {
|
|
4136
|
+
requestConfig = _objectSpread2({
|
|
4134
4137
|
url: "".concat(prefixUrl.selectPrefix, "/accountingSubject"),
|
|
4135
4138
|
filter: 'qp-name,code-orGroup,like',
|
|
4136
4139
|
mappingTextField: 'name',
|
|
@@ -4140,13 +4143,13 @@ function commonFun(type, prefixUrl) {
|
|
|
4140
4143
|
sorter: 'desc-id'
|
|
4141
4144
|
},
|
|
4142
4145
|
sourceName: 'accountingSubjectCode'
|
|
4143
|
-
};
|
|
4146
|
+
}, requestConfigProp);
|
|
4144
4147
|
needModalTable = false;
|
|
4145
4148
|
} // 库存组织选择器(无弹窗)
|
|
4146
4149
|
|
|
4147
4150
|
|
|
4148
4151
|
if (type === 'inventoryOrg') {
|
|
4149
|
-
requestConfig = {
|
|
4152
|
+
requestConfig = _objectSpread2({
|
|
4150
4153
|
url: "".concat(prefixUrl.selectPrefix, "/inventoryOrg"),
|
|
4151
4154
|
filter: 'qp-name,code-orGroup,like',
|
|
4152
4155
|
mappingTextField: 'name',
|
|
@@ -4156,13 +4159,13 @@ function commonFun(type, prefixUrl) {
|
|
|
4156
4159
|
sorter: 'desc-id'
|
|
4157
4160
|
},
|
|
4158
4161
|
sourceName: 'inventoryOrgCode'
|
|
4159
|
-
};
|
|
4162
|
+
}, requestConfigProp);
|
|
4160
4163
|
needModalTable = false;
|
|
4161
4164
|
} // 法人公司选择器(无弹窗)
|
|
4162
4165
|
|
|
4163
4166
|
|
|
4164
4167
|
if (type === 'corporationCompany') {
|
|
4165
|
-
requestConfig = {
|
|
4168
|
+
requestConfig = _objectSpread2({
|
|
4166
4169
|
url: "".concat(prefixUrl.selectPrefix, "/company"),
|
|
4167
4170
|
filter: 'qp-name,code-orGroup,like',
|
|
4168
4171
|
mappingTextField: 'name',
|
|
@@ -4172,15 +4175,15 @@ function commonFun(type, prefixUrl) {
|
|
|
4172
4175
|
sorter: 'desc-id'
|
|
4173
4176
|
},
|
|
4174
4177
|
sourceName: 'corporationCompany'
|
|
4175
|
-
};
|
|
4178
|
+
}, requestConfigProp);
|
|
4176
4179
|
needModalTable = false;
|
|
4177
4180
|
} // 员工选择器
|
|
4178
4181
|
|
|
4179
4182
|
|
|
4180
4183
|
if (type === 'employee') {
|
|
4181
|
-
requestConfig = {
|
|
4184
|
+
requestConfig = _objectSpread2({
|
|
4182
4185
|
url: "".concat(prefixUrl.selectPrefix, "/employee/v2"),
|
|
4183
|
-
filter: 'qp-name
|
|
4186
|
+
filter: 'qp-employeeNumber,name-orGroup,like',
|
|
4184
4187
|
mappingTextField: 'name',
|
|
4185
4188
|
mappingTextShowKeyField: 'employeeNumber',
|
|
4186
4189
|
mappingValueField: 'employeeNumber',
|
|
@@ -4189,7 +4192,7 @@ function commonFun(type, prefixUrl) {
|
|
|
4189
4192
|
sorter: 'desc-id'
|
|
4190
4193
|
},
|
|
4191
4194
|
sourceName: 'employeeNumber'
|
|
4192
|
-
};
|
|
4195
|
+
}, requestConfigProp);
|
|
4193
4196
|
tableSearchForm = [{
|
|
4194
4197
|
name: 'qp-name-like',
|
|
4195
4198
|
label: '员工名称'
|
|
@@ -4229,7 +4232,7 @@ function commonFun(type, prefixUrl) {
|
|
|
4229
4232
|
})]).then(function (x) {
|
|
4230
4233
|
formatSource(x, 0, 2, tableSearchForm);
|
|
4231
4234
|
});
|
|
4232
|
-
modalTableProps = {
|
|
4235
|
+
modalTableProps = _objectSpread2({
|
|
4233
4236
|
modalTableTitle: '选择员工',
|
|
4234
4237
|
tableSearchForm: tableSearchForm,
|
|
4235
4238
|
tableColumns: [{
|
|
@@ -4248,12 +4251,12 @@ function commonFun(type, prefixUrl) {
|
|
|
4248
4251
|
title: '手机号',
|
|
4249
4252
|
dataIndex: 'officeTelephone'
|
|
4250
4253
|
}]
|
|
4251
|
-
};
|
|
4254
|
+
}, modalTableBusProps);
|
|
4252
4255
|
} // 配送方式选择器
|
|
4253
4256
|
|
|
4254
4257
|
|
|
4255
4258
|
if (type === 'deliveryMode') {
|
|
4256
|
-
requestConfig = {
|
|
4259
|
+
requestConfig = _objectSpread2({
|
|
4257
4260
|
url: "".concat(prefixUrl.selectPrefix, "/deliveryMode"),
|
|
4258
4261
|
filter: 'qp-name,code-orGroup,like',
|
|
4259
4262
|
mappingTextField: 'name',
|
|
@@ -4263,7 +4266,7 @@ function commonFun(type, prefixUrl) {
|
|
|
4263
4266
|
sorter: 'desc-id'
|
|
4264
4267
|
},
|
|
4265
4268
|
sourceName: 'deliveryModeCode'
|
|
4266
|
-
};
|
|
4269
|
+
}, requestConfigProp);
|
|
4267
4270
|
tableSearchForm = [{
|
|
4268
4271
|
name: 'qp-name-like',
|
|
4269
4272
|
label: '配送方式名称'
|
|
@@ -4332,7 +4335,7 @@ function commonFun(type, prefixUrl) {
|
|
|
4332
4335
|
formatSource(x, 0, 2, tableSearchForm);
|
|
4333
4336
|
formatSource(x, 1, 5, tableSearchForm);
|
|
4334
4337
|
});
|
|
4335
|
-
modalTableProps = {
|
|
4338
|
+
modalTableProps = _objectSpread2({
|
|
4336
4339
|
modalTableTitle: '选择配送方式',
|
|
4337
4340
|
tableSearchForm: tableSearchForm,
|
|
4338
4341
|
tableColumns: [{
|
|
@@ -4367,7 +4370,7 @@ function commonFun(type, prefixUrl) {
|
|
|
4367
4370
|
dataIndex: 'remark',
|
|
4368
4371
|
title: '备注'
|
|
4369
4372
|
}]
|
|
4370
|
-
};
|
|
4373
|
+
}, modalTableBusProps);
|
|
4371
4374
|
}
|
|
4372
4375
|
|
|
4373
4376
|
return {
|
|
@@ -4377,6 +4380,8 @@ function commonFun(type, prefixUrl) {
|
|
|
4377
4380
|
};
|
|
4378
4381
|
}
|
|
4379
4382
|
|
|
4383
|
+
var MemoSearchSelect = /*#__PURE__*/React__default['default'].memo(SearchSelect);
|
|
4384
|
+
|
|
4380
4385
|
var BusinessSearchSelect = function BusinessSearchSelect(props) {
|
|
4381
4386
|
var businessType = (props === null || props === void 0 ? void 0 : props.selectBusinessType) || 'supplier';
|
|
4382
4387
|
var prefixUrl = (props === null || props === void 0 ? void 0 : props.prefixUrl) || {
|
|
@@ -4384,21 +4389,33 @@ var BusinessSearchSelect = function BusinessSearchSelect(props) {
|
|
|
4384
4389
|
formSelectFix: '/bop/api'
|
|
4385
4390
|
};
|
|
4386
4391
|
|
|
4387
|
-
var _commonFun = commonFun(businessType, prefixUrl),
|
|
4392
|
+
var _commonFun = commonFun(businessType, prefixUrl, (props === null || props === void 0 ? void 0 : props.requestConfig) || {}, (props === null || props === void 0 ? void 0 : props.modalTableProps) || {}),
|
|
4388
4393
|
requestConfig = _commonFun.requestConfig,
|
|
4389
4394
|
modalTableProps = _commonFun.modalTableProps,
|
|
4390
4395
|
needModalTable = _commonFun.needModalTable;
|
|
4391
4396
|
|
|
4392
|
-
var currentProps =
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(
|
|
4397
|
+
var currentProps = React.useMemo(function () {
|
|
4398
|
+
return _objectSpread2(_objectSpread2({}, props), {}, {
|
|
4399
|
+
requestConfig: requestConfig,
|
|
4400
|
+
needModalTable: needModalTable,
|
|
4401
|
+
modalTableProps: modalTableProps
|
|
4402
|
+
});
|
|
4403
|
+
}, [props === null || props === void 0 ? void 0 : props.value]);
|
|
4404
|
+
return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(MemoSearchSelect, _objectSpread2({}, currentProps)));
|
|
4400
4405
|
};
|
|
4401
4406
|
|
|
4407
|
+
var index = /*#__PURE__*/React__default['default'].memo(BusinessSearchSelect, function (props, nextProps) {
|
|
4408
|
+
if (props && props.labelInValue && props.value && JSON.stringify(props.value) !== JSON.stringify(nextProps.value)) {
|
|
4409
|
+
return false;
|
|
4410
|
+
}
|
|
4411
|
+
|
|
4412
|
+
if (props && props.value !== nextProps.value) {
|
|
4413
|
+
return false;
|
|
4414
|
+
}
|
|
4415
|
+
|
|
4416
|
+
return true;
|
|
4417
|
+
});
|
|
4418
|
+
|
|
4402
4419
|
var CommodityEntry = function CommodityEntry(props) {
|
|
4403
4420
|
var dataValidationRef = React.useRef();
|
|
4404
4421
|
var _props$buttonName = props.buttonName,
|
|
@@ -4484,7 +4501,7 @@ var CommodityEntry = function CommodityEntry(props) {
|
|
|
4484
4501
|
* @LastEditTime: 2022-01-14 17:17:26
|
|
4485
4502
|
* @LastEditors: rodchen
|
|
4486
4503
|
*/
|
|
4487
|
-
var index = (function (storageKeyString) {
|
|
4504
|
+
var index$1 = (function (storageKeyString) {
|
|
4488
4505
|
var seconds = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
4489
4506
|
var tipsCallFunction = arguments.length > 2 ? arguments[2] : undefined;
|
|
4490
4507
|
if (typeof seconds !== 'number') throw new Error('seconds should be number');
|
|
@@ -4544,8 +4561,8 @@ function getStorageVale(storageKeyString) {
|
|
|
4544
4561
|
var resposne = JSON.parse(localStorage.getItem('userInfo') || '{}');
|
|
4545
4562
|
axios__default['default'].defaults.headers.common['sso-sessionid'] = (resposne === null || resposne === void 0 ? void 0 : resposne.sessionId) || '';
|
|
4546
4563
|
|
|
4547
|
-
exports.BusinessSearchSelect =
|
|
4548
|
-
exports.CheckOneUser = index;
|
|
4564
|
+
exports.BusinessSearchSelect = index;
|
|
4565
|
+
exports.CheckOneUser = index$1;
|
|
4549
4566
|
exports.CommodityEntry = CommodityEntry;
|
|
4550
4567
|
exports.DataValidation = DataValidation;
|
|
4551
4568
|
exports.QueryMutipleInput = QueryMutipleInput;
|