@bit-sun/business-component 1.1.37 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 +59 -28
  7. package/README.md +27 -27
  8. package/dist/index.esm.js +2525 -3854
  9. package/dist/index.js +2525 -3854
  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 +1365 -1148
  16. package/src/components/Business/SearchSelect/common.ts +34 -34
  17. package/src/components/Business/SearchSelect/index.md +1107 -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 +672 -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 +715 -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,1365 @@
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
+ let modalTableProps = {
61
+ modalTableTitle: '',
62
+ tableSearchForm,
63
+ tableColumns: [],
64
+ ...modalTableBusProps,
65
+ }
66
+ let 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-approveStatus-eq': 1,
246
+ 'qp-type-eq': 10, // 查唯一国际条码
247
+ sorter: 'desc-id'
248
+ }, // 默认参数
249
+ sourceName: 'skuCode',
250
+ ...requestConfigProp,
251
+ }
252
+ tableSearchForm = requestConfig.url.includes('v2') ? [
253
+ requestConfig.url.includes('v2') ? { name: 'qp-skuName-like', label: 'SKU名称' } : { name: 'qp-name-like', label: 'SKU名称' },
254
+ { name: 'qp-skuCode-like', label: 'SKU编码' },
255
+ requestConfig.url.includes('v2') ? { name: 'qp-code-like', label: '国际条码' } : { name: 'qp-barCode-like', label: '国际条码'},
256
+ { name: 'qp-itemName-like', label: '所属SPU名称' },
257
+ { name: 'qp-itemCode-like', label: '所属SPU编码' },
258
+ requestConfig.url.includes('v2') ?{ name: 'qp-externalCode-like', label: '外部编码' } : null,
259
+ requestConfig.url.includes('v2') ? { name: 'qp-propertyValueCode-in', type: 'businessSearchSelect', label: '规格', field: {
260
+ type: 'businessSearchSelect',
261
+ props: {
262
+ selectBusinessType: 'skuPropertyValue',
263
+ selectProps: {
264
+ mode: 'multiple',
265
+ maxTagCount: 1,
266
+ },
267
+ ...(requestConfigProp?.skuPropertyValueRequestConfig || { prefixUrl }), // 可自定义此处规格请求接口相关参数,默认前缀取自sku选择器
268
+ },
269
+ }
270
+ } : null,
271
+ { name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
272
+ type: 'select',
273
+ props: {
274
+ mode: 'multiple',
275
+ notFoundContent: '暂无数据',
276
+ allowClear: true,
277
+ showSearch: true,
278
+ showArrow: true,
279
+ maxTagCount: 1,
280
+ optionFilterProp: 'children',
281
+ filterOption: (input: string, option: { props: { children: string } }) =>
282
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
283
+ },
284
+ } },
285
+ { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
286
+ type: 'treeSelect',
287
+ props: {
288
+ treeData: [],
289
+ treeCheckable: true,
290
+ showSearch: true,
291
+ allowClear: true,
292
+ showArrow: true,
293
+ treeNodeFilterProp: 'title',
294
+ treeDefaultExpandAll: true,
295
+ maxTagCount: 1,
296
+ placeholder: '请选择',
297
+ style: {
298
+ width: '100%',
299
+ },
300
+ dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
301
+ },
302
+ } },
303
+ { name: 'qp-classId-in', type: 'select', label: '品类', field: {
304
+ type: 'select',
305
+ props: {
306
+ mode: 'multiple',
307
+ notFoundContent: '暂无数据',
308
+ allowClear: true,
309
+ showSearch: true,
310
+ showArrow: true,
311
+ maxTagCount: 1,
312
+ optionFilterProp: 'children',
313
+ filterOption: (input: string, option: { props: { children: string } }) =>
314
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
315
+ },
316
+ } },
317
+ ] : [
318
+ { name: 'qp-name-like', label: 'SKU名称' },
319
+ { name: 'qp-skuCode-like', label: 'SKU编码' },
320
+ { name: 'qp-barCode-like', label: '国际条码'},
321
+ { name: 'qp-itemName-like', label: '所属SPU名称' },
322
+ { name: 'qp-itemCode-like', label: '所属SPU编码' },
323
+ { name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
324
+ type: 'select',
325
+ props: {
326
+ mode: 'multiple',
327
+ notFoundContent: '暂无数据',
328
+ allowClear: true,
329
+ showSearch: true,
330
+ showArrow: true,
331
+ maxTagCount: 1,
332
+ optionFilterProp: 'children',
333
+ filterOption: (input: string, option: { props: { children: string } }) =>
334
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
335
+ },
336
+ } },
337
+ { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
338
+ type: 'treeSelect',
339
+ props: {
340
+ treeData: [],
341
+ treeCheckable: true,
342
+ showSearch: true,
343
+ allowClear: true,
344
+ showArrow: true,
345
+ treeNodeFilterProp: 'title',
346
+ treeDefaultExpandAll: true,
347
+ maxTagCount: 1,
348
+ placeholder: '请选择',
349
+ style: {
350
+ width: '100%',
351
+ },
352
+ dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
353
+ },
354
+ } },
355
+ { name: 'qp-classId-in', type: 'select', label: '品类', field: {
356
+ type: 'select',
357
+ props: {
358
+ mode: 'multiple',
359
+ notFoundContent: '暂无数据',
360
+ allowClear: true,
361
+ showSearch: true,
362
+ showArrow: true,
363
+ maxTagCount: 1,
364
+ optionFilterProp: 'children',
365
+ filterOption: (input: string, option: { props: { children: string } }) =>
366
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
367
+ },
368
+ } },
369
+ ]
370
+ Promise.all([
371
+ loadSelectSource(`${prefixUrl.formSelectFix}/brand/queryBrandList`, {
372
+ pageSize: 5000,
373
+ currentPage: 1,
374
+ }),
375
+ loadSelectSource(`${prefixUrl.formSelectFix}/category/queryCategoryTree`, {
376
+ pageSize: 5000,
377
+ currentPage: 1,
378
+ }),
379
+ loadSelectSource(`${prefixUrl.formSelectFix}/class/withProperty`, {
380
+ pageSize: 5000,
381
+ currentPage: 1,
382
+ }),
383
+ ]).then((x: any)=>{
384
+ requestConfig.url.includes('v2') ? formatSource(x,0, 7, tableSearchForm,['id','name']) : formatSource(x,0, 5, tableSearchForm,['id','name'])
385
+ requestConfig.url.includes('v2') ? formatTreeDataSource(x,1, 8, tableSearchForm) : formatTreeDataSource(x,1, 6, tableSearchForm)
386
+ requestConfig.url.includes('v2') ? formatSource(x,2, 9, tableSearchForm,['id','name']) : formatSource(x,2, 7, tableSearchForm,['id','name'])
387
+ })
388
+ modalTableProps = {
389
+ modalTableTitle: '选择SKU',
390
+ tableSearchForm,
391
+ tableColumns: requestConfig.url.includes('v2') ? [
392
+ {
393
+ title: 'SKU编码',
394
+ dataIndex: 'skuCode',
395
+ },
396
+ {
397
+ title: 'SKU名称',
398
+ dataIndex: 'name',
399
+ },
400
+ {
401
+ title: '国际条码',
402
+ dataIndex: 'barCode',
403
+ },
404
+ {
405
+ title: '所属SPU名称',
406
+ dataIndex: 'itemName',
407
+ },
408
+ {
409
+ title: '所属SPU编码',
410
+ dataIndex: 'itemCode',
411
+ },
412
+ requestConfig.url.includes('v2') ? {
413
+ title: '外部编码',
414
+ dataIndex: 'externalCode',
415
+ } : false,
416
+ {
417
+ title: '规格',
418
+ dataIndex: requestConfig.url.includes('v2') ? 'propertyNameAndValue' : 'skuSpec',
419
+ },
420
+ {
421
+ title: '类目',
422
+ dataIndex: 'categoryName',
423
+ },
424
+ {
425
+ title: '品类',
426
+ dataIndex: 'className',
427
+ },
428
+ {
429
+ title: '品牌',
430
+ dataIndex: 'brandName',
431
+ },
432
+ ] : [
433
+ {
434
+ title: 'SKU编码',
435
+ dataIndex: 'skuCode',
436
+ },
437
+ {
438
+ title: 'SKU名称',
439
+ dataIndex: 'name',
440
+ },
441
+ {
442
+ title: '国际条码',
443
+ dataIndex: 'barCode',
444
+ },
445
+ {
446
+ title: '所属SPU名称',
447
+ dataIndex: 'itemName',
448
+ },
449
+ {
450
+ title: '所属SPU编码',
451
+ dataIndex: 'itemCode',
452
+ },
453
+ {
454
+ title: '规格',
455
+ dataIndex: 'skuSpec',
456
+ },
457
+ {
458
+ title: '类目',
459
+ dataIndex: 'categoryName',
460
+ },
461
+ {
462
+ title: '品类',
463
+ dataIndex: 'className',
464
+ },
465
+ {
466
+ title: '品牌',
467
+ dataIndex: 'brandName',
468
+ },
469
+ ],
470
+ ...modalTableBusProps
471
+ }
472
+ }
473
+
474
+ // 商品选择器spu
475
+ if(type === 'spuCommodity') {
476
+ requestConfig = {
477
+ url: `${prefixUrl.selectPrefix}/item`,
478
+ filter: 'qp-itemCode,name-orGroup,like', // 过滤参数
479
+ mappingTextField: 'name',
480
+ mappingValueField: 'itemCode',
481
+ otherParams: {
482
+ 'qp-approveStatus-eq': 1, // 审核状态(0.待审批;1.审批通过;2.驳回;3.审批未通过)
483
+ sorter: 'desc-id'
484
+ }, // 默认参数
485
+ sourceName: 'itemCode',
486
+ ...requestConfigProp,
487
+ }
488
+ tableSearchForm = [
489
+ { name: 'qp-name-like', label: 'SPU名称' },
490
+ { name: 'qp-itemCode-like', label: 'SPU编码' },
491
+ { name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
492
+ type: 'select',
493
+ props: {
494
+ mode: 'multiple',
495
+ notFoundContent: '暂无数据',
496
+ allowClear: true,
497
+ showSearch: true,
498
+ showArrow: true,
499
+ maxTagCount: 1,
500
+ optionFilterProp: 'children',
501
+ filterOption: (input: string, option: { props: { children: string } }) =>
502
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
503
+ },
504
+ } },
505
+ { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
506
+ type: 'treeSelect',
507
+ props: {
508
+ treeData: [],
509
+ treeCheckable: true,
510
+ showSearch: true,
511
+ allowClear: true,
512
+ showArrow: true,
513
+ treeNodeFilterProp: 'title',
514
+ treeDefaultExpandAll: true,
515
+ maxTagCount: 1,
516
+ placeholder: '请选择',
517
+ style: {
518
+ width: '100%',
519
+ },
520
+ dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
521
+ },
522
+ } },
523
+ { name: 'qp-classId-in', type: 'select', label: '品类', field: {
524
+ type: 'select',
525
+ props: {
526
+ mode: 'multiple',
527
+ notFoundContent: '暂无数据',
528
+ allowClear: true,
529
+ showSearch: true,
530
+ showArrow: true,
531
+ maxTagCount: 1,
532
+ optionFilterProp: 'children',
533
+ filterOption: (input: string, option: { props: { children: string } }) =>
534
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
535
+ },
536
+ } },
537
+ ]
538
+ Promise.all([
539
+ loadSelectSource(`${prefixUrl.formSelectFix}/brand/queryBrandList`, {
540
+ pageSize: 5000,
541
+ currentPage: 1,
542
+ }),
543
+ loadSelectSource(`${prefixUrl.formSelectFix}/category/queryCategoryTree`, {
544
+ pageSize: 5000,
545
+ currentPage: 1,
546
+ }),
547
+ loadSelectSource(`${prefixUrl.formSelectFix}/class/withProperty`, {
548
+ pageSize: 5000,
549
+ currentPage: 1,
550
+ }),
551
+ ]).then((x: any)=>{
552
+ formatSource(x,0, 2, tableSearchForm,['id','name']);
553
+ formatTreeDataSource(x,1, 3, tableSearchForm);
554
+ formatSource(x,2, 4, tableSearchForm,['id','name']);
555
+ })
556
+ modalTableProps = {
557
+ modalTableTitle: '选择SPU',
558
+ tableSearchForm,
559
+ tableColumns: [
560
+ {
561
+ title: 'SPU编码',
562
+ dataIndex: 'itemCode',
563
+ },
564
+ {
565
+ title: 'SPU名称',
566
+ dataIndex: 'name',
567
+ },
568
+ {
569
+ title: '品牌',
570
+ dataIndex: 'brandName',
571
+ },
572
+ {
573
+ title: '类目',
574
+ dataIndex: 'categoryText',
575
+ },
576
+ {
577
+ title: '品类',
578
+ dataIndex: 'className',
579
+ },
580
+ ],
581
+ ...modalTableBusProps
582
+ }
583
+ }
584
+
585
+ // 商品规格选择器(无弹窗)
586
+ if(type === 'skuPropertyValue') {
587
+ requestConfig = {
588
+ url: `${prefixUrl.selectPrefix}/skuPropertyValue/list`,
589
+ filter: 'qp-value-like', // 过滤参数
590
+ mappingTextField: 'value',
591
+ mappingTextShowKeyField: 'propertyValueCode',
592
+ mappingValueField: 'propertyValueCode',
593
+ otherParams: {
594
+ sorter: 'desc-id'
595
+ }, // 默认参数
596
+ sourceName: 'qp-propertyValueCode-in',
597
+ ...requestConfigProp,
598
+ }
599
+ needModalTable = false
600
+ }
601
+
602
+ // 仓库选择器(物理、逻辑仓)
603
+ if(type === 'physicalWarehouse') {
604
+ requestConfig = {
605
+ url: `${prefixUrl.selectPrefix}/physicalWarehouse`,
606
+ filter: 'qp-physicalWarehouseName,physicalWarehouseCode-orGroup,like', // 过滤参数
607
+ mappingTextField: 'physicalWarehouseName',
608
+ mappingTextShowKeyField: 'physicalWarehouseCode',
609
+ mappingValueField: 'id',
610
+ otherParams: {
611
+ 'qp-isEnable-eq': 1,
612
+ sorter: 'desc-id'
613
+ }, // 默认参数
614
+ sourceName: 'warehouseIds',
615
+ ...requestConfigProp,
616
+ }
617
+ tableSearchForm = [
618
+ { name: 'qp-physicalWarehouseName-like', label: '物理仓名称' },
619
+ { name: 'qp-physicalWarehouseCode-like', label: '物理仓编码' },
620
+ { name: 'qp-physicalWarehouseType-eq', type: 'select', label: '物理仓类型', initialSource: getDictionarySource('SC00002') },
621
+ { name: 'qp-companyCode-eq', type: 'select', label: '所属公司', field: {
622
+ type: 'select',
623
+ props: {
624
+ mode: 'multiple',
625
+ notFoundContent: '暂无数据',
626
+ allowClear: true,
627
+ showSearch: true,
628
+ showArrow: true,
629
+ maxTagCount: 1,
630
+ optionFilterProp: 'children',
631
+ filterOption: (input: string, option: { props: { children: string } }) =>
632
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
633
+ },
634
+ } },
635
+ ]
636
+ Promise.all([
637
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
638
+ pageSize: 5000,
639
+ currentPage: 1,
640
+ 'qp-companyType-eq': 20,
641
+ }),
642
+ ]).then((x: any)=>{
643
+ formatSource(x,0, 3, tableSearchForm);
644
+ })
645
+ modalTableProps = {
646
+ modalTableTitle: '选择物理仓',
647
+ tableSearchForm,
648
+ tableColumns: [
649
+ {
650
+ title: '物理仓编码',
651
+ dataIndex: 'physicalWarehouseCode',
652
+ },
653
+ {
654
+ title: '物理仓名称',
655
+ dataIndex: 'physicalWarehouseName',
656
+ },
657
+ {
658
+ title: '物理仓类型',
659
+ dataIndex: 'physicalWarehouseType',
660
+ render: (text: number) => getDictionaryTextByValue('SC00002', text),
661
+ },
662
+ {
663
+ title: '所属公司',
664
+ dataIndex: 'companyName',
665
+ },
666
+ ],
667
+ ...modalTableBusProps
668
+ }
669
+ }
670
+ if(type === 'realWarehouse') {
671
+ requestConfig = {
672
+ url: `${prefixUrl.selectPrefix}/realWarehouse`,
673
+ filter: 'qp-realWarehouseName,realWarehouseCode-orGroup,like', // 过滤参数
674
+ mappingTextField: 'realWarehouseName',
675
+ mappingTextShowKeyField: 'realWarehouseCode',
676
+ mappingValueField: 'id',
677
+ otherParams: {
678
+ 'qp-isEnable-eq': 1,
679
+ sorter: 'desc-id'
680
+ }, // 默认参数
681
+ sourceName: 'warehouseIds',
682
+ ...requestConfigProp,
683
+ }
684
+ tableSearchForm = [
685
+ { name: 'qp-realWarehouseName-like', label: '逻辑仓名称' },
686
+ { name: 'qp-realWarehouseCode-like', label: '逻辑仓编码' },
687
+ { name: 'qp-realWarehouseType-eq', type: 'select', label: '逻辑仓类型', initialSource: getDictionarySource('SC00004') },
688
+ ]
689
+ modalTableProps = {
690
+ modalTableTitle: '选择逻辑仓',
691
+ tableSearchForm,
692
+ tableColumns: [
693
+ {
694
+ title: '逻辑仓编码',
695
+ dataIndex: 'realWarehouseCode',
696
+ },
697
+ {
698
+ title: '逻辑仓名称',
699
+ dataIndex: 'realWarehouseName',
700
+ },
701
+ {
702
+ title: '逻辑仓类型',
703
+ dataIndex: 'realWarehouseType',
704
+ render: (text: number) => getDictionaryTextByValue('SC00004', text),
705
+ },
706
+ ],
707
+ ...modalTableBusProps,
708
+ }
709
+ }
710
+
711
+ // 仓库选择器(虚拟、渠道仓)(无弹窗)
712
+ if(type === 'virtualWarehouse') {
713
+ requestConfig = {
714
+ url: `${prefixUrl.selectPrefix}/virtualWarehouse`,
715
+ filter: 'qp-virtualWarehouseName,virtualWarehouseCode-orGroup,like', // 过滤参数
716
+ mappingTextField: 'virtualWarehouseName',
717
+ mappingTextShowKeyField: 'virtualWarehouseCode',
718
+ mappingValueField: 'id',
719
+ otherParams: {
720
+ 'qp-isEnable-eq': 1,
721
+ sorter: 'desc-id'
722
+ }, // 默认参数
723
+ sourceName: 'warehouseIds',
724
+ ...requestConfigProp,
725
+ }
726
+ needModalTable = false
727
+ }
728
+ if(type === 'channelWarehouse') {
729
+ requestConfig = {
730
+ url: `${prefixUrl.selectPrefix}/channelWarehouse`,
731
+ filter: 'qp-channelWarehouseName,channelWarehouseCode-orGroup,like', // 过滤参数
732
+ mappingTextField: 'channelWarehouseName',
733
+ mappingTextShowKeyField: 'channelWarehouseCode',
734
+ mappingValueField: 'id',
735
+ otherParams: {
736
+ 'qp-isEnable-eq': 1,
737
+ sorter: 'desc-id'
738
+ }, // 默认参数
739
+ sourceName: 'warehouseIds',
740
+ ...requestConfigProp,
741
+ }
742
+ needModalTable = false
743
+ }
744
+
745
+ // 客户选择器
746
+ if(type === 'customer') {
747
+ requestConfig = {
748
+ url: `${prefixUrl.selectPrefix}/uc/customer/v2`,
749
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
750
+ mappingTextField: 'name',
751
+ mappingValueField: 'code',
752
+ otherParams: {
753
+ sorter: 'desc-id'
754
+ }, // 默认参数
755
+ sourceName: 'customCode',
756
+ ...requestConfigProp,
757
+ }
758
+ tableSearchForm = [
759
+ { name: 'qp-name-like', label: '客户名称' },
760
+ { name: 'qp-code-like', label: '客户编码' },
761
+ { name: 'qp-conglomerateCode-in', type: 'select', label: '归属集团', field: {
762
+ type: 'select',
763
+ props: {
764
+ mode: 'multiple',
765
+ notFoundContent: '暂无数据',
766
+ allowClear: true,
767
+ showSearch: true,
768
+ showArrow: true,
769
+ maxTagCount: 1,
770
+ optionFilterProp: 'children',
771
+ filterOption: (input: string, option: { props: { children: string } }) =>
772
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
773
+ },
774
+ } },
775
+ { name: 'qp-accountingCode-in', type: 'select', label: '归属核算主体', field: {
776
+ type: 'select',
777
+ props: {
778
+ mode: 'multiple',
779
+ notFoundContent: '暂无数据',
780
+ allowClear: true,
781
+ showSearch: true,
782
+ showArrow: true,
783
+ maxTagCount: 1,
784
+ optionFilterProp: 'children',
785
+ filterOption: (input: string, option: { props: { children: string } }) =>
786
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
787
+ },
788
+ } },
789
+ { name: 'qp-companyCode-in', type: 'select', label: '归属法人公司', field: {
790
+ type: 'select',
791
+ props: {
792
+ mode: 'multiple',
793
+ notFoundContent: '暂无数据',
794
+ allowClear: true,
795
+ showSearch: true,
796
+ showArrow: true,
797
+ maxTagCount: 1,
798
+ optionFilterProp: 'children',
799
+ filterOption: (input: string, option: { props: { children: string } }) =>
800
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
801
+ },
802
+ } },
803
+ { name: 'qp-sharingType-eq', type: 'select', label: '共享类型', initialSource: sharingTypeDataList },
804
+ ]
805
+ Promise.all([
806
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
807
+ pageSize: 5000,
808
+ currentPage: 1,
809
+ 'qp-companyType-eq': '30',
810
+ }),
811
+ loadSelectSource(`${prefixUrl.formSelectFix}/accountingSubject`, {
812
+ pageSize: 5000,
813
+ currentPage: 1,
814
+ }),
815
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
816
+ pageSize: 5000,
817
+ currentPage: 1,
818
+ 'qp-companyType-eq': '20',
819
+ })
820
+ ]).then((x: any)=>{
821
+ formatSource(x,0, 2, tableSearchForm);
822
+ formatSource(x,1, 3, tableSearchForm);
823
+ formatSource(x,2, 4, tableSearchForm);
824
+ })
825
+ modalTableProps = {
826
+ modalTableTitle: '选择客户',
827
+ tableSearchForm,
828
+ tableColumns: [
829
+ {
830
+ title: '客户编码',
831
+ dataIndex: 'code',
832
+ },
833
+ {
834
+ title: '客户名称',
835
+ dataIndex: 'name',
836
+ },
837
+ {
838
+ title: '归属集团',
839
+ dataIndex: 'conglomerateName',
840
+ },
841
+ {
842
+ title: '归属法人公司',
843
+ dataIndex: 'legalCompanyName',
844
+ },
845
+ {
846
+ title: '归属核算主体',
847
+ dataIndex: 'accountingName',
848
+ },
849
+ {
850
+ title: '共享类型',
851
+ dataIndex: 'sharingType',
852
+ render: (text: number) => hasDictSharingType ? getDictionaryTextByValue('UC000013', text) : sharingType.find((i: any) => i.value === text)?.text,
853
+ },
854
+ ],
855
+ ...modalTableBusProps
856
+ }
857
+ }
858
+ if(type === 'customer2') {
859
+ // 版本2
860
+ requestConfig = {
861
+ url: `${prefixUrl.selectPrefix}/customer`,
862
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
863
+ mappingTextField: 'name',
864
+ mappingValueField: 'code',
865
+ otherParams: {
866
+ sorter: 'desc-id'
867
+ }, // 默认参数
868
+ sourceName: 'customCode',
869
+ ...requestConfigProp,
870
+ }
871
+ tableSearchForm = [
872
+ { name: 'qp-name-like', label: '客户名称' },
873
+ { name: 'qp-code-like', label: '客户编码' },
874
+ { name: 'qp-createOrgCode-eq', type: 'select', label: '创建组织', field: {
875
+ type: 'select',
876
+ props: {
877
+ // mode: 'multiple',
878
+ notFoundContent: '暂无数据',
879
+ allowClear: true,
880
+ showSearch: true,
881
+ showArrow: true,
882
+ // maxTagCount: 1,
883
+ optionFilterProp: 'children',
884
+ filterOption: (input: string, option: { props: { children: string } }) =>
885
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
886
+ },
887
+ } },
888
+ { name: 'qp-salesOrgCode-eq', type: 'select', label: '使用组织', field: {
889
+ type: 'select',
890
+ props: {
891
+ // mode: 'multiple',
892
+ notFoundContent: '暂无数据',
893
+ allowClear: true,
894
+ showSearch: true,
895
+ showArrow: true,
896
+ // maxTagCount: 1,
897
+ optionFilterProp: 'children',
898
+ filterOption: (input: string, option: { props: { children: string } }) =>
899
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
900
+ },
901
+ } },
902
+ ]
903
+ Promise.all([
904
+ loadSelectSource(`${prefixUrl.formSelectFix}/org/listNoPage`, {}),
905
+ loadSelectSource(`${prefixUrl.formSelectFix}/org/listNoPage`,{}),
906
+ ]).then((x: any)=>{
907
+ formatSource(x,0, 2, tableSearchForm);
908
+ formatSource(x,1, 3, tableSearchForm);
909
+ })
910
+ modalTableProps = {
911
+ modalTableTitle: '选择客户',
912
+ tableSearchForm,
913
+ tableColumns: [
914
+ {
915
+ title: '客户编码',
916
+ dataIndex: 'code',
917
+ },
918
+ {
919
+ title: '客户名称',
920
+ dataIndex: 'name',
921
+ },
922
+ {
923
+ title: '创建组织',
924
+ dataIndex: 'createOrgName',
925
+ },
926
+ {
927
+ title: '使用组织',
928
+ dataIndex: 'salesOrgName',
929
+ },
930
+ ],
931
+ ...modalTableBusProps
932
+ }
933
+ }
934
+
935
+ // 店铺选择器
936
+ if(type === 'shopFile') {
937
+ requestConfig = {
938
+ url: `${prefixUrl.selectPrefix}/store`,
939
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
940
+ mappingTextField: 'name',
941
+ mappingValueField: 'code',
942
+ otherParams: {
943
+ sorter: 'desc-id'
944
+ }, // 默认参数
945
+ sourceName: 'code',
946
+ ...requestConfigProp,
947
+ }
948
+ tableSearchForm = [
949
+ { name: 'qp-name-like', label: '店铺名称' },
950
+ { name: 'qp-code-like', label: '店铺编码' },
951
+ { name: 'qp-conglomerateCode-in', type: 'select', label: '归属集团', field: {
952
+ type: 'select',
953
+ props: {
954
+ mode: 'multiple',
955
+ notFoundContent: '暂无数据',
956
+ allowClear: true,
957
+ showSearch: true,
958
+ showArrow: true,
959
+ maxTagCount: 1,
960
+ optionFilterProp: 'children',
961
+ filterOption: (input: string, option: { props: { children: string } }) =>
962
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
963
+ },
964
+ } },
965
+ { name: 'qp-companyCode-in', type: 'select', label: '归属法人公司', field: {
966
+ type: 'select',
967
+ props: {
968
+ mode: 'multiple',
969
+ notFoundContent: '暂无数据',
970
+ allowClear: true,
971
+ showSearch: true,
972
+ showArrow: true,
973
+ maxTagCount: 1,
974
+ optionFilterProp: 'children',
975
+ filterOption: (input: string, option: { props: { children: string } }) =>
976
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
977
+ },
978
+ } },
979
+ { name: 'qp-type-in', type: 'select', label: '店铺类型', initialSource: shopFileType },
980
+ { name: 'qp-plateformCode-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-accountingCode-in', type: 'select', label: '归属核算主体', field: {
995
+ type: 'select',
996
+ props: {
997
+ mode: 'multiple',
998
+ notFoundContent: '暂无数据',
999
+ allowClear: true,
1000
+ showSearch: true,
1001
+ showArrow: true,
1002
+ maxTagCount: 1,
1003
+ optionFilterProp: 'children',
1004
+ filterOption: (input: string, option: { props: { children: string } }) =>
1005
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1006
+ },
1007
+ } },
1008
+ ]
1009
+ Promise.all([
1010
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
1011
+ pageSize: 5000,
1012
+ currentPage: 1,
1013
+ 'qp-companyType-eq': '30',
1014
+ }),
1015
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
1016
+ pageSize: 5000,
1017
+ currentPage: 1,
1018
+ 'qp-companyType-eq': '20',
1019
+ }),
1020
+ loadSelectSource(`${prefixUrl.formSelectFix}/platformRecord/getPlatformRecordList`, {
1021
+ // pageSize: 5000,
1022
+ // currentPage: 1,
1023
+ 'qp-status-eq': '1',
1024
+ }),
1025
+ loadSelectSource(`${prefixUrl.formSelectFix}/accountingSubject`, {
1026
+ pageSize: 5000,
1027
+ currentPage: 1,
1028
+ }),
1029
+ ]).then((x: any)=>{
1030
+ formatSource(x,0, 2, tableSearchForm);
1031
+ formatSource(x,1, 3, tableSearchForm);
1032
+ formatSource(x,2, 5, tableSearchForm);
1033
+ formatSource(x,3, 6, tableSearchForm);
1034
+ })
1035
+ modalTableProps = {
1036
+ modalTableTitle: '选择店铺',
1037
+ tableSearchForm,
1038
+ tableColumns: [
1039
+ {
1040
+ title: '店铺编码',
1041
+ dataIndex: 'code',
1042
+ },
1043
+ {
1044
+ title: '店铺名称',
1045
+ dataIndex: 'name',
1046
+ },
1047
+ {
1048
+ title: '归属集团',
1049
+ dataIndex: 'conglomerateName',
1050
+ },
1051
+ {
1052
+ title: '归属法人公司',
1053
+ dataIndex: 'companyName',
1054
+ },
1055
+ {
1056
+ title: '店铺类型',
1057
+ dataIndex: 'type',
1058
+ render: (text: number) => shopFileType.find((i: any) => i.value === text)?.text,
1059
+ },
1060
+ {
1061
+ title: '店铺来源',
1062
+ dataIndex: 'platformName',
1063
+ },
1064
+ {
1065
+ title: '归属核算主体',
1066
+ dataIndex: 'accountingName',
1067
+ },
1068
+ ],
1069
+ ...modalTableBusProps
1070
+ }
1071
+ }
1072
+
1073
+ // 核算主体选择器(无弹窗)
1074
+ if(type === 'accountingSubject') {
1075
+ requestConfig = {
1076
+ url: `${prefixUrl.selectPrefix}/accountingSubject`,
1077
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
1078
+ mappingTextField: 'name',
1079
+ mappingTextShowKeyField: 'code',
1080
+ mappingValueField: 'id',
1081
+ otherParams: {
1082
+ sorter: 'desc-id'
1083
+ }, // 默认参数
1084
+ sourceName: 'accountingSubjectCode',
1085
+ ...requestConfigProp,
1086
+ }
1087
+ needModalTable = false
1088
+ }
1089
+ // 库存组织选择器(无弹窗)
1090
+ if(type === 'inventoryOrg') {
1091
+ requestConfig = {
1092
+ url: `${prefixUrl.selectPrefix}/inventoryOrg`,
1093
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
1094
+ mappingTextField: 'name',
1095
+ mappingTextShowKeyField: 'code',
1096
+ mappingValueField: 'id',
1097
+ otherParams: {
1098
+ sorter: 'desc-id'
1099
+ }, // 默认参数
1100
+ sourceName: 'inventoryOrgCode',
1101
+ ...requestConfigProp,
1102
+ }
1103
+ needModalTable = false
1104
+ }
1105
+ // 法人公司选择器(无弹窗)
1106
+ if(type === 'corporationCompany') {
1107
+ requestConfig = {
1108
+ url: `${prefixUrl.selectPrefix}/company`,
1109
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
1110
+ mappingTextField: 'name',
1111
+ mappingTextShowKeyField: 'code',
1112
+ mappingValueField: 'id',
1113
+ otherParams: {
1114
+ sorter: 'desc-id'
1115
+ }, // 默认参数
1116
+ sourceName: 'corporationCompany',
1117
+ ...requestConfigProp,
1118
+ }
1119
+ needModalTable = false
1120
+ }
1121
+
1122
+ // 员工选择器
1123
+ if(type === 'employee') {
1124
+ requestConfig = {
1125
+ url: `${prefixUrl.selectPrefix}/employee/v2`,
1126
+ filter: 'qp-employeeNumber,name-orGroup,like', // 过滤参数
1127
+ mappingTextField: 'name',
1128
+ mappingTextShowKeyField: 'employeeNumber',
1129
+ mappingValueField: 'employeeNumber',
1130
+ otherParams: {
1131
+ 'qp-enable-eq': 10, // 启用状态 10-启用,20-禁用
1132
+ sorter: 'desc-id'
1133
+ }, // 默认参数
1134
+ sourceName: 'employeeNumber',
1135
+ ...requestConfigProp,
1136
+ }
1137
+ tableSearchForm = [
1138
+ { name: 'qp-name-like', label: '员工名称' },
1139
+ { name: 'qp-employeeNumber-like', label: '员工编码' },
1140
+ { name: 'qp-companyCode-in', type: 'select', label: '所属公司', field: {
1141
+ type: 'select',
1142
+ props: {
1143
+ mode: 'multiple',
1144
+ notFoundContent: '暂无数据',
1145
+ allowClear: true,
1146
+ showSearch: true,
1147
+ showArrow: true,
1148
+ maxTagCount: 1,
1149
+ optionFilterProp: 'children',
1150
+ filterOption: (input: string, option: { props: { children: string } }) =>
1151
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1152
+ },
1153
+ } },
1154
+ { name: 'qp-email-like', label: '邮箱' },
1155
+ { name: 'qp-officeTelephone-like', label: '手机号' },
1156
+ ]
1157
+ Promise.all([
1158
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
1159
+ pageSize: 5000,
1160
+ currentPage: 1,
1161
+ 'qp-companyType-eq': 20,
1162
+ }),
1163
+ ]).then((x: any)=>{
1164
+ formatSource(x,0, 2, tableSearchForm);
1165
+ })
1166
+ modalTableProps = {
1167
+ modalTableTitle: '选择员工',
1168
+ tableSearchForm,
1169
+ tableColumns: [
1170
+ {
1171
+ title: '员工编码',
1172
+ dataIndex: 'employeeNumber',
1173
+ },
1174
+ {
1175
+ title: '员工名称',
1176
+ dataIndex: 'name',
1177
+ },
1178
+ {
1179
+ title: '所属公司',
1180
+ dataIndex: 'companyName',
1181
+ },
1182
+ {
1183
+ title: '邮箱',
1184
+ dataIndex: 'email',
1185
+ },
1186
+ {
1187
+ title: '手机号',
1188
+ dataIndex: 'officeTelephone',
1189
+ },
1190
+ ],
1191
+ ...modalTableBusProps
1192
+ }
1193
+ }
1194
+ if(type === 'employee2') {
1195
+ // 版本2
1196
+ requestConfig = {
1197
+ url: `${prefixUrl.selectPrefix}/employee/pageList/v2`,
1198
+ filter: 'qp-employeeNumber,name-orGroup,like', // 过滤参数
1199
+ mappingTextField: 'name',
1200
+ mappingTextShowKeyField: 'employeeNumber',
1201
+ mappingValueField: 'id',
1202
+ otherParams: {
1203
+ 'qp-enable-eq': 10, // 启用状态 10-启用,20-禁用
1204
+ sorter: 'desc-id'
1205
+ }, // 默认参数
1206
+ sourceName: 'employeeNumber',
1207
+ ...requestConfigProp,
1208
+ }
1209
+ tableSearchForm = [
1210
+ { name: 'qp-name-like', label: '员工名称' },
1211
+ { name: 'qp-employeeNumber-like', label: '员工编码' },
1212
+ { name: 'qp-directOrgCode-in', type: 'select', label: '所属组织机构', field: {
1213
+ type: 'select',
1214
+ props: {
1215
+ mode: 'multiple',
1216
+ notFoundContent: '暂无数据',
1217
+ allowClear: true,
1218
+ showSearch: true,
1219
+ showArrow: true,
1220
+ maxTagCount: 1,
1221
+ optionFilterProp: 'children',
1222
+ filterOption: (input: string, option: { props: { children: string } }) =>
1223
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1224
+ },
1225
+ } },
1226
+ { name: 'qp-email-like', label: '邮箱' },
1227
+ { name: 'qp-officeTelephone-like', label: '手机号' },
1228
+ ]
1229
+ Promise.all([
1230
+ loadSelectSource(`${prefixUrl.formSelectFix}/org/listNoPage`, {}),
1231
+ ]).then((x: any)=>{
1232
+ formatSource(x,0, 2, tableSearchForm);
1233
+ })
1234
+ modalTableProps = {
1235
+ modalTableTitle: '选择员工',
1236
+ tableSearchForm,
1237
+ tableColumns: [
1238
+ {
1239
+ title: '员工编码',
1240
+ dataIndex: 'employeeNumber',
1241
+ },
1242
+ {
1243
+ title: '员工名称',
1244
+ dataIndex: 'name',
1245
+ },
1246
+ {
1247
+ title: '所属组织机构',
1248
+ dataIndex: 'directOrgName',
1249
+ },
1250
+ {
1251
+ title: '邮箱',
1252
+ dataIndex: 'email',
1253
+ },
1254
+ {
1255
+ title: '手机号',
1256
+ dataIndex: 'officeTelephone',
1257
+ },
1258
+ ],
1259
+ ...modalTableBusProps
1260
+ }
1261
+ }
1262
+
1263
+ // 配送方式选择器
1264
+ if(type === 'deliveryMode') {
1265
+ requestConfig = {
1266
+ url: `${prefixUrl.selectPrefix}/deliveryMode`,
1267
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
1268
+ mappingTextField: 'name',
1269
+ mappingTextShowKeyField: 'code',
1270
+ mappingValueField: 'code',
1271
+ otherParams: {
1272
+ sorter: 'desc-id'
1273
+ }, // 默认参数
1274
+ sourceName: 'deliveryModeCode',
1275
+ ...requestConfigProp
1276
+ }
1277
+ tableSearchForm = [
1278
+ { name: 'qp-name-like', label: '配送方式名称' },
1279
+ { name: 'qp-code-like', label: '配送方式编码' },
1280
+ { name: 'qp-logisCompanyCode-in', type: 'select', label: '所属物流商', field: {
1281
+ type: 'select',
1282
+ props: {
1283
+ mode: 'multiple',
1284
+ notFoundContent: '暂无数据',
1285
+ allowClear: true,
1286
+ showSearch: true,
1287
+ showArrow: true,
1288
+ maxTagCount: 1,
1289
+ optionFilterProp: 'children',
1290
+ filterOption: (input: string, option: { props: { children: string } }) =>
1291
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1292
+ },
1293
+ } },
1294
+ { name: 'qp-recordChannnelCode-in', type: 'select', label: '单号获取通道', initialSource: getDictionarySource('BSC00004') },
1295
+ { name: 'qp-arrivalPaySupport-in', type: 'select', label: '是否支持到付', initialSource: arrivalPaySupportList },
1296
+ { name: 'qp-sheetTemplateCode-in', type: 'select', label: '面单模板', field: {
1297
+ type: 'select',
1298
+ props: {
1299
+ mode: 'multiple',
1300
+ notFoundContent: '暂无数据',
1301
+ allowClear: true,
1302
+ showSearch: true,
1303
+ showArrow: true,
1304
+ maxTagCount: 1,
1305
+ optionFilterProp: 'children',
1306
+ filterOption: (input: string, option: { props: { children: string } }) =>
1307
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1308
+ },
1309
+ } },
1310
+ { name: 'qp-remark-like', label: '备注' },
1311
+ ]
1312
+ Promise.all([
1313
+ loadSelectSource(`${prefixUrl.formSelectFix}/logisCompany`, {
1314
+ pageSize: 5000,
1315
+ currentPage: 1,
1316
+ }),
1317
+ loadSelectSource(`${prefixUrl.formSelectFix}/printTemplate`, {
1318
+ pageSize: 5000,
1319
+ currentPage: 1,
1320
+ })
1321
+ ]).then((x: any)=>{
1322
+ formatSource(x,0, 2, tableSearchForm);
1323
+ formatSource(x,1, 5, tableSearchForm);
1324
+ })
1325
+ modalTableProps = {
1326
+ modalTableTitle: '选择配送方式',
1327
+ tableSearchForm,
1328
+ tableColumns: [
1329
+ {
1330
+ title: '配送方式编码',
1331
+ dataIndex: 'code',
1332
+ },
1333
+ {
1334
+ title: '配送方式名称',
1335
+ dataIndex: 'name',
1336
+ },
1337
+ {
1338
+ title: '所属物流商',
1339
+ dataIndex: 'logisCompanyName',
1340
+ },
1341
+ {
1342
+ dataIndex: 'recordChannnelCode',
1343
+ title: '单号获取通道',
1344
+ render: (text: any) => getDictionaryTextByValue('BSC00004', text),
1345
+ },
1346
+ {
1347
+ dataIndex: 'arrivalPaySupport',
1348
+ title: '是否支持到付',
1349
+ render: (text: number) => arrivalPaySupportList.find((i: any) => i.value === text)?.text,
1350
+ },
1351
+ {
1352
+ dataIndex: 'sheetTemplateName',
1353
+ title: '面单模板',
1354
+ },
1355
+ {
1356
+ dataIndex: 'remark',
1357
+ title: '备注',
1358
+ },
1359
+ ],
1360
+ ...modalTableBusProps
1361
+ }
1362
+ }
1363
+
1364
+ return { modalTableProps, requestConfig, needModalTable };
1365
+ }