@bit-sun/business-component 1.1.37 → 1.1.38

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 (33) 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 +28 -28
  7. package/README.md +27 -27
  8. package/dist/index.esm.js +2298 -3859
  9. package/dist/index.js +2298 -3859
  10. package/dist/utils/CheckOneUser/index.d.ts +1 -1
  11. package/docs/index.md +21 -21
  12. package/package.json +50 -50
  13. package/src/components/Business/CommodityEntry/index.md +69 -69
  14. package/src/components/Business/CommodityEntry/index.tsx +75 -75
  15. package/src/components/Business/SearchSelect/BusinessUtils.ts +1149 -1148
  16. package/src/components/Business/SearchSelect/common.ts +34 -34
  17. package/src/components/Business/SearchSelect/index.md +1061 -1061
  18. package/src/components/Business/SearchSelect/index.tsx +43 -43
  19. package/src/components/Business/SearchSelect/utils.ts +74 -74
  20. package/src/components/Functional/DataValidation/index.less +63 -63
  21. package/src/components/Functional/DataValidation/index.md +38 -38
  22. package/src/components/Functional/DataValidation/index.tsx +668 -668
  23. package/src/components/Functional/QueryMutipleInput/index.less +37 -37
  24. package/src/components/Functional/QueryMutipleInput/index.md +33 -33
  25. package/src/components/Functional/QueryMutipleInput/index.tsx +128 -128
  26. package/src/components/Functional/SearchSelect/index.less +115 -115
  27. package/src/components/Functional/SearchSelect/index.md +141 -141
  28. package/src/components/Functional/SearchSelect/index.tsx +714 -714
  29. package/src/index.ts +21 -21
  30. package/src/utils/CheckOneUser/index.md +39 -39
  31. package/src/utils/CheckOneUser/index.ts +51 -51
  32. package/tsconfig.json +29 -29
  33. package/typings.d.ts +2 -2
@@ -1,1148 +1,1149 @@
1
- // 此文件用于 处理业务组件 所用到的公共方法
2
- // @ts-nocheck
3
- import { shopFileType, arrivalPaySupportList, sharingType } 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 || []);
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
- // 供应商选择器
61
- if(type === 'supplier') {
62
- tableSearchForm = [
63
- { name: 'qp-name-like', label: '供应商名称' }, // field: { type: 'input', props: { placeholder: '请输入'}}
64
- { name: 'qp-code-like', label: '供应商编码' },
65
- { name: 'qp-conglomerateCode-in', type: 'select', label: '归属集团', field: {
66
- type: 'select',
67
- props: {
68
- mode: 'multiple',
69
- notFoundContent: '暂无数据',
70
- allowClear: true,
71
- showSearch: true,
72
- showArrow: true,
73
- maxTagCount: 1,
74
- optionFilterProp: 'children',
75
- filterOption: (input: string, option: { props: { children: string } }) =>
76
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
77
- },
78
- } },
79
- { name: 'qp-accountingCode-in', type: 'select', label: '归属核算主体', field: {
80
- type: 'select',
81
- props: {
82
- mode: 'multiple',
83
- notFoundContent: '暂无数据',
84
- allowClear: true,
85
- showSearch: true,
86
- showArrow: true,
87
- maxTagCount: 1,
88
- optionFilterProp: 'children',
89
- filterOption: (input: string, option: { props: { children: string } }) =>
90
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
91
- },
92
- } },
93
- { name: 'qp-companyCode-in', type: 'select', label: '归属法人公司', field: {
94
- type: 'select',
95
- props: {
96
- mode: 'multiple',
97
- notFoundContent: '暂无数据',
98
- allowClear: true,
99
- showSearch: true,
100
- showArrow: true,
101
- maxTagCount: 1,
102
- optionFilterProp: 'children',
103
- filterOption: (input: string, option: { props: { children: string } }) =>
104
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
105
- },
106
- } },
107
- { name: 'qp-sharingType-eq', type: 'select', label: '共享类型', initialSource: sharingTypeDataList },
108
- ]
109
- Promise.all([
110
- loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
111
- pageSize: 5000,
112
- currentPage: 1,
113
- 'qp-companyType-eq': '30',
114
- }),
115
- loadSelectSource(`${prefixUrl.formSelectFix}/accountingSubject`, {
116
- pageSize: 5000,
117
- currentPage: 1,
118
- }),
119
- loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
120
- pageSize: 5000,
121
- currentPage: 1,
122
- 'qp-companyType-eq': '20',
123
- })
124
- ]).then((x: any)=>{
125
- formatSource(x,0, 2, tableSearchForm);
126
- formatSource(x,1, 3, tableSearchForm);
127
- formatSource(x,2, 4, tableSearchForm);
128
- })
129
- }
130
- let modalTableProps = {
131
- modalTableTitle: '选择供应商',
132
- tableSearchForm,
133
- tableColumns: [
134
- {
135
- title: '供应商编码',
136
- dataIndex: 'code',
137
- },
138
- {
139
- title: '供应商名称',
140
- dataIndex: 'name',
141
- },
142
- {
143
- title: '归属集团',
144
- dataIndex: 'conglomerateName',
145
- },
146
- {
147
- title: '归属法人公司',
148
- dataIndex: 'legalCompanyName',
149
- },
150
- {
151
- title: '归属核算主体',
152
- dataIndex: 'accountingName',
153
- },
154
- {
155
- title: '共享类型',
156
- dataIndex: 'sharingType',
157
- render: (text: number) => hasDictSharingType ? getDictionaryTextByValue('UC000013', text) : sharingType.find((i: any) => i.value === text)?.text
158
- },
159
- ],
160
- ...modalTableBusProps,
161
- }
162
- let needModalTable = true;
163
-
164
- // 商品选择器sku
165
- if(type === 'skuCommodity') {
166
- requestConfig = {
167
- url: `${prefixUrl.selectPrefix}/sku/pager/v2`,
168
- filter: 'skuCodeAndSkuName', // 过滤参数
169
- mappingTextField: 'name',
170
- mappingValueField: 'skuCode',
171
- mappingTextShowTextField: ['name', 'propertyNameAndValue'],
172
- otherParams: {
173
- 'qp-approveStatus-eq': 1,
174
- 'qp-type-eq': 10, // 查唯一国际条码
175
- sorter: 'desc-id'
176
- }, // 默认参数
177
- sourceName: 'skuCode',
178
- ...requestConfigProp,
179
- }
180
- tableSearchForm = requestConfig.url.includes('v2') ? [
181
- requestConfig.url.includes('v2') ? { name: 'qp-skuName-like', label: 'SKU名称' } : { name: 'qp-name-like', label: 'SKU名称' },
182
- { name: 'qp-skuCode-like', label: 'SKU编码' },
183
- requestConfig.url.includes('v2') ? { name: 'qp-code-like', label: '国际条码' } : { name: 'qp-barCode-like', label: '国际条码'},
184
- { name: 'qp-itemName-like', label: '所属SPU名称' },
185
- { name: 'qp-itemCode-like', label: '所属SPU编码' },
186
- requestConfig.url.includes('v2') ?{ name: 'qp-externalCode-like', label: '外部编码' } : null,
187
- requestConfig.url.includes('v2') ? { name: 'qp-propertyValueCode-in', type: 'businessSearchSelect', label: '规格', field: {
188
- type: 'businessSearchSelect',
189
- props: {
190
- selectBusinessType: 'skuPropertyValue',
191
- selectProps: {
192
- mode: 'multiple',
193
- maxTagCount: 1,
194
- }
195
- },
196
- }
197
- } : null,
198
- { name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
199
- type: 'select',
200
- props: {
201
- mode: 'multiple',
202
- notFoundContent: '暂无数据',
203
- allowClear: true,
204
- showSearch: true,
205
- showArrow: true,
206
- maxTagCount: 1,
207
- optionFilterProp: 'children',
208
- filterOption: (input: string, option: { props: { children: string } }) =>
209
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
210
- },
211
- } },
212
- { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
213
- type: 'treeSelect',
214
- props: {
215
- treeData: [],
216
- treeCheckable: true,
217
- showSearch: true,
218
- allowClear: true,
219
- showArrow: true,
220
- treeNodeFilterProp: 'title',
221
- treeDefaultExpandAll: true,
222
- maxTagCount: 1,
223
- placeholder: '请选择',
224
- style: {
225
- width: '100%',
226
- },
227
- dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
228
- },
229
- } },
230
- { name: 'qp-classId-in', type: 'select', label: '品类', field: {
231
- type: 'select',
232
- props: {
233
- mode: 'multiple',
234
- notFoundContent: '暂无数据',
235
- allowClear: true,
236
- showSearch: true,
237
- showArrow: true,
238
- maxTagCount: 1,
239
- optionFilterProp: 'children',
240
- filterOption: (input: string, option: { props: { children: string } }) =>
241
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
242
- },
243
- } },
244
- ] : [
245
- { name: 'qp-name-like', label: 'SKU名称' },
246
- { name: 'qp-skuCode-like', label: 'SKU编码' },
247
- { name: 'qp-barCode-like', label: '国际条码'},
248
- { name: 'qp-itemName-like', label: '所属SPU名称' },
249
- { name: 'qp-itemCode-like', label: '所属SPU编码' },
250
- { name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
251
- type: 'select',
252
- props: {
253
- mode: 'multiple',
254
- notFoundContent: '暂无数据',
255
- allowClear: true,
256
- showSearch: true,
257
- showArrow: true,
258
- maxTagCount: 1,
259
- optionFilterProp: 'children',
260
- filterOption: (input: string, option: { props: { children: string } }) =>
261
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
262
- },
263
- } },
264
- { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
265
- type: 'treeSelect',
266
- props: {
267
- treeData: [],
268
- treeCheckable: true,
269
- showSearch: true,
270
- allowClear: true,
271
- showArrow: true,
272
- treeNodeFilterProp: 'title',
273
- treeDefaultExpandAll: true,
274
- maxTagCount: 1,
275
- placeholder: '请选择',
276
- style: {
277
- width: '100%',
278
- },
279
- dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
280
- },
281
- } },
282
- { name: 'qp-classId-in', type: 'select', label: '品类', field: {
283
- type: 'select',
284
- props: {
285
- mode: 'multiple',
286
- notFoundContent: '暂无数据',
287
- allowClear: true,
288
- showSearch: true,
289
- showArrow: true,
290
- maxTagCount: 1,
291
- optionFilterProp: 'children',
292
- filterOption: (input: string, option: { props: { children: string } }) =>
293
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
294
- },
295
- } },
296
- ]
297
- Promise.all([
298
- loadSelectSource(`${prefixUrl.formSelectFix}/brand/queryBrandList`, {
299
- pageSize: 5000,
300
- currentPage: 1,
301
- }),
302
- loadSelectSource(`${prefixUrl.formSelectFix}/category/queryCategoryTree`, {
303
- pageSize: 5000,
304
- currentPage: 1,
305
- }),
306
- loadSelectSource(`${prefixUrl.formSelectFix}/class/withProperty`, {
307
- pageSize: 5000,
308
- currentPage: 1,
309
- }),
310
- ]).then((x: any)=>{
311
- requestConfig.url.includes('v2') ? formatSource(x,0, 7, tableSearchForm,['id','name']) : formatSource(x,0, 5, tableSearchForm,['id','name'])
312
- requestConfig.url.includes('v2') ? formatTreeDataSource(x,1, 8, tableSearchForm) : formatTreeDataSource(x,1, 6, tableSearchForm)
313
- requestConfig.url.includes('v2') ? formatSource(x,2, 9, tableSearchForm,['id','name']) : formatSource(x,2, 7, tableSearchForm,['id','name'])
314
- })
315
- modalTableProps = {
316
- modalTableTitle: '选择SKU',
317
- tableSearchForm,
318
- tableColumns: requestConfig.url.includes('v2') ? [
319
- {
320
- title: 'SKU编码',
321
- dataIndex: 'skuCode',
322
- },
323
- {
324
- title: 'SKU名称',
325
- dataIndex: 'name',
326
- },
327
- {
328
- title: '国际条码',
329
- dataIndex: 'barCode',
330
- },
331
- {
332
- title: '所属SPU名称',
333
- dataIndex: 'itemName',
334
- },
335
- {
336
- title: '所属SPU编码',
337
- dataIndex: 'itemCode',
338
- },
339
- requestConfig.url.includes('v2') ? {
340
- title: '外部编码',
341
- dataIndex: 'externalCode',
342
- } : false,
343
- {
344
- title: '规格',
345
- dataIndex: requestConfig.url.includes('v2') ? 'propertyNameAndValue' : 'skuSpec',
346
- },
347
- {
348
- title: '类目',
349
- dataIndex: 'categoryName',
350
- },
351
- {
352
- title: '品类',
353
- dataIndex: 'className',
354
- },
355
- {
356
- title: '品牌',
357
- dataIndex: 'brandName',
358
- },
359
- ] : [
360
- {
361
- title: 'SKU编码',
362
- dataIndex: 'skuCode',
363
- },
364
- {
365
- title: 'SKU名称',
366
- dataIndex: 'name',
367
- },
368
- {
369
- title: '国际条码',
370
- dataIndex: 'barCode',
371
- },
372
- {
373
- title: '所属SPU名称',
374
- dataIndex: 'itemName',
375
- },
376
- {
377
- title: '所属SPU编码',
378
- dataIndex: 'itemCode',
379
- },
380
- {
381
- title: '规格',
382
- dataIndex: 'skuSpec',
383
- },
384
- {
385
- title: '类目',
386
- dataIndex: 'categoryName',
387
- },
388
- {
389
- title: '品类',
390
- dataIndex: 'className',
391
- },
392
- {
393
- title: '品牌',
394
- dataIndex: 'brandName',
395
- },
396
- ],
397
- ...modalTableBusProps
398
- }
399
- }
400
-
401
- // 商品选择器spu
402
- if(type === 'spuCommodity') {
403
- requestConfig = {
404
- url: `${prefixUrl.selectPrefix}/item`,
405
- filter: 'qp-itemCode,name-orGroup,like', // 过滤参数
406
- mappingTextField: 'name',
407
- mappingValueField: 'itemCode',
408
- otherParams: {
409
- 'qp-approveStatus-eq': 1, // 审核状态(0.待审批;1.审批通过;2.驳回;3.审批未通过)
410
- sorter: 'desc-id'
411
- }, // 默认参数
412
- sourceName: 'itemCode',
413
- ...requestConfigProp,
414
- }
415
- tableSearchForm = [
416
- { name: 'qp-name-like', label: 'SPU名称' },
417
- { name: 'qp-itemCode-like', label: 'SPU编码' },
418
- { name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
419
- type: 'select',
420
- props: {
421
- mode: 'multiple',
422
- notFoundContent: '暂无数据',
423
- allowClear: true,
424
- showSearch: true,
425
- showArrow: true,
426
- maxTagCount: 1,
427
- optionFilterProp: 'children',
428
- filterOption: (input: string, option: { props: { children: string } }) =>
429
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
430
- },
431
- } },
432
- { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
433
- type: 'treeSelect',
434
- props: {
435
- treeData: [],
436
- treeCheckable: true,
437
- showSearch: true,
438
- allowClear: true,
439
- showArrow: true,
440
- treeNodeFilterProp: 'title',
441
- treeDefaultExpandAll: true,
442
- maxTagCount: 1,
443
- placeholder: '请选择',
444
- style: {
445
- width: '100%',
446
- },
447
- dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
448
- },
449
- } },
450
- { name: 'qp-classId-in', type: 'select', label: '品类', field: {
451
- type: 'select',
452
- props: {
453
- mode: 'multiple',
454
- notFoundContent: '暂无数据',
455
- allowClear: true,
456
- showSearch: true,
457
- showArrow: true,
458
- maxTagCount: 1,
459
- optionFilterProp: 'children',
460
- filterOption: (input: string, option: { props: { children: string } }) =>
461
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
462
- },
463
- } },
464
- ]
465
- Promise.all([
466
- loadSelectSource(`${prefixUrl.formSelectFix}/brand/queryBrandList`, {
467
- pageSize: 5000,
468
- currentPage: 1,
469
- }),
470
- loadSelectSource(`${prefixUrl.formSelectFix}/category/queryCategoryTree`, {
471
- pageSize: 5000,
472
- currentPage: 1,
473
- }),
474
- loadSelectSource(`${prefixUrl.formSelectFix}/class/withProperty`, {
475
- pageSize: 5000,
476
- currentPage: 1,
477
- }),
478
- ]).then((x: any)=>{
479
- formatSource(x,0, 2, tableSearchForm,['id','name']);
480
- formatTreeDataSource(x,1, 3, tableSearchForm);
481
- formatSource(x,2, 4, tableSearchForm,['id','name']);
482
- })
483
- modalTableProps = {
484
- modalTableTitle: '选择SPU',
485
- tableSearchForm,
486
- tableColumns: [
487
- {
488
- title: 'SPU编码',
489
- dataIndex: 'itemCode',
490
- },
491
- {
492
- title: 'SPU名称',
493
- dataIndex: 'name',
494
- },
495
- {
496
- title: '品牌',
497
- dataIndex: 'brandName',
498
- },
499
- {
500
- title: '类目',
501
- dataIndex: 'categoryText',
502
- },
503
- {
504
- title: '品类',
505
- dataIndex: 'className',
506
- },
507
- ],
508
- ...modalTableBusProps
509
- }
510
- }
511
-
512
- // 商品规格选择器(无弹窗)
513
- if(type === 'skuPropertyValue') {
514
- requestConfig = {
515
- url: `${prefixUrl.selectPrefix}/skuPropertyValue/list`,
516
- filter: 'qp-value-like', // 过滤参数
517
- mappingTextField: 'value',
518
- mappingTextShowKeyField: 'propertyValueCode',
519
- mappingValueField: 'propertyValueCode',
520
- otherParams: {
521
- sorter: 'desc-id'
522
- }, // 默认参数
523
- sourceName: 'qp-propertyValueCode-in',
524
- ...requestConfigProp,
525
- }
526
- needModalTable = false
527
- }
528
-
529
- // 仓库选择器(物理、逻辑仓)
530
- if(type === 'physicalWarehouse') {
531
- requestConfig = {
532
- url: `${prefixUrl.selectPrefix}/physicalWarehouse`,
533
- filter: 'qp-physicalWarehouseName,physicalWarehouseCode-orGroup,like', // 过滤参数
534
- mappingTextField: 'physicalWarehouseName',
535
- mappingTextShowKeyField: 'physicalWarehouseCode',
536
- mappingValueField: 'id',
537
- otherParams: {
538
- 'qp-isEnable-eq': 1,
539
- sorter: 'desc-id'
540
- }, // 默认参数
541
- sourceName: 'warehouseIds',
542
- ...requestConfigProp,
543
- }
544
- tableSearchForm = [
545
- { name: 'qp-physicalWarehouseName-like', label: '物理仓名称' },
546
- { name: 'qp-physicalWarehouseCode-like', label: '物理仓编码' },
547
- { name: 'qp-physicalWarehouseType-eq', type: 'select', label: '物理仓类型', initialSource: getDictionarySource('SC00002') },
548
- { name: 'qp-companyCode-eq', type: 'select', label: '所属公司', field: {
549
- type: 'select',
550
- props: {
551
- mode: 'multiple',
552
- notFoundContent: '暂无数据',
553
- allowClear: true,
554
- showSearch: true,
555
- showArrow: true,
556
- maxTagCount: 1,
557
- optionFilterProp: 'children',
558
- filterOption: (input: string, option: { props: { children: string } }) =>
559
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
560
- },
561
- } },
562
- ]
563
- Promise.all([
564
- loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
565
- pageSize: 5000,
566
- currentPage: 1,
567
- 'qp-companyType-eq': 20,
568
- }),
569
- ]).then((x: any)=>{
570
- formatSource(x,0, 3, tableSearchForm);
571
- })
572
- modalTableProps = {
573
- modalTableTitle: '选择物理仓',
574
- tableSearchForm,
575
- tableColumns: [
576
- {
577
- title: '物理仓编码',
578
- dataIndex: 'physicalWarehouseCode',
579
- },
580
- {
581
- title: '物理仓名称',
582
- dataIndex: 'physicalWarehouseName',
583
- },
584
- {
585
- title: '物理仓类型',
586
- dataIndex: 'physicalWarehouseType',
587
- render: (text: number) => getDictionaryTextByValue('SC00002', text),
588
- },
589
- {
590
- title: '所属公司',
591
- dataIndex: 'companyName',
592
- },
593
- ],
594
- ...modalTableBusProps
595
- }
596
- }
597
- if(type === 'realWarehouse') {
598
- requestConfig = {
599
- url: `${prefixUrl.selectPrefix}/realWarehouse`,
600
- filter: 'qp-realWarehouseName,realWarehouseCode-orGroup,like', // 过滤参数
601
- mappingTextField: 'realWarehouseName',
602
- mappingTextShowKeyField: 'realWarehouseCode',
603
- mappingValueField: 'id',
604
- otherParams: {
605
- 'qp-isEnable-eq': 1,
606
- sorter: 'desc-id'
607
- }, // 默认参数
608
- sourceName: 'warehouseIds',
609
- ...requestConfigProp,
610
- }
611
- tableSearchForm = [
612
- { name: 'qp-realWarehouseName-like', label: '逻辑仓名称' },
613
- { name: 'qp-realWarehouseCode-like', label: '逻辑仓编码' },
614
- { name: 'qp-realWarehouseType-eq', type: 'select', label: '逻辑仓类型', initialSource: getDictionarySource('SC00004') },
615
- ]
616
- modalTableProps = {
617
- modalTableTitle: '选择逻辑仓',
618
- tableSearchForm,
619
- tableColumns: [
620
- {
621
- title: '逻辑仓编码',
622
- dataIndex: 'realWarehouseCode',
623
- },
624
- {
625
- title: '逻辑仓名称',
626
- dataIndex: 'realWarehouseName',
627
- },
628
- {
629
- title: '逻辑仓类型',
630
- dataIndex: 'realWarehouseType',
631
- render: (text: number) => getDictionaryTextByValue('SC00004', text),
632
- },
633
- ],
634
- ...modalTableBusProps,
635
- }
636
- }
637
-
638
- // 仓库选择器(虚拟、渠道仓)(无弹窗)
639
- if(type === 'virtualWarehouse') {
640
- requestConfig = {
641
- url: `${prefixUrl.selectPrefix}/virtualWarehouse`,
642
- filter: 'qp-virtualWarehouseName,virtualWarehouseCode-orGroup,like', // 过滤参数
643
- mappingTextField: 'virtualWarehouseName',
644
- mappingTextShowKeyField: 'virtualWarehouseCode',
645
- mappingValueField: 'id',
646
- otherParams: {
647
- 'qp-isEnable-eq': 1,
648
- sorter: 'desc-id'
649
- }, // 默认参数
650
- sourceName: 'warehouseIds',
651
- ...requestConfigProp,
652
- }
653
- needModalTable = false
654
- }
655
- if(type === 'channelWarehouse') {
656
- requestConfig = {
657
- url: `${prefixUrl.selectPrefix}/channelWarehouse`,
658
- filter: 'qp-channelWarehouseName,channelWarehouseCode-orGroup,like', // 过滤参数
659
- mappingTextField: 'channelWarehouseName',
660
- mappingTextShowKeyField: 'channelWarehouseCode',
661
- mappingValueField: 'id',
662
- otherParams: {
663
- 'qp-isEnable-eq': 1,
664
- sorter: 'desc-id'
665
- }, // 默认参数
666
- sourceName: 'warehouseIds',
667
- ...requestConfigProp,
668
- }
669
- needModalTable = false
670
- }
671
-
672
- // 客户选择器
673
- if(type === 'customer') {
674
- requestConfig = {
675
- url: `${prefixUrl.selectPrefix}/uc/customer/v2`,
676
- filter: 'qp-name,code-orGroup,like', // 过滤参数
677
- mappingTextField: 'name',
678
- mappingValueField: 'code',
679
- otherParams: {
680
- sorter: 'desc-id'
681
- }, // 默认参数
682
- sourceName: 'customCode',
683
- ...requestConfigProp,
684
- }
685
- tableSearchForm = [
686
- { name: 'qp-name-like', label: '客户名称' },
687
- { name: 'qp-code-like', label: '客户编码' },
688
- { name: 'qp-conglomerateCode-in', type: 'select', label: '归属集团', field: {
689
- type: 'select',
690
- props: {
691
- mode: 'multiple',
692
- notFoundContent: '暂无数据',
693
- allowClear: true,
694
- showSearch: true,
695
- showArrow: true,
696
- maxTagCount: 1,
697
- optionFilterProp: 'children',
698
- filterOption: (input: string, option: { props: { children: string } }) =>
699
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
700
- },
701
- } },
702
- { name: 'qp-accountingCode-in', type: 'select', label: '归属核算主体', field: {
703
- type: 'select',
704
- props: {
705
- mode: 'multiple',
706
- notFoundContent: '暂无数据',
707
- allowClear: true,
708
- showSearch: true,
709
- showArrow: true,
710
- maxTagCount: 1,
711
- optionFilterProp: 'children',
712
- filterOption: (input: string, option: { props: { children: string } }) =>
713
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
714
- },
715
- } },
716
- { name: 'qp-companyCode-in', type: 'select', label: '归属法人公司', field: {
717
- type: 'select',
718
- props: {
719
- mode: 'multiple',
720
- notFoundContent: '暂无数据',
721
- allowClear: true,
722
- showSearch: true,
723
- showArrow: true,
724
- maxTagCount: 1,
725
- optionFilterProp: 'children',
726
- filterOption: (input: string, option: { props: { children: string } }) =>
727
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
728
- },
729
- } },
730
- { name: 'qp-sharingType-eq', type: 'select', label: '共享类型', initialSource: sharingTypeDataList },
731
- ]
732
- Promise.all([
733
- loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
734
- pageSize: 5000,
735
- currentPage: 1,
736
- 'qp-companyType-eq': '30',
737
- }),
738
- loadSelectSource(`${prefixUrl.formSelectFix}/accountingSubject`, {
739
- pageSize: 5000,
740
- currentPage: 1,
741
- }),
742
- loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
743
- pageSize: 5000,
744
- currentPage: 1,
745
- 'qp-companyType-eq': '20',
746
- })
747
- ]).then((x: any)=>{
748
- formatSource(x,0, 2, tableSearchForm);
749
- formatSource(x,1, 3, tableSearchForm);
750
- formatSource(x,2, 4, tableSearchForm);
751
- })
752
- modalTableProps = {
753
- modalTableTitle: '选择客户',
754
- tableSearchForm,
755
- tableColumns: [
756
- {
757
- title: '客户编码',
758
- dataIndex: 'code',
759
- },
760
- {
761
- title: '客户名称',
762
- dataIndex: 'name',
763
- },
764
- {
765
- title: '归属集团',
766
- dataIndex: 'conglomerateName',
767
- },
768
- {
769
- title: '归属法人公司',
770
- dataIndex: 'legalCompanyName',
771
- },
772
- {
773
- title: '归属核算主体',
774
- dataIndex: 'accountingName',
775
- },
776
- {
777
- title: '共享类型',
778
- dataIndex: 'sharingType',
779
- render: (text: number) => hasDictSharingType ? getDictionaryTextByValue('UC000013', text) : sharingType.find((i: any) => i.value === text)?.text,
780
- },
781
- ],
782
- ...modalTableBusProps
783
- }
784
- }
785
-
786
- // 店铺选择器
787
- if(type === 'shopFile') {
788
- requestConfig = {
789
- url: `${prefixUrl.selectPrefix}/store`,
790
- filter: 'qp-name,code-orGroup,like', // 过滤参数
791
- mappingTextField: 'name',
792
- mappingValueField: 'code',
793
- otherParams: {
794
- sorter: 'desc-id'
795
- }, // 默认参数
796
- sourceName: 'code',
797
- ...requestConfigProp,
798
- }
799
- tableSearchForm = [
800
- { name: 'qp-name-like', label: '店铺名称' },
801
- { name: 'qp-code-like', label: '店铺编码' },
802
- { name: 'qp-conglomerateCode-in', type: 'select', label: '归属集团', field: {
803
- type: 'select',
804
- props: {
805
- mode: 'multiple',
806
- notFoundContent: '暂无数据',
807
- allowClear: true,
808
- showSearch: true,
809
- showArrow: true,
810
- maxTagCount: 1,
811
- optionFilterProp: 'children',
812
- filterOption: (input: string, option: { props: { children: string } }) =>
813
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
814
- },
815
- } },
816
- { name: 'qp-companyCode-in', type: 'select', label: '归属法人公司', field: {
817
- type: 'select',
818
- props: {
819
- mode: 'multiple',
820
- notFoundContent: '暂无数据',
821
- allowClear: true,
822
- showSearch: true,
823
- showArrow: true,
824
- maxTagCount: 1,
825
- optionFilterProp: 'children',
826
- filterOption: (input: string, option: { props: { children: string } }) =>
827
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
828
- },
829
- } },
830
- { name: 'qp-type-in', type: 'select', label: '店铺类型', initialSource: shopFileType },
831
- { name: 'qp-plateformCode-in', type: 'select', label: '店铺来源', field: {
832
- type: 'select',
833
- props: {
834
- mode: 'multiple',
835
- notFoundContent: '暂无数据',
836
- allowClear: true,
837
- showSearch: true,
838
- showArrow: true,
839
- maxTagCount: 1,
840
- optionFilterProp: 'children',
841
- filterOption: (input: string, option: { props: { children: string } }) =>
842
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
843
- },
844
- } },
845
- { name: 'qp-accountingCode-in', type: 'select', label: '归属核算主体', field: {
846
- type: 'select',
847
- props: {
848
- mode: 'multiple',
849
- notFoundContent: '暂无数据',
850
- allowClear: true,
851
- showSearch: true,
852
- showArrow: true,
853
- maxTagCount: 1,
854
- optionFilterProp: 'children',
855
- filterOption: (input: string, option: { props: { children: string } }) =>
856
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
857
- },
858
- } },
859
- ]
860
- Promise.all([
861
- loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
862
- pageSize: 5000,
863
- currentPage: 1,
864
- 'qp-companyType-eq': '30',
865
- }),
866
- loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
867
- pageSize: 5000,
868
- currentPage: 1,
869
- 'qp-companyType-eq': '20',
870
- }),
871
- loadSelectSource(`${prefixUrl.formSelectFix}/platformRecord/getPlatformRecordList`, {
872
- // pageSize: 5000,
873
- // currentPage: 1,
874
- 'qp-status-eq': '1',
875
- }),
876
- loadSelectSource(`${prefixUrl.formSelectFix}/accountingSubject`, {
877
- pageSize: 5000,
878
- currentPage: 1,
879
- }),
880
- ]).then((x: any)=>{
881
- formatSource(x,0, 2, tableSearchForm);
882
- formatSource(x,1, 3, tableSearchForm);
883
- formatSource(x,2, 5, tableSearchForm);
884
- formatSource(x,3, 6, tableSearchForm);
885
- })
886
- modalTableProps = {
887
- modalTableTitle: '选择店铺',
888
- tableSearchForm,
889
- tableColumns: [
890
- {
891
- title: '店铺编码',
892
- dataIndex: 'code',
893
- },
894
- {
895
- title: '店铺名称',
896
- dataIndex: 'name',
897
- },
898
- {
899
- title: '归属集团',
900
- dataIndex: 'conglomerateName',
901
- },
902
- {
903
- title: '归属法人公司',
904
- dataIndex: 'companyName',
905
- },
906
- {
907
- title: '店铺类型',
908
- dataIndex: 'type',
909
- render: (text: number) => shopFileType.find((i: any) => i.value === text)?.text,
910
- },
911
- {
912
- title: '店铺来源',
913
- dataIndex: 'platformName',
914
- },
915
- {
916
- title: '归属核算主体',
917
- dataIndex: 'accountingName',
918
- },
919
- ],
920
- ...modalTableBusProps
921
- }
922
- }
923
-
924
- // 核算主体选择器(无弹窗)
925
- if(type === 'accountingSubject') {
926
- requestConfig = {
927
- url: `${prefixUrl.selectPrefix}/accountingSubject`,
928
- filter: 'qp-name,code-orGroup,like', // 过滤参数
929
- mappingTextField: 'name',
930
- mappingTextShowKeyField: 'code',
931
- mappingValueField: 'id',
932
- otherParams: {
933
- sorter: 'desc-id'
934
- }, // 默认参数
935
- sourceName: 'accountingSubjectCode',
936
- ...requestConfigProp,
937
- }
938
- needModalTable = false
939
- }
940
- // 库存组织选择器(无弹窗)
941
- if(type === 'inventoryOrg') {
942
- requestConfig = {
943
- url: `${prefixUrl.selectPrefix}/inventoryOrg`,
944
- filter: 'qp-name,code-orGroup,like', // 过滤参数
945
- mappingTextField: 'name',
946
- mappingTextShowKeyField: 'code',
947
- mappingValueField: 'id',
948
- otherParams: {
949
- sorter: 'desc-id'
950
- }, // 默认参数
951
- sourceName: 'inventoryOrgCode',
952
- ...requestConfigProp,
953
- }
954
- needModalTable = false
955
- }
956
- // 法人公司选择器(无弹窗)
957
- if(type === 'corporationCompany') {
958
- requestConfig = {
959
- url: `${prefixUrl.selectPrefix}/company`,
960
- filter: 'qp-name,code-orGroup,like', // 过滤参数
961
- mappingTextField: 'name',
962
- mappingTextShowKeyField: 'code',
963
- mappingValueField: 'id',
964
- otherParams: {
965
- sorter: 'desc-id'
966
- }, // 默认参数
967
- sourceName: 'corporationCompany',
968
- ...requestConfigProp,
969
- }
970
- needModalTable = false
971
- }
972
-
973
- // 员工选择器
974
- if(type === 'employee') {
975
- requestConfig = {
976
- url: `${prefixUrl.selectPrefix}/employee/v2`,
977
- filter: 'qp-employeeNumber,name-orGroup,like', // 过滤参数
978
- mappingTextField: 'name',
979
- mappingTextShowKeyField: 'employeeNumber',
980
- mappingValueField: 'employeeNumber',
981
- otherParams: {
982
- 'qp-enable-eq': 10, // 启用状态 10-启用,20-禁用
983
- sorter: 'desc-id'
984
- }, // 默认参数
985
- sourceName: 'employeeNumber',
986
- ...requestConfigProp,
987
- }
988
- tableSearchForm = [
989
- { name: 'qp-name-like', label: '员工名称' },
990
- { name: 'qp-employeeNumber-like', label: '员工编码' },
991
- { name: 'qp-companyCode-in', type: 'select', label: '所属公司', field: {
992
- type: 'select',
993
- props: {
994
- mode: 'multiple',
995
- notFoundContent: '暂无数据',
996
- allowClear: true,
997
- showSearch: true,
998
- showArrow: true,
999
- maxTagCount: 1,
1000
- optionFilterProp: 'children',
1001
- filterOption: (input: string, option: { props: { children: string } }) =>
1002
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1003
- },
1004
- } },
1005
- { name: 'qp-email-like', label: '邮箱' },
1006
- { name: 'qp-officeTelephone-like', label: '手机号' },
1007
- ]
1008
- Promise.all([
1009
- loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
1010
- pageSize: 5000,
1011
- currentPage: 1,
1012
- 'qp-companyType-eq': 20,
1013
- }),
1014
- ]).then((x: any)=>{
1015
- formatSource(x,0, 2, tableSearchForm);
1016
- })
1017
- modalTableProps = {
1018
- modalTableTitle: '选择员工',
1019
- tableSearchForm,
1020
- tableColumns: [
1021
- {
1022
- title: '员工编码',
1023
- dataIndex: 'employeeNumber',
1024
- },
1025
- {
1026
- title: '员工名称',
1027
- dataIndex: 'name',
1028
- },
1029
- {
1030
- title: '所属公司',
1031
- dataIndex: 'companyName',
1032
- },
1033
- {
1034
- title: '邮箱',
1035
- dataIndex: 'email',
1036
- },
1037
- {
1038
- title: '手机号',
1039
- dataIndex: 'officeTelephone',
1040
- },
1041
- ],
1042
- ...modalTableBusProps
1043
- }
1044
- }
1045
-
1046
- // 配送方式选择器
1047
- if(type === 'deliveryMode') {
1048
- requestConfig = {
1049
- url: `${prefixUrl.selectPrefix}/deliveryMode`,
1050
- filter: 'qp-name,code-orGroup,like', // 过滤参数
1051
- mappingTextField: 'name',
1052
- mappingTextShowKeyField: 'code',
1053
- mappingValueField: 'code',
1054
- otherParams: {
1055
- sorter: 'desc-id'
1056
- }, // 默认参数
1057
- sourceName: 'deliveryModeCode',
1058
- ...requestConfigProp
1059
- }
1060
- tableSearchForm = [
1061
- { name: 'qp-name-like', label: '配送方式名称' },
1062
- { name: 'qp-code-like', label: '配送方式编码' },
1063
- { name: 'qp-logisCompanyCode-in', type: 'select', label: '所属物流商', field: {
1064
- type: 'select',
1065
- props: {
1066
- mode: 'multiple',
1067
- notFoundContent: '暂无数据',
1068
- allowClear: true,
1069
- showSearch: true,
1070
- showArrow: true,
1071
- maxTagCount: 1,
1072
- optionFilterProp: 'children',
1073
- filterOption: (input: string, option: { props: { children: string } }) =>
1074
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1075
- },
1076
- } },
1077
- { name: 'qp-recordChannnelCode-in', type: 'select', label: '单号获取通道', initialSource: getDictionarySource('BSC00004') },
1078
- { name: 'qp-arrivalPaySupport-in', type: 'select', label: '是否支持到付', initialSource: arrivalPaySupportList },
1079
- { name: 'qp-sheetTemplateCode-in', type: 'select', label: '面单模板', field: {
1080
- type: 'select',
1081
- props: {
1082
- mode: 'multiple',
1083
- notFoundContent: '暂无数据',
1084
- allowClear: true,
1085
- showSearch: true,
1086
- showArrow: true,
1087
- maxTagCount: 1,
1088
- optionFilterProp: 'children',
1089
- filterOption: (input: string, option: { props: { children: string } }) =>
1090
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1091
- },
1092
- } },
1093
- { name: 'qp-remark-like', label: '备注' },
1094
- ]
1095
- Promise.all([
1096
- loadSelectSource(`${prefixUrl.formSelectFix}/logisCompany`, {
1097
- pageSize: 5000,
1098
- currentPage: 1,
1099
- }),
1100
- loadSelectSource(`${prefixUrl.formSelectFix}/printTemplate`, {
1101
- pageSize: 5000,
1102
- currentPage: 1,
1103
- })
1104
- ]).then((x: any)=>{
1105
- formatSource(x,0, 2, tableSearchForm);
1106
- formatSource(x,1, 5, tableSearchForm);
1107
- })
1108
- modalTableProps = {
1109
- modalTableTitle: '选择配送方式',
1110
- tableSearchForm,
1111
- tableColumns: [
1112
- {
1113
- title: '配送方式编码',
1114
- dataIndex: 'code',
1115
- },
1116
- {
1117
- title: '配送方式名称',
1118
- dataIndex: 'name',
1119
- },
1120
- {
1121
- title: '所属物流商',
1122
- dataIndex: 'logisCompanyName',
1123
- },
1124
- {
1125
- dataIndex: 'recordChannnelCode',
1126
- title: '单号获取通道',
1127
- render: (text: any) => getDictionaryTextByValue('BSC00004', text),
1128
- },
1129
- {
1130
- dataIndex: 'arrivalPaySupport',
1131
- title: '是否支持到付',
1132
- render: (text: number) => arrivalPaySupportList.find((i: any) => i.value === text)?.text,
1133
- },
1134
- {
1135
- dataIndex: 'sheetTemplateName',
1136
- title: '面单模板',
1137
- },
1138
- {
1139
- dataIndex: 'remark',
1140
- title: '备注',
1141
- },
1142
- ],
1143
- ...modalTableBusProps
1144
- }
1145
- }
1146
-
1147
- return { modalTableProps, requestConfig, needModalTable };
1148
- }
1
+ // 此文件用于 处理业务组件 所用到的公共方法
2
+ // @ts-nocheck
3
+ import { shopFileType, arrivalPaySupportList, sharingType } 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 || []);
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
+ // 供应商选择器
61
+ if(type === 'supplier') {
62
+ tableSearchForm = [
63
+ { name: 'qp-name-like', label: '供应商名称' }, // field: { type: 'input', props: { placeholder: '请输入'}}
64
+ { name: 'qp-code-like', label: '供应商编码' },
65
+ { name: 'qp-conglomerateCode-in', type: 'select', label: '归属集团', field: {
66
+ type: 'select',
67
+ props: {
68
+ mode: 'multiple',
69
+ notFoundContent: '暂无数据',
70
+ allowClear: true,
71
+ showSearch: true,
72
+ showArrow: true,
73
+ maxTagCount: 1,
74
+ optionFilterProp: 'children',
75
+ filterOption: (input: string, option: { props: { children: string } }) =>
76
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
77
+ },
78
+ } },
79
+ { name: 'qp-accountingCode-in', type: 'select', label: '归属核算主体', field: {
80
+ type: 'select',
81
+ props: {
82
+ mode: 'multiple',
83
+ notFoundContent: '暂无数据',
84
+ allowClear: true,
85
+ showSearch: true,
86
+ showArrow: true,
87
+ maxTagCount: 1,
88
+ optionFilterProp: 'children',
89
+ filterOption: (input: string, option: { props: { children: string } }) =>
90
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
91
+ },
92
+ } },
93
+ { name: 'qp-companyCode-in', type: 'select', label: '归属法人公司', field: {
94
+ type: 'select',
95
+ props: {
96
+ mode: 'multiple',
97
+ notFoundContent: '暂无数据',
98
+ allowClear: true,
99
+ showSearch: true,
100
+ showArrow: true,
101
+ maxTagCount: 1,
102
+ optionFilterProp: 'children',
103
+ filterOption: (input: string, option: { props: { children: string } }) =>
104
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
105
+ },
106
+ } },
107
+ { name: 'qp-sharingType-eq', type: 'select', label: '共享类型', initialSource: sharingTypeDataList },
108
+ ]
109
+ Promise.all([
110
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
111
+ pageSize: 5000,
112
+ currentPage: 1,
113
+ 'qp-companyType-eq': '30',
114
+ }),
115
+ loadSelectSource(`${prefixUrl.formSelectFix}/accountingSubject`, {
116
+ pageSize: 5000,
117
+ currentPage: 1,
118
+ }),
119
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
120
+ pageSize: 5000,
121
+ currentPage: 1,
122
+ 'qp-companyType-eq': '20',
123
+ })
124
+ ]).then((x: any)=>{
125
+ formatSource(x,0, 2, tableSearchForm);
126
+ formatSource(x,1, 3, tableSearchForm);
127
+ formatSource(x,2, 4, tableSearchForm);
128
+ })
129
+ }
130
+ let modalTableProps = {
131
+ modalTableTitle: '选择供应商',
132
+ tableSearchForm,
133
+ tableColumns: [
134
+ {
135
+ title: '供应商编码',
136
+ dataIndex: 'code',
137
+ },
138
+ {
139
+ title: '供应商名称',
140
+ dataIndex: 'name',
141
+ },
142
+ {
143
+ title: '归属集团',
144
+ dataIndex: 'conglomerateName',
145
+ },
146
+ {
147
+ title: '归属法人公司',
148
+ dataIndex: 'legalCompanyName',
149
+ },
150
+ {
151
+ title: '归属核算主体',
152
+ dataIndex: 'accountingName',
153
+ },
154
+ {
155
+ title: '共享类型',
156
+ dataIndex: 'sharingType',
157
+ render: (text: number) => hasDictSharingType ? getDictionaryTextByValue('UC000013', text) : sharingType.find((i: any) => i.value === text)?.text
158
+ },
159
+ ],
160
+ ...modalTableBusProps,
161
+ }
162
+ let needModalTable = true;
163
+
164
+ // 商品选择器sku
165
+ if(type === 'skuCommodity') {
166
+ requestConfig = {
167
+ url: `${prefixUrl.selectPrefix}/sku/pager/v2`,
168
+ filter: 'skuCodeAndSkuName', // 过滤参数
169
+ mappingTextField: 'name',
170
+ mappingValueField: 'skuCode',
171
+ mappingTextShowTextField: ['name', 'propertyNameAndValue'],
172
+ otherParams: {
173
+ 'qp-approveStatus-eq': 1,
174
+ 'qp-type-eq': 10, // 查唯一国际条码
175
+ sorter: 'desc-id'
176
+ }, // 默认参数
177
+ sourceName: 'skuCode',
178
+ ...requestConfigProp,
179
+ }
180
+ tableSearchForm = requestConfig.url.includes('v2') ? [
181
+ requestConfig.url.includes('v2') ? { name: 'qp-skuName-like', label: 'SKU名称' } : { name: 'qp-name-like', label: 'SKU名称' },
182
+ { name: 'qp-skuCode-like', label: 'SKU编码' },
183
+ requestConfig.url.includes('v2') ? { name: 'qp-code-like', label: '国际条码' } : { name: 'qp-barCode-like', label: '国际条码'},
184
+ { name: 'qp-itemName-like', label: '所属SPU名称' },
185
+ { name: 'qp-itemCode-like', label: '所属SPU编码' },
186
+ requestConfig.url.includes('v2') ?{ name: 'qp-externalCode-like', label: '外部编码' } : null,
187
+ requestConfig.url.includes('v2') ? { name: 'qp-propertyValueCode-in', type: 'businessSearchSelect', label: '规格', field: {
188
+ type: 'businessSearchSelect',
189
+ props: {
190
+ selectBusinessType: 'skuPropertyValue',
191
+ selectProps: {
192
+ mode: 'multiple',
193
+ maxTagCount: 1,
194
+ },
195
+ ...(requestConfigProp?.skuPropertyValueRequestConfig || {}),
196
+ },
197
+ }
198
+ } : null,
199
+ { name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
200
+ type: 'select',
201
+ props: {
202
+ mode: 'multiple',
203
+ notFoundContent: '暂无数据',
204
+ allowClear: true,
205
+ showSearch: true,
206
+ showArrow: true,
207
+ maxTagCount: 1,
208
+ optionFilterProp: 'children',
209
+ filterOption: (input: string, option: { props: { children: string } }) =>
210
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
211
+ },
212
+ } },
213
+ { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
214
+ type: 'treeSelect',
215
+ props: {
216
+ treeData: [],
217
+ treeCheckable: true,
218
+ showSearch: true,
219
+ allowClear: true,
220
+ showArrow: true,
221
+ treeNodeFilterProp: 'title',
222
+ treeDefaultExpandAll: true,
223
+ maxTagCount: 1,
224
+ placeholder: '请选择',
225
+ style: {
226
+ width: '100%',
227
+ },
228
+ dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
229
+ },
230
+ } },
231
+ { name: 'qp-classId-in', type: 'select', label: '品类', field: {
232
+ type: 'select',
233
+ props: {
234
+ mode: 'multiple',
235
+ notFoundContent: '暂无数据',
236
+ allowClear: true,
237
+ showSearch: true,
238
+ showArrow: true,
239
+ maxTagCount: 1,
240
+ optionFilterProp: 'children',
241
+ filterOption: (input: string, option: { props: { children: string } }) =>
242
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
243
+ },
244
+ } },
245
+ ] : [
246
+ { name: 'qp-name-like', label: 'SKU名称' },
247
+ { name: 'qp-skuCode-like', label: 'SKU编码' },
248
+ { name: 'qp-barCode-like', label: '国际条码'},
249
+ { name: 'qp-itemName-like', label: '所属SPU名称' },
250
+ { name: 'qp-itemCode-like', label: '所属SPU编码' },
251
+ { name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
252
+ type: 'select',
253
+ props: {
254
+ mode: 'multiple',
255
+ notFoundContent: '暂无数据',
256
+ allowClear: true,
257
+ showSearch: true,
258
+ showArrow: true,
259
+ maxTagCount: 1,
260
+ optionFilterProp: 'children',
261
+ filterOption: (input: string, option: { props: { children: string } }) =>
262
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
263
+ },
264
+ } },
265
+ { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
266
+ type: 'treeSelect',
267
+ props: {
268
+ treeData: [],
269
+ treeCheckable: true,
270
+ showSearch: true,
271
+ allowClear: true,
272
+ showArrow: true,
273
+ treeNodeFilterProp: 'title',
274
+ treeDefaultExpandAll: true,
275
+ maxTagCount: 1,
276
+ placeholder: '请选择',
277
+ style: {
278
+ width: '100%',
279
+ },
280
+ dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
281
+ },
282
+ } },
283
+ { name: 'qp-classId-in', type: 'select', label: '品类', field: {
284
+ type: 'select',
285
+ props: {
286
+ mode: 'multiple',
287
+ notFoundContent: '暂无数据',
288
+ allowClear: true,
289
+ showSearch: true,
290
+ showArrow: true,
291
+ maxTagCount: 1,
292
+ optionFilterProp: 'children',
293
+ filterOption: (input: string, option: { props: { children: string } }) =>
294
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
295
+ },
296
+ } },
297
+ ]
298
+ Promise.all([
299
+ loadSelectSource(`${prefixUrl.formSelectFix}/brand/queryBrandList`, {
300
+ pageSize: 5000,
301
+ currentPage: 1,
302
+ }),
303
+ loadSelectSource(`${prefixUrl.formSelectFix}/category/queryCategoryTree`, {
304
+ pageSize: 5000,
305
+ currentPage: 1,
306
+ }),
307
+ loadSelectSource(`${prefixUrl.formSelectFix}/class/withProperty`, {
308
+ pageSize: 5000,
309
+ currentPage: 1,
310
+ }),
311
+ ]).then((x: any)=>{
312
+ requestConfig.url.includes('v2') ? formatSource(x,0, 7, tableSearchForm,['id','name']) : formatSource(x,0, 5, tableSearchForm,['id','name'])
313
+ requestConfig.url.includes('v2') ? formatTreeDataSource(x,1, 8, tableSearchForm) : formatTreeDataSource(x,1, 6, tableSearchForm)
314
+ requestConfig.url.includes('v2') ? formatSource(x,2, 9, tableSearchForm,['id','name']) : formatSource(x,2, 7, tableSearchForm,['id','name'])
315
+ })
316
+ modalTableProps = {
317
+ modalTableTitle: '选择SKU',
318
+ tableSearchForm,
319
+ tableColumns: requestConfig.url.includes('v2') ? [
320
+ {
321
+ title: 'SKU编码',
322
+ dataIndex: 'skuCode',
323
+ },
324
+ {
325
+ title: 'SKU名称',
326
+ dataIndex: 'name',
327
+ },
328
+ {
329
+ title: '国际条码',
330
+ dataIndex: 'barCode',
331
+ },
332
+ {
333
+ title: '所属SPU名称',
334
+ dataIndex: 'itemName',
335
+ },
336
+ {
337
+ title: '所属SPU编码',
338
+ dataIndex: 'itemCode',
339
+ },
340
+ requestConfig.url.includes('v2') ? {
341
+ title: '外部编码',
342
+ dataIndex: 'externalCode',
343
+ } : false,
344
+ {
345
+ title: '规格',
346
+ dataIndex: requestConfig.url.includes('v2') ? 'propertyNameAndValue' : 'skuSpec',
347
+ },
348
+ {
349
+ title: '类目',
350
+ dataIndex: 'categoryName',
351
+ },
352
+ {
353
+ title: '品类',
354
+ dataIndex: 'className',
355
+ },
356
+ {
357
+ title: '品牌',
358
+ dataIndex: 'brandName',
359
+ },
360
+ ] : [
361
+ {
362
+ title: 'SKU编码',
363
+ dataIndex: 'skuCode',
364
+ },
365
+ {
366
+ title: 'SKU名称',
367
+ dataIndex: 'name',
368
+ },
369
+ {
370
+ title: '国际条码',
371
+ dataIndex: 'barCode',
372
+ },
373
+ {
374
+ title: '所属SPU名称',
375
+ dataIndex: 'itemName',
376
+ },
377
+ {
378
+ title: '所属SPU编码',
379
+ dataIndex: 'itemCode',
380
+ },
381
+ {
382
+ title: '规格',
383
+ dataIndex: 'skuSpec',
384
+ },
385
+ {
386
+ title: '类目',
387
+ dataIndex: 'categoryName',
388
+ },
389
+ {
390
+ title: '品类',
391
+ dataIndex: 'className',
392
+ },
393
+ {
394
+ title: '品牌',
395
+ dataIndex: 'brandName',
396
+ },
397
+ ],
398
+ ...modalTableBusProps
399
+ }
400
+ }
401
+
402
+ // 商品选择器spu
403
+ if(type === 'spuCommodity') {
404
+ requestConfig = {
405
+ url: `${prefixUrl.selectPrefix}/item`,
406
+ filter: 'qp-itemCode,name-orGroup,like', // 过滤参数
407
+ mappingTextField: 'name',
408
+ mappingValueField: 'itemCode',
409
+ otherParams: {
410
+ 'qp-approveStatus-eq': 1, // 审核状态(0.待审批;1.审批通过;2.驳回;3.审批未通过)
411
+ sorter: 'desc-id'
412
+ }, // 默认参数
413
+ sourceName: 'itemCode',
414
+ ...requestConfigProp,
415
+ }
416
+ tableSearchForm = [
417
+ { name: 'qp-name-like', label: 'SPU名称' },
418
+ { name: 'qp-itemCode-like', label: 'SPU编码' },
419
+ { name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
420
+ type: 'select',
421
+ props: {
422
+ mode: 'multiple',
423
+ notFoundContent: '暂无数据',
424
+ allowClear: true,
425
+ showSearch: true,
426
+ showArrow: true,
427
+ maxTagCount: 1,
428
+ optionFilterProp: 'children',
429
+ filterOption: (input: string, option: { props: { children: string } }) =>
430
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
431
+ },
432
+ } },
433
+ { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
434
+ type: 'treeSelect',
435
+ props: {
436
+ treeData: [],
437
+ treeCheckable: true,
438
+ showSearch: true,
439
+ allowClear: true,
440
+ showArrow: true,
441
+ treeNodeFilterProp: 'title',
442
+ treeDefaultExpandAll: true,
443
+ maxTagCount: 1,
444
+ placeholder: '请选择',
445
+ style: {
446
+ width: '100%',
447
+ },
448
+ dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
449
+ },
450
+ } },
451
+ { name: 'qp-classId-in', type: 'select', label: '品类', field: {
452
+ type: 'select',
453
+ props: {
454
+ mode: 'multiple',
455
+ notFoundContent: '暂无数据',
456
+ allowClear: true,
457
+ showSearch: true,
458
+ showArrow: true,
459
+ maxTagCount: 1,
460
+ optionFilterProp: 'children',
461
+ filterOption: (input: string, option: { props: { children: string } }) =>
462
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
463
+ },
464
+ } },
465
+ ]
466
+ Promise.all([
467
+ loadSelectSource(`${prefixUrl.formSelectFix}/brand/queryBrandList`, {
468
+ pageSize: 5000,
469
+ currentPage: 1,
470
+ }),
471
+ loadSelectSource(`${prefixUrl.formSelectFix}/category/queryCategoryTree`, {
472
+ pageSize: 5000,
473
+ currentPage: 1,
474
+ }),
475
+ loadSelectSource(`${prefixUrl.formSelectFix}/class/withProperty`, {
476
+ pageSize: 5000,
477
+ currentPage: 1,
478
+ }),
479
+ ]).then((x: any)=>{
480
+ formatSource(x,0, 2, tableSearchForm,['id','name']);
481
+ formatTreeDataSource(x,1, 3, tableSearchForm);
482
+ formatSource(x,2, 4, tableSearchForm,['id','name']);
483
+ })
484
+ modalTableProps = {
485
+ modalTableTitle: '选择SPU',
486
+ tableSearchForm,
487
+ tableColumns: [
488
+ {
489
+ title: 'SPU编码',
490
+ dataIndex: 'itemCode',
491
+ },
492
+ {
493
+ title: 'SPU名称',
494
+ dataIndex: 'name',
495
+ },
496
+ {
497
+ title: '品牌',
498
+ dataIndex: 'brandName',
499
+ },
500
+ {
501
+ title: '类目',
502
+ dataIndex: 'categoryText',
503
+ },
504
+ {
505
+ title: '品类',
506
+ dataIndex: 'className',
507
+ },
508
+ ],
509
+ ...modalTableBusProps
510
+ }
511
+ }
512
+
513
+ // 商品规格选择器(无弹窗)
514
+ if(type === 'skuPropertyValue') {
515
+ requestConfig = {
516
+ url: `${prefixUrl.selectPrefix}/skuPropertyValue/list`,
517
+ filter: 'qp-value-like', // 过滤参数
518
+ mappingTextField: 'value',
519
+ mappingTextShowKeyField: 'propertyValueCode',
520
+ mappingValueField: 'propertyValueCode',
521
+ otherParams: {
522
+ sorter: 'desc-id'
523
+ }, // 默认参数
524
+ sourceName: 'qp-propertyValueCode-in',
525
+ ...requestConfigProp,
526
+ }
527
+ needModalTable = false
528
+ }
529
+
530
+ // 仓库选择器(物理、逻辑仓)
531
+ if(type === 'physicalWarehouse') {
532
+ requestConfig = {
533
+ url: `${prefixUrl.selectPrefix}/physicalWarehouse`,
534
+ filter: 'qp-physicalWarehouseName,physicalWarehouseCode-orGroup,like', // 过滤参数
535
+ mappingTextField: 'physicalWarehouseName',
536
+ mappingTextShowKeyField: 'physicalWarehouseCode',
537
+ mappingValueField: 'id',
538
+ otherParams: {
539
+ 'qp-isEnable-eq': 1,
540
+ sorter: 'desc-id'
541
+ }, // 默认参数
542
+ sourceName: 'warehouseIds',
543
+ ...requestConfigProp,
544
+ }
545
+ tableSearchForm = [
546
+ { name: 'qp-physicalWarehouseName-like', label: '物理仓名称' },
547
+ { name: 'qp-physicalWarehouseCode-like', label: '物理仓编码' },
548
+ { name: 'qp-physicalWarehouseType-eq', type: 'select', label: '物理仓类型', initialSource: getDictionarySource('SC00002') },
549
+ { name: 'qp-companyCode-eq', type: 'select', label: '所属公司', field: {
550
+ type: 'select',
551
+ props: {
552
+ mode: 'multiple',
553
+ notFoundContent: '暂无数据',
554
+ allowClear: true,
555
+ showSearch: true,
556
+ showArrow: true,
557
+ maxTagCount: 1,
558
+ optionFilterProp: 'children',
559
+ filterOption: (input: string, option: { props: { children: string } }) =>
560
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
561
+ },
562
+ } },
563
+ ]
564
+ Promise.all([
565
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
566
+ pageSize: 5000,
567
+ currentPage: 1,
568
+ 'qp-companyType-eq': 20,
569
+ }),
570
+ ]).then((x: any)=>{
571
+ formatSource(x,0, 3, tableSearchForm);
572
+ })
573
+ modalTableProps = {
574
+ modalTableTitle: '选择物理仓',
575
+ tableSearchForm,
576
+ tableColumns: [
577
+ {
578
+ title: '物理仓编码',
579
+ dataIndex: 'physicalWarehouseCode',
580
+ },
581
+ {
582
+ title: '物理仓名称',
583
+ dataIndex: 'physicalWarehouseName',
584
+ },
585
+ {
586
+ title: '物理仓类型',
587
+ dataIndex: 'physicalWarehouseType',
588
+ render: (text: number) => getDictionaryTextByValue('SC00002', text),
589
+ },
590
+ {
591
+ title: '所属公司',
592
+ dataIndex: 'companyName',
593
+ },
594
+ ],
595
+ ...modalTableBusProps
596
+ }
597
+ }
598
+ if(type === 'realWarehouse') {
599
+ requestConfig = {
600
+ url: `${prefixUrl.selectPrefix}/realWarehouse`,
601
+ filter: 'qp-realWarehouseName,realWarehouseCode-orGroup,like', // 过滤参数
602
+ mappingTextField: 'realWarehouseName',
603
+ mappingTextShowKeyField: 'realWarehouseCode',
604
+ mappingValueField: 'id',
605
+ otherParams: {
606
+ 'qp-isEnable-eq': 1,
607
+ sorter: 'desc-id'
608
+ }, // 默认参数
609
+ sourceName: 'warehouseIds',
610
+ ...requestConfigProp,
611
+ }
612
+ tableSearchForm = [
613
+ { name: 'qp-realWarehouseName-like', label: '逻辑仓名称' },
614
+ { name: 'qp-realWarehouseCode-like', label: '逻辑仓编码' },
615
+ { name: 'qp-realWarehouseType-eq', type: 'select', label: '逻辑仓类型', initialSource: getDictionarySource('SC00004') },
616
+ ]
617
+ modalTableProps = {
618
+ modalTableTitle: '选择逻辑仓',
619
+ tableSearchForm,
620
+ tableColumns: [
621
+ {
622
+ title: '逻辑仓编码',
623
+ dataIndex: 'realWarehouseCode',
624
+ },
625
+ {
626
+ title: '逻辑仓名称',
627
+ dataIndex: 'realWarehouseName',
628
+ },
629
+ {
630
+ title: '逻辑仓类型',
631
+ dataIndex: 'realWarehouseType',
632
+ render: (text: number) => getDictionaryTextByValue('SC00004', text),
633
+ },
634
+ ],
635
+ ...modalTableBusProps,
636
+ }
637
+ }
638
+
639
+ // 仓库选择器(虚拟、渠道仓)(无弹窗)
640
+ if(type === 'virtualWarehouse') {
641
+ requestConfig = {
642
+ url: `${prefixUrl.selectPrefix}/virtualWarehouse`,
643
+ filter: 'qp-virtualWarehouseName,virtualWarehouseCode-orGroup,like', // 过滤参数
644
+ mappingTextField: 'virtualWarehouseName',
645
+ mappingTextShowKeyField: 'virtualWarehouseCode',
646
+ mappingValueField: 'id',
647
+ otherParams: {
648
+ 'qp-isEnable-eq': 1,
649
+ sorter: 'desc-id'
650
+ }, // 默认参数
651
+ sourceName: 'warehouseIds',
652
+ ...requestConfigProp,
653
+ }
654
+ needModalTable = false
655
+ }
656
+ if(type === 'channelWarehouse') {
657
+ requestConfig = {
658
+ url: `${prefixUrl.selectPrefix}/channelWarehouse`,
659
+ filter: 'qp-channelWarehouseName,channelWarehouseCode-orGroup,like', // 过滤参数
660
+ mappingTextField: 'channelWarehouseName',
661
+ mappingTextShowKeyField: 'channelWarehouseCode',
662
+ mappingValueField: 'id',
663
+ otherParams: {
664
+ 'qp-isEnable-eq': 1,
665
+ sorter: 'desc-id'
666
+ }, // 默认参数
667
+ sourceName: 'warehouseIds',
668
+ ...requestConfigProp,
669
+ }
670
+ needModalTable = false
671
+ }
672
+
673
+ // 客户选择器
674
+ if(type === 'customer') {
675
+ requestConfig = {
676
+ url: `${prefixUrl.selectPrefix}/uc/customer/v2`,
677
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
678
+ mappingTextField: 'name',
679
+ mappingValueField: 'code',
680
+ otherParams: {
681
+ sorter: 'desc-id'
682
+ }, // 默认参数
683
+ sourceName: 'customCode',
684
+ ...requestConfigProp,
685
+ }
686
+ tableSearchForm = [
687
+ { name: 'qp-name-like', label: '客户名称' },
688
+ { name: 'qp-code-like', label: '客户编码' },
689
+ { name: 'qp-conglomerateCode-in', type: 'select', label: '归属集团', field: {
690
+ type: 'select',
691
+ props: {
692
+ mode: 'multiple',
693
+ notFoundContent: '暂无数据',
694
+ allowClear: true,
695
+ showSearch: true,
696
+ showArrow: true,
697
+ maxTagCount: 1,
698
+ optionFilterProp: 'children',
699
+ filterOption: (input: string, option: { props: { children: string } }) =>
700
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
701
+ },
702
+ } },
703
+ { name: 'qp-accountingCode-in', type: 'select', label: '归属核算主体', field: {
704
+ type: 'select',
705
+ props: {
706
+ mode: 'multiple',
707
+ notFoundContent: '暂无数据',
708
+ allowClear: true,
709
+ showSearch: true,
710
+ showArrow: true,
711
+ maxTagCount: 1,
712
+ optionFilterProp: 'children',
713
+ filterOption: (input: string, option: { props: { children: string } }) =>
714
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
715
+ },
716
+ } },
717
+ { name: 'qp-companyCode-in', type: 'select', label: '归属法人公司', field: {
718
+ type: 'select',
719
+ props: {
720
+ mode: 'multiple',
721
+ notFoundContent: '暂无数据',
722
+ allowClear: true,
723
+ showSearch: true,
724
+ showArrow: true,
725
+ maxTagCount: 1,
726
+ optionFilterProp: 'children',
727
+ filterOption: (input: string, option: { props: { children: string } }) =>
728
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
729
+ },
730
+ } },
731
+ { name: 'qp-sharingType-eq', type: 'select', label: '共享类型', initialSource: sharingTypeDataList },
732
+ ]
733
+ Promise.all([
734
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
735
+ pageSize: 5000,
736
+ currentPage: 1,
737
+ 'qp-companyType-eq': '30',
738
+ }),
739
+ loadSelectSource(`${prefixUrl.formSelectFix}/accountingSubject`, {
740
+ pageSize: 5000,
741
+ currentPage: 1,
742
+ }),
743
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
744
+ pageSize: 5000,
745
+ currentPage: 1,
746
+ 'qp-companyType-eq': '20',
747
+ })
748
+ ]).then((x: any)=>{
749
+ formatSource(x,0, 2, tableSearchForm);
750
+ formatSource(x,1, 3, tableSearchForm);
751
+ formatSource(x,2, 4, tableSearchForm);
752
+ })
753
+ modalTableProps = {
754
+ modalTableTitle: '选择客户',
755
+ tableSearchForm,
756
+ tableColumns: [
757
+ {
758
+ title: '客户编码',
759
+ dataIndex: 'code',
760
+ },
761
+ {
762
+ title: '客户名称',
763
+ dataIndex: 'name',
764
+ },
765
+ {
766
+ title: '归属集团',
767
+ dataIndex: 'conglomerateName',
768
+ },
769
+ {
770
+ title: '归属法人公司',
771
+ dataIndex: 'legalCompanyName',
772
+ },
773
+ {
774
+ title: '归属核算主体',
775
+ dataIndex: 'accountingName',
776
+ },
777
+ {
778
+ title: '共享类型',
779
+ dataIndex: 'sharingType',
780
+ render: (text: number) => hasDictSharingType ? getDictionaryTextByValue('UC000013', text) : sharingType.find((i: any) => i.value === text)?.text,
781
+ },
782
+ ],
783
+ ...modalTableBusProps
784
+ }
785
+ }
786
+
787
+ // 店铺选择器
788
+ if(type === 'shopFile') {
789
+ requestConfig = {
790
+ url: `${prefixUrl.selectPrefix}/store`,
791
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
792
+ mappingTextField: 'name',
793
+ mappingValueField: 'code',
794
+ otherParams: {
795
+ sorter: 'desc-id'
796
+ }, // 默认参数
797
+ sourceName: 'code',
798
+ ...requestConfigProp,
799
+ }
800
+ tableSearchForm = [
801
+ { name: 'qp-name-like', label: '店铺名称' },
802
+ { name: 'qp-code-like', label: '店铺编码' },
803
+ { name: 'qp-conglomerateCode-in', type: 'select', label: '归属集团', field: {
804
+ type: 'select',
805
+ props: {
806
+ mode: 'multiple',
807
+ notFoundContent: '暂无数据',
808
+ allowClear: true,
809
+ showSearch: true,
810
+ showArrow: true,
811
+ maxTagCount: 1,
812
+ optionFilterProp: 'children',
813
+ filterOption: (input: string, option: { props: { children: string } }) =>
814
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
815
+ },
816
+ } },
817
+ { name: 'qp-companyCode-in', type: 'select', label: '归属法人公司', field: {
818
+ type: 'select',
819
+ props: {
820
+ mode: 'multiple',
821
+ notFoundContent: '暂无数据',
822
+ allowClear: true,
823
+ showSearch: true,
824
+ showArrow: true,
825
+ maxTagCount: 1,
826
+ optionFilterProp: 'children',
827
+ filterOption: (input: string, option: { props: { children: string } }) =>
828
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
829
+ },
830
+ } },
831
+ { name: 'qp-type-in', type: 'select', label: '店铺类型', initialSource: shopFileType },
832
+ { name: 'qp-plateformCode-in', type: 'select', label: '店铺来源', field: {
833
+ type: 'select',
834
+ props: {
835
+ mode: 'multiple',
836
+ notFoundContent: '暂无数据',
837
+ allowClear: true,
838
+ showSearch: true,
839
+ showArrow: true,
840
+ maxTagCount: 1,
841
+ optionFilterProp: 'children',
842
+ filterOption: (input: string, option: { props: { children: string } }) =>
843
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
844
+ },
845
+ } },
846
+ { name: 'qp-accountingCode-in', type: 'select', label: '归属核算主体', field: {
847
+ type: 'select',
848
+ props: {
849
+ mode: 'multiple',
850
+ notFoundContent: '暂无数据',
851
+ allowClear: true,
852
+ showSearch: true,
853
+ showArrow: true,
854
+ maxTagCount: 1,
855
+ optionFilterProp: 'children',
856
+ filterOption: (input: string, option: { props: { children: string } }) =>
857
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
858
+ },
859
+ } },
860
+ ]
861
+ Promise.all([
862
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
863
+ pageSize: 5000,
864
+ currentPage: 1,
865
+ 'qp-companyType-eq': '30',
866
+ }),
867
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
868
+ pageSize: 5000,
869
+ currentPage: 1,
870
+ 'qp-companyType-eq': '20',
871
+ }),
872
+ loadSelectSource(`${prefixUrl.formSelectFix}/platformRecord/getPlatformRecordList`, {
873
+ // pageSize: 5000,
874
+ // currentPage: 1,
875
+ 'qp-status-eq': '1',
876
+ }),
877
+ loadSelectSource(`${prefixUrl.formSelectFix}/accountingSubject`, {
878
+ pageSize: 5000,
879
+ currentPage: 1,
880
+ }),
881
+ ]).then((x: any)=>{
882
+ formatSource(x,0, 2, tableSearchForm);
883
+ formatSource(x,1, 3, tableSearchForm);
884
+ formatSource(x,2, 5, tableSearchForm);
885
+ formatSource(x,3, 6, tableSearchForm);
886
+ })
887
+ modalTableProps = {
888
+ modalTableTitle: '选择店铺',
889
+ tableSearchForm,
890
+ tableColumns: [
891
+ {
892
+ title: '店铺编码',
893
+ dataIndex: 'code',
894
+ },
895
+ {
896
+ title: '店铺名称',
897
+ dataIndex: 'name',
898
+ },
899
+ {
900
+ title: '归属集团',
901
+ dataIndex: 'conglomerateName',
902
+ },
903
+ {
904
+ title: '归属法人公司',
905
+ dataIndex: 'companyName',
906
+ },
907
+ {
908
+ title: '店铺类型',
909
+ dataIndex: 'type',
910
+ render: (text: number) => shopFileType.find((i: any) => i.value === text)?.text,
911
+ },
912
+ {
913
+ title: '店铺来源',
914
+ dataIndex: 'platformName',
915
+ },
916
+ {
917
+ title: '归属核算主体',
918
+ dataIndex: 'accountingName',
919
+ },
920
+ ],
921
+ ...modalTableBusProps
922
+ }
923
+ }
924
+
925
+ // 核算主体选择器(无弹窗)
926
+ if(type === 'accountingSubject') {
927
+ requestConfig = {
928
+ url: `${prefixUrl.selectPrefix}/accountingSubject`,
929
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
930
+ mappingTextField: 'name',
931
+ mappingTextShowKeyField: 'code',
932
+ mappingValueField: 'id',
933
+ otherParams: {
934
+ sorter: 'desc-id'
935
+ }, // 默认参数
936
+ sourceName: 'accountingSubjectCode',
937
+ ...requestConfigProp,
938
+ }
939
+ needModalTable = false
940
+ }
941
+ // 库存组织选择器(无弹窗)
942
+ if(type === 'inventoryOrg') {
943
+ requestConfig = {
944
+ url: `${prefixUrl.selectPrefix}/inventoryOrg`,
945
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
946
+ mappingTextField: 'name',
947
+ mappingTextShowKeyField: 'code',
948
+ mappingValueField: 'id',
949
+ otherParams: {
950
+ sorter: 'desc-id'
951
+ }, // 默认参数
952
+ sourceName: 'inventoryOrgCode',
953
+ ...requestConfigProp,
954
+ }
955
+ needModalTable = false
956
+ }
957
+ // 法人公司选择器(无弹窗)
958
+ if(type === 'corporationCompany') {
959
+ requestConfig = {
960
+ url: `${prefixUrl.selectPrefix}/company`,
961
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
962
+ mappingTextField: 'name',
963
+ mappingTextShowKeyField: 'code',
964
+ mappingValueField: 'id',
965
+ otherParams: {
966
+ sorter: 'desc-id'
967
+ }, // 默认参数
968
+ sourceName: 'corporationCompany',
969
+ ...requestConfigProp,
970
+ }
971
+ needModalTable = false
972
+ }
973
+
974
+ // 员工选择器
975
+ if(type === 'employee') {
976
+ requestConfig = {
977
+ url: `${prefixUrl.selectPrefix}/employee/v2`,
978
+ filter: 'qp-employeeNumber,name-orGroup,like', // 过滤参数
979
+ mappingTextField: 'name',
980
+ mappingTextShowKeyField: 'employeeNumber',
981
+ mappingValueField: 'employeeNumber',
982
+ otherParams: {
983
+ 'qp-enable-eq': 10, // 启用状态 10-启用,20-禁用
984
+ sorter: 'desc-id'
985
+ }, // 默认参数
986
+ sourceName: 'employeeNumber',
987
+ ...requestConfigProp,
988
+ }
989
+ tableSearchForm = [
990
+ { name: 'qp-name-like', label: '员工名称' },
991
+ { name: 'qp-employeeNumber-like', label: '员工编码' },
992
+ { name: 'qp-companyCode-in', type: 'select', label: '所属公司', field: {
993
+ type: 'select',
994
+ props: {
995
+ mode: 'multiple',
996
+ notFoundContent: '暂无数据',
997
+ allowClear: true,
998
+ showSearch: true,
999
+ showArrow: true,
1000
+ maxTagCount: 1,
1001
+ optionFilterProp: 'children',
1002
+ filterOption: (input: string, option: { props: { children: string } }) =>
1003
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1004
+ },
1005
+ } },
1006
+ { name: 'qp-email-like', label: '邮箱' },
1007
+ { name: 'qp-officeTelephone-like', label: '手机号' },
1008
+ ]
1009
+ Promise.all([
1010
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
1011
+ pageSize: 5000,
1012
+ currentPage: 1,
1013
+ 'qp-companyType-eq': 20,
1014
+ }),
1015
+ ]).then((x: any)=>{
1016
+ formatSource(x,0, 2, tableSearchForm);
1017
+ })
1018
+ modalTableProps = {
1019
+ modalTableTitle: '选择员工',
1020
+ tableSearchForm,
1021
+ tableColumns: [
1022
+ {
1023
+ title: '员工编码',
1024
+ dataIndex: 'employeeNumber',
1025
+ },
1026
+ {
1027
+ title: '员工名称',
1028
+ dataIndex: 'name',
1029
+ },
1030
+ {
1031
+ title: '所属公司',
1032
+ dataIndex: 'companyName',
1033
+ },
1034
+ {
1035
+ title: '邮箱',
1036
+ dataIndex: 'email',
1037
+ },
1038
+ {
1039
+ title: '手机号',
1040
+ dataIndex: 'officeTelephone',
1041
+ },
1042
+ ],
1043
+ ...modalTableBusProps
1044
+ }
1045
+ }
1046
+
1047
+ // 配送方式选择器
1048
+ if(type === 'deliveryMode') {
1049
+ requestConfig = {
1050
+ url: `${prefixUrl.selectPrefix}/deliveryMode`,
1051
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
1052
+ mappingTextField: 'name',
1053
+ mappingTextShowKeyField: 'code',
1054
+ mappingValueField: 'code',
1055
+ otherParams: {
1056
+ sorter: 'desc-id'
1057
+ }, // 默认参数
1058
+ sourceName: 'deliveryModeCode',
1059
+ ...requestConfigProp
1060
+ }
1061
+ tableSearchForm = [
1062
+ { name: 'qp-name-like', label: '配送方式名称' },
1063
+ { name: 'qp-code-like', label: '配送方式编码' },
1064
+ { name: 'qp-logisCompanyCode-in', type: 'select', label: '所属物流商', field: {
1065
+ type: 'select',
1066
+ props: {
1067
+ mode: 'multiple',
1068
+ notFoundContent: '暂无数据',
1069
+ allowClear: true,
1070
+ showSearch: true,
1071
+ showArrow: true,
1072
+ maxTagCount: 1,
1073
+ optionFilterProp: 'children',
1074
+ filterOption: (input: string, option: { props: { children: string } }) =>
1075
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1076
+ },
1077
+ } },
1078
+ { name: 'qp-recordChannnelCode-in', type: 'select', label: '单号获取通道', initialSource: getDictionarySource('BSC00004') },
1079
+ { name: 'qp-arrivalPaySupport-in', type: 'select', label: '是否支持到付', initialSource: arrivalPaySupportList },
1080
+ { name: 'qp-sheetTemplateCode-in', type: 'select', label: '面单模板', field: {
1081
+ type: 'select',
1082
+ props: {
1083
+ mode: 'multiple',
1084
+ notFoundContent: '暂无数据',
1085
+ allowClear: true,
1086
+ showSearch: true,
1087
+ showArrow: true,
1088
+ maxTagCount: 1,
1089
+ optionFilterProp: 'children',
1090
+ filterOption: (input: string, option: { props: { children: string } }) =>
1091
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1092
+ },
1093
+ } },
1094
+ { name: 'qp-remark-like', label: '备注' },
1095
+ ]
1096
+ Promise.all([
1097
+ loadSelectSource(`${prefixUrl.formSelectFix}/logisCompany`, {
1098
+ pageSize: 5000,
1099
+ currentPage: 1,
1100
+ }),
1101
+ loadSelectSource(`${prefixUrl.formSelectFix}/printTemplate`, {
1102
+ pageSize: 5000,
1103
+ currentPage: 1,
1104
+ })
1105
+ ]).then((x: any)=>{
1106
+ formatSource(x,0, 2, tableSearchForm);
1107
+ formatSource(x,1, 5, tableSearchForm);
1108
+ })
1109
+ modalTableProps = {
1110
+ modalTableTitle: '选择配送方式',
1111
+ tableSearchForm,
1112
+ tableColumns: [
1113
+ {
1114
+ title: '配送方式编码',
1115
+ dataIndex: 'code',
1116
+ },
1117
+ {
1118
+ title: '配送方式名称',
1119
+ dataIndex: 'name',
1120
+ },
1121
+ {
1122
+ title: '所属物流商',
1123
+ dataIndex: 'logisCompanyName',
1124
+ },
1125
+ {
1126
+ dataIndex: 'recordChannnelCode',
1127
+ title: '单号获取通道',
1128
+ render: (text: any) => getDictionaryTextByValue('BSC00004', text),
1129
+ },
1130
+ {
1131
+ dataIndex: 'arrivalPaySupport',
1132
+ title: '是否支持到付',
1133
+ render: (text: number) => arrivalPaySupportList.find((i: any) => i.value === text)?.text,
1134
+ },
1135
+ {
1136
+ dataIndex: 'sheetTemplateName',
1137
+ title: '面单模板',
1138
+ },
1139
+ {
1140
+ dataIndex: 'remark',
1141
+ title: '备注',
1142
+ },
1143
+ ],
1144
+ ...modalTableBusProps
1145
+ }
1146
+ }
1147
+
1148
+ return { modalTableProps, requestConfig, needModalTable };
1149
+ }