@bit-sun/business-component 2.0.12 → 2.0.13

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