@bit-sun/business-component 1.1.21 → 1.1.24

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 (29) hide show
  1. package/package.json +1 -1
  2. package/src/components/Business/CommodityEntry/index.md +69 -0
  3. package/src/components/Business/CommodityEntry/index.tsx +75 -0
  4. package/src/components/Business/SearchSelect/BusinessUtils.ts +888 -0
  5. package/src/components/Business/SearchSelect/common.ts +34 -0
  6. package/src/components/Business/SearchSelect/index.md +906 -0
  7. package/src/components/{SearchSelect/business/BusinessSearchSelect.tsx → Business/SearchSelect/index.tsx} +3 -2
  8. package/src/components/Business/SearchSelect/utils.ts +71 -0
  9. package/src/components/{DataValidation → Functional/DataValidation}/index.less +0 -0
  10. package/src/components/{DataValidation → Functional/DataValidation}/index.md +3 -3
  11. package/src/components/{DataValidation → Functional/DataValidation}/index.tsx +1 -1
  12. package/src/components/{QueryMutipleInput → Functional/QueryMutipleInput}/index.less +0 -0
  13. package/src/components/{QueryMutipleInput → Functional/QueryMutipleInput}/index.md +3 -3
  14. package/src/components/{QueryMutipleInput → Functional/QueryMutipleInput}/index.tsx +0 -0
  15. package/src/components/{SearchSelect → Functional/SearchSelect}/index.less +0 -0
  16. package/src/components/{SearchSelect → Functional/SearchSelect}/index.md +14 -11
  17. package/src/components/{SearchSelect → Functional/SearchSelect}/index.tsx +226 -106
  18. package/src/index.ts +5 -4
  19. package/dist/components/DataValidation/index.d.ts +0 -144
  20. package/dist/components/QueryMutipleInput/index.d.ts +0 -5
  21. package/dist/components/SearchSelect/business/BusinessSearchSelect.d.ts +0 -2
  22. package/dist/components/SearchSelect/business/BusinessUtils.d.ts +0 -22
  23. package/dist/components/SearchSelect/index.d.ts +0 -3
  24. package/dist/index.d.ts +0 -5
  25. package/dist/index.esm.js +0 -3723
  26. package/dist/index.js +0 -3738
  27. package/dist/utils/CheckOneUser/index.d.ts +0 -2
  28. package/src/components/SearchSelect/business/BusinessUtils.ts +0 -464
  29. package/src/components/SearchSelect/business/index.md +0 -181
@@ -0,0 +1,888 @@
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) {
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
+ }
18
+
19
+ /*
20
+ * 处理 格式化下拉框数据源
21
+ * reData 必传 promise返回响应的数据 格式为[{},{},{},...] Promise.all第一个参数数组有多少个数组长度就是多少,其中每个对象为每次请求的结果数据
22
+ * 每个结果数据格式为{ status: '0', msg: 'success', data: { items: [], total: 1, size: 1, page: 1 }, traceId: 'baba..'}
23
+ * position 必传 为获取Promise.all请求结果的位置
24
+ * changePosition 必传 为搜索表单Form中需要更改数据源的Item项的位置
25
+ * changeSearchForm 必传 为搜索表单Form数据
26
+ * */
27
+ const formatSource = (reData: any, position: number, changePosition: number,changeSearchForm: any,resKeyValue=['code', 'name']) => {
28
+ const data = reData && reData[position]?.data;
29
+ const list = Array.isArray(data) ? data :(data?.items || data?.list || []);
30
+ const formatData = list?.length ? list.map((v: any) => ({ text: v[resKeyValue[1]], value: v[resKeyValue[0]] })) : [];
31
+ changeSearchForm[changePosition] = {...changeSearchForm[changePosition], initialSource: formatData}
32
+ }
33
+
34
+ // 格式化树选择器数据源
35
+ const mapSearchTree = (treeDataItem: any, resKeyValue: any) => {
36
+ const haveChildren = Array.isArray(treeDataItem.children) && treeDataItem.children.length > 0;
37
+ return {
38
+ title: treeDataItem[resKeyValue[1]],
39
+ value: treeDataItem[resKeyValue[0]],
40
+ parentId: treeDataItem.parent,
41
+ data: { ...treeDataItem },
42
+ isLeaf: !haveChildren,
43
+ disabled: haveChildren,
44
+ children: haveChildren ? treeDataItem.children.map((i: any) => mapSearchTree(i, resKeyValue)) : [],
45
+ };
46
+ };
47
+ const formatTreeDataSource = (reData: any, position: number, changePosition: number,changeSearchForm: any,resKeyValue=['id', 'name']) => {
48
+ const data = reData && reData[position]?.data;
49
+ const formatData = (data &&
50
+ Array.isArray(data) &&
51
+ data.length &&
52
+ data.map((ites: any) => mapSearchTree(ites, resKeyValue))) ||
53
+ []
54
+ changeSearchForm[changePosition].field.props.treeData = formatData;
55
+ }
56
+
57
+
58
+ let tableSearchForm: any [] = [];
59
+ // 供应商选择器
60
+ if(type === 'supplier') {
61
+ tableSearchForm = [
62
+ { name: 'qp-name-like', label: '供应商名称' }, // field: { type: 'input', props: { placeholder: '请输入'}}
63
+ { name: 'qp-code-like', label: '供应商编码' },
64
+ { name: 'qp-conglomerateCode-in', type: 'select', label: '归属集团', field: {
65
+ type: 'select',
66
+ props: {
67
+ mode: 'multiple',
68
+ notFoundContent: '暂无数据',
69
+ allowClear: true,
70
+ showSearch: true,
71
+ showArrow: true,
72
+ maxTagCount: 1,
73
+ optionFilterProp: 'children',
74
+ filterOption: (input: string, option: { props: { children: string } }) =>
75
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
76
+ },
77
+ } },
78
+ { name: 'qp-accountingCode-in', type: 'select', label: '归属核算主体', field: {
79
+ type: 'select',
80
+ props: {
81
+ mode: 'multiple',
82
+ notFoundContent: '暂无数据',
83
+ allowClear: true,
84
+ showSearch: true,
85
+ showArrow: true,
86
+ maxTagCount: 1,
87
+ optionFilterProp: 'children',
88
+ filterOption: (input: string, option: { props: { children: string } }) =>
89
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
90
+ },
91
+ } },
92
+ { name: 'qp-companyCode-in', type: 'select', label: '归属法人公司', field: {
93
+ type: 'select',
94
+ props: {
95
+ mode: 'multiple',
96
+ notFoundContent: '暂无数据',
97
+ allowClear: true,
98
+ showSearch: true,
99
+ showArrow: true,
100
+ maxTagCount: 1,
101
+ optionFilterProp: 'children',
102
+ filterOption: (input: string, option: { props: { children: string } }) =>
103
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
104
+ },
105
+ } },
106
+ { name: 'qp-sharingType-eq', type: 'select', label: '共享类型', initialSource: sharingTypeDataList },
107
+ ]
108
+ Promise.all([
109
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
110
+ pageSize: 5000,
111
+ currentPage: 1,
112
+ 'qp-companyType-eq': '30',
113
+ }),
114
+ loadSelectSource(`${prefixUrl.formSelectFix}/accountingSubject`, {
115
+ pageSize: 5000,
116
+ currentPage: 1,
117
+ }),
118
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
119
+ pageSize: 5000,
120
+ currentPage: 1,
121
+ 'qp-companyType-eq': '20',
122
+ })
123
+ ]).then((x: any)=>{
124
+ formatSource(x,0, 2, tableSearchForm);
125
+ formatSource(x,1, 3, tableSearchForm);
126
+ formatSource(x,2, 4, tableSearchForm);
127
+ })
128
+ }
129
+ let modalTableProps = {
130
+ modalTableTitle: '选择供应商',
131
+ tableSearchForm,
132
+ tableColumns: [
133
+ {
134
+ title: '供应商编码',
135
+ dataIndex: 'code',
136
+ },
137
+ {
138
+ title: '供应商名称',
139
+ dataIndex: 'name',
140
+ },
141
+ {
142
+ title: '归属集团',
143
+ dataIndex: 'conglomerateName',
144
+ },
145
+ {
146
+ title: '归属法人公司',
147
+ dataIndex: 'legalCompanyName',
148
+ },
149
+ {
150
+ title: '归属核算主体',
151
+ dataIndex: 'accountingName',
152
+ },
153
+ {
154
+ title: '共享类型',
155
+ dataIndex: 'sharingType',
156
+ render: (text: number) => hasDictSharingType ? getDictionaryTextByValue('UC000013', text) : sharingType.find((i: any) => i.value === text)?.text
157
+ },
158
+ ]
159
+ }
160
+ let needModalTable = true;
161
+
162
+ // 商品选择器
163
+ if(type === 'skuCommodity') {
164
+ requestConfig = {
165
+ url: `${prefixUrl.selectPrefix}/sku`,
166
+ filter: 'qp-name,skuCode-orGroup,like', // 过滤参数
167
+ mappingTextField: 'name',
168
+ mappingValueField: 'skuCode',
169
+ otherParams: {
170
+ 'qp-approveStatus-eq':2,
171
+ sorter: 'desc-id'
172
+ }, // 默认参数
173
+ sourceName: 'skuCode',
174
+ }
175
+ tableSearchForm = [
176
+ { name: 'qp-name-like', label: 'SKU名称' },
177
+ { name: 'qp-skuCode-like', label: 'SKU编码' },
178
+ { name: 'qp-barCode-like', label: '条形码' },
179
+ { name: 'qp-itemName-like', label: '所属SPU名称' },
180
+ { name: 'qp-itemCode-like', label: '所属SPU编码' },
181
+ { name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
182
+ type: 'select',
183
+ props: {
184
+ mode: 'multiple',
185
+ notFoundContent: '暂无数据',
186
+ allowClear: true,
187
+ showSearch: true,
188
+ showArrow: true,
189
+ maxTagCount: 1,
190
+ optionFilterProp: 'children',
191
+ filterOption: (input: string, option: { props: { children: string } }) =>
192
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
193
+ },
194
+ } },
195
+ { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
196
+ type: 'treeSelect',
197
+ props: {
198
+ treeData: [],
199
+ treeCheckable: true,
200
+ showSearch: true,
201
+ allowClear: true,
202
+ showArrow: true,
203
+ treeNodeFilterProp: 'title',
204
+ treeDefaultExpandAll: true,
205
+ maxTagCount: 1,
206
+ placeholder: '请选择',
207
+ style: {
208
+ width: '100%',
209
+ },
210
+ dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
211
+ },
212
+ } },
213
+ { name: 'qp-classId-in', type: 'select', label: '品类', field: {
214
+ type: 'select',
215
+ props: {
216
+ mode: 'multiple',
217
+ notFoundContent: '暂无数据',
218
+ allowClear: true,
219
+ showSearch: true,
220
+ showArrow: true,
221
+ maxTagCount: 1,
222
+ optionFilterProp: 'children',
223
+ filterOption: (input: string, option: { props: { children: string } }) =>
224
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
225
+ },
226
+ } },
227
+ ]
228
+ Promise.all([
229
+ loadSelectSource(`${prefixUrl.formSelectFix}/brand/queryBrandList`, {
230
+ pageSize: 5000,
231
+ currentPage: 1,
232
+ }),
233
+ loadSelectSource(`${prefixUrl.formSelectFix}/category/queryCategoryTree`, {
234
+ pageSize: 5000,
235
+ currentPage: 1,
236
+ }),
237
+ loadSelectSource(`${prefixUrl.formSelectFix}/class/withProperty`, {
238
+ pageSize: 5000,
239
+ currentPage: 1,
240
+ }),
241
+ ]).then((x: any)=>{
242
+ formatSource(x,0, 5, tableSearchForm,['id','name']);
243
+ formatTreeDataSource(x,1, 6, tableSearchForm);
244
+ formatSource(x,2, 7, tableSearchForm,['id','name']);
245
+ })
246
+ modalTableProps = {
247
+ modalTableTitle: '选择SKU',
248
+ tableSearchForm,
249
+ tableColumns: [
250
+ {
251
+ title: 'SKU编码',
252
+ dataIndex: 'skuCode',
253
+ },
254
+ {
255
+ title: 'SKU名称',
256
+ dataIndex: 'name',
257
+ },
258
+ {
259
+ title: '所属SPU',
260
+ dataIndex: 'itemName',
261
+ },
262
+ {
263
+ title: '规格',
264
+ dataIndex: 'skuSpec',
265
+ },
266
+ {
267
+ title: '类目',
268
+ dataIndex: 'categoryName',
269
+ },
270
+ {
271
+ title: '品类',
272
+ dataIndex: 'className',
273
+ },
274
+ {
275
+ title: '品牌',
276
+ dataIndex: 'brandName',
277
+ },
278
+ {
279
+ title: '条形码',
280
+ dataIndex: 'barCode',
281
+ },
282
+ ]
283
+ }
284
+ }
285
+
286
+ // 仓库选择器(物理、逻辑仓)
287
+ if(type === 'physicalWarehouse') {
288
+ requestConfig = {
289
+ url: `${prefixUrl.selectPrefix}/physicalWarehouse`,
290
+ filter: 'qp-physicalWarehouseName,physicalWarehouseCode-orGroup,like', // 过滤参数
291
+ mappingTextField: 'physicalWarehouseName',
292
+ mappingTextShowKeyField: 'physicalWarehouseCode',
293
+ mappingValueField: 'id',
294
+ otherParams: {
295
+ 'qp-isEnable-eq': 1,
296
+ sorter: 'desc-id'
297
+ }, // 默认参数
298
+ sourceName: 'warehouseIds',
299
+ }
300
+ tableSearchForm = [
301
+ { name: 'qp-physicalWarehouseName-like', label: '物理仓名称' },
302
+ { name: 'qp-physicalWarehouseCode-like', label: '物理仓编码' },
303
+ { name: 'qp-physicalWarehouseType-eq', type: 'select', label: '物理仓类型', initialSource: getDictionarySource('SC00002') },
304
+ { name: 'qp-companyCode-eq', type: 'select', label: '所属公司', field: {
305
+ type: 'select',
306
+ props: {
307
+ mode: 'multiple',
308
+ notFoundContent: '暂无数据',
309
+ allowClear: true,
310
+ showSearch: true,
311
+ showArrow: true,
312
+ maxTagCount: 1,
313
+ optionFilterProp: 'children',
314
+ filterOption: (input: string, option: { props: { children: string } }) =>
315
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
316
+ },
317
+ } },
318
+ ]
319
+ Promise.all([
320
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
321
+ pageSize: 5000,
322
+ currentPage: 1,
323
+ 'qp-companyType-eq': 20,
324
+ }),
325
+ ]).then((x: any)=>{
326
+ formatSource(x,0, 3, tableSearchForm);
327
+ })
328
+ modalTableProps = {
329
+ modalTableTitle: '选择物理仓',
330
+ tableSearchForm,
331
+ tableColumns: [
332
+ {
333
+ title: '物理仓编码',
334
+ dataIndex: 'physicalWarehouseCode',
335
+ },
336
+ {
337
+ title: '物理仓名称',
338
+ dataIndex: 'physicalWarehouseName',
339
+ },
340
+ {
341
+ title: '物理仓类型',
342
+ dataIndex: 'physicalWarehouseType',
343
+ render: (text: number) => getDictionaryTextByValue('SC00002', text),
344
+ },
345
+ {
346
+ title: '所属公司',
347
+ dataIndex: 'companyName',
348
+ },
349
+ ]
350
+ }
351
+ }
352
+ if(type === 'realWarehouse') {
353
+ requestConfig = {
354
+ url: `${prefixUrl.selectPrefix}/realWarehouse`,
355
+ filter: 'qp-realWarehouseName,realWarehouseCode-orGroup,like', // 过滤参数
356
+ mappingTextField: 'realWarehouseName',
357
+ mappingTextShowKeyField: 'realWarehouseCode',
358
+ mappingValueField: 'id',
359
+ otherParams: {
360
+ 'qp-isEnable-eq': 1,
361
+ sorter: 'desc-id'
362
+ }, // 默认参数
363
+ sourceName: 'warehouseIds',
364
+ }
365
+ tableSearchForm = [
366
+ { name: 'qp-realWarehouseName-like', label: '逻辑仓名称' },
367
+ { name: 'qp-realWarehouseCode-like', label: '逻辑仓编码' },
368
+ { name: 'qp-realWarehouseType-eq', type: 'select', label: '逻辑仓类型', initialSource: getDictionarySource('SC00004') },
369
+ ]
370
+ modalTableProps = {
371
+ modalTableTitle: '选择逻辑仓',
372
+ tableSearchForm,
373
+ tableColumns: [
374
+ {
375
+ title: '逻辑仓编码',
376
+ dataIndex: 'realWarehouseCode',
377
+ },
378
+ {
379
+ title: '逻辑仓名称',
380
+ dataIndex: 'realWarehouseName',
381
+ },
382
+ {
383
+ title: '逻辑仓类型',
384
+ dataIndex: 'realWarehouseType',
385
+ render: (text: number) => getDictionaryTextByValue('SC00004', text),
386
+ },
387
+ ]
388
+ }
389
+ }
390
+
391
+ // 仓库选择器(虚拟、渠道仓)(无弹窗)
392
+ if(type === 'virtualWarehouse') {
393
+ requestConfig = {
394
+ url: `${prefixUrl.selectPrefix}/virtualWarehouse`,
395
+ filter: 'qp-virtualWarehouseName,virtualWarehouseCode-orGroup,like', // 过滤参数
396
+ mappingTextField: 'virtualWarehouseName',
397
+ mappingTextShowKeyField: 'virtualWarehouseCode',
398
+ mappingValueField: 'id',
399
+ otherParams: {
400
+ 'qp-isEnable-eq': 1,
401
+ sorter: 'desc-id'
402
+ }, // 默认参数
403
+ sourceName: 'warehouseIds',
404
+ }
405
+ needModalTable = false
406
+ }
407
+ if(type === 'channelWarehouse') {
408
+ requestConfig = {
409
+ url: `${prefixUrl.selectPrefix}/channelWarehouse`,
410
+ filter: 'qp-channelWarehouseName,channelWarehouseCode-orGroup,like', // 过滤参数
411
+ mappingTextField: 'channelWarehouseName',
412
+ mappingTextShowKeyField: 'channelWarehouseCode',
413
+ mappingValueField: 'id',
414
+ otherParams: {
415
+ 'qp-isEnable-eq': 1,
416
+ sorter: 'desc-id'
417
+ }, // 默认参数
418
+ sourceName: 'warehouseIds',
419
+ }
420
+ needModalTable = false
421
+ }
422
+
423
+ // 客户选择器
424
+ if(type === 'customer') {
425
+ requestConfig = {
426
+ url: `${prefixUrl.selectPrefix}/uc/customer/v2`,
427
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
428
+ mappingTextField: 'name',
429
+ mappingValueField: 'code',
430
+ otherParams: {
431
+ sorter: 'desc-id'
432
+ }, // 默认参数
433
+ sourceName: 'customCode',
434
+ }
435
+ tableSearchForm = [
436
+ { name: 'qp-name-like', label: '客户名称' },
437
+ { name: 'qp-code-like', label: '客户编码' },
438
+ { name: 'qp-conglomerateCode-in', type: 'select', label: '归属集团', field: {
439
+ type: 'select',
440
+ props: {
441
+ mode: 'multiple',
442
+ notFoundContent: '暂无数据',
443
+ allowClear: true,
444
+ showSearch: true,
445
+ showArrow: true,
446
+ maxTagCount: 1,
447
+ optionFilterProp: 'children',
448
+ filterOption: (input: string, option: { props: { children: string } }) =>
449
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
450
+ },
451
+ } },
452
+ { name: 'qp-accountingCode-in', type: 'select', label: '归属核算主体', field: {
453
+ type: 'select',
454
+ props: {
455
+ mode: 'multiple',
456
+ notFoundContent: '暂无数据',
457
+ allowClear: true,
458
+ showSearch: true,
459
+ showArrow: true,
460
+ maxTagCount: 1,
461
+ optionFilterProp: 'children',
462
+ filterOption: (input: string, option: { props: { children: string } }) =>
463
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
464
+ },
465
+ } },
466
+ { name: 'qp-companyCode-in', type: 'select', label: '归属法人公司', field: {
467
+ type: 'select',
468
+ props: {
469
+ mode: 'multiple',
470
+ notFoundContent: '暂无数据',
471
+ allowClear: true,
472
+ showSearch: true,
473
+ showArrow: true,
474
+ maxTagCount: 1,
475
+ optionFilterProp: 'children',
476
+ filterOption: (input: string, option: { props: { children: string } }) =>
477
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
478
+ },
479
+ } },
480
+ { name: 'qp-sharingType-eq', type: 'select', label: '共享类型', initialSource: sharingTypeDataList },
481
+ ]
482
+ Promise.all([
483
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
484
+ pageSize: 5000,
485
+ currentPage: 1,
486
+ 'qp-companyType-eq': '30',
487
+ }),
488
+ loadSelectSource(`${prefixUrl.formSelectFix}/accountingSubject`, {
489
+ pageSize: 5000,
490
+ currentPage: 1,
491
+ }),
492
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
493
+ pageSize: 5000,
494
+ currentPage: 1,
495
+ 'qp-companyType-eq': '20',
496
+ })
497
+ ]).then((x: any)=>{
498
+ formatSource(x,0, 2, tableSearchForm);
499
+ formatSource(x,1, 3, tableSearchForm);
500
+ formatSource(x,2, 4, tableSearchForm);
501
+ })
502
+ modalTableProps = {
503
+ modalTableTitle: '选择客户',
504
+ tableSearchForm,
505
+ tableColumns: [
506
+ {
507
+ title: '客户编码',
508
+ dataIndex: 'code',
509
+ },
510
+ {
511
+ title: '客户名称',
512
+ dataIndex: 'name',
513
+ },
514
+ {
515
+ title: '归属集团',
516
+ dataIndex: 'conglomerateName',
517
+ },
518
+ {
519
+ title: '归属法人公司',
520
+ dataIndex: 'legalCompanyName',
521
+ },
522
+ {
523
+ title: '归属核算主体',
524
+ dataIndex: 'accountingName',
525
+ },
526
+ {
527
+ title: '共享类型',
528
+ dataIndex: 'sharingType',
529
+ render: (text: number) => hasDictSharingType ? getDictionaryTextByValue('UC000013', text) : sharingType.find((i: any) => i.value === text)?.text,
530
+ },
531
+ ]
532
+ }
533
+ }
534
+
535
+ // 店铺选择器
536
+ if(type === 'shopFile') {
537
+ requestConfig = {
538
+ url: `${prefixUrl.selectPrefix}/store`,
539
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
540
+ mappingTextField: 'name',
541
+ mappingValueField: 'code',
542
+ otherParams: {
543
+ sorter: 'desc-id'
544
+ }, // 默认参数
545
+ sourceName: 'code',
546
+ }
547
+ tableSearchForm = [
548
+ { name: 'qp-name-like', label: '店铺名称' },
549
+ { name: 'qp-code-like', label: '店铺编码' },
550
+ { name: 'qp-conglomerateCode-in', type: 'select', label: '归属集团', field: {
551
+ type: 'select',
552
+ props: {
553
+ mode: 'multiple',
554
+ notFoundContent: '暂无数据',
555
+ allowClear: true,
556
+ showSearch: true,
557
+ showArrow: true,
558
+ maxTagCount: 1,
559
+ optionFilterProp: 'children',
560
+ filterOption: (input: string, option: { props: { children: string } }) =>
561
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
562
+ },
563
+ } },
564
+ { name: 'qp-companyCode-in', type: 'select', label: '归属法人公司', field: {
565
+ type: 'select',
566
+ props: {
567
+ mode: 'multiple',
568
+ notFoundContent: '暂无数据',
569
+ allowClear: true,
570
+ showSearch: true,
571
+ showArrow: true,
572
+ maxTagCount: 1,
573
+ optionFilterProp: 'children',
574
+ filterOption: (input: string, option: { props: { children: string } }) =>
575
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
576
+ },
577
+ } },
578
+ { name: 'qp-type-in', type: 'select', label: '店铺类型', initialSource: shopFileType },
579
+ { name: 'qp-plateformCode-in', type: 'select', label: '店铺来源', field: {
580
+ type: 'select',
581
+ props: {
582
+ mode: 'multiple',
583
+ notFoundContent: '暂无数据',
584
+ allowClear: true,
585
+ showSearch: true,
586
+ showArrow: true,
587
+ maxTagCount: 1,
588
+ optionFilterProp: 'children',
589
+ filterOption: (input: string, option: { props: { children: string } }) =>
590
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
591
+ },
592
+ } },
593
+ { name: 'qp-accountingCode-in', type: 'select', label: '归属核算主体', field: {
594
+ type: 'select',
595
+ props: {
596
+ mode: 'multiple',
597
+ notFoundContent: '暂无数据',
598
+ allowClear: true,
599
+ showSearch: true,
600
+ showArrow: true,
601
+ maxTagCount: 1,
602
+ optionFilterProp: 'children',
603
+ filterOption: (input: string, option: { props: { children: string } }) =>
604
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
605
+ },
606
+ } },
607
+ ]
608
+ Promise.all([
609
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
610
+ pageSize: 5000,
611
+ currentPage: 1,
612
+ 'qp-companyType-eq': '30',
613
+ }),
614
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
615
+ pageSize: 5000,
616
+ currentPage: 1,
617
+ 'qp-companyType-eq': '20',
618
+ }),
619
+ loadSelectSource(`${prefixUrl.formSelectFix}/platformRecord/getPlatformRecordList`, {
620
+ // pageSize: 5000,
621
+ // currentPage: 1,
622
+ 'qp-status-eq': '1',
623
+ }),
624
+ loadSelectSource(`${prefixUrl.formSelectFix}/accountingSubject`, {
625
+ pageSize: 5000,
626
+ currentPage: 1,
627
+ }),
628
+ ]).then((x: any)=>{
629
+ formatSource(x,0, 2, tableSearchForm);
630
+ formatSource(x,1, 3, tableSearchForm);
631
+ formatSource(x,2, 5, tableSearchForm);
632
+ formatSource(x,3, 6, tableSearchForm);
633
+ })
634
+ modalTableProps = {
635
+ modalTableTitle: '选择店铺',
636
+ tableSearchForm,
637
+ tableColumns: [
638
+ {
639
+ title: '店铺编码',
640
+ dataIndex: 'code',
641
+ },
642
+ {
643
+ title: '店铺名称',
644
+ dataIndex: 'name',
645
+ },
646
+ {
647
+ title: '归属集团',
648
+ dataIndex: 'conglomerateName',
649
+ },
650
+ {
651
+ title: '归属法人公司',
652
+ dataIndex: 'companyName',
653
+ },
654
+ {
655
+ title: '店铺类型',
656
+ dataIndex: 'type',
657
+ render: (text: number) => shopFileType.find((i: any) => i.value === text)?.text,
658
+ },
659
+ {
660
+ title: '店铺来源',
661
+ dataIndex: 'platformName',
662
+ },
663
+ {
664
+ title: '归属核算主体',
665
+ dataIndex: 'accountingName',
666
+ },
667
+ ]
668
+ }
669
+ }
670
+
671
+ // 核算主体选择器(无弹窗)
672
+ if(type === 'accountingSubject') {
673
+ requestConfig = {
674
+ url: `${prefixUrl.selectPrefix}/accountingSubject`,
675
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
676
+ mappingTextField: 'name',
677
+ mappingTextShowKeyField: 'code',
678
+ mappingValueField: 'id',
679
+ otherParams: {
680
+ sorter: 'desc-id'
681
+ }, // 默认参数
682
+ sourceName: 'accountingSubjectCode',
683
+ }
684
+ needModalTable = false
685
+ }
686
+ // 库存组织选择器(无弹窗)
687
+ if(type === 'inventoryOrg') {
688
+ requestConfig = {
689
+ url: `${prefixUrl.selectPrefix}/inventoryOrg`,
690
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
691
+ mappingTextField: 'name',
692
+ mappingTextShowKeyField: 'code',
693
+ mappingValueField: 'id',
694
+ otherParams: {
695
+ sorter: 'desc-id'
696
+ }, // 默认参数
697
+ sourceName: 'inventoryOrgCode',
698
+ }
699
+ needModalTable = false
700
+ }
701
+ // 法人公司选择器(无弹窗)
702
+ if(type === 'corporationCompany') {
703
+ requestConfig = {
704
+ url: `${prefixUrl.selectPrefix}/company`,
705
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
706
+ mappingTextField: 'name',
707
+ mappingTextShowKeyField: 'code',
708
+ mappingValueField: 'id',
709
+ otherParams: {
710
+ sorter: 'desc-id'
711
+ }, // 默认参数
712
+ sourceName: 'corporationCompany',
713
+ }
714
+ needModalTable = false
715
+ }
716
+
717
+ // 员工选择器
718
+ if(type === 'employee') {
719
+ requestConfig = {
720
+ url: `${prefixUrl.selectPrefix}/employee/v2`,
721
+ filter: 'qp-name,employeeNumber-orGroup,like', // 过滤参数
722
+ mappingTextField: 'name',
723
+ mappingTextShowKeyField: 'employeeNumber',
724
+ mappingValueField: 'employeeNumber',
725
+ otherParams: {
726
+ 'qp-enable-eq': 10, // 启用状态 10-启用,20-禁用
727
+ sorter: 'desc-id'
728
+ }, // 默认参数
729
+ sourceName: 'employeeNumber',
730
+ }
731
+ tableSearchForm = [
732
+ { name: 'qp-name-like', label: '员工名称' },
733
+ { name: 'qp-employeeNumber-like', label: '员工编码' },
734
+ { name: 'qp-companyCode-in', type: 'select', label: '所属公司', field: {
735
+ type: 'select',
736
+ props: {
737
+ mode: 'multiple',
738
+ notFoundContent: '暂无数据',
739
+ allowClear: true,
740
+ showSearch: true,
741
+ showArrow: true,
742
+ maxTagCount: 1,
743
+ optionFilterProp: 'children',
744
+ filterOption: (input: string, option: { props: { children: string } }) =>
745
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
746
+ },
747
+ } },
748
+ { name: 'qp-email-like', label: '邮箱' },
749
+ { name: 'qp-officeTelephone-like', label: '手机号' },
750
+ ]
751
+ Promise.all([
752
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
753
+ pageSize: 5000,
754
+ currentPage: 1,
755
+ 'qp-companyType-eq': 20,
756
+ }),
757
+ ]).then((x: any)=>{
758
+ formatSource(x,0, 2, tableSearchForm);
759
+ })
760
+ modalTableProps = {
761
+ modalTableTitle: '选择员工',
762
+ tableSearchForm,
763
+ tableColumns: [
764
+ {
765
+ title: '员工编码',
766
+ dataIndex: 'employeeNumber',
767
+ },
768
+ {
769
+ title: '员工名称',
770
+ dataIndex: 'name',
771
+ },
772
+ {
773
+ title: '所属公司',
774
+ dataIndex: 'companyName',
775
+ },
776
+ {
777
+ title: '邮箱',
778
+ dataIndex: 'email',
779
+ },
780
+ {
781
+ title: '手机号',
782
+ dataIndex: 'officeTelephone',
783
+ },
784
+ ]
785
+ }
786
+ }
787
+
788
+ // 配送方式选择器
789
+ if(type === 'deliveryMode') {
790
+ requestConfig = {
791
+ url: `${prefixUrl.selectPrefix}/deliveryMode`,
792
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
793
+ mappingTextField: 'name',
794
+ mappingTextShowKeyField: 'code',
795
+ mappingValueField: 'code',
796
+ otherParams: {
797
+ sorter: 'desc-id'
798
+ }, // 默认参数
799
+ sourceName: 'deliveryModeCode',
800
+ }
801
+ tableSearchForm = [
802
+ { name: 'qp-name-like', label: '配送方式名称' },
803
+ { name: 'qp-code-like', label: '配送方式编码' },
804
+ { name: 'qp-logisCompanyCode-in', type: 'select', label: '所属物流商', field: {
805
+ type: 'select',
806
+ props: {
807
+ mode: 'multiple',
808
+ notFoundContent: '暂无数据',
809
+ allowClear: true,
810
+ showSearch: true,
811
+ showArrow: true,
812
+ maxTagCount: 1,
813
+ optionFilterProp: 'children',
814
+ filterOption: (input: string, option: { props: { children: string } }) =>
815
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
816
+ },
817
+ } },
818
+ { name: 'qp-recordChannnelCode-in', type: 'select', label: '单号获取通道', initialSource: getDictionarySource('BSC00004') },
819
+ { name: 'qp-arrivalPaySupport-in', type: 'select', label: '是否支持到付', initialSource: arrivalPaySupportList },
820
+ { name: 'qp-sheetTemplateCode-in', type: 'select', label: '面单模板', field: {
821
+ type: 'select',
822
+ props: {
823
+ mode: 'multiple',
824
+ notFoundContent: '暂无数据',
825
+ allowClear: true,
826
+ showSearch: true,
827
+ showArrow: true,
828
+ maxTagCount: 1,
829
+ optionFilterProp: 'children',
830
+ filterOption: (input: string, option: { props: { children: string } }) =>
831
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
832
+ },
833
+ } },
834
+ { name: 'qp-remark-like', label: '备注' },
835
+ ]
836
+ Promise.all([
837
+ loadSelectSource(`${prefixUrl.formSelectFix}/logisCompany`, {
838
+ pageSize: 5000,
839
+ currentPage: 1,
840
+ }),
841
+ loadSelectSource(`${prefixUrl.formSelectFix}/printTemplate`, {
842
+ pageSize: 5000,
843
+ currentPage: 1,
844
+ })
845
+ ]).then((x: any)=>{
846
+ formatSource(x,0, 2, tableSearchForm);
847
+ formatSource(x,1, 5, tableSearchForm);
848
+ })
849
+ modalTableProps = {
850
+ modalTableTitle: '选择配送方式',
851
+ tableSearchForm,
852
+ tableColumns: [
853
+ {
854
+ title: '配送方式编码',
855
+ dataIndex: 'code',
856
+ },
857
+ {
858
+ title: '配送方式名称',
859
+ dataIndex: 'name',
860
+ },
861
+ {
862
+ title: '所属物流商',
863
+ dataIndex: 'logisCompanyName',
864
+ },
865
+ {
866
+ dataIndex: 'recordChannnelCode',
867
+ title: '单号获取通道',
868
+ render: (text: any) => getDictionaryTextByValue('BSC00004', text),
869
+ },
870
+ {
871
+ dataIndex: 'arrivalPaySupport',
872
+ title: '是否支持到付',
873
+ render: (text: number) => arrivalPaySupportList.find((i: any) => i.value === text)?.text,
874
+ },
875
+ {
876
+ dataIndex: 'sheetTemplateName',
877
+ title: '面单模板',
878
+ },
879
+ {
880
+ dataIndex: 'remark',
881
+ title: '备注',
882
+ },
883
+ ]
884
+ }
885
+ }
886
+
887
+ return { modalTableProps, requestConfig, needModalTable };
888
+ }