@bit-sun/business-component 2.3.21 → 2.3.22

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