@bit-sun/business-component 1.2.3 → 2.0.0
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/.umirc.ts +31 -16
- package/dist/components/Business/SearchSelect/BusinessUtils.d.ts +1 -1
- package/dist/components/Business/SearchSelect/common.d.ts +5 -1
- package/dist/components/Business/SearchSelect/utils.d.ts +2 -1
- package/dist/index.esm.js +183 -21
- package/dist/index.js +183 -21
- package/package.json +1 -1
- package/src/components/Business/SearchSelect/BusinessUtils.ts +83 -6
- package/src/components/Business/SearchSelect/common.ts +20 -1
- package/src/components/Business/SearchSelect/index.md +60 -30
- package/src/components/Business/SearchSelect/index.tsx +2 -1
- package/src/components/Business/SearchSelect/utils.ts +27 -2
- package/src/components/Functional/SearchSelect/index.tsx +24 -7
- package/src/index.ts +1 -0
package/dist/index.js
CHANGED
|
@@ -3083,6 +3083,7 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3083
3083
|
|
|
3084
3084
|
var currentPage = 1;
|
|
3085
3085
|
var selectParamsKey = (requestConfig === null || requestConfig === void 0 ? void 0 : requestConfig.filter) || 'qp-codeAndName-like';
|
|
3086
|
+
var selectParamsInitKey = (requestConfig === null || requestConfig === void 0 ? void 0 : requestConfig.filterInit) || selectParamsKey;
|
|
3086
3087
|
|
|
3087
3088
|
var currentSelectProps = _objectSpread2(_objectSpread2({}, selectProps), {}, {
|
|
3088
3089
|
// 以下属性不可更改----设计配置项
|
|
@@ -3139,7 +3140,7 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3139
3140
|
var searchParams = {};
|
|
3140
3141
|
|
|
3141
3142
|
if (typeof selectParamsKey === 'string') {
|
|
3142
|
-
searchParams = _defineProperty({},
|
|
3143
|
+
searchParams = v ? _defineProperty({}, selectParamsInitKey, initVal) : _defineProperty({}, selectParamsKey, searchValue);
|
|
3143
3144
|
}
|
|
3144
3145
|
|
|
3145
3146
|
if (Array.isArray(selectParamsKey)) {
|
|
@@ -3334,10 +3335,12 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3334
3335
|
}, otherParams), fixedParam), params);
|
|
3335
3336
|
|
|
3336
3337
|
axios__default['default'].get("".concat(url, "?").concat(querystring.stringify(queryParams))).then(function (result) {
|
|
3338
|
+
var _result, _result2;
|
|
3339
|
+
|
|
3337
3340
|
setFetching(false);
|
|
3338
3341
|
result = result.data;
|
|
3339
3342
|
|
|
3340
|
-
if (result.status !== '0') {
|
|
3343
|
+
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') {
|
|
3341
3344
|
antd.message.error(result.msg);
|
|
3342
3345
|
return;
|
|
3343
3346
|
}
|
|
@@ -3459,7 +3462,6 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3459
3462
|
React.useEffect(function () {
|
|
3460
3463
|
if (value) {
|
|
3461
3464
|
setPopValue(value);
|
|
3462
|
-
onChange(value);
|
|
3463
3465
|
}
|
|
3464
3466
|
}, [value]);
|
|
3465
3467
|
React.useEffect(function () {
|
|
@@ -3528,9 +3530,9 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3528
3530
|
if (labelInValue) {
|
|
3529
3531
|
var formatResult = value.map(function (i) {
|
|
3530
3532
|
return {
|
|
3531
|
-
key: i
|
|
3532
|
-
label: i
|
|
3533
|
-
value: i
|
|
3533
|
+
key: i[mappingValueField],
|
|
3534
|
+
label: i[mappingTextField],
|
|
3535
|
+
value: i[mappingValueField]
|
|
3534
3536
|
};
|
|
3535
3537
|
});
|
|
3536
3538
|
onChange(selectMode ? formatResult : formatResult[0]);
|
|
@@ -3709,6 +3711,11 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3709
3711
|
selectedRowKeys: selectedRowKeys,
|
|
3710
3712
|
onChange: function onChange(sks, srs) {
|
|
3711
3713
|
onChangeSelectedKeys(sks, srs);
|
|
3714
|
+
},
|
|
3715
|
+
getCheckboxProps: function getCheckboxProps() {
|
|
3716
|
+
return {
|
|
3717
|
+
disabled: (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled) || (props === null || props === void 0 ? void 0 : props.disabled)
|
|
3718
|
+
};
|
|
3712
3719
|
}
|
|
3713
3720
|
};
|
|
3714
3721
|
|
|
@@ -3729,7 +3736,7 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3729
3736
|
var formItem = function formItem(list) {
|
|
3730
3737
|
if (isModalVisible && (list === null || list === void 0 ? void 0 : list.length)) {
|
|
3731
3738
|
return list.map(function (i) {
|
|
3732
|
-
var _i$field, _i$field3, _i$field5;
|
|
3739
|
+
var _i$field, _i$field3, _i$field5, _i$field6, _i$field7;
|
|
3733
3740
|
|
|
3734
3741
|
if ((i === null || i === void 0 ? void 0 : i.type) === 'select' || (i === null || i === void 0 ? void 0 : (_i$field = i.field) === null || _i$field === void 0 ? void 0 : _i$field.type) === 'select') {
|
|
3735
3742
|
var _i$field2, _i$initialSource;
|
|
@@ -3766,12 +3773,24 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3766
3773
|
}, i === null || i === void 0 ? void 0 : (_i$field4 = i.field) === null || _i$field4 === void 0 ? void 0 : _i$field4.props)));
|
|
3767
3774
|
}
|
|
3768
3775
|
|
|
3769
|
-
if ((i === null || i === void 0 ? void 0 : i.type) === 'businessSearchSelect') {
|
|
3776
|
+
if ((i === null || i === void 0 ? void 0 : i.type) === 'businessSearchSelect' || (i === null || i === void 0 ? void 0 : (_i$field5 = i.field) === null || _i$field5 === void 0 ? void 0 : _i$field5.type) === 'businessSearchSelect') {
|
|
3770
3777
|
return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
|
|
3771
3778
|
name: i.name,
|
|
3772
3779
|
label: i.label,
|
|
3773
3780
|
key: i.name
|
|
3774
3781
|
}, /*#__PURE__*/React__default['default'].createElement(BusinessSearchSelect$1, _objectSpread2({}, i.field.props))));
|
|
3782
|
+
}
|
|
3783
|
+
|
|
3784
|
+
if ((i === null || i === void 0 ? void 0 : i.type) === 'multipleQueryInput' || (i === null || i === void 0 ? void 0 : (_i$field6 = i.field) === null || _i$field6 === void 0 ? void 0 : _i$field6.type) === 'multipleQueryInput') {
|
|
3785
|
+
return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
|
|
3786
|
+
name: i.name,
|
|
3787
|
+
label: i.label,
|
|
3788
|
+
key: i.name
|
|
3789
|
+
}, /*#__PURE__*/React__default['default'].createElement(QueryMutipleInput, {
|
|
3790
|
+
onValueChange: function onValueChange(value) {
|
|
3791
|
+
form.setFieldsValue(_defineProperty({}, i.name, value));
|
|
3792
|
+
}
|
|
3793
|
+
})));
|
|
3775
3794
|
} // 默认type是input
|
|
3776
3795
|
|
|
3777
3796
|
|
|
@@ -3786,7 +3805,7 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3786
3805
|
placeholder: "\u8BF7\u8F93\u5165",
|
|
3787
3806
|
allowClear: true,
|
|
3788
3807
|
maxLength: 100
|
|
3789
|
-
}, i === null || i === void 0 ? void 0 : (_i$
|
|
3808
|
+
}, i === null || i === void 0 ? void 0 : (_i$field7 = i.field) === null || _i$field7 === void 0 ? void 0 : _i$field7.props)));
|
|
3790
3809
|
});
|
|
3791
3810
|
} else {
|
|
3792
3811
|
return null;
|
|
@@ -3981,7 +4000,8 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
3981
4000
|
}, /*#__PURE__*/React__default['default'].createElement(antd.Checkbox, {
|
|
3982
4001
|
indeterminate: indeterminate,
|
|
3983
4002
|
checked: checkedAll,
|
|
3984
|
-
onChange: onChangeCheckAll
|
|
4003
|
+
onChange: onChangeCheckAll,
|
|
4004
|
+
disabled: (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled) || (props === null || props === void 0 ? void 0 : props.disabled)
|
|
3985
4005
|
}), " \u5168\u9009\u6240\u6709\u9875\u9762") : '')))));
|
|
3986
4006
|
};
|
|
3987
4007
|
|
|
@@ -3992,6 +4012,19 @@ var shopFileType = [{
|
|
|
3992
4012
|
text: "线下",
|
|
3993
4013
|
value: 'offline'
|
|
3994
4014
|
}];
|
|
4015
|
+
var shopFile2Type = [{
|
|
4016
|
+
text: "第三方线上",
|
|
4017
|
+
value: 'online'
|
|
4018
|
+
}, {
|
|
4019
|
+
text: "线下",
|
|
4020
|
+
value: 'offline'
|
|
4021
|
+
}, {
|
|
4022
|
+
text: "自营B2B",
|
|
4023
|
+
value: 'B2B'
|
|
4024
|
+
}, {
|
|
4025
|
+
text: "自营B2C",
|
|
4026
|
+
value: 'B2C'
|
|
4027
|
+
}];
|
|
3995
4028
|
var arrivalPaySupportList = [{
|
|
3996
4029
|
text: "支持",
|
|
3997
4030
|
value: 1
|
|
@@ -4058,11 +4091,11 @@ var getDictionaryTextByValue = function getDictionaryTextByValue(dicCode, value)
|
|
|
4058
4091
|
var loadSelectSource = function loadSelectSource(url, params) {
|
|
4059
4092
|
return new Promise(function (resolve, reject) {
|
|
4060
4093
|
axios__default['default'].get("".concat(url, "?").concat(querystring.stringify(params))).then(function (result) {
|
|
4061
|
-
var _result;
|
|
4094
|
+
var _result, _result2;
|
|
4062
4095
|
|
|
4063
4096
|
result = result.data;
|
|
4064
4097
|
|
|
4065
|
-
if (result.status && result.status !== '0' || ((
|
|
4098
|
+
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') {
|
|
4066
4099
|
antd.message.error(result.msg);
|
|
4067
4100
|
return;
|
|
4068
4101
|
}
|
|
@@ -4074,6 +4107,48 @@ var loadSelectSource = function loadSelectSource(url, params) {
|
|
|
4074
4107
|
});
|
|
4075
4108
|
};
|
|
4076
4109
|
|
|
4110
|
+
var handleDefaultPrefixUrl = function handleDefaultPrefixUrl(type) {
|
|
4111
|
+
var result;
|
|
4112
|
+
|
|
4113
|
+
switch (type) {
|
|
4114
|
+
case 'supplier2':
|
|
4115
|
+
case 'customer2':
|
|
4116
|
+
case 'shopFile2':
|
|
4117
|
+
result = '/channel-manage';
|
|
4118
|
+
break;
|
|
4119
|
+
|
|
4120
|
+
case 'skuCommodity':
|
|
4121
|
+
case 'skuPropertyValue':
|
|
4122
|
+
case 'spuCommodity':
|
|
4123
|
+
result = '/items';
|
|
4124
|
+
break;
|
|
4125
|
+
|
|
4126
|
+
case 'physicalWarehouse':
|
|
4127
|
+
case 'realWarehouse':
|
|
4128
|
+
case 'virtualWarehouse':
|
|
4129
|
+
case 'channelWarehouse':
|
|
4130
|
+
result = '/stock';
|
|
4131
|
+
break;
|
|
4132
|
+
|
|
4133
|
+
case 'inventoryOrg2':
|
|
4134
|
+
case 'purchaseOrg':
|
|
4135
|
+
case 'salesOrg':
|
|
4136
|
+
case 'employee2':
|
|
4137
|
+
result = '/user';
|
|
4138
|
+
break;
|
|
4139
|
+
|
|
4140
|
+
case 'deliveryMode':
|
|
4141
|
+
result = '/basic';
|
|
4142
|
+
break;
|
|
4143
|
+
|
|
4144
|
+
default:
|
|
4145
|
+
result = '/bop/api';
|
|
4146
|
+
break;
|
|
4147
|
+
}
|
|
4148
|
+
|
|
4149
|
+
return result;
|
|
4150
|
+
};
|
|
4151
|
+
|
|
4077
4152
|
var _getDictionarySource;
|
|
4078
4153
|
var hasDictSharingType = (_getDictionarySource = getDictionarySource('UC000013')) === null || _getDictionarySource === void 0 ? void 0 : _getDictionarySource.length;
|
|
4079
4154
|
var sharingTypeDataList = hasDictSharingType && getDictionarySource('UC000013') || sharingType;
|
|
@@ -4101,7 +4176,7 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
|
|
|
4101
4176
|
|
|
4102
4177
|
var resKeyValue = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : ['code', 'name'];
|
|
4103
4178
|
var data = reData && ((_reData$position = reData[position]) === null || _reData$position === void 0 ? void 0 : _reData$position.data);
|
|
4104
|
-
var list = Array.isArray(data) ? data : (data === null || data === void 0 ? void 0 : data.items) || (data === null || data === void 0 ? void 0 : data.list) || [];
|
|
4179
|
+
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) || [];
|
|
4105
4180
|
var formatData = (list === null || list === void 0 ? void 0 : list.length) ? list.map(function (v) {
|
|
4106
4181
|
return {
|
|
4107
4182
|
text: v[resKeyValue[1]],
|
|
@@ -4148,7 +4223,7 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
|
|
|
4148
4223
|
tableColumns: []
|
|
4149
4224
|
}, modalTableBusProps);
|
|
4150
4225
|
|
|
4151
|
-
var needModalTable = true; // 供应商选择器
|
|
4226
|
+
var needModalTable = (modalTableBusProps === null || modalTableBusProps === void 0 ? void 0 : modalTableBusProps.needModalTable) !== undefined ? modalTableBusProps === null || modalTableBusProps === void 0 ? void 0 : modalTableBusProps.needModalTable : true; // 供应商选择器
|
|
4152
4227
|
|
|
4153
4228
|
if (type === 'supplier') {
|
|
4154
4229
|
tableSearchForm = [{
|
|
@@ -4348,7 +4423,7 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
|
|
|
4348
4423
|
mappingTextShowTextField: ['name', 'propertyNameAndValue'],
|
|
4349
4424
|
otherParams: {
|
|
4350
4425
|
'qp-approveStatus-eq': 1,
|
|
4351
|
-
'qp-type-eq': 10,
|
|
4426
|
+
// 'qp-type-eq': 10, // 查唯一国际条码【有些项目不需要必须要有国际条码,故注释,需要的项目自己定义otherParams补充上这个条件】
|
|
4352
4427
|
sorter: 'desc-id'
|
|
4353
4428
|
},
|
|
4354
4429
|
sourceName: 'skuCode'
|
|
@@ -4360,8 +4435,12 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
|
|
|
4360
4435
|
name: 'qp-name-like',
|
|
4361
4436
|
label: 'SKU名称'
|
|
4362
4437
|
}, {
|
|
4363
|
-
name: 'qp-skuCode-
|
|
4364
|
-
label: 'SKU编码'
|
|
4438
|
+
name: 'qp-skuCode-in',
|
|
4439
|
+
label: 'SKU编码',
|
|
4440
|
+
field: {
|
|
4441
|
+
type: 'multipleQueryInput',
|
|
4442
|
+
props: _objectSpread2({}, (requestConfigProp === null || requestConfigProp === void 0 ? void 0 : requestConfigProp.skuCodeValueRequestConfig) || {})
|
|
4443
|
+
}
|
|
4365
4444
|
}, requestConfig.url.includes('v2') ? {
|
|
4366
4445
|
name: 'qp-code-like',
|
|
4367
4446
|
label: '国际条码'
|
|
@@ -4461,8 +4540,12 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
|
|
|
4461
4540
|
name: 'qp-name-like',
|
|
4462
4541
|
label: 'SKU名称'
|
|
4463
4542
|
}, {
|
|
4464
|
-
name: 'qp-skuCode-
|
|
4465
|
-
label: 'SKU编码'
|
|
4543
|
+
name: 'qp-skuCode-in',
|
|
4544
|
+
label: 'SKU编码',
|
|
4545
|
+
field: {
|
|
4546
|
+
type: 'multipleQueryInput',
|
|
4547
|
+
props: _objectSpread2({}, (requestConfigProp === null || requestConfigProp === void 0 ? void 0 : requestConfigProp.skuCodeValueRequestConfig) || {})
|
|
4548
|
+
}
|
|
4466
4549
|
}, {
|
|
4467
4550
|
name: 'qp-barCode-like',
|
|
4468
4551
|
label: '国际条码'
|
|
@@ -4910,6 +4993,7 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
|
|
|
4910
4993
|
mappingTextField: 'name',
|
|
4911
4994
|
mappingValueField: 'code',
|
|
4912
4995
|
otherParams: {
|
|
4996
|
+
'qp-status-eq': 10,
|
|
4913
4997
|
sorter: 'desc-id'
|
|
4914
4998
|
},
|
|
4915
4999
|
sourceName: 'customCode'
|
|
@@ -5265,6 +5349,83 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
|
|
|
5265
5349
|
dataIndex: 'accountingName'
|
|
5266
5350
|
}]
|
|
5267
5351
|
}, modalTableBusProps);
|
|
5352
|
+
}
|
|
5353
|
+
|
|
5354
|
+
if (type === 'shopFile2') {
|
|
5355
|
+
var _JSON$parse, _JSON$parse$employeeR;
|
|
5356
|
+
|
|
5357
|
+
requestConfig = _objectSpread2({
|
|
5358
|
+
url: "".concat(prefixUrl.selectPrefix, "/store/page"),
|
|
5359
|
+
filter: 'qp-name,code-orGroup,like',
|
|
5360
|
+
mappingTextField: 'name',
|
|
5361
|
+
mappingValueField: 'code',
|
|
5362
|
+
otherParams: {
|
|
5363
|
+
sorter: 'desc-id'
|
|
5364
|
+
},
|
|
5365
|
+
sourceName: 'code'
|
|
5366
|
+
}, requestConfigProp);
|
|
5367
|
+
tableSearchForm = [{
|
|
5368
|
+
name: 'qp-name-like',
|
|
5369
|
+
label: '商店名称'
|
|
5370
|
+
}, {
|
|
5371
|
+
name: 'qp-code-like',
|
|
5372
|
+
label: '商店编码'
|
|
5373
|
+
}, {
|
|
5374
|
+
name: 'qp-type-in',
|
|
5375
|
+
type: 'select',
|
|
5376
|
+
label: '商店类型',
|
|
5377
|
+
initialSource: shopFile2Type
|
|
5378
|
+
}, {
|
|
5379
|
+
name: 'qp-orgCode-in',
|
|
5380
|
+
type: 'select',
|
|
5381
|
+
label: '所属销售组织',
|
|
5382
|
+
field: {
|
|
5383
|
+
type: 'select',
|
|
5384
|
+
props: {
|
|
5385
|
+
mode: 'multiple',
|
|
5386
|
+
notFoundContent: '暂无数据',
|
|
5387
|
+
allowClear: true,
|
|
5388
|
+
showSearch: true,
|
|
5389
|
+
showArrow: true,
|
|
5390
|
+
maxTagCount: 1,
|
|
5391
|
+
optionFilterProp: 'children',
|
|
5392
|
+
filterOption: function filterOption(input, option) {
|
|
5393
|
+
return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
|
5394
|
+
}
|
|
5395
|
+
}
|
|
5396
|
+
}
|
|
5397
|
+
}];
|
|
5398
|
+
Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/orgView/getTree/sales-organizational-view"), {
|
|
5399
|
+
'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,
|
|
5400
|
+
'qp-realOrg-eq': true,
|
|
5401
|
+
'qp-status-eq': 10
|
|
5402
|
+
})]).then(function (x) {
|
|
5403
|
+
formatSource(x, 0, 3, tableSearchForm);
|
|
5404
|
+
});
|
|
5405
|
+
modalTableProps = _objectSpread2({
|
|
5406
|
+
modalTableTitle: '选择商店',
|
|
5407
|
+
tableSearchForm: tableSearchForm,
|
|
5408
|
+
tableColumns: [{
|
|
5409
|
+
title: '商店编码',
|
|
5410
|
+
dataIndex: 'code'
|
|
5411
|
+
}, {
|
|
5412
|
+
title: '商店名称',
|
|
5413
|
+
dataIndex: 'name'
|
|
5414
|
+
}, {
|
|
5415
|
+
title: '商店类型',
|
|
5416
|
+
dataIndex: 'type',
|
|
5417
|
+
render: function render(text) {
|
|
5418
|
+
var _shopFile2Type$find;
|
|
5419
|
+
|
|
5420
|
+
return (_shopFile2Type$find = shopFile2Type.find(function (i) {
|
|
5421
|
+
return i.value === text;
|
|
5422
|
+
})) === null || _shopFile2Type$find === void 0 ? void 0 : _shopFile2Type$find.text;
|
|
5423
|
+
}
|
|
5424
|
+
}, {
|
|
5425
|
+
title: '所属销售组织',
|
|
5426
|
+
dataIndex: 'orgName'
|
|
5427
|
+
}]
|
|
5428
|
+
}, modalTableBusProps);
|
|
5268
5429
|
} // 核算主体选择器(无弹窗)
|
|
5269
5430
|
|
|
5270
5431
|
|
|
@@ -5592,8 +5753,8 @@ var MemoSearchSelect = /*#__PURE__*/React__default['default'].memo(SearchSelect)
|
|
|
5592
5753
|
var BusinessSearchSelect = function BusinessSearchSelect(props) {
|
|
5593
5754
|
var businessType = (props === null || props === void 0 ? void 0 : props.selectBusinessType) || 'supplier';
|
|
5594
5755
|
var prefixUrl = (props === null || props === void 0 ? void 0 : props.prefixUrl) || {
|
|
5595
|
-
selectPrefix:
|
|
5596
|
-
formSelectFix:
|
|
5756
|
+
selectPrefix: handleDefaultPrefixUrl(businessType),
|
|
5757
|
+
formSelectFix: handleDefaultPrefixUrl(businessType)
|
|
5597
5758
|
};
|
|
5598
5759
|
|
|
5599
5760
|
var _commonFun = commonFun(businessType, prefixUrl, (props === null || props === void 0 ? void 0 : props.requestConfig) || {}, (props === null || props === void 0 ? void 0 : props.modalTableProps) || {}),
|
|
@@ -5767,6 +5928,7 @@ function getStorageVale(storageKeyString) {
|
|
|
5767
5928
|
|
|
5768
5929
|
var resposne = JSON.parse(localStorage.getItem('userInfo') || '{}');
|
|
5769
5930
|
axios__default['default'].defaults.headers.common['sso-sessionid'] = (resposne === null || resposne === void 0 ? void 0 : resposne.sessionId) || '';
|
|
5931
|
+
axios__default['default'].defaults.headers.common['x-tenant-id'] = (resposne === null || resposne === void 0 ? void 0 : resposne.tenantId) || '1';
|
|
5770
5932
|
|
|
5771
5933
|
exports.BusinessSearchSelect = BusinessSearchSelect$1;
|
|
5772
5934
|
exports.CheckOneUser = index;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// 此文件用于 处理业务组件 所用到的公共方法
|
|
2
2
|
// @ts-nocheck
|
|
3
|
-
import { shopFileType, arrivalPaySupportList, sharingType } from './common';
|
|
3
|
+
import { shopFileType, arrivalPaySupportList, sharingType, shopFile2Type } from './common';
|
|
4
4
|
import { getDictionarySource, getDictionaryTextByValue, loadSelectSource } from './utils';
|
|
5
5
|
|
|
6
6
|
const hasDictSharingType = getDictionarySource('UC000013')?.length;
|
|
@@ -27,7 +27,7 @@ export function commonFun (type?: string, prefixUrl: any, requestConfigProp?: an
|
|
|
27
27
|
* */
|
|
28
28
|
const formatSource = (reData: any, position: number, changePosition: number,changeSearchForm: any,resKeyValue=['code', 'name']) => {
|
|
29
29
|
const data = reData && reData[position]?.data;
|
|
30
|
-
const list = Array.isArray(data) ? data :(data?.items || data?.list || []);
|
|
30
|
+
const list = Array.isArray(data) ? data :(data?.items || data?.list || data?.children || []);
|
|
31
31
|
const formatData = list?.length ? list.map((v: any) => ({ text: v[resKeyValue[1]], value: v[resKeyValue[0]] })) : [];
|
|
32
32
|
changeSearchForm[changePosition] = {...changeSearchForm[changePosition], initialSource: formatData}
|
|
33
33
|
}
|
|
@@ -63,7 +63,7 @@ export function commonFun (type?: string, prefixUrl: any, requestConfigProp?: an
|
|
|
63
63
|
tableColumns: [],
|
|
64
64
|
...modalTableBusProps,
|
|
65
65
|
}
|
|
66
|
-
let needModalTable = true;
|
|
66
|
+
let needModalTable = modalTableBusProps?.needModalTable !== undefined ? modalTableBusProps?.needModalTable : true;
|
|
67
67
|
|
|
68
68
|
// 供应商选择器
|
|
69
69
|
if(type === 'supplier') {
|
|
@@ -243,7 +243,7 @@ export function commonFun (type?: string, prefixUrl: any, requestConfigProp?: an
|
|
|
243
243
|
mappingTextShowTextField: ['name', 'propertyNameAndValue'],
|
|
244
244
|
otherParams: {
|
|
245
245
|
'qp-approveStatus-eq': 1,
|
|
246
|
-
'qp-type-eq': 10, //
|
|
246
|
+
// 'qp-type-eq': 10, // 查唯一国际条码【有些项目不需要必须要有国际条码,故注释,需要的项目自己定义otherParams补充上这个条件】
|
|
247
247
|
sorter: 'desc-id'
|
|
248
248
|
}, // 默认参数
|
|
249
249
|
sourceName: 'skuCode',
|
|
@@ -251,7 +251,12 @@ export function commonFun (type?: string, prefixUrl: any, requestConfigProp?: an
|
|
|
251
251
|
}
|
|
252
252
|
tableSearchForm = requestConfig.url.includes('v2') ? [
|
|
253
253
|
requestConfig.url.includes('v2') ? { name: 'qp-skuName-like', label: 'SKU名称' } : { name: 'qp-name-like', label: 'SKU名称' },
|
|
254
|
-
{ name: 'qp-skuCode-
|
|
254
|
+
{ name: 'qp-skuCode-in', label: 'SKU编码', field: {
|
|
255
|
+
type: 'multipleQueryInput',
|
|
256
|
+
props: {
|
|
257
|
+
...(requestConfigProp?.skuCodeValueRequestConfig || {}),
|
|
258
|
+
},
|
|
259
|
+
}},
|
|
255
260
|
requestConfig.url.includes('v2') ? { name: 'qp-code-like', label: '国际条码' } : { name: 'qp-barCode-like', label: '国际条码'},
|
|
256
261
|
{ name: 'qp-itemName-like', label: '所属SPU名称' },
|
|
257
262
|
{ name: 'qp-itemCode-like', label: '所属SPU编码' },
|
|
@@ -316,7 +321,12 @@ export function commonFun (type?: string, prefixUrl: any, requestConfigProp?: an
|
|
|
316
321
|
} },
|
|
317
322
|
] : [
|
|
318
323
|
{ name: 'qp-name-like', label: 'SKU名称' },
|
|
319
|
-
{ name: 'qp-skuCode-
|
|
324
|
+
{ name: 'qp-skuCode-in', label: 'SKU编码', field: {
|
|
325
|
+
type: 'multipleQueryInput',
|
|
326
|
+
props: {
|
|
327
|
+
...(requestConfigProp?.skuCodeValueRequestConfig || {}),
|
|
328
|
+
},
|
|
329
|
+
}},
|
|
320
330
|
{ name: 'qp-barCode-like', label: '国际条码'},
|
|
321
331
|
{ name: 'qp-itemName-like', label: '所属SPU名称' },
|
|
322
332
|
{ name: 'qp-itemCode-like', label: '所属SPU编码' },
|
|
@@ -750,6 +760,7 @@ export function commonFun (type?: string, prefixUrl: any, requestConfigProp?: an
|
|
|
750
760
|
mappingTextField: 'name',
|
|
751
761
|
mappingValueField: 'code',
|
|
752
762
|
otherParams: {
|
|
763
|
+
'qp-status-eq': 10,
|
|
753
764
|
sorter: 'desc-id'
|
|
754
765
|
}, // 默认参数
|
|
755
766
|
sourceName: 'customCode',
|
|
@@ -1069,6 +1080,71 @@ export function commonFun (type?: string, prefixUrl: any, requestConfigProp?: an
|
|
|
1069
1080
|
...modalTableBusProps
|
|
1070
1081
|
}
|
|
1071
1082
|
}
|
|
1083
|
+
if(type === 'shopFile2') {
|
|
1084
|
+
requestConfig = {
|
|
1085
|
+
url: `${prefixUrl.selectPrefix}/store/page`,
|
|
1086
|
+
filter: 'qp-name,code-orGroup,like', // 过滤参数
|
|
1087
|
+
mappingTextField: 'name',
|
|
1088
|
+
mappingValueField: 'code',
|
|
1089
|
+
otherParams: {
|
|
1090
|
+
sorter: 'desc-id'
|
|
1091
|
+
}, // 默认参数
|
|
1092
|
+
sourceName: 'code',
|
|
1093
|
+
...requestConfigProp,
|
|
1094
|
+
}
|
|
1095
|
+
tableSearchForm = [
|
|
1096
|
+
{ name: 'qp-name-like', label: '商店名称' },
|
|
1097
|
+
{ name: 'qp-code-like', label: '商店编码' },
|
|
1098
|
+
{ name: 'qp-type-in', type: 'select', label: '商店类型', initialSource: shopFile2Type },
|
|
1099
|
+
{ name: 'qp-orgCode-in', type: 'select', label: '所属销售组织', field: {
|
|
1100
|
+
type: 'select',
|
|
1101
|
+
props: {
|
|
1102
|
+
mode: 'multiple',
|
|
1103
|
+
notFoundContent: '暂无数据',
|
|
1104
|
+
allowClear: true,
|
|
1105
|
+
showSearch: true,
|
|
1106
|
+
showArrow: true,
|
|
1107
|
+
maxTagCount: 1,
|
|
1108
|
+
optionFilterProp: 'children',
|
|
1109
|
+
filterOption: (input: string, option: { props: { children: string } }) =>
|
|
1110
|
+
option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
|
|
1111
|
+
},
|
|
1112
|
+
} },
|
|
1113
|
+
]
|
|
1114
|
+
Promise.all([
|
|
1115
|
+
loadSelectSource(`${prefixUrl.formSelectFix}/orgView/getTree/sales-organizational-view`, {
|
|
1116
|
+
'qp-employeeCode-eq': JSON.parse(localStorage.getItem('userInfo') || '{}')?.employeeResVo?.employeeNumber,
|
|
1117
|
+
'qp-realOrg-eq': true,
|
|
1118
|
+
'qp-status-eq': 10
|
|
1119
|
+
}),
|
|
1120
|
+
]).then((x: any)=>{
|
|
1121
|
+
formatSource(x,0, 3, tableSearchForm);
|
|
1122
|
+
})
|
|
1123
|
+
modalTableProps = {
|
|
1124
|
+
modalTableTitle: '选择商店',
|
|
1125
|
+
tableSearchForm,
|
|
1126
|
+
tableColumns: [
|
|
1127
|
+
{
|
|
1128
|
+
title: '商店编码',
|
|
1129
|
+
dataIndex: 'code',
|
|
1130
|
+
},
|
|
1131
|
+
{
|
|
1132
|
+
title: '商店名称',
|
|
1133
|
+
dataIndex: 'name',
|
|
1134
|
+
},
|
|
1135
|
+
{
|
|
1136
|
+
title: '商店类型',
|
|
1137
|
+
dataIndex: 'type',
|
|
1138
|
+
render: (text: number) => shopFile2Type.find((i: any) => i.value === text)?.text,
|
|
1139
|
+
},
|
|
1140
|
+
{
|
|
1141
|
+
title: '所属销售组织',
|
|
1142
|
+
dataIndex: 'orgName',
|
|
1143
|
+
},
|
|
1144
|
+
],
|
|
1145
|
+
...modalTableBusProps
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1072
1148
|
|
|
1073
1149
|
// 核算主体选择器(无弹窗)
|
|
1074
1150
|
if(type === 'accountingSubject') {
|
|
@@ -1102,6 +1178,7 @@ export function commonFun (type?: string, prefixUrl: any, requestConfigProp?: an
|
|
|
1102
1178
|
}
|
|
1103
1179
|
needModalTable = false
|
|
1104
1180
|
}
|
|
1181
|
+
|
|
1105
1182
|
// 法人公司选择器(无弹窗)
|
|
1106
1183
|
if(type === 'corporationCompany') {
|
|
1107
1184
|
requestConfig = {
|
|
@@ -9,6 +9,25 @@ const shopFileType = [
|
|
|
9
9
|
}
|
|
10
10
|
]
|
|
11
11
|
|
|
12
|
+
const shopFile2Type = [
|
|
13
|
+
{
|
|
14
|
+
text: "第三方线上",
|
|
15
|
+
value: 'online',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
text: "线下",
|
|
19
|
+
value: 'offline',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
text: "自营B2B",
|
|
23
|
+
value: 'B2B',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
text: "自营B2C",
|
|
27
|
+
value: 'B2C',
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
|
|
12
31
|
const arrivalPaySupportList = [
|
|
13
32
|
{
|
|
14
33
|
text: "支持",
|
|
@@ -31,4 +50,4 @@ const sharingType = [
|
|
|
31
50
|
}
|
|
32
51
|
]
|
|
33
52
|
|
|
34
|
-
export { shopFileType, arrivalPaySupportList, sharingType }
|
|
53
|
+
export { shopFileType, arrivalPaySupportList, sharingType, shopFile2Type }
|