@bit-sun/business-component 3.1.10-alpha.1 → 3.1.10-alpha.11

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