@bit-sun/business-component 2.4.31 → 2.4.32

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 (205) 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/index.esm.js +189 -244
  9. package/dist/index.js +195 -250
  10. package/dist/utils/utils.d.ts +1 -1
  11. package/docs/index.md +21 -21
  12. package/lib/assets/drag.svg +17 -17
  13. package/lib/assets/exportFail.svg +37 -37
  14. package/lib/assets/exportProcessing.svg +28 -28
  15. package/lib/assets/exportSuccess.svg +34 -34
  16. package/lib/assets/label_icon_bottom.svg +25 -25
  17. package/lib/assets/upExport.svg +22 -22
  18. package/package.json +80 -80
  19. package/src/assets/32.svg +27 -27
  20. package/src/assets/addIcon.svg +17 -17
  21. package/src/assets/allfunc.svg +27 -27
  22. package/src/assets/arrowRight.svg +24 -24
  23. package/src/assets/btn-delete.svg +29 -29
  24. package/src/assets/btn-edit.svg +19 -19
  25. package/src/assets/btn-more.svg +17 -17
  26. package/src/assets/btn-submit.svg +19 -19
  27. package/src/assets/caidan.svg +11 -11
  28. package/src/assets/close.svg +26 -26
  29. package/src/assets/drag.svg +17 -17
  30. package/src/assets/exportFail.svg +37 -37
  31. package/src/assets/exportProcessing.svg +28 -28
  32. package/src/assets/exportSuccess.svg +34 -34
  33. package/src/assets/fixed-left-active.svg +11 -11
  34. package/src/assets/fixed-left.svg +15 -15
  35. package/src/assets/fixed-right-active.svg +11 -11
  36. package/src/assets/fixed-right.svg +15 -15
  37. package/src/assets/guanbi.svg +15 -15
  38. package/src/assets/icon-quanping.svg +15 -15
  39. package/src/assets/icon-shezhi.svg +17 -17
  40. package/src/assets/label_icon_bottom.svg +25 -25
  41. package/src/assets/list-no-img.svg +21 -21
  42. package/src/assets/morentouxiang-32.svg +23 -23
  43. package/src/assets/scanning.svg +24 -24
  44. package/src/assets/upExport.svg +22 -22
  45. package/src/common/ENUM.ts +41 -41
  46. package/src/components/Business/AddSelectBusiness/index.md +162 -162
  47. package/src/components/Business/AddSelectBusiness/index.tsx +1062 -1062
  48. package/src/components/Business/BsLayouts/Components/AllFunc/drawContent.tsx +112 -112
  49. package/src/components/Business/BsLayouts/Components/AllFunc/index.less +153 -153
  50. package/src/components/Business/BsLayouts/Components/AllFunc/index.tsx +70 -70
  51. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.less +90 -90
  52. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.tsx +37 -37
  53. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/leftTree.tsx +242 -242
  54. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/rightTree.tsx +384 -384
  55. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/DrawContent.tsx +285 -285
  56. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/customMenuHeader.tsx +74 -74
  57. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/drawContent.less +170 -170
  58. package/src/components/Business/BsLayouts/Components/CustomerMenu/index.less +64 -64
  59. package/src/components/Business/BsLayouts/Components/CustomerMenu/index.tsx +153 -153
  60. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.less +72 -72
  61. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.tsx +158 -158
  62. package/src/components/Business/BsLayouts/Components/RightContent/LoginModal.tsx +85 -85
  63. package/src/components/Business/BsLayouts/Components/RightContent/home.less +218 -218
  64. package/src/components/Business/BsLayouts/Components/RightContent/index.tsx +155 -155
  65. package/src/components/Business/BsLayouts/Components/SearchFunc/index.less +160 -160
  66. package/src/components/Business/BsLayouts/Components/SearchFunc/index.tsx +75 -75
  67. package/src/components/Business/BsLayouts/index.less +79 -79
  68. package/src/components/Business/BsLayouts/index.tsx +1484 -1484
  69. package/src/components/Business/BsLayouts/service.ts +10 -10
  70. package/src/components/Business/BsLayouts/utils.tsx +203 -203
  71. package/src/components/Business/BsSulaQueryTable/SearchItemSetting.tsx +566 -566
  72. package/src/components/Business/BsSulaQueryTable/index.less +221 -221
  73. package/src/components/Business/BsSulaQueryTable/index.tsx +606 -606
  74. package/src/components/Business/BsSulaQueryTable/setting.tsx +854 -854
  75. package/src/components/Business/BsSulaQueryTable/utils.less +65 -65
  76. package/src/components/Business/BsSulaQueryTable/utils.tsx +690 -690
  77. package/src/components/Business/CommodityEntry/index.md +70 -70
  78. package/src/components/Business/CommodityEntry/index.tsx +81 -81
  79. package/src/components/Business/CommonAlert/index.tsx +23 -23
  80. package/src/components/Business/CommonGuideWrapper/index.less +111 -111
  81. package/src/components/Business/CommonGuideWrapper/index.md +39 -39
  82. package/src/components/Business/CommonGuideWrapper/index.tsx +83 -83
  83. package/src/components/Business/DetailPageWrapper/index.less +79 -79
  84. package/src/components/Business/DetailPageWrapper/index.tsx +315 -315
  85. package/src/components/Business/DetailPageWrapper/utils.tsx +164 -164
  86. package/src/components/Business/HomePageWrapper/index.less +33 -33
  87. package/src/components/Business/HomePageWrapper/index.md +45 -45
  88. package/src/components/Business/HomePageWrapper/index.tsx +162 -162
  89. package/src/components/Business/JsonQueryTable/components/FieldsModifyModal.tsx +824 -824
  90. package/src/components/Business/JsonQueryTable/components/FieldsSettingsTable.tsx +205 -205
  91. package/src/components/Business/JsonQueryTable/components/Formula.tsx +206 -206
  92. package/src/components/Business/JsonQueryTable/components/MaintainOptions.tsx +127 -127
  93. package/src/components/Business/JsonQueryTable/configButton/index.js +20 -20
  94. package/src/components/Business/JsonQueryTable/configTree/component/compactArrayView.js +25 -25
  95. package/src/components/Business/JsonQueryTable/configTree/component/compactObjectView.js +30 -30
  96. package/src/components/Business/JsonQueryTable/configTree/index.js +82 -82
  97. package/src/components/Business/JsonQueryTable/configTree/index.less +44 -44
  98. package/src/components/Business/JsonQueryTable/configTree/parser/highlight.js +57 -57
  99. package/src/components/Business/JsonQueryTable/configTree/parser/index.js +124 -124
  100. package/src/components/Business/JsonQueryTable/configTree/render/iconRender.js +29 -29
  101. package/src/components/Business/JsonQueryTable/configTree/render/nameRender.js +22 -22
  102. package/src/components/Business/JsonQueryTable/configTree/treeNode.js +116 -116
  103. package/src/components/Business/JsonQueryTable/drawer/index.tsx +12 -12
  104. package/src/components/Business/JsonQueryTable/function.ts +62 -62
  105. package/src/components/Business/JsonQueryTable/index.less +16 -16
  106. package/src/components/Business/JsonQueryTable/index.md +328 -328
  107. package/src/components/Business/JsonQueryTable/index.tsx +537 -537
  108. package/src/components/Business/JsonQueryTable/jsonEditor/index.js +346 -346
  109. package/src/components/Business/JsonQueryTable/jsonEditor/index.less +22 -22
  110. package/src/components/Business/JsonQueryTable/jsonEditor/lint/basicType.js +147 -147
  111. package/src/components/Business/JsonQueryTable/jsonEditor/lint/index.js +389 -389
  112. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/actions.js +118 -118
  113. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/dependency.js +22 -22
  114. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/index.js +21 -21
  115. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/request.js +65 -65
  116. package/src/components/Business/JsonQueryTable/static.ts +450 -450
  117. package/src/components/Business/SearchSelect/BusinessUtils.tsx +2120 -2120
  118. package/src/components/Business/SearchSelect/common.ts +134 -134
  119. package/src/components/Business/SearchSelect/index.md +1503 -1503
  120. package/src/components/Business/SearchSelect/index.tsx +55 -55
  121. package/src/components/Business/SearchSelect/utils.ts +101 -101
  122. package/src/components/Business/StateFlow/index.less +130 -130
  123. package/src/components/Business/StateFlow/index.md +60 -60
  124. package/src/components/Business/StateFlow/index.tsx +29 -29
  125. package/src/components/Business/TreeSearchSelect/index.md +185 -185
  126. package/src/components/Business/TreeSearchSelect/index.tsx +33 -33
  127. package/src/components/Business/TreeSearchSelect/utils.ts +104 -104
  128. package/src/components/Business/columnSettingTable/columnSetting.tsx +766 -766
  129. package/src/components/Business/columnSettingTable/index.less +247 -247
  130. package/src/components/Business/columnSettingTable/index.md +357 -357
  131. package/src/components/Business/columnSettingTable/index.tsx +235 -235
  132. package/src/components/Business/columnSettingTable/sulaSettingTable.tsx +243 -243
  133. package/src/components/Business/columnSettingTable/utils.tsx +71 -71
  134. package/src/components/Business/moreTreeTable/FixedScrollBar.tsx +87 -87
  135. package/src/components/Business/moreTreeTable/hooks/useSticky.ts +21 -21
  136. package/src/components/Business/moreTreeTable/index.less +99 -99
  137. package/src/components/Business/moreTreeTable/index.md +448 -448
  138. package/src/components/Business/moreTreeTable/index.tsx +387 -387
  139. package/src/components/Business/moreTreeTable/utils.ts +126 -126
  140. package/src/components/Functional/AddSelect/helps.ts +80 -80
  141. package/src/components/Functional/AddSelect/index.less +367 -367
  142. package/src/components/Functional/AddSelect/index.md +155 -155
  143. package/src/components/Functional/AddSelect/index.tsx +1171 -1171
  144. package/src/components/Functional/BillEntry/index.less +371 -371
  145. package/src/components/Functional/BillEntry/index.md +39 -39
  146. package/src/components/Functional/BillEntry/index.tsx +773 -773
  147. package/src/components/Functional/BsAntdSula/BsCascader/index.md +62 -62
  148. package/src/components/Functional/BsAntdSula/BsCascader/index.tsx +178 -178
  149. package/src/components/Functional/BsAntdSula/index.ts +2 -2
  150. package/src/components/Functional/DataImport/index.less +63 -63
  151. package/src/components/Functional/DataImport/index.md +44 -44
  152. package/src/components/Functional/DataImport/index.tsx +696 -696
  153. package/src/components/Functional/DataValidation/index.less +63 -63
  154. package/src/components/Functional/DataValidation/index.md +39 -39
  155. package/src/components/Functional/DataValidation/index.tsx +688 -688
  156. package/src/components/Functional/EllipsisTooltip/index.d.ts +5 -5
  157. package/src/components/Functional/EllipsisTooltip/index.js +36 -36
  158. package/src/components/Functional/EllipsisTooltip/index.md +30 -30
  159. package/src/components/Functional/ExportFunctions/ExportIcon/index.md +37 -37
  160. package/src/components/Functional/ExportFunctions/ExportIcon/index.tsx +60 -60
  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 +897 -896
  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 +204 -204
  170. package/src/components/Solution/RuleComponent/Formula.tsx +335 -335
  171. package/src/components/Solution/RuleComponent/InnerSelect.tsx +62 -62
  172. package/src/components/Solution/RuleComponent/index.d.ts +29 -29
  173. package/src/components/Solution/RuleComponent/index.js +2103 -2103
  174. package/src/components/Solution/RuleComponent/index.less +229 -229
  175. package/src/components/Solution/RuleComponent/renderSpecificAction.js +99 -99
  176. package/src/components/Solution/RuleComponent/ruleFiled.js +2293 -2293
  177. package/src/components/Solution/RuleComponent/services.ts +13 -13
  178. package/src/components/Solution/RuleComponent/util.js +143 -143
  179. package/src/components/Solution/RuleSetter/RuleInstance.tsx +6 -6
  180. package/src/components/Solution/RuleSetter/baseRule.tsx +368 -368
  181. package/src/components/Solution/RuleSetter/function.ts +336 -336
  182. package/src/components/Solution/RuleSetter/index.less +221 -221
  183. package/src/components/Solution/RuleSetter/index.tsx +208 -208
  184. package/src/components/Solution/RuleSetter/service.js +276 -276
  185. package/src/index.ts +40 -40
  186. package/src/plugin/TableColumnSetting/index.less +247 -247
  187. package/src/plugin/TableColumnSetting/index.md +50 -50
  188. package/src/plugin/TableColumnSetting/index.tsx +725 -725
  189. package/src/plugin/TableColumnSetting/utils.ts +19 -19
  190. package/src/styles/bsDefault.less +1912 -1912
  191. package/src/utils/CheckOneUser/index.md +39 -39
  192. package/src/utils/CheckOneUser/index.ts +51 -51
  193. package/src/utils/CustomLoginInfo.ts +55 -55
  194. package/src/utils/LocalstorageUtils.ts +128 -128
  195. package/src/utils/TableUtils.tsx +18 -18
  196. package/src/utils/auth.ts +32 -32
  197. package/src/utils/checkUtils.ts +39 -39
  198. package/src/utils/enumConfig.ts +16 -16
  199. package/src/utils/getFormMode.js +12 -12
  200. package/src/utils/index.ts +12 -12
  201. package/src/utils/requestUtils.ts +166 -166
  202. package/src/utils/serialize.js +7 -7
  203. package/src/utils/utils.ts +195 -195
  204. package/tsconfig.json +29 -29
  205. package/typings.d.ts +4 -4
@@ -1,2120 +1,2120 @@
1
- // 此文件用于 处理业务组件 所用到的公共方法
2
- // @ts-nocheck
3
- import { shopFileType, arrivalPaySupportList, sharingType, shopFile2Type, shopFile2Status, employeeType, orgType, nodeType, personDataSourceType } from './common';
4
- import { getDictionarySource, getDictionaryTextByValue, loadSelectSource } from './utils';
5
- import { handleTextOverflow, tableColumnsImage } from '@/components/Business/BsSulaQueryTable/utils';
6
- import { getSkuImg } from '@/utils/TableUtils';
7
- import { getEmployeeCode } from '@/utils/LocalstorageUtils';
8
- import { Image } from 'antd';
9
-
10
- const hasDictSharingType = getDictionarySource('UC000013')?.length;
11
- const sharingTypeDataList = hasDictSharingType && getDictionarySource('UC000013') || sharingType
12
-
13
- export function commonFun (type?: string, prefixUrl: any, requestConfigProp?: any, modalTableBusProps?:any) {
14
- // 默认type === 'supplier' 供应商选择器
15
- let requestConfig = {
16
- url: `${prefixUrl.selectPrefix}/supplier`,
17
- filter: 'qp-name,code-orGroup,like', // 过滤参数
18
- otherParams: {
19
- sorter: 'desc-id'
20
- }, // 默认参数
21
- ...requestConfigProp
22
- }
23
-
24
- /*
25
- * 处理 格式化下拉框数据源
26
- * reData 必传 promise返回响应的数据 格式为[{},{},{},...] Promise.all第一个参数数组有多少个数组长度就是多少,其中每个对象为每次请求的结果数据
27
- * 每个结果数据格式为{ status: '0', msg: 'success', data: { items: [], total: 1, size: 1, page: 1 }, traceId: 'baba..'}
28
- * position 必传 为获取Promise.all请求结果的位置
29
- * changePosition 必传 为搜索表单Form中需要更改数据源的Item项的位置
30
- * changeSearchForm 必传 为搜索表单Form数据
31
- * */
32
- const formatSource = (reData: any, position: number, changePosition: number,changeSearchForm: any,resKeyValue=['code', 'name']) => {
33
- const data = reData && reData[position]?.data;
34
- const list = Array.isArray(data) ? data :(data?.items || data?.list || data?.children || []);
35
- const formatData = list?.length ? list.map((v: any) => ({ text: v[resKeyValue[1]], value: v[resKeyValue[0]] })) : [];
36
- changeSearchForm[changePosition] = {...changeSearchForm[changePosition], initialSource: formatData}
37
- }
38
-
39
- // 格式化树选择器数据源
40
- const mapSearchTree = (treeDataItem: any, resKeyValue: any, disabledJudge?: any) => {
41
- const haveChildren = Array.isArray(treeDataItem.children) && treeDataItem.children.length > 0;
42
- return {
43
- title: treeDataItem[resKeyValue[1]],
44
- value: treeDataItem[resKeyValue[0]],
45
- parentId: treeDataItem.parent,
46
- data: { ...treeDataItem },
47
- isLeaf: !haveChildren,
48
- disabled: disabledJudge!==undefined? disabledJudge : haveChildren,
49
- children: haveChildren ? treeDataItem.children.map((i: any) => mapSearchTree(i, resKeyValue, disabledJudge)) : [],
50
- };
51
- };
52
- const formatTreeDataSource = (reData: any, position: number, changePosition: number,changeSearchForm: any,resKeyValue=['id', 'name']) => {
53
- let data = reData && reData[position]?.data;
54
- let disabledJudge;
55
- if(Object.keys(data).length) {
56
- data = [data];
57
- disabledJudge=false
58
- }
59
- const formatData = (data &&
60
- Array.isArray(data) &&
61
- data.length &&
62
- data.map((ites: any) => mapSearchTree(ites, resKeyValue, disabledJudge))) ||
63
- []
64
- changeSearchForm[changePosition].field.props.treeData = formatData;
65
- }
66
-
67
-
68
- let tableSearchForm: any [] = [];
69
- let modalTableProps = {
70
- modalTableTitle: '',
71
- tableSearchForm,
72
- tableColumns: [],
73
- ...modalTableBusProps,
74
- }
75
- let needModalTable = modalTableBusProps?.needModalTable !== undefined ? modalTableBusProps?.needModalTable : true;
76
-
77
- // 供应商选择器
78
- if(type === 'supplier') {
79
- tableSearchForm = [
80
- { name: 'qp-name-like', label: '供应商名称' }, // field: { type: 'input', props: { placeholder: '请输入'}}
81
- { name: 'qp-code-like', label: '供应商编码' },
82
- { name: 'qp-conglomerateCode-in', type: 'select', label: '归属集团', field: {
83
- type: 'select',
84
- props: {
85
- mode: 'multiple',
86
- notFoundContent: '暂无数据',
87
- allowClear: true,
88
- showSearch: true,
89
- showArrow: true,
90
- maxTagCount: 1,
91
- optionFilterProp: 'children',
92
- filterOption: (input: string, option: { props: { children: string } }) =>
93
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
94
- },
95
- } },
96
- { name: 'qp-accountingCode-in', type: 'select', label: '归属核算主体', field: {
97
- type: 'select',
98
- props: {
99
- mode: 'multiple',
100
- notFoundContent: '暂无数据',
101
- allowClear: true,
102
- showSearch: true,
103
- showArrow: true,
104
- maxTagCount: 1,
105
- optionFilterProp: 'children',
106
- filterOption: (input: string, option: { props: { children: string } }) =>
107
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
108
- },
109
- } },
110
- { name: 'qp-companyCode-in', type: 'select', label: '归属法人公司', field: {
111
- type: 'select',
112
- props: {
113
- mode: 'multiple',
114
- notFoundContent: '暂无数据',
115
- allowClear: true,
116
- showSearch: true,
117
- showArrow: true,
118
- maxTagCount: 1,
119
- optionFilterProp: 'children',
120
- filterOption: (input: string, option: { props: { children: string } }) =>
121
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
122
- },
123
- } },
124
- { name: 'qp-sharingType-eq', type: 'select', label: '共享类型', initialSource: sharingTypeDataList },
125
- ]
126
- Promise.all([
127
- loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
128
- pageSize: 5000,
129
- currentPage: 1,
130
- 'qp-companyType-eq': '30',
131
- }),
132
- loadSelectSource(`${prefixUrl.formSelectFix}/accountingSubject`, {
133
- pageSize: 5000,
134
- currentPage: 1,
135
- }),
136
- loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
137
- pageSize: 5000,
138
- currentPage: 1,
139
- 'qp-companyType-eq': '20',
140
- })
141
- ]).then((x: any)=>{
142
- formatSource(x,0, 2, tableSearchForm);
143
- formatSource(x,1, 3, tableSearchForm);
144
- formatSource(x,2, 4, tableSearchForm);
145
- })
146
- modalTableProps = {
147
- modalTableTitle: '选择供应商',
148
- tableSearchForm,
149
- tableColumns: [
150
- {
151
- title: '供应商编码',
152
- dataIndex: 'code',
153
- },
154
- {
155
- title: '供应商名称',
156
- dataIndex: 'name',
157
- },
158
- {
159
- title: '归属集团',
160
- dataIndex: 'conglomerateName',
161
- },
162
- {
163
- title: '归属法人公司',
164
- dataIndex: 'legalCompanyName',
165
- },
166
- {
167
- title: '归属核算主体',
168
- dataIndex: 'accountingName',
169
- },
170
- {
171
- title: '共享类型',
172
- dataIndex: 'sharingType',
173
- render: (text: number) => hasDictSharingType ? getDictionaryTextByValue('UC000013', text) : sharingType.find((i: any) => i.value === text)?.text
174
- },
175
- ],
176
- ...modalTableBusProps,
177
- }
178
- }
179
- if(type === 'supplier2') {
180
- // 版本2
181
- tableSearchForm = [
182
- { name: 'qp-name-like', label: '供应商名称' }, // field: { type: 'input', props: { placeholder: '请输入'}}
183
- { name: 'qp-code-like', label: '供应商编码' },
184
- { name: 'qp-createOrgCode-eq', type: 'select', label: '创建组织', field: {
185
- type: 'select',
186
- props: {
187
- // mode: 'multiple',
188
- notFoundContent: '暂无数据',
189
- allowClear: true,
190
- showSearch: true,
191
- showArrow: true,
192
- // maxTagCount: 1,
193
- optionFilterProp: 'children',
194
- filterOption: (input: string, option: { props: { children: string } }) =>
195
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
196
- },
197
- } },
198
- { name: 'qp-supplierOrgCode-eq', type: 'select', label: '使用组织', field: {
199
- type: 'select',
200
- props: {
201
- // mode: 'multiple',
202
- notFoundContent: '暂无数据',
203
- allowClear: true,
204
- showSearch: true,
205
- showArrow: true,
206
- // maxTagCount: 1,
207
- optionFilterProp: 'children',
208
- filterOption: (input: string, option: { props: { children: string } }) =>
209
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
210
- },
211
- } },
212
- ]
213
- Promise.all([
214
- loadSelectSource(`${prefixUrl.formSelectFix}/org/listNoPage`, {}),
215
- loadSelectSource(`${prefixUrl.formSelectFix}/org/listNoPage`, {}),
216
- ]).then((x: any)=>{
217
- formatSource(x,0, 2, tableSearchForm);
218
- formatSource(x,1, 3, tableSearchForm);
219
- })
220
- modalTableProps = {
221
- modalTableTitle: '选择供应商',
222
- tableSearchForm,
223
- tableColumns: [
224
- {
225
- title: '供应商编码',
226
- dataIndex: 'code',
227
- },
228
- {
229
- title: '供应商名称',
230
- dataIndex: 'name',
231
- },
232
- {
233
- title: '创建组织',
234
- dataIndex: 'createOrgName',
235
- },
236
- {
237
- title: '使用组织',
238
- dataIndex: 'salesOrgName',
239
- },
240
- ],
241
- ...modalTableBusProps
242
- }
243
- }
244
-
245
- // 商品选择器sku
246
- if(type === 'skuCommodity') {
247
- requestConfig = {
248
- url: `${prefixUrl.selectPrefix}/sku/pager/v2`,
249
- filter: 'skuCodeAndSkuName', // 过滤参数
250
- mappingTextField: 'name',
251
- mappingValueField: 'skuCode',
252
- mappingTextShowTextField: ['name', 'propertyNameAndValue'],
253
- otherParams: {
254
- 'qp-combination-eq': false,
255
- 'qp-approveStatus-eq': 1,
256
- 'qp-status-eq': 1,
257
- // 'qp-type-eq': 10, // 查唯一国际条码【有些项目不需要必须要有国际条码,故注释,需要的项目自己定义otherParams补充上这个条件】
258
- sorter: 'desc-id'
259
- }, // 默认参数
260
- sourceName: 'skuCode',
261
- ...requestConfigProp,
262
- }
263
- tableSearchForm = requestConfig.url.includes('v2') ? [
264
- requestConfig.url.includes('v2') ? { name: 'qp-skuName-like', label: 'SKU名称' } : { name: 'qp-name-like', label: 'SKU名称' },
265
- { name: 'qp-skuCode-in', label: 'SKU编码', field: {
266
- type: 'multipleQueryInput',
267
- props: {
268
- ...(requestConfigProp?.skuCodeValueRequestConfig || {}),
269
- },
270
- }},
271
- requestConfig.url.includes('v2') ? { name: 'qp-code-like', label: '国际条码' } : { name: 'qp-barCode-like', label: '国际条码'},
272
- { name: 'qp-itemName-like', label: '所属SPU名称' },
273
- { name: 'qp-itemCode-like', label: '所属SPU编码' },
274
- requestConfig.url.includes('v2') ?{ name: 'qp-externalCode-like', label: '外部编码' } : null,
275
- requestConfig.url.includes('v2') ? { name: 'qp-propertyValueCode-in', type: 'businessSearchSelect', label: '规格', field: {
276
- type: 'businessSearchSelect',
277
- props: {
278
- selectBusinessType: 'skuPropertyValue',
279
- selectProps: {
280
- mode: 'multiple',
281
- maxTagCount: 1,
282
- },
283
- ...(requestConfigProp?.skuPropertyValueRequestConfig || { prefixUrl }), // 可自定义此处规格请求接口相关参数,默认前缀取自sku选择器
284
- },
285
- }
286
- } : null,
287
- { name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
288
- type: 'select',
289
- props: {
290
- mode: 'multiple',
291
- notFoundContent: '暂无数据',
292
- allowClear: true,
293
- showSearch: true,
294
- showArrow: true,
295
- maxTagCount: 1,
296
- optionFilterProp: 'children',
297
- filterOption: (input: string, option: { props: { children: string } }) =>
298
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
299
- },
300
- } },
301
- { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
302
- type: 'treeSelect',
303
- props: {
304
- treeData: [],
305
- treeCheckable: true,
306
- showSearch: true,
307
- allowClear: true,
308
- showArrow: true,
309
- treeNodeFilterProp: 'title',
310
- treeDefaultExpandAll: true,
311
- maxTagCount: 1,
312
- placeholder: '请选择',
313
- style: {
314
- width: '100%',
315
- },
316
- dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
317
- },
318
- } },
319
- { name: 'qp-classId-in', type: 'select', label: '品类', field: {
320
- type: 'select',
321
- props: {
322
- mode: 'multiple',
323
- notFoundContent: '暂无数据',
324
- allowClear: true,
325
- showSearch: true,
326
- showArrow: true,
327
- maxTagCount: 1,
328
- optionFilterProp: 'children',
329
- filterOption: (input: string, option: { props: { children: string } }) =>
330
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
331
- },
332
- } },
333
- ] : [
334
- { name: 'qp-name-like', label: 'SKU名称' },
335
- { name: 'qp-skuCode-in', label: 'SKU编码', field: {
336
- type: 'multipleQueryInput',
337
- props: {
338
- ...(requestConfigProp?.skuCodeValueRequestConfig || {}),
339
- },
340
- }},
341
- { name: 'qp-barCode-like', label: '国际条码'},
342
- { name: 'qp-itemName-like', label: '所属SPU名称' },
343
- { name: 'qp-itemCode-like', label: '所属SPU编码' },
344
- { name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
345
- type: 'select',
346
- props: {
347
- mode: 'multiple',
348
- notFoundContent: '暂无数据',
349
- allowClear: true,
350
- showSearch: true,
351
- showArrow: true,
352
- maxTagCount: 1,
353
- optionFilterProp: 'children',
354
- filterOption: (input: string, option: { props: { children: string } }) =>
355
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
356
- },
357
- } },
358
- { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
359
- type: 'treeSelect',
360
- props: {
361
- treeData: [],
362
- treeCheckable: true,
363
- showSearch: true,
364
- allowClear: true,
365
- showArrow: true,
366
- treeNodeFilterProp: 'title',
367
- treeDefaultExpandAll: true,
368
- maxTagCount: 1,
369
- placeholder: '请选择',
370
- style: {
371
- width: '100%',
372
- },
373
- dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
374
- },
375
- } },
376
- { name: 'qp-classId-in', type: 'select', label: '品类', field: {
377
- type: 'select',
378
- props: {
379
- mode: 'multiple',
380
- notFoundContent: '暂无数据',
381
- allowClear: true,
382
- showSearch: true,
383
- showArrow: true,
384
- maxTagCount: 1,
385
- optionFilterProp: 'children',
386
- filterOption: (input: string, option: { props: { children: string } }) =>
387
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
388
- },
389
- } },
390
- ]
391
- Promise.all([
392
- loadSelectSource(`${prefixUrl.formSelectFix}/brand/queryBrandList`, {
393
- pageSize: 5000,
394
- currentPage: 1,
395
- 'ctl-withAuth': true
396
- }),
397
- loadSelectSource(`${prefixUrl.formSelectFix}/category/queryCategoryTree`, {
398
- pageSize: 5000,
399
- currentPage: 1,
400
- }),
401
- loadSelectSource(`${prefixUrl.formSelectFix}/class/withProperty`, {
402
- pageSize: 5000,
403
- currentPage: 1,
404
- }),
405
- ]).then((x: any)=>{
406
- requestConfig.url.includes('v2') ? formatSource(x,0, 7, tableSearchForm,['id','name']) : formatSource(x,0, 5, tableSearchForm,['id','name'])
407
- requestConfig.url.includes('v2') ? formatTreeDataSource(x,1, 8, tableSearchForm) : formatTreeDataSource(x,1, 6, tableSearchForm)
408
- requestConfig.url.includes('v2') ? formatSource(x,2, 9, tableSearchForm,['id','name']) : formatSource(x,2, 7, tableSearchForm,['id','name'])
409
- })
410
- modalTableProps = {
411
- modalTableTitle: '选择SKU',
412
- tableSearchForm,
413
- tableColumns: requestConfig.url.includes('v2') ? [
414
- {
415
- title: 'SKU编码',
416
- dataIndex: 'skuCode',
417
- },
418
- {
419
- title: 'SKU名称',
420
- dataIndex: 'name',
421
- },
422
- {
423
- title: '图片',
424
- dataIndex: 'itemUrl',
425
- render: (text: any,record: any) => tableColumnsImage(getSkuImg(record), { width: 28, height: 28 }),
426
- },
427
- {
428
- title: '国际条码',
429
- dataIndex: 'barCode',
430
- },
431
- {
432
- title: '所属SPU名称',
433
- dataIndex: 'itemName',
434
- },
435
- {
436
- title: '所属SPU编码',
437
- dataIndex: 'itemCode',
438
- },
439
- requestConfig.url.includes('v2') ? {
440
- title: '外部编码',
441
- dataIndex: 'externalCode',
442
- } : false,
443
- {
444
- title: '规格',
445
- dataIndex: requestConfig.url.includes('v2') ? 'propertyNameAndValue' : 'skuSpec',
446
- },
447
- {
448
- title: '类目',
449
- dataIndex: 'categoryName',
450
- },
451
- {
452
- title: '品类',
453
- dataIndex: 'className',
454
- },
455
- {
456
- title: '品牌',
457
- dataIndex: 'brandName',
458
- },
459
- ] : [
460
- {
461
- title: 'SKU编码',
462
- dataIndex: 'skuCode',
463
- },
464
- {
465
- title: 'SKU名称',
466
- dataIndex: 'name',
467
- },
468
- {
469
- title: '国际条码',
470
- dataIndex: 'barCode',
471
- },
472
- {
473
- title: '所属SPU名称',
474
- dataIndex: 'itemName',
475
- },
476
- {
477
- title: '所属SPU编码',
478
- dataIndex: 'itemCode',
479
- },
480
- {
481
- title: '规格',
482
- dataIndex: 'skuSpec',
483
- },
484
- {
485
- title: '类目',
486
- dataIndex: 'categoryName',
487
- },
488
- {
489
- title: '品类',
490
- dataIndex: 'className',
491
- },
492
- {
493
- title: '品牌',
494
- dataIndex: 'brandName',
495
- },
496
- ],
497
- ...modalTableBusProps
498
- }
499
- }
500
-
501
- // 商品选择器spu
502
- if(type === 'spuCommodity') {
503
- requestConfig = {
504
- url: `${prefixUrl.selectPrefix}/item`,
505
- filter: 'qp-itemCode,name-orGroup,like', // 过滤参数
506
- mappingTextField: 'name',
507
- mappingValueField: 'itemCode',
508
- otherParams: {
509
- 'qp-approveStatus-eq': 1, // 审核状态(0.待审批;1.审批通过;2.驳回;3.审批未通过)
510
- sorter: 'desc-id'
511
- }, // 默认参数
512
- sourceName: 'itemCode',
513
- ...requestConfigProp,
514
- }
515
- tableSearchForm = [
516
- { name: 'qp-name-like', label: 'SPU名称' },
517
- { name: 'qp-itemCode-like', label: 'SPU编码' },
518
- { name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
519
- type: 'select',
520
- props: {
521
- mode: 'multiple',
522
- notFoundContent: '暂无数据',
523
- allowClear: true,
524
- showSearch: true,
525
- showArrow: true,
526
- maxTagCount: 1,
527
- optionFilterProp: 'children',
528
- filterOption: (input: string, option: { props: { children: string } }) =>
529
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
530
- },
531
- } },
532
- { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
533
- type: 'treeSelect',
534
- props: {
535
- treeData: [],
536
- treeCheckable: true,
537
- showSearch: true,
538
- allowClear: true,
539
- showArrow: true,
540
- treeNodeFilterProp: 'title',
541
- treeDefaultExpandAll: true,
542
- maxTagCount: 1,
543
- placeholder: '请选择',
544
- style: {
545
- width: '100%',
546
- },
547
- dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
548
- },
549
- } },
550
- { name: 'qp-classId-in', type: 'select', label: '品类', field: {
551
- type: 'select',
552
- props: {
553
- mode: 'multiple',
554
- notFoundContent: '暂无数据',
555
- allowClear: true,
556
- showSearch: true,
557
- showArrow: true,
558
- maxTagCount: 1,
559
- optionFilterProp: 'children',
560
- filterOption: (input: string, option: { props: { children: string } }) =>
561
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
562
- },
563
- } },
564
- ]
565
- Promise.all([
566
- loadSelectSource(`${prefixUrl.formSelectFix}/brand/queryBrandList`, {
567
- pageSize: 5000,
568
- currentPage: 1,
569
- 'ctl-withAuth': true
570
- }),
571
- loadSelectSource(`${prefixUrl.formSelectFix}/category/queryCategoryTree`, {
572
- pageSize: 5000,
573
- currentPage: 1,
574
- }),
575
- loadSelectSource(`${prefixUrl.formSelectFix}/class/withProperty`, {
576
- pageSize: 5000,
577
- currentPage: 1,
578
- }),
579
- ]).then((x: any)=>{
580
- formatSource(x,0, 2, tableSearchForm,['id','name']);
581
- formatTreeDataSource(x,1, 3, tableSearchForm);
582
- formatSource(x,2, 4, tableSearchForm,['id','name']);
583
- })
584
- modalTableProps = {
585
- modalTableTitle: '选择SPU',
586
- tableSearchForm,
587
- tableColumns: [
588
- {
589
- title: 'SPU编码',
590
- dataIndex: 'itemCode',
591
- },
592
- {
593
- title: 'SPU名称',
594
- dataIndex: 'name',
595
- },
596
- {
597
- title: '品牌',
598
- dataIndex: 'brandName',
599
- },
600
- {
601
- title: '类目',
602
- dataIndex: 'categoryText',
603
- },
604
- {
605
- title: '品类',
606
- dataIndex: 'className',
607
- },
608
- ],
609
- ...modalTableBusProps
610
- }
611
- }
612
-
613
- // 商品选择器skc
614
- if(type === 'skcCommodity') {
615
- requestConfig = {
616
- url: `${prefixUrl.selectPrefix}/skc/skcSelect`,
617
- filter: 'qp-code,name-orGroup,like', // 过滤参数
618
- mappingTextField: 'name',
619
- mappingValueField: 'code',
620
- otherParams: {
621
- 'qp-skcStatus-eq': 1, // 状态:0禁用 1启用
622
- }, // 默认参数
623
- sourceName: 'qp-skcCode-eq',
624
- ...requestConfigProp,
625
- }
626
- tableSearchForm = [
627
- { name: 'qp-code-like', label: 'SKC编码' },
628
- { name: 'qp-skcName-like', label: 'SKC名称' },
629
- { name: 'qp-itemName-like', label: '商品名称' },
630
- { name: 'qp-colorName-in', type: 'select', label: '颜色', field: {
631
- type: 'select',
632
- props: {
633
- mode: 'multiple',
634
- notFoundContent: '暂无数据',
635
- allowClear: true,
636
- showSearch: true,
637
- showArrow: true,
638
- maxTagCount: 1,
639
- optionFilterProp: 'children',
640
- filterOption: (input: string, option: { props: { children: string } }) =>
641
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
642
- },
643
- } },
644
- { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
645
- type: 'treeSelect',
646
- props: {
647
- treeData: [],
648
- treeCheckable: true,
649
- showSearch: true,
650
- allowClear: true,
651
- showArrow: true,
652
- treeNodeFilterProp: 'title',
653
- treeDefaultExpandAll: true,
654
- maxTagCount: 1,
655
- placeholder: '请选择',
656
- style: {
657
- width: '100%',
658
- },
659
- dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
660
- },
661
- } },
662
- { name: 'qp-classId-in', type: 'select', label: '品类', field: {
663
- type: 'select',
664
- props: {
665
- mode: 'multiple',
666
- notFoundContent: '暂无数据',
667
- allowClear: true,
668
- showSearch: true,
669
- showArrow: true,
670
- maxTagCount: 1,
671
- optionFilterProp: 'children',
672
- filterOption: (input: string, option: { props: { children: string } }) =>
673
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
674
- },
675
- } },
676
- { name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
677
- type: 'select',
678
- props: {
679
- mode: 'multiple',
680
- notFoundContent: '暂无数据',
681
- allowClear: true,
682
- showSearch: true,
683
- showArrow: true,
684
- maxTagCount: 1,
685
- optionFilterProp: 'children',
686
- filterOption: (input: string, option: { props: { children: string } }) =>
687
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
688
- },
689
- } },
690
- ]
691
- Promise.all([
692
- loadSelectSource(`${prefixUrl.formSelectFix}/item/propertyValue/sizeBySkcConfig`, {
693
- pageSize: 10000,
694
- currentPage: 1,
695
- type: 2, // 类型:1尺码;2颜色
696
- }),
697
- loadSelectSource(`${prefixUrl.formSelectFix}/category/queryCategoryTree`, {
698
- pageSize: 5000,
699
- currentPage: 1,
700
- }),
701
- loadSelectSource(`${prefixUrl.formSelectFix}/class/withProperty`, {
702
- pageSize: 5000,
703
- currentPage: 1,
704
- }),
705
- loadSelectSource(`${prefixUrl.formSelectFix}/brand/queryBrandList`, {
706
- pageSize: 5000,
707
- currentPage: 1,
708
- 'ctl-withAuth': true
709
- }),
710
- ]).then((x: any)=>{
711
- formatSource(x,0, 3, tableSearchForm,['value','value']);
712
- formatTreeDataSource(x,1, 4, tableSearchForm);
713
- formatSource(x,2, 5, tableSearchForm,['id','name']);
714
- formatSource(x,3, 6, tableSearchForm,['id','name']);
715
- })
716
- modalTableProps = {
717
- modalTableTitle: '选择SKC',
718
- tableSearchForm,
719
- tableColumns: [
720
- {
721
- title: 'SKC编码',
722
- dataIndex: 'code',
723
- },
724
- {
725
- title: 'SKC名称',
726
- dataIndex: 'name',
727
- },
728
- {
729
- title: '商品名称',
730
- dataIndex: 'itemName',
731
- },
732
- {
733
- title: '颜色',
734
- dataIndex: 'colorName',
735
- },
736
- {
737
- title: '类目',
738
- dataIndex: 'categoryText',
739
- },
740
- {
741
- title: '品类',
742
- dataIndex: 'className',
743
- },
744
- {
745
- title: '品牌',
746
- dataIndex: 'brandName',
747
- },
748
- ],
749
- ...modalTableBusProps
750
- }
751
- }
752
-
753
- // 商品规格选择器(无弹窗)
754
- if(type === 'skuPropertyValue') {
755
- requestConfig = {
756
- url: `${prefixUrl.selectPrefix}/skuPropertyValue/list`,
757
- filter: 'qp-value-like', // 过滤参数
758
- mappingTextField: 'value',
759
- mappingTextShowKeyField: 'propertyValueCode',
760
- mappingValueField: 'propertyValueCode',
761
- otherParams: {
762
- sorter: 'desc-id'
763
- }, // 默认参数
764
- sourceName: 'qp-propertyValueCode-in',
765
- ...requestConfigProp,
766
- }
767
- needModalTable = false
768
- }
769
-
770
- // 仓库选择器(物理、逻辑仓、运营仓)
771
- if(type === 'physicalWarehouse') {
772
- requestConfig = {
773
- url: `${prefixUrl.selectPrefix}/physicalWarehouse`,
774
- filter: 'qp-physicalWarehouseName,physicalWarehouseCode-orGroup,like', // 过滤参数
775
- mappingTextField: 'physicalWarehouseName',
776
- mappingTextShowKeyField: 'physicalWarehouseCode',
777
- mappingValueField: 'id',
778
- otherParams: {
779
- ...(modalTableBusProps?.needStatusSearch?{}:{'qp-isEnable-eq': 1}),
780
- sorter: 'desc-id'
781
- }, // 默认参数
782
- sourceName: 'warehouseIds',
783
- ...requestConfigProp,
784
- }
785
- tableSearchForm = [
786
- { name: 'qp-physicalWarehouseName-like', label: '物理仓名称' },
787
- { name: 'qp-physicalWarehouseCode-like', label: '物理仓编码' },
788
- { name: 'qp-physicalWarehouseType-eq', type: 'select', label: '物理仓类型', initialSource: getDictionarySource('SC00002') },
789
- { name: 'qp-companyCode-eq', type: 'select', label: '所属公司', field: {
790
- type: 'select',
791
- props: {
792
- mode: 'multiple',
793
- notFoundContent: '暂无数据',
794
- allowClear: true,
795
- showSearch: true,
796
- showArrow: true,
797
- maxTagCount: 1,
798
- optionFilterProp: 'children',
799
- filterOption: (input: string, option: { props: { children: string } }) =>
800
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
801
- },
802
- } },
803
- ...(modalTableBusProps?.needStatusSearch?[{ name: 'qp-isEnable-eq', type: 'select', label: '物理仓状态', initialSource: getDictionarySource('SC00001') }]:[])
804
- ]
805
- Promise.all([
806
- loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
807
- pageSize: 5000,
808
- currentPage: 1,
809
- 'qp-companyType-eq': 20,
810
- }),
811
- ]).then((x: any)=>{
812
- formatSource(x,0, 3, tableSearchForm);
813
- })
814
- modalTableProps = {
815
- modalTableTitle: '选择物理仓',
816
- tableSearchForm,
817
- tableColumns: [
818
- {
819
- title: '物理仓编码',
820
- dataIndex: 'physicalWarehouseCode',
821
- },
822
- {
823
- title: '物理仓名称',
824
- dataIndex: 'physicalWarehouseName',
825
- },
826
- {
827
- title: '物理仓类型',
828
- dataIndex: 'physicalWarehouseType',
829
- render: (text: number) => getDictionaryTextByValue('SC00002', text),
830
- },
831
- ...(modalTableBusProps?.needStatusSearch?[{
832
- title: '状态',
833
- dataIndex: 'isEnable',
834
- render: (text: number) => getDictionaryTextByValue('SC00001', text),
835
- }]:[]),
836
- {
837
- title: '所属公司',
838
- dataIndex: 'companyName',
839
- },
840
- ],
841
- ...modalTableBusProps
842
- }
843
- }
844
- if(type === 'realWarehouse') {
845
- requestConfig = {
846
- url: `${prefixUrl.selectPrefix}/realWarehouse`,
847
- filter: 'qp-realWarehouseName,realWarehouseCode-orGroup,like', // 过滤参数
848
- mappingTextField: 'realWarehouseName',
849
- mappingTextShowKeyField: 'realWarehouseCode',
850
- mappingValueField: 'id',
851
- otherParams: {
852
- ...(modalTableBusProps?.needStatusSearch?{}:{'qp-isEnable-eq': 1}),
853
- sorter: 'desc-id'
854
- }, // 默认参数
855
- sourceName: 'warehouseIds',
856
- ...requestConfigProp,
857
- }
858
- tableSearchForm = [
859
- { name: 'qp-realWarehouseName-like', label: '逻辑仓名称' },
860
- { name: 'qp-realWarehouseCode-like', label: '逻辑仓编码' },
861
- { name: 'qp-realWarehouseType-eq', type: 'select', label: '逻辑仓类型', initialSource: getDictionarySource('SC00004') },
862
- ...(modalTableBusProps?.needStatusSearch?[{ name: 'qp-isEnable-eq', type: 'select', label: '逻辑仓状态', initialSource: getDictionarySource('SC00001') }]:[])
863
- ]
864
- modalTableProps = {
865
- modalTableTitle: '选择逻辑仓',
866
- tableSearchForm,
867
- tableColumns: [
868
- {
869
- title: '逻辑仓编码',
870
- dataIndex: 'realWarehouseCode',
871
- },
872
- {
873
- title: '逻辑仓名称',
874
- dataIndex: 'realWarehouseName',
875
- },
876
- {
877
- title: '逻辑仓类型',
878
- dataIndex: 'realWarehouseType',
879
- render: (text: number) => getDictionaryTextByValue('SC00004', text),
880
- },
881
- ...(modalTableBusProps?.needStatusSearch?[{
882
- title: '状态',
883
- dataIndex: 'isEnable',
884
- render: (text: number) => getDictionaryTextByValue('SC00001', text),
885
- }]:[]),
886
- ],
887
- ...modalTableBusProps,
888
- }
889
- }
890
- if(type === 'ownerWarehouse') {
891
- requestConfig = {
892
- url: `${prefixUrl.selectPrefix}/ownerWarehouse`,
893
- filter: 'qp-name,operationWarehouseCode-orGroup,like', // 过滤参数
894
- mappingTextField: 'name',
895
- mappingTextShowKeyField: 'operationWarehouseCode',
896
- mappingValueField: 'operationWarehouseCode',
897
- otherParams: {
898
- ...(modalTableBusProps?.needStatusSearch?{}:{'qp-status-eq': 1}),
899
- sorter: 'desc-id'
900
- }, // 默认参数
901
- sourceName: 'qp-operationWarehouseCode-in',
902
- ...requestConfigProp,
903
- }
904
- tableSearchForm = [
905
- { name: 'qp-name-like', label: '运营仓名称' },
906
- { name: 'qp-operationWarehouseCode-like', label: '运营仓编码' },
907
- { name: 'qp-groupCode-in', type: 'select', label: '运营组', field: {
908
- type: 'select',
909
- props: {
910
- mode: 'multiple',
911
- notFoundContent: '暂无数据',
912
- allowClear: true,
913
- showSearch: true,
914
- showArrow: true,
915
- maxTagCount: 1,
916
- optionFilterProp: 'children',
917
- filterOption: (input: string, option: { props: { children: string } }) =>
918
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
919
- },
920
- } },
921
- ...(modalTableBusProps?.needStatusSearch?[{ name: 'qp-status-eq', type: 'select', label: '运营仓状态', initialSource: getDictionarySource('SC00001') }]:[])
922
- ]
923
- Promise.all([
924
- loadSelectSource(`${prefixUrl.formSelectFix}/groupInfo/listNoPage`, { 'qp-status-eq': 1 }),
925
- ]).then((x: any)=>{
926
- formatSource(x,0, 2, tableSearchForm,['groupCode','groupName']);
927
- })
928
- modalTableProps = {
929
- modalTableTitle: '选择运营仓',
930
- tableSearchForm,
931
- tableColumns: [
932
- {
933
- title: '运营仓编码',
934
- dataIndex: 'operationWarehouseCode',
935
- },
936
- {
937
- title: '运营仓名称',
938
- dataIndex: 'name',
939
- },
940
- {
941
- title: '运营组',
942
- dataIndex: 'groupName',
943
- },
944
- ...(modalTableBusProps?.needStatusSearch?[{
945
- title: '状态',
946
- dataIndex: 'status',
947
- render: (text: number) => getDictionaryTextByValue('SC00001', text),
948
- }]:[]),
949
- ],
950
- ...modalTableBusProps,
951
- }
952
- }
953
-
954
- // 仓库选择器(虚拟、渠道仓)(无弹窗)
955
- if(type === 'virtualWarehouse') {
956
- requestConfig = {
957
- url: `${prefixUrl.selectPrefix}/virtualWarehouse`,
958
- filter: 'qp-virtualWarehouseName,virtualWarehouseCode-orGroup,like', // 过滤参数
959
- mappingTextField: 'virtualWarehouseName',
960
- mappingTextShowKeyField: 'virtualWarehouseCode',
961
- mappingValueField: 'id',
962
- otherParams: {
963
- 'qp-isEnable-eq': 1,
964
- sorter: 'desc-id'
965
- }, // 默认参数
966
- sourceName: 'warehouseIds',
967
- ...requestConfigProp,
968
- }
969
- needModalTable = false
970
- }
971
- if(type === 'channelWarehouse') {
972
- requestConfig = {
973
- url: `${prefixUrl.selectPrefix}/channelWarehouse`,
974
- filter: 'qp-channelWarehouseName,channelWarehouseCode-orGroup,like', // 过滤参数
975
- mappingTextField: 'channelWarehouseName',
976
- mappingTextShowKeyField: 'channelWarehouseCode',
977
- mappingValueField: 'id',
978
- otherParams: {
979
- 'qp-isEnable-eq': 1,
980
- sorter: 'desc-id'
981
- }, // 默认参数
982
- sourceName: 'warehouseIds',
983
- ...requestConfigProp,
984
- }
985
- needModalTable = false
986
- }
987
-
988
- // 客户选择器
989
- if(type === 'customer') {
990
- requestConfig = {
991
- url: `${prefixUrl.selectPrefix}/uc/customer/v2`,
992
- filter: 'qp-name,code-orGroup,like', // 过滤参数
993
- mappingTextField: 'name',
994
- mappingValueField: 'code',
995
- otherParams: {
996
- 'qp-status-eq': 10,
997
- sorter: 'desc-id'
998
- }, // 默认参数
999
- sourceName: 'customCode',
1000
- ...requestConfigProp,
1001
- }
1002
- tableSearchForm = [
1003
- { name: 'qp-name-like', label: '客户名称' },
1004
- { name: 'qp-code-like', label: '客户编码' },
1005
- { name: 'qp-conglomerateCode-in', type: 'select', label: '归属集团', field: {
1006
- type: 'select',
1007
- props: {
1008
- mode: 'multiple',
1009
- notFoundContent: '暂无数据',
1010
- allowClear: true,
1011
- showSearch: true,
1012
- showArrow: true,
1013
- maxTagCount: 1,
1014
- optionFilterProp: 'children',
1015
- filterOption: (input: string, option: { props: { children: string } }) =>
1016
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1017
- },
1018
- } },
1019
- { name: 'qp-accountingCode-in', type: 'select', label: '归属核算主体', field: {
1020
- type: 'select',
1021
- props: {
1022
- mode: 'multiple',
1023
- notFoundContent: '暂无数据',
1024
- allowClear: true,
1025
- showSearch: true,
1026
- showArrow: true,
1027
- maxTagCount: 1,
1028
- optionFilterProp: 'children',
1029
- filterOption: (input: string, option: { props: { children: string } }) =>
1030
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1031
- },
1032
- } },
1033
- { name: 'qp-companyCode-in', type: 'select', label: '归属法人公司', field: {
1034
- type: 'select',
1035
- props: {
1036
- mode: 'multiple',
1037
- notFoundContent: '暂无数据',
1038
- allowClear: true,
1039
- showSearch: true,
1040
- showArrow: true,
1041
- maxTagCount: 1,
1042
- optionFilterProp: 'children',
1043
- filterOption: (input: string, option: { props: { children: string } }) =>
1044
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1045
- },
1046
- } },
1047
- { name: 'qp-sharingType-eq', type: 'select', label: '共享类型', initialSource: sharingTypeDataList },
1048
- ]
1049
- Promise.all([
1050
- loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
1051
- pageSize: 5000,
1052
- currentPage: 1,
1053
- 'qp-companyType-eq': '30',
1054
- }),
1055
- loadSelectSource(`${prefixUrl.formSelectFix}/accountingSubject`, {
1056
- pageSize: 5000,
1057
- currentPage: 1,
1058
- }),
1059
- loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
1060
- pageSize: 5000,
1061
- currentPage: 1,
1062
- 'qp-companyType-eq': '20',
1063
- })
1064
- ]).then((x: any)=>{
1065
- formatSource(x,0, 2, tableSearchForm);
1066
- formatSource(x,1, 3, tableSearchForm);
1067
- formatSource(x,2, 4, tableSearchForm);
1068
- })
1069
- modalTableProps = {
1070
- modalTableTitle: '选择客户',
1071
- tableSearchForm,
1072
- tableColumns: [
1073
- {
1074
- title: '客户编码',
1075
- dataIndex: 'code',
1076
- },
1077
- {
1078
- title: '客户名称',
1079
- dataIndex: 'name',
1080
- },
1081
- {
1082
- title: '归属集团',
1083
- dataIndex: 'conglomerateName',
1084
- },
1085
- {
1086
- title: '归属法人公司',
1087
- dataIndex: 'legalCompanyName',
1088
- },
1089
- {
1090
- title: '归属核算主体',
1091
- dataIndex: 'accountingName',
1092
- },
1093
- {
1094
- title: '共享类型',
1095
- dataIndex: 'sharingType',
1096
- render: (text: number) => hasDictSharingType ? getDictionaryTextByValue('UC000013', text) : sharingType.find((i: any) => i.value === text)?.text,
1097
- },
1098
- ],
1099
- ...modalTableBusProps
1100
- }
1101
- }
1102
- if(type === 'customer2') {
1103
- // 版本2
1104
- requestConfig = {
1105
- url: `${prefixUrl.selectPrefix}/customer`,
1106
- filter: 'qp-name,code-orGroup,like', // 过滤参数
1107
- mappingTextField: 'name',
1108
- mappingValueField: 'code',
1109
- otherParams: {
1110
- 'qp-isMain-eq': 1, // 员工权限过滤,若不需要不要加
1111
- 'qp-status-eq': 1, // 1启用 0禁用
1112
- sorter: 'desc-id'
1113
- }, // 默认参数
1114
- sourceName: 'customCode',
1115
- ...requestConfigProp,
1116
- }
1117
- tableSearchForm = [
1118
- { name: 'qp-name-like', label: '客户名称' },
1119
- { name: 'qp-code-like', label: '客户编码' },
1120
- { name: 'qp-createOrgCode-eq', type: 'select', label: '创建组织', field: {
1121
- type: 'select',
1122
- props: {
1123
- // mode: 'multiple',
1124
- notFoundContent: '暂无数据',
1125
- allowClear: true,
1126
- showSearch: true,
1127
- showArrow: true,
1128
- // maxTagCount: 1,
1129
- optionFilterProp: 'children',
1130
- filterOption: (input: string, option: { props: { children: string } }) =>
1131
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1132
- },
1133
- } },
1134
- { name: 'qp-salesOrgCode-eq', type: 'select', label: '使用组织', field: {
1135
- type: 'select',
1136
- props: {
1137
- // mode: 'multiple',
1138
- notFoundContent: '暂无数据',
1139
- allowClear: true,
1140
- showSearch: true,
1141
- showArrow: true,
1142
- // maxTagCount: 1,
1143
- optionFilterProp: 'children',
1144
- filterOption: (input: string, option: { props: { children: string } }) =>
1145
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1146
- },
1147
- } },
1148
- ]
1149
- Promise.all([
1150
- loadSelectSource(`${prefixUrl.formSelectFix}/org/listNoPage`, {}),
1151
- loadSelectSource(`${prefixUrl.formSelectFix}/org/listNoPage`,{}),
1152
- ]).then((x: any)=>{
1153
- formatSource(x,0, 2, tableSearchForm);
1154
- formatSource(x,1, 3, tableSearchForm);
1155
- })
1156
- modalTableProps = {
1157
- modalTableTitle: '选择客户',
1158
- tableSearchForm,
1159
- tableColumns: [
1160
- {
1161
- title: '客户编码',
1162
- dataIndex: 'code',
1163
- },
1164
- {
1165
- title: '客户名称',
1166
- dataIndex: 'name',
1167
- },
1168
- {
1169
- title: '创建组织',
1170
- dataIndex: 'createOrgName',
1171
- },
1172
- {
1173
- title: '使用组织',
1174
- dataIndex: 'salesOrgName',
1175
- },
1176
- ],
1177
- ...modalTableBusProps
1178
- }
1179
- }
1180
-
1181
- // 店铺选择器
1182
- if(type === 'shopFile') {
1183
- requestConfig = {
1184
- url: `${prefixUrl.selectPrefix}/store`,
1185
- filter: 'qp-name,code-orGroup,like', // 过滤参数
1186
- mappingTextField: 'name',
1187
- mappingValueField: 'code',
1188
- otherParams: {
1189
- sorter: 'desc-id'
1190
- }, // 默认参数
1191
- sourceName: 'code',
1192
- ...requestConfigProp,
1193
- }
1194
- tableSearchForm = [
1195
- { name: 'qp-name-like', label: '店铺名称' },
1196
- { name: 'qp-code-like', label: '店铺编码' },
1197
- { name: 'qp-conglomerateCode-in', type: 'select', label: '归属集团', field: {
1198
- type: 'select',
1199
- props: {
1200
- mode: 'multiple',
1201
- notFoundContent: '暂无数据',
1202
- allowClear: true,
1203
- showSearch: true,
1204
- showArrow: true,
1205
- maxTagCount: 1,
1206
- optionFilterProp: 'children',
1207
- filterOption: (input: string, option: { props: { children: string } }) =>
1208
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1209
- },
1210
- } },
1211
- { name: 'qp-companyCode-in', type: 'select', label: '归属法人公司', field: {
1212
- type: 'select',
1213
- props: {
1214
- mode: 'multiple',
1215
- notFoundContent: '暂无数据',
1216
- allowClear: true,
1217
- showSearch: true,
1218
- showArrow: true,
1219
- maxTagCount: 1,
1220
- optionFilterProp: 'children',
1221
- filterOption: (input: string, option: { props: { children: string } }) =>
1222
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1223
- },
1224
- } },
1225
- { name: 'qp-type-in', type: 'select', label: '店铺类型', initialSource: shopFileType },
1226
- { name: 'qp-plateformCode-in', type: 'select', label: '店铺来源', field: {
1227
- type: 'select',
1228
- props: {
1229
- mode: 'multiple',
1230
- notFoundContent: '暂无数据',
1231
- allowClear: true,
1232
- showSearch: true,
1233
- showArrow: true,
1234
- maxTagCount: 1,
1235
- optionFilterProp: 'children',
1236
- filterOption: (input: string, option: { props: { children: string } }) =>
1237
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1238
- },
1239
- } },
1240
- { name: 'qp-accountingCode-in', type: 'select', label: '归属核算主体', field: {
1241
- type: 'select',
1242
- props: {
1243
- mode: 'multiple',
1244
- notFoundContent: '暂无数据',
1245
- allowClear: true,
1246
- showSearch: true,
1247
- showArrow: true,
1248
- maxTagCount: 1,
1249
- optionFilterProp: 'children',
1250
- filterOption: (input: string, option: { props: { children: string } }) =>
1251
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1252
- },
1253
- } },
1254
- ]
1255
- Promise.all([
1256
- loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
1257
- pageSize: 5000,
1258
- currentPage: 1,
1259
- 'qp-companyType-eq': '30',
1260
- }),
1261
- loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
1262
- pageSize: 5000,
1263
- currentPage: 1,
1264
- 'qp-companyType-eq': '20',
1265
- }),
1266
- loadSelectSource(`${prefixUrl.formSelectFix}/platformRecord/getPlatformRecordList`, {
1267
- // pageSize: 5000,
1268
- // currentPage: 1,
1269
- 'qp-status-eq': '1',
1270
- }),
1271
- loadSelectSource(`${prefixUrl.formSelectFix}/accountingSubject`, {
1272
- pageSize: 5000,
1273
- currentPage: 1,
1274
- }),
1275
- ]).then((x: any)=>{
1276
- formatSource(x,0, 2, tableSearchForm);
1277
- formatSource(x,1, 3, tableSearchForm);
1278
- formatSource(x,2, 5, tableSearchForm);
1279
- formatSource(x,3, 6, tableSearchForm);
1280
- })
1281
- modalTableProps = {
1282
- modalTableTitle: '选择店铺',
1283
- tableSearchForm,
1284
- tableColumns: [
1285
- {
1286
- title: '店铺编码',
1287
- dataIndex: 'code',
1288
- },
1289
- {
1290
- title: '店铺名称',
1291
- dataIndex: 'name',
1292
- },
1293
- {
1294
- title: '归属集团',
1295
- dataIndex: 'conglomerateName',
1296
- },
1297
- {
1298
- title: '归属法人公司',
1299
- dataIndex: 'companyName',
1300
- },
1301
- {
1302
- title: '店铺类型',
1303
- dataIndex: 'type',
1304
- render: (text: number) => shopFileType.find((i: any) => i.value === text)?.text,
1305
- },
1306
- {
1307
- title: '店铺来源',
1308
- dataIndex: 'platformName',
1309
- },
1310
- {
1311
- title: '归属核算主体',
1312
- dataIndex: 'accountingName',
1313
- },
1314
- ],
1315
- ...modalTableBusProps
1316
- }
1317
- }
1318
- if(type === 'shopFile2') {
1319
- requestConfig = {
1320
- url: `${prefixUrl.selectPrefix}/store/page`,
1321
- filter: 'qp-name,code-orGroup,like', // 过滤参数
1322
- mappingTextField: 'name',
1323
- mappingValueField: 'code',
1324
- otherParams: {
1325
- sorter: 'desc-id'
1326
- }, // 默认参数
1327
- sourceName: 'code',
1328
- ...requestConfigProp,
1329
- }
1330
- tableSearchForm = [
1331
- { name: 'qp-name-like', label: '商店名称' },
1332
- { name: 'qp-code-like', label: '商店编码' },
1333
- { name: 'qp-type-in', type: 'select', label: '商店类型', initialSource: shopFile2Type },
1334
- { name: 'qp-status-in', type: 'select', label: '商店状态', initialSource: shopFile2Status },
1335
- { name: 'qp-orgCode-in', type: 'select', label: '所属销售组织', field: {
1336
- type: 'select',
1337
- props: {
1338
- mode: 'multiple',
1339
- notFoundContent: '暂无数据',
1340
- allowClear: true,
1341
- showSearch: true,
1342
- showArrow: true,
1343
- maxTagCount: 1,
1344
- optionFilterProp: 'children',
1345
- filterOption: (input: string, option: { props: { children: string } }) =>
1346
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1347
- },
1348
- } },
1349
- ]
1350
- Promise.all([
1351
- loadSelectSource(`${prefixUrl.formSelectFix}/orgView/getTree/sales-organizational-view`, {
1352
- 'qp-employeeCode-eq': getEmployeeCode(),
1353
- 'qp-realOrg-eq': true,
1354
- 'qp-status-eq': 10
1355
- }),
1356
- ]).then((x: any)=>{
1357
- formatSource(x,0, 4, tableSearchForm);
1358
- })
1359
- modalTableProps = {
1360
- modalTableTitle: '选择商店',
1361
- tableSearchForm,
1362
- tableColumns: [
1363
- {
1364
- title: '商店编码',
1365
- dataIndex: 'code',
1366
- },
1367
- {
1368
- title: '商店名称',
1369
- dataIndex: 'name',
1370
- },
1371
- {
1372
- title: '商店类型',
1373
- dataIndex: 'type',
1374
- render: (text: number) => shopFile2Type.find((i: any) => i.value === text)?.text,
1375
- },
1376
- {
1377
- title: '启用状态',
1378
- dataIndex: 'status',
1379
- render: (text: number) => shopFile2Status.find((i: any) => i.value === text)?.text,
1380
- },
1381
- {
1382
- title: '所属销售组织',
1383
- dataIndex: 'orgName',
1384
- },
1385
- ],
1386
- ...modalTableBusProps
1387
- }
1388
- }
1389
-
1390
- // 核算主体选择器(无弹窗)
1391
- if(type === 'accountingSubject') {
1392
- requestConfig = {
1393
- url: `${prefixUrl.selectPrefix}/accountingSubject`,
1394
- filter: 'qp-name,code-orGroup,like', // 过滤参数
1395
- mappingTextField: 'name',
1396
- mappingTextShowKeyField: 'code',
1397
- mappingValueField: 'id',
1398
- otherParams: {
1399
- sorter: 'desc-id'
1400
- }, // 默认参数
1401
- sourceName: 'accountingSubjectCode',
1402
- ...requestConfigProp,
1403
- }
1404
- needModalTable = false
1405
- }
1406
- // 库存组织选择器(无弹窗)
1407
- if(type === 'inventoryOrg') {
1408
- requestConfig = {
1409
- url: `${prefixUrl.selectPrefix}/inventoryOrg`,
1410
- filter: 'qp-name,code-orGroup,like', // 过滤参数
1411
- mappingTextField: 'name',
1412
- mappingTextShowKeyField: 'code',
1413
- mappingValueField: 'id',
1414
- otherParams: {
1415
- sorter: 'desc-id'
1416
- }, // 默认参数
1417
- sourceName: 'inventoryOrgCode',
1418
- ...requestConfigProp,
1419
- }
1420
- needModalTable = false
1421
- }
1422
-
1423
- // 法人公司选择器(无弹窗)
1424
- if(type === 'corporationCompany') {
1425
- requestConfig = {
1426
- url: `${prefixUrl.selectPrefix}/company`,
1427
- filter: 'qp-name,code-orGroup,like', // 过滤参数
1428
- mappingTextField: 'name',
1429
- mappingTextShowKeyField: 'code',
1430
- mappingValueField: 'id',
1431
- otherParams: {
1432
- sorter: 'desc-id'
1433
- }, // 默认参数
1434
- sourceName: 'corporationCompany',
1435
- ...requestConfigProp,
1436
- }
1437
- needModalTable = false
1438
- }
1439
-
1440
- // 员工选择器
1441
- if(type === 'employee') {
1442
- requestConfig = {
1443
- url: `${prefixUrl.selectPrefix}/employee/v2`,
1444
- filter: 'qp-employeeNumber,name-orGroup,like', // 过滤参数
1445
- mappingTextField: 'name',
1446
- mappingTextShowKeyField: 'employeeNumber',
1447
- mappingValueField: 'employeeNumber',
1448
- otherParams: {
1449
- 'qp-enable-eq': 10, // 启用状态 10-启用,20-禁用
1450
- 'qp-employmentType-eq': 20,
1451
- sorter: 'desc-id'
1452
- }, // 默认参数
1453
- sourceName: 'employeeNumber',
1454
- ...requestConfigProp,
1455
- }
1456
- tableSearchForm = [
1457
- { name: 'qp-name-like', label: '员工名称' },
1458
- { name: 'qp-employeeNumber-like', label: '员工编码' },
1459
- { name: 'qp-companyCode-in', type: 'select', label: '所属公司', field: {
1460
- type: 'select',
1461
- props: {
1462
- mode: 'multiple',
1463
- notFoundContent: '暂无数据',
1464
- allowClear: true,
1465
- showSearch: true,
1466
- showArrow: true,
1467
- maxTagCount: 1,
1468
- optionFilterProp: 'children',
1469
- filterOption: (input: string, option: { props: { children: string } }) =>
1470
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1471
- },
1472
- } },
1473
- { name: 'qp-email-like', label: '邮箱' },
1474
- { name: 'qp-officeTelephone-like', label: '手机号' },
1475
- ]
1476
- Promise.all([
1477
- loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
1478
- pageSize: 5000,
1479
- currentPage: 1,
1480
- 'qp-companyType-eq': 20,
1481
- }),
1482
- ]).then((x: any)=>{
1483
- formatSource(x,0, 2, tableSearchForm);
1484
- })
1485
- modalTableProps = {
1486
- modalTableTitle: '选择员工',
1487
- tableSearchForm,
1488
- tableColumns: [
1489
- {
1490
- title: '员工编码',
1491
- dataIndex: 'employeeNumber',
1492
- },
1493
- {
1494
- title: '员工名称',
1495
- dataIndex: 'name',
1496
- },
1497
- {
1498
- title: '所属公司',
1499
- dataIndex: 'companyName',
1500
- },
1501
- {
1502
- title: '邮箱',
1503
- dataIndex: 'email',
1504
- },
1505
- {
1506
- title: '手机号',
1507
- dataIndex: 'officeTelephone',
1508
- },
1509
- ],
1510
- ...modalTableBusProps
1511
- }
1512
- }
1513
- if(type === 'employee2') {
1514
- // 版本2
1515
- requestConfig = {
1516
- url: `${prefixUrl.selectPrefix}/employee/pageList/v2`,
1517
- filter: 'qp-username,name-orGroup,like', // 过滤参数
1518
- mappingTextField: 'name',
1519
- mappingTextShowKeyField: 'username',
1520
- mappingValueField: 'id',
1521
- otherParams: {
1522
- 'qp-enable-eq': 10, // 启用状态 10-启用,20-禁用
1523
- 'qp-orgViewIds-like': 'administrative-organization-view', // 为了兼容 搜素所属组织机构时候需要传此参数
1524
- ...(modalTableBusProps?.needTypeSearch?{}:{'qp-employmentType-eq': 20}), // 10外部员工;20内部员工
1525
- sorter: 'desc-id'
1526
- }, // 默认参数
1527
- sourceName: 'employeeNumber',
1528
- ...requestConfigProp,
1529
- }
1530
- tableSearchForm = [
1531
- { name: 'qp-username-like', label: '账户名称' },
1532
- { name: 'qp-name-like', label: '显示名称' },
1533
- // { name: 'qp-employeeNumber-like', label: '员工编码' },
1534
- { name: 'qp-code-in', type: 'treeSelect', label: '所属组织机构', field: {
1535
- type: 'treeSelect',
1536
- props: {
1537
- multiple: true,
1538
- treeData: [],
1539
- treeCheckable: false,
1540
- showSearch: true,
1541
- allowClear: true,
1542
- showArrow: true,
1543
- treeNodeFilterProp: 'title',
1544
- treeDefaultExpandAll: true,
1545
- maxTagCount: 1,
1546
- placeholder: '请选择',
1547
- style: {
1548
- width: '100%',
1549
- },
1550
- showCheckedStrategy: 'TreeSelect.SHOW_ALL',
1551
- dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
1552
- },
1553
- } },
1554
- ...(modalTableBusProps?.needTypeSearch?[{ name: 'qp-employmentType-eq', type: 'select', label: '员工类型', initialSource: employeeType }]:[]),
1555
- { name: 'qp-email-like', label: '邮箱' },
1556
- { name: 'qp-officeTelephone-like', label: '手机号' },
1557
- ]
1558
- Promise.all([
1559
- loadSelectSource(`${prefixUrl.formSelectFix}/orgViewNode/common/getTreeForOrgViewAndTenant`, { 'orgViewCode': 'administrative-organization-view' }),
1560
- ]).then((x: any)=>{
1561
- formatTreeDataSource(x,0, 2, tableSearchForm,['code', 'name']);
1562
- })
1563
- modalTableProps = {
1564
- modalTableTitle: '添加员工',
1565
- tableSearchForm,
1566
- tableColumns: [
1567
- {
1568
- title: '账户名称',
1569
- dataIndex: 'username',
1570
- },
1571
- {
1572
- title: '显示名称',
1573
- dataIndex: 'name',
1574
- },
1575
- // {
1576
- // title: '员工编码',
1577
- // dataIndex: 'employeeNumber',
1578
- // },
1579
- // {
1580
- // title: '员工名称',
1581
- // dataIndex: 'name',
1582
- // },
1583
- {
1584
- title: '所属组织机构',
1585
- dataIndex: 'administrativeNames',
1586
- render: (text: any) => handleTextOverflow(text),
1587
- },
1588
- ...(modalTableBusProps?.needTypeSearch?[{
1589
- title: '员工类型',
1590
- dataIndex: 'employmentType',
1591
- render: (text: number) => employeeType.find((i: any) => i.value === text)?.text,
1592
- }]:[]),
1593
- {
1594
- title: '邮箱',
1595
- dataIndex: 'email',
1596
- },
1597
- {
1598
- title: '手机号',
1599
- dataIndex: 'officeTelephone',
1600
- },
1601
- ],
1602
- ...modalTableBusProps
1603
- }
1604
- }
1605
-
1606
- // 配送方式选择器
1607
- if(type === 'deliveryMode') {
1608
- const isLogisCompanyCodeSingleSearch = requestConfigProp?.fixedparameter?.some((i: any) => i == 'qp-logisCompanyCode-eq');
1609
- const logisCompanyCodeSingleSearchName = isLogisCompanyCodeSingleSearch ? 'qp-logisCompanyCode-eq' : 'qp-logisCompanyCode-in';
1610
- requestConfig = {
1611
- url: `${prefixUrl.selectPrefix}/deliveryMode`,
1612
- filter: 'qp-name,code-orGroup,like', // 过滤参数
1613
- mappingTextField: 'name',
1614
- mappingTextShowKeyField: 'code',
1615
- mappingValueField: 'code',
1616
- otherParams: {
1617
- sorter: 'desc-id'
1618
- }, // 默认参数
1619
- sourceName: 'deliveryModeCode',
1620
- ...requestConfigProp
1621
- }
1622
- tableSearchForm = [
1623
- { name: 'qp-name-like', label: '配送方式名称' },
1624
- { name: 'qp-code-like', label: '配送方式编码' },
1625
- { name: logisCompanyCodeSingleSearchName, type: 'select', label: '所属物流商', field: {
1626
- type: 'select',
1627
- props: {
1628
- ...(isLogisCompanyCodeSingleSearch ? {} : {
1629
- mode: 'multiple',
1630
- maxTagCount: 1,
1631
- }),
1632
- notFoundContent: '暂无数据',
1633
- allowClear: true,
1634
- showSearch: true,
1635
- showArrow: true,
1636
- optionFilterProp: 'children',
1637
- filterOption: (input: string, option: { props: { children: string } }) =>
1638
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1639
- },
1640
- } },
1641
- { name: 'qp-recordChannnelCode-in', type: 'select', label: '单号获取通道', initialSource: getDictionarySource('BSC00004') },
1642
- { name: 'qp-arrivalPaySupport-in', type: 'select', label: '是否支持到付', initialSource: arrivalPaySupportList },
1643
- { name: 'qp-sheetTemplateCode-in', type: 'select', label: '面单模板', field: {
1644
- type: 'select',
1645
- props: {
1646
- mode: 'multiple',
1647
- notFoundContent: '暂无数据',
1648
- allowClear: true,
1649
- showSearch: true,
1650
- showArrow: true,
1651
- maxTagCount: 1,
1652
- optionFilterProp: 'children',
1653
- filterOption: (input: string, option: { props: { children: string } }) =>
1654
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1655
- },
1656
- } },
1657
- { name: 'qp-remark-like', label: '备注' },
1658
- ]
1659
- Promise.all([
1660
- loadSelectSource(`${prefixUrl.formSelectFix}/logisCompany`, {
1661
- pageSize: 5000,
1662
- currentPage: 1,
1663
- }),
1664
- loadSelectSource(`${prefixUrl.formSelectFix}/printTemplate`, {
1665
- pageSize: 5000,
1666
- currentPage: 1,
1667
- })
1668
- ]).then((x: any)=>{
1669
- formatSource(x,0, 2, tableSearchForm);
1670
- formatSource(x,1, 5, tableSearchForm);
1671
- })
1672
- modalTableProps = {
1673
- modalTableTitle: '选择配送方式',
1674
- tableSearchForm,
1675
- tableColumns: [
1676
- {
1677
- title: '配送方式编码',
1678
- dataIndex: 'code',
1679
- },
1680
- {
1681
- title: '配送方式名称',
1682
- dataIndex: 'name',
1683
- },
1684
- {
1685
- title: '所属物流商',
1686
- dataIndex: 'logisCompanyName',
1687
- },
1688
- {
1689
- dataIndex: 'recordChannnelCode',
1690
- title: '单号获取通道',
1691
- render: (text: any) => getDictionaryTextByValue('BSC00004', text),
1692
- },
1693
- {
1694
- dataIndex: 'arrivalPaySupport',
1695
- title: '是否支持到付',
1696
- render: (text: number) => arrivalPaySupportList.find((i: any) => i.value === text)?.text,
1697
- },
1698
- {
1699
- dataIndex: 'sheetTemplateName',
1700
- title: '面单模板',
1701
- },
1702
- {
1703
- dataIndex: 'remark',
1704
- title: '备注',
1705
- },
1706
- ],
1707
- ...modalTableBusProps
1708
- }
1709
- }
1710
-
1711
- // 规则模板选择器
1712
- if(type === 'ruleTemplate') {
1713
- requestConfig = {
1714
- url: `${prefixUrl.selectPrefix}/ruleTemplate`,
1715
- filter: 'qp-name,code-orGroup,like', // 过滤参数
1716
- mappingTextField: 'name',
1717
- mappingTextShowKeyField: 'code',
1718
- mappingValueField: 'code',
1719
- otherParams: {
1720
- sorter: 'desc-id'
1721
- }, // 默认参数
1722
- sourceName: 'ruleTemplateCode',
1723
- ...requestConfigProp
1724
- }
1725
- tableSearchForm = [
1726
- { name: 'qp-name-like', label: '规则模板名称' },
1727
- { name: 'qp-code-like', label: '规则模板编码' },
1728
- ]
1729
- modalTableProps = {
1730
- modalTableTitle: '选择规则模板',
1731
- tableSearchForm,
1732
- tableColumns: [
1733
- {
1734
- title: '规则模板编码',
1735
- dataIndex: 'code',
1736
- },
1737
- {
1738
- title: '规则模板名称',
1739
- dataIndex: 'name',
1740
- render: (text: any) => handleTextOverflow(text),
1741
- },
1742
- {
1743
- title: '条件对象',
1744
- dataIndex: 'objectName',
1745
- render: (text: any) => handleTextOverflow(text),
1746
- },
1747
- {
1748
- dataIndex: 'extName',
1749
- title: '条件扩展',
1750
- render: (text: any) => handleTextOverflow(text),
1751
- },
1752
- {
1753
- dataIndex: 'actionName',
1754
- title: '执行动作',
1755
- render: (text: any) => handleTextOverflow(text),
1756
- },
1757
- ],
1758
- ...modalTableBusProps
1759
- }
1760
- }
1761
-
1762
- // 角色选择器
1763
- if(type === 'role') {
1764
- requestConfig = {
1765
- url: `${prefixUrl.selectPrefix}/role`,
1766
- filter: 'qp-name,code-orGroup,like', // 过滤参数
1767
- mappingTextField: 'name',
1768
- mappingTextShowKeyField: 'code',
1769
- mappingValueField: 'code',
1770
- otherParams: {
1771
- 'qp-status-eq': 10, // 10启用 20禁用
1772
- sorter: 'desc-id',
1773
- }, // 默认参数
1774
- sourceName: 'roleCode',
1775
- ...requestConfigProp
1776
- }
1777
- tableSearchForm = [
1778
- { name: 'qp-name-like', label: '角色名称' },
1779
- { name: 'qp-code-like', label: '角色编码' },
1780
- { name: 'qp-categoryCode-eq', type: 'select', label: '角色分类', field: {
1781
- type: 'select',
1782
- props: {
1783
- notFoundContent: '暂无数据',
1784
- allowClear: true,
1785
- showSearch: true,
1786
- showArrow: true,
1787
- maxTagCount: 1,
1788
- optionFilterProp: 'children',
1789
- filterOption: (input: string, option: { props: { children: string } }) =>
1790
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1791
- },
1792
- }
1793
- },
1794
- ]
1795
- Promise.all([
1796
- loadSelectSource(`${prefixUrl.formSelectFix}/permissionCategory`, {
1797
- pageSize: 5000,
1798
- currentPage: 1,
1799
- }),
1800
- ]).then((x: any)=>{
1801
- formatSource(x,0, 2, tableSearchForm);
1802
- })
1803
- modalTableProps = {
1804
- modalTableTitle: '选择角色',
1805
- tableSearchForm,
1806
- tableColumns: [
1807
- {
1808
- title: '角色编码',
1809
- dataIndex: 'code',
1810
- },
1811
- {
1812
- title: '角色名称',
1813
- dataIndex: 'name',
1814
- render: (text: any) => handleTextOverflow(text),
1815
- },
1816
- {
1817
- title: '角色分类',
1818
- dataIndex: 'categoryName',
1819
- render: (text: any) => handleTextOverflow(text),
1820
- },
1821
- {
1822
- dataIndex: 'remark',
1823
- title: '角色描述',
1824
- render: (text: any) => handleTextOverflow(text),
1825
- },
1826
- {
1827
- dataIndex: 'applicationName',
1828
- title: '应用',
1829
- render: (text: any) => handleTextOverflow(text),
1830
- },
1831
- ],
1832
- ...modalTableBusProps
1833
- }
1834
- }
1835
-
1836
- // 销售渠道选择器
1837
- if(type === 'market-channel') {
1838
- requestConfig = {
1839
- url: `${prefixUrl.selectPrefix}/channelInfo`,
1840
- filter: 'qp-name,code-orGroup,like', // 过滤参数
1841
- mappingTextField: 'name',
1842
- mappingTextShowKeyField: 'code',
1843
- mappingValueField: 'code',
1844
- otherParams: {
1845
- 'qp-type-eq': 1, //销售渠道类型
1846
- 'qp-isMain-eq': 1,
1847
- 'qp-status-eq': 10, // 10启用 20禁用
1848
- sorter: 'desc-id',
1849
- }, // 默认参数
1850
- sourceName: 'marketChannelCode',
1851
- ...requestConfigProp
1852
- }
1853
- tableSearchForm = [
1854
- { name: 'qp-name-like', label: '销售渠道名称' },
1855
- { name: 'qp-code-like', label: '销售渠道编码' },
1856
- { name: 'qp-salesOrgCode-in', type: 'select', label: '所属销售组织', field: {
1857
- type: 'select',
1858
- props: {
1859
- mode: 'multiple',
1860
- notFoundContent: '暂无数据',
1861
- allowClear: true,
1862
- showSearch: true,
1863
- showArrow: true,
1864
- maxTagCount: 1,
1865
- optionFilterProp: 'children',
1866
- filterOption: (input: string, option: { props: { children: string } }) =>
1867
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1868
- },
1869
- } },
1870
- ]
1871
- Promise.all([
1872
- loadSelectSource(`${prefixUrl.formSelectFix}/orgView/getTree/sales-organizational-view`, {
1873
- 'qp-employeeCode-eq': getEmployeeCode(),
1874
- 'qp-realOrg-eq': true,
1875
- 'qp-status-eq': 10
1876
- }),
1877
- ]).then((x: any)=>{
1878
- formatSource(x, 0, 2, tableSearchForm);
1879
- })
1880
- modalTableProps = {
1881
- modalTableTitle: '选择销售渠道',
1882
- tableSearchForm,
1883
- tableColumns: [
1884
- {
1885
- title: '销售渠道编码',
1886
- dataIndex: 'code',
1887
- },
1888
- {
1889
- title: '销售渠道名称',
1890
- dataIndex: 'name',
1891
- render: (text: any) => handleTextOverflow(text),
1892
- },
1893
- {
1894
- title: '所属销售组织',
1895
- dataIndex: 'salesOrgCodeName',
1896
- render: (text: any) => handleTextOverflow(text),
1897
- },
1898
- ],
1899
- ...modalTableBusProps
1900
- }
1901
- }
1902
-
1903
- //业务组织选择器(可筛选业务职能/组织类型/组织形态)
1904
- if (type === 'business-organization') {
1905
- requestConfig = {
1906
- url: `${prefixUrl.selectPrefix}/orgViewNode/common/pageList`,
1907
- filter: 'qp-name-like', // 过滤参数
1908
- mappingTextField: 'name',
1909
- mappingTextShowKeyField: 'code',
1910
- mappingValueField: 'code',
1911
- otherParams: {
1912
- sorter: 'desc-createTime',
1913
- }, // 默认参数
1914
- sourceName: 'organizationCode',
1915
- ...requestConfigProp
1916
- },
1917
- tableSearchForm = [
1918
- { name: 'qp-name-like', label: '组织名称' },
1919
- { name: 'qp-code-like', label: '组织编码' },
1920
- { name: 'qp-orgViewCode-in', type: 'select', label: '业务职能', field: {
1921
- type: 'select',
1922
- props: {
1923
- mode: 'multiple',
1924
- notFoundContent: '暂无数据',
1925
- allowClear: true,
1926
- showSearch: true,
1927
- showArrow: true,
1928
- maxTagCount: 1,
1929
- optionFilterProp: 'children',
1930
- filterOption: (input: string, option: { props: { children: string } }) =>
1931
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1932
- },
1933
- }
1934
- },
1935
- {
1936
- name: 'qp-orgType-in',
1937
- type: 'select',
1938
- label: '组织类型',
1939
- field: {
1940
- type: 'select',
1941
- props: {
1942
- mode: 'multiple',
1943
- allowClear: true,
1944
- maxTagCount: 1,
1945
- },
1946
- },
1947
- initialSource: orgType
1948
- },
1949
- {
1950
- name: 'qp-nodeType-in',
1951
- type: 'select',
1952
- label: '组织形态',
1953
- field: {
1954
- type: 'select',
1955
- props: {
1956
- mode: 'multiple',
1957
- allowClear: true,
1958
- maxTagCount: 1,
1959
- },
1960
- },
1961
- initialSource: nodeType
1962
- }]
1963
- Promise.all([
1964
- loadSelectSource(`${prefixUrl.formSelectFix}/orgView/getOrgViewListNoPage`, {
1965
- 'qp-status-eq': 10
1966
- }),
1967
- ]).then((x: any)=>{
1968
- formatSource(x, 0, 2, tableSearchForm);
1969
- })
1970
- modalTableProps = {
1971
- modalTableTitle: '选择组织',
1972
- tableSearchForm,
1973
- tableColumns: [
1974
- {
1975
- title: '组织编码',
1976
- dataIndex: 'code',
1977
- },
1978
- {
1979
- title: '组织名称',
1980
- dataIndex: 'name',
1981
- render: (text: any) => handleTextOverflow(text),
1982
- },
1983
- {
1984
- title: '业务职能',
1985
- dataIndex: 'orgViewNameList',
1986
- render: (text: any, record: any) => {
1987
- const { orgViewNameList = [] } = record;
1988
- return orgViewNameList.length ? orgViewNameList.join('/') : '--';
1989
- },
1990
- },
1991
- {
1992
- title: '组织类型',
1993
- dataIndex: 'orgType',
1994
- render: (text: any) => {
1995
- const obj = orgType.find((i: any) => i.value == text);
1996
- return obj ? obj.text : '--';
1997
- }
1998
- },
1999
- {
2000
- title: '组织形态',
2001
- dataIndex: 'nodeType',
2002
- render: (text: any) => {
2003
- const obj = nodeType.find((i: any) => i.value == text);
2004
- return obj ? obj.text : '--';
2005
- }
2006
- },
2007
- ],
2008
- ...modalTableBusProps
2009
- }
2010
- }
2011
-
2012
- // 人员选择器
2013
- if(type === 'person') {
2014
- requestConfig = {
2015
- url: `${prefixUrl.selectPrefix}/person`,
2016
- filter: 'qp-code,name-orGroup,like', // 过滤参数
2017
- mappingTextField: 'name',
2018
- mappingTextShowKeyField: 'code',
2019
- mappingValueField: 'code',
2020
- otherParams: {
2021
- sorter: 'desc-id'
2022
- }, // 默认参数
2023
- sourceName: 'personCode',
2024
- ...requestConfigProp,
2025
- }
2026
- tableSearchForm = [
2027
- { name: 'qp-name-like', label: '姓名' },
2028
- { name: 'qp-code-like', label: '员工工号' },
2029
- { name: 'qp-phone-like', label: '手机号' },
2030
- ]
2031
- modalTableProps = {
2032
- modalTableTitle: '添加人员',
2033
- tableSearchForm,
2034
- tableColumns: [
2035
- {
2036
- title: '姓名',
2037
- dataIndex: 'name',
2038
- },
2039
- {
2040
- title: '员工工号',
2041
- dataIndex: 'code',
2042
- },
2043
- {
2044
- title: '员工类型',
2045
- dataIndex: 'dataSource',
2046
- render: (text: number) => personDataSourceType.find((i: any) => i.value == text)?.text,
2047
- },
2048
- {
2049
- title: '手机号',
2050
- dataIndex: 'phone',
2051
- },
2052
- ],
2053
- ...modalTableBusProps
2054
- }
2055
- }
2056
-
2057
- // 品牌选择器
2058
- if(type === 'brand') {
2059
- requestConfig = {
2060
- url: `${prefixUrl.selectPrefix}/brand/list`,
2061
- filter: 'qp-brandCode,name-orGroup,like', // 过滤参数
2062
- mappingTextField: 'name',
2063
- mappingTextShowKeyField: 'brandCode',
2064
- mappingValueField: 'brandCode',
2065
- otherParams: {
2066
- 'ctl-withAuth': true,
2067
- 'qp-status-in': '1', // 1启用 0禁用
2068
- sorter: 'desc-id'
2069
- }, // 默认参数
2070
- sourceName: 'brandCode',
2071
- ...requestConfigProp,
2072
- }
2073
- tableSearchForm = [
2074
- { name: 'qp-name-like', label: '品牌名称' },
2075
- { name: 'qp-brandCode-like', label: '品牌编码' },
2076
- ]
2077
- modalTableProps = {
2078
- modalTableTitle: '添加品牌',
2079
- tableSearchForm,
2080
- tableColumns: [
2081
- {
2082
- title: '品牌图片',
2083
- dataIndex: 'logoUrl',
2084
- render: (text: any) => (
2085
- <Image.PreviewGroup>
2086
- {(text && Object.prototype.toString.call(JSON.parse(text)) === '[object Array]' &&
2087
- JSON.parse(text || '[]').map((ites: any, index: any) =>
2088
- tableColumnsImage(ites),
2089
- )) ||
2090
- tableColumnsImage(text)}
2091
- </Image.PreviewGroup>
2092
- ),
2093
- },
2094
- {
2095
- title: '品牌编码',
2096
- dataIndex: 'brandCode',
2097
- },
2098
- {
2099
- title: '品牌中文名',
2100
- dataIndex: 'name',
2101
- },
2102
- {
2103
- title: '品牌英文名',
2104
- dataIndex: 'enName',
2105
- },
2106
- {
2107
- title: '品牌首字母',
2108
- dataIndex: 'brandInitial',
2109
- },
2110
- {
2111
- title: '描述',
2112
- dataIndex: 'detail',
2113
- },
2114
- ],
2115
- ...modalTableBusProps
2116
- }
2117
- }
2118
-
2119
- return { modalTableProps, requestConfig, needModalTable };
2120
- }
1
+ // 此文件用于 处理业务组件 所用到的公共方法
2
+ // @ts-nocheck
3
+ import { shopFileType, arrivalPaySupportList, sharingType, shopFile2Type, shopFile2Status, employeeType, orgType, nodeType, personDataSourceType } from './common';
4
+ import { getDictionarySource, getDictionaryTextByValue, loadSelectSource } from './utils';
5
+ import { handleTextOverflow, tableColumnsImage } from '@/components/Business/BsSulaQueryTable/utils';
6
+ import { getSkuImg } from '@/utils/TableUtils';
7
+ import { getEmployeeCode } from '@/utils/LocalstorageUtils';
8
+ import { Image } from 'antd';
9
+
10
+ const hasDictSharingType = getDictionarySource('UC000013')?.length;
11
+ const sharingTypeDataList = hasDictSharingType && getDictionarySource('UC000013') || sharingType
12
+
13
+ export function commonFun (type?: string, prefixUrl: any, requestConfigProp?: any, modalTableBusProps?:any) {
14
+ // 默认type === 'supplier' 供应商选择器
15
+ let requestConfig = {
16
+ url: `${prefixUrl.selectPrefix}/supplier`,
17
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
18
+ otherParams: {
19
+ sorter: 'desc-id'
20
+ }, // 默认参数
21
+ ...requestConfigProp
22
+ }
23
+
24
+ /*
25
+ * 处理 格式化下拉框数据源
26
+ * reData 必传 promise返回响应的数据 格式为[{},{},{},...] Promise.all第一个参数数组有多少个数组长度就是多少,其中每个对象为每次请求的结果数据
27
+ * 每个结果数据格式为{ status: '0', msg: 'success', data: { items: [], total: 1, size: 1, page: 1 }, traceId: 'baba..'}
28
+ * position 必传 为获取Promise.all请求结果的位置
29
+ * changePosition 必传 为搜索表单Form中需要更改数据源的Item项的位置
30
+ * changeSearchForm 必传 为搜索表单Form数据
31
+ * */
32
+ const formatSource = (reData: any, position: number, changePosition: number,changeSearchForm: any,resKeyValue=['code', 'name']) => {
33
+ const data = reData && reData[position]?.data;
34
+ const list = Array.isArray(data) ? data :(data?.items || data?.list || data?.children || []);
35
+ const formatData = list?.length ? list.map((v: any) => ({ text: v[resKeyValue[1]], value: v[resKeyValue[0]] })) : [];
36
+ changeSearchForm[changePosition] = {...changeSearchForm[changePosition], initialSource: formatData}
37
+ }
38
+
39
+ // 格式化树选择器数据源
40
+ const mapSearchTree = (treeDataItem: any, resKeyValue: any, disabledJudge?: any) => {
41
+ const haveChildren = Array.isArray(treeDataItem.children) && treeDataItem.children.length > 0;
42
+ return {
43
+ title: treeDataItem[resKeyValue[1]],
44
+ value: treeDataItem[resKeyValue[0]],
45
+ parentId: treeDataItem.parent,
46
+ data: { ...treeDataItem },
47
+ isLeaf: !haveChildren,
48
+ disabled: disabledJudge!==undefined? disabledJudge : haveChildren,
49
+ children: haveChildren ? treeDataItem.children.map((i: any) => mapSearchTree(i, resKeyValue, disabledJudge)) : [],
50
+ };
51
+ };
52
+ const formatTreeDataSource = (reData: any, position: number, changePosition: number,changeSearchForm: any,resKeyValue=['id', 'name']) => {
53
+ let data = reData && reData[position]?.data;
54
+ let disabledJudge;
55
+ if(Object.keys(data).length) {
56
+ data = [data];
57
+ disabledJudge=false
58
+ }
59
+ const formatData = (data &&
60
+ Array.isArray(data) &&
61
+ data.length &&
62
+ data.map((ites: any) => mapSearchTree(ites, resKeyValue, disabledJudge))) ||
63
+ []
64
+ changeSearchForm[changePosition].field.props.treeData = formatData;
65
+ }
66
+
67
+
68
+ let tableSearchForm: any [] = [];
69
+ let modalTableProps = {
70
+ modalTableTitle: '',
71
+ tableSearchForm,
72
+ tableColumns: [],
73
+ ...modalTableBusProps,
74
+ }
75
+ let needModalTable = modalTableBusProps?.needModalTable !== undefined ? modalTableBusProps?.needModalTable : true;
76
+
77
+ // 供应商选择器
78
+ if(type === 'supplier') {
79
+ tableSearchForm = [
80
+ { name: 'qp-name-like', label: '供应商名称' }, // field: { type: 'input', props: { placeholder: '请输入'}}
81
+ { name: 'qp-code-like', label: '供应商编码' },
82
+ { name: 'qp-conglomerateCode-in', type: 'select', label: '归属集团', field: {
83
+ type: 'select',
84
+ props: {
85
+ mode: 'multiple',
86
+ notFoundContent: '暂无数据',
87
+ allowClear: true,
88
+ showSearch: true,
89
+ showArrow: true,
90
+ maxTagCount: 1,
91
+ optionFilterProp: 'children',
92
+ filterOption: (input: string, option: { props: { children: string } }) =>
93
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
94
+ },
95
+ } },
96
+ { name: 'qp-accountingCode-in', type: 'select', label: '归属核算主体', field: {
97
+ type: 'select',
98
+ props: {
99
+ mode: 'multiple',
100
+ notFoundContent: '暂无数据',
101
+ allowClear: true,
102
+ showSearch: true,
103
+ showArrow: true,
104
+ maxTagCount: 1,
105
+ optionFilterProp: 'children',
106
+ filterOption: (input: string, option: { props: { children: string } }) =>
107
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
108
+ },
109
+ } },
110
+ { name: 'qp-companyCode-in', type: 'select', label: '归属法人公司', field: {
111
+ type: 'select',
112
+ props: {
113
+ mode: 'multiple',
114
+ notFoundContent: '暂无数据',
115
+ allowClear: true,
116
+ showSearch: true,
117
+ showArrow: true,
118
+ maxTagCount: 1,
119
+ optionFilterProp: 'children',
120
+ filterOption: (input: string, option: { props: { children: string } }) =>
121
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
122
+ },
123
+ } },
124
+ { name: 'qp-sharingType-eq', type: 'select', label: '共享类型', initialSource: sharingTypeDataList },
125
+ ]
126
+ Promise.all([
127
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
128
+ pageSize: 5000,
129
+ currentPage: 1,
130
+ 'qp-companyType-eq': '30',
131
+ }),
132
+ loadSelectSource(`${prefixUrl.formSelectFix}/accountingSubject`, {
133
+ pageSize: 5000,
134
+ currentPage: 1,
135
+ }),
136
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
137
+ pageSize: 5000,
138
+ currentPage: 1,
139
+ 'qp-companyType-eq': '20',
140
+ })
141
+ ]).then((x: any)=>{
142
+ formatSource(x,0, 2, tableSearchForm);
143
+ formatSource(x,1, 3, tableSearchForm);
144
+ formatSource(x,2, 4, tableSearchForm);
145
+ })
146
+ modalTableProps = {
147
+ modalTableTitle: '选择供应商',
148
+ tableSearchForm,
149
+ tableColumns: [
150
+ {
151
+ title: '供应商编码',
152
+ dataIndex: 'code',
153
+ },
154
+ {
155
+ title: '供应商名称',
156
+ dataIndex: 'name',
157
+ },
158
+ {
159
+ title: '归属集团',
160
+ dataIndex: 'conglomerateName',
161
+ },
162
+ {
163
+ title: '归属法人公司',
164
+ dataIndex: 'legalCompanyName',
165
+ },
166
+ {
167
+ title: '归属核算主体',
168
+ dataIndex: 'accountingName',
169
+ },
170
+ {
171
+ title: '共享类型',
172
+ dataIndex: 'sharingType',
173
+ render: (text: number) => hasDictSharingType ? getDictionaryTextByValue('UC000013', text) : sharingType.find((i: any) => i.value === text)?.text
174
+ },
175
+ ],
176
+ ...modalTableBusProps,
177
+ }
178
+ }
179
+ if(type === 'supplier2') {
180
+ // 版本2
181
+ tableSearchForm = [
182
+ { name: 'qp-name-like', label: '供应商名称' }, // field: { type: 'input', props: { placeholder: '请输入'}}
183
+ { name: 'qp-code-like', label: '供应商编码' },
184
+ { name: 'qp-createOrgCode-eq', type: 'select', label: '创建组织', field: {
185
+ type: 'select',
186
+ props: {
187
+ // mode: 'multiple',
188
+ notFoundContent: '暂无数据',
189
+ allowClear: true,
190
+ showSearch: true,
191
+ showArrow: true,
192
+ // maxTagCount: 1,
193
+ optionFilterProp: 'children',
194
+ filterOption: (input: string, option: { props: { children: string } }) =>
195
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
196
+ },
197
+ } },
198
+ { name: 'qp-supplierOrgCode-eq', type: 'select', label: '使用组织', field: {
199
+ type: 'select',
200
+ props: {
201
+ // mode: 'multiple',
202
+ notFoundContent: '暂无数据',
203
+ allowClear: true,
204
+ showSearch: true,
205
+ showArrow: true,
206
+ // maxTagCount: 1,
207
+ optionFilterProp: 'children',
208
+ filterOption: (input: string, option: { props: { children: string } }) =>
209
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
210
+ },
211
+ } },
212
+ ]
213
+ Promise.all([
214
+ loadSelectSource(`${prefixUrl.formSelectFix}/org/listNoPage`, {}),
215
+ loadSelectSource(`${prefixUrl.formSelectFix}/org/listNoPage`, {}),
216
+ ]).then((x: any)=>{
217
+ formatSource(x,0, 2, tableSearchForm);
218
+ formatSource(x,1, 3, tableSearchForm);
219
+ })
220
+ modalTableProps = {
221
+ modalTableTitle: '选择供应商',
222
+ tableSearchForm,
223
+ tableColumns: [
224
+ {
225
+ title: '供应商编码',
226
+ dataIndex: 'code',
227
+ },
228
+ {
229
+ title: '供应商名称',
230
+ dataIndex: 'name',
231
+ },
232
+ {
233
+ title: '创建组织',
234
+ dataIndex: 'createOrgName',
235
+ },
236
+ {
237
+ title: '使用组织',
238
+ dataIndex: 'salesOrgName',
239
+ },
240
+ ],
241
+ ...modalTableBusProps
242
+ }
243
+ }
244
+
245
+ // 商品选择器sku
246
+ if(type === 'skuCommodity') {
247
+ requestConfig = {
248
+ url: `${prefixUrl.selectPrefix}/sku/pager/v2`,
249
+ filter: 'skuCodeAndSkuName', // 过滤参数
250
+ mappingTextField: 'name',
251
+ mappingValueField: 'skuCode',
252
+ mappingTextShowTextField: ['name', 'propertyNameAndValue'],
253
+ otherParams: {
254
+ 'qp-combination-eq': false,
255
+ 'qp-approveStatus-eq': 1,
256
+ 'qp-status-eq': 1,
257
+ // 'qp-type-eq': 10, // 查唯一国际条码【有些项目不需要必须要有国际条码,故注释,需要的项目自己定义otherParams补充上这个条件】
258
+ sorter: 'desc-id'
259
+ }, // 默认参数
260
+ sourceName: 'skuCode',
261
+ ...requestConfigProp,
262
+ }
263
+ tableSearchForm = requestConfig.url.includes('v2') ? [
264
+ requestConfig.url.includes('v2') ? { name: 'qp-skuName-like', label: 'SKU名称' } : { name: 'qp-name-like', label: 'SKU名称' },
265
+ { name: 'qp-skuCode-in', label: 'SKU编码', field: {
266
+ type: 'multipleQueryInput',
267
+ props: {
268
+ ...(requestConfigProp?.skuCodeValueRequestConfig || {}),
269
+ },
270
+ }},
271
+ requestConfig.url.includes('v2') ? { name: 'qp-code-like', label: '国际条码' } : { name: 'qp-barCode-like', label: '国际条码'},
272
+ { name: 'qp-itemName-like', label: '所属SPU名称' },
273
+ { name: 'qp-itemCode-like', label: '所属SPU编码' },
274
+ requestConfig.url.includes('v2') ?{ name: 'qp-externalCode-like', label: '外部编码' } : null,
275
+ requestConfig.url.includes('v2') ? { name: 'qp-propertyValueCode-in', type: 'businessSearchSelect', label: '规格', field: {
276
+ type: 'businessSearchSelect',
277
+ props: {
278
+ selectBusinessType: 'skuPropertyValue',
279
+ selectProps: {
280
+ mode: 'multiple',
281
+ maxTagCount: 1,
282
+ },
283
+ ...(requestConfigProp?.skuPropertyValueRequestConfig || { prefixUrl }), // 可自定义此处规格请求接口相关参数,默认前缀取自sku选择器
284
+ },
285
+ }
286
+ } : null,
287
+ { name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
288
+ type: 'select',
289
+ props: {
290
+ mode: 'multiple',
291
+ notFoundContent: '暂无数据',
292
+ allowClear: true,
293
+ showSearch: true,
294
+ showArrow: true,
295
+ maxTagCount: 1,
296
+ optionFilterProp: 'children',
297
+ filterOption: (input: string, option: { props: { children: string } }) =>
298
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
299
+ },
300
+ } },
301
+ { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
302
+ type: 'treeSelect',
303
+ props: {
304
+ treeData: [],
305
+ treeCheckable: true,
306
+ showSearch: true,
307
+ allowClear: true,
308
+ showArrow: true,
309
+ treeNodeFilterProp: 'title',
310
+ treeDefaultExpandAll: true,
311
+ maxTagCount: 1,
312
+ placeholder: '请选择',
313
+ style: {
314
+ width: '100%',
315
+ },
316
+ dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
317
+ },
318
+ } },
319
+ { name: 'qp-classId-in', type: 'select', label: '品类', field: {
320
+ type: 'select',
321
+ props: {
322
+ mode: 'multiple',
323
+ notFoundContent: '暂无数据',
324
+ allowClear: true,
325
+ showSearch: true,
326
+ showArrow: true,
327
+ maxTagCount: 1,
328
+ optionFilterProp: 'children',
329
+ filterOption: (input: string, option: { props: { children: string } }) =>
330
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
331
+ },
332
+ } },
333
+ ] : [
334
+ { name: 'qp-name-like', label: 'SKU名称' },
335
+ { name: 'qp-skuCode-in', label: 'SKU编码', field: {
336
+ type: 'multipleQueryInput',
337
+ props: {
338
+ ...(requestConfigProp?.skuCodeValueRequestConfig || {}),
339
+ },
340
+ }},
341
+ { name: 'qp-barCode-like', label: '国际条码'},
342
+ { name: 'qp-itemName-like', label: '所属SPU名称' },
343
+ { name: 'qp-itemCode-like', label: '所属SPU编码' },
344
+ { name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
345
+ type: 'select',
346
+ props: {
347
+ mode: 'multiple',
348
+ notFoundContent: '暂无数据',
349
+ allowClear: true,
350
+ showSearch: true,
351
+ showArrow: true,
352
+ maxTagCount: 1,
353
+ optionFilterProp: 'children',
354
+ filterOption: (input: string, option: { props: { children: string } }) =>
355
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
356
+ },
357
+ } },
358
+ { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
359
+ type: 'treeSelect',
360
+ props: {
361
+ treeData: [],
362
+ treeCheckable: true,
363
+ showSearch: true,
364
+ allowClear: true,
365
+ showArrow: true,
366
+ treeNodeFilterProp: 'title',
367
+ treeDefaultExpandAll: true,
368
+ maxTagCount: 1,
369
+ placeholder: '请选择',
370
+ style: {
371
+ width: '100%',
372
+ },
373
+ dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
374
+ },
375
+ } },
376
+ { name: 'qp-classId-in', type: 'select', label: '品类', field: {
377
+ type: 'select',
378
+ props: {
379
+ mode: 'multiple',
380
+ notFoundContent: '暂无数据',
381
+ allowClear: true,
382
+ showSearch: true,
383
+ showArrow: true,
384
+ maxTagCount: 1,
385
+ optionFilterProp: 'children',
386
+ filterOption: (input: string, option: { props: { children: string } }) =>
387
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
388
+ },
389
+ } },
390
+ ]
391
+ Promise.all([
392
+ loadSelectSource(`${prefixUrl.formSelectFix}/brand/queryBrandList`, {
393
+ pageSize: 5000,
394
+ currentPage: 1,
395
+ 'ctl-withAuth': true
396
+ }),
397
+ loadSelectSource(`${prefixUrl.formSelectFix}/category/queryCategoryTree`, {
398
+ pageSize: 5000,
399
+ currentPage: 1,
400
+ }),
401
+ loadSelectSource(`${prefixUrl.formSelectFix}/class/withProperty`, {
402
+ pageSize: 5000,
403
+ currentPage: 1,
404
+ }),
405
+ ]).then((x: any)=>{
406
+ requestConfig.url.includes('v2') ? formatSource(x,0, 7, tableSearchForm,['id','name']) : formatSource(x,0, 5, tableSearchForm,['id','name'])
407
+ requestConfig.url.includes('v2') ? formatTreeDataSource(x,1, 8, tableSearchForm) : formatTreeDataSource(x,1, 6, tableSearchForm)
408
+ requestConfig.url.includes('v2') ? formatSource(x,2, 9, tableSearchForm,['id','name']) : formatSource(x,2, 7, tableSearchForm,['id','name'])
409
+ })
410
+ modalTableProps = {
411
+ modalTableTitle: '选择SKU',
412
+ tableSearchForm,
413
+ tableColumns: requestConfig.url.includes('v2') ? [
414
+ {
415
+ title: 'SKU编码',
416
+ dataIndex: 'skuCode',
417
+ },
418
+ {
419
+ title: 'SKU名称',
420
+ dataIndex: 'name',
421
+ },
422
+ {
423
+ title: '图片',
424
+ dataIndex: 'itemUrl',
425
+ render: (text: any,record: any) => tableColumnsImage(getSkuImg(record), { width: 28, height: 28 }),
426
+ },
427
+ {
428
+ title: '国际条码',
429
+ dataIndex: 'barCode',
430
+ },
431
+ {
432
+ title: '所属SPU名称',
433
+ dataIndex: 'itemName',
434
+ },
435
+ {
436
+ title: '所属SPU编码',
437
+ dataIndex: 'itemCode',
438
+ },
439
+ requestConfig.url.includes('v2') ? {
440
+ title: '外部编码',
441
+ dataIndex: 'externalCode',
442
+ } : false,
443
+ {
444
+ title: '规格',
445
+ dataIndex: requestConfig.url.includes('v2') ? 'propertyNameAndValue' : 'skuSpec',
446
+ },
447
+ {
448
+ title: '类目',
449
+ dataIndex: 'categoryName',
450
+ },
451
+ {
452
+ title: '品类',
453
+ dataIndex: 'className',
454
+ },
455
+ {
456
+ title: '品牌',
457
+ dataIndex: 'brandName',
458
+ },
459
+ ] : [
460
+ {
461
+ title: 'SKU编码',
462
+ dataIndex: 'skuCode',
463
+ },
464
+ {
465
+ title: 'SKU名称',
466
+ dataIndex: 'name',
467
+ },
468
+ {
469
+ title: '国际条码',
470
+ dataIndex: 'barCode',
471
+ },
472
+ {
473
+ title: '所属SPU名称',
474
+ dataIndex: 'itemName',
475
+ },
476
+ {
477
+ title: '所属SPU编码',
478
+ dataIndex: 'itemCode',
479
+ },
480
+ {
481
+ title: '规格',
482
+ dataIndex: 'skuSpec',
483
+ },
484
+ {
485
+ title: '类目',
486
+ dataIndex: 'categoryName',
487
+ },
488
+ {
489
+ title: '品类',
490
+ dataIndex: 'className',
491
+ },
492
+ {
493
+ title: '品牌',
494
+ dataIndex: 'brandName',
495
+ },
496
+ ],
497
+ ...modalTableBusProps
498
+ }
499
+ }
500
+
501
+ // 商品选择器spu
502
+ if(type === 'spuCommodity') {
503
+ requestConfig = {
504
+ url: `${prefixUrl.selectPrefix}/item`,
505
+ filter: 'qp-itemCode,name-orGroup,like', // 过滤参数
506
+ mappingTextField: 'name',
507
+ mappingValueField: 'itemCode',
508
+ otherParams: {
509
+ 'qp-approveStatus-eq': 1, // 审核状态(0.待审批;1.审批通过;2.驳回;3.审批未通过)
510
+ sorter: 'desc-id'
511
+ }, // 默认参数
512
+ sourceName: 'itemCode',
513
+ ...requestConfigProp,
514
+ }
515
+ tableSearchForm = [
516
+ { name: 'qp-name-like', label: 'SPU名称' },
517
+ { name: 'qp-itemCode-like', label: 'SPU编码' },
518
+ { name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
519
+ type: 'select',
520
+ props: {
521
+ mode: 'multiple',
522
+ notFoundContent: '暂无数据',
523
+ allowClear: true,
524
+ showSearch: true,
525
+ showArrow: true,
526
+ maxTagCount: 1,
527
+ optionFilterProp: 'children',
528
+ filterOption: (input: string, option: { props: { children: string } }) =>
529
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
530
+ },
531
+ } },
532
+ { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
533
+ type: 'treeSelect',
534
+ props: {
535
+ treeData: [],
536
+ treeCheckable: true,
537
+ showSearch: true,
538
+ allowClear: true,
539
+ showArrow: true,
540
+ treeNodeFilterProp: 'title',
541
+ treeDefaultExpandAll: true,
542
+ maxTagCount: 1,
543
+ placeholder: '请选择',
544
+ style: {
545
+ width: '100%',
546
+ },
547
+ dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
548
+ },
549
+ } },
550
+ { name: 'qp-classId-in', type: 'select', label: '品类', field: {
551
+ type: 'select',
552
+ props: {
553
+ mode: 'multiple',
554
+ notFoundContent: '暂无数据',
555
+ allowClear: true,
556
+ showSearch: true,
557
+ showArrow: true,
558
+ maxTagCount: 1,
559
+ optionFilterProp: 'children',
560
+ filterOption: (input: string, option: { props: { children: string } }) =>
561
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
562
+ },
563
+ } },
564
+ ]
565
+ Promise.all([
566
+ loadSelectSource(`${prefixUrl.formSelectFix}/brand/queryBrandList`, {
567
+ pageSize: 5000,
568
+ currentPage: 1,
569
+ 'ctl-withAuth': true
570
+ }),
571
+ loadSelectSource(`${prefixUrl.formSelectFix}/category/queryCategoryTree`, {
572
+ pageSize: 5000,
573
+ currentPage: 1,
574
+ }),
575
+ loadSelectSource(`${prefixUrl.formSelectFix}/class/withProperty`, {
576
+ pageSize: 5000,
577
+ currentPage: 1,
578
+ }),
579
+ ]).then((x: any)=>{
580
+ formatSource(x,0, 2, tableSearchForm,['id','name']);
581
+ formatTreeDataSource(x,1, 3, tableSearchForm);
582
+ formatSource(x,2, 4, tableSearchForm,['id','name']);
583
+ })
584
+ modalTableProps = {
585
+ modalTableTitle: '选择SPU',
586
+ tableSearchForm,
587
+ tableColumns: [
588
+ {
589
+ title: 'SPU编码',
590
+ dataIndex: 'itemCode',
591
+ },
592
+ {
593
+ title: 'SPU名称',
594
+ dataIndex: 'name',
595
+ },
596
+ {
597
+ title: '品牌',
598
+ dataIndex: 'brandName',
599
+ },
600
+ {
601
+ title: '类目',
602
+ dataIndex: 'categoryText',
603
+ },
604
+ {
605
+ title: '品类',
606
+ dataIndex: 'className',
607
+ },
608
+ ],
609
+ ...modalTableBusProps
610
+ }
611
+ }
612
+
613
+ // 商品选择器skc
614
+ if(type === 'skcCommodity') {
615
+ requestConfig = {
616
+ url: `${prefixUrl.selectPrefix}/skc/skcSelect`,
617
+ filter: 'qp-code,name-orGroup,like', // 过滤参数
618
+ mappingTextField: 'name',
619
+ mappingValueField: 'code',
620
+ otherParams: {
621
+ 'qp-skcStatus-eq': 1, // 状态:0禁用 1启用
622
+ }, // 默认参数
623
+ sourceName: 'qp-skcCode-eq',
624
+ ...requestConfigProp,
625
+ }
626
+ tableSearchForm = [
627
+ { name: 'qp-code-like', label: 'SKC编码' },
628
+ { name: 'qp-skcName-like', label: 'SKC名称' },
629
+ { name: 'qp-itemName-like', label: '商品名称' },
630
+ { name: 'qp-colorName-in', type: 'select', label: '颜色', field: {
631
+ type: 'select',
632
+ props: {
633
+ mode: 'multiple',
634
+ notFoundContent: '暂无数据',
635
+ allowClear: true,
636
+ showSearch: true,
637
+ showArrow: true,
638
+ maxTagCount: 1,
639
+ optionFilterProp: 'children',
640
+ filterOption: (input: string, option: { props: { children: string } }) =>
641
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
642
+ },
643
+ } },
644
+ { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
645
+ type: 'treeSelect',
646
+ props: {
647
+ treeData: [],
648
+ treeCheckable: true,
649
+ showSearch: true,
650
+ allowClear: true,
651
+ showArrow: true,
652
+ treeNodeFilterProp: 'title',
653
+ treeDefaultExpandAll: true,
654
+ maxTagCount: 1,
655
+ placeholder: '请选择',
656
+ style: {
657
+ width: '100%',
658
+ },
659
+ dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
660
+ },
661
+ } },
662
+ { name: 'qp-classId-in', type: 'select', label: '品类', field: {
663
+ type: 'select',
664
+ props: {
665
+ mode: 'multiple',
666
+ notFoundContent: '暂无数据',
667
+ allowClear: true,
668
+ showSearch: true,
669
+ showArrow: true,
670
+ maxTagCount: 1,
671
+ optionFilterProp: 'children',
672
+ filterOption: (input: string, option: { props: { children: string } }) =>
673
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
674
+ },
675
+ } },
676
+ { name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
677
+ type: 'select',
678
+ props: {
679
+ mode: 'multiple',
680
+ notFoundContent: '暂无数据',
681
+ allowClear: true,
682
+ showSearch: true,
683
+ showArrow: true,
684
+ maxTagCount: 1,
685
+ optionFilterProp: 'children',
686
+ filterOption: (input: string, option: { props: { children: string } }) =>
687
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
688
+ },
689
+ } },
690
+ ]
691
+ Promise.all([
692
+ loadSelectSource(`${prefixUrl.formSelectFix}/item/propertyValue/sizeBySkcConfig`, {
693
+ pageSize: 10000,
694
+ currentPage: 1,
695
+ type: 2, // 类型:1尺码;2颜色
696
+ }),
697
+ loadSelectSource(`${prefixUrl.formSelectFix}/category/queryCategoryTree`, {
698
+ pageSize: 5000,
699
+ currentPage: 1,
700
+ }),
701
+ loadSelectSource(`${prefixUrl.formSelectFix}/class/withProperty`, {
702
+ pageSize: 5000,
703
+ currentPage: 1,
704
+ }),
705
+ loadSelectSource(`${prefixUrl.formSelectFix}/brand/queryBrandList`, {
706
+ pageSize: 5000,
707
+ currentPage: 1,
708
+ 'ctl-withAuth': true
709
+ }),
710
+ ]).then((x: any)=>{
711
+ formatSource(x,0, 3, tableSearchForm,['value','value']);
712
+ formatTreeDataSource(x,1, 4, tableSearchForm);
713
+ formatSource(x,2, 5, tableSearchForm,['id','name']);
714
+ formatSource(x,3, 6, tableSearchForm,['id','name']);
715
+ })
716
+ modalTableProps = {
717
+ modalTableTitle: '选择SKC',
718
+ tableSearchForm,
719
+ tableColumns: [
720
+ {
721
+ title: 'SKC编码',
722
+ dataIndex: 'code',
723
+ },
724
+ {
725
+ title: 'SKC名称',
726
+ dataIndex: 'name',
727
+ },
728
+ {
729
+ title: '商品名称',
730
+ dataIndex: 'itemName',
731
+ },
732
+ {
733
+ title: '颜色',
734
+ dataIndex: 'colorName',
735
+ },
736
+ {
737
+ title: '类目',
738
+ dataIndex: 'categoryText',
739
+ },
740
+ {
741
+ title: '品类',
742
+ dataIndex: 'className',
743
+ },
744
+ {
745
+ title: '品牌',
746
+ dataIndex: 'brandName',
747
+ },
748
+ ],
749
+ ...modalTableBusProps
750
+ }
751
+ }
752
+
753
+ // 商品规格选择器(无弹窗)
754
+ if(type === 'skuPropertyValue') {
755
+ requestConfig = {
756
+ url: `${prefixUrl.selectPrefix}/skuPropertyValue/list`,
757
+ filter: 'qp-value-like', // 过滤参数
758
+ mappingTextField: 'value',
759
+ mappingTextShowKeyField: 'propertyValueCode',
760
+ mappingValueField: 'propertyValueCode',
761
+ otherParams: {
762
+ sorter: 'desc-id'
763
+ }, // 默认参数
764
+ sourceName: 'qp-propertyValueCode-in',
765
+ ...requestConfigProp,
766
+ }
767
+ needModalTable = false
768
+ }
769
+
770
+ // 仓库选择器(物理、逻辑仓、运营仓)
771
+ if(type === 'physicalWarehouse') {
772
+ requestConfig = {
773
+ url: `${prefixUrl.selectPrefix}/physicalWarehouse`,
774
+ filter: 'qp-physicalWarehouseName,physicalWarehouseCode-orGroup,like', // 过滤参数
775
+ mappingTextField: 'physicalWarehouseName',
776
+ mappingTextShowKeyField: 'physicalWarehouseCode',
777
+ mappingValueField: 'id',
778
+ otherParams: {
779
+ ...(modalTableBusProps?.needStatusSearch?{}:{'qp-isEnable-eq': 1}),
780
+ sorter: 'desc-id'
781
+ }, // 默认参数
782
+ sourceName: 'warehouseIds',
783
+ ...requestConfigProp,
784
+ }
785
+ tableSearchForm = [
786
+ { name: 'qp-physicalWarehouseName-like', label: '物理仓名称' },
787
+ { name: 'qp-physicalWarehouseCode-like', label: '物理仓编码' },
788
+ { name: 'qp-physicalWarehouseType-eq', type: 'select', label: '物理仓类型', initialSource: getDictionarySource('SC00002') },
789
+ { name: 'qp-companyCode-eq', type: 'select', label: '所属公司', field: {
790
+ type: 'select',
791
+ props: {
792
+ mode: 'multiple',
793
+ notFoundContent: '暂无数据',
794
+ allowClear: true,
795
+ showSearch: true,
796
+ showArrow: true,
797
+ maxTagCount: 1,
798
+ optionFilterProp: 'children',
799
+ filterOption: (input: string, option: { props: { children: string } }) =>
800
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
801
+ },
802
+ } },
803
+ ...(modalTableBusProps?.needStatusSearch?[{ name: 'qp-isEnable-eq', type: 'select', label: '物理仓状态', initialSource: getDictionarySource('SC00001') }]:[])
804
+ ]
805
+ Promise.all([
806
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
807
+ pageSize: 5000,
808
+ currentPage: 1,
809
+ 'qp-companyType-eq': 20,
810
+ }),
811
+ ]).then((x: any)=>{
812
+ formatSource(x,0, 3, tableSearchForm);
813
+ })
814
+ modalTableProps = {
815
+ modalTableTitle: '选择物理仓',
816
+ tableSearchForm,
817
+ tableColumns: [
818
+ {
819
+ title: '物理仓编码',
820
+ dataIndex: 'physicalWarehouseCode',
821
+ },
822
+ {
823
+ title: '物理仓名称',
824
+ dataIndex: 'physicalWarehouseName',
825
+ },
826
+ {
827
+ title: '物理仓类型',
828
+ dataIndex: 'physicalWarehouseType',
829
+ render: (text: number) => getDictionaryTextByValue('SC00002', text),
830
+ },
831
+ ...(modalTableBusProps?.needStatusSearch?[{
832
+ title: '状态',
833
+ dataIndex: 'isEnable',
834
+ render: (text: number) => getDictionaryTextByValue('SC00001', text),
835
+ }]:[]),
836
+ {
837
+ title: '所属公司',
838
+ dataIndex: 'companyName',
839
+ },
840
+ ],
841
+ ...modalTableBusProps
842
+ }
843
+ }
844
+ if(type === 'realWarehouse') {
845
+ requestConfig = {
846
+ url: `${prefixUrl.selectPrefix}/realWarehouse`,
847
+ filter: 'qp-realWarehouseName,realWarehouseCode-orGroup,like', // 过滤参数
848
+ mappingTextField: 'realWarehouseName',
849
+ mappingTextShowKeyField: 'realWarehouseCode',
850
+ mappingValueField: 'id',
851
+ otherParams: {
852
+ ...(modalTableBusProps?.needStatusSearch?{}:{'qp-isEnable-eq': 1}),
853
+ sorter: 'desc-id'
854
+ }, // 默认参数
855
+ sourceName: 'warehouseIds',
856
+ ...requestConfigProp,
857
+ }
858
+ tableSearchForm = [
859
+ { name: 'qp-realWarehouseName-like', label: '逻辑仓名称' },
860
+ { name: 'qp-realWarehouseCode-like', label: '逻辑仓编码' },
861
+ { name: 'qp-realWarehouseType-eq', type: 'select', label: '逻辑仓类型', initialSource: getDictionarySource('SC00004') },
862
+ ...(modalTableBusProps?.needStatusSearch?[{ name: 'qp-isEnable-eq', type: 'select', label: '逻辑仓状态', initialSource: getDictionarySource('SC00001') }]:[])
863
+ ]
864
+ modalTableProps = {
865
+ modalTableTitle: '选择逻辑仓',
866
+ tableSearchForm,
867
+ tableColumns: [
868
+ {
869
+ title: '逻辑仓编码',
870
+ dataIndex: 'realWarehouseCode',
871
+ },
872
+ {
873
+ title: '逻辑仓名称',
874
+ dataIndex: 'realWarehouseName',
875
+ },
876
+ {
877
+ title: '逻辑仓类型',
878
+ dataIndex: 'realWarehouseType',
879
+ render: (text: number) => getDictionaryTextByValue('SC00004', text),
880
+ },
881
+ ...(modalTableBusProps?.needStatusSearch?[{
882
+ title: '状态',
883
+ dataIndex: 'isEnable',
884
+ render: (text: number) => getDictionaryTextByValue('SC00001', text),
885
+ }]:[]),
886
+ ],
887
+ ...modalTableBusProps,
888
+ }
889
+ }
890
+ if(type === 'ownerWarehouse') {
891
+ requestConfig = {
892
+ url: `${prefixUrl.selectPrefix}/ownerWarehouse`,
893
+ filter: 'qp-name,operationWarehouseCode-orGroup,like', // 过滤参数
894
+ mappingTextField: 'name',
895
+ mappingTextShowKeyField: 'operationWarehouseCode',
896
+ mappingValueField: 'operationWarehouseCode',
897
+ otherParams: {
898
+ ...(modalTableBusProps?.needStatusSearch?{}:{'qp-status-eq': 1}),
899
+ sorter: 'desc-id'
900
+ }, // 默认参数
901
+ sourceName: 'qp-operationWarehouseCode-in',
902
+ ...requestConfigProp,
903
+ }
904
+ tableSearchForm = [
905
+ { name: 'qp-name-like', label: '运营仓名称' },
906
+ { name: 'qp-operationWarehouseCode-like', label: '运营仓编码' },
907
+ { name: 'qp-groupCode-in', type: 'select', label: '运营组', field: {
908
+ type: 'select',
909
+ props: {
910
+ mode: 'multiple',
911
+ notFoundContent: '暂无数据',
912
+ allowClear: true,
913
+ showSearch: true,
914
+ showArrow: true,
915
+ maxTagCount: 1,
916
+ optionFilterProp: 'children',
917
+ filterOption: (input: string, option: { props: { children: string } }) =>
918
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
919
+ },
920
+ } },
921
+ ...(modalTableBusProps?.needStatusSearch?[{ name: 'qp-status-eq', type: 'select', label: '运营仓状态', initialSource: getDictionarySource('SC00001') }]:[])
922
+ ]
923
+ Promise.all([
924
+ loadSelectSource(`${prefixUrl.formSelectFix}/groupInfo/listNoPage`, { 'qp-status-eq': 1 }),
925
+ ]).then((x: any)=>{
926
+ formatSource(x,0, 2, tableSearchForm,['groupCode','groupName']);
927
+ })
928
+ modalTableProps = {
929
+ modalTableTitle: '选择运营仓',
930
+ tableSearchForm,
931
+ tableColumns: [
932
+ {
933
+ title: '运营仓编码',
934
+ dataIndex: 'operationWarehouseCode',
935
+ },
936
+ {
937
+ title: '运营仓名称',
938
+ dataIndex: 'name',
939
+ },
940
+ {
941
+ title: '运营组',
942
+ dataIndex: 'groupName',
943
+ },
944
+ ...(modalTableBusProps?.needStatusSearch?[{
945
+ title: '状态',
946
+ dataIndex: 'status',
947
+ render: (text: number) => getDictionaryTextByValue('SC00001', text),
948
+ }]:[]),
949
+ ],
950
+ ...modalTableBusProps,
951
+ }
952
+ }
953
+
954
+ // 仓库选择器(虚拟、渠道仓)(无弹窗)
955
+ if(type === 'virtualWarehouse') {
956
+ requestConfig = {
957
+ url: `${prefixUrl.selectPrefix}/virtualWarehouse`,
958
+ filter: 'qp-virtualWarehouseName,virtualWarehouseCode-orGroup,like', // 过滤参数
959
+ mappingTextField: 'virtualWarehouseName',
960
+ mappingTextShowKeyField: 'virtualWarehouseCode',
961
+ mappingValueField: 'id',
962
+ otherParams: {
963
+ 'qp-isEnable-eq': 1,
964
+ sorter: 'desc-id'
965
+ }, // 默认参数
966
+ sourceName: 'warehouseIds',
967
+ ...requestConfigProp,
968
+ }
969
+ needModalTable = false
970
+ }
971
+ if(type === 'channelWarehouse') {
972
+ requestConfig = {
973
+ url: `${prefixUrl.selectPrefix}/channelWarehouse`,
974
+ filter: 'qp-channelWarehouseName,channelWarehouseCode-orGroup,like', // 过滤参数
975
+ mappingTextField: 'channelWarehouseName',
976
+ mappingTextShowKeyField: 'channelWarehouseCode',
977
+ mappingValueField: 'id',
978
+ otherParams: {
979
+ 'qp-isEnable-eq': 1,
980
+ sorter: 'desc-id'
981
+ }, // 默认参数
982
+ sourceName: 'warehouseIds',
983
+ ...requestConfigProp,
984
+ }
985
+ needModalTable = false
986
+ }
987
+
988
+ // 客户选择器
989
+ if(type === 'customer') {
990
+ requestConfig = {
991
+ url: `${prefixUrl.selectPrefix}/uc/customer/v2`,
992
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
993
+ mappingTextField: 'name',
994
+ mappingValueField: 'code',
995
+ otherParams: {
996
+ 'qp-status-eq': 10,
997
+ sorter: 'desc-id'
998
+ }, // 默认参数
999
+ sourceName: 'customCode',
1000
+ ...requestConfigProp,
1001
+ }
1002
+ tableSearchForm = [
1003
+ { name: 'qp-name-like', label: '客户名称' },
1004
+ { name: 'qp-code-like', label: '客户编码' },
1005
+ { name: 'qp-conglomerateCode-in', type: 'select', label: '归属集团', field: {
1006
+ type: 'select',
1007
+ props: {
1008
+ mode: 'multiple',
1009
+ notFoundContent: '暂无数据',
1010
+ allowClear: true,
1011
+ showSearch: true,
1012
+ showArrow: true,
1013
+ maxTagCount: 1,
1014
+ optionFilterProp: 'children',
1015
+ filterOption: (input: string, option: { props: { children: string } }) =>
1016
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1017
+ },
1018
+ } },
1019
+ { name: 'qp-accountingCode-in', type: 'select', label: '归属核算主体', field: {
1020
+ type: 'select',
1021
+ props: {
1022
+ mode: 'multiple',
1023
+ notFoundContent: '暂无数据',
1024
+ allowClear: true,
1025
+ showSearch: true,
1026
+ showArrow: true,
1027
+ maxTagCount: 1,
1028
+ optionFilterProp: 'children',
1029
+ filterOption: (input: string, option: { props: { children: string } }) =>
1030
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1031
+ },
1032
+ } },
1033
+ { name: 'qp-companyCode-in', type: 'select', label: '归属法人公司', field: {
1034
+ type: 'select',
1035
+ props: {
1036
+ mode: 'multiple',
1037
+ notFoundContent: '暂无数据',
1038
+ allowClear: true,
1039
+ showSearch: true,
1040
+ showArrow: true,
1041
+ maxTagCount: 1,
1042
+ optionFilterProp: 'children',
1043
+ filterOption: (input: string, option: { props: { children: string } }) =>
1044
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1045
+ },
1046
+ } },
1047
+ { name: 'qp-sharingType-eq', type: 'select', label: '共享类型', initialSource: sharingTypeDataList },
1048
+ ]
1049
+ Promise.all([
1050
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
1051
+ pageSize: 5000,
1052
+ currentPage: 1,
1053
+ 'qp-companyType-eq': '30',
1054
+ }),
1055
+ loadSelectSource(`${prefixUrl.formSelectFix}/accountingSubject`, {
1056
+ pageSize: 5000,
1057
+ currentPage: 1,
1058
+ }),
1059
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
1060
+ pageSize: 5000,
1061
+ currentPage: 1,
1062
+ 'qp-companyType-eq': '20',
1063
+ })
1064
+ ]).then((x: any)=>{
1065
+ formatSource(x,0, 2, tableSearchForm);
1066
+ formatSource(x,1, 3, tableSearchForm);
1067
+ formatSource(x,2, 4, tableSearchForm);
1068
+ })
1069
+ modalTableProps = {
1070
+ modalTableTitle: '选择客户',
1071
+ tableSearchForm,
1072
+ tableColumns: [
1073
+ {
1074
+ title: '客户编码',
1075
+ dataIndex: 'code',
1076
+ },
1077
+ {
1078
+ title: '客户名称',
1079
+ dataIndex: 'name',
1080
+ },
1081
+ {
1082
+ title: '归属集团',
1083
+ dataIndex: 'conglomerateName',
1084
+ },
1085
+ {
1086
+ title: '归属法人公司',
1087
+ dataIndex: 'legalCompanyName',
1088
+ },
1089
+ {
1090
+ title: '归属核算主体',
1091
+ dataIndex: 'accountingName',
1092
+ },
1093
+ {
1094
+ title: '共享类型',
1095
+ dataIndex: 'sharingType',
1096
+ render: (text: number) => hasDictSharingType ? getDictionaryTextByValue('UC000013', text) : sharingType.find((i: any) => i.value === text)?.text,
1097
+ },
1098
+ ],
1099
+ ...modalTableBusProps
1100
+ }
1101
+ }
1102
+ if(type === 'customer2') {
1103
+ // 版本2
1104
+ requestConfig = {
1105
+ url: `${prefixUrl.selectPrefix}/customer`,
1106
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
1107
+ mappingTextField: 'name',
1108
+ mappingValueField: 'code',
1109
+ otherParams: {
1110
+ 'qp-isMain-eq': 1, // 员工权限过滤,若不需要不要加
1111
+ 'qp-status-eq': 1, // 1启用 0禁用
1112
+ sorter: 'desc-id'
1113
+ }, // 默认参数
1114
+ sourceName: 'customCode',
1115
+ ...requestConfigProp,
1116
+ }
1117
+ tableSearchForm = [
1118
+ { name: 'qp-name-like', label: '客户名称' },
1119
+ { name: 'qp-code-like', label: '客户编码' },
1120
+ { name: 'qp-createOrgCode-eq', type: 'select', label: '创建组织', field: {
1121
+ type: 'select',
1122
+ props: {
1123
+ // mode: 'multiple',
1124
+ notFoundContent: '暂无数据',
1125
+ allowClear: true,
1126
+ showSearch: true,
1127
+ showArrow: true,
1128
+ // maxTagCount: 1,
1129
+ optionFilterProp: 'children',
1130
+ filterOption: (input: string, option: { props: { children: string } }) =>
1131
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1132
+ },
1133
+ } },
1134
+ { name: 'qp-salesOrgCode-eq', type: 'select', label: '使用组织', field: {
1135
+ type: 'select',
1136
+ props: {
1137
+ // mode: 'multiple',
1138
+ notFoundContent: '暂无数据',
1139
+ allowClear: true,
1140
+ showSearch: true,
1141
+ showArrow: true,
1142
+ // maxTagCount: 1,
1143
+ optionFilterProp: 'children',
1144
+ filterOption: (input: string, option: { props: { children: string } }) =>
1145
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1146
+ },
1147
+ } },
1148
+ ]
1149
+ Promise.all([
1150
+ loadSelectSource(`${prefixUrl.formSelectFix}/org/listNoPage`, {}),
1151
+ loadSelectSource(`${prefixUrl.formSelectFix}/org/listNoPage`,{}),
1152
+ ]).then((x: any)=>{
1153
+ formatSource(x,0, 2, tableSearchForm);
1154
+ formatSource(x,1, 3, tableSearchForm);
1155
+ })
1156
+ modalTableProps = {
1157
+ modalTableTitle: '选择客户',
1158
+ tableSearchForm,
1159
+ tableColumns: [
1160
+ {
1161
+ title: '客户编码',
1162
+ dataIndex: 'code',
1163
+ },
1164
+ {
1165
+ title: '客户名称',
1166
+ dataIndex: 'name',
1167
+ },
1168
+ {
1169
+ title: '创建组织',
1170
+ dataIndex: 'createOrgName',
1171
+ },
1172
+ {
1173
+ title: '使用组织',
1174
+ dataIndex: 'salesOrgName',
1175
+ },
1176
+ ],
1177
+ ...modalTableBusProps
1178
+ }
1179
+ }
1180
+
1181
+ // 店铺选择器
1182
+ if(type === 'shopFile') {
1183
+ requestConfig = {
1184
+ url: `${prefixUrl.selectPrefix}/store`,
1185
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
1186
+ mappingTextField: 'name',
1187
+ mappingValueField: 'code',
1188
+ otherParams: {
1189
+ sorter: 'desc-id'
1190
+ }, // 默认参数
1191
+ sourceName: 'code',
1192
+ ...requestConfigProp,
1193
+ }
1194
+ tableSearchForm = [
1195
+ { name: 'qp-name-like', label: '店铺名称' },
1196
+ { name: 'qp-code-like', label: '店铺编码' },
1197
+ { name: 'qp-conglomerateCode-in', type: 'select', label: '归属集团', field: {
1198
+ type: 'select',
1199
+ props: {
1200
+ mode: 'multiple',
1201
+ notFoundContent: '暂无数据',
1202
+ allowClear: true,
1203
+ showSearch: true,
1204
+ showArrow: true,
1205
+ maxTagCount: 1,
1206
+ optionFilterProp: 'children',
1207
+ filterOption: (input: string, option: { props: { children: string } }) =>
1208
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1209
+ },
1210
+ } },
1211
+ { name: 'qp-companyCode-in', type: 'select', label: '归属法人公司', field: {
1212
+ type: 'select',
1213
+ props: {
1214
+ mode: 'multiple',
1215
+ notFoundContent: '暂无数据',
1216
+ allowClear: true,
1217
+ showSearch: true,
1218
+ showArrow: true,
1219
+ maxTagCount: 1,
1220
+ optionFilterProp: 'children',
1221
+ filterOption: (input: string, option: { props: { children: string } }) =>
1222
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1223
+ },
1224
+ } },
1225
+ { name: 'qp-type-in', type: 'select', label: '店铺类型', initialSource: shopFileType },
1226
+ { name: 'qp-plateformCode-in', type: 'select', label: '店铺来源', field: {
1227
+ type: 'select',
1228
+ props: {
1229
+ mode: 'multiple',
1230
+ notFoundContent: '暂无数据',
1231
+ allowClear: true,
1232
+ showSearch: true,
1233
+ showArrow: true,
1234
+ maxTagCount: 1,
1235
+ optionFilterProp: 'children',
1236
+ filterOption: (input: string, option: { props: { children: string } }) =>
1237
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1238
+ },
1239
+ } },
1240
+ { name: 'qp-accountingCode-in', type: 'select', label: '归属核算主体', field: {
1241
+ type: 'select',
1242
+ props: {
1243
+ mode: 'multiple',
1244
+ notFoundContent: '暂无数据',
1245
+ allowClear: true,
1246
+ showSearch: true,
1247
+ showArrow: true,
1248
+ maxTagCount: 1,
1249
+ optionFilterProp: 'children',
1250
+ filterOption: (input: string, option: { props: { children: string } }) =>
1251
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1252
+ },
1253
+ } },
1254
+ ]
1255
+ Promise.all([
1256
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
1257
+ pageSize: 5000,
1258
+ currentPage: 1,
1259
+ 'qp-companyType-eq': '30',
1260
+ }),
1261
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
1262
+ pageSize: 5000,
1263
+ currentPage: 1,
1264
+ 'qp-companyType-eq': '20',
1265
+ }),
1266
+ loadSelectSource(`${prefixUrl.formSelectFix}/platformRecord/getPlatformRecordList`, {
1267
+ // pageSize: 5000,
1268
+ // currentPage: 1,
1269
+ 'qp-status-eq': '1',
1270
+ }),
1271
+ loadSelectSource(`${prefixUrl.formSelectFix}/accountingSubject`, {
1272
+ pageSize: 5000,
1273
+ currentPage: 1,
1274
+ }),
1275
+ ]).then((x: any)=>{
1276
+ formatSource(x,0, 2, tableSearchForm);
1277
+ formatSource(x,1, 3, tableSearchForm);
1278
+ formatSource(x,2, 5, tableSearchForm);
1279
+ formatSource(x,3, 6, tableSearchForm);
1280
+ })
1281
+ modalTableProps = {
1282
+ modalTableTitle: '选择店铺',
1283
+ tableSearchForm,
1284
+ tableColumns: [
1285
+ {
1286
+ title: '店铺编码',
1287
+ dataIndex: 'code',
1288
+ },
1289
+ {
1290
+ title: '店铺名称',
1291
+ dataIndex: 'name',
1292
+ },
1293
+ {
1294
+ title: '归属集团',
1295
+ dataIndex: 'conglomerateName',
1296
+ },
1297
+ {
1298
+ title: '归属法人公司',
1299
+ dataIndex: 'companyName',
1300
+ },
1301
+ {
1302
+ title: '店铺类型',
1303
+ dataIndex: 'type',
1304
+ render: (text: number) => shopFileType.find((i: any) => i.value === text)?.text,
1305
+ },
1306
+ {
1307
+ title: '店铺来源',
1308
+ dataIndex: 'platformName',
1309
+ },
1310
+ {
1311
+ title: '归属核算主体',
1312
+ dataIndex: 'accountingName',
1313
+ },
1314
+ ],
1315
+ ...modalTableBusProps
1316
+ }
1317
+ }
1318
+ if(type === 'shopFile2') {
1319
+ requestConfig = {
1320
+ url: `${prefixUrl.selectPrefix}/store/page`,
1321
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
1322
+ mappingTextField: 'name',
1323
+ mappingValueField: 'code',
1324
+ otherParams: {
1325
+ sorter: 'desc-id'
1326
+ }, // 默认参数
1327
+ sourceName: 'code',
1328
+ ...requestConfigProp,
1329
+ }
1330
+ tableSearchForm = [
1331
+ { name: 'qp-name-like', label: '商店名称' },
1332
+ { name: 'qp-code-like', label: '商店编码' },
1333
+ { name: 'qp-type-in', type: 'select', label: '商店类型', initialSource: shopFile2Type },
1334
+ { name: 'qp-status-in', type: 'select', label: '商店状态', initialSource: shopFile2Status },
1335
+ { name: 'qp-orgCode-in', type: 'select', label: '所属销售组织', field: {
1336
+ type: 'select',
1337
+ props: {
1338
+ mode: 'multiple',
1339
+ notFoundContent: '暂无数据',
1340
+ allowClear: true,
1341
+ showSearch: true,
1342
+ showArrow: true,
1343
+ maxTagCount: 1,
1344
+ optionFilterProp: 'children',
1345
+ filterOption: (input: string, option: { props: { children: string } }) =>
1346
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1347
+ },
1348
+ } },
1349
+ ]
1350
+ Promise.all([
1351
+ loadSelectSource(`${prefixUrl.formSelectFix}/orgView/getTree/sales-organizational-view`, {
1352
+ 'qp-employeeCode-eq': getEmployeeCode(),
1353
+ 'qp-realOrg-eq': true,
1354
+ 'qp-status-eq': 10
1355
+ }),
1356
+ ]).then((x: any)=>{
1357
+ formatSource(x,0, 4, tableSearchForm);
1358
+ })
1359
+ modalTableProps = {
1360
+ modalTableTitle: '选择商店',
1361
+ tableSearchForm,
1362
+ tableColumns: [
1363
+ {
1364
+ title: '商店编码',
1365
+ dataIndex: 'code',
1366
+ },
1367
+ {
1368
+ title: '商店名称',
1369
+ dataIndex: 'name',
1370
+ },
1371
+ {
1372
+ title: '商店类型',
1373
+ dataIndex: 'type',
1374
+ render: (text: number) => shopFile2Type.find((i: any) => i.value === text)?.text,
1375
+ },
1376
+ {
1377
+ title: '启用状态',
1378
+ dataIndex: 'status',
1379
+ render: (text: number) => shopFile2Status.find((i: any) => i.value === text)?.text,
1380
+ },
1381
+ {
1382
+ title: '所属销售组织',
1383
+ dataIndex: 'orgName',
1384
+ },
1385
+ ],
1386
+ ...modalTableBusProps
1387
+ }
1388
+ }
1389
+
1390
+ // 核算主体选择器(无弹窗)
1391
+ if(type === 'accountingSubject') {
1392
+ requestConfig = {
1393
+ url: `${prefixUrl.selectPrefix}/accountingSubject`,
1394
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
1395
+ mappingTextField: 'name',
1396
+ mappingTextShowKeyField: 'code',
1397
+ mappingValueField: 'id',
1398
+ otherParams: {
1399
+ sorter: 'desc-id'
1400
+ }, // 默认参数
1401
+ sourceName: 'accountingSubjectCode',
1402
+ ...requestConfigProp,
1403
+ }
1404
+ needModalTable = false
1405
+ }
1406
+ // 库存组织选择器(无弹窗)
1407
+ if(type === 'inventoryOrg') {
1408
+ requestConfig = {
1409
+ url: `${prefixUrl.selectPrefix}/inventoryOrg`,
1410
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
1411
+ mappingTextField: 'name',
1412
+ mappingTextShowKeyField: 'code',
1413
+ mappingValueField: 'id',
1414
+ otherParams: {
1415
+ sorter: 'desc-id'
1416
+ }, // 默认参数
1417
+ sourceName: 'inventoryOrgCode',
1418
+ ...requestConfigProp,
1419
+ }
1420
+ needModalTable = false
1421
+ }
1422
+
1423
+ // 法人公司选择器(无弹窗)
1424
+ if(type === 'corporationCompany') {
1425
+ requestConfig = {
1426
+ url: `${prefixUrl.selectPrefix}/company`,
1427
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
1428
+ mappingTextField: 'name',
1429
+ mappingTextShowKeyField: 'code',
1430
+ mappingValueField: 'id',
1431
+ otherParams: {
1432
+ sorter: 'desc-id'
1433
+ }, // 默认参数
1434
+ sourceName: 'corporationCompany',
1435
+ ...requestConfigProp,
1436
+ }
1437
+ needModalTable = false
1438
+ }
1439
+
1440
+ // 员工选择器
1441
+ if(type === 'employee') {
1442
+ requestConfig = {
1443
+ url: `${prefixUrl.selectPrefix}/employee/v2`,
1444
+ filter: 'qp-employeeNumber,name-orGroup,like', // 过滤参数
1445
+ mappingTextField: 'name',
1446
+ mappingTextShowKeyField: 'employeeNumber',
1447
+ mappingValueField: 'employeeNumber',
1448
+ otherParams: {
1449
+ 'qp-enable-eq': 10, // 启用状态 10-启用,20-禁用
1450
+ 'qp-employmentType-eq': 20,
1451
+ sorter: 'desc-id'
1452
+ }, // 默认参数
1453
+ sourceName: 'employeeNumber',
1454
+ ...requestConfigProp,
1455
+ }
1456
+ tableSearchForm = [
1457
+ { name: 'qp-name-like', label: '员工名称' },
1458
+ { name: 'qp-employeeNumber-like', label: '员工编码' },
1459
+ { name: 'qp-companyCode-in', type: 'select', label: '所属公司', field: {
1460
+ type: 'select',
1461
+ props: {
1462
+ mode: 'multiple',
1463
+ notFoundContent: '暂无数据',
1464
+ allowClear: true,
1465
+ showSearch: true,
1466
+ showArrow: true,
1467
+ maxTagCount: 1,
1468
+ optionFilterProp: 'children',
1469
+ filterOption: (input: string, option: { props: { children: string } }) =>
1470
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1471
+ },
1472
+ } },
1473
+ { name: 'qp-email-like', label: '邮箱' },
1474
+ { name: 'qp-officeTelephone-like', label: '手机号' },
1475
+ ]
1476
+ Promise.all([
1477
+ loadSelectSource(`${prefixUrl.formSelectFix}/company`, {
1478
+ pageSize: 5000,
1479
+ currentPage: 1,
1480
+ 'qp-companyType-eq': 20,
1481
+ }),
1482
+ ]).then((x: any)=>{
1483
+ formatSource(x,0, 2, tableSearchForm);
1484
+ })
1485
+ modalTableProps = {
1486
+ modalTableTitle: '选择员工',
1487
+ tableSearchForm,
1488
+ tableColumns: [
1489
+ {
1490
+ title: '员工编码',
1491
+ dataIndex: 'employeeNumber',
1492
+ },
1493
+ {
1494
+ title: '员工名称',
1495
+ dataIndex: 'name',
1496
+ },
1497
+ {
1498
+ title: '所属公司',
1499
+ dataIndex: 'companyName',
1500
+ },
1501
+ {
1502
+ title: '邮箱',
1503
+ dataIndex: 'email',
1504
+ },
1505
+ {
1506
+ title: '手机号',
1507
+ dataIndex: 'officeTelephone',
1508
+ },
1509
+ ],
1510
+ ...modalTableBusProps
1511
+ }
1512
+ }
1513
+ if(type === 'employee2') {
1514
+ // 版本2
1515
+ requestConfig = {
1516
+ url: `${prefixUrl.selectPrefix}/employee/pageList/v2`,
1517
+ filter: 'qp-username,name-orGroup,like', // 过滤参数
1518
+ mappingTextField: 'name',
1519
+ mappingTextShowKeyField: 'username',
1520
+ mappingValueField: 'id',
1521
+ otherParams: {
1522
+ 'qp-enable-eq': 10, // 启用状态 10-启用,20-禁用
1523
+ 'qp-orgViewIds-like': 'administrative-organization-view', // 为了兼容 搜素所属组织机构时候需要传此参数
1524
+ ...(modalTableBusProps?.needTypeSearch?{}:{'qp-employmentType-eq': 20}), // 10外部员工;20内部员工
1525
+ sorter: 'desc-id'
1526
+ }, // 默认参数
1527
+ sourceName: 'employeeNumber',
1528
+ ...requestConfigProp,
1529
+ }
1530
+ tableSearchForm = [
1531
+ { name: 'qp-username-like', label: '账户名称' },
1532
+ { name: 'qp-name-like', label: '显示名称' },
1533
+ // { name: 'qp-employeeNumber-like', label: '员工编码' },
1534
+ { name: 'qp-code-in', type: 'treeSelect', label: '所属组织机构', field: {
1535
+ type: 'treeSelect',
1536
+ props: {
1537
+ multiple: true,
1538
+ treeData: [],
1539
+ treeCheckable: false,
1540
+ showSearch: true,
1541
+ allowClear: true,
1542
+ showArrow: true,
1543
+ treeNodeFilterProp: 'title',
1544
+ treeDefaultExpandAll: true,
1545
+ maxTagCount: 1,
1546
+ placeholder: '请选择',
1547
+ style: {
1548
+ width: '100%',
1549
+ },
1550
+ showCheckedStrategy: 'TreeSelect.SHOW_ALL',
1551
+ dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
1552
+ },
1553
+ } },
1554
+ ...(modalTableBusProps?.needTypeSearch?[{ name: 'qp-employmentType-eq', type: 'select', label: '员工类型', initialSource: employeeType }]:[]),
1555
+ { name: 'qp-email-like', label: '邮箱' },
1556
+ { name: 'qp-officeTelephone-like', label: '手机号' },
1557
+ ]
1558
+ Promise.all([
1559
+ loadSelectSource(`${prefixUrl.formSelectFix}/orgViewNode/common/getTreeForOrgViewAndTenant`, { 'orgViewCode': 'administrative-organization-view' }),
1560
+ ]).then((x: any)=>{
1561
+ formatTreeDataSource(x,0, 2, tableSearchForm,['code', 'name']);
1562
+ })
1563
+ modalTableProps = {
1564
+ modalTableTitle: '添加员工',
1565
+ tableSearchForm,
1566
+ tableColumns: [
1567
+ {
1568
+ title: '账户名称',
1569
+ dataIndex: 'username',
1570
+ },
1571
+ {
1572
+ title: '显示名称',
1573
+ dataIndex: 'name',
1574
+ },
1575
+ // {
1576
+ // title: '员工编码',
1577
+ // dataIndex: 'employeeNumber',
1578
+ // },
1579
+ // {
1580
+ // title: '员工名称',
1581
+ // dataIndex: 'name',
1582
+ // },
1583
+ {
1584
+ title: '所属组织机构',
1585
+ dataIndex: 'administrativeNames',
1586
+ render: (text: any) => handleTextOverflow(text),
1587
+ },
1588
+ ...(modalTableBusProps?.needTypeSearch?[{
1589
+ title: '员工类型',
1590
+ dataIndex: 'employmentType',
1591
+ render: (text: number) => employeeType.find((i: any) => i.value === text)?.text,
1592
+ }]:[]),
1593
+ {
1594
+ title: '邮箱',
1595
+ dataIndex: 'email',
1596
+ },
1597
+ {
1598
+ title: '手机号',
1599
+ dataIndex: 'officeTelephone',
1600
+ },
1601
+ ],
1602
+ ...modalTableBusProps
1603
+ }
1604
+ }
1605
+
1606
+ // 配送方式选择器
1607
+ if(type === 'deliveryMode') {
1608
+ const isLogisCompanyCodeSingleSearch = requestConfigProp?.fixedparameter?.some((i: any) => i == 'qp-logisCompanyCode-eq');
1609
+ const logisCompanyCodeSingleSearchName = isLogisCompanyCodeSingleSearch ? 'qp-logisCompanyCode-eq' : 'qp-logisCompanyCode-in';
1610
+ requestConfig = {
1611
+ url: `${prefixUrl.selectPrefix}/deliveryMode`,
1612
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
1613
+ mappingTextField: 'name',
1614
+ mappingTextShowKeyField: 'code',
1615
+ mappingValueField: 'code',
1616
+ otherParams: {
1617
+ sorter: 'desc-id'
1618
+ }, // 默认参数
1619
+ sourceName: 'deliveryModeCode',
1620
+ ...requestConfigProp
1621
+ }
1622
+ tableSearchForm = [
1623
+ { name: 'qp-name-like', label: '配送方式名称' },
1624
+ { name: 'qp-code-like', label: '配送方式编码' },
1625
+ { name: logisCompanyCodeSingleSearchName, type: 'select', label: '所属物流商', field: {
1626
+ type: 'select',
1627
+ props: {
1628
+ ...(isLogisCompanyCodeSingleSearch ? {} : {
1629
+ mode: 'multiple',
1630
+ maxTagCount: 1,
1631
+ }),
1632
+ notFoundContent: '暂无数据',
1633
+ allowClear: true,
1634
+ showSearch: true,
1635
+ showArrow: true,
1636
+ optionFilterProp: 'children',
1637
+ filterOption: (input: string, option: { props: { children: string } }) =>
1638
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1639
+ },
1640
+ } },
1641
+ { name: 'qp-recordChannnelCode-in', type: 'select', label: '单号获取通道', initialSource: getDictionarySource('BSC00004') },
1642
+ { name: 'qp-arrivalPaySupport-in', type: 'select', label: '是否支持到付', initialSource: arrivalPaySupportList },
1643
+ { name: 'qp-sheetTemplateCode-in', type: 'select', label: '面单模板', field: {
1644
+ type: 'select',
1645
+ props: {
1646
+ mode: 'multiple',
1647
+ notFoundContent: '暂无数据',
1648
+ allowClear: true,
1649
+ showSearch: true,
1650
+ showArrow: true,
1651
+ maxTagCount: 1,
1652
+ optionFilterProp: 'children',
1653
+ filterOption: (input: string, option: { props: { children: string } }) =>
1654
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1655
+ },
1656
+ } },
1657
+ { name: 'qp-remark-like', label: '备注' },
1658
+ ]
1659
+ Promise.all([
1660
+ loadSelectSource(`${prefixUrl.formSelectFix}/logisCompany`, {
1661
+ pageSize: 5000,
1662
+ currentPage: 1,
1663
+ }),
1664
+ loadSelectSource(`${prefixUrl.formSelectFix}/printTemplate`, {
1665
+ pageSize: 5000,
1666
+ currentPage: 1,
1667
+ })
1668
+ ]).then((x: any)=>{
1669
+ formatSource(x,0, 2, tableSearchForm);
1670
+ formatSource(x,1, 5, tableSearchForm);
1671
+ })
1672
+ modalTableProps = {
1673
+ modalTableTitle: '选择配送方式',
1674
+ tableSearchForm,
1675
+ tableColumns: [
1676
+ {
1677
+ title: '配送方式编码',
1678
+ dataIndex: 'code',
1679
+ },
1680
+ {
1681
+ title: '配送方式名称',
1682
+ dataIndex: 'name',
1683
+ },
1684
+ {
1685
+ title: '所属物流商',
1686
+ dataIndex: 'logisCompanyName',
1687
+ },
1688
+ {
1689
+ dataIndex: 'recordChannnelCode',
1690
+ title: '单号获取通道',
1691
+ render: (text: any) => getDictionaryTextByValue('BSC00004', text),
1692
+ },
1693
+ {
1694
+ dataIndex: 'arrivalPaySupport',
1695
+ title: '是否支持到付',
1696
+ render: (text: number) => arrivalPaySupportList.find((i: any) => i.value === text)?.text,
1697
+ },
1698
+ {
1699
+ dataIndex: 'sheetTemplateName',
1700
+ title: '面单模板',
1701
+ },
1702
+ {
1703
+ dataIndex: 'remark',
1704
+ title: '备注',
1705
+ },
1706
+ ],
1707
+ ...modalTableBusProps
1708
+ }
1709
+ }
1710
+
1711
+ // 规则模板选择器
1712
+ if(type === 'ruleTemplate') {
1713
+ requestConfig = {
1714
+ url: `${prefixUrl.selectPrefix}/ruleTemplate`,
1715
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
1716
+ mappingTextField: 'name',
1717
+ mappingTextShowKeyField: 'code',
1718
+ mappingValueField: 'code',
1719
+ otherParams: {
1720
+ sorter: 'desc-id'
1721
+ }, // 默认参数
1722
+ sourceName: 'ruleTemplateCode',
1723
+ ...requestConfigProp
1724
+ }
1725
+ tableSearchForm = [
1726
+ { name: 'qp-name-like', label: '规则模板名称' },
1727
+ { name: 'qp-code-like', label: '规则模板编码' },
1728
+ ]
1729
+ modalTableProps = {
1730
+ modalTableTitle: '选择规则模板',
1731
+ tableSearchForm,
1732
+ tableColumns: [
1733
+ {
1734
+ title: '规则模板编码',
1735
+ dataIndex: 'code',
1736
+ },
1737
+ {
1738
+ title: '规则模板名称',
1739
+ dataIndex: 'name',
1740
+ render: (text: any) => handleTextOverflow(text),
1741
+ },
1742
+ {
1743
+ title: '条件对象',
1744
+ dataIndex: 'objectName',
1745
+ render: (text: any) => handleTextOverflow(text),
1746
+ },
1747
+ {
1748
+ dataIndex: 'extName',
1749
+ title: '条件扩展',
1750
+ render: (text: any) => handleTextOverflow(text),
1751
+ },
1752
+ {
1753
+ dataIndex: 'actionName',
1754
+ title: '执行动作',
1755
+ render: (text: any) => handleTextOverflow(text),
1756
+ },
1757
+ ],
1758
+ ...modalTableBusProps
1759
+ }
1760
+ }
1761
+
1762
+ // 角色选择器
1763
+ if(type === 'role') {
1764
+ requestConfig = {
1765
+ url: `${prefixUrl.selectPrefix}/role`,
1766
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
1767
+ mappingTextField: 'name',
1768
+ mappingTextShowKeyField: 'code',
1769
+ mappingValueField: 'code',
1770
+ otherParams: {
1771
+ 'qp-status-eq': 10, // 10启用 20禁用
1772
+ sorter: 'desc-id',
1773
+ }, // 默认参数
1774
+ sourceName: 'roleCode',
1775
+ ...requestConfigProp
1776
+ }
1777
+ tableSearchForm = [
1778
+ { name: 'qp-name-like', label: '角色名称' },
1779
+ { name: 'qp-code-like', label: '角色编码' },
1780
+ { name: 'qp-categoryCode-eq', type: 'select', label: '角色分类', field: {
1781
+ type: 'select',
1782
+ props: {
1783
+ notFoundContent: '暂无数据',
1784
+ allowClear: true,
1785
+ showSearch: true,
1786
+ showArrow: true,
1787
+ maxTagCount: 1,
1788
+ optionFilterProp: 'children',
1789
+ filterOption: (input: string, option: { props: { children: string } }) =>
1790
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1791
+ },
1792
+ }
1793
+ },
1794
+ ]
1795
+ Promise.all([
1796
+ loadSelectSource(`${prefixUrl.formSelectFix}/permissionCategory`, {
1797
+ pageSize: 5000,
1798
+ currentPage: 1,
1799
+ }),
1800
+ ]).then((x: any)=>{
1801
+ formatSource(x,0, 2, tableSearchForm);
1802
+ })
1803
+ modalTableProps = {
1804
+ modalTableTitle: '选择角色',
1805
+ tableSearchForm,
1806
+ tableColumns: [
1807
+ {
1808
+ title: '角色编码',
1809
+ dataIndex: 'code',
1810
+ },
1811
+ {
1812
+ title: '角色名称',
1813
+ dataIndex: 'name',
1814
+ render: (text: any) => handleTextOverflow(text),
1815
+ },
1816
+ {
1817
+ title: '角色分类',
1818
+ dataIndex: 'categoryName',
1819
+ render: (text: any) => handleTextOverflow(text),
1820
+ },
1821
+ {
1822
+ dataIndex: 'remark',
1823
+ title: '角色描述',
1824
+ render: (text: any) => handleTextOverflow(text),
1825
+ },
1826
+ {
1827
+ dataIndex: 'applicationName',
1828
+ title: '应用',
1829
+ render: (text: any) => handleTextOverflow(text),
1830
+ },
1831
+ ],
1832
+ ...modalTableBusProps
1833
+ }
1834
+ }
1835
+
1836
+ // 销售渠道选择器
1837
+ if(type === 'market-channel') {
1838
+ requestConfig = {
1839
+ url: `${prefixUrl.selectPrefix}/channelInfo`,
1840
+ filter: 'qp-name,code-orGroup,like', // 过滤参数
1841
+ mappingTextField: 'name',
1842
+ mappingTextShowKeyField: 'code',
1843
+ mappingValueField: 'code',
1844
+ otherParams: {
1845
+ 'qp-type-eq': 1, //销售渠道类型
1846
+ 'qp-isMain-eq': 1,
1847
+ 'qp-status-eq': 10, // 10启用 20禁用
1848
+ sorter: 'desc-id',
1849
+ }, // 默认参数
1850
+ sourceName: 'marketChannelCode',
1851
+ ...requestConfigProp
1852
+ }
1853
+ tableSearchForm = [
1854
+ { name: 'qp-name-like', label: '销售渠道名称' },
1855
+ { name: 'qp-code-like', label: '销售渠道编码' },
1856
+ { name: 'qp-salesOrgCode-in', type: 'select', label: '所属销售组织', field: {
1857
+ type: 'select',
1858
+ props: {
1859
+ mode: 'multiple',
1860
+ notFoundContent: '暂无数据',
1861
+ allowClear: true,
1862
+ showSearch: true,
1863
+ showArrow: true,
1864
+ maxTagCount: 1,
1865
+ optionFilterProp: 'children',
1866
+ filterOption: (input: string, option: { props: { children: string } }) =>
1867
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1868
+ },
1869
+ } },
1870
+ ]
1871
+ Promise.all([
1872
+ loadSelectSource(`${prefixUrl.formSelectFix}/orgView/getTree/sales-organizational-view`, {
1873
+ 'qp-employeeCode-eq': getEmployeeCode(),
1874
+ 'qp-realOrg-eq': true,
1875
+ 'qp-status-eq': 10
1876
+ }),
1877
+ ]).then((x: any)=>{
1878
+ formatSource(x, 0, 2, tableSearchForm);
1879
+ })
1880
+ modalTableProps = {
1881
+ modalTableTitle: '选择销售渠道',
1882
+ tableSearchForm,
1883
+ tableColumns: [
1884
+ {
1885
+ title: '销售渠道编码',
1886
+ dataIndex: 'code',
1887
+ },
1888
+ {
1889
+ title: '销售渠道名称',
1890
+ dataIndex: 'name',
1891
+ render: (text: any) => handleTextOverflow(text),
1892
+ },
1893
+ {
1894
+ title: '所属销售组织',
1895
+ dataIndex: 'salesOrgCodeName',
1896
+ render: (text: any) => handleTextOverflow(text),
1897
+ },
1898
+ ],
1899
+ ...modalTableBusProps
1900
+ }
1901
+ }
1902
+
1903
+ //业务组织选择器(可筛选业务职能/组织类型/组织形态)
1904
+ if (type === 'business-organization') {
1905
+ requestConfig = {
1906
+ url: `${prefixUrl.selectPrefix}/orgViewNode/common/pageList`,
1907
+ filter: 'qp-name-like', // 过滤参数
1908
+ mappingTextField: 'name',
1909
+ mappingTextShowKeyField: 'code',
1910
+ mappingValueField: 'code',
1911
+ otherParams: {
1912
+ sorter: 'desc-createTime',
1913
+ }, // 默认参数
1914
+ sourceName: 'organizationCode',
1915
+ ...requestConfigProp
1916
+ },
1917
+ tableSearchForm = [
1918
+ { name: 'qp-name-like', label: '组织名称' },
1919
+ { name: 'qp-code-like', label: '组织编码' },
1920
+ { name: 'qp-orgViewCode-in', type: 'select', label: '业务职能', field: {
1921
+ type: 'select',
1922
+ props: {
1923
+ mode: 'multiple',
1924
+ notFoundContent: '暂无数据',
1925
+ allowClear: true,
1926
+ showSearch: true,
1927
+ showArrow: true,
1928
+ maxTagCount: 1,
1929
+ optionFilterProp: 'children',
1930
+ filterOption: (input: string, option: { props: { children: string } }) =>
1931
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
1932
+ },
1933
+ }
1934
+ },
1935
+ {
1936
+ name: 'qp-orgType-in',
1937
+ type: 'select',
1938
+ label: '组织类型',
1939
+ field: {
1940
+ type: 'select',
1941
+ props: {
1942
+ mode: 'multiple',
1943
+ allowClear: true,
1944
+ maxTagCount: 1,
1945
+ },
1946
+ },
1947
+ initialSource: orgType
1948
+ },
1949
+ {
1950
+ name: 'qp-nodeType-in',
1951
+ type: 'select',
1952
+ label: '组织形态',
1953
+ field: {
1954
+ type: 'select',
1955
+ props: {
1956
+ mode: 'multiple',
1957
+ allowClear: true,
1958
+ maxTagCount: 1,
1959
+ },
1960
+ },
1961
+ initialSource: nodeType
1962
+ }]
1963
+ Promise.all([
1964
+ loadSelectSource(`${prefixUrl.formSelectFix}/orgView/getOrgViewListNoPage`, {
1965
+ 'qp-status-eq': 10
1966
+ }),
1967
+ ]).then((x: any)=>{
1968
+ formatSource(x, 0, 2, tableSearchForm);
1969
+ })
1970
+ modalTableProps = {
1971
+ modalTableTitle: '选择组织',
1972
+ tableSearchForm,
1973
+ tableColumns: [
1974
+ {
1975
+ title: '组织编码',
1976
+ dataIndex: 'code',
1977
+ },
1978
+ {
1979
+ title: '组织名称',
1980
+ dataIndex: 'name',
1981
+ render: (text: any) => handleTextOverflow(text),
1982
+ },
1983
+ {
1984
+ title: '业务职能',
1985
+ dataIndex: 'orgViewNameList',
1986
+ render: (text: any, record: any) => {
1987
+ const { orgViewNameList = [] } = record;
1988
+ return orgViewNameList.length ? orgViewNameList.join('/') : '--';
1989
+ },
1990
+ },
1991
+ {
1992
+ title: '组织类型',
1993
+ dataIndex: 'orgType',
1994
+ render: (text: any) => {
1995
+ const obj = orgType.find((i: any) => i.value == text);
1996
+ return obj ? obj.text : '--';
1997
+ }
1998
+ },
1999
+ {
2000
+ title: '组织形态',
2001
+ dataIndex: 'nodeType',
2002
+ render: (text: any) => {
2003
+ const obj = nodeType.find((i: any) => i.value == text);
2004
+ return obj ? obj.text : '--';
2005
+ }
2006
+ },
2007
+ ],
2008
+ ...modalTableBusProps
2009
+ }
2010
+ }
2011
+
2012
+ // 人员选择器
2013
+ if(type === 'person') {
2014
+ requestConfig = {
2015
+ url: `${prefixUrl.selectPrefix}/person`,
2016
+ filter: 'qp-code,name-orGroup,like', // 过滤参数
2017
+ mappingTextField: 'name',
2018
+ mappingTextShowKeyField: 'code',
2019
+ mappingValueField: 'code',
2020
+ otherParams: {
2021
+ sorter: 'desc-id'
2022
+ }, // 默认参数
2023
+ sourceName: 'personCode',
2024
+ ...requestConfigProp,
2025
+ }
2026
+ tableSearchForm = [
2027
+ { name: 'qp-name-like', label: '姓名' },
2028
+ { name: 'qp-code-like', label: '员工工号' },
2029
+ { name: 'qp-phone-like', label: '手机号' },
2030
+ ]
2031
+ modalTableProps = {
2032
+ modalTableTitle: '添加人员',
2033
+ tableSearchForm,
2034
+ tableColumns: [
2035
+ {
2036
+ title: '姓名',
2037
+ dataIndex: 'name',
2038
+ },
2039
+ {
2040
+ title: '员工工号',
2041
+ dataIndex: 'code',
2042
+ },
2043
+ {
2044
+ title: '员工类型',
2045
+ dataIndex: 'dataSource',
2046
+ render: (text: number) => personDataSourceType.find((i: any) => i.value == text)?.text,
2047
+ },
2048
+ {
2049
+ title: '手机号',
2050
+ dataIndex: 'phone',
2051
+ },
2052
+ ],
2053
+ ...modalTableBusProps
2054
+ }
2055
+ }
2056
+
2057
+ // 品牌选择器
2058
+ if(type === 'brand') {
2059
+ requestConfig = {
2060
+ url: `${prefixUrl.selectPrefix}/brand/list`,
2061
+ filter: 'qp-brandCode,name-orGroup,like', // 过滤参数
2062
+ mappingTextField: 'name',
2063
+ mappingTextShowKeyField: 'brandCode',
2064
+ mappingValueField: 'brandCode',
2065
+ otherParams: {
2066
+ 'ctl-withAuth': true,
2067
+ 'qp-status-in': '1', // 1启用 0禁用
2068
+ sorter: 'desc-id'
2069
+ }, // 默认参数
2070
+ sourceName: 'brandCode',
2071
+ ...requestConfigProp,
2072
+ }
2073
+ tableSearchForm = [
2074
+ { name: 'qp-name-like', label: '品牌名称' },
2075
+ { name: 'qp-brandCode-like', label: '品牌编码' },
2076
+ ]
2077
+ modalTableProps = {
2078
+ modalTableTitle: '添加品牌',
2079
+ tableSearchForm,
2080
+ tableColumns: [
2081
+ {
2082
+ title: '品牌图片',
2083
+ dataIndex: 'logoUrl',
2084
+ render: (text: any) => (
2085
+ <Image.PreviewGroup>
2086
+ {(text && Object.prototype.toString.call(JSON.parse(text)) === '[object Array]' &&
2087
+ JSON.parse(text || '[]').map((ites: any, index: any) =>
2088
+ tableColumnsImage(ites),
2089
+ )) ||
2090
+ tableColumnsImage(text)}
2091
+ </Image.PreviewGroup>
2092
+ ),
2093
+ },
2094
+ {
2095
+ title: '品牌编码',
2096
+ dataIndex: 'brandCode',
2097
+ },
2098
+ {
2099
+ title: '品牌中文名',
2100
+ dataIndex: 'name',
2101
+ },
2102
+ {
2103
+ title: '品牌英文名',
2104
+ dataIndex: 'enName',
2105
+ },
2106
+ {
2107
+ title: '品牌首字母',
2108
+ dataIndex: 'brandInitial',
2109
+ },
2110
+ {
2111
+ title: '描述',
2112
+ dataIndex: 'detail',
2113
+ },
2114
+ ],
2115
+ ...modalTableBusProps
2116
+ }
2117
+ }
2118
+
2119
+ return { modalTableProps, requestConfig, needModalTable };
2120
+ }