@bit-sun/business-component 3.1.5 → 3.1.7

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