@bit-sun/business-component 2.0.28 → 2.0.30

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.
Files changed (78) hide show
  1. package/.editorconfig +16 -16
  2. package/.fatherrc.ts +4 -4
  3. package/.gitlab-ci.yml +174 -174
  4. package/.prettierignore +7 -7
  5. package/.prettierrc +11 -11
  6. package/.umirc.ts +74 -74
  7. package/README.md +27 -27
  8. package/dist/index.esm.js +5625 -7523
  9. package/dist/index.js +5622 -7520
  10. package/docs/index.md +21 -21
  11. package/lib/assets/drag.svg +17 -17
  12. package/lib/assets/exportFail.svg +37 -37
  13. package/lib/assets/exportProcessing.svg +28 -28
  14. package/lib/assets/exportSuccess.svg +34 -34
  15. package/lib/assets/label_icon_bottom.svg +25 -25
  16. package/lib/assets/upExport.svg +22 -22
  17. package/package.json +5 -3
  18. package/src/assets/close.svg +26 -26
  19. package/src/assets/drag.svg +17 -17
  20. package/src/assets/exportFail.svg +37 -37
  21. package/src/assets/exportProcessing.svg +28 -28
  22. package/src/assets/exportSuccess.svg +34 -34
  23. package/src/assets/icon-shezhi.svg +17 -17
  24. package/src/assets/label_icon_bottom.svg +25 -25
  25. package/src/assets/upExport.svg +22 -22
  26. package/src/components/Business/AddSelectBusiness/index.md +41 -41
  27. package/src/components/Business/AddSelectBusiness/index.tsx +290 -290
  28. package/src/components/Business/CommodityEntry/index.md +70 -70
  29. package/src/components/Business/CommodityEntry/index.tsx +80 -80
  30. package/src/components/Business/CommonGuideWrapper/index.less +111 -111
  31. package/src/components/Business/CommonGuideWrapper/index.md +39 -39
  32. package/src/components/Business/CommonGuideWrapper/index.tsx +83 -83
  33. package/src/components/Business/SearchSelect/BusinessUtils.ts +1448 -1446
  34. package/src/components/Business/SearchSelect/common.ts +53 -53
  35. package/src/components/Business/SearchSelect/index.md +1137 -1137
  36. package/src/components/Business/SearchSelect/index.tsx +51 -51
  37. package/src/components/Business/SearchSelect/utils.ts +99 -99
  38. package/src/components/Business/StateFlow/index.less +130 -130
  39. package/src/components/Business/StateFlow/index.md +60 -60
  40. package/src/components/Business/StateFlow/index.tsx +29 -29
  41. package/src/components/Business/TreeSearchSelect/index.md +126 -126
  42. package/src/components/Business/TreeSearchSelect/index.tsx +34 -34
  43. package/src/components/Business/TreeSearchSelect/utils.ts +60 -60
  44. package/src/components/Business/columnSettingTable/columnSetting.tsx +594 -594
  45. package/src/components/Business/columnSettingTable/index.less +247 -247
  46. package/src/components/Business/columnSettingTable/index.md +357 -357
  47. package/src/components/Business/columnSettingTable/index.tsx +216 -216
  48. package/src/components/Business/columnSettingTable/sulaSettingTable.tsx +224 -224
  49. package/src/components/Business/columnSettingTable/utils.tsx +68 -68
  50. package/src/components/Functional/AddSelect/index.less +367 -367
  51. package/src/components/Functional/AddSelect/index.md +122 -122
  52. package/src/components/Functional/AddSelect/index.tsx +952 -952
  53. package/src/components/Functional/BillEntry/index.less +371 -371
  54. package/src/components/Functional/BillEntry/index.md +37 -37
  55. package/src/components/Functional/BillEntry/index.tsx +547 -547
  56. package/src/components/Functional/DataImport/index.less +63 -63
  57. package/src/components/Functional/DataImport/index.md +44 -44
  58. package/src/components/Functional/DataImport/index.tsx +689 -689
  59. package/src/components/Functional/DataValidation/index.less +63 -63
  60. package/src/components/Functional/DataValidation/index.md +38 -38
  61. package/src/components/Functional/DataValidation/index.tsx +681 -681
  62. package/src/components/Functional/ExportFunctions/ExportIcon/index.md +37 -37
  63. package/src/components/Functional/ExportFunctions/ExportIcon/index.tsx +59 -59
  64. package/src/components/Functional/QueryMutipleInput/index.less +37 -37
  65. package/src/components/Functional/QueryMutipleInput/index.md +33 -33
  66. package/src/components/Functional/QueryMutipleInput/index.tsx +128 -128
  67. package/src/components/Functional/SearchSelect/index.less +115 -115
  68. package/src/components/Functional/SearchSelect/index.md +141 -141
  69. package/src/components/Functional/SearchSelect/index.tsx +812 -812
  70. package/src/components/Functional/TreeSearchSelect/index.md +47 -47
  71. package/src/components/Functional/TreeSearchSelect/index.tsx +149 -149
  72. package/src/index.ts +27 -27
  73. package/src/utils/CheckOneUser/index.md +39 -39
  74. package/src/utils/CheckOneUser/index.ts +51 -51
  75. package/src/utils/requestUtils.ts +32 -32
  76. package/src/utils/utils.ts +22 -22
  77. package/tsconfig.json +29 -29
  78. package/typings.d.ts +4 -4
@@ -1,1446 +1,1448 @@
1
- // 此文件用于 处理业务组件 所用到的公共方法
2
- // @ts-nocheck
3
- import { shopFileType, arrivalPaySupportList, sharingType, shopFile2Type } from './common';
4
- import { getDictionarySource, getDictionaryTextByValue, loadSelectSource } from './utils';
5
-
6
- const hasDictSharingType = getDictionarySource('UC000013')?.length;
7
- const sharingTypeDataList = hasDictSharingType && getDictionarySource('UC000013') || sharingType
8
-
9
- export function commonFun (type?: string, prefixUrl: any, requestConfigProp?: any, modalTableBusProps?:any) {
10
- // 默认type === 'supplier' 供应商选择器
11
- let requestConfig = {
12
- url: `${prefixUrl.selectPrefix}/supplier`,
13
- filter: 'qp-name,code-orGroup,like', // 过滤参数
14
- otherParams: {
15
- sorter: 'desc-id'
16
- }, // 默认参数
17
- ...requestConfigProp
18
- }
19
-
20
- /*
21
- * 处理 格式化下拉框数据源
22
- * reData 必传 promise返回响应的数据 格式为[{},{},{},...] Promise.all第一个参数数组有多少个数组长度就是多少,其中每个对象为每次请求的结果数据
23
- * 每个结果数据格式为{ status: '0', msg: 'success', data: { items: [], total: 1, size: 1, page: 1 }, traceId: 'baba..'}
24
- * position 必传 为获取Promise.all请求结果的位置
25
- * changePosition 必传 为搜索表单Form中需要更改数据源的Item项的位置
26
- * changeSearchForm 必传 为搜索表单Form数据
27
- * */
28
- const formatSource = (reData: any, position: number, changePosition: number,changeSearchForm: any,resKeyValue=['code', 'name']) => {
29
- const data = reData && reData[position]?.data;
30
- const list = Array.isArray(data) ? data :(data?.items || data?.list || data?.children || []);
31
- const formatData = list?.length ? list.map((v: any) => ({ text: v[resKeyValue[1]], value: v[resKeyValue[0]] })) : [];
32
- changeSearchForm[changePosition] = {...changeSearchForm[changePosition], initialSource: formatData}
33
- }
34
-
35
- // 格式化树选择器数据源
36
- const mapSearchTree = (treeDataItem: any, resKeyValue: any) => {
37
- const haveChildren = Array.isArray(treeDataItem.children) && treeDataItem.children.length > 0;
38
- return {
39
- title: treeDataItem[resKeyValue[1]],
40
- value: treeDataItem[resKeyValue[0]],
41
- parentId: treeDataItem.parent,
42
- data: { ...treeDataItem },
43
- isLeaf: !haveChildren,
44
- disabled: haveChildren,
45
- children: haveChildren ? treeDataItem.children.map((i: any) => mapSearchTree(i, resKeyValue)) : [],
46
- };
47
- };
48
- const formatTreeDataSource = (reData: any, position: number, changePosition: number,changeSearchForm: any,resKeyValue=['id', 'name']) => {
49
- const data = reData && reData[position]?.data;
50
- const formatData = (data &&
51
- Array.isArray(data) &&
52
- data.length &&
53
- data.map((ites: any) => mapSearchTree(ites, resKeyValue))) ||
54
- []
55
- changeSearchForm[changePosition].field.props.treeData = formatData;
56
- }
57
-
58
-
59
- let tableSearchForm: any [] = [];
60
- let modalTableProps = {
61
- modalTableTitle: '',
62
- tableSearchForm,
63
- tableColumns: [],
64
- ...modalTableBusProps,
65
- }
66
- let needModalTable = modalTableBusProps?.needModalTable !== undefined ? modalTableBusProps?.needModalTable : true;
67
-
68
- // 供应商选择器
69
- if(type === 'supplier') {
70
- tableSearchForm = [
71
- { name: 'qp-name-like', label: '供应商名称' }, // field: { type: 'input', props: { placeholder: '请输入'}}
72
- { name: 'qp-code-like', label: '供应商编码' },
73
- { name: 'qp-conglomerateCode-in', type: 'select', label: '归属集团', field: {
74
- type: 'select',
75
- props: {
76
- mode: 'multiple',
77
- notFoundContent: '暂无数据',
78
- allowClear: true,
79
- showSearch: true,
80
- showArrow: true,
81
- maxTagCount: 1,
82
- optionFilterProp: 'children',
83
- filterOption: (input: string, option: { props: { children: string } }) =>
84
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
85
- },
86
- } },
87
- { name: 'qp-accountingCode-in', type: 'select', label: '归属核算主体', field: {
88
- type: 'select',
89
- props: {
90
- mode: 'multiple',
91
- notFoundContent: '暂无数据',
92
- allowClear: true,
93
- showSearch: true,
94
- showArrow: true,
95
- maxTagCount: 1,
96
- optionFilterProp: 'children',
97
- filterOption: (input: string, option: { props: { children: string } }) =>
98
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
99
- },
100
- } },
101
- { name: 'qp-companyCode-in', type: 'select', label: '归属法人公司', field: {
102
- type: 'select',
103
- props: {
104
- mode: 'multiple',
105
- notFoundContent: '暂无数据',
106
- allowClear: true,
107
- showSearch: true,
108
- showArrow: true,
109
- maxTagCount: 1,
110
- optionFilterProp: 'children',
111
- filterOption: (input: string, option: { props: { children: string } }) =>
112
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
113
- },
114
- } },
115
- { name: 'qp-sharingType-eq', type: 'select', label: '共享类型', initialSource: sharingTypeDataList },
116
- ]
117
- Promise.all([
118
- loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
119
- pageSize: 5000,
120
- currentPage: 1,
121
- 'qp-companyType-eq': '30',
122
- }),
123
- loadSelectSource(`${prefixUrl.formSelectFix}/accountingSubject`, {
124
- pageSize: 5000,
125
- currentPage: 1,
126
- }),
127
- loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
128
- pageSize: 5000,
129
- currentPage: 1,
130
- 'qp-companyType-eq': '20',
131
- })
132
- ]).then((x: any)=>{
133
- formatSource(x,0, 2, tableSearchForm);
134
- formatSource(x,1, 3, tableSearchForm);
135
- formatSource(x,2, 4, tableSearchForm);
136
- })
137
- modalTableProps = {
138
- modalTableTitle: '选择供应商',
139
- tableSearchForm,
140
- tableColumns: [
141
- {
142
- title: '供应商编码',
143
- dataIndex: 'code',
144
- },
145
- {
146
- title: '供应商名称',
147
- dataIndex: 'name',
148
- },
149
- {
150
- title: '归属集团',
151
- dataIndex: 'conglomerateName',
152
- },
153
- {
154
- title: '归属法人公司',
155
- dataIndex: 'legalCompanyName',
156
- },
157
- {
158
- title: '归属核算主体',
159
- dataIndex: 'accountingName',
160
- },
161
- {
162
- title: '共享类型',
163
- dataIndex: 'sharingType',
164
- render: (text: number) => hasDictSharingType ? getDictionaryTextByValue('UC000013', text) : sharingType.find((i: any) => i.value === text)?.text
165
- },
166
- ],
167
- ...modalTableBusProps,
168
- }
169
- }
170
- if(type === 'supplier2') {
171
- // 版本2
172
- tableSearchForm = [
173
- { name: 'qp-name-like', label: '供应商名称' }, // field: { type: 'input', props: { placeholder: '请输入'}}
174
- { name: 'qp-code-like', label: '供应商编码' },
175
- { name: 'qp-createOrgCode-eq', type: 'select', label: '创建组织', field: {
176
- type: 'select',
177
- props: {
178
- // mode: 'multiple',
179
- notFoundContent: '暂无数据',
180
- allowClear: true,
181
- showSearch: true,
182
- showArrow: true,
183
- // maxTagCount: 1,
184
- optionFilterProp: 'children',
185
- filterOption: (input: string, option: { props: { children: string } }) =>
186
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
187
- },
188
- } },
189
- { name: 'qp-supplierOrgCode-eq', type: 'select', label: '使用组织', field: {
190
- type: 'select',
191
- props: {
192
- // mode: 'multiple',
193
- notFoundContent: '暂无数据',
194
- allowClear: true,
195
- showSearch: true,
196
- showArrow: true,
197
- // maxTagCount: 1,
198
- optionFilterProp: 'children',
199
- filterOption: (input: string, option: { props: { children: string } }) =>
200
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
201
- },
202
- } },
203
- ]
204
- Promise.all([
205
- loadSelectSource(`${prefixUrl.formSelectFix}/org/listNoPage`, {}),
206
- loadSelectSource(`${prefixUrl.formSelectFix}/org/listNoPage`, {}),
207
- ]).then((x: any)=>{
208
- formatSource(x,0, 2, tableSearchForm);
209
- formatSource(x,1, 3, tableSearchForm);
210
- })
211
- modalTableProps = {
212
- modalTableTitle: '选择供应商',
213
- tableSearchForm,
214
- tableColumns: [
215
- {
216
- title: '供应商编码',
217
- dataIndex: 'code',
218
- },
219
- {
220
- title: '供应商名称',
221
- dataIndex: 'name',
222
- },
223
- {
224
- title: '创建组织',
225
- dataIndex: 'createOrgName',
226
- },
227
- {
228
- title: '使用组织',
229
- dataIndex: 'salesOrgName',
230
- },
231
- ],
232
- ...modalTableBusProps
233
- }
234
- }
235
-
236
- // 商品选择器sku
237
- if(type === 'skuCommodity') {
238
- requestConfig = {
239
- url: `${prefixUrl.selectPrefix}/sku/pager/v2`,
240
- filter: 'skuCodeAndSkuName', // 过滤参数
241
- mappingTextField: 'name',
242
- mappingValueField: 'skuCode',
243
- mappingTextShowTextField: ['name', 'propertyNameAndValue'],
244
- otherParams: {
245
- 'qp-combination-eq': false,
246
- 'qp-approveStatus-eq': 1,
247
- 'qp-status-eq': 1,
248
- // 'qp-type-eq': 10, // 查唯一国际条码【有些项目不需要必须要有国际条码,故注释,需要的项目自己定义otherParams补充上这个条件】
249
- sorter: 'desc-id'
250
- }, // 默认参数
251
- sourceName: 'skuCode',
252
- ...requestConfigProp,
253
- }
254
- tableSearchForm = requestConfig.url.includes('v2') ? [
255
- requestConfig.url.includes('v2') ? { name: 'qp-skuName-like', label: 'SKU名称' } : { name: 'qp-name-like', label: 'SKU名称' },
256
- { name: 'qp-skuCode-in', label: 'SKU编码', field: {
257
- type: 'multipleQueryInput',
258
- props: {
259
- ...(requestConfigProp?.skuCodeValueRequestConfig || {}),
260
- },
261
- }},
262
- requestConfig.url.includes('v2') ? { name: 'qp-code-like', label: '国际条码' } : { name: 'qp-barCode-like', label: '国际条码'},
263
- { name: 'qp-itemName-like', label: '所属SPU名称' },
264
- { name: 'qp-itemCode-like', label: '所属SPU编码' },
265
- requestConfig.url.includes('v2') ?{ name: 'qp-externalCode-like', label: '外部编码' } : null,
266
- requestConfig.url.includes('v2') ? { name: 'qp-propertyValueCode-in', type: 'businessSearchSelect', label: '规格', field: {
267
- type: 'businessSearchSelect',
268
- props: {
269
- selectBusinessType: 'skuPropertyValue',
270
- selectProps: {
271
- mode: 'multiple',
272
- maxTagCount: 1,
273
- },
274
- ...(requestConfigProp?.skuPropertyValueRequestConfig || { prefixUrl }), // 可自定义此处规格请求接口相关参数,默认前缀取自sku选择器
275
- },
276
- }
277
- } : null,
278
- { name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
279
- type: 'select',
280
- props: {
281
- mode: 'multiple',
282
- notFoundContent: '暂无数据',
283
- allowClear: true,
284
- showSearch: true,
285
- showArrow: true,
286
- maxTagCount: 1,
287
- optionFilterProp: 'children',
288
- filterOption: (input: string, option: { props: { children: string } }) =>
289
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
290
- },
291
- } },
292
- { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
293
- type: 'treeSelect',
294
- props: {
295
- treeData: [],
296
- treeCheckable: true,
297
- showSearch: true,
298
- allowClear: true,
299
- showArrow: true,
300
- treeNodeFilterProp: 'title',
301
- treeDefaultExpandAll: true,
302
- maxTagCount: 1,
303
- placeholder: '请选择',
304
- style: {
305
- width: '100%',
306
- },
307
- dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
308
- },
309
- } },
310
- { name: 'qp-classId-in', type: 'select', label: '品类', field: {
311
- type: 'select',
312
- props: {
313
- mode: 'multiple',
314
- notFoundContent: '暂无数据',
315
- allowClear: true,
316
- showSearch: true,
317
- showArrow: true,
318
- maxTagCount: 1,
319
- optionFilterProp: 'children',
320
- filterOption: (input: string, option: { props: { children: string } }) =>
321
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
322
- },
323
- } },
324
- ] : [
325
- { name: 'qp-name-like', label: 'SKU名称' },
326
- { name: 'qp-skuCode-in', label: 'SKU编码', field: {
327
- type: 'multipleQueryInput',
328
- props: {
329
- ...(requestConfigProp?.skuCodeValueRequestConfig || {}),
330
- },
331
- }},
332
- { name: 'qp-barCode-like', label: '国际条码'},
333
- { name: 'qp-itemName-like', label: '所属SPU名称' },
334
- { name: 'qp-itemCode-like', label: '所属SPU编码' },
335
- { name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
336
- type: 'select',
337
- props: {
338
- mode: 'multiple',
339
- notFoundContent: '暂无数据',
340
- allowClear: true,
341
- showSearch: true,
342
- showArrow: true,
343
- maxTagCount: 1,
344
- optionFilterProp: 'children',
345
- filterOption: (input: string, option: { props: { children: string } }) =>
346
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
347
- },
348
- } },
349
- { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
350
- type: 'treeSelect',
351
- props: {
352
- treeData: [],
353
- treeCheckable: true,
354
- showSearch: true,
355
- allowClear: true,
356
- showArrow: true,
357
- treeNodeFilterProp: 'title',
358
- treeDefaultExpandAll: true,
359
- maxTagCount: 1,
360
- placeholder: '请选择',
361
- style: {
362
- width: '100%',
363
- },
364
- dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
365
- },
366
- } },
367
- { name: 'qp-classId-in', type: 'select', label: '品类', field: {
368
- type: 'select',
369
- props: {
370
- mode: 'multiple',
371
- notFoundContent: '暂无数据',
372
- allowClear: true,
373
- showSearch: true,
374
- showArrow: true,
375
- maxTagCount: 1,
376
- optionFilterProp: 'children',
377
- filterOption: (input: string, option: { props: { children: string } }) =>
378
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
379
- },
380
- } },
381
- ]
382
- Promise.all([
383
- loadSelectSource(`${prefixUrl.formSelectFix}/brand/queryBrandList`, {
384
- pageSize: 5000,
385
- currentPage: 1,
386
- 'ctl-withAuth': true
387
- }),
388
- loadSelectSource(`${prefixUrl.formSelectFix}/category/queryCategoryTree`, {
389
- pageSize: 5000,
390
- currentPage: 1,
391
- }),
392
- loadSelectSource(`${prefixUrl.formSelectFix}/class/withProperty`, {
393
- pageSize: 5000,
394
- currentPage: 1,
395
- }),
396
- ]).then((x: any)=>{
397
- requestConfig.url.includes('v2') ? formatSource(x,0, 7, tableSearchForm,['id','name']) : formatSource(x,0, 5, tableSearchForm,['id','name'])
398
- requestConfig.url.includes('v2') ? formatTreeDataSource(x,1, 8, tableSearchForm) : formatTreeDataSource(x,1, 6, tableSearchForm)
399
- requestConfig.url.includes('v2') ? formatSource(x,2, 9, tableSearchForm,['id','name']) : formatSource(x,2, 7, tableSearchForm,['id','name'])
400
- })
401
- modalTableProps = {
402
- modalTableTitle: '选择SKU',
403
- tableSearchForm,
404
- tableColumns: requestConfig.url.includes('v2') ? [
405
- {
406
- title: 'SKU编码',
407
- dataIndex: 'skuCode',
408
- },
409
- {
410
- title: 'SKU名称',
411
- dataIndex: 'name',
412
- },
413
- {
414
- title: '国际条码',
415
- dataIndex: 'barCode',
416
- },
417
- {
418
- title: '所属SPU名称',
419
- dataIndex: 'itemName',
420
- },
421
- {
422
- title: '所属SPU编码',
423
- dataIndex: 'itemCode',
424
- },
425
- requestConfig.url.includes('v2') ? {
426
- title: '外部编码',
427
- dataIndex: 'externalCode',
428
- } : false,
429
- {
430
- title: '规格',
431
- dataIndex: requestConfig.url.includes('v2') ? 'propertyNameAndValue' : 'skuSpec',
432
- },
433
- {
434
- title: '类目',
435
- dataIndex: 'categoryName',
436
- },
437
- {
438
- title: '品类',
439
- dataIndex: 'className',
440
- },
441
- {
442
- title: '品牌',
443
- dataIndex: 'brandName',
444
- },
445
- ] : [
446
- {
447
- title: 'SKU编码',
448
- dataIndex: 'skuCode',
449
- },
450
- {
451
- title: 'SKU名称',
452
- dataIndex: 'name',
453
- },
454
- {
455
- title: '国际条码',
456
- dataIndex: 'barCode',
457
- },
458
- {
459
- title: '所属SPU名称',
460
- dataIndex: 'itemName',
461
- },
462
- {
463
- title: '所属SPU编码',
464
- dataIndex: 'itemCode',
465
- },
466
- {
467
- title: '规格',
468
- dataIndex: 'skuSpec',
469
- },
470
- {
471
- title: '类目',
472
- dataIndex: 'categoryName',
473
- },
474
- {
475
- title: '品类',
476
- dataIndex: 'className',
477
- },
478
- {
479
- title: '品牌',
480
- dataIndex: 'brandName',
481
- },
482
- ],
483
- ...modalTableBusProps
484
- }
485
- }
486
-
487
- // 商品选择器spu
488
- if(type === 'spuCommodity') {
489
- requestConfig = {
490
- url: `${prefixUrl.selectPrefix}/item`,
491
- filter: 'qp-itemCode,name-orGroup,like', // 过滤参数
492
- mappingTextField: 'name',
493
- mappingValueField: 'itemCode',
494
- otherParams: {
495
- 'qp-approveStatus-eq': 1, // 审核状态(0.待审批;1.审批通过;2.驳回;3.审批未通过)
496
- sorter: 'desc-id'
497
- }, // 默认参数
498
- sourceName: 'itemCode',
499
- ...requestConfigProp,
500
- }
501
- tableSearchForm = [
502
- { name: 'qp-name-like', label: 'SPU名称' },
503
- { name: 'qp-itemCode-like', label: 'SPU编码' },
504
- { name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
505
- type: 'select',
506
- props: {
507
- mode: 'multiple',
508
- notFoundContent: '暂无数据',
509
- allowClear: true,
510
- showSearch: true,
511
- showArrow: true,
512
- maxTagCount: 1,
513
- optionFilterProp: 'children',
514
- filterOption: (input: string, option: { props: { children: string } }) =>
515
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
516
- },
517
- } },
518
- { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
519
- type: 'treeSelect',
520
- props: {
521
- treeData: [],
522
- treeCheckable: true,
523
- showSearch: true,
524
- allowClear: true,
525
- showArrow: true,
526
- treeNodeFilterProp: 'title',
527
- treeDefaultExpandAll: true,
528
- maxTagCount: 1,
529
- placeholder: '请选择',
530
- style: {
531
- width: '100%',
532
- },
533
- dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
534
- },
535
- } },
536
- { name: 'qp-classId-in', type: 'select', label: '品类', field: {
537
- type: 'select',
538
- props: {
539
- mode: 'multiple',
540
- notFoundContent: '暂无数据',
541
- allowClear: true,
542
- showSearch: true,
543
- showArrow: true,
544
- maxTagCount: 1,
545
- optionFilterProp: 'children',
546
- filterOption: (input: string, option: { props: { children: string } }) =>
547
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
548
- },
549
- } },
550
- ]
551
- Promise.all([
552
- loadSelectSource(`${prefixUrl.formSelectFix}/brand/queryBrandList`, {
553
- pageSize: 5000,
554
- currentPage: 1,
555
- 'ctl-withAuth': true
556
- }),
557
- loadSelectSource(`${prefixUrl.formSelectFix}/category/queryCategoryTree`, {
558
- pageSize: 5000,
559
- currentPage: 1,
560
- }),
561
- loadSelectSource(`${prefixUrl.formSelectFix}/class/withProperty`, {
562
- pageSize: 5000,
563
- currentPage: 1,
564
- }),
565
- ]).then((x: any)=>{
566
- formatSource(x,0, 2, tableSearchForm,['id','name']);
567
- formatTreeDataSource(x,1, 3, tableSearchForm);
568
- formatSource(x,2, 4, tableSearchForm,['id','name']);
569
- })
570
- modalTableProps = {
571
- modalTableTitle: '选择SPU',
572
- tableSearchForm,
573
- tableColumns: [
574
- {
575
- title: 'SPU编码',
576
- dataIndex: 'itemCode',
577
- },
578
- {
579
- title: 'SPU名称',
580
- dataIndex: 'name',
581
- },
582
- {
583
- title: '品牌',
584
- dataIndex: 'brandName',
585
- },
586
- {
587
- title: '类目',
588
- dataIndex: 'categoryText',
589
- },
590
- {
591
- title: '品类',
592
- dataIndex: 'className',
593
- },
594
- ],
595
- ...modalTableBusProps
596
- }
597
- }
598
-
599
- // 商品规格选择器(无弹窗)
600
- if(type === 'skuPropertyValue') {
601
- requestConfig = {
602
- url: `${prefixUrl.selectPrefix}/skuPropertyValue/list`,
603
- filter: 'qp-value-like', // 过滤参数
604
- mappingTextField: 'value',
605
- mappingTextShowKeyField: 'propertyValueCode',
606
- mappingValueField: 'propertyValueCode',
607
- otherParams: {
608
- sorter: 'desc-id'
609
- }, // 默认参数
610
- sourceName: 'qp-propertyValueCode-in',
611
- ...requestConfigProp,
612
- }
613
- needModalTable = false
614
- }
615
-
616
- // 仓库选择器(物理、逻辑仓)
617
- if(type === 'physicalWarehouse') {
618
- requestConfig = {
619
- url: `${prefixUrl.selectPrefix}/physicalWarehouse`,
620
- filter: 'qp-physicalWarehouseName,physicalWarehouseCode-orGroup,like', // 过滤参数
621
- mappingTextField: 'physicalWarehouseName',
622
- mappingTextShowKeyField: 'physicalWarehouseCode',
623
- mappingValueField: 'id',
624
- otherParams: {
625
- 'qp-isEnable-eq': 1,
626
- sorter: 'desc-id'
627
- }, // 默认参数
628
- sourceName: 'warehouseIds',
629
- ...requestConfigProp,
630
- }
631
- tableSearchForm = [
632
- { name: 'qp-physicalWarehouseName-like', label: '物理仓名称' },
633
- { name: 'qp-physicalWarehouseCode-like', label: '物理仓编码' },
634
- { name: 'qp-physicalWarehouseType-eq', type: 'select', label: '物理仓类型', initialSource: getDictionarySource('SC00002') },
635
- { name: 'qp-companyCode-eq', type: 'select', label: '所属公司', field: {
636
- type: 'select',
637
- props: {
638
- mode: 'multiple',
639
- notFoundContent: '暂无数据',
640
- allowClear: true,
641
- showSearch: true,
642
- showArrow: true,
643
- maxTagCount: 1,
644
- optionFilterProp: 'children',
645
- filterOption: (input: string, option: { props: { children: string } }) =>
646
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
647
- },
648
- } },
649
- ]
650
- Promise.all([
651
- loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
652
- pageSize: 5000,
653
- currentPage: 1,
654
- 'qp-companyType-eq': 20,
655
- }),
656
- ]).then((x: any)=>{
657
- formatSource(x,0, 3, tableSearchForm);
658
- })
659
- modalTableProps = {
660
- modalTableTitle: '选择物理仓',
661
- tableSearchForm,
662
- tableColumns: [
663
- {
664
- title: '物理仓编码',
665
- dataIndex: 'physicalWarehouseCode',
666
- },
667
- {
668
- title: '物理仓名称',
669
- dataIndex: 'physicalWarehouseName',
670
- },
671
- {
672
- title: '物理仓类型',
673
- dataIndex: 'physicalWarehouseType',
674
- render: (text: number) => getDictionaryTextByValue('SC00002', text),
675
- },
676
- {
677
- title: '所属公司',
678
- dataIndex: 'companyName',
679
- },
680
- ],
681
- ...modalTableBusProps
682
- }
683
- }
684
- if(type === 'realWarehouse') {
685
- requestConfig = {
686
- url: `${prefixUrl.selectPrefix}/realWarehouse`,
687
- filter: 'qp-realWarehouseName,realWarehouseCode-orGroup,like', // 过滤参数
688
- mappingTextField: 'realWarehouseName',
689
- mappingTextShowKeyField: 'realWarehouseCode',
690
- mappingValueField: 'id',
691
- otherParams: {
692
- 'qp-isEnable-eq': 1,
693
- sorter: 'desc-id'
694
- }, // 默认参数
695
- sourceName: 'warehouseIds',
696
- ...requestConfigProp,
697
- }
698
- tableSearchForm = [
699
- { name: 'qp-realWarehouseName-like', label: '逻辑仓名称' },
700
- { name: 'qp-realWarehouseCode-like', label: '逻辑仓编码' },
701
- { name: 'qp-realWarehouseType-eq', type: 'select', label: '逻辑仓类型', initialSource: getDictionarySource('SC00004') },
702
- ]
703
- modalTableProps = {
704
- modalTableTitle: '选择逻辑仓',
705
- tableSearchForm,
706
- tableColumns: [
707
- {
708
- title: '逻辑仓编码',
709
- dataIndex: 'realWarehouseCode',
710
- },
711
- {
712
- title: '逻辑仓名称',
713
- dataIndex: 'realWarehouseName',
714
- },
715
- {
716
- title: '逻辑仓类型',
717
- dataIndex: 'realWarehouseType',
718
- render: (text: number) => getDictionaryTextByValue('SC00004', text),
719
- },
720
- ],
721
- ...modalTableBusProps,
722
- }
723
- }
724
-
725
- // 仓库选择器(虚拟、渠道仓)(无弹窗)
726
- if(type === 'virtualWarehouse') {
727
- requestConfig = {
728
- url: `${prefixUrl.selectPrefix}/virtualWarehouse`,
729
- filter: 'qp-virtualWarehouseName,virtualWarehouseCode-orGroup,like', // 过滤参数
730
- mappingTextField: 'virtualWarehouseName',
731
- mappingTextShowKeyField: 'virtualWarehouseCode',
732
- mappingValueField: 'id',
733
- otherParams: {
734
- 'qp-isEnable-eq': 1,
735
- sorter: 'desc-id'
736
- }, // 默认参数
737
- sourceName: 'warehouseIds',
738
- ...requestConfigProp,
739
- }
740
- needModalTable = false
741
- }
742
- if(type === 'channelWarehouse') {
743
- requestConfig = {
744
- url: `${prefixUrl.selectPrefix}/channelWarehouse`,
745
- filter: 'qp-channelWarehouseName,channelWarehouseCode-orGroup,like', // 过滤参数
746
- mappingTextField: 'channelWarehouseName',
747
- mappingTextShowKeyField: 'channelWarehouseCode',
748
- mappingValueField: 'id',
749
- otherParams: {
750
- 'qp-isEnable-eq': 1,
751
- sorter: 'desc-id'
752
- }, // 默认参数
753
- sourceName: 'warehouseIds',
754
- ...requestConfigProp,
755
- }
756
- needModalTable = false
757
- }
758
-
759
- // 客户选择器
760
- if(type === 'customer') {
761
- requestConfig = {
762
- url: `${prefixUrl.selectPrefix}/uc/customer/v2`,
763
- filter: 'qp-name,code-orGroup,like', // 过滤参数
764
- mappingTextField: 'name',
765
- mappingValueField: 'code',
766
- otherParams: {
767
- 'qp-status-eq': 10,
768
- sorter: 'desc-id'
769
- }, // 默认参数
770
- sourceName: 'customCode',
771
- ...requestConfigProp,
772
- }
773
- tableSearchForm = [
774
- { name: 'qp-name-like', label: '客户名称' },
775
- { name: 'qp-code-like', label: '客户编码' },
776
- { name: 'qp-conglomerateCode-in', type: 'select', label: '归属集团', field: {
777
- type: 'select',
778
- props: {
779
- mode: 'multiple',
780
- notFoundContent: '暂无数据',
781
- allowClear: true,
782
- showSearch: true,
783
- showArrow: true,
784
- maxTagCount: 1,
785
- optionFilterProp: 'children',
786
- filterOption: (input: string, option: { props: { children: string } }) =>
787
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
788
- },
789
- } },
790
- { name: 'qp-accountingCode-in', type: 'select', label: '归属核算主体', field: {
791
- type: 'select',
792
- props: {
793
- mode: 'multiple',
794
- notFoundContent: '暂无数据',
795
- allowClear: true,
796
- showSearch: true,
797
- showArrow: true,
798
- maxTagCount: 1,
799
- optionFilterProp: 'children',
800
- filterOption: (input: string, option: { props: { children: string } }) =>
801
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
802
- },
803
- } },
804
- { name: 'qp-companyCode-in', type: 'select', label: '归属法人公司', field: {
805
- type: 'select',
806
- props: {
807
- mode: 'multiple',
808
- notFoundContent: '暂无数据',
809
- allowClear: true,
810
- showSearch: true,
811
- showArrow: true,
812
- maxTagCount: 1,
813
- optionFilterProp: 'children',
814
- filterOption: (input: string, option: { props: { children: string } }) =>
815
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
816
- },
817
- } },
818
- { name: 'qp-sharingType-eq', type: 'select', label: '共享类型', initialSource: sharingTypeDataList },
819
- ]
820
- Promise.all([
821
- loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
822
- pageSize: 5000,
823
- currentPage: 1,
824
- 'qp-companyType-eq': '30',
825
- }),
826
- loadSelectSource(`${prefixUrl.formSelectFix}/accountingSubject`, {
827
- pageSize: 5000,
828
- currentPage: 1,
829
- }),
830
- loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
831
- pageSize: 5000,
832
- currentPage: 1,
833
- 'qp-companyType-eq': '20',
834
- })
835
- ]).then((x: any)=>{
836
- formatSource(x,0, 2, tableSearchForm);
837
- formatSource(x,1, 3, tableSearchForm);
838
- formatSource(x,2, 4, tableSearchForm);
839
- })
840
- modalTableProps = {
841
- modalTableTitle: '选择客户',
842
- tableSearchForm,
843
- tableColumns: [
844
- {
845
- title: '客户编码',
846
- dataIndex: 'code',
847
- },
848
- {
849
- title: '客户名称',
850
- dataIndex: 'name',
851
- },
852
- {
853
- title: '归属集团',
854
- dataIndex: 'conglomerateName',
855
- },
856
- {
857
- title: '归属法人公司',
858
- dataIndex: 'legalCompanyName',
859
- },
860
- {
861
- title: '归属核算主体',
862
- dataIndex: 'accountingName',
863
- },
864
- {
865
- title: '共享类型',
866
- dataIndex: 'sharingType',
867
- render: (text: number) => hasDictSharingType ? getDictionaryTextByValue('UC000013', text) : sharingType.find((i: any) => i.value === text)?.text,
868
- },
869
- ],
870
- ...modalTableBusProps
871
- }
872
- }
873
- if(type === 'customer2') {
874
- // 版本2
875
- requestConfig = {
876
- url: `${prefixUrl.selectPrefix}/customer`,
877
- filter: 'qp-name,code-orGroup,like', // 过滤参数
878
- mappingTextField: 'name',
879
- mappingValueField: 'code',
880
- otherParams: {
881
- sorter: 'desc-id'
882
- }, // 默认参数
883
- sourceName: 'customCode',
884
- ...requestConfigProp,
885
- }
886
- tableSearchForm = [
887
- { name: 'qp-name-like', label: '客户名称' },
888
- { name: 'qp-code-like', label: '客户编码' },
889
- { name: 'qp-createOrgCode-eq', type: 'select', label: '创建组织', field: {
890
- type: 'select',
891
- props: {
892
- // mode: 'multiple',
893
- notFoundContent: '暂无数据',
894
- allowClear: true,
895
- showSearch: true,
896
- showArrow: true,
897
- // maxTagCount: 1,
898
- optionFilterProp: 'children',
899
- filterOption: (input: string, option: { props: { children: string } }) =>
900
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
901
- },
902
- } },
903
- { name: 'qp-salesOrgCode-eq', type: 'select', label: '使用组织', field: {
904
- type: 'select',
905
- props: {
906
- // mode: 'multiple',
907
- notFoundContent: '暂无数据',
908
- allowClear: true,
909
- showSearch: true,
910
- showArrow: true,
911
- // maxTagCount: 1,
912
- optionFilterProp: 'children',
913
- filterOption: (input: string, option: { props: { children: string } }) =>
914
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
915
- },
916
- } },
917
- ]
918
- Promise.all([
919
- loadSelectSource(`${prefixUrl.formSelectFix}/org/listNoPage`, {}),
920
- loadSelectSource(`${prefixUrl.formSelectFix}/org/listNoPage`,{}),
921
- ]).then((x: any)=>{
922
- formatSource(x,0, 2, tableSearchForm);
923
- formatSource(x,1, 3, tableSearchForm);
924
- })
925
- modalTableProps = {
926
- modalTableTitle: '选择客户',
927
- tableSearchForm,
928
- tableColumns: [
929
- {
930
- title: '客户编码',
931
- dataIndex: 'code',
932
- },
933
- {
934
- title: '客户名称',
935
- dataIndex: 'name',
936
- },
937
- {
938
- title: '创建组织',
939
- dataIndex: 'createOrgName',
940
- },
941
- {
942
- title: '使用组织',
943
- dataIndex: 'salesOrgName',
944
- },
945
- ],
946
- ...modalTableBusProps
947
- }
948
- }
949
-
950
- // 店铺选择器
951
- if(type === 'shopFile') {
952
- requestConfig = {
953
- url: `${prefixUrl.selectPrefix}/store`,
954
- filter: 'qp-name,code-orGroup,like', // 过滤参数
955
- mappingTextField: 'name',
956
- mappingValueField: 'code',
957
- otherParams: {
958
- sorter: 'desc-id'
959
- }, // 默认参数
960
- sourceName: 'code',
961
- ...requestConfigProp,
962
- }
963
- tableSearchForm = [
964
- { name: 'qp-name-like', label: '店铺名称' },
965
- { name: 'qp-code-like', label: '店铺编码' },
966
- { name: 'qp-conglomerateCode-in', type: 'select', label: '归属集团', field: {
967
- type: 'select',
968
- props: {
969
- mode: 'multiple',
970
- notFoundContent: '暂无数据',
971
- allowClear: true,
972
- showSearch: true,
973
- showArrow: true,
974
- maxTagCount: 1,
975
- optionFilterProp: 'children',
976
- filterOption: (input: string, option: { props: { children: string } }) =>
977
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
978
- },
979
- } },
980
- { name: 'qp-companyCode-in', type: 'select', label: '归属法人公司', field: {
981
- type: 'select',
982
- props: {
983
- mode: 'multiple',
984
- notFoundContent: '暂无数据',
985
- allowClear: true,
986
- showSearch: true,
987
- showArrow: true,
988
- maxTagCount: 1,
989
- optionFilterProp: 'children',
990
- filterOption: (input: string, option: { props: { children: string } }) =>
991
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
992
- },
993
- } },
994
- { name: 'qp-type-in', type: 'select', label: '店铺类型', initialSource: shopFileType },
995
- { name: 'qp-plateformCode-in', type: 'select', label: '店铺来源', field: {
996
- type: 'select',
997
- props: {
998
- mode: 'multiple',
999
- notFoundContent: '暂无数据',
1000
- allowClear: true,
1001
- showSearch: true,
1002
- showArrow: true,
1003
- maxTagCount: 1,
1004
- optionFilterProp: 'children',
1005
- filterOption: (input: string, option: { props: { children: string } }) =>
1006
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1007
- },
1008
- } },
1009
- { name: 'qp-accountingCode-in', type: 'select', label: '归属核算主体', field: {
1010
- type: 'select',
1011
- props: {
1012
- mode: 'multiple',
1013
- notFoundContent: '暂无数据',
1014
- allowClear: true,
1015
- showSearch: true,
1016
- showArrow: true,
1017
- maxTagCount: 1,
1018
- optionFilterProp: 'children',
1019
- filterOption: (input: string, option: { props: { children: string } }) =>
1020
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1021
- },
1022
- } },
1023
- ]
1024
- Promise.all([
1025
- loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
1026
- pageSize: 5000,
1027
- currentPage: 1,
1028
- 'qp-companyType-eq': '30',
1029
- }),
1030
- loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
1031
- pageSize: 5000,
1032
- currentPage: 1,
1033
- 'qp-companyType-eq': '20',
1034
- }),
1035
- loadSelectSource(`${prefixUrl.formSelectFix}/platformRecord/getPlatformRecordList`, {
1036
- // pageSize: 5000,
1037
- // currentPage: 1,
1038
- 'qp-status-eq': '1',
1039
- }),
1040
- loadSelectSource(`${prefixUrl.formSelectFix}/accountingSubject`, {
1041
- pageSize: 5000,
1042
- currentPage: 1,
1043
- }),
1044
- ]).then((x: any)=>{
1045
- formatSource(x,0, 2, tableSearchForm);
1046
- formatSource(x,1, 3, tableSearchForm);
1047
- formatSource(x,2, 5, tableSearchForm);
1048
- formatSource(x,3, 6, tableSearchForm);
1049
- })
1050
- modalTableProps = {
1051
- modalTableTitle: '选择店铺',
1052
- tableSearchForm,
1053
- tableColumns: [
1054
- {
1055
- title: '店铺编码',
1056
- dataIndex: 'code',
1057
- },
1058
- {
1059
- title: '店铺名称',
1060
- dataIndex: 'name',
1061
- },
1062
- {
1063
- title: '归属集团',
1064
- dataIndex: 'conglomerateName',
1065
- },
1066
- {
1067
- title: '归属法人公司',
1068
- dataIndex: 'companyName',
1069
- },
1070
- {
1071
- title: '店铺类型',
1072
- dataIndex: 'type',
1073
- render: (text: number) => shopFileType.find((i: any) => i.value === text)?.text,
1074
- },
1075
- {
1076
- title: '店铺来源',
1077
- dataIndex: 'platformName',
1078
- },
1079
- {
1080
- title: '归属核算主体',
1081
- dataIndex: 'accountingName',
1082
- },
1083
- ],
1084
- ...modalTableBusProps
1085
- }
1086
- }
1087
- if(type === 'shopFile2') {
1088
- requestConfig = {
1089
- url: `${prefixUrl.selectPrefix}/store/page`,
1090
- filter: 'qp-name,code-orGroup,like', // 过滤参数
1091
- mappingTextField: 'name',
1092
- mappingValueField: 'code',
1093
- otherParams: {
1094
- sorter: 'desc-id'
1095
- }, // 默认参数
1096
- sourceName: 'code',
1097
- ...requestConfigProp,
1098
- }
1099
- tableSearchForm = [
1100
- { name: 'qp-name-like', label: '商店名称' },
1101
- { name: 'qp-code-like', label: '商店编码' },
1102
- { name: 'qp-type-in', type: 'select', label: '商店类型', initialSource: shopFile2Type },
1103
- { name: 'qp-orgCode-in', type: 'select', label: '所属销售组织', field: {
1104
- type: 'select',
1105
- props: {
1106
- mode: 'multiple',
1107
- notFoundContent: '暂无数据',
1108
- allowClear: true,
1109
- showSearch: true,
1110
- showArrow: true,
1111
- maxTagCount: 1,
1112
- optionFilterProp: 'children',
1113
- filterOption: (input: string, option: { props: { children: string } }) =>
1114
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1115
- },
1116
- } },
1117
- ]
1118
- Promise.all([
1119
- loadSelectSource(`${prefixUrl.formSelectFix}/orgView/getTree/sales-organizational-view`, {
1120
- 'qp-employeeCode-eq': JSON.parse(localStorage.getItem('userInfo') || '{}')?.employeeResVo?.employeeNumber,
1121
- 'qp-realOrg-eq': true,
1122
- 'qp-status-eq': 10
1123
- }),
1124
- ]).then((x: any)=>{
1125
- formatSource(x,0, 3, tableSearchForm);
1126
- })
1127
- modalTableProps = {
1128
- modalTableTitle: '选择商店',
1129
- tableSearchForm,
1130
- tableColumns: [
1131
- {
1132
- title: '商店编码',
1133
- dataIndex: 'code',
1134
- },
1135
- {
1136
- title: '商店名称',
1137
- dataIndex: 'name',
1138
- },
1139
- {
1140
- title: '商店类型',
1141
- dataIndex: 'type',
1142
- render: (text: number) => shopFile2Type.find((i: any) => i.value === text)?.text,
1143
- },
1144
- {
1145
- title: '所属销售组织',
1146
- dataIndex: 'orgName',
1147
- },
1148
- ],
1149
- ...modalTableBusProps
1150
- }
1151
- }
1152
-
1153
- // 核算主体选择器(无弹窗)
1154
- if(type === 'accountingSubject') {
1155
- requestConfig = {
1156
- url: `${prefixUrl.selectPrefix}/accountingSubject`,
1157
- filter: 'qp-name,code-orGroup,like', // 过滤参数
1158
- mappingTextField: 'name',
1159
- mappingTextShowKeyField: 'code',
1160
- mappingValueField: 'id',
1161
- otherParams: {
1162
- sorter: 'desc-id'
1163
- }, // 默认参数
1164
- sourceName: 'accountingSubjectCode',
1165
- ...requestConfigProp,
1166
- }
1167
- needModalTable = false
1168
- }
1169
- // 库存组织选择器(无弹窗)
1170
- if(type === 'inventoryOrg') {
1171
- requestConfig = {
1172
- url: `${prefixUrl.selectPrefix}/inventoryOrg`,
1173
- filter: 'qp-name,code-orGroup,like', // 过滤参数
1174
- mappingTextField: 'name',
1175
- mappingTextShowKeyField: 'code',
1176
- mappingValueField: 'id',
1177
- otherParams: {
1178
- sorter: 'desc-id'
1179
- }, // 默认参数
1180
- sourceName: 'inventoryOrgCode',
1181
- ...requestConfigProp,
1182
- }
1183
- needModalTable = false
1184
- }
1185
-
1186
- // 法人公司选择器(无弹窗)
1187
- if(type === 'corporationCompany') {
1188
- requestConfig = {
1189
- url: `${prefixUrl.selectPrefix}/company`,
1190
- filter: 'qp-name,code-orGroup,like', // 过滤参数
1191
- mappingTextField: 'name',
1192
- mappingTextShowKeyField: 'code',
1193
- mappingValueField: 'id',
1194
- otherParams: {
1195
- sorter: 'desc-id'
1196
- }, // 默认参数
1197
- sourceName: 'corporationCompany',
1198
- ...requestConfigProp,
1199
- }
1200
- needModalTable = false
1201
- }
1202
-
1203
- // 员工选择器
1204
- if(type === 'employee') {
1205
- requestConfig = {
1206
- url: `${prefixUrl.selectPrefix}/employee/v2`,
1207
- filter: 'qp-employeeNumber,name-orGroup,like', // 过滤参数
1208
- mappingTextField: 'name',
1209
- mappingTextShowKeyField: 'employeeNumber',
1210
- mappingValueField: 'employeeNumber',
1211
- otherParams: {
1212
- 'qp-enable-eq': 10, // 启用状态 10-启用,20-禁用
1213
- sorter: 'desc-id'
1214
- }, // 默认参数
1215
- sourceName: 'employeeNumber',
1216
- ...requestConfigProp,
1217
- }
1218
- tableSearchForm = [
1219
- { name: 'qp-name-like', label: '员工名称' },
1220
- { name: 'qp-employeeNumber-like', label: '员工编码' },
1221
- { name: 'qp-companyCode-in', type: 'select', label: '所属公司', field: {
1222
- type: 'select',
1223
- props: {
1224
- mode: 'multiple',
1225
- notFoundContent: '暂无数据',
1226
- allowClear: true,
1227
- showSearch: true,
1228
- showArrow: true,
1229
- maxTagCount: 1,
1230
- optionFilterProp: 'children',
1231
- filterOption: (input: string, option: { props: { children: string } }) =>
1232
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1233
- },
1234
- } },
1235
- { name: 'qp-email-like', label: '邮箱' },
1236
- { name: 'qp-officeTelephone-like', label: '手机号' },
1237
- ]
1238
- Promise.all([
1239
- loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
1240
- pageSize: 5000,
1241
- currentPage: 1,
1242
- 'qp-companyType-eq': 20,
1243
- }),
1244
- ]).then((x: any)=>{
1245
- formatSource(x,0, 2, tableSearchForm);
1246
- })
1247
- modalTableProps = {
1248
- modalTableTitle: '选择员工',
1249
- tableSearchForm,
1250
- tableColumns: [
1251
- {
1252
- title: '员工编码',
1253
- dataIndex: 'employeeNumber',
1254
- },
1255
- {
1256
- title: '员工名称',
1257
- dataIndex: 'name',
1258
- },
1259
- {
1260
- title: '所属公司',
1261
- dataIndex: 'companyName',
1262
- },
1263
- {
1264
- title: '邮箱',
1265
- dataIndex: 'email',
1266
- },
1267
- {
1268
- title: '手机号',
1269
- dataIndex: 'officeTelephone',
1270
- },
1271
- ],
1272
- ...modalTableBusProps
1273
- }
1274
- }
1275
- if(type === 'employee2') {
1276
- // 版本2
1277
- requestConfig = {
1278
- url: `${prefixUrl.selectPrefix}/employee/pageList/v2`,
1279
- filter: 'qp-employeeNumber,name-orGroup,like', // 过滤参数
1280
- mappingTextField: 'name',
1281
- mappingTextShowKeyField: 'employeeNumber',
1282
- mappingValueField: 'id',
1283
- otherParams: {
1284
- 'qp-enable-eq': 10, // 启用状态 10-启用,20-禁用
1285
- sorter: 'desc-id'
1286
- }, // 默认参数
1287
- sourceName: 'employeeNumber',
1288
- ...requestConfigProp,
1289
- }
1290
- tableSearchForm = [
1291
- { name: 'qp-name-like', label: '员工名称' },
1292
- { name: 'qp-employeeNumber-like', label: '员工编码' },
1293
- { name: 'qp-directOrgCode-in', type: 'select', label: '所属组织机构', field: {
1294
- type: 'select',
1295
- props: {
1296
- mode: 'multiple',
1297
- notFoundContent: '暂无数据',
1298
- allowClear: true,
1299
- showSearch: true,
1300
- showArrow: true,
1301
- maxTagCount: 1,
1302
- optionFilterProp: 'children',
1303
- filterOption: (input: string, option: { props: { children: string } }) =>
1304
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1305
- },
1306
- } },
1307
- { name: 'qp-email-like', label: '邮箱' },
1308
- { name: 'qp-officeTelephone-like', label: '手机号' },
1309
- ]
1310
- Promise.all([
1311
- loadSelectSource(`${prefixUrl.formSelectFix}/org/listNoPage`, {}),
1312
- ]).then((x: any)=>{
1313
- formatSource(x,0, 2, tableSearchForm);
1314
- })
1315
- modalTableProps = {
1316
- modalTableTitle: '选择员工',
1317
- tableSearchForm,
1318
- tableColumns: [
1319
- {
1320
- title: '员工编码',
1321
- dataIndex: 'employeeNumber',
1322
- },
1323
- {
1324
- title: '员工名称',
1325
- dataIndex: 'name',
1326
- },
1327
- {
1328
- title: '所属组织机构',
1329
- dataIndex: 'directOrgName',
1330
- },
1331
- {
1332
- title: '邮箱',
1333
- dataIndex: 'email',
1334
- },
1335
- {
1336
- title: '手机号',
1337
- dataIndex: 'officeTelephone',
1338
- },
1339
- ],
1340
- ...modalTableBusProps
1341
- }
1342
- }
1343
-
1344
- // 配送方式选择器
1345
- if(type === 'deliveryMode') {
1346
- requestConfig = {
1347
- url: `${prefixUrl.selectPrefix}/deliveryMode`,
1348
- filter: 'qp-name,code-orGroup,like', // 过滤参数
1349
- mappingTextField: 'name',
1350
- mappingTextShowKeyField: 'code',
1351
- mappingValueField: 'code',
1352
- otherParams: {
1353
- sorter: 'desc-id'
1354
- }, // 默认参数
1355
- sourceName: 'deliveryModeCode',
1356
- ...requestConfigProp
1357
- }
1358
- tableSearchForm = [
1359
- { name: 'qp-name-like', label: '配送方式名称' },
1360
- { name: 'qp-code-like', label: '配送方式编码' },
1361
- { name: 'qp-logisCompanyCode-in', type: 'select', label: '所属物流商', field: {
1362
- type: 'select',
1363
- props: {
1364
- mode: 'multiple',
1365
- notFoundContent: '暂无数据',
1366
- allowClear: true,
1367
- showSearch: true,
1368
- showArrow: true,
1369
- maxTagCount: 1,
1370
- optionFilterProp: 'children',
1371
- filterOption: (input: string, option: { props: { children: string } }) =>
1372
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1373
- },
1374
- } },
1375
- { name: 'qp-recordChannnelCode-in', type: 'select', label: '单号获取通道', initialSource: getDictionarySource('BSC00004') },
1376
- { name: 'qp-arrivalPaySupport-in', type: 'select', label: '是否支持到付', initialSource: arrivalPaySupportList },
1377
- { name: 'qp-sheetTemplateCode-in', type: 'select', label: '面单模板', field: {
1378
- type: 'select',
1379
- props: {
1380
- mode: 'multiple',
1381
- notFoundContent: '暂无数据',
1382
- allowClear: true,
1383
- showSearch: true,
1384
- showArrow: true,
1385
- maxTagCount: 1,
1386
- optionFilterProp: 'children',
1387
- filterOption: (input: string, option: { props: { children: string } }) =>
1388
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1389
- },
1390
- } },
1391
- { name: 'qp-remark-like', label: '备注' },
1392
- ]
1393
- Promise.all([
1394
- loadSelectSource(`${prefixUrl.formSelectFix}/logisCompany`, {
1395
- pageSize: 5000,
1396
- currentPage: 1,
1397
- }),
1398
- loadSelectSource(`${prefixUrl.formSelectFix}/printTemplate`, {
1399
- pageSize: 5000,
1400
- currentPage: 1,
1401
- })
1402
- ]).then((x: any)=>{
1403
- formatSource(x,0, 2, tableSearchForm);
1404
- formatSource(x,1, 5, tableSearchForm);
1405
- })
1406
- modalTableProps = {
1407
- modalTableTitle: '选择配送方式',
1408
- tableSearchForm,
1409
- tableColumns: [
1410
- {
1411
- title: '配送方式编码',
1412
- dataIndex: 'code',
1413
- },
1414
- {
1415
- title: '配送方式名称',
1416
- dataIndex: 'name',
1417
- },
1418
- {
1419
- title: '所属物流商',
1420
- dataIndex: 'logisCompanyName',
1421
- },
1422
- {
1423
- dataIndex: 'recordChannnelCode',
1424
- title: '单号获取通道',
1425
- render: (text: any) => getDictionaryTextByValue('BSC00004', text),
1426
- },
1427
- {
1428
- dataIndex: 'arrivalPaySupport',
1429
- title: '是否支持到付',
1430
- render: (text: number) => arrivalPaySupportList.find((i: any) => i.value === text)?.text,
1431
- },
1432
- {
1433
- dataIndex: 'sheetTemplateName',
1434
- title: '面单模板',
1435
- },
1436
- {
1437
- dataIndex: 'remark',
1438
- title: '备注',
1439
- },
1440
- ],
1441
- ...modalTableBusProps
1442
- }
1443
- }
1444
-
1445
- return { modalTableProps, requestConfig, needModalTable };
1446
- }
1
+ // 此文件用于 处理业务组件 所用到的公共方法
2
+ // @ts-nocheck
3
+ import { shopFileType, arrivalPaySupportList, sharingType, shopFile2Type } from './common';
4
+ import { getDictionarySource, getDictionaryTextByValue, loadSelectSource } from './utils';
5
+
6
+ const hasDictSharingType = getDictionarySource('UC000013')?.length;
7
+ const sharingTypeDataList = hasDictSharingType && getDictionarySource('UC000013') || sharingType
8
+
9
+ export function commonFun (type?: string, prefixUrl: any, requestConfigProp?: any, modalTableBusProps?:any) {
10
+ // 默认type === 'supplier' 供应商选择器
11
+ let requestConfig = {
12
+ url: `${prefixUrl.selectPrefix}/supplier`,
13
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
14
+ otherParams: {
15
+ sorter: 'desc-id'
16
+ }, // 默认参数
17
+ ...requestConfigProp
18
+ }
19
+
20
+ /*
21
+ * 处理 格式化下拉框数据源
22
+ * reData 必传 promise返回响应的数据 格式为[{},{},{},...] Promise.all第一个参数数组有多少个数组长度就是多少,其中每个对象为每次请求的结果数据
23
+ * 每个结果数据格式为{ status: '0', msg: 'success', data: { items: [], total: 1, size: 1, page: 1 }, traceId: 'baba..'}
24
+ * position 必传 为获取Promise.all请求结果的位置
25
+ * changePosition 必传 为搜索表单Form中需要更改数据源的Item项的位置
26
+ * changeSearchForm 必传 为搜索表单Form数据
27
+ * */
28
+ const formatSource = (reData: any, position: number, changePosition: number,changeSearchForm: any,resKeyValue=['code', 'name']) => {
29
+ const data = reData && reData[position]?.data;
30
+ const list = Array.isArray(data) ? data :(data?.items || data?.list || data?.children || []);
31
+ const formatData = list?.length ? list.map((v: any) => ({ text: v[resKeyValue[1]], value: v[resKeyValue[0]] })) : [];
32
+ changeSearchForm[changePosition] = {...changeSearchForm[changePosition], initialSource: formatData}
33
+ }
34
+
35
+ // 格式化树选择器数据源
36
+ const mapSearchTree = (treeDataItem: any, resKeyValue: any) => {
37
+ const haveChildren = Array.isArray(treeDataItem.children) && treeDataItem.children.length > 0;
38
+ return {
39
+ title: treeDataItem[resKeyValue[1]],
40
+ value: treeDataItem[resKeyValue[0]],
41
+ parentId: treeDataItem.parent,
42
+ data: { ...treeDataItem },
43
+ isLeaf: !haveChildren,
44
+ disabled: haveChildren,
45
+ children: haveChildren ? treeDataItem.children.map((i: any) => mapSearchTree(i, resKeyValue)) : [],
46
+ };
47
+ };
48
+ const formatTreeDataSource = (reData: any, position: number, changePosition: number,changeSearchForm: any,resKeyValue=['id', 'name']) => {
49
+ const data = reData && reData[position]?.data;
50
+ const formatData = (data &&
51
+ Array.isArray(data) &&
52
+ data.length &&
53
+ data.map((ites: any) => mapSearchTree(ites, resKeyValue))) ||
54
+ []
55
+ changeSearchForm[changePosition].field.props.treeData = formatData;
56
+ }
57
+
58
+
59
+ let tableSearchForm: any [] = [];
60
+ let modalTableProps = {
61
+ modalTableTitle: '',
62
+ tableSearchForm,
63
+ tableColumns: [],
64
+ ...modalTableBusProps,
65
+ }
66
+ let needModalTable = modalTableBusProps?.needModalTable !== undefined ? modalTableBusProps?.needModalTable : true;
67
+
68
+ // 供应商选择器
69
+ if(type === 'supplier') {
70
+ tableSearchForm = [
71
+ { name: 'qp-name-like', label: '供应商名称' }, // field: { type: 'input', props: { placeholder: '请输入'}}
72
+ { name: 'qp-code-like', label: '供应商编码' },
73
+ { name: 'qp-conglomerateCode-in', type: 'select', label: '归属集团', field: {
74
+ type: 'select',
75
+ props: {
76
+ mode: 'multiple',
77
+ notFoundContent: '暂无数据',
78
+ allowClear: true,
79
+ showSearch: true,
80
+ showArrow: true,
81
+ maxTagCount: 1,
82
+ optionFilterProp: 'children',
83
+ filterOption: (input: string, option: { props: { children: string } }) =>
84
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
85
+ },
86
+ } },
87
+ { name: 'qp-accountingCode-in', type: 'select', label: '归属核算主体', field: {
88
+ type: 'select',
89
+ props: {
90
+ mode: 'multiple',
91
+ notFoundContent: '暂无数据',
92
+ allowClear: true,
93
+ showSearch: true,
94
+ showArrow: true,
95
+ maxTagCount: 1,
96
+ optionFilterProp: 'children',
97
+ filterOption: (input: string, option: { props: { children: string } }) =>
98
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
99
+ },
100
+ } },
101
+ { name: 'qp-companyCode-in', type: 'select', label: '归属法人公司', field: {
102
+ type: 'select',
103
+ props: {
104
+ mode: 'multiple',
105
+ notFoundContent: '暂无数据',
106
+ allowClear: true,
107
+ showSearch: true,
108
+ showArrow: true,
109
+ maxTagCount: 1,
110
+ optionFilterProp: 'children',
111
+ filterOption: (input: string, option: { props: { children: string } }) =>
112
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
113
+ },
114
+ } },
115
+ { name: 'qp-sharingType-eq', type: 'select', label: '共享类型', initialSource: sharingTypeDataList },
116
+ ]
117
+ Promise.all([
118
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
119
+ pageSize: 5000,
120
+ currentPage: 1,
121
+ 'qp-companyType-eq': '30',
122
+ }),
123
+ loadSelectSource(`${prefixUrl.formSelectFix}/accountingSubject`, {
124
+ pageSize: 5000,
125
+ currentPage: 1,
126
+ }),
127
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
128
+ pageSize: 5000,
129
+ currentPage: 1,
130
+ 'qp-companyType-eq': '20',
131
+ })
132
+ ]).then((x: any)=>{
133
+ formatSource(x,0, 2, tableSearchForm);
134
+ formatSource(x,1, 3, tableSearchForm);
135
+ formatSource(x,2, 4, tableSearchForm);
136
+ })
137
+ modalTableProps = {
138
+ modalTableTitle: '选择供应商',
139
+ tableSearchForm,
140
+ tableColumns: [
141
+ {
142
+ title: '供应商编码',
143
+ dataIndex: 'code',
144
+ },
145
+ {
146
+ title: '供应商名称',
147
+ dataIndex: 'name',
148
+ },
149
+ {
150
+ title: '归属集团',
151
+ dataIndex: 'conglomerateName',
152
+ },
153
+ {
154
+ title: '归属法人公司',
155
+ dataIndex: 'legalCompanyName',
156
+ },
157
+ {
158
+ title: '归属核算主体',
159
+ dataIndex: 'accountingName',
160
+ },
161
+ {
162
+ title: '共享类型',
163
+ dataIndex: 'sharingType',
164
+ render: (text: number) => hasDictSharingType ? getDictionaryTextByValue('UC000013', text) : sharingType.find((i: any) => i.value === text)?.text
165
+ },
166
+ ],
167
+ ...modalTableBusProps,
168
+ }
169
+ }
170
+ if(type === 'supplier2') {
171
+ // 版本2
172
+ tableSearchForm = [
173
+ { name: 'qp-name-like', label: '供应商名称' }, // field: { type: 'input', props: { placeholder: '请输入'}}
174
+ { name: 'qp-code-like', label: '供应商编码' },
175
+ { name: 'qp-createOrgCode-eq', type: 'select', label: '创建组织', field: {
176
+ type: 'select',
177
+ props: {
178
+ // mode: 'multiple',
179
+ notFoundContent: '暂无数据',
180
+ allowClear: true,
181
+ showSearch: true,
182
+ showArrow: true,
183
+ // maxTagCount: 1,
184
+ optionFilterProp: 'children',
185
+ filterOption: (input: string, option: { props: { children: string } }) =>
186
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
187
+ },
188
+ } },
189
+ { name: 'qp-supplierOrgCode-eq', type: 'select', label: '使用组织', field: {
190
+ type: 'select',
191
+ props: {
192
+ // mode: 'multiple',
193
+ notFoundContent: '暂无数据',
194
+ allowClear: true,
195
+ showSearch: true,
196
+ showArrow: true,
197
+ // maxTagCount: 1,
198
+ optionFilterProp: 'children',
199
+ filterOption: (input: string, option: { props: { children: string } }) =>
200
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
201
+ },
202
+ } },
203
+ ]
204
+ Promise.all([
205
+ loadSelectSource(`${prefixUrl.formSelectFix}/org/listNoPage`, {}),
206
+ loadSelectSource(`${prefixUrl.formSelectFix}/org/listNoPage`, {}),
207
+ ]).then((x: any)=>{
208
+ formatSource(x,0, 2, tableSearchForm);
209
+ formatSource(x,1, 3, tableSearchForm);
210
+ })
211
+ modalTableProps = {
212
+ modalTableTitle: '选择供应商',
213
+ tableSearchForm,
214
+ tableColumns: [
215
+ {
216
+ title: '供应商编码',
217
+ dataIndex: 'code',
218
+ },
219
+ {
220
+ title: '供应商名称',
221
+ dataIndex: 'name',
222
+ },
223
+ {
224
+ title: '创建组织',
225
+ dataIndex: 'createOrgName',
226
+ },
227
+ {
228
+ title: '使用组织',
229
+ dataIndex: 'salesOrgName',
230
+ },
231
+ ],
232
+ ...modalTableBusProps
233
+ }
234
+ }
235
+
236
+ // 商品选择器sku
237
+ if(type === 'skuCommodity') {
238
+ requestConfig = {
239
+ url: `${prefixUrl.selectPrefix}/sku/pager/v2`,
240
+ filter: 'skuCodeAndSkuName', // 过滤参数
241
+ mappingTextField: 'name',
242
+ mappingValueField: 'skuCode',
243
+ mappingTextShowTextField: ['name', 'propertyNameAndValue'],
244
+ otherParams: {
245
+ 'qp-combination-eq': false,
246
+ 'qp-approveStatus-eq': 1,
247
+ 'qp-status-eq': 1,
248
+ // 'qp-type-eq': 10, // 查唯一国际条码【有些项目不需要必须要有国际条码,故注释,需要的项目自己定义otherParams补充上这个条件】
249
+ sorter: 'desc-id'
250
+ }, // 默认参数
251
+ sourceName: 'skuCode',
252
+ ...requestConfigProp,
253
+ }
254
+ tableSearchForm = requestConfig.url.includes('v2') ? [
255
+ requestConfig.url.includes('v2') ? { name: 'qp-skuName-like', label: 'SKU名称' } : { name: 'qp-name-like', label: 'SKU名称' },
256
+ { name: 'qp-skuCode-in', label: 'SKU编码', field: {
257
+ type: 'multipleQueryInput',
258
+ props: {
259
+ ...(requestConfigProp?.skuCodeValueRequestConfig || {}),
260
+ },
261
+ }},
262
+ requestConfig.url.includes('v2') ? { name: 'qp-code-like', label: '国际条码' } : { name: 'qp-barCode-like', label: '国际条码'},
263
+ { name: 'qp-itemName-like', label: '所属SPU名称' },
264
+ { name: 'qp-itemCode-like', label: '所属SPU编码' },
265
+ requestConfig.url.includes('v2') ?{ name: 'qp-externalCode-like', label: '外部编码' } : null,
266
+ requestConfig.url.includes('v2') ? { name: 'qp-propertyValueCode-in', type: 'businessSearchSelect', label: '规格', field: {
267
+ type: 'businessSearchSelect',
268
+ props: {
269
+ selectBusinessType: 'skuPropertyValue',
270
+ selectProps: {
271
+ mode: 'multiple',
272
+ maxTagCount: 1,
273
+ },
274
+ ...(requestConfigProp?.skuPropertyValueRequestConfig || { prefixUrl }), // 可自定义此处规格请求接口相关参数,默认前缀取自sku选择器
275
+ },
276
+ }
277
+ } : null,
278
+ { name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
279
+ type: 'select',
280
+ props: {
281
+ mode: 'multiple',
282
+ notFoundContent: '暂无数据',
283
+ allowClear: true,
284
+ showSearch: true,
285
+ showArrow: true,
286
+ maxTagCount: 1,
287
+ optionFilterProp: 'children',
288
+ filterOption: (input: string, option: { props: { children: string } }) =>
289
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
290
+ },
291
+ } },
292
+ { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
293
+ type: 'treeSelect',
294
+ props: {
295
+ treeData: [],
296
+ treeCheckable: true,
297
+ showSearch: true,
298
+ allowClear: true,
299
+ showArrow: true,
300
+ treeNodeFilterProp: 'title',
301
+ treeDefaultExpandAll: true,
302
+ maxTagCount: 1,
303
+ placeholder: '请选择',
304
+ style: {
305
+ width: '100%',
306
+ },
307
+ dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
308
+ },
309
+ } },
310
+ { name: 'qp-classId-in', type: 'select', label: '品类', field: {
311
+ type: 'select',
312
+ props: {
313
+ mode: 'multiple',
314
+ notFoundContent: '暂无数据',
315
+ allowClear: true,
316
+ showSearch: true,
317
+ showArrow: true,
318
+ maxTagCount: 1,
319
+ optionFilterProp: 'children',
320
+ filterOption: (input: string, option: { props: { children: string } }) =>
321
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
322
+ },
323
+ } },
324
+ ] : [
325
+ { name: 'qp-name-like', label: 'SKU名称' },
326
+ { name: 'qp-skuCode-in', label: 'SKU编码', field: {
327
+ type: 'multipleQueryInput',
328
+ props: {
329
+ ...(requestConfigProp?.skuCodeValueRequestConfig || {}),
330
+ },
331
+ }},
332
+ { name: 'qp-barCode-like', label: '国际条码'},
333
+ { name: 'qp-itemName-like', label: '所属SPU名称' },
334
+ { name: 'qp-itemCode-like', label: '所属SPU编码' },
335
+ { name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
336
+ type: 'select',
337
+ props: {
338
+ mode: 'multiple',
339
+ notFoundContent: '暂无数据',
340
+ allowClear: true,
341
+ showSearch: true,
342
+ showArrow: true,
343
+ maxTagCount: 1,
344
+ optionFilterProp: 'children',
345
+ filterOption: (input: string, option: { props: { children: string } }) =>
346
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
347
+ },
348
+ } },
349
+ { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
350
+ type: 'treeSelect',
351
+ props: {
352
+ treeData: [],
353
+ treeCheckable: true,
354
+ showSearch: true,
355
+ allowClear: true,
356
+ showArrow: true,
357
+ treeNodeFilterProp: 'title',
358
+ treeDefaultExpandAll: true,
359
+ maxTagCount: 1,
360
+ placeholder: '请选择',
361
+ style: {
362
+ width: '100%',
363
+ },
364
+ dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
365
+ },
366
+ } },
367
+ { name: 'qp-classId-in', type: 'select', label: '品类', field: {
368
+ type: 'select',
369
+ props: {
370
+ mode: 'multiple',
371
+ notFoundContent: '暂无数据',
372
+ allowClear: true,
373
+ showSearch: true,
374
+ showArrow: true,
375
+ maxTagCount: 1,
376
+ optionFilterProp: 'children',
377
+ filterOption: (input: string, option: { props: { children: string } }) =>
378
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
379
+ },
380
+ } },
381
+ ]
382
+ Promise.all([
383
+ loadSelectSource(`${prefixUrl.formSelectFix}/brand/queryBrandList`, {
384
+ pageSize: 5000,
385
+ currentPage: 1,
386
+ 'ctl-withAuth': true
387
+ }),
388
+ loadSelectSource(`${prefixUrl.formSelectFix}/category/queryCategoryTree`, {
389
+ pageSize: 5000,
390
+ currentPage: 1,
391
+ }),
392
+ loadSelectSource(`${prefixUrl.formSelectFix}/class/withProperty`, {
393
+ pageSize: 5000,
394
+ currentPage: 1,
395
+ }),
396
+ ]).then((x: any)=>{
397
+ requestConfig.url.includes('v2') ? formatSource(x,0, 7, tableSearchForm,['id','name']) : formatSource(x,0, 5, tableSearchForm,['id','name'])
398
+ requestConfig.url.includes('v2') ? formatTreeDataSource(x,1, 8, tableSearchForm) : formatTreeDataSource(x,1, 6, tableSearchForm)
399
+ requestConfig.url.includes('v2') ? formatSource(x,2, 9, tableSearchForm,['id','name']) : formatSource(x,2, 7, tableSearchForm,['id','name'])
400
+ })
401
+ modalTableProps = {
402
+ modalTableTitle: '选择SKU',
403
+ tableSearchForm,
404
+ tableColumns: requestConfig.url.includes('v2') ? [
405
+ {
406
+ title: 'SKU编码',
407
+ dataIndex: 'skuCode',
408
+ },
409
+ {
410
+ title: 'SKU名称',
411
+ dataIndex: 'name',
412
+ },
413
+ {
414
+ title: '国际条码',
415
+ dataIndex: 'barCode',
416
+ },
417
+ {
418
+ title: '所属SPU名称',
419
+ dataIndex: 'itemName',
420
+ },
421
+ {
422
+ title: '所属SPU编码',
423
+ dataIndex: 'itemCode',
424
+ },
425
+ requestConfig.url.includes('v2') ? {
426
+ title: '外部编码',
427
+ dataIndex: 'externalCode',
428
+ } : false,
429
+ {
430
+ title: '规格',
431
+ dataIndex: requestConfig.url.includes('v2') ? 'propertyNameAndValue' : 'skuSpec',
432
+ },
433
+ {
434
+ title: '类目',
435
+ dataIndex: 'categoryName',
436
+ },
437
+ {
438
+ title: '品类',
439
+ dataIndex: 'className',
440
+ },
441
+ {
442
+ title: '品牌',
443
+ dataIndex: 'brandName',
444
+ },
445
+ ] : [
446
+ {
447
+ title: 'SKU编码',
448
+ dataIndex: 'skuCode',
449
+ },
450
+ {
451
+ title: 'SKU名称',
452
+ dataIndex: 'name',
453
+ },
454
+ {
455
+ title: '国际条码',
456
+ dataIndex: 'barCode',
457
+ },
458
+ {
459
+ title: '所属SPU名称',
460
+ dataIndex: 'itemName',
461
+ },
462
+ {
463
+ title: '所属SPU编码',
464
+ dataIndex: 'itemCode',
465
+ },
466
+ {
467
+ title: '规格',
468
+ dataIndex: 'skuSpec',
469
+ },
470
+ {
471
+ title: '类目',
472
+ dataIndex: 'categoryName',
473
+ },
474
+ {
475
+ title: '品类',
476
+ dataIndex: 'className',
477
+ },
478
+ {
479
+ title: '品牌',
480
+ dataIndex: 'brandName',
481
+ },
482
+ ],
483
+ ...modalTableBusProps
484
+ }
485
+ }
486
+
487
+ // 商品选择器spu
488
+ if(type === 'spuCommodity') {
489
+ requestConfig = {
490
+ url: `${prefixUrl.selectPrefix}/item`,
491
+ filter: 'qp-itemCode,name-orGroup,like', // 过滤参数
492
+ mappingTextField: 'name',
493
+ mappingValueField: 'itemCode',
494
+ otherParams: {
495
+ 'qp-approveStatus-eq': 1, // 审核状态(0.待审批;1.审批通过;2.驳回;3.审批未通过)
496
+ sorter: 'desc-id'
497
+ }, // 默认参数
498
+ sourceName: 'itemCode',
499
+ ...requestConfigProp,
500
+ }
501
+ tableSearchForm = [
502
+ { name: 'qp-name-like', label: 'SPU名称' },
503
+ { name: 'qp-itemCode-like', label: 'SPU编码' },
504
+ { name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
505
+ type: 'select',
506
+ props: {
507
+ mode: 'multiple',
508
+ notFoundContent: '暂无数据',
509
+ allowClear: true,
510
+ showSearch: true,
511
+ showArrow: true,
512
+ maxTagCount: 1,
513
+ optionFilterProp: 'children',
514
+ filterOption: (input: string, option: { props: { children: string } }) =>
515
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
516
+ },
517
+ } },
518
+ { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
519
+ type: 'treeSelect',
520
+ props: {
521
+ treeData: [],
522
+ treeCheckable: true,
523
+ showSearch: true,
524
+ allowClear: true,
525
+ showArrow: true,
526
+ treeNodeFilterProp: 'title',
527
+ treeDefaultExpandAll: true,
528
+ maxTagCount: 1,
529
+ placeholder: '请选择',
530
+ style: {
531
+ width: '100%',
532
+ },
533
+ dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
534
+ },
535
+ } },
536
+ { name: 'qp-classId-in', type: 'select', label: '品类', field: {
537
+ type: 'select',
538
+ props: {
539
+ mode: 'multiple',
540
+ notFoundContent: '暂无数据',
541
+ allowClear: true,
542
+ showSearch: true,
543
+ showArrow: true,
544
+ maxTagCount: 1,
545
+ optionFilterProp: 'children',
546
+ filterOption: (input: string, option: { props: { children: string } }) =>
547
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
548
+ },
549
+ } },
550
+ ]
551
+ Promise.all([
552
+ loadSelectSource(`${prefixUrl.formSelectFix}/brand/queryBrandList`, {
553
+ pageSize: 5000,
554
+ currentPage: 1,
555
+ 'ctl-withAuth': true
556
+ }),
557
+ loadSelectSource(`${prefixUrl.formSelectFix}/category/queryCategoryTree`, {
558
+ pageSize: 5000,
559
+ currentPage: 1,
560
+ }),
561
+ loadSelectSource(`${prefixUrl.formSelectFix}/class/withProperty`, {
562
+ pageSize: 5000,
563
+ currentPage: 1,
564
+ }),
565
+ ]).then((x: any)=>{
566
+ formatSource(x,0, 2, tableSearchForm,['id','name']);
567
+ formatTreeDataSource(x,1, 3, tableSearchForm);
568
+ formatSource(x,2, 4, tableSearchForm,['id','name']);
569
+ })
570
+ modalTableProps = {
571
+ modalTableTitle: '选择SPU',
572
+ tableSearchForm,
573
+ tableColumns: [
574
+ {
575
+ title: 'SPU编码',
576
+ dataIndex: 'itemCode',
577
+ },
578
+ {
579
+ title: 'SPU名称',
580
+ dataIndex: 'name',
581
+ },
582
+ {
583
+ title: '品牌',
584
+ dataIndex: 'brandName',
585
+ },
586
+ {
587
+ title: '类目',
588
+ dataIndex: 'categoryText',
589
+ },
590
+ {
591
+ title: '品类',
592
+ dataIndex: 'className',
593
+ },
594
+ ],
595
+ ...modalTableBusProps
596
+ }
597
+ }
598
+
599
+ // 商品规格选择器(无弹窗)
600
+ if(type === 'skuPropertyValue') {
601
+ requestConfig = {
602
+ url: `${prefixUrl.selectPrefix}/skuPropertyValue/list`,
603
+ filter: 'qp-value-like', // 过滤参数
604
+ mappingTextField: 'value',
605
+ mappingTextShowKeyField: 'propertyValueCode',
606
+ mappingValueField: 'propertyValueCode',
607
+ otherParams: {
608
+ sorter: 'desc-id'
609
+ }, // 默认参数
610
+ sourceName: 'qp-propertyValueCode-in',
611
+ ...requestConfigProp,
612
+ }
613
+ needModalTable = false
614
+ }
615
+
616
+ // 仓库选择器(物理、逻辑仓)
617
+ if(type === 'physicalWarehouse') {
618
+ requestConfig = {
619
+ url: `${prefixUrl.selectPrefix}/physicalWarehouse`,
620
+ filter: 'qp-physicalWarehouseName,physicalWarehouseCode-orGroup,like', // 过滤参数
621
+ mappingTextField: 'physicalWarehouseName',
622
+ mappingTextShowKeyField: 'physicalWarehouseCode',
623
+ mappingValueField: 'id',
624
+ otherParams: {
625
+ 'qp-isEnable-eq': 1,
626
+ sorter: 'desc-id'
627
+ }, // 默认参数
628
+ sourceName: 'warehouseIds',
629
+ ...requestConfigProp,
630
+ }
631
+ tableSearchForm = [
632
+ { name: 'qp-physicalWarehouseName-like', label: '物理仓名称' },
633
+ { name: 'qp-physicalWarehouseCode-like', label: '物理仓编码' },
634
+ { name: 'qp-physicalWarehouseType-eq', type: 'select', label: '物理仓类型', initialSource: getDictionarySource('SC00002') },
635
+ { name: 'qp-companyCode-eq', type: 'select', label: '所属公司', field: {
636
+ type: 'select',
637
+ props: {
638
+ mode: 'multiple',
639
+ notFoundContent: '暂无数据',
640
+ allowClear: true,
641
+ showSearch: true,
642
+ showArrow: true,
643
+ maxTagCount: 1,
644
+ optionFilterProp: 'children',
645
+ filterOption: (input: string, option: { props: { children: string } }) =>
646
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
647
+ },
648
+ } },
649
+ ]
650
+ Promise.all([
651
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
652
+ pageSize: 5000,
653
+ currentPage: 1,
654
+ 'qp-companyType-eq': 20,
655
+ }),
656
+ ]).then((x: any)=>{
657
+ formatSource(x,0, 3, tableSearchForm);
658
+ })
659
+ modalTableProps = {
660
+ modalTableTitle: '选择物理仓',
661
+ tableSearchForm,
662
+ tableColumns: [
663
+ {
664
+ title: '物理仓编码',
665
+ dataIndex: 'physicalWarehouseCode',
666
+ },
667
+ {
668
+ title: '物理仓名称',
669
+ dataIndex: 'physicalWarehouseName',
670
+ },
671
+ {
672
+ title: '物理仓类型',
673
+ dataIndex: 'physicalWarehouseType',
674
+ render: (text: number) => getDictionaryTextByValue('SC00002', text),
675
+ },
676
+ {
677
+ title: '所属公司',
678
+ dataIndex: 'companyName',
679
+ },
680
+ ],
681
+ ...modalTableBusProps
682
+ }
683
+ }
684
+ if(type === 'realWarehouse') {
685
+ requestConfig = {
686
+ url: `${prefixUrl.selectPrefix}/realWarehouse`,
687
+ filter: 'qp-realWarehouseName,realWarehouseCode-orGroup,like', // 过滤参数
688
+ mappingTextField: 'realWarehouseName',
689
+ mappingTextShowKeyField: 'realWarehouseCode',
690
+ mappingValueField: 'id',
691
+ otherParams: {
692
+ 'qp-isEnable-eq': 1,
693
+ sorter: 'desc-id'
694
+ }, // 默认参数
695
+ sourceName: 'warehouseIds',
696
+ ...requestConfigProp,
697
+ }
698
+ tableSearchForm = [
699
+ { name: 'qp-realWarehouseName-like', label: '逻辑仓名称' },
700
+ { name: 'qp-realWarehouseCode-like', label: '逻辑仓编码' },
701
+ { name: 'qp-realWarehouseType-eq', type: 'select', label: '逻辑仓类型', initialSource: getDictionarySource('SC00004') },
702
+ ]
703
+ modalTableProps = {
704
+ modalTableTitle: '选择逻辑仓',
705
+ tableSearchForm,
706
+ tableColumns: [
707
+ {
708
+ title: '逻辑仓编码',
709
+ dataIndex: 'realWarehouseCode',
710
+ },
711
+ {
712
+ title: '逻辑仓名称',
713
+ dataIndex: 'realWarehouseName',
714
+ },
715
+ {
716
+ title: '逻辑仓类型',
717
+ dataIndex: 'realWarehouseType',
718
+ render: (text: number) => getDictionaryTextByValue('SC00004', text),
719
+ },
720
+ ],
721
+ ...modalTableBusProps,
722
+ }
723
+ }
724
+
725
+ // 仓库选择器(虚拟、渠道仓)(无弹窗)
726
+ if(type === 'virtualWarehouse') {
727
+ requestConfig = {
728
+ url: `${prefixUrl.selectPrefix}/virtualWarehouse`,
729
+ filter: 'qp-virtualWarehouseName,virtualWarehouseCode-orGroup,like', // 过滤参数
730
+ mappingTextField: 'virtualWarehouseName',
731
+ mappingTextShowKeyField: 'virtualWarehouseCode',
732
+ mappingValueField: 'id',
733
+ otherParams: {
734
+ 'qp-isEnable-eq': 1,
735
+ sorter: 'desc-id'
736
+ }, // 默认参数
737
+ sourceName: 'warehouseIds',
738
+ ...requestConfigProp,
739
+ }
740
+ needModalTable = false
741
+ }
742
+ if(type === 'channelWarehouse') {
743
+ requestConfig = {
744
+ url: `${prefixUrl.selectPrefix}/channelWarehouse`,
745
+ filter: 'qp-channelWarehouseName,channelWarehouseCode-orGroup,like', // 过滤参数
746
+ mappingTextField: 'channelWarehouseName',
747
+ mappingTextShowKeyField: 'channelWarehouseCode',
748
+ mappingValueField: 'id',
749
+ otherParams: {
750
+ 'qp-isEnable-eq': 1,
751
+ sorter: 'desc-id'
752
+ }, // 默认参数
753
+ sourceName: 'warehouseIds',
754
+ ...requestConfigProp,
755
+ }
756
+ needModalTable = false
757
+ }
758
+
759
+ // 客户选择器
760
+ if(type === 'customer') {
761
+ requestConfig = {
762
+ url: `${prefixUrl.selectPrefix}/uc/customer/v2`,
763
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
764
+ mappingTextField: 'name',
765
+ mappingValueField: 'code',
766
+ otherParams: {
767
+ 'qp-status-eq': 10,
768
+ sorter: 'desc-id'
769
+ }, // 默认参数
770
+ sourceName: 'customCode',
771
+ ...requestConfigProp,
772
+ }
773
+ tableSearchForm = [
774
+ { name: 'qp-name-like', label: '客户名称' },
775
+ { name: 'qp-code-like', label: '客户编码' },
776
+ { name: 'qp-conglomerateCode-in', type: 'select', label: '归属集团', field: {
777
+ type: 'select',
778
+ props: {
779
+ mode: 'multiple',
780
+ notFoundContent: '暂无数据',
781
+ allowClear: true,
782
+ showSearch: true,
783
+ showArrow: true,
784
+ maxTagCount: 1,
785
+ optionFilterProp: 'children',
786
+ filterOption: (input: string, option: { props: { children: string } }) =>
787
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
788
+ },
789
+ } },
790
+ { name: 'qp-accountingCode-in', type: 'select', label: '归属核算主体', field: {
791
+ type: 'select',
792
+ props: {
793
+ mode: 'multiple',
794
+ notFoundContent: '暂无数据',
795
+ allowClear: true,
796
+ showSearch: true,
797
+ showArrow: true,
798
+ maxTagCount: 1,
799
+ optionFilterProp: 'children',
800
+ filterOption: (input: string, option: { props: { children: string } }) =>
801
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
802
+ },
803
+ } },
804
+ { name: 'qp-companyCode-in', type: 'select', label: '归属法人公司', field: {
805
+ type: 'select',
806
+ props: {
807
+ mode: 'multiple',
808
+ notFoundContent: '暂无数据',
809
+ allowClear: true,
810
+ showSearch: true,
811
+ showArrow: true,
812
+ maxTagCount: 1,
813
+ optionFilterProp: 'children',
814
+ filterOption: (input: string, option: { props: { children: string } }) =>
815
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
816
+ },
817
+ } },
818
+ { name: 'qp-sharingType-eq', type: 'select', label: '共享类型', initialSource: sharingTypeDataList },
819
+ ]
820
+ Promise.all([
821
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
822
+ pageSize: 5000,
823
+ currentPage: 1,
824
+ 'qp-companyType-eq': '30',
825
+ }),
826
+ loadSelectSource(`${prefixUrl.formSelectFix}/accountingSubject`, {
827
+ pageSize: 5000,
828
+ currentPage: 1,
829
+ }),
830
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
831
+ pageSize: 5000,
832
+ currentPage: 1,
833
+ 'qp-companyType-eq': '20',
834
+ })
835
+ ]).then((x: any)=>{
836
+ formatSource(x,0, 2, tableSearchForm);
837
+ formatSource(x,1, 3, tableSearchForm);
838
+ formatSource(x,2, 4, tableSearchForm);
839
+ })
840
+ modalTableProps = {
841
+ modalTableTitle: '选择客户',
842
+ tableSearchForm,
843
+ tableColumns: [
844
+ {
845
+ title: '客户编码',
846
+ dataIndex: 'code',
847
+ },
848
+ {
849
+ title: '客户名称',
850
+ dataIndex: 'name',
851
+ },
852
+ {
853
+ title: '归属集团',
854
+ dataIndex: 'conglomerateName',
855
+ },
856
+ {
857
+ title: '归属法人公司',
858
+ dataIndex: 'legalCompanyName',
859
+ },
860
+ {
861
+ title: '归属核算主体',
862
+ dataIndex: 'accountingName',
863
+ },
864
+ {
865
+ title: '共享类型',
866
+ dataIndex: 'sharingType',
867
+ render: (text: number) => hasDictSharingType ? getDictionaryTextByValue('UC000013', text) : sharingType.find((i: any) => i.value === text)?.text,
868
+ },
869
+ ],
870
+ ...modalTableBusProps
871
+ }
872
+ }
873
+ if(type === 'customer2') {
874
+ // 版本2
875
+ requestConfig = {
876
+ url: `${prefixUrl.selectPrefix}/customer`,
877
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
878
+ mappingTextField: 'name',
879
+ mappingValueField: 'code',
880
+ otherParams: {
881
+ sorter: 'desc-id'
882
+ }, // 默认参数
883
+ sourceName: 'customCode',
884
+ ...requestConfigProp,
885
+ }
886
+ tableSearchForm = [
887
+ { name: 'qp-name-like', label: '客户名称' },
888
+ { name: 'qp-code-like', label: '客户编码' },
889
+ { name: 'qp-createOrgCode-eq', type: 'select', label: '创建组织', field: {
890
+ type: 'select',
891
+ props: {
892
+ // mode: 'multiple',
893
+ notFoundContent: '暂无数据',
894
+ allowClear: true,
895
+ showSearch: true,
896
+ showArrow: true,
897
+ // maxTagCount: 1,
898
+ optionFilterProp: 'children',
899
+ filterOption: (input: string, option: { props: { children: string } }) =>
900
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
901
+ },
902
+ } },
903
+ { name: 'qp-salesOrgCode-eq', type: 'select', label: '使用组织', field: {
904
+ type: 'select',
905
+ props: {
906
+ // mode: 'multiple',
907
+ notFoundContent: '暂无数据',
908
+ allowClear: true,
909
+ showSearch: true,
910
+ showArrow: true,
911
+ // maxTagCount: 1,
912
+ optionFilterProp: 'children',
913
+ filterOption: (input: string, option: { props: { children: string } }) =>
914
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
915
+ },
916
+ } },
917
+ ]
918
+ Promise.all([
919
+ loadSelectSource(`${prefixUrl.formSelectFix}/org/listNoPage`, {}),
920
+ loadSelectSource(`${prefixUrl.formSelectFix}/org/listNoPage`,{}),
921
+ ]).then((x: any)=>{
922
+ formatSource(x,0, 2, tableSearchForm);
923
+ formatSource(x,1, 3, tableSearchForm);
924
+ })
925
+ modalTableProps = {
926
+ modalTableTitle: '选择客户',
927
+ tableSearchForm,
928
+ tableColumns: [
929
+ {
930
+ title: '客户编码',
931
+ dataIndex: 'code',
932
+ },
933
+ {
934
+ title: '客户名称',
935
+ dataIndex: 'name',
936
+ },
937
+ {
938
+ title: '创建组织',
939
+ dataIndex: 'createOrgName',
940
+ },
941
+ {
942
+ title: '使用组织',
943
+ dataIndex: 'salesOrgName',
944
+ },
945
+ ],
946
+ ...modalTableBusProps
947
+ }
948
+ }
949
+
950
+ // 店铺选择器
951
+ if(type === 'shopFile') {
952
+ requestConfig = {
953
+ url: `${prefixUrl.selectPrefix}/store`,
954
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
955
+ mappingTextField: 'name',
956
+ mappingValueField: 'code',
957
+ otherParams: {
958
+ sorter: 'desc-id'
959
+ }, // 默认参数
960
+ sourceName: 'code',
961
+ ...requestConfigProp,
962
+ }
963
+ tableSearchForm = [
964
+ { name: 'qp-name-like', label: '店铺名称' },
965
+ { name: 'qp-code-like', label: '店铺编码' },
966
+ { name: 'qp-conglomerateCode-in', type: 'select', label: '归属集团', field: {
967
+ type: 'select',
968
+ props: {
969
+ mode: 'multiple',
970
+ notFoundContent: '暂无数据',
971
+ allowClear: true,
972
+ showSearch: true,
973
+ showArrow: true,
974
+ maxTagCount: 1,
975
+ optionFilterProp: 'children',
976
+ filterOption: (input: string, option: { props: { children: string } }) =>
977
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
978
+ },
979
+ } },
980
+ { name: 'qp-companyCode-in', type: 'select', label: '归属法人公司', field: {
981
+ type: 'select',
982
+ props: {
983
+ mode: 'multiple',
984
+ notFoundContent: '暂无数据',
985
+ allowClear: true,
986
+ showSearch: true,
987
+ showArrow: true,
988
+ maxTagCount: 1,
989
+ optionFilterProp: 'children',
990
+ filterOption: (input: string, option: { props: { children: string } }) =>
991
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
992
+ },
993
+ } },
994
+ { name: 'qp-type-in', type: 'select', label: '店铺类型', initialSource: shopFileType },
995
+ { name: 'qp-plateformCode-in', type: 'select', label: '店铺来源', field: {
996
+ type: 'select',
997
+ props: {
998
+ mode: 'multiple',
999
+ notFoundContent: '暂无数据',
1000
+ allowClear: true,
1001
+ showSearch: true,
1002
+ showArrow: true,
1003
+ maxTagCount: 1,
1004
+ optionFilterProp: 'children',
1005
+ filterOption: (input: string, option: { props: { children: string } }) =>
1006
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1007
+ },
1008
+ } },
1009
+ { name: 'qp-accountingCode-in', type: 'select', label: '归属核算主体', field: {
1010
+ type: 'select',
1011
+ props: {
1012
+ mode: 'multiple',
1013
+ notFoundContent: '暂无数据',
1014
+ allowClear: true,
1015
+ showSearch: true,
1016
+ showArrow: true,
1017
+ maxTagCount: 1,
1018
+ optionFilterProp: 'children',
1019
+ filterOption: (input: string, option: { props: { children: string } }) =>
1020
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1021
+ },
1022
+ } },
1023
+ ]
1024
+ Promise.all([
1025
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
1026
+ pageSize: 5000,
1027
+ currentPage: 1,
1028
+ 'qp-companyType-eq': '30',
1029
+ }),
1030
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
1031
+ pageSize: 5000,
1032
+ currentPage: 1,
1033
+ 'qp-companyType-eq': '20',
1034
+ }),
1035
+ loadSelectSource(`${prefixUrl.formSelectFix}/platformRecord/getPlatformRecordList`, {
1036
+ // pageSize: 5000,
1037
+ // currentPage: 1,
1038
+ 'qp-status-eq': '1',
1039
+ }),
1040
+ loadSelectSource(`${prefixUrl.formSelectFix}/accountingSubject`, {
1041
+ pageSize: 5000,
1042
+ currentPage: 1,
1043
+ }),
1044
+ ]).then((x: any)=>{
1045
+ formatSource(x,0, 2, tableSearchForm);
1046
+ formatSource(x,1, 3, tableSearchForm);
1047
+ formatSource(x,2, 5, tableSearchForm);
1048
+ formatSource(x,3, 6, tableSearchForm);
1049
+ })
1050
+ modalTableProps = {
1051
+ modalTableTitle: '选择店铺',
1052
+ tableSearchForm,
1053
+ tableColumns: [
1054
+ {
1055
+ title: '店铺编码',
1056
+ dataIndex: 'code',
1057
+ },
1058
+ {
1059
+ title: '店铺名称',
1060
+ dataIndex: 'name',
1061
+ },
1062
+ {
1063
+ title: '归属集团',
1064
+ dataIndex: 'conglomerateName',
1065
+ },
1066
+ {
1067
+ title: '归属法人公司',
1068
+ dataIndex: 'companyName',
1069
+ },
1070
+ {
1071
+ title: '店铺类型',
1072
+ dataIndex: 'type',
1073
+ render: (text: number) => shopFileType.find((i: any) => i.value === text)?.text,
1074
+ },
1075
+ {
1076
+ title: '店铺来源',
1077
+ dataIndex: 'platformName',
1078
+ },
1079
+ {
1080
+ title: '归属核算主体',
1081
+ dataIndex: 'accountingName',
1082
+ },
1083
+ ],
1084
+ ...modalTableBusProps
1085
+ }
1086
+ }
1087
+ if(type === 'shopFile2') {
1088
+ requestConfig = {
1089
+ url: `${prefixUrl.selectPrefix}/store/page`,
1090
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
1091
+ mappingTextField: 'name',
1092
+ mappingValueField: 'code',
1093
+ otherParams: {
1094
+ sorter: 'desc-id'
1095
+ }, // 默认参数
1096
+ sourceName: 'code',
1097
+ ...requestConfigProp,
1098
+ }
1099
+ tableSearchForm = [
1100
+ { name: 'qp-name-like', label: '商店名称' },
1101
+ { name: 'qp-code-like', label: '商店编码' },
1102
+ { name: 'qp-type-in', type: 'select', label: '商店类型', initialSource: shopFile2Type },
1103
+ { name: 'qp-orgCode-in', type: 'select', label: '所属销售组织', field: {
1104
+ type: 'select',
1105
+ props: {
1106
+ mode: 'multiple',
1107
+ notFoundContent: '暂无数据',
1108
+ allowClear: true,
1109
+ showSearch: true,
1110
+ showArrow: true,
1111
+ maxTagCount: 1,
1112
+ optionFilterProp: 'children',
1113
+ filterOption: (input: string, option: { props: { children: string } }) =>
1114
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1115
+ },
1116
+ } },
1117
+ ]
1118
+ Promise.all([
1119
+ loadSelectSource(`${prefixUrl.formSelectFix}/orgView/getTree/sales-organizational-view`, {
1120
+ 'qp-employeeCode-eq': JSON.parse(localStorage.getItem('userInfo') || '{}')?.employeeResVo?.employeeNumber,
1121
+ 'qp-realOrg-eq': true,
1122
+ 'qp-status-eq': 10
1123
+ }),
1124
+ ]).then((x: any)=>{
1125
+ formatSource(x,0, 3, tableSearchForm);
1126
+ })
1127
+ modalTableProps = {
1128
+ modalTableTitle: '选择商店',
1129
+ tableSearchForm,
1130
+ tableColumns: [
1131
+ {
1132
+ title: '商店编码',
1133
+ dataIndex: 'code',
1134
+ },
1135
+ {
1136
+ title: '商店名称',
1137
+ dataIndex: 'name',
1138
+ },
1139
+ {
1140
+ title: '商店类型',
1141
+ dataIndex: 'type',
1142
+ render: (text: number) => shopFile2Type.find((i: any) => i.value === text)?.text,
1143
+ },
1144
+ {
1145
+ title: '所属销售组织',
1146
+ dataIndex: 'orgName',
1147
+ },
1148
+ ],
1149
+ ...modalTableBusProps
1150
+ }
1151
+ }
1152
+
1153
+ // 核算主体选择器(无弹窗)
1154
+ if(type === 'accountingSubject') {
1155
+ requestConfig = {
1156
+ url: `${prefixUrl.selectPrefix}/accountingSubject`,
1157
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
1158
+ mappingTextField: 'name',
1159
+ mappingTextShowKeyField: 'code',
1160
+ mappingValueField: 'id',
1161
+ otherParams: {
1162
+ sorter: 'desc-id'
1163
+ }, // 默认参数
1164
+ sourceName: 'accountingSubjectCode',
1165
+ ...requestConfigProp,
1166
+ }
1167
+ needModalTable = false
1168
+ }
1169
+ // 库存组织选择器(无弹窗)
1170
+ if(type === 'inventoryOrg') {
1171
+ requestConfig = {
1172
+ url: `${prefixUrl.selectPrefix}/inventoryOrg`,
1173
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
1174
+ mappingTextField: 'name',
1175
+ mappingTextShowKeyField: 'code',
1176
+ mappingValueField: 'id',
1177
+ otherParams: {
1178
+ sorter: 'desc-id'
1179
+ }, // 默认参数
1180
+ sourceName: 'inventoryOrgCode',
1181
+ ...requestConfigProp,
1182
+ }
1183
+ needModalTable = false
1184
+ }
1185
+
1186
+ // 法人公司选择器(无弹窗)
1187
+ if(type === 'corporationCompany') {
1188
+ requestConfig = {
1189
+ url: `${prefixUrl.selectPrefix}/company`,
1190
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
1191
+ mappingTextField: 'name',
1192
+ mappingTextShowKeyField: 'code',
1193
+ mappingValueField: 'id',
1194
+ otherParams: {
1195
+ sorter: 'desc-id'
1196
+ }, // 默认参数
1197
+ sourceName: 'corporationCompany',
1198
+ ...requestConfigProp,
1199
+ }
1200
+ needModalTable = false
1201
+ }
1202
+
1203
+ // 员工选择器
1204
+ if(type === 'employee') {
1205
+ requestConfig = {
1206
+ url: `${prefixUrl.selectPrefix}/employee/v2`,
1207
+ filter: 'qp-employeeNumber,name-orGroup,like', // 过滤参数
1208
+ mappingTextField: 'name',
1209
+ mappingTextShowKeyField: 'employeeNumber',
1210
+ mappingValueField: 'employeeNumber',
1211
+ otherParams: {
1212
+ 'qp-enable-eq': 10, // 启用状态 10-启用,20-禁用
1213
+ 'qp-employmentType-eq': 20,
1214
+ sorter: 'desc-id'
1215
+ }, // 默认参数
1216
+ sourceName: 'employeeNumber',
1217
+ ...requestConfigProp,
1218
+ }
1219
+ tableSearchForm = [
1220
+ { name: 'qp-name-like', label: '员工名称' },
1221
+ { name: 'qp-employeeNumber-like', label: '员工编码' },
1222
+ { name: 'qp-companyCode-in', type: 'select', label: '所属公司', field: {
1223
+ type: 'select',
1224
+ props: {
1225
+ mode: 'multiple',
1226
+ notFoundContent: '暂无数据',
1227
+ allowClear: true,
1228
+ showSearch: true,
1229
+ showArrow: true,
1230
+ maxTagCount: 1,
1231
+ optionFilterProp: 'children',
1232
+ filterOption: (input: string, option: { props: { children: string } }) =>
1233
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1234
+ },
1235
+ } },
1236
+ { name: 'qp-email-like', label: '邮箱' },
1237
+ { name: 'qp-officeTelephone-like', label: '手机号' },
1238
+ ]
1239
+ Promise.all([
1240
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
1241
+ pageSize: 5000,
1242
+ currentPage: 1,
1243
+ 'qp-companyType-eq': 20,
1244
+ }),
1245
+ ]).then((x: any)=>{
1246
+ formatSource(x,0, 2, tableSearchForm);
1247
+ })
1248
+ modalTableProps = {
1249
+ modalTableTitle: '选择员工',
1250
+ tableSearchForm,
1251
+ tableColumns: [
1252
+ {
1253
+ title: '员工编码',
1254
+ dataIndex: 'employeeNumber',
1255
+ },
1256
+ {
1257
+ title: '员工名称',
1258
+ dataIndex: 'name',
1259
+ },
1260
+ {
1261
+ title: '所属公司',
1262
+ dataIndex: 'companyName',
1263
+ },
1264
+ {
1265
+ title: '邮箱',
1266
+ dataIndex: 'email',
1267
+ },
1268
+ {
1269
+ title: '手机号',
1270
+ dataIndex: 'officeTelephone',
1271
+ },
1272
+ ],
1273
+ ...modalTableBusProps
1274
+ }
1275
+ }
1276
+ if(type === 'employee2') {
1277
+ // 版本2
1278
+ requestConfig = {
1279
+ url: `${prefixUrl.selectPrefix}/employee/pageList/v2`,
1280
+ filter: 'qp-employeeNumber,name-orGroup,like', // 过滤参数
1281
+ mappingTextField: 'name',
1282
+ mappingTextShowKeyField: 'employeeNumber',
1283
+ mappingValueField: 'id',
1284
+ otherParams: {
1285
+ 'qp-enable-eq': 10, // 启用状态 10-启用,20-禁用
1286
+ 'qp-employmentType-eq': 20,
1287
+ sorter: 'desc-id'
1288
+ }, // 默认参数
1289
+ sourceName: 'employeeNumber',
1290
+ ...requestConfigProp,
1291
+ }
1292
+ tableSearchForm = [
1293
+ { name: 'qp-name-like', label: '员工名称' },
1294
+ { name: 'qp-employeeNumber-like', label: '员工编码' },
1295
+ { name: 'qp-directOrgCode-in', type: 'select', label: '所属组织机构', field: {
1296
+ type: 'select',
1297
+ props: {
1298
+ mode: 'multiple',
1299
+ notFoundContent: '暂无数据',
1300
+ allowClear: true,
1301
+ showSearch: true,
1302
+ showArrow: true,
1303
+ maxTagCount: 1,
1304
+ optionFilterProp: 'children',
1305
+ filterOption: (input: string, option: { props: { children: string } }) =>
1306
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1307
+ },
1308
+ } },
1309
+ { name: 'qp-email-like', label: '邮箱' },
1310
+ { name: 'qp-officeTelephone-like', label: '手机号' },
1311
+ ]
1312
+ Promise.all([
1313
+ loadSelectSource(`${prefixUrl.formSelectFix}/org/listNoPage`, {}),
1314
+ ]).then((x: any)=>{
1315
+ formatSource(x,0, 2, tableSearchForm);
1316
+ })
1317
+ modalTableProps = {
1318
+ modalTableTitle: '选择员工',
1319
+ tableSearchForm,
1320
+ tableColumns: [
1321
+ {
1322
+ title: '员工编码',
1323
+ dataIndex: 'employeeNumber',
1324
+ },
1325
+ {
1326
+ title: '员工名称',
1327
+ dataIndex: 'name',
1328
+ },
1329
+ {
1330
+ title: '所属组织机构',
1331
+ dataIndex: 'directOrgName',
1332
+ },
1333
+ {
1334
+ title: '邮箱',
1335
+ dataIndex: 'email',
1336
+ },
1337
+ {
1338
+ title: '手机号',
1339
+ dataIndex: 'officeTelephone',
1340
+ },
1341
+ ],
1342
+ ...modalTableBusProps
1343
+ }
1344
+ }
1345
+
1346
+ // 配送方式选择器
1347
+ if(type === 'deliveryMode') {
1348
+ requestConfig = {
1349
+ url: `${prefixUrl.selectPrefix}/deliveryMode`,
1350
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
1351
+ mappingTextField: 'name',
1352
+ mappingTextShowKeyField: 'code',
1353
+ mappingValueField: 'code',
1354
+ otherParams: {
1355
+ sorter: 'desc-id'
1356
+ }, // 默认参数
1357
+ sourceName: 'deliveryModeCode',
1358
+ ...requestConfigProp
1359
+ }
1360
+ tableSearchForm = [
1361
+ { name: 'qp-name-like', label: '配送方式名称' },
1362
+ { name: 'qp-code-like', label: '配送方式编码' },
1363
+ { name: 'qp-logisCompanyCode-in', type: 'select', label: '所属物流商', field: {
1364
+ type: 'select',
1365
+ props: {
1366
+ mode: 'multiple',
1367
+ notFoundContent: '暂无数据',
1368
+ allowClear: true,
1369
+ showSearch: true,
1370
+ showArrow: true,
1371
+ maxTagCount: 1,
1372
+ optionFilterProp: 'children',
1373
+ filterOption: (input: string, option: { props: { children: string } }) =>
1374
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1375
+ },
1376
+ } },
1377
+ { name: 'qp-recordChannnelCode-in', type: 'select', label: '单号获取通道', initialSource: getDictionarySource('BSC00004') },
1378
+ { name: 'qp-arrivalPaySupport-in', type: 'select', label: '是否支持到付', initialSource: arrivalPaySupportList },
1379
+ { name: 'qp-sheetTemplateCode-in', type: 'select', label: '面单模板', field: {
1380
+ type: 'select',
1381
+ props: {
1382
+ mode: 'multiple',
1383
+ notFoundContent: '暂无数据',
1384
+ allowClear: true,
1385
+ showSearch: true,
1386
+ showArrow: true,
1387
+ maxTagCount: 1,
1388
+ optionFilterProp: 'children',
1389
+ filterOption: (input: string, option: { props: { children: string } }) =>
1390
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1391
+ },
1392
+ } },
1393
+ { name: 'qp-remark-like', label: '备注' },
1394
+ ]
1395
+ Promise.all([
1396
+ loadSelectSource(`${prefixUrl.formSelectFix}/logisCompany`, {
1397
+ pageSize: 5000,
1398
+ currentPage: 1,
1399
+ }),
1400
+ loadSelectSource(`${prefixUrl.formSelectFix}/printTemplate`, {
1401
+ pageSize: 5000,
1402
+ currentPage: 1,
1403
+ })
1404
+ ]).then((x: any)=>{
1405
+ formatSource(x,0, 2, tableSearchForm);
1406
+ formatSource(x,1, 5, tableSearchForm);
1407
+ })
1408
+ modalTableProps = {
1409
+ modalTableTitle: '选择配送方式',
1410
+ tableSearchForm,
1411
+ tableColumns: [
1412
+ {
1413
+ title: '配送方式编码',
1414
+ dataIndex: 'code',
1415
+ },
1416
+ {
1417
+ title: '配送方式名称',
1418
+ dataIndex: 'name',
1419
+ },
1420
+ {
1421
+ title: '所属物流商',
1422
+ dataIndex: 'logisCompanyName',
1423
+ },
1424
+ {
1425
+ dataIndex: 'recordChannnelCode',
1426
+ title: '单号获取通道',
1427
+ render: (text: any) => getDictionaryTextByValue('BSC00004', text),
1428
+ },
1429
+ {
1430
+ dataIndex: 'arrivalPaySupport',
1431
+ title: '是否支持到付',
1432
+ render: (text: number) => arrivalPaySupportList.find((i: any) => i.value === text)?.text,
1433
+ },
1434
+ {
1435
+ dataIndex: 'sheetTemplateName',
1436
+ title: '面单模板',
1437
+ },
1438
+ {
1439
+ dataIndex: 'remark',
1440
+ title: '备注',
1441
+ },
1442
+ ],
1443
+ ...modalTableBusProps
1444
+ }
1445
+ }
1446
+
1447
+ return { modalTableProps, requestConfig, needModalTable };
1448
+ }