@bit-sun/business-component 2.1.7 → 2.1.9

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