@bit-sun/business-component 2.2.0 → 2.2.2

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 (188) hide show
  1. package/.editorconfig +16 -16
  2. package/.fatherrc.ts +5 -5
  3. package/.gitlab-ci.yml +179 -179
  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/components/Business/BsLayouts/Components/AllFunc/drawContent.d.ts +1 -1
  9. package/dist/components/Business/BsLayouts/Components/AllFunc/index.d.ts +1 -1
  10. package/dist/components/Business/BsLayouts/Components/RightContent/index.d.ts +2 -2
  11. package/dist/components/Business/BsLayouts/Components/SearchFunc/index.d.ts +2 -2
  12. package/dist/components/Business/BsLayouts/index.d.ts +2 -2
  13. package/dist/components/Business/BsSulaQueryTable/utils.d.ts +2 -2
  14. package/dist/index.d.ts +1 -0
  15. package/dist/index.esm.js +7804 -9105
  16. package/dist/index.js +7803 -9103
  17. package/dist/plugin/TableColumnSetting/index.d.ts +64 -0
  18. package/dist/plugin/TableColumnSetting/utils.d.ts +1 -0
  19. package/dist/utils/LocalstorageUtils.d.ts +2 -0
  20. package/dist/utils/TableUtils.d.ts +2 -2
  21. package/dist/utils/utils.d.ts +1 -1
  22. package/docs/index.md +21 -21
  23. package/lib/assets/drag.svg +17 -17
  24. package/lib/assets/exportFail.svg +37 -37
  25. package/lib/assets/exportProcessing.svg +28 -28
  26. package/lib/assets/exportSuccess.svg +34 -34
  27. package/lib/assets/label_icon_bottom.svg +25 -25
  28. package/lib/assets/upExport.svg +22 -22
  29. package/package.json +77 -77
  30. package/src/assets/32.svg +27 -27
  31. package/src/assets/addIcon.svg +17 -17
  32. package/src/assets/allfunc.svg +27 -27
  33. package/src/assets/arrowRight.svg +24 -24
  34. package/src/assets/btn-delete.svg +29 -29
  35. package/src/assets/btn-edit.svg +19 -19
  36. package/src/assets/btn-more.svg +17 -17
  37. package/src/assets/btn-submit.svg +19 -19
  38. package/src/assets/caidan.svg +11 -11
  39. package/src/assets/close.svg +26 -26
  40. package/src/assets/drag.svg +17 -17
  41. package/src/assets/exportFail.svg +37 -37
  42. package/src/assets/exportProcessing.svg +28 -28
  43. package/src/assets/exportSuccess.svg +34 -34
  44. package/src/assets/fixed-left-active.svg +11 -11
  45. package/src/assets/fixed-left.svg +15 -15
  46. package/src/assets/fixed-right-active.svg +11 -11
  47. package/src/assets/fixed-right.svg +15 -15
  48. package/src/assets/guanbi.svg +15 -15
  49. package/src/assets/icon-quanping.svg +15 -15
  50. package/src/assets/icon-shezhi.svg +17 -17
  51. package/src/assets/label_icon_bottom.svg +25 -25
  52. package/src/assets/list-no-img.svg +21 -21
  53. package/src/assets/morentouxiang-32.svg +23 -23
  54. package/src/assets/scanning.svg +24 -24
  55. package/src/assets/upExport.svg +22 -22
  56. package/src/components/Business/AddSelectBusiness/index.md +63 -42
  57. package/src/components/Business/AddSelectBusiness/index.tsx +344 -341
  58. package/src/components/Business/BsLayouts/Components/AllFunc/drawContent.tsx +111 -111
  59. package/src/components/Business/BsLayouts/Components/AllFunc/index.less +153 -153
  60. package/src/components/Business/BsLayouts/Components/AllFunc/index.tsx +70 -70
  61. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.less +90 -90
  62. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.tsx +37 -37
  63. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/leftTree.tsx +242 -242
  64. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/rightTree.tsx +384 -384
  65. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/DrawContent.tsx +285 -285
  66. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/customMenuHeader.tsx +74 -74
  67. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/drawContent.less +170 -170
  68. package/src/components/Business/BsLayouts/Components/CustomerMenu/index.less +64 -64
  69. package/src/components/Business/BsLayouts/Components/CustomerMenu/index.tsx +153 -153
  70. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.less +72 -72
  71. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.tsx +157 -157
  72. package/src/components/Business/BsLayouts/Components/RightContent/LoginModal.tsx +85 -85
  73. package/src/components/Business/BsLayouts/Components/RightContent/home.less +218 -218
  74. package/src/components/Business/BsLayouts/Components/RightContent/index.tsx +156 -156
  75. package/src/components/Business/BsLayouts/Components/SearchFunc/index.less +160 -160
  76. package/src/components/Business/BsLayouts/Components/SearchFunc/index.tsx +75 -75
  77. package/src/components/Business/BsLayouts/index.less +79 -79
  78. package/src/components/Business/BsLayouts/index.tsx +1479 -1479
  79. package/src/components/Business/BsLayouts/service.ts +10 -10
  80. package/src/components/Business/BsLayouts/utils.tsx +230 -230
  81. package/src/components/Business/BsSulaQueryTable/index.less +219 -219
  82. package/src/components/Business/BsSulaQueryTable/index.tsx +480 -476
  83. package/src/components/Business/BsSulaQueryTable/setting.tsx +802 -802
  84. package/src/components/Business/BsSulaQueryTable/utils.less +65 -65
  85. package/src/components/Business/BsSulaQueryTable/utils.tsx +688 -688
  86. package/src/components/Business/CommodityEntry/index.md +70 -70
  87. package/src/components/Business/CommodityEntry/index.tsx +80 -80
  88. package/src/components/Business/CommonAlert/index.tsx +23 -23
  89. package/src/components/Business/CommonGuideWrapper/index.less +111 -111
  90. package/src/components/Business/CommonGuideWrapper/index.md +39 -39
  91. package/src/components/Business/CommonGuideWrapper/index.tsx +83 -83
  92. package/src/components/Business/DetailPageWrapper/index.less +79 -79
  93. package/src/components/Business/DetailPageWrapper/index.tsx +335 -335
  94. package/src/components/Business/DetailPageWrapper/utils.tsx +100 -100
  95. package/src/components/Business/HomePageWrapper/index.less +33 -33
  96. package/src/components/Business/HomePageWrapper/index.md +45 -45
  97. package/src/components/Business/HomePageWrapper/index.tsx +162 -162
  98. package/src/components/Business/JsonQueryTable/components/FieldsModifyModal.tsx +824 -824
  99. package/src/components/Business/JsonQueryTable/components/FieldsSettingsTable.tsx +201 -201
  100. package/src/components/Business/JsonQueryTable/components/Formula.tsx +205 -205
  101. package/src/components/Business/JsonQueryTable/components/MaintainOptions.tsx +127 -127
  102. package/src/components/Business/JsonQueryTable/configButton/index.js +20 -20
  103. package/src/components/Business/JsonQueryTable/configTree/component/compactArrayView.js +25 -25
  104. package/src/components/Business/JsonQueryTable/configTree/component/compactObjectView.js +30 -30
  105. package/src/components/Business/JsonQueryTable/configTree/index.js +82 -82
  106. package/src/components/Business/JsonQueryTable/configTree/index.less +44 -44
  107. package/src/components/Business/JsonQueryTable/configTree/parser/highlight.js +57 -57
  108. package/src/components/Business/JsonQueryTable/configTree/parser/index.js +124 -124
  109. package/src/components/Business/JsonQueryTable/configTree/render/iconRender.js +29 -29
  110. package/src/components/Business/JsonQueryTable/configTree/render/nameRender.js +22 -22
  111. package/src/components/Business/JsonQueryTable/configTree/treeNode.js +116 -116
  112. package/src/components/Business/JsonQueryTable/drawer/index.tsx +12 -12
  113. package/src/components/Business/JsonQueryTable/function.ts +62 -62
  114. package/src/components/Business/JsonQueryTable/index.less +16 -16
  115. package/src/components/Business/JsonQueryTable/index.md +328 -328
  116. package/src/components/Business/JsonQueryTable/index.tsx +320 -320
  117. package/src/components/Business/JsonQueryTable/jsonEditor/index.js +346 -346
  118. package/src/components/Business/JsonQueryTable/jsonEditor/index.less +22 -22
  119. package/src/components/Business/JsonQueryTable/jsonEditor/lint/basicType.js +147 -147
  120. package/src/components/Business/JsonQueryTable/jsonEditor/lint/index.js +389 -389
  121. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/actions.js +118 -118
  122. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/dependency.js +22 -22
  123. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/index.js +21 -21
  124. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/request.js +65 -65
  125. package/src/components/Business/JsonQueryTable/static.ts +356 -356
  126. package/src/components/Business/SearchSelect/BusinessUtils.ts +1586 -1586
  127. package/src/components/Business/SearchSelect/common.ts +53 -53
  128. package/src/components/Business/SearchSelect/index.md +1254 -1254
  129. package/src/components/Business/SearchSelect/index.tsx +51 -51
  130. package/src/components/Business/SearchSelect/utils.ts +100 -100
  131. package/src/components/Business/StateFlow/index.less +130 -130
  132. package/src/components/Business/StateFlow/index.md +60 -60
  133. package/src/components/Business/StateFlow/index.tsx +29 -29
  134. package/src/components/Business/TreeSearchSelect/index.md +126 -126
  135. package/src/components/Business/TreeSearchSelect/index.tsx +34 -34
  136. package/src/components/Business/TreeSearchSelect/utils.ts +60 -60
  137. package/src/components/Business/columnSettingTable/columnSetting.tsx +764 -764
  138. package/src/components/Business/columnSettingTable/index.less +247 -247
  139. package/src/components/Business/columnSettingTable/index.md +357 -357
  140. package/src/components/Business/columnSettingTable/index.tsx +232 -232
  141. package/src/components/Business/columnSettingTable/sulaSettingTable.tsx +240 -240
  142. package/src/components/Business/columnSettingTable/utils.tsx +68 -68
  143. package/src/components/Business/moreTreeTable/index.less +99 -99
  144. package/src/components/Business/moreTreeTable/index.md +508 -508
  145. package/src/components/Business/moreTreeTable/index.tsx +315 -315
  146. package/src/components/Business/moreTreeTable/utils.ts +126 -126
  147. package/src/components/Functional/AddSelect/index.less +367 -367
  148. package/src/components/Functional/AddSelect/index.md +155 -154
  149. package/src/components/Functional/AddSelect/index.tsx +1072 -994
  150. package/src/components/Functional/BillEntry/index.less +371 -371
  151. package/src/components/Functional/BillEntry/index.md +39 -39
  152. package/src/components/Functional/BillEntry/index.tsx +766 -670
  153. package/src/components/Functional/DataImport/index.less +63 -63
  154. package/src/components/Functional/DataImport/index.md +44 -44
  155. package/src/components/Functional/DataImport/index.tsx +695 -695
  156. package/src/components/Functional/DataValidation/index.less +63 -63
  157. package/src/components/Functional/DataValidation/index.md +39 -39
  158. package/src/components/Functional/DataValidation/index.tsx +687 -687
  159. package/src/components/Functional/ExportFunctions/ExportIcon/index.md +37 -37
  160. package/src/components/Functional/ExportFunctions/ExportIcon/index.tsx +59 -59
  161. package/src/components/Functional/QueryMutipleInput/index.less +37 -37
  162. package/src/components/Functional/QueryMutipleInput/index.md +33 -33
  163. package/src/components/Functional/QueryMutipleInput/index.tsx +128 -128
  164. package/src/components/Functional/SearchSelect/index.less +115 -115
  165. package/src/components/Functional/SearchSelect/index.md +141 -141
  166. package/src/components/Functional/SearchSelect/index.tsx +813 -813
  167. package/src/components/Functional/SearchSelect/utils.ts +3 -3
  168. package/src/components/Functional/TreeSearchSelect/index.md +47 -47
  169. package/src/components/Functional/TreeSearchSelect/index.tsx +149 -149
  170. package/src/index.ts +34 -34
  171. package/src/plugin/TableColumnSetting/index.less +247 -0
  172. package/src/plugin/TableColumnSetting/index.md +50 -0
  173. package/src/plugin/TableColumnSetting/index.tsx +724 -0
  174. package/src/plugin/TableColumnSetting/utils.ts +19 -0
  175. package/src/styles/bsDefault.less +1906 -1906
  176. package/src/utils/CheckOneUser/index.md +39 -39
  177. package/src/utils/CheckOneUser/index.ts +51 -51
  178. package/src/utils/LocalstorageUtils.ts +33 -0
  179. package/src/utils/TableUtils.tsx +18 -18
  180. package/src/utils/checkUtils.ts +39 -39
  181. package/src/utils/enumConfig.ts +10 -10
  182. package/src/utils/getFormMode.js +12 -12
  183. package/src/utils/index.ts +2 -2
  184. package/src/utils/requestUtils.ts +33 -33
  185. package/src/utils/serialize.js +7 -7
  186. package/src/utils/utils.ts +183 -183
  187. package/tsconfig.json +29 -29
  188. package/typings.d.ts +4 -4
@@ -1,1586 +1,1586 @@
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
- if(type === 'ownerWarehouse') {
738
- requestConfig = {
739
- url: `${prefixUrl.selectPrefix}/ownerWarehouse`,
740
- filter: 'qp-name,operationWarehouseCode-orGroup,like', // 过滤参数
741
- mappingTextField: 'name',
742
- mappingTextShowKeyField: 'operationWarehouseCode',
743
- mappingValueField: 'operationWarehouseCode',
744
- otherParams: {
745
- 'qp-status-eq': 1,
746
- sorter: 'desc-id'
747
- }, // 默认参数
748
- sourceName: 'qp-operationWarehouseCode-in',
749
- ...requestConfigProp,
750
- }
751
- tableSearchForm = [
752
- { name: 'qp-name-like', label: '运营仓名称' },
753
- { name: 'qp-operationWarehouseCode-like', label: '运营仓编码' },
754
- { name: 'qp-groupCode-in', type: 'select', label: '运营组', field: {
755
- type: 'select',
756
- props: {
757
- mode: 'multiple',
758
- notFoundContent: '暂无数据',
759
- allowClear: true,
760
- showSearch: true,
761
- showArrow: true,
762
- maxTagCount: 1,
763
- optionFilterProp: 'children',
764
- filterOption: (input: string, option: { props: { children: string } }) =>
765
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
766
- },
767
- } },
768
- ]
769
- Promise.all([
770
- loadSelectSource(`${prefixUrl.formSelectFix}/groupInfo/listNoPage`, { 'qp-status-eq': 1 }),
771
- ]).then((x: any)=>{
772
- formatSource(x,0, 2, tableSearchForm,['groupCode','groupName']);
773
- })
774
- modalTableProps = {
775
- modalTableTitle: '选择运营仓',
776
- tableSearchForm,
777
- tableColumns: [
778
- {
779
- title: '运营仓编码',
780
- dataIndex: 'operationWarehouseCode',
781
- },
782
- {
783
- title: '运营仓名称',
784
- dataIndex: 'name',
785
- },
786
- {
787
- title: '运营组',
788
- dataIndex: 'groupName',
789
- },
790
- ],
791
- ...modalTableBusProps,
792
- }
793
- }
794
-
795
- // 仓库选择器(虚拟、渠道仓)(无弹窗)
796
- if(type === 'virtualWarehouse') {
797
- requestConfig = {
798
- url: `${prefixUrl.selectPrefix}/virtualWarehouse`,
799
- filter: 'qp-virtualWarehouseName,virtualWarehouseCode-orGroup,like', // 过滤参数
800
- mappingTextField: 'virtualWarehouseName',
801
- mappingTextShowKeyField: 'virtualWarehouseCode',
802
- mappingValueField: 'id',
803
- otherParams: {
804
- 'qp-isEnable-eq': 1,
805
- sorter: 'desc-id'
806
- }, // 默认参数
807
- sourceName: 'warehouseIds',
808
- ...requestConfigProp,
809
- }
810
- needModalTable = false
811
- }
812
- if(type === 'channelWarehouse') {
813
- requestConfig = {
814
- url: `${prefixUrl.selectPrefix}/channelWarehouse`,
815
- filter: 'qp-channelWarehouseName,channelWarehouseCode-orGroup,like', // 过滤参数
816
- mappingTextField: 'channelWarehouseName',
817
- mappingTextShowKeyField: 'channelWarehouseCode',
818
- mappingValueField: 'id',
819
- otherParams: {
820
- 'qp-isEnable-eq': 1,
821
- sorter: 'desc-id'
822
- }, // 默认参数
823
- sourceName: 'warehouseIds',
824
- ...requestConfigProp,
825
- }
826
- needModalTable = false
827
- }
828
-
829
- // 客户选择器
830
- if(type === 'customer') {
831
- requestConfig = {
832
- url: `${prefixUrl.selectPrefix}/uc/customer/v2`,
833
- filter: 'qp-name,code-orGroup,like', // 过滤参数
834
- mappingTextField: 'name',
835
- mappingValueField: 'code',
836
- otherParams: {
837
- 'qp-status-eq': 10,
838
- sorter: 'desc-id'
839
- }, // 默认参数
840
- sourceName: 'customCode',
841
- ...requestConfigProp,
842
- }
843
- tableSearchForm = [
844
- { name: 'qp-name-like', label: '客户名称' },
845
- { name: 'qp-code-like', label: '客户编码' },
846
- { name: 'qp-conglomerateCode-in', type: 'select', label: '归属集团', field: {
847
- type: 'select',
848
- props: {
849
- mode: 'multiple',
850
- notFoundContent: '暂无数据',
851
- allowClear: true,
852
- showSearch: true,
853
- showArrow: true,
854
- maxTagCount: 1,
855
- optionFilterProp: 'children',
856
- filterOption: (input: string, option: { props: { children: string } }) =>
857
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
858
- },
859
- } },
860
- { name: 'qp-accountingCode-in', type: 'select', label: '归属核算主体', field: {
861
- type: 'select',
862
- props: {
863
- mode: 'multiple',
864
- notFoundContent: '暂无数据',
865
- allowClear: true,
866
- showSearch: true,
867
- showArrow: true,
868
- maxTagCount: 1,
869
- optionFilterProp: 'children',
870
- filterOption: (input: string, option: { props: { children: string } }) =>
871
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
872
- },
873
- } },
874
- { name: 'qp-companyCode-in', type: 'select', label: '归属法人公司', field: {
875
- type: 'select',
876
- props: {
877
- mode: 'multiple',
878
- notFoundContent: '暂无数据',
879
- allowClear: true,
880
- showSearch: true,
881
- showArrow: true,
882
- maxTagCount: 1,
883
- optionFilterProp: 'children',
884
- filterOption: (input: string, option: { props: { children: string } }) =>
885
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
886
- },
887
- } },
888
- { name: 'qp-sharingType-eq', type: 'select', label: '共享类型', initialSource: sharingTypeDataList },
889
- ]
890
- Promise.all([
891
- loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
892
- pageSize: 5000,
893
- currentPage: 1,
894
- 'qp-companyType-eq': '30',
895
- }),
896
- loadSelectSource(`${prefixUrl.formSelectFix}/accountingSubject`, {
897
- pageSize: 5000,
898
- currentPage: 1,
899
- }),
900
- loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
901
- pageSize: 5000,
902
- currentPage: 1,
903
- 'qp-companyType-eq': '20',
904
- })
905
- ]).then((x: any)=>{
906
- formatSource(x,0, 2, tableSearchForm);
907
- formatSource(x,1, 3, tableSearchForm);
908
- formatSource(x,2, 4, tableSearchForm);
909
- })
910
- modalTableProps = {
911
- modalTableTitle: '选择客户',
912
- tableSearchForm,
913
- tableColumns: [
914
- {
915
- title: '客户编码',
916
- dataIndex: 'code',
917
- },
918
- {
919
- title: '客户名称',
920
- dataIndex: 'name',
921
- },
922
- {
923
- title: '归属集团',
924
- dataIndex: 'conglomerateName',
925
- },
926
- {
927
- title: '归属法人公司',
928
- dataIndex: 'legalCompanyName',
929
- },
930
- {
931
- title: '归属核算主体',
932
- dataIndex: 'accountingName',
933
- },
934
- {
935
- title: '共享类型',
936
- dataIndex: 'sharingType',
937
- render: (text: number) => hasDictSharingType ? getDictionaryTextByValue('UC000013', text) : sharingType.find((i: any) => i.value === text)?.text,
938
- },
939
- ],
940
- ...modalTableBusProps
941
- }
942
- }
943
- if(type === 'customer2') {
944
- // 版本2
945
- requestConfig = {
946
- url: `${prefixUrl.selectPrefix}/customer`,
947
- filter: 'qp-name,code-orGroup,like', // 过滤参数
948
- mappingTextField: 'name',
949
- mappingValueField: 'code',
950
- otherParams: {
951
- sorter: 'desc-id'
952
- }, // 默认参数
953
- sourceName: 'customCode',
954
- ...requestConfigProp,
955
- }
956
- tableSearchForm = [
957
- { name: 'qp-name-like', label: '客户名称' },
958
- { name: 'qp-code-like', label: '客户编码' },
959
- { name: 'qp-createOrgCode-eq', type: 'select', label: '创建组织', field: {
960
- type: 'select',
961
- props: {
962
- // mode: 'multiple',
963
- notFoundContent: '暂无数据',
964
- allowClear: true,
965
- showSearch: true,
966
- showArrow: true,
967
- // maxTagCount: 1,
968
- optionFilterProp: 'children',
969
- filterOption: (input: string, option: { props: { children: string } }) =>
970
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
971
- },
972
- } },
973
- { name: 'qp-salesOrgCode-eq', 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
- ]
988
- Promise.all([
989
- loadSelectSource(`${prefixUrl.formSelectFix}/org/listNoPage`, {}),
990
- loadSelectSource(`${prefixUrl.formSelectFix}/org/listNoPage`,{}),
991
- ]).then((x: any)=>{
992
- formatSource(x,0, 2, tableSearchForm);
993
- formatSource(x,1, 3, tableSearchForm);
994
- })
995
- modalTableProps = {
996
- modalTableTitle: '选择客户',
997
- tableSearchForm,
998
- tableColumns: [
999
- {
1000
- title: '客户编码',
1001
- dataIndex: 'code',
1002
- },
1003
- {
1004
- title: '客户名称',
1005
- dataIndex: 'name',
1006
- },
1007
- {
1008
- title: '创建组织',
1009
- dataIndex: 'createOrgName',
1010
- },
1011
- {
1012
- title: '使用组织',
1013
- dataIndex: 'salesOrgName',
1014
- },
1015
- ],
1016
- ...modalTableBusProps
1017
- }
1018
- }
1019
-
1020
- // 店铺选择器
1021
- if(type === 'shopFile') {
1022
- requestConfig = {
1023
- url: `${prefixUrl.selectPrefix}/store`,
1024
- filter: 'qp-name,code-orGroup,like', // 过滤参数
1025
- mappingTextField: 'name',
1026
- mappingValueField: 'code',
1027
- otherParams: {
1028
- sorter: 'desc-id'
1029
- }, // 默认参数
1030
- sourceName: 'code',
1031
- ...requestConfigProp,
1032
- }
1033
- tableSearchForm = [
1034
- { name: 'qp-name-like', label: '店铺名称' },
1035
- { name: 'qp-code-like', label: '店铺编码' },
1036
- { name: 'qp-conglomerateCode-in', type: 'select', label: '归属集团', field: {
1037
- type: 'select',
1038
- props: {
1039
- mode: 'multiple',
1040
- notFoundContent: '暂无数据',
1041
- allowClear: true,
1042
- showSearch: true,
1043
- showArrow: true,
1044
- maxTagCount: 1,
1045
- optionFilterProp: 'children',
1046
- filterOption: (input: string, option: { props: { children: string } }) =>
1047
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1048
- },
1049
- } },
1050
- { name: 'qp-companyCode-in', type: 'select', label: '归属法人公司', field: {
1051
- type: 'select',
1052
- props: {
1053
- mode: 'multiple',
1054
- notFoundContent: '暂无数据',
1055
- allowClear: true,
1056
- showSearch: true,
1057
- showArrow: true,
1058
- maxTagCount: 1,
1059
- optionFilterProp: 'children',
1060
- filterOption: (input: string, option: { props: { children: string } }) =>
1061
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1062
- },
1063
- } },
1064
- { name: 'qp-type-in', type: 'select', label: '店铺类型', initialSource: shopFileType },
1065
- { name: 'qp-plateformCode-in', type: 'select', label: '店铺来源', field: {
1066
- type: 'select',
1067
- props: {
1068
- mode: 'multiple',
1069
- notFoundContent: '暂无数据',
1070
- allowClear: true,
1071
- showSearch: true,
1072
- showArrow: true,
1073
- maxTagCount: 1,
1074
- optionFilterProp: 'children',
1075
- filterOption: (input: string, option: { props: { children: string } }) =>
1076
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1077
- },
1078
- } },
1079
- { name: 'qp-accountingCode-in', type: 'select', label: '归属核算主体', field: {
1080
- type: 'select',
1081
- props: {
1082
- mode: 'multiple',
1083
- notFoundContent: '暂无数据',
1084
- allowClear: true,
1085
- showSearch: true,
1086
- showArrow: true,
1087
- maxTagCount: 1,
1088
- optionFilterProp: 'children',
1089
- filterOption: (input: string, option: { props: { children: string } }) =>
1090
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1091
- },
1092
- } },
1093
- ]
1094
- Promise.all([
1095
- loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
1096
- pageSize: 5000,
1097
- currentPage: 1,
1098
- 'qp-companyType-eq': '30',
1099
- }),
1100
- loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
1101
- pageSize: 5000,
1102
- currentPage: 1,
1103
- 'qp-companyType-eq': '20',
1104
- }),
1105
- loadSelectSource(`${prefixUrl.formSelectFix}/platformRecord/getPlatformRecordList`, {
1106
- // pageSize: 5000,
1107
- // currentPage: 1,
1108
- 'qp-status-eq': '1',
1109
- }),
1110
- loadSelectSource(`${prefixUrl.formSelectFix}/accountingSubject`, {
1111
- pageSize: 5000,
1112
- currentPage: 1,
1113
- }),
1114
- ]).then((x: any)=>{
1115
- formatSource(x,0, 2, tableSearchForm);
1116
- formatSource(x,1, 3, tableSearchForm);
1117
- formatSource(x,2, 5, tableSearchForm);
1118
- formatSource(x,3, 6, tableSearchForm);
1119
- })
1120
- modalTableProps = {
1121
- modalTableTitle: '选择店铺',
1122
- tableSearchForm,
1123
- tableColumns: [
1124
- {
1125
- title: '店铺编码',
1126
- dataIndex: 'code',
1127
- },
1128
- {
1129
- title: '店铺名称',
1130
- dataIndex: 'name',
1131
- },
1132
- {
1133
- title: '归属集团',
1134
- dataIndex: 'conglomerateName',
1135
- },
1136
- {
1137
- title: '归属法人公司',
1138
- dataIndex: 'companyName',
1139
- },
1140
- {
1141
- title: '店铺类型',
1142
- dataIndex: 'type',
1143
- render: (text: number) => shopFileType.find((i: any) => i.value === text)?.text,
1144
- },
1145
- {
1146
- title: '店铺来源',
1147
- dataIndex: 'platformName',
1148
- },
1149
- {
1150
- title: '归属核算主体',
1151
- dataIndex: 'accountingName',
1152
- },
1153
- ],
1154
- ...modalTableBusProps
1155
- }
1156
- }
1157
- if(type === 'shopFile2') {
1158
- requestConfig = {
1159
- url: `${prefixUrl.selectPrefix}/store/page`,
1160
- filter: 'qp-name,code-orGroup,like', // 过滤参数
1161
- mappingTextField: 'name',
1162
- mappingValueField: 'code',
1163
- otherParams: {
1164
- sorter: 'desc-id'
1165
- }, // 默认参数
1166
- sourceName: 'code',
1167
- ...requestConfigProp,
1168
- }
1169
- tableSearchForm = [
1170
- { name: 'qp-name-like', label: '商店名称' },
1171
- { name: 'qp-code-like', label: '商店编码' },
1172
- { name: 'qp-type-in', type: 'select', label: '商店类型', initialSource: shopFile2Type },
1173
- { name: 'qp-orgCode-in', type: 'select', label: '所属销售组织', field: {
1174
- type: 'select',
1175
- props: {
1176
- mode: 'multiple',
1177
- notFoundContent: '暂无数据',
1178
- allowClear: true,
1179
- showSearch: true,
1180
- showArrow: true,
1181
- maxTagCount: 1,
1182
- optionFilterProp: 'children',
1183
- filterOption: (input: string, option: { props: { children: string } }) =>
1184
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1185
- },
1186
- } },
1187
- ]
1188
- Promise.all([
1189
- loadSelectSource(`${prefixUrl.formSelectFix}/orgView/getTree/sales-organizational-view`, {
1190
- 'qp-employeeCode-eq': JSON.parse(localStorage.getItem(ENUM.BROWSER_CACHE.USER_INFO) || '{}')?.employeeResVo?.employeeNumber,
1191
- 'qp-realOrg-eq': true,
1192
- 'qp-status-eq': 10
1193
- }),
1194
- ]).then((x: any)=>{
1195
- formatSource(x,0, 3, tableSearchForm);
1196
- })
1197
- modalTableProps = {
1198
- modalTableTitle: '选择商店',
1199
- tableSearchForm,
1200
- tableColumns: [
1201
- {
1202
- title: '商店编码',
1203
- dataIndex: 'code',
1204
- },
1205
- {
1206
- title: '商店名称',
1207
- dataIndex: 'name',
1208
- },
1209
- {
1210
- title: '商店类型',
1211
- dataIndex: 'type',
1212
- render: (text: number) => shopFile2Type.find((i: any) => i.value === text)?.text,
1213
- },
1214
- {
1215
- title: '所属销售组织',
1216
- dataIndex: 'orgName',
1217
- },
1218
- ],
1219
- ...modalTableBusProps
1220
- }
1221
- }
1222
-
1223
- // 核算主体选择器(无弹窗)
1224
- if(type === 'accountingSubject') {
1225
- requestConfig = {
1226
- url: `${prefixUrl.selectPrefix}/accountingSubject`,
1227
- filter: 'qp-name,code-orGroup,like', // 过滤参数
1228
- mappingTextField: 'name',
1229
- mappingTextShowKeyField: 'code',
1230
- mappingValueField: 'id',
1231
- otherParams: {
1232
- sorter: 'desc-id'
1233
- }, // 默认参数
1234
- sourceName: 'accountingSubjectCode',
1235
- ...requestConfigProp,
1236
- }
1237
- needModalTable = false
1238
- }
1239
- // 库存组织选择器(无弹窗)
1240
- if(type === 'inventoryOrg') {
1241
- requestConfig = {
1242
- url: `${prefixUrl.selectPrefix}/inventoryOrg`,
1243
- filter: 'qp-name,code-orGroup,like', // 过滤参数
1244
- mappingTextField: 'name',
1245
- mappingTextShowKeyField: 'code',
1246
- mappingValueField: 'id',
1247
- otherParams: {
1248
- sorter: 'desc-id'
1249
- }, // 默认参数
1250
- sourceName: 'inventoryOrgCode',
1251
- ...requestConfigProp,
1252
- }
1253
- needModalTable = false
1254
- }
1255
-
1256
- // 法人公司选择器(无弹窗)
1257
- if(type === 'corporationCompany') {
1258
- requestConfig = {
1259
- url: `${prefixUrl.selectPrefix}/company`,
1260
- filter: 'qp-name,code-orGroup,like', // 过滤参数
1261
- mappingTextField: 'name',
1262
- mappingTextShowKeyField: 'code',
1263
- mappingValueField: 'id',
1264
- otherParams: {
1265
- sorter: 'desc-id'
1266
- }, // 默认参数
1267
- sourceName: 'corporationCompany',
1268
- ...requestConfigProp,
1269
- }
1270
- needModalTable = false
1271
- }
1272
-
1273
- // 员工选择器
1274
- if(type === 'employee') {
1275
- requestConfig = {
1276
- url: `${prefixUrl.selectPrefix}/employee/v2`,
1277
- filter: 'qp-employeeNumber,name-orGroup,like', // 过滤参数
1278
- mappingTextField: 'name',
1279
- mappingTextShowKeyField: 'employeeNumber',
1280
- mappingValueField: 'employeeNumber',
1281
- otherParams: {
1282
- 'qp-enable-eq': 10, // 启用状态 10-启用,20-禁用
1283
- 'qp-employmentType-eq': 20,
1284
- sorter: 'desc-id'
1285
- }, // 默认参数
1286
- sourceName: 'employeeNumber',
1287
- ...requestConfigProp,
1288
- }
1289
- tableSearchForm = [
1290
- { name: 'qp-name-like', label: '员工名称' },
1291
- { name: 'qp-employeeNumber-like', label: '员工编码' },
1292
- { name: 'qp-companyCode-in', type: 'select', label: '所属公司', field: {
1293
- type: 'select',
1294
- props: {
1295
- mode: 'multiple',
1296
- notFoundContent: '暂无数据',
1297
- allowClear: true,
1298
- showSearch: true,
1299
- showArrow: true,
1300
- maxTagCount: 1,
1301
- optionFilterProp: 'children',
1302
- filterOption: (input: string, option: { props: { children: string } }) =>
1303
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1304
- },
1305
- } },
1306
- { name: 'qp-email-like', label: '邮箱' },
1307
- { name: 'qp-officeTelephone-like', label: '手机号' },
1308
- ]
1309
- Promise.all([
1310
- loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
1311
- pageSize: 5000,
1312
- currentPage: 1,
1313
- 'qp-companyType-eq': 20,
1314
- }),
1315
- ]).then((x: any)=>{
1316
- formatSource(x,0, 2, tableSearchForm);
1317
- })
1318
- modalTableProps = {
1319
- modalTableTitle: '选择员工',
1320
- tableSearchForm,
1321
- tableColumns: [
1322
- {
1323
- title: '员工编码',
1324
- dataIndex: 'employeeNumber',
1325
- },
1326
- {
1327
- title: '员工名称',
1328
- dataIndex: 'name',
1329
- },
1330
- {
1331
- title: '所属公司',
1332
- dataIndex: 'companyName',
1333
- },
1334
- {
1335
- title: '邮箱',
1336
- dataIndex: 'email',
1337
- },
1338
- {
1339
- title: '手机号',
1340
- dataIndex: 'officeTelephone',
1341
- },
1342
- ],
1343
- ...modalTableBusProps
1344
- }
1345
- }
1346
- if(type === 'employee2') {
1347
- // 版本2
1348
- requestConfig = {
1349
- url: `${prefixUrl.selectPrefix}/employee/pageList/v2`,
1350
- filter: 'qp-username,name-orGroup,like', // 过滤参数
1351
- mappingTextField: 'name',
1352
- mappingTextShowKeyField: 'username',
1353
- mappingValueField: 'id',
1354
- otherParams: {
1355
- 'qp-enable-eq': 10, // 启用状态 10-启用,20-禁用
1356
- 'qp-employmentType-eq': 20,
1357
- 'qp-orgViewIds-like': 'administrative-organization-view',
1358
- sorter: 'desc-id'
1359
- }, // 默认参数
1360
- sourceName: 'employeeNumber',
1361
- ...requestConfigProp,
1362
- }
1363
- tableSearchForm = [
1364
- { name: 'qp-username-like', label: '账户名称' },
1365
- { name: 'qp-name-like', label: '显示名称' },
1366
- // { name: 'qp-employeeNumber-like', label: '员工编码' },
1367
- { name: 'qp-code-in', type: 'treeSelect', label: '所属组织机构', field: {
1368
- type: 'treeSelect',
1369
- props: {
1370
- multiple: true,
1371
- treeData: [],
1372
- treeCheckable: false,
1373
- showSearch: true,
1374
- allowClear: true,
1375
- showArrow: true,
1376
- treeNodeFilterProp: 'title',
1377
- treeDefaultExpandAll: true,
1378
- maxTagCount: 1,
1379
- placeholder: '请选择',
1380
- style: {
1381
- width: '100%',
1382
- },
1383
- showCheckedStrategy: 'TreeSelect.SHOW_ALL',
1384
- dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
1385
- },
1386
- } },
1387
- { name: 'qp-email-like', label: '邮箱' },
1388
- { name: 'qp-officeTelephone-like', label: '手机号' },
1389
- ]
1390
- Promise.all([
1391
- loadSelectSource(`${prefixUrl.formSelectFix}/orgViewNode/common/getTreeForOrgViewAndTenant`, { 'orgViewCode': 'administrative-organization-view' }),
1392
- ]).then((x: any)=>{
1393
- formatTreeDataSource(x,0, 2, tableSearchForm,['code', 'name']);
1394
- })
1395
- modalTableProps = {
1396
- modalTableTitle: '添加员工',
1397
- tableSearchForm,
1398
- tableColumns: [
1399
- {
1400
- title: '账户名称',
1401
- dataIndex: 'username',
1402
- },
1403
- {
1404
- title: '显示名称',
1405
- dataIndex: 'name',
1406
- },
1407
- // {
1408
- // title: '员工编码',
1409
- // dataIndex: 'employeeNumber',
1410
- // },
1411
- // {
1412
- // title: '员工名称',
1413
- // dataIndex: 'name',
1414
- // },
1415
- {
1416
- title: '所属组织机构',
1417
- dataIndex: 'administrativeNames',
1418
- render: (text: any) => handleTextOverflow(text),
1419
- },
1420
- {
1421
- title: '邮箱',
1422
- dataIndex: 'email',
1423
- },
1424
- {
1425
- title: '手机号',
1426
- dataIndex: 'officeTelephone',
1427
- },
1428
- ],
1429
- ...modalTableBusProps
1430
- }
1431
- }
1432
-
1433
- // 配送方式选择器
1434
- if(type === 'deliveryMode') {
1435
- requestConfig = {
1436
- url: `${prefixUrl.selectPrefix}/deliveryMode`,
1437
- filter: 'qp-name,code-orGroup,like', // 过滤参数
1438
- mappingTextField: 'name',
1439
- mappingTextShowKeyField: 'code',
1440
- mappingValueField: 'code',
1441
- otherParams: {
1442
- sorter: 'desc-id'
1443
- }, // 默认参数
1444
- sourceName: 'deliveryModeCode',
1445
- ...requestConfigProp
1446
- }
1447
- tableSearchForm = [
1448
- { name: 'qp-name-like', label: '配送方式名称' },
1449
- { name: 'qp-code-like', label: '配送方式编码' },
1450
- { name: 'qp-logisCompanyCode-in', type: 'select', label: '所属物流商', field: {
1451
- type: 'select',
1452
- props: {
1453
- mode: 'multiple',
1454
- notFoundContent: '暂无数据',
1455
- allowClear: true,
1456
- showSearch: true,
1457
- showArrow: true,
1458
- maxTagCount: 1,
1459
- optionFilterProp: 'children',
1460
- filterOption: (input: string, option: { props: { children: string } }) =>
1461
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1462
- },
1463
- } },
1464
- { name: 'qp-recordChannnelCode-in', type: 'select', label: '单号获取通道', initialSource: getDictionarySource('BSC00004') },
1465
- { name: 'qp-arrivalPaySupport-in', type: 'select', label: '是否支持到付', initialSource: arrivalPaySupportList },
1466
- { name: 'qp-sheetTemplateCode-in', type: 'select', label: '面单模板', field: {
1467
- type: 'select',
1468
- props: {
1469
- mode: 'multiple',
1470
- notFoundContent: '暂无数据',
1471
- allowClear: true,
1472
- showSearch: true,
1473
- showArrow: true,
1474
- maxTagCount: 1,
1475
- optionFilterProp: 'children',
1476
- filterOption: (input: string, option: { props: { children: string } }) =>
1477
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1478
- },
1479
- } },
1480
- { name: 'qp-remark-like', label: '备注' },
1481
- ]
1482
- Promise.all([
1483
- loadSelectSource(`${prefixUrl.formSelectFix}/logisCompany`, {
1484
- pageSize: 5000,
1485
- currentPage: 1,
1486
- }),
1487
- loadSelectSource(`${prefixUrl.formSelectFix}/printTemplate`, {
1488
- pageSize: 5000,
1489
- currentPage: 1,
1490
- })
1491
- ]).then((x: any)=>{
1492
- formatSource(x,0, 2, tableSearchForm);
1493
- formatSource(x,1, 5, tableSearchForm);
1494
- })
1495
- modalTableProps = {
1496
- modalTableTitle: '选择配送方式',
1497
- tableSearchForm,
1498
- tableColumns: [
1499
- {
1500
- title: '配送方式编码',
1501
- dataIndex: 'code',
1502
- },
1503
- {
1504
- title: '配送方式名称',
1505
- dataIndex: 'name',
1506
- },
1507
- {
1508
- title: '所属物流商',
1509
- dataIndex: 'logisCompanyName',
1510
- },
1511
- {
1512
- dataIndex: 'recordChannnelCode',
1513
- title: '单号获取通道',
1514
- render: (text: any) => getDictionaryTextByValue('BSC00004', text),
1515
- },
1516
- {
1517
- dataIndex: 'arrivalPaySupport',
1518
- title: '是否支持到付',
1519
- render: (text: number) => arrivalPaySupportList.find((i: any) => i.value === text)?.text,
1520
- },
1521
- {
1522
- dataIndex: 'sheetTemplateName',
1523
- title: '面单模板',
1524
- },
1525
- {
1526
- dataIndex: 'remark',
1527
- title: '备注',
1528
- },
1529
- ],
1530
- ...modalTableBusProps
1531
- }
1532
- }
1533
-
1534
- // 规则场景选择器
1535
- if(type === 'ruleTemplate') {
1536
- requestConfig = {
1537
- url: `${prefixUrl.selectPrefix}/ruleTemplate`,
1538
- filter: 'qp-name,code-orGroup,like', // 过滤参数
1539
- mappingTextField: 'name',
1540
- mappingTextShowKeyField: 'code',
1541
- mappingValueField: 'code',
1542
- otherParams: {
1543
- sorter: 'desc-id'
1544
- }, // 默认参数
1545
- sourceName: 'ruleTemplateCode',
1546
- ...requestConfigProp
1547
- }
1548
- tableSearchForm = [
1549
- { name: 'qp-name-like', label: '规则场景名称' },
1550
- { name: 'qp-code-like', label: '规则场景编码' },
1551
- ]
1552
- modalTableProps = {
1553
- modalTableTitle: '选择规则场景',
1554
- tableSearchForm,
1555
- tableColumns: [
1556
- {
1557
- title: '规则场景编码',
1558
- dataIndex: 'code',
1559
- },
1560
- {
1561
- title: '规则场景名称',
1562
- dataIndex: 'name',
1563
- render: (text: any) => handleTextOverflow(text),
1564
- },
1565
- {
1566
- title: '条件对象',
1567
- dataIndex: 'objectName',
1568
- render: (text: any) => handleTextOverflow(text),
1569
- },
1570
- {
1571
- dataIndex: 'extName',
1572
- title: '条件扩展',
1573
- render: (text: any) => handleTextOverflow(text),
1574
- },
1575
- {
1576
- dataIndex: 'actionName',
1577
- title: '执行动作',
1578
- render: (text: any) => handleTextOverflow(text),
1579
- },
1580
- ],
1581
- ...modalTableBusProps
1582
- }
1583
- }
1584
-
1585
- return { modalTableProps, requestConfig, needModalTable };
1586
- }
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
+ if(type === 'ownerWarehouse') {
738
+ requestConfig = {
739
+ url: `${prefixUrl.selectPrefix}/ownerWarehouse`,
740
+ filter: 'qp-name,operationWarehouseCode-orGroup,like', // 过滤参数
741
+ mappingTextField: 'name',
742
+ mappingTextShowKeyField: 'operationWarehouseCode',
743
+ mappingValueField: 'operationWarehouseCode',
744
+ otherParams: {
745
+ 'qp-status-eq': 1,
746
+ sorter: 'desc-id'
747
+ }, // 默认参数
748
+ sourceName: 'qp-operationWarehouseCode-in',
749
+ ...requestConfigProp,
750
+ }
751
+ tableSearchForm = [
752
+ { name: 'qp-name-like', label: '运营仓名称' },
753
+ { name: 'qp-operationWarehouseCode-like', label: '运营仓编码' },
754
+ { name: 'qp-groupCode-in', type: 'select', label: '运营组', field: {
755
+ type: 'select',
756
+ props: {
757
+ mode: 'multiple',
758
+ notFoundContent: '暂无数据',
759
+ allowClear: true,
760
+ showSearch: true,
761
+ showArrow: true,
762
+ maxTagCount: 1,
763
+ optionFilterProp: 'children',
764
+ filterOption: (input: string, option: { props: { children: string } }) =>
765
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
766
+ },
767
+ } },
768
+ ]
769
+ Promise.all([
770
+ loadSelectSource(`${prefixUrl.formSelectFix}/groupInfo/listNoPage`, { 'qp-status-eq': 1 }),
771
+ ]).then((x: any)=>{
772
+ formatSource(x,0, 2, tableSearchForm,['groupCode','groupName']);
773
+ })
774
+ modalTableProps = {
775
+ modalTableTitle: '选择运营仓',
776
+ tableSearchForm,
777
+ tableColumns: [
778
+ {
779
+ title: '运营仓编码',
780
+ dataIndex: 'operationWarehouseCode',
781
+ },
782
+ {
783
+ title: '运营仓名称',
784
+ dataIndex: 'name',
785
+ },
786
+ {
787
+ title: '运营组',
788
+ dataIndex: 'groupName',
789
+ },
790
+ ],
791
+ ...modalTableBusProps,
792
+ }
793
+ }
794
+
795
+ // 仓库选择器(虚拟、渠道仓)(无弹窗)
796
+ if(type === 'virtualWarehouse') {
797
+ requestConfig = {
798
+ url: `${prefixUrl.selectPrefix}/virtualWarehouse`,
799
+ filter: 'qp-virtualWarehouseName,virtualWarehouseCode-orGroup,like', // 过滤参数
800
+ mappingTextField: 'virtualWarehouseName',
801
+ mappingTextShowKeyField: 'virtualWarehouseCode',
802
+ mappingValueField: 'id',
803
+ otherParams: {
804
+ 'qp-isEnable-eq': 1,
805
+ sorter: 'desc-id'
806
+ }, // 默认参数
807
+ sourceName: 'warehouseIds',
808
+ ...requestConfigProp,
809
+ }
810
+ needModalTable = false
811
+ }
812
+ if(type === 'channelWarehouse') {
813
+ requestConfig = {
814
+ url: `${prefixUrl.selectPrefix}/channelWarehouse`,
815
+ filter: 'qp-channelWarehouseName,channelWarehouseCode-orGroup,like', // 过滤参数
816
+ mappingTextField: 'channelWarehouseName',
817
+ mappingTextShowKeyField: 'channelWarehouseCode',
818
+ mappingValueField: 'id',
819
+ otherParams: {
820
+ 'qp-isEnable-eq': 1,
821
+ sorter: 'desc-id'
822
+ }, // 默认参数
823
+ sourceName: 'warehouseIds',
824
+ ...requestConfigProp,
825
+ }
826
+ needModalTable = false
827
+ }
828
+
829
+ // 客户选择器
830
+ if(type === 'customer') {
831
+ requestConfig = {
832
+ url: `${prefixUrl.selectPrefix}/uc/customer/v2`,
833
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
834
+ mappingTextField: 'name',
835
+ mappingValueField: 'code',
836
+ otherParams: {
837
+ 'qp-status-eq': 10,
838
+ sorter: 'desc-id'
839
+ }, // 默认参数
840
+ sourceName: 'customCode',
841
+ ...requestConfigProp,
842
+ }
843
+ tableSearchForm = [
844
+ { name: 'qp-name-like', label: '客户名称' },
845
+ { name: 'qp-code-like', label: '客户编码' },
846
+ { name: 'qp-conglomerateCode-in', type: 'select', label: '归属集团', field: {
847
+ type: 'select',
848
+ props: {
849
+ mode: 'multiple',
850
+ notFoundContent: '暂无数据',
851
+ allowClear: true,
852
+ showSearch: true,
853
+ showArrow: true,
854
+ maxTagCount: 1,
855
+ optionFilterProp: 'children',
856
+ filterOption: (input: string, option: { props: { children: string } }) =>
857
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
858
+ },
859
+ } },
860
+ { name: 'qp-accountingCode-in', type: 'select', label: '归属核算主体', field: {
861
+ type: 'select',
862
+ props: {
863
+ mode: 'multiple',
864
+ notFoundContent: '暂无数据',
865
+ allowClear: true,
866
+ showSearch: true,
867
+ showArrow: true,
868
+ maxTagCount: 1,
869
+ optionFilterProp: 'children',
870
+ filterOption: (input: string, option: { props: { children: string } }) =>
871
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
872
+ },
873
+ } },
874
+ { name: 'qp-companyCode-in', type: 'select', label: '归属法人公司', field: {
875
+ type: 'select',
876
+ props: {
877
+ mode: 'multiple',
878
+ notFoundContent: '暂无数据',
879
+ allowClear: true,
880
+ showSearch: true,
881
+ showArrow: true,
882
+ maxTagCount: 1,
883
+ optionFilterProp: 'children',
884
+ filterOption: (input: string, option: { props: { children: string } }) =>
885
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
886
+ },
887
+ } },
888
+ { name: 'qp-sharingType-eq', type: 'select', label: '共享类型', initialSource: sharingTypeDataList },
889
+ ]
890
+ Promise.all([
891
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
892
+ pageSize: 5000,
893
+ currentPage: 1,
894
+ 'qp-companyType-eq': '30',
895
+ }),
896
+ loadSelectSource(`${prefixUrl.formSelectFix}/accountingSubject`, {
897
+ pageSize: 5000,
898
+ currentPage: 1,
899
+ }),
900
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
901
+ pageSize: 5000,
902
+ currentPage: 1,
903
+ 'qp-companyType-eq': '20',
904
+ })
905
+ ]).then((x: any)=>{
906
+ formatSource(x,0, 2, tableSearchForm);
907
+ formatSource(x,1, 3, tableSearchForm);
908
+ formatSource(x,2, 4, tableSearchForm);
909
+ })
910
+ modalTableProps = {
911
+ modalTableTitle: '选择客户',
912
+ tableSearchForm,
913
+ tableColumns: [
914
+ {
915
+ title: '客户编码',
916
+ dataIndex: 'code',
917
+ },
918
+ {
919
+ title: '客户名称',
920
+ dataIndex: 'name',
921
+ },
922
+ {
923
+ title: '归属集团',
924
+ dataIndex: 'conglomerateName',
925
+ },
926
+ {
927
+ title: '归属法人公司',
928
+ dataIndex: 'legalCompanyName',
929
+ },
930
+ {
931
+ title: '归属核算主体',
932
+ dataIndex: 'accountingName',
933
+ },
934
+ {
935
+ title: '共享类型',
936
+ dataIndex: 'sharingType',
937
+ render: (text: number) => hasDictSharingType ? getDictionaryTextByValue('UC000013', text) : sharingType.find((i: any) => i.value === text)?.text,
938
+ },
939
+ ],
940
+ ...modalTableBusProps
941
+ }
942
+ }
943
+ if(type === 'customer2') {
944
+ // 版本2
945
+ requestConfig = {
946
+ url: `${prefixUrl.selectPrefix}/customer`,
947
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
948
+ mappingTextField: 'name',
949
+ mappingValueField: 'code',
950
+ otherParams: {
951
+ sorter: 'desc-id'
952
+ }, // 默认参数
953
+ sourceName: 'customCode',
954
+ ...requestConfigProp,
955
+ }
956
+ tableSearchForm = [
957
+ { name: 'qp-name-like', label: '客户名称' },
958
+ { name: 'qp-code-like', label: '客户编码' },
959
+ { name: 'qp-createOrgCode-eq', type: 'select', label: '创建组织', field: {
960
+ type: 'select',
961
+ props: {
962
+ // mode: 'multiple',
963
+ notFoundContent: '暂无数据',
964
+ allowClear: true,
965
+ showSearch: true,
966
+ showArrow: true,
967
+ // maxTagCount: 1,
968
+ optionFilterProp: 'children',
969
+ filterOption: (input: string, option: { props: { children: string } }) =>
970
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
971
+ },
972
+ } },
973
+ { name: 'qp-salesOrgCode-eq', 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
+ ]
988
+ Promise.all([
989
+ loadSelectSource(`${prefixUrl.formSelectFix}/org/listNoPage`, {}),
990
+ loadSelectSource(`${prefixUrl.formSelectFix}/org/listNoPage`,{}),
991
+ ]).then((x: any)=>{
992
+ formatSource(x,0, 2, tableSearchForm);
993
+ formatSource(x,1, 3, tableSearchForm);
994
+ })
995
+ modalTableProps = {
996
+ modalTableTitle: '选择客户',
997
+ tableSearchForm,
998
+ tableColumns: [
999
+ {
1000
+ title: '客户编码',
1001
+ dataIndex: 'code',
1002
+ },
1003
+ {
1004
+ title: '客户名称',
1005
+ dataIndex: 'name',
1006
+ },
1007
+ {
1008
+ title: '创建组织',
1009
+ dataIndex: 'createOrgName',
1010
+ },
1011
+ {
1012
+ title: '使用组织',
1013
+ dataIndex: 'salesOrgName',
1014
+ },
1015
+ ],
1016
+ ...modalTableBusProps
1017
+ }
1018
+ }
1019
+
1020
+ // 店铺选择器
1021
+ if(type === 'shopFile') {
1022
+ requestConfig = {
1023
+ url: `${prefixUrl.selectPrefix}/store`,
1024
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
1025
+ mappingTextField: 'name',
1026
+ mappingValueField: 'code',
1027
+ otherParams: {
1028
+ sorter: 'desc-id'
1029
+ }, // 默认参数
1030
+ sourceName: 'code',
1031
+ ...requestConfigProp,
1032
+ }
1033
+ tableSearchForm = [
1034
+ { name: 'qp-name-like', label: '店铺名称' },
1035
+ { name: 'qp-code-like', label: '店铺编码' },
1036
+ { name: 'qp-conglomerateCode-in', type: 'select', label: '归属集团', field: {
1037
+ type: 'select',
1038
+ props: {
1039
+ mode: 'multiple',
1040
+ notFoundContent: '暂无数据',
1041
+ allowClear: true,
1042
+ showSearch: true,
1043
+ showArrow: true,
1044
+ maxTagCount: 1,
1045
+ optionFilterProp: 'children',
1046
+ filterOption: (input: string, option: { props: { children: string } }) =>
1047
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1048
+ },
1049
+ } },
1050
+ { name: 'qp-companyCode-in', type: 'select', label: '归属法人公司', field: {
1051
+ type: 'select',
1052
+ props: {
1053
+ mode: 'multiple',
1054
+ notFoundContent: '暂无数据',
1055
+ allowClear: true,
1056
+ showSearch: true,
1057
+ showArrow: true,
1058
+ maxTagCount: 1,
1059
+ optionFilterProp: 'children',
1060
+ filterOption: (input: string, option: { props: { children: string } }) =>
1061
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1062
+ },
1063
+ } },
1064
+ { name: 'qp-type-in', type: 'select', label: '店铺类型', initialSource: shopFileType },
1065
+ { name: 'qp-plateformCode-in', type: 'select', label: '店铺来源', field: {
1066
+ type: 'select',
1067
+ props: {
1068
+ mode: 'multiple',
1069
+ notFoundContent: '暂无数据',
1070
+ allowClear: true,
1071
+ showSearch: true,
1072
+ showArrow: true,
1073
+ maxTagCount: 1,
1074
+ optionFilterProp: 'children',
1075
+ filterOption: (input: string, option: { props: { children: string } }) =>
1076
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1077
+ },
1078
+ } },
1079
+ { name: 'qp-accountingCode-in', type: 'select', label: '归属核算主体', field: {
1080
+ type: 'select',
1081
+ props: {
1082
+ mode: 'multiple',
1083
+ notFoundContent: '暂无数据',
1084
+ allowClear: true,
1085
+ showSearch: true,
1086
+ showArrow: true,
1087
+ maxTagCount: 1,
1088
+ optionFilterProp: 'children',
1089
+ filterOption: (input: string, option: { props: { children: string } }) =>
1090
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1091
+ },
1092
+ } },
1093
+ ]
1094
+ Promise.all([
1095
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
1096
+ pageSize: 5000,
1097
+ currentPage: 1,
1098
+ 'qp-companyType-eq': '30',
1099
+ }),
1100
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
1101
+ pageSize: 5000,
1102
+ currentPage: 1,
1103
+ 'qp-companyType-eq': '20',
1104
+ }),
1105
+ loadSelectSource(`${prefixUrl.formSelectFix}/platformRecord/getPlatformRecordList`, {
1106
+ // pageSize: 5000,
1107
+ // currentPage: 1,
1108
+ 'qp-status-eq': '1',
1109
+ }),
1110
+ loadSelectSource(`${prefixUrl.formSelectFix}/accountingSubject`, {
1111
+ pageSize: 5000,
1112
+ currentPage: 1,
1113
+ }),
1114
+ ]).then((x: any)=>{
1115
+ formatSource(x,0, 2, tableSearchForm);
1116
+ formatSource(x,1, 3, tableSearchForm);
1117
+ formatSource(x,2, 5, tableSearchForm);
1118
+ formatSource(x,3, 6, tableSearchForm);
1119
+ })
1120
+ modalTableProps = {
1121
+ modalTableTitle: '选择店铺',
1122
+ tableSearchForm,
1123
+ tableColumns: [
1124
+ {
1125
+ title: '店铺编码',
1126
+ dataIndex: 'code',
1127
+ },
1128
+ {
1129
+ title: '店铺名称',
1130
+ dataIndex: 'name',
1131
+ },
1132
+ {
1133
+ title: '归属集团',
1134
+ dataIndex: 'conglomerateName',
1135
+ },
1136
+ {
1137
+ title: '归属法人公司',
1138
+ dataIndex: 'companyName',
1139
+ },
1140
+ {
1141
+ title: '店铺类型',
1142
+ dataIndex: 'type',
1143
+ render: (text: number) => shopFileType.find((i: any) => i.value === text)?.text,
1144
+ },
1145
+ {
1146
+ title: '店铺来源',
1147
+ dataIndex: 'platformName',
1148
+ },
1149
+ {
1150
+ title: '归属核算主体',
1151
+ dataIndex: 'accountingName',
1152
+ },
1153
+ ],
1154
+ ...modalTableBusProps
1155
+ }
1156
+ }
1157
+ if(type === 'shopFile2') {
1158
+ requestConfig = {
1159
+ url: `${prefixUrl.selectPrefix}/store/page`,
1160
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
1161
+ mappingTextField: 'name',
1162
+ mappingValueField: 'code',
1163
+ otherParams: {
1164
+ sorter: 'desc-id'
1165
+ }, // 默认参数
1166
+ sourceName: 'code',
1167
+ ...requestConfigProp,
1168
+ }
1169
+ tableSearchForm = [
1170
+ { name: 'qp-name-like', label: '商店名称' },
1171
+ { name: 'qp-code-like', label: '商店编码' },
1172
+ { name: 'qp-type-in', type: 'select', label: '商店类型', initialSource: shopFile2Type },
1173
+ { name: 'qp-orgCode-in', type: 'select', label: '所属销售组织', field: {
1174
+ type: 'select',
1175
+ props: {
1176
+ mode: 'multiple',
1177
+ notFoundContent: '暂无数据',
1178
+ allowClear: true,
1179
+ showSearch: true,
1180
+ showArrow: true,
1181
+ maxTagCount: 1,
1182
+ optionFilterProp: 'children',
1183
+ filterOption: (input: string, option: { props: { children: string } }) =>
1184
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1185
+ },
1186
+ } },
1187
+ ]
1188
+ Promise.all([
1189
+ loadSelectSource(`${prefixUrl.formSelectFix}/orgView/getTree/sales-organizational-view`, {
1190
+ 'qp-employeeCode-eq': JSON.parse(localStorage.getItem(ENUM.BROWSER_CACHE.USER_INFO) || '{}')?.employeeResVo?.employeeNumber,
1191
+ 'qp-realOrg-eq': true,
1192
+ 'qp-status-eq': 10
1193
+ }),
1194
+ ]).then((x: any)=>{
1195
+ formatSource(x,0, 3, tableSearchForm);
1196
+ })
1197
+ modalTableProps = {
1198
+ modalTableTitle: '选择商店',
1199
+ tableSearchForm,
1200
+ tableColumns: [
1201
+ {
1202
+ title: '商店编码',
1203
+ dataIndex: 'code',
1204
+ },
1205
+ {
1206
+ title: '商店名称',
1207
+ dataIndex: 'name',
1208
+ },
1209
+ {
1210
+ title: '商店类型',
1211
+ dataIndex: 'type',
1212
+ render: (text: number) => shopFile2Type.find((i: any) => i.value === text)?.text,
1213
+ },
1214
+ {
1215
+ title: '所属销售组织',
1216
+ dataIndex: 'orgName',
1217
+ },
1218
+ ],
1219
+ ...modalTableBusProps
1220
+ }
1221
+ }
1222
+
1223
+ // 核算主体选择器(无弹窗)
1224
+ if(type === 'accountingSubject') {
1225
+ requestConfig = {
1226
+ url: `${prefixUrl.selectPrefix}/accountingSubject`,
1227
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
1228
+ mappingTextField: 'name',
1229
+ mappingTextShowKeyField: 'code',
1230
+ mappingValueField: 'id',
1231
+ otherParams: {
1232
+ sorter: 'desc-id'
1233
+ }, // 默认参数
1234
+ sourceName: 'accountingSubjectCode',
1235
+ ...requestConfigProp,
1236
+ }
1237
+ needModalTable = false
1238
+ }
1239
+ // 库存组织选择器(无弹窗)
1240
+ if(type === 'inventoryOrg') {
1241
+ requestConfig = {
1242
+ url: `${prefixUrl.selectPrefix}/inventoryOrg`,
1243
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
1244
+ mappingTextField: 'name',
1245
+ mappingTextShowKeyField: 'code',
1246
+ mappingValueField: 'id',
1247
+ otherParams: {
1248
+ sorter: 'desc-id'
1249
+ }, // 默认参数
1250
+ sourceName: 'inventoryOrgCode',
1251
+ ...requestConfigProp,
1252
+ }
1253
+ needModalTable = false
1254
+ }
1255
+
1256
+ // 法人公司选择器(无弹窗)
1257
+ if(type === 'corporationCompany') {
1258
+ requestConfig = {
1259
+ url: `${prefixUrl.selectPrefix}/company`,
1260
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
1261
+ mappingTextField: 'name',
1262
+ mappingTextShowKeyField: 'code',
1263
+ mappingValueField: 'id',
1264
+ otherParams: {
1265
+ sorter: 'desc-id'
1266
+ }, // 默认参数
1267
+ sourceName: 'corporationCompany',
1268
+ ...requestConfigProp,
1269
+ }
1270
+ needModalTable = false
1271
+ }
1272
+
1273
+ // 员工选择器
1274
+ if(type === 'employee') {
1275
+ requestConfig = {
1276
+ url: `${prefixUrl.selectPrefix}/employee/v2`,
1277
+ filter: 'qp-employeeNumber,name-orGroup,like', // 过滤参数
1278
+ mappingTextField: 'name',
1279
+ mappingTextShowKeyField: 'employeeNumber',
1280
+ mappingValueField: 'employeeNumber',
1281
+ otherParams: {
1282
+ 'qp-enable-eq': 10, // 启用状态 10-启用,20-禁用
1283
+ 'qp-employmentType-eq': 20,
1284
+ sorter: 'desc-id'
1285
+ }, // 默认参数
1286
+ sourceName: 'employeeNumber',
1287
+ ...requestConfigProp,
1288
+ }
1289
+ tableSearchForm = [
1290
+ { name: 'qp-name-like', label: '员工名称' },
1291
+ { name: 'qp-employeeNumber-like', label: '员工编码' },
1292
+ { name: 'qp-companyCode-in', type: 'select', label: '所属公司', field: {
1293
+ type: 'select',
1294
+ props: {
1295
+ mode: 'multiple',
1296
+ notFoundContent: '暂无数据',
1297
+ allowClear: true,
1298
+ showSearch: true,
1299
+ showArrow: true,
1300
+ maxTagCount: 1,
1301
+ optionFilterProp: 'children',
1302
+ filterOption: (input: string, option: { props: { children: string } }) =>
1303
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1304
+ },
1305
+ } },
1306
+ { name: 'qp-email-like', label: '邮箱' },
1307
+ { name: 'qp-officeTelephone-like', label: '手机号' },
1308
+ ]
1309
+ Promise.all([
1310
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
1311
+ pageSize: 5000,
1312
+ currentPage: 1,
1313
+ 'qp-companyType-eq': 20,
1314
+ }),
1315
+ ]).then((x: any)=>{
1316
+ formatSource(x,0, 2, tableSearchForm);
1317
+ })
1318
+ modalTableProps = {
1319
+ modalTableTitle: '选择员工',
1320
+ tableSearchForm,
1321
+ tableColumns: [
1322
+ {
1323
+ title: '员工编码',
1324
+ dataIndex: 'employeeNumber',
1325
+ },
1326
+ {
1327
+ title: '员工名称',
1328
+ dataIndex: 'name',
1329
+ },
1330
+ {
1331
+ title: '所属公司',
1332
+ dataIndex: 'companyName',
1333
+ },
1334
+ {
1335
+ title: '邮箱',
1336
+ dataIndex: 'email',
1337
+ },
1338
+ {
1339
+ title: '手机号',
1340
+ dataIndex: 'officeTelephone',
1341
+ },
1342
+ ],
1343
+ ...modalTableBusProps
1344
+ }
1345
+ }
1346
+ if(type === 'employee2') {
1347
+ // 版本2
1348
+ requestConfig = {
1349
+ url: `${prefixUrl.selectPrefix}/employee/pageList/v2`,
1350
+ filter: 'qp-username,name-orGroup,like', // 过滤参数
1351
+ mappingTextField: 'name',
1352
+ mappingTextShowKeyField: 'username',
1353
+ mappingValueField: 'id',
1354
+ otherParams: {
1355
+ 'qp-enable-eq': 10, // 启用状态 10-启用,20-禁用
1356
+ 'qp-employmentType-eq': 20,
1357
+ 'qp-orgViewIds-like': 'administrative-organization-view',
1358
+ sorter: 'desc-id'
1359
+ }, // 默认参数
1360
+ sourceName: 'employeeNumber',
1361
+ ...requestConfigProp,
1362
+ }
1363
+ tableSearchForm = [
1364
+ { name: 'qp-username-like', label: '账户名称' },
1365
+ { name: 'qp-name-like', label: '显示名称' },
1366
+ // { name: 'qp-employeeNumber-like', label: '员工编码' },
1367
+ { name: 'qp-code-in', type: 'treeSelect', label: '所属组织机构', field: {
1368
+ type: 'treeSelect',
1369
+ props: {
1370
+ multiple: true,
1371
+ treeData: [],
1372
+ treeCheckable: false,
1373
+ showSearch: true,
1374
+ allowClear: true,
1375
+ showArrow: true,
1376
+ treeNodeFilterProp: 'title',
1377
+ treeDefaultExpandAll: true,
1378
+ maxTagCount: 1,
1379
+ placeholder: '请选择',
1380
+ style: {
1381
+ width: '100%',
1382
+ },
1383
+ showCheckedStrategy: 'TreeSelect.SHOW_ALL',
1384
+ dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
1385
+ },
1386
+ } },
1387
+ { name: 'qp-email-like', label: '邮箱' },
1388
+ { name: 'qp-officeTelephone-like', label: '手机号' },
1389
+ ]
1390
+ Promise.all([
1391
+ loadSelectSource(`${prefixUrl.formSelectFix}/orgViewNode/common/getTreeForOrgViewAndTenant`, { 'orgViewCode': 'administrative-organization-view' }),
1392
+ ]).then((x: any)=>{
1393
+ formatTreeDataSource(x,0, 2, tableSearchForm,['code', 'name']);
1394
+ })
1395
+ modalTableProps = {
1396
+ modalTableTitle: '添加员工',
1397
+ tableSearchForm,
1398
+ tableColumns: [
1399
+ {
1400
+ title: '账户名称',
1401
+ dataIndex: 'username',
1402
+ },
1403
+ {
1404
+ title: '显示名称',
1405
+ dataIndex: 'name',
1406
+ },
1407
+ // {
1408
+ // title: '员工编码',
1409
+ // dataIndex: 'employeeNumber',
1410
+ // },
1411
+ // {
1412
+ // title: '员工名称',
1413
+ // dataIndex: 'name',
1414
+ // },
1415
+ {
1416
+ title: '所属组织机构',
1417
+ dataIndex: 'administrativeNames',
1418
+ render: (text: any) => handleTextOverflow(text),
1419
+ },
1420
+ {
1421
+ title: '邮箱',
1422
+ dataIndex: 'email',
1423
+ },
1424
+ {
1425
+ title: '手机号',
1426
+ dataIndex: 'officeTelephone',
1427
+ },
1428
+ ],
1429
+ ...modalTableBusProps
1430
+ }
1431
+ }
1432
+
1433
+ // 配送方式选择器
1434
+ if(type === 'deliveryMode') {
1435
+ requestConfig = {
1436
+ url: `${prefixUrl.selectPrefix}/deliveryMode`,
1437
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
1438
+ mappingTextField: 'name',
1439
+ mappingTextShowKeyField: 'code',
1440
+ mappingValueField: 'code',
1441
+ otherParams: {
1442
+ sorter: 'desc-id'
1443
+ }, // 默认参数
1444
+ sourceName: 'deliveryModeCode',
1445
+ ...requestConfigProp
1446
+ }
1447
+ tableSearchForm = [
1448
+ { name: 'qp-name-like', label: '配送方式名称' },
1449
+ { name: 'qp-code-like', label: '配送方式编码' },
1450
+ { name: 'qp-logisCompanyCode-in', type: 'select', label: '所属物流商', field: {
1451
+ type: 'select',
1452
+ props: {
1453
+ mode: 'multiple',
1454
+ notFoundContent: '暂无数据',
1455
+ allowClear: true,
1456
+ showSearch: true,
1457
+ showArrow: true,
1458
+ maxTagCount: 1,
1459
+ optionFilterProp: 'children',
1460
+ filterOption: (input: string, option: { props: { children: string } }) =>
1461
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1462
+ },
1463
+ } },
1464
+ { name: 'qp-recordChannnelCode-in', type: 'select', label: '单号获取通道', initialSource: getDictionarySource('BSC00004') },
1465
+ { name: 'qp-arrivalPaySupport-in', type: 'select', label: '是否支持到付', initialSource: arrivalPaySupportList },
1466
+ { name: 'qp-sheetTemplateCode-in', type: 'select', label: '面单模板', field: {
1467
+ type: 'select',
1468
+ props: {
1469
+ mode: 'multiple',
1470
+ notFoundContent: '暂无数据',
1471
+ allowClear: true,
1472
+ showSearch: true,
1473
+ showArrow: true,
1474
+ maxTagCount: 1,
1475
+ optionFilterProp: 'children',
1476
+ filterOption: (input: string, option: { props: { children: string } }) =>
1477
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1478
+ },
1479
+ } },
1480
+ { name: 'qp-remark-like', label: '备注' },
1481
+ ]
1482
+ Promise.all([
1483
+ loadSelectSource(`${prefixUrl.formSelectFix}/logisCompany`, {
1484
+ pageSize: 5000,
1485
+ currentPage: 1,
1486
+ }),
1487
+ loadSelectSource(`${prefixUrl.formSelectFix}/printTemplate`, {
1488
+ pageSize: 5000,
1489
+ currentPage: 1,
1490
+ })
1491
+ ]).then((x: any)=>{
1492
+ formatSource(x,0, 2, tableSearchForm);
1493
+ formatSource(x,1, 5, tableSearchForm);
1494
+ })
1495
+ modalTableProps = {
1496
+ modalTableTitle: '选择配送方式',
1497
+ tableSearchForm,
1498
+ tableColumns: [
1499
+ {
1500
+ title: '配送方式编码',
1501
+ dataIndex: 'code',
1502
+ },
1503
+ {
1504
+ title: '配送方式名称',
1505
+ dataIndex: 'name',
1506
+ },
1507
+ {
1508
+ title: '所属物流商',
1509
+ dataIndex: 'logisCompanyName',
1510
+ },
1511
+ {
1512
+ dataIndex: 'recordChannnelCode',
1513
+ title: '单号获取通道',
1514
+ render: (text: any) => getDictionaryTextByValue('BSC00004', text),
1515
+ },
1516
+ {
1517
+ dataIndex: 'arrivalPaySupport',
1518
+ title: '是否支持到付',
1519
+ render: (text: number) => arrivalPaySupportList.find((i: any) => i.value === text)?.text,
1520
+ },
1521
+ {
1522
+ dataIndex: 'sheetTemplateName',
1523
+ title: '面单模板',
1524
+ },
1525
+ {
1526
+ dataIndex: 'remark',
1527
+ title: '备注',
1528
+ },
1529
+ ],
1530
+ ...modalTableBusProps
1531
+ }
1532
+ }
1533
+
1534
+ // 规则场景选择器
1535
+ if(type === 'ruleTemplate') {
1536
+ requestConfig = {
1537
+ url: `${prefixUrl.selectPrefix}/ruleTemplate`,
1538
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
1539
+ mappingTextField: 'name',
1540
+ mappingTextShowKeyField: 'code',
1541
+ mappingValueField: 'code',
1542
+ otherParams: {
1543
+ sorter: 'desc-id'
1544
+ }, // 默认参数
1545
+ sourceName: 'ruleTemplateCode',
1546
+ ...requestConfigProp
1547
+ }
1548
+ tableSearchForm = [
1549
+ { name: 'qp-name-like', label: '规则场景名称' },
1550
+ { name: 'qp-code-like', label: '规则场景编码' },
1551
+ ]
1552
+ modalTableProps = {
1553
+ modalTableTitle: '选择规则场景',
1554
+ tableSearchForm,
1555
+ tableColumns: [
1556
+ {
1557
+ title: '规则场景编码',
1558
+ dataIndex: 'code',
1559
+ },
1560
+ {
1561
+ title: '规则场景名称',
1562
+ dataIndex: 'name',
1563
+ render: (text: any) => handleTextOverflow(text),
1564
+ },
1565
+ {
1566
+ title: '条件对象',
1567
+ dataIndex: 'objectName',
1568
+ render: (text: any) => handleTextOverflow(text),
1569
+ },
1570
+ {
1571
+ dataIndex: 'extName',
1572
+ title: '条件扩展',
1573
+ render: (text: any) => handleTextOverflow(text),
1574
+ },
1575
+ {
1576
+ dataIndex: 'actionName',
1577
+ title: '执行动作',
1578
+ render: (text: any) => handleTextOverflow(text),
1579
+ },
1580
+ ],
1581
+ ...modalTableBusProps
1582
+ }
1583
+ }
1584
+
1585
+ return { modalTableProps, requestConfig, needModalTable };
1586
+ }