@bit-sun/business-component 1.1.32 → 1.1.35

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 +3706 -2023
  9. package/dist/index.js +3706 -2023
  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 +1059 -1059
  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 -666
  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,1059 +1,1059 @@
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 = [
181
- { name: 'qp-skuName-like', label: 'SKU名称' },
182
- { name: 'qp-skuCode-like', label: 'SKU编码' },
183
- { name: 'qp-code-like', label: '国际条码' },
184
- { name: 'qp-itemName-like', label: '所属SPU名称' },
185
- { name: 'qp-itemCode-like', label: '所属SPU编码' },
186
- { name: 'qp-externalCode-like', label: '外部编码' },
187
- { 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
- },
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
- Promise.all([
246
- loadSelectSource(`${prefixUrl.formSelectFix}/brand/queryBrandList`, {
247
- pageSize: 5000,
248
- currentPage: 1,
249
- }),
250
- loadSelectSource(`${prefixUrl.formSelectFix}/category/queryCategoryTree`, {
251
- pageSize: 5000,
252
- currentPage: 1,
253
- }),
254
- loadSelectSource(`${prefixUrl.formSelectFix}/class/withProperty`, {
255
- pageSize: 5000,
256
- currentPage: 1,
257
- }),
258
- ]).then((x: any)=>{
259
- formatSource(x,0, 7, tableSearchForm,['id','name']);
260
- formatTreeDataSource(x,1, 8, tableSearchForm);
261
- formatSource(x,2, 9, tableSearchForm,['id','name']);
262
- })
263
- modalTableProps = {
264
- modalTableTitle: '选择SKU',
265
- tableSearchForm,
266
- tableColumns: [
267
- {
268
- title: 'SKU编码',
269
- dataIndex: 'skuCode',
270
- },
271
- {
272
- title: 'SKU名称',
273
- dataIndex: 'name',
274
- },
275
- {
276
- title: '国际条码',
277
- dataIndex: 'barCode',
278
- },
279
- {
280
- title: '所属SPU名称',
281
- dataIndex: 'itemName',
282
- },
283
- {
284
- title: '所属SPU编码',
285
- dataIndex: 'itemCode',
286
- },
287
- {
288
- title: '外部编码',
289
- dataIndex: 'externalCode',
290
- },
291
- {
292
- title: '规格',
293
- dataIndex: 'propertyNameAndValue',
294
- },
295
- {
296
- title: '类目',
297
- dataIndex: 'categoryName',
298
- },
299
- {
300
- title: '品类',
301
- dataIndex: 'className',
302
- },
303
- {
304
- title: '品牌',
305
- dataIndex: 'brandName',
306
- },
307
- ],
308
- ...modalTableBusProps
309
- }
310
- }
311
-
312
- // 商品选择器spu
313
- if(type === 'spuCommodity') {
314
- requestConfig = {
315
- url: `${prefixUrl.selectPrefix}/item`,
316
- filter: 'qp-itemCode,name-orGroup,like', // 过滤参数
317
- mappingTextField: 'name',
318
- mappingValueField: 'itemCode',
319
- otherParams: {
320
- 'qp-approveStatus-eq': 1, // 审核状态(0.待审批;1.审批通过;2.驳回;3.审批未通过)
321
- sorter: 'desc-id'
322
- }, // 默认参数
323
- sourceName: 'itemCode',
324
- ...requestConfigProp,
325
- }
326
- tableSearchForm = [
327
- { name: 'qp-name-like', label: 'SPU名称' },
328
- { name: 'qp-itemCode-like', label: 'SPU编码' },
329
- { name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
330
- type: 'select',
331
- props: {
332
- mode: 'multiple',
333
- notFoundContent: '暂无数据',
334
- allowClear: true,
335
- showSearch: true,
336
- showArrow: true,
337
- maxTagCount: 1,
338
- optionFilterProp: 'children',
339
- filterOption: (input: string, option: { props: { children: string } }) =>
340
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
341
- },
342
- } },
343
- { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
344
- type: 'treeSelect',
345
- props: {
346
- treeData: [],
347
- treeCheckable: true,
348
- showSearch: true,
349
- allowClear: true,
350
- showArrow: true,
351
- treeNodeFilterProp: 'title',
352
- treeDefaultExpandAll: true,
353
- maxTagCount: 1,
354
- placeholder: '请选择',
355
- style: {
356
- width: '100%',
357
- },
358
- dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
359
- },
360
- } },
361
- { name: 'qp-classId-in', type: 'select', label: '品类', field: {
362
- type: 'select',
363
- props: {
364
- mode: 'multiple',
365
- notFoundContent: '暂无数据',
366
- allowClear: true,
367
- showSearch: true,
368
- showArrow: true,
369
- maxTagCount: 1,
370
- optionFilterProp: 'children',
371
- filterOption: (input: string, option: { props: { children: string } }) =>
372
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
373
- },
374
- } },
375
- ]
376
- Promise.all([
377
- loadSelectSource(`${prefixUrl.formSelectFix}/brand/queryBrandList`, {
378
- pageSize: 5000,
379
- currentPage: 1,
380
- }),
381
- loadSelectSource(`${prefixUrl.formSelectFix}/category/queryCategoryTree`, {
382
- pageSize: 5000,
383
- currentPage: 1,
384
- }),
385
- loadSelectSource(`${prefixUrl.formSelectFix}/class/withProperty`, {
386
- pageSize: 5000,
387
- currentPage: 1,
388
- }),
389
- ]).then((x: any)=>{
390
- formatSource(x,0, 2, tableSearchForm,['id','name']);
391
- formatTreeDataSource(x,1, 3, tableSearchForm);
392
- formatSource(x,2, 4, tableSearchForm,['id','name']);
393
- })
394
- modalTableProps = {
395
- modalTableTitle: '选择SPU',
396
- tableSearchForm,
397
- tableColumns: [
398
- {
399
- title: 'SPU编码',
400
- dataIndex: 'itemCode',
401
- },
402
- {
403
- title: 'SPU名称',
404
- dataIndex: 'name',
405
- },
406
- {
407
- title: '品牌',
408
- dataIndex: 'brandName',
409
- },
410
- {
411
- title: '类目',
412
- dataIndex: 'categoryText',
413
- },
414
- {
415
- title: '品类',
416
- dataIndex: 'className',
417
- },
418
- ],
419
- ...modalTableBusProps
420
- }
421
- }
422
-
423
- // 商品规格选择器(无弹窗)
424
- if(type === 'skuPropertyValue') {
425
- requestConfig = {
426
- url: `${prefixUrl.selectPrefix}/skuPropertyValue/list`,
427
- filter: 'qp-value-like', // 过滤参数
428
- mappingTextField: 'value',
429
- mappingTextShowKeyField: 'propertyValueCode',
430
- mappingValueField: 'propertyValueCode',
431
- otherParams: {
432
- sorter: 'desc-id'
433
- }, // 默认参数
434
- sourceName: 'qp-propertyValueCode-in',
435
- ...requestConfigProp,
436
- }
437
- needModalTable = false
438
- }
439
-
440
- // 仓库选择器(物理、逻辑仓)
441
- if(type === 'physicalWarehouse') {
442
- requestConfig = {
443
- url: `${prefixUrl.selectPrefix}/physicalWarehouse`,
444
- filter: 'qp-physicalWarehouseName,physicalWarehouseCode-orGroup,like', // 过滤参数
445
- mappingTextField: 'physicalWarehouseName',
446
- mappingTextShowKeyField: 'physicalWarehouseCode',
447
- mappingValueField: 'id',
448
- otherParams: {
449
- 'qp-isEnable-eq': 1,
450
- sorter: 'desc-id'
451
- }, // 默认参数
452
- sourceName: 'warehouseIds',
453
- ...requestConfigProp,
454
- }
455
- tableSearchForm = [
456
- { name: 'qp-physicalWarehouseName-like', label: '物理仓名称' },
457
- { name: 'qp-physicalWarehouseCode-like', label: '物理仓编码' },
458
- { name: 'qp-physicalWarehouseType-eq', type: 'select', label: '物理仓类型', initialSource: getDictionarySource('SC00002') },
459
- { name: 'qp-companyCode-eq', type: 'select', label: '所属公司', field: {
460
- type: 'select',
461
- props: {
462
- mode: 'multiple',
463
- notFoundContent: '暂无数据',
464
- allowClear: true,
465
- showSearch: true,
466
- showArrow: true,
467
- maxTagCount: 1,
468
- optionFilterProp: 'children',
469
- filterOption: (input: string, option: { props: { children: string } }) =>
470
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
471
- },
472
- } },
473
- ]
474
- Promise.all([
475
- loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
476
- pageSize: 5000,
477
- currentPage: 1,
478
- 'qp-companyType-eq': 20,
479
- }),
480
- ]).then((x: any)=>{
481
- formatSource(x,0, 3, tableSearchForm);
482
- })
483
- modalTableProps = {
484
- modalTableTitle: '选择物理仓',
485
- tableSearchForm,
486
- tableColumns: [
487
- {
488
- title: '物理仓编码',
489
- dataIndex: 'physicalWarehouseCode',
490
- },
491
- {
492
- title: '物理仓名称',
493
- dataIndex: 'physicalWarehouseName',
494
- },
495
- {
496
- title: '物理仓类型',
497
- dataIndex: 'physicalWarehouseType',
498
- render: (text: number) => getDictionaryTextByValue('SC00002', text),
499
- },
500
- {
501
- title: '所属公司',
502
- dataIndex: 'companyName',
503
- },
504
- ],
505
- ...modalTableBusProps
506
- }
507
- }
508
- if(type === 'realWarehouse') {
509
- requestConfig = {
510
- url: `${prefixUrl.selectPrefix}/realWarehouse`,
511
- filter: 'qp-realWarehouseName,realWarehouseCode-orGroup,like', // 过滤参数
512
- mappingTextField: 'realWarehouseName',
513
- mappingTextShowKeyField: 'realWarehouseCode',
514
- mappingValueField: 'id',
515
- otherParams: {
516
- 'qp-isEnable-eq': 1,
517
- sorter: 'desc-id'
518
- }, // 默认参数
519
- sourceName: 'warehouseIds',
520
- ...requestConfigProp,
521
- }
522
- tableSearchForm = [
523
- { name: 'qp-realWarehouseName-like', label: '逻辑仓名称' },
524
- { name: 'qp-realWarehouseCode-like', label: '逻辑仓编码' },
525
- { name: 'qp-realWarehouseType-eq', type: 'select', label: '逻辑仓类型', initialSource: getDictionarySource('SC00004') },
526
- ]
527
- modalTableProps = {
528
- modalTableTitle: '选择逻辑仓',
529
- tableSearchForm,
530
- tableColumns: [
531
- {
532
- title: '逻辑仓编码',
533
- dataIndex: 'realWarehouseCode',
534
- },
535
- {
536
- title: '逻辑仓名称',
537
- dataIndex: 'realWarehouseName',
538
- },
539
- {
540
- title: '逻辑仓类型',
541
- dataIndex: 'realWarehouseType',
542
- render: (text: number) => getDictionaryTextByValue('SC00004', text),
543
- },
544
- ],
545
- ...modalTableBusProps,
546
- }
547
- }
548
-
549
- // 仓库选择器(虚拟、渠道仓)(无弹窗)
550
- if(type === 'virtualWarehouse') {
551
- requestConfig = {
552
- url: `${prefixUrl.selectPrefix}/virtualWarehouse`,
553
- filter: 'qp-virtualWarehouseName,virtualWarehouseCode-orGroup,like', // 过滤参数
554
- mappingTextField: 'virtualWarehouseName',
555
- mappingTextShowKeyField: 'virtualWarehouseCode',
556
- mappingValueField: 'id',
557
- otherParams: {
558
- 'qp-isEnable-eq': 1,
559
- sorter: 'desc-id'
560
- }, // 默认参数
561
- sourceName: 'warehouseIds',
562
- ...requestConfigProp,
563
- }
564
- needModalTable = false
565
- }
566
- if(type === 'channelWarehouse') {
567
- requestConfig = {
568
- url: `${prefixUrl.selectPrefix}/channelWarehouse`,
569
- filter: 'qp-channelWarehouseName,channelWarehouseCode-orGroup,like', // 过滤参数
570
- mappingTextField: 'channelWarehouseName',
571
- mappingTextShowKeyField: 'channelWarehouseCode',
572
- mappingValueField: 'id',
573
- otherParams: {
574
- 'qp-isEnable-eq': 1,
575
- sorter: 'desc-id'
576
- }, // 默认参数
577
- sourceName: 'warehouseIds',
578
- ...requestConfigProp,
579
- }
580
- needModalTable = false
581
- }
582
-
583
- // 客户选择器
584
- if(type === 'customer') {
585
- requestConfig = {
586
- url: `${prefixUrl.selectPrefix}/uc/customer/v2`,
587
- filter: 'qp-name,code-orGroup,like', // 过滤参数
588
- mappingTextField: 'name',
589
- mappingValueField: 'code',
590
- otherParams: {
591
- sorter: 'desc-id'
592
- }, // 默认参数
593
- sourceName: 'customCode',
594
- ...requestConfigProp,
595
- }
596
- tableSearchForm = [
597
- { name: 'qp-name-like', label: '客户名称' },
598
- { name: 'qp-code-like', label: '客户编码' },
599
- { name: 'qp-conglomerateCode-in', type: 'select', label: '归属集团', field: {
600
- type: 'select',
601
- props: {
602
- mode: 'multiple',
603
- notFoundContent: '暂无数据',
604
- allowClear: true,
605
- showSearch: true,
606
- showArrow: true,
607
- maxTagCount: 1,
608
- optionFilterProp: 'children',
609
- filterOption: (input: string, option: { props: { children: string } }) =>
610
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
611
- },
612
- } },
613
- { name: 'qp-accountingCode-in', type: 'select', label: '归属核算主体', field: {
614
- type: 'select',
615
- props: {
616
- mode: 'multiple',
617
- notFoundContent: '暂无数据',
618
- allowClear: true,
619
- showSearch: true,
620
- showArrow: true,
621
- maxTagCount: 1,
622
- optionFilterProp: 'children',
623
- filterOption: (input: string, option: { props: { children: string } }) =>
624
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
625
- },
626
- } },
627
- { name: 'qp-companyCode-in', type: 'select', label: '归属法人公司', field: {
628
- type: 'select',
629
- props: {
630
- mode: 'multiple',
631
- notFoundContent: '暂无数据',
632
- allowClear: true,
633
- showSearch: true,
634
- showArrow: true,
635
- maxTagCount: 1,
636
- optionFilterProp: 'children',
637
- filterOption: (input: string, option: { props: { children: string } }) =>
638
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
639
- },
640
- } },
641
- { name: 'qp-sharingType-eq', type: 'select', label: '共享类型', initialSource: sharingTypeDataList },
642
- ]
643
- Promise.all([
644
- loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
645
- pageSize: 5000,
646
- currentPage: 1,
647
- 'qp-companyType-eq': '30',
648
- }),
649
- loadSelectSource(`${prefixUrl.formSelectFix}/accountingSubject`, {
650
- pageSize: 5000,
651
- currentPage: 1,
652
- }),
653
- loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
654
- pageSize: 5000,
655
- currentPage: 1,
656
- 'qp-companyType-eq': '20',
657
- })
658
- ]).then((x: any)=>{
659
- formatSource(x,0, 2, tableSearchForm);
660
- formatSource(x,1, 3, tableSearchForm);
661
- formatSource(x,2, 4, tableSearchForm);
662
- })
663
- modalTableProps = {
664
- modalTableTitle: '选择客户',
665
- tableSearchForm,
666
- tableColumns: [
667
- {
668
- title: '客户编码',
669
- dataIndex: 'code',
670
- },
671
- {
672
- title: '客户名称',
673
- dataIndex: 'name',
674
- },
675
- {
676
- title: '归属集团',
677
- dataIndex: 'conglomerateName',
678
- },
679
- {
680
- title: '归属法人公司',
681
- dataIndex: 'legalCompanyName',
682
- },
683
- {
684
- title: '归属核算主体',
685
- dataIndex: 'accountingName',
686
- },
687
- {
688
- title: '共享类型',
689
- dataIndex: 'sharingType',
690
- render: (text: number) => hasDictSharingType ? getDictionaryTextByValue('UC000013', text) : sharingType.find((i: any) => i.value === text)?.text,
691
- },
692
- ],
693
- ...modalTableBusProps
694
- }
695
- }
696
-
697
- // 店铺选择器
698
- if(type === 'shopFile') {
699
- requestConfig = {
700
- url: `${prefixUrl.selectPrefix}/store`,
701
- filter: 'qp-name,code-orGroup,like', // 过滤参数
702
- mappingTextField: 'name',
703
- mappingValueField: 'code',
704
- otherParams: {
705
- sorter: 'desc-id'
706
- }, // 默认参数
707
- sourceName: 'code',
708
- ...requestConfigProp,
709
- }
710
- tableSearchForm = [
711
- { name: 'qp-name-like', label: '店铺名称' },
712
- { name: 'qp-code-like', label: '店铺编码' },
713
- { name: 'qp-conglomerateCode-in', type: 'select', label: '归属集团', field: {
714
- type: 'select',
715
- props: {
716
- mode: 'multiple',
717
- notFoundContent: '暂无数据',
718
- allowClear: true,
719
- showSearch: true,
720
- showArrow: true,
721
- maxTagCount: 1,
722
- optionFilterProp: 'children',
723
- filterOption: (input: string, option: { props: { children: string } }) =>
724
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
725
- },
726
- } },
727
- { name: 'qp-companyCode-in', type: 'select', label: '归属法人公司', field: {
728
- type: 'select',
729
- props: {
730
- mode: 'multiple',
731
- notFoundContent: '暂无数据',
732
- allowClear: true,
733
- showSearch: true,
734
- showArrow: true,
735
- maxTagCount: 1,
736
- optionFilterProp: 'children',
737
- filterOption: (input: string, option: { props: { children: string } }) =>
738
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
739
- },
740
- } },
741
- { name: 'qp-type-in', type: 'select', label: '店铺类型', initialSource: shopFileType },
742
- { name: 'qp-plateformCode-in', type: 'select', label: '店铺来源', field: {
743
- type: 'select',
744
- props: {
745
- mode: 'multiple',
746
- notFoundContent: '暂无数据',
747
- allowClear: true,
748
- showSearch: true,
749
- showArrow: true,
750
- maxTagCount: 1,
751
- optionFilterProp: 'children',
752
- filterOption: (input: string, option: { props: { children: string } }) =>
753
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
754
- },
755
- } },
756
- { name: 'qp-accountingCode-in', type: 'select', label: '归属核算主体', field: {
757
- type: 'select',
758
- props: {
759
- mode: 'multiple',
760
- notFoundContent: '暂无数据',
761
- allowClear: true,
762
- showSearch: true,
763
- showArrow: true,
764
- maxTagCount: 1,
765
- optionFilterProp: 'children',
766
- filterOption: (input: string, option: { props: { children: string } }) =>
767
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
768
- },
769
- } },
770
- ]
771
- Promise.all([
772
- loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
773
- pageSize: 5000,
774
- currentPage: 1,
775
- 'qp-companyType-eq': '30',
776
- }),
777
- loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
778
- pageSize: 5000,
779
- currentPage: 1,
780
- 'qp-companyType-eq': '20',
781
- }),
782
- loadSelectSource(`${prefixUrl.formSelectFix}/platformRecord/getPlatformRecordList`, {
783
- // pageSize: 5000,
784
- // currentPage: 1,
785
- 'qp-status-eq': '1',
786
- }),
787
- loadSelectSource(`${prefixUrl.formSelectFix}/accountingSubject`, {
788
- pageSize: 5000,
789
- currentPage: 1,
790
- }),
791
- ]).then((x: any)=>{
792
- formatSource(x,0, 2, tableSearchForm);
793
- formatSource(x,1, 3, tableSearchForm);
794
- formatSource(x,2, 5, tableSearchForm);
795
- formatSource(x,3, 6, tableSearchForm);
796
- })
797
- modalTableProps = {
798
- modalTableTitle: '选择店铺',
799
- tableSearchForm,
800
- tableColumns: [
801
- {
802
- title: '店铺编码',
803
- dataIndex: 'code',
804
- },
805
- {
806
- title: '店铺名称',
807
- dataIndex: 'name',
808
- },
809
- {
810
- title: '归属集团',
811
- dataIndex: 'conglomerateName',
812
- },
813
- {
814
- title: '归属法人公司',
815
- dataIndex: 'companyName',
816
- },
817
- {
818
- title: '店铺类型',
819
- dataIndex: 'type',
820
- render: (text: number) => shopFileType.find((i: any) => i.value === text)?.text,
821
- },
822
- {
823
- title: '店铺来源',
824
- dataIndex: 'platformName',
825
- },
826
- {
827
- title: '归属核算主体',
828
- dataIndex: 'accountingName',
829
- },
830
- ],
831
- ...modalTableBusProps
832
- }
833
- }
834
-
835
- // 核算主体选择器(无弹窗)
836
- if(type === 'accountingSubject') {
837
- requestConfig = {
838
- url: `${prefixUrl.selectPrefix}/accountingSubject`,
839
- filter: 'qp-name,code-orGroup,like', // 过滤参数
840
- mappingTextField: 'name',
841
- mappingTextShowKeyField: 'code',
842
- mappingValueField: 'id',
843
- otherParams: {
844
- sorter: 'desc-id'
845
- }, // 默认参数
846
- sourceName: 'accountingSubjectCode',
847
- ...requestConfigProp,
848
- }
849
- needModalTable = false
850
- }
851
- // 库存组织选择器(无弹窗)
852
- if(type === 'inventoryOrg') {
853
- requestConfig = {
854
- url: `${prefixUrl.selectPrefix}/inventoryOrg`,
855
- filter: 'qp-name,code-orGroup,like', // 过滤参数
856
- mappingTextField: 'name',
857
- mappingTextShowKeyField: 'code',
858
- mappingValueField: 'id',
859
- otherParams: {
860
- sorter: 'desc-id'
861
- }, // 默认参数
862
- sourceName: 'inventoryOrgCode',
863
- ...requestConfigProp,
864
- }
865
- needModalTable = false
866
- }
867
- // 法人公司选择器(无弹窗)
868
- if(type === 'corporationCompany') {
869
- requestConfig = {
870
- url: `${prefixUrl.selectPrefix}/company`,
871
- filter: 'qp-name,code-orGroup,like', // 过滤参数
872
- mappingTextField: 'name',
873
- mappingTextShowKeyField: 'code',
874
- mappingValueField: 'id',
875
- otherParams: {
876
- sorter: 'desc-id'
877
- }, // 默认参数
878
- sourceName: 'corporationCompany',
879
- ...requestConfigProp,
880
- }
881
- needModalTable = false
882
- }
883
-
884
- // 员工选择器
885
- if(type === 'employee') {
886
- requestConfig = {
887
- url: `${prefixUrl.selectPrefix}/employee/v2`,
888
- filter: 'qp-employeeNumber,name-orGroup,like', // 过滤参数
889
- mappingTextField: 'name',
890
- mappingTextShowKeyField: 'employeeNumber',
891
- mappingValueField: 'employeeNumber',
892
- otherParams: {
893
- 'qp-enable-eq': 10, // 启用状态 10-启用,20-禁用
894
- sorter: 'desc-id'
895
- }, // 默认参数
896
- sourceName: 'employeeNumber',
897
- ...requestConfigProp,
898
- }
899
- tableSearchForm = [
900
- { name: 'qp-name-like', label: '员工名称' },
901
- { name: 'qp-employeeNumber-like', label: '员工编码' },
902
- { name: 'qp-companyCode-in', type: 'select', label: '所属公司', field: {
903
- type: 'select',
904
- props: {
905
- mode: 'multiple',
906
- notFoundContent: '暂无数据',
907
- allowClear: true,
908
- showSearch: true,
909
- showArrow: true,
910
- maxTagCount: 1,
911
- optionFilterProp: 'children',
912
- filterOption: (input: string, option: { props: { children: string } }) =>
913
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
914
- },
915
- } },
916
- { name: 'qp-email-like', label: '邮箱' },
917
- { name: 'qp-officeTelephone-like', label: '手机号' },
918
- ]
919
- Promise.all([
920
- loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
921
- pageSize: 5000,
922
- currentPage: 1,
923
- 'qp-companyType-eq': 20,
924
- }),
925
- ]).then((x: any)=>{
926
- formatSource(x,0, 2, tableSearchForm);
927
- })
928
- modalTableProps = {
929
- modalTableTitle: '选择员工',
930
- tableSearchForm,
931
- tableColumns: [
932
- {
933
- title: '员工编码',
934
- dataIndex: 'employeeNumber',
935
- },
936
- {
937
- title: '员工名称',
938
- dataIndex: 'name',
939
- },
940
- {
941
- title: '所属公司',
942
- dataIndex: 'companyName',
943
- },
944
- {
945
- title: '邮箱',
946
- dataIndex: 'email',
947
- },
948
- {
949
- title: '手机号',
950
- dataIndex: 'officeTelephone',
951
- },
952
- ],
953
- ...modalTableBusProps
954
- }
955
- }
956
-
957
- // 配送方式选择器
958
- if(type === 'deliveryMode') {
959
- requestConfig = {
960
- url: `${prefixUrl.selectPrefix}/deliveryMode`,
961
- filter: 'qp-name,code-orGroup,like', // 过滤参数
962
- mappingTextField: 'name',
963
- mappingTextShowKeyField: 'code',
964
- mappingValueField: 'code',
965
- otherParams: {
966
- sorter: 'desc-id'
967
- }, // 默认参数
968
- sourceName: 'deliveryModeCode',
969
- ...requestConfigProp
970
- }
971
- tableSearchForm = [
972
- { name: 'qp-name-like', label: '配送方式名称' },
973
- { name: 'qp-code-like', label: '配送方式编码' },
974
- { name: 'qp-logisCompanyCode-in', type: 'select', label: '所属物流商', field: {
975
- type: 'select',
976
- props: {
977
- mode: 'multiple',
978
- notFoundContent: '暂无数据',
979
- allowClear: true,
980
- showSearch: true,
981
- showArrow: true,
982
- maxTagCount: 1,
983
- optionFilterProp: 'children',
984
- filterOption: (input: string, option: { props: { children: string } }) =>
985
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
986
- },
987
- } },
988
- { name: 'qp-recordChannnelCode-in', type: 'select', label: '单号获取通道', initialSource: getDictionarySource('BSC00004') },
989
- { name: 'qp-arrivalPaySupport-in', type: 'select', label: '是否支持到付', initialSource: arrivalPaySupportList },
990
- { name: 'qp-sheetTemplateCode-in', type: 'select', label: '面单模板', field: {
991
- type: 'select',
992
- props: {
993
- mode: 'multiple',
994
- notFoundContent: '暂无数据',
995
- allowClear: true,
996
- showSearch: true,
997
- showArrow: true,
998
- maxTagCount: 1,
999
- optionFilterProp: 'children',
1000
- filterOption: (input: string, option: { props: { children: string } }) =>
1001
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1002
- },
1003
- } },
1004
- { name: 'qp-remark-like', label: '备注' },
1005
- ]
1006
- Promise.all([
1007
- loadSelectSource(`${prefixUrl.formSelectFix}/logisCompany`, {
1008
- pageSize: 5000,
1009
- currentPage: 1,
1010
- }),
1011
- loadSelectSource(`${prefixUrl.formSelectFix}/printTemplate`, {
1012
- pageSize: 5000,
1013
- currentPage: 1,
1014
- })
1015
- ]).then((x: any)=>{
1016
- formatSource(x,0, 2, tableSearchForm);
1017
- formatSource(x,1, 5, tableSearchForm);
1018
- })
1019
- modalTableProps = {
1020
- modalTableTitle: '选择配送方式',
1021
- tableSearchForm,
1022
- tableColumns: [
1023
- {
1024
- title: '配送方式编码',
1025
- dataIndex: 'code',
1026
- },
1027
- {
1028
- title: '配送方式名称',
1029
- dataIndex: 'name',
1030
- },
1031
- {
1032
- title: '所属物流商',
1033
- dataIndex: 'logisCompanyName',
1034
- },
1035
- {
1036
- dataIndex: 'recordChannnelCode',
1037
- title: '单号获取通道',
1038
- render: (text: any) => getDictionaryTextByValue('BSC00004', text),
1039
- },
1040
- {
1041
- dataIndex: 'arrivalPaySupport',
1042
- title: '是否支持到付',
1043
- render: (text: number) => arrivalPaySupportList.find((i: any) => i.value === text)?.text,
1044
- },
1045
- {
1046
- dataIndex: 'sheetTemplateName',
1047
- title: '面单模板',
1048
- },
1049
- {
1050
- dataIndex: 'remark',
1051
- title: '备注',
1052
- },
1053
- ],
1054
- ...modalTableBusProps
1055
- }
1056
- }
1057
-
1058
- return { modalTableProps, requestConfig, needModalTable };
1059
- }
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 = [
181
+ { name: 'qp-skuName-like', label: 'SKU名称' },
182
+ { name: 'qp-skuCode-like', label: 'SKU编码' },
183
+ { name: 'qp-code-like', label: '国际条码' },
184
+ { name: 'qp-itemName-like', label: '所属SPU名称' },
185
+ { name: 'qp-itemCode-like', label: '所属SPU编码' },
186
+ { name: 'qp-externalCode-like', label: '外部编码' },
187
+ { 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
+ },
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
+ Promise.all([
246
+ loadSelectSource(`${prefixUrl.formSelectFix}/brand/queryBrandList`, {
247
+ pageSize: 5000,
248
+ currentPage: 1,
249
+ }),
250
+ loadSelectSource(`${prefixUrl.formSelectFix}/category/queryCategoryTree`, {
251
+ pageSize: 5000,
252
+ currentPage: 1,
253
+ }),
254
+ loadSelectSource(`${prefixUrl.formSelectFix}/class/withProperty`, {
255
+ pageSize: 5000,
256
+ currentPage: 1,
257
+ }),
258
+ ]).then((x: any)=>{
259
+ formatSource(x,0, 7, tableSearchForm,['id','name']);
260
+ formatTreeDataSource(x,1, 8, tableSearchForm);
261
+ formatSource(x,2, 9, tableSearchForm,['id','name']);
262
+ })
263
+ modalTableProps = {
264
+ modalTableTitle: '选择SKU',
265
+ tableSearchForm,
266
+ tableColumns: [
267
+ {
268
+ title: 'SKU编码',
269
+ dataIndex: 'skuCode',
270
+ },
271
+ {
272
+ title: 'SKU名称',
273
+ dataIndex: 'name',
274
+ },
275
+ {
276
+ title: '国际条码',
277
+ dataIndex: 'barCode',
278
+ },
279
+ {
280
+ title: '所属SPU名称',
281
+ dataIndex: 'itemName',
282
+ },
283
+ {
284
+ title: '所属SPU编码',
285
+ dataIndex: 'itemCode',
286
+ },
287
+ {
288
+ title: '外部编码',
289
+ dataIndex: 'externalCode',
290
+ },
291
+ {
292
+ title: '规格',
293
+ dataIndex: 'propertyNameAndValue',
294
+ },
295
+ {
296
+ title: '类目',
297
+ dataIndex: 'categoryName',
298
+ },
299
+ {
300
+ title: '品类',
301
+ dataIndex: 'className',
302
+ },
303
+ {
304
+ title: '品牌',
305
+ dataIndex: 'brandName',
306
+ },
307
+ ],
308
+ ...modalTableBusProps
309
+ }
310
+ }
311
+
312
+ // 商品选择器spu
313
+ if(type === 'spuCommodity') {
314
+ requestConfig = {
315
+ url: `${prefixUrl.selectPrefix}/item`,
316
+ filter: 'qp-itemCode,name-orGroup,like', // 过滤参数
317
+ mappingTextField: 'name',
318
+ mappingValueField: 'itemCode',
319
+ otherParams: {
320
+ 'qp-approveStatus-eq': 1, // 审核状态(0.待审批;1.审批通过;2.驳回;3.审批未通过)
321
+ sorter: 'desc-id'
322
+ }, // 默认参数
323
+ sourceName: 'itemCode',
324
+ ...requestConfigProp,
325
+ }
326
+ tableSearchForm = [
327
+ { name: 'qp-name-like', label: 'SPU名称' },
328
+ { name: 'qp-itemCode-like', label: 'SPU编码' },
329
+ { name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
330
+ type: 'select',
331
+ props: {
332
+ mode: 'multiple',
333
+ notFoundContent: '暂无数据',
334
+ allowClear: true,
335
+ showSearch: true,
336
+ showArrow: true,
337
+ maxTagCount: 1,
338
+ optionFilterProp: 'children',
339
+ filterOption: (input: string, option: { props: { children: string } }) =>
340
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
341
+ },
342
+ } },
343
+ { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
344
+ type: 'treeSelect',
345
+ props: {
346
+ treeData: [],
347
+ treeCheckable: true,
348
+ showSearch: true,
349
+ allowClear: true,
350
+ showArrow: true,
351
+ treeNodeFilterProp: 'title',
352
+ treeDefaultExpandAll: true,
353
+ maxTagCount: 1,
354
+ placeholder: '请选择',
355
+ style: {
356
+ width: '100%',
357
+ },
358
+ dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
359
+ },
360
+ } },
361
+ { name: 'qp-classId-in', type: 'select', label: '品类', field: {
362
+ type: 'select',
363
+ props: {
364
+ mode: 'multiple',
365
+ notFoundContent: '暂无数据',
366
+ allowClear: true,
367
+ showSearch: true,
368
+ showArrow: true,
369
+ maxTagCount: 1,
370
+ optionFilterProp: 'children',
371
+ filterOption: (input: string, option: { props: { children: string } }) =>
372
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
373
+ },
374
+ } },
375
+ ]
376
+ Promise.all([
377
+ loadSelectSource(`${prefixUrl.formSelectFix}/brand/queryBrandList`, {
378
+ pageSize: 5000,
379
+ currentPage: 1,
380
+ }),
381
+ loadSelectSource(`${prefixUrl.formSelectFix}/category/queryCategoryTree`, {
382
+ pageSize: 5000,
383
+ currentPage: 1,
384
+ }),
385
+ loadSelectSource(`${prefixUrl.formSelectFix}/class/withProperty`, {
386
+ pageSize: 5000,
387
+ currentPage: 1,
388
+ }),
389
+ ]).then((x: any)=>{
390
+ formatSource(x,0, 2, tableSearchForm,['id','name']);
391
+ formatTreeDataSource(x,1, 3, tableSearchForm);
392
+ formatSource(x,2, 4, tableSearchForm,['id','name']);
393
+ })
394
+ modalTableProps = {
395
+ modalTableTitle: '选择SPU',
396
+ tableSearchForm,
397
+ tableColumns: [
398
+ {
399
+ title: 'SPU编码',
400
+ dataIndex: 'itemCode',
401
+ },
402
+ {
403
+ title: 'SPU名称',
404
+ dataIndex: 'name',
405
+ },
406
+ {
407
+ title: '品牌',
408
+ dataIndex: 'brandName',
409
+ },
410
+ {
411
+ title: '类目',
412
+ dataIndex: 'categoryText',
413
+ },
414
+ {
415
+ title: '品类',
416
+ dataIndex: 'className',
417
+ },
418
+ ],
419
+ ...modalTableBusProps
420
+ }
421
+ }
422
+
423
+ // 商品规格选择器(无弹窗)
424
+ if(type === 'skuPropertyValue') {
425
+ requestConfig = {
426
+ url: `${prefixUrl.selectPrefix}/skuPropertyValue/list`,
427
+ filter: 'qp-value-like', // 过滤参数
428
+ mappingTextField: 'value',
429
+ mappingTextShowKeyField: 'propertyValueCode',
430
+ mappingValueField: 'propertyValueCode',
431
+ otherParams: {
432
+ sorter: 'desc-id'
433
+ }, // 默认参数
434
+ sourceName: 'qp-propertyValueCode-in',
435
+ ...requestConfigProp,
436
+ }
437
+ needModalTable = false
438
+ }
439
+
440
+ // 仓库选择器(物理、逻辑仓)
441
+ if(type === 'physicalWarehouse') {
442
+ requestConfig = {
443
+ url: `${prefixUrl.selectPrefix}/physicalWarehouse`,
444
+ filter: 'qp-physicalWarehouseName,physicalWarehouseCode-orGroup,like', // 过滤参数
445
+ mappingTextField: 'physicalWarehouseName',
446
+ mappingTextShowKeyField: 'physicalWarehouseCode',
447
+ mappingValueField: 'id',
448
+ otherParams: {
449
+ 'qp-isEnable-eq': 1,
450
+ sorter: 'desc-id'
451
+ }, // 默认参数
452
+ sourceName: 'warehouseIds',
453
+ ...requestConfigProp,
454
+ }
455
+ tableSearchForm = [
456
+ { name: 'qp-physicalWarehouseName-like', label: '物理仓名称' },
457
+ { name: 'qp-physicalWarehouseCode-like', label: '物理仓编码' },
458
+ { name: 'qp-physicalWarehouseType-eq', type: 'select', label: '物理仓类型', initialSource: getDictionarySource('SC00002') },
459
+ { name: 'qp-companyCode-eq', type: 'select', label: '所属公司', field: {
460
+ type: 'select',
461
+ props: {
462
+ mode: 'multiple',
463
+ notFoundContent: '暂无数据',
464
+ allowClear: true,
465
+ showSearch: true,
466
+ showArrow: true,
467
+ maxTagCount: 1,
468
+ optionFilterProp: 'children',
469
+ filterOption: (input: string, option: { props: { children: string } }) =>
470
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
471
+ },
472
+ } },
473
+ ]
474
+ Promise.all([
475
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
476
+ pageSize: 5000,
477
+ currentPage: 1,
478
+ 'qp-companyType-eq': 20,
479
+ }),
480
+ ]).then((x: any)=>{
481
+ formatSource(x,0, 3, tableSearchForm);
482
+ })
483
+ modalTableProps = {
484
+ modalTableTitle: '选择物理仓',
485
+ tableSearchForm,
486
+ tableColumns: [
487
+ {
488
+ title: '物理仓编码',
489
+ dataIndex: 'physicalWarehouseCode',
490
+ },
491
+ {
492
+ title: '物理仓名称',
493
+ dataIndex: 'physicalWarehouseName',
494
+ },
495
+ {
496
+ title: '物理仓类型',
497
+ dataIndex: 'physicalWarehouseType',
498
+ render: (text: number) => getDictionaryTextByValue('SC00002', text),
499
+ },
500
+ {
501
+ title: '所属公司',
502
+ dataIndex: 'companyName',
503
+ },
504
+ ],
505
+ ...modalTableBusProps
506
+ }
507
+ }
508
+ if(type === 'realWarehouse') {
509
+ requestConfig = {
510
+ url: `${prefixUrl.selectPrefix}/realWarehouse`,
511
+ filter: 'qp-realWarehouseName,realWarehouseCode-orGroup,like', // 过滤参数
512
+ mappingTextField: 'realWarehouseName',
513
+ mappingTextShowKeyField: 'realWarehouseCode',
514
+ mappingValueField: 'id',
515
+ otherParams: {
516
+ 'qp-isEnable-eq': 1,
517
+ sorter: 'desc-id'
518
+ }, // 默认参数
519
+ sourceName: 'warehouseIds',
520
+ ...requestConfigProp,
521
+ }
522
+ tableSearchForm = [
523
+ { name: 'qp-realWarehouseName-like', label: '逻辑仓名称' },
524
+ { name: 'qp-realWarehouseCode-like', label: '逻辑仓编码' },
525
+ { name: 'qp-realWarehouseType-eq', type: 'select', label: '逻辑仓类型', initialSource: getDictionarySource('SC00004') },
526
+ ]
527
+ modalTableProps = {
528
+ modalTableTitle: '选择逻辑仓',
529
+ tableSearchForm,
530
+ tableColumns: [
531
+ {
532
+ title: '逻辑仓编码',
533
+ dataIndex: 'realWarehouseCode',
534
+ },
535
+ {
536
+ title: '逻辑仓名称',
537
+ dataIndex: 'realWarehouseName',
538
+ },
539
+ {
540
+ title: '逻辑仓类型',
541
+ dataIndex: 'realWarehouseType',
542
+ render: (text: number) => getDictionaryTextByValue('SC00004', text),
543
+ },
544
+ ],
545
+ ...modalTableBusProps,
546
+ }
547
+ }
548
+
549
+ // 仓库选择器(虚拟、渠道仓)(无弹窗)
550
+ if(type === 'virtualWarehouse') {
551
+ requestConfig = {
552
+ url: `${prefixUrl.selectPrefix}/virtualWarehouse`,
553
+ filter: 'qp-virtualWarehouseName,virtualWarehouseCode-orGroup,like', // 过滤参数
554
+ mappingTextField: 'virtualWarehouseName',
555
+ mappingTextShowKeyField: 'virtualWarehouseCode',
556
+ mappingValueField: 'id',
557
+ otherParams: {
558
+ 'qp-isEnable-eq': 1,
559
+ sorter: 'desc-id'
560
+ }, // 默认参数
561
+ sourceName: 'warehouseIds',
562
+ ...requestConfigProp,
563
+ }
564
+ needModalTable = false
565
+ }
566
+ if(type === 'channelWarehouse') {
567
+ requestConfig = {
568
+ url: `${prefixUrl.selectPrefix}/channelWarehouse`,
569
+ filter: 'qp-channelWarehouseName,channelWarehouseCode-orGroup,like', // 过滤参数
570
+ mappingTextField: 'channelWarehouseName',
571
+ mappingTextShowKeyField: 'channelWarehouseCode',
572
+ mappingValueField: 'id',
573
+ otherParams: {
574
+ 'qp-isEnable-eq': 1,
575
+ sorter: 'desc-id'
576
+ }, // 默认参数
577
+ sourceName: 'warehouseIds',
578
+ ...requestConfigProp,
579
+ }
580
+ needModalTable = false
581
+ }
582
+
583
+ // 客户选择器
584
+ if(type === 'customer') {
585
+ requestConfig = {
586
+ url: `${prefixUrl.selectPrefix}/uc/customer/v2`,
587
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
588
+ mappingTextField: 'name',
589
+ mappingValueField: 'code',
590
+ otherParams: {
591
+ sorter: 'desc-id'
592
+ }, // 默认参数
593
+ sourceName: 'customCode',
594
+ ...requestConfigProp,
595
+ }
596
+ tableSearchForm = [
597
+ { name: 'qp-name-like', label: '客户名称' },
598
+ { name: 'qp-code-like', label: '客户编码' },
599
+ { name: 'qp-conglomerateCode-in', type: 'select', label: '归属集团', field: {
600
+ type: 'select',
601
+ props: {
602
+ mode: 'multiple',
603
+ notFoundContent: '暂无数据',
604
+ allowClear: true,
605
+ showSearch: true,
606
+ showArrow: true,
607
+ maxTagCount: 1,
608
+ optionFilterProp: 'children',
609
+ filterOption: (input: string, option: { props: { children: string } }) =>
610
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
611
+ },
612
+ } },
613
+ { name: 'qp-accountingCode-in', type: 'select', label: '归属核算主体', field: {
614
+ type: 'select',
615
+ props: {
616
+ mode: 'multiple',
617
+ notFoundContent: '暂无数据',
618
+ allowClear: true,
619
+ showSearch: true,
620
+ showArrow: true,
621
+ maxTagCount: 1,
622
+ optionFilterProp: 'children',
623
+ filterOption: (input: string, option: { props: { children: string } }) =>
624
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
625
+ },
626
+ } },
627
+ { name: 'qp-companyCode-in', type: 'select', label: '归属法人公司', field: {
628
+ type: 'select',
629
+ props: {
630
+ mode: 'multiple',
631
+ notFoundContent: '暂无数据',
632
+ allowClear: true,
633
+ showSearch: true,
634
+ showArrow: true,
635
+ maxTagCount: 1,
636
+ optionFilterProp: 'children',
637
+ filterOption: (input: string, option: { props: { children: string } }) =>
638
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
639
+ },
640
+ } },
641
+ { name: 'qp-sharingType-eq', type: 'select', label: '共享类型', initialSource: sharingTypeDataList },
642
+ ]
643
+ Promise.all([
644
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
645
+ pageSize: 5000,
646
+ currentPage: 1,
647
+ 'qp-companyType-eq': '30',
648
+ }),
649
+ loadSelectSource(`${prefixUrl.formSelectFix}/accountingSubject`, {
650
+ pageSize: 5000,
651
+ currentPage: 1,
652
+ }),
653
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
654
+ pageSize: 5000,
655
+ currentPage: 1,
656
+ 'qp-companyType-eq': '20',
657
+ })
658
+ ]).then((x: any)=>{
659
+ formatSource(x,0, 2, tableSearchForm);
660
+ formatSource(x,1, 3, tableSearchForm);
661
+ formatSource(x,2, 4, tableSearchForm);
662
+ })
663
+ modalTableProps = {
664
+ modalTableTitle: '选择客户',
665
+ tableSearchForm,
666
+ tableColumns: [
667
+ {
668
+ title: '客户编码',
669
+ dataIndex: 'code',
670
+ },
671
+ {
672
+ title: '客户名称',
673
+ dataIndex: 'name',
674
+ },
675
+ {
676
+ title: '归属集团',
677
+ dataIndex: 'conglomerateName',
678
+ },
679
+ {
680
+ title: '归属法人公司',
681
+ dataIndex: 'legalCompanyName',
682
+ },
683
+ {
684
+ title: '归属核算主体',
685
+ dataIndex: 'accountingName',
686
+ },
687
+ {
688
+ title: '共享类型',
689
+ dataIndex: 'sharingType',
690
+ render: (text: number) => hasDictSharingType ? getDictionaryTextByValue('UC000013', text) : sharingType.find((i: any) => i.value === text)?.text,
691
+ },
692
+ ],
693
+ ...modalTableBusProps
694
+ }
695
+ }
696
+
697
+ // 店铺选择器
698
+ if(type === 'shopFile') {
699
+ requestConfig = {
700
+ url: `${prefixUrl.selectPrefix}/store`,
701
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
702
+ mappingTextField: 'name',
703
+ mappingValueField: 'code',
704
+ otherParams: {
705
+ sorter: 'desc-id'
706
+ }, // 默认参数
707
+ sourceName: 'code',
708
+ ...requestConfigProp,
709
+ }
710
+ tableSearchForm = [
711
+ { name: 'qp-name-like', label: '店铺名称' },
712
+ { name: 'qp-code-like', label: '店铺编码' },
713
+ { name: 'qp-conglomerateCode-in', type: 'select', label: '归属集团', field: {
714
+ type: 'select',
715
+ props: {
716
+ mode: 'multiple',
717
+ notFoundContent: '暂无数据',
718
+ allowClear: true,
719
+ showSearch: true,
720
+ showArrow: true,
721
+ maxTagCount: 1,
722
+ optionFilterProp: 'children',
723
+ filterOption: (input: string, option: { props: { children: string } }) =>
724
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
725
+ },
726
+ } },
727
+ { name: 'qp-companyCode-in', type: 'select', label: '归属法人公司', field: {
728
+ type: 'select',
729
+ props: {
730
+ mode: 'multiple',
731
+ notFoundContent: '暂无数据',
732
+ allowClear: true,
733
+ showSearch: true,
734
+ showArrow: true,
735
+ maxTagCount: 1,
736
+ optionFilterProp: 'children',
737
+ filterOption: (input: string, option: { props: { children: string } }) =>
738
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
739
+ },
740
+ } },
741
+ { name: 'qp-type-in', type: 'select', label: '店铺类型', initialSource: shopFileType },
742
+ { name: 'qp-plateformCode-in', type: 'select', label: '店铺来源', field: {
743
+ type: 'select',
744
+ props: {
745
+ mode: 'multiple',
746
+ notFoundContent: '暂无数据',
747
+ allowClear: true,
748
+ showSearch: true,
749
+ showArrow: true,
750
+ maxTagCount: 1,
751
+ optionFilterProp: 'children',
752
+ filterOption: (input: string, option: { props: { children: string } }) =>
753
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
754
+ },
755
+ } },
756
+ { name: 'qp-accountingCode-in', type: 'select', label: '归属核算主体', field: {
757
+ type: 'select',
758
+ props: {
759
+ mode: 'multiple',
760
+ notFoundContent: '暂无数据',
761
+ allowClear: true,
762
+ showSearch: true,
763
+ showArrow: true,
764
+ maxTagCount: 1,
765
+ optionFilterProp: 'children',
766
+ filterOption: (input: string, option: { props: { children: string } }) =>
767
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
768
+ },
769
+ } },
770
+ ]
771
+ Promise.all([
772
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
773
+ pageSize: 5000,
774
+ currentPage: 1,
775
+ 'qp-companyType-eq': '30',
776
+ }),
777
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
778
+ pageSize: 5000,
779
+ currentPage: 1,
780
+ 'qp-companyType-eq': '20',
781
+ }),
782
+ loadSelectSource(`${prefixUrl.formSelectFix}/platformRecord/getPlatformRecordList`, {
783
+ // pageSize: 5000,
784
+ // currentPage: 1,
785
+ 'qp-status-eq': '1',
786
+ }),
787
+ loadSelectSource(`${prefixUrl.formSelectFix}/accountingSubject`, {
788
+ pageSize: 5000,
789
+ currentPage: 1,
790
+ }),
791
+ ]).then((x: any)=>{
792
+ formatSource(x,0, 2, tableSearchForm);
793
+ formatSource(x,1, 3, tableSearchForm);
794
+ formatSource(x,2, 5, tableSearchForm);
795
+ formatSource(x,3, 6, tableSearchForm);
796
+ })
797
+ modalTableProps = {
798
+ modalTableTitle: '选择店铺',
799
+ tableSearchForm,
800
+ tableColumns: [
801
+ {
802
+ title: '店铺编码',
803
+ dataIndex: 'code',
804
+ },
805
+ {
806
+ title: '店铺名称',
807
+ dataIndex: 'name',
808
+ },
809
+ {
810
+ title: '归属集团',
811
+ dataIndex: 'conglomerateName',
812
+ },
813
+ {
814
+ title: '归属法人公司',
815
+ dataIndex: 'companyName',
816
+ },
817
+ {
818
+ title: '店铺类型',
819
+ dataIndex: 'type',
820
+ render: (text: number) => shopFileType.find((i: any) => i.value === text)?.text,
821
+ },
822
+ {
823
+ title: '店铺来源',
824
+ dataIndex: 'platformName',
825
+ },
826
+ {
827
+ title: '归属核算主体',
828
+ dataIndex: 'accountingName',
829
+ },
830
+ ],
831
+ ...modalTableBusProps
832
+ }
833
+ }
834
+
835
+ // 核算主体选择器(无弹窗)
836
+ if(type === 'accountingSubject') {
837
+ requestConfig = {
838
+ url: `${prefixUrl.selectPrefix}/accountingSubject`,
839
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
840
+ mappingTextField: 'name',
841
+ mappingTextShowKeyField: 'code',
842
+ mappingValueField: 'id',
843
+ otherParams: {
844
+ sorter: 'desc-id'
845
+ }, // 默认参数
846
+ sourceName: 'accountingSubjectCode',
847
+ ...requestConfigProp,
848
+ }
849
+ needModalTable = false
850
+ }
851
+ // 库存组织选择器(无弹窗)
852
+ if(type === 'inventoryOrg') {
853
+ requestConfig = {
854
+ url: `${prefixUrl.selectPrefix}/inventoryOrg`,
855
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
856
+ mappingTextField: 'name',
857
+ mappingTextShowKeyField: 'code',
858
+ mappingValueField: 'id',
859
+ otherParams: {
860
+ sorter: 'desc-id'
861
+ }, // 默认参数
862
+ sourceName: 'inventoryOrgCode',
863
+ ...requestConfigProp,
864
+ }
865
+ needModalTable = false
866
+ }
867
+ // 法人公司选择器(无弹窗)
868
+ if(type === 'corporationCompany') {
869
+ requestConfig = {
870
+ url: `${prefixUrl.selectPrefix}/company`,
871
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
872
+ mappingTextField: 'name',
873
+ mappingTextShowKeyField: 'code',
874
+ mappingValueField: 'id',
875
+ otherParams: {
876
+ sorter: 'desc-id'
877
+ }, // 默认参数
878
+ sourceName: 'corporationCompany',
879
+ ...requestConfigProp,
880
+ }
881
+ needModalTable = false
882
+ }
883
+
884
+ // 员工选择器
885
+ if(type === 'employee') {
886
+ requestConfig = {
887
+ url: `${prefixUrl.selectPrefix}/employee/v2`,
888
+ filter: 'qp-employeeNumber,name-orGroup,like', // 过滤参数
889
+ mappingTextField: 'name',
890
+ mappingTextShowKeyField: 'employeeNumber',
891
+ mappingValueField: 'employeeNumber',
892
+ otherParams: {
893
+ 'qp-enable-eq': 10, // 启用状态 10-启用,20-禁用
894
+ sorter: 'desc-id'
895
+ }, // 默认参数
896
+ sourceName: 'employeeNumber',
897
+ ...requestConfigProp,
898
+ }
899
+ tableSearchForm = [
900
+ { name: 'qp-name-like', label: '员工名称' },
901
+ { name: 'qp-employeeNumber-like', label: '员工编码' },
902
+ { name: 'qp-companyCode-in', type: 'select', label: '所属公司', field: {
903
+ type: 'select',
904
+ props: {
905
+ mode: 'multiple',
906
+ notFoundContent: '暂无数据',
907
+ allowClear: true,
908
+ showSearch: true,
909
+ showArrow: true,
910
+ maxTagCount: 1,
911
+ optionFilterProp: 'children',
912
+ filterOption: (input: string, option: { props: { children: string } }) =>
913
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
914
+ },
915
+ } },
916
+ { name: 'qp-email-like', label: '邮箱' },
917
+ { name: 'qp-officeTelephone-like', label: '手机号' },
918
+ ]
919
+ Promise.all([
920
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
921
+ pageSize: 5000,
922
+ currentPage: 1,
923
+ 'qp-companyType-eq': 20,
924
+ }),
925
+ ]).then((x: any)=>{
926
+ formatSource(x,0, 2, tableSearchForm);
927
+ })
928
+ modalTableProps = {
929
+ modalTableTitle: '选择员工',
930
+ tableSearchForm,
931
+ tableColumns: [
932
+ {
933
+ title: '员工编码',
934
+ dataIndex: 'employeeNumber',
935
+ },
936
+ {
937
+ title: '员工名称',
938
+ dataIndex: 'name',
939
+ },
940
+ {
941
+ title: '所属公司',
942
+ dataIndex: 'companyName',
943
+ },
944
+ {
945
+ title: '邮箱',
946
+ dataIndex: 'email',
947
+ },
948
+ {
949
+ title: '手机号',
950
+ dataIndex: 'officeTelephone',
951
+ },
952
+ ],
953
+ ...modalTableBusProps
954
+ }
955
+ }
956
+
957
+ // 配送方式选择器
958
+ if(type === 'deliveryMode') {
959
+ requestConfig = {
960
+ url: `${prefixUrl.selectPrefix}/deliveryMode`,
961
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
962
+ mappingTextField: 'name',
963
+ mappingTextShowKeyField: 'code',
964
+ mappingValueField: 'code',
965
+ otherParams: {
966
+ sorter: 'desc-id'
967
+ }, // 默认参数
968
+ sourceName: 'deliveryModeCode',
969
+ ...requestConfigProp
970
+ }
971
+ tableSearchForm = [
972
+ { name: 'qp-name-like', label: '配送方式名称' },
973
+ { name: 'qp-code-like', label: '配送方式编码' },
974
+ { name: 'qp-logisCompanyCode-in', type: 'select', label: '所属物流商', field: {
975
+ type: 'select',
976
+ props: {
977
+ mode: 'multiple',
978
+ notFoundContent: '暂无数据',
979
+ allowClear: true,
980
+ showSearch: true,
981
+ showArrow: true,
982
+ maxTagCount: 1,
983
+ optionFilterProp: 'children',
984
+ filterOption: (input: string, option: { props: { children: string } }) =>
985
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
986
+ },
987
+ } },
988
+ { name: 'qp-recordChannnelCode-in', type: 'select', label: '单号获取通道', initialSource: getDictionarySource('BSC00004') },
989
+ { name: 'qp-arrivalPaySupport-in', type: 'select', label: '是否支持到付', initialSource: arrivalPaySupportList },
990
+ { name: 'qp-sheetTemplateCode-in', type: 'select', label: '面单模板', field: {
991
+ type: 'select',
992
+ props: {
993
+ mode: 'multiple',
994
+ notFoundContent: '暂无数据',
995
+ allowClear: true,
996
+ showSearch: true,
997
+ showArrow: true,
998
+ maxTagCount: 1,
999
+ optionFilterProp: 'children',
1000
+ filterOption: (input: string, option: { props: { children: string } }) =>
1001
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1002
+ },
1003
+ } },
1004
+ { name: 'qp-remark-like', label: '备注' },
1005
+ ]
1006
+ Promise.all([
1007
+ loadSelectSource(`${prefixUrl.formSelectFix}/logisCompany`, {
1008
+ pageSize: 5000,
1009
+ currentPage: 1,
1010
+ }),
1011
+ loadSelectSource(`${prefixUrl.formSelectFix}/printTemplate`, {
1012
+ pageSize: 5000,
1013
+ currentPage: 1,
1014
+ })
1015
+ ]).then((x: any)=>{
1016
+ formatSource(x,0, 2, tableSearchForm);
1017
+ formatSource(x,1, 5, tableSearchForm);
1018
+ })
1019
+ modalTableProps = {
1020
+ modalTableTitle: '选择配送方式',
1021
+ tableSearchForm,
1022
+ tableColumns: [
1023
+ {
1024
+ title: '配送方式编码',
1025
+ dataIndex: 'code',
1026
+ },
1027
+ {
1028
+ title: '配送方式名称',
1029
+ dataIndex: 'name',
1030
+ },
1031
+ {
1032
+ title: '所属物流商',
1033
+ dataIndex: 'logisCompanyName',
1034
+ },
1035
+ {
1036
+ dataIndex: 'recordChannnelCode',
1037
+ title: '单号获取通道',
1038
+ render: (text: any) => getDictionaryTextByValue('BSC00004', text),
1039
+ },
1040
+ {
1041
+ dataIndex: 'arrivalPaySupport',
1042
+ title: '是否支持到付',
1043
+ render: (text: number) => arrivalPaySupportList.find((i: any) => i.value === text)?.text,
1044
+ },
1045
+ {
1046
+ dataIndex: 'sheetTemplateName',
1047
+ title: '面单模板',
1048
+ },
1049
+ {
1050
+ dataIndex: 'remark',
1051
+ title: '备注',
1052
+ },
1053
+ ],
1054
+ ...modalTableBusProps
1055
+ }
1056
+ }
1057
+
1058
+ return { modalTableProps, requestConfig, needModalTable };
1059
+ }