@bit-sun/business-component 2.3.22-beta7 → 2.3.22-beta8

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 -1060
  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 +565 -564
  69. package/src/components/Business/BsSulaQueryTable/index.less +221 -221
  70. package/src/components/Business/BsSulaQueryTable/index.tsx +531 -531
  71. package/src/components/Business/BsSulaQueryTable/setting.tsx +853 -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 +765 -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 -79
  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 -1170
  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 +725 -724
  179. package/src/plugin/TableColumnSetting/utils.ts +19 -19
  180. package/src/styles/bsDefault.less +1890 -1890
  181. package/src/utils/CheckOneUser/index.md +39 -39
  182. package/src/utils/CheckOneUser/index.ts +51 -51
  183. package/src/utils/LocalstorageUtils.ts +114 -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 +42 -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 -14
  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 -30768
  260. package/dist/index.js +0 -30815
  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,1060 +1,1060 @@
1
- /*
2
- * @Description:
3
- * @Author: rodchen
4
- * @Date: 2022-05-07 15:17:28
5
- * @LastEditTime: 2022-05-08 21:01:21
6
- * @LastEditors: rodchen
7
- */
8
- import React, { useState, useEffect } from 'react';
9
- import { Tooltip, Select, message } from 'antd';
10
- import axios from 'axios';
11
- import { AddSelect } from '../../../index';
12
- import { tableColumnsImage } from '@/components/Business/BsSulaQueryTable/utils';
13
- import { getSkuImg } from '@/utils/TableUtils';
14
- import { getEmployeeId } from '@/utils/LocalstorageUtils';
15
- // import { getCurrentTargetBgId } from '@/utils/LocalstorageUtils';
16
-
17
- function handleSelectColumn(c: any, parentProps: any) {
18
- let result = c;
19
- const showColumns = parentProps?.showColumns || [];
20
- const exceptColumns = parentProps?.exceptColumns || [];
21
- const coverColumns = parentProps?.coverColumns || [];
22
- const additionColumns = parentProps?.additionColumns || [];
23
- // 仅展示内容
24
- if(showColumns?.length) {
25
- result = result.filter((i: any) => showColumns.includes(i.dataIndex))
26
- }
27
- // 过滤不需要展示内容
28
- if(exceptColumns?.length) {
29
- result = result.filter((i: any) => !exceptColumns.includes(i.dataIndex))
30
- }
31
- // 追加(最好不用这个,当组件不固定时候会有影响)
32
- if(additionColumns?.length) {
33
- additionColumns.forEach((i: any) => {
34
- result.splice(i.position,0,i.column)
35
- })
36
- }
37
- // 覆盖内容
38
- if(coverColumns?.length) {
39
- result = coverColumns;
40
- }
41
- return result
42
- }
43
- function handleSearchForm(c: any, parentProps: any) {
44
- let result = c;
45
- const showTableSearchForm = parentProps?.showTableSearchForm || [];
46
- const exceptTableSearchForm= parentProps?.exceptTableSearchForm|| [];
47
- const coverTableSearchForm = parentProps?.coverTableSearchForm || [];
48
- // 仅展示内容
49
- if(showTableSearchForm?.length) {
50
- result = result.filter((i: any) => showTableSearchForm.includes(i.name))
51
- }
52
- // 过滤不需要展示内容
53
- if(exceptTableSearchForm?.length) {
54
- result = result.filter((i: any) => !exceptTableSearchForm.includes(i.name))
55
- }
56
- // 覆盖内容
57
- if(coverTableSearchForm?.length) {
58
- result = coverTableSearchForm;
59
- }
60
- return result;
61
- }
62
- function handleFormSearchSourceLoad(c: any, parentProps: any) {
63
- let result = c;
64
- const showTableFormSearchSourceLoad = parentProps?.showTableFormSearchSourceLoad || [];
65
- const exceptTableFormSearchSourceLoad= parentProps?.exceptTableFormSearchSourceLoad|| [];
66
- const coverTableFormSearchSourceLoad = parentProps?.coverTableFormSearchSourceLoad || [];
67
- const noNeedTableFormSearchSourceLoad = parentProps?.noNeedTableFormSearchSourceLoad
68
- // 仅展示内容
69
- if(showTableFormSearchSourceLoad?.length) {
70
- result = result.filter((i: any) => showTableFormSearchSourceLoad.includes(i.url))
71
- }
72
- // 过滤不需要展示内容
73
- if(exceptTableFormSearchSourceLoad?.length) {
74
- result = result.filter((i: any) => !exceptTableFormSearchSourceLoad.includes(i.url))
75
- }
76
- // 覆盖内容
77
- if(coverTableFormSearchSourceLoad?.length) {
78
- result = coverTableFormSearchSourceLoad;
79
- }
80
- // 不需要默认请求
81
- if(noNeedTableFormSearchSourceLoad) {
82
- result = [];
83
- }
84
- return result;
85
- }
86
-
87
- export const AddSkuSelect = (parProps: any) => {
88
- const selectProps = {
89
- mode: 'multiple',
90
- }
91
- const [value, setValue] = useState(selectProps?.mode ? [] : null);
92
- const isNoUseItemBarcode = parProps?.noUseItemEancode !== undefined ? parProps?.noUseItemEancode : true; // 默认不加商品条码,兼容老项目
93
- //注⚠️:自定义过表头的请记得传tableCodeList参数
94
- const initialSelectColumn = [
95
- {
96
- title: 'SKU编码',
97
- width: 150,
98
- dataIndex: 'skuCode',
99
- },
100
- ...(isNoUseItemBarcode ? [] : [
101
- {
102
- title: '商品条码',
103
- width: 100,
104
- ellipsis: {
105
- showTitle: false,
106
- },
107
- dataIndex: 'itemEancode',
108
- render: (text: any) => (
109
- <Tooltip placement="topLeft" title={text}>
110
- {text}
111
- </Tooltip>
112
- ),
113
- }
114
- ]),
115
- {
116
- title: 'SKU名称',
117
- width: 200,
118
- ellipsis: {
119
- showTitle: false,
120
- },
121
- render: (text: any) => (
122
- <Tooltip placement="topLeft" title={text}>
123
- {text}
124
- </Tooltip>
125
- ),
126
- dataIndex: 'name',
127
- },
128
- {
129
- title: '图片',
130
- dataIndex: 'itemUrl',
131
- width: 200,
132
- ellipsis: {
133
- showTitle: false,
134
- },
135
- render: (text: any,record: any) => (
136
- <Tooltip placement="topLeft" title={text}>
137
- {tableColumnsImage(getSkuImg(record),{ width: 28, height: 28 })}
138
- </Tooltip>
139
- ),
140
- },
141
- {
142
- title: '数量',
143
- width: 100,
144
- isInputItem: true,
145
- dataIndex: 'count',
146
- },
147
- {
148
- title: '单位',
149
- dataIndex: 'selectUnitCode',
150
- width: 80,
151
- ellipsis: {
152
- showTitle: false,
153
- },
154
- render: (text: any, record: any) => {
155
- if (record?.packingUnitList?.length) {
156
- const basePackUnit = record?.packingUnitList[0]
157
- record.selectUnitCode = basePackUnit.unitCode
158
- return basePackUnit.name || basePackUnit.unitCode
159
- }
160
-
161
-
162
- return <></>
163
- },
164
- },
165
- {
166
- title: '所属SPU编码',
167
- width: 150,
168
- ellipsis: {
169
- showTitle: false,
170
- },
171
- dataIndex: 'itemCode',
172
- render: (text: any) => (
173
- <Tooltip placement="topLeft" title={text}>
174
- {text}
175
- </Tooltip>
176
- ),
177
- },
178
- {
179
- title: '规格',
180
- width: 200,
181
- ellipsis: {
182
- showTitle: false,
183
- },
184
- render: (text: any) => (
185
- <Tooltip placement="topLeft" title={text}>
186
- {text}
187
- </Tooltip>
188
- ),
189
- dataIndex: 'propertyNameAndValue',
190
- }
191
- ]
192
- const mTpSelectColumn = handleSelectColumn(initialSelectColumn, parProps);
193
- const initialTableColumn = [
194
- {
195
- title: 'SKU编码',
196
- width: 150,
197
- dataIndex: 'skuCode',
198
- },
199
- {
200
- title: 'SKU名称',
201
- width: 200,
202
- ellipsis: {
203
- showTitle: false,
204
- },
205
- render: (text: any) => (
206
- <Tooltip placement="topLeft" title={text}>
207
- {text}
208
- </Tooltip>
209
- ),
210
- dataIndex: 'name',
211
- },
212
- {
213
- title: '图片',
214
- dataIndex: 'itemUrl',
215
- width: 200,
216
- ellipsis: {
217
- showTitle: false,
218
- },
219
- render: (text: any,record: any) => (
220
- <Tooltip placement="topLeft" title={text}>
221
- {tableColumnsImage(getSkuImg(record),{ width: 20, height: 20 })}
222
- </Tooltip>
223
- ),
224
- },
225
- ...(isNoUseItemBarcode ? []: [
226
- {
227
- title: '商品条码',
228
- width: 100,
229
- ellipsis: {
230
- showTitle: false,
231
- },
232
- dataIndex: 'itemEancode',
233
- render: (text: any) => (
234
- <Tooltip placement="topLeft" title={text}>
235
- {text}
236
- </Tooltip>
237
- ),
238
- }
239
- ]),
240
- {
241
- title: '所属SPU名称',
242
- width: 100,
243
- ellipsis: {
244
- showTitle: false,
245
- },
246
- dataIndex: 'itemName',
247
- render: (text: any) => (
248
- <Tooltip placement="topLeft" title={text}>
249
- {text}
250
- </Tooltip>
251
- ),
252
- },
253
- {
254
- title: '所属SPU编码',
255
- width: 100,
256
- ellipsis: {
257
- showTitle: false,
258
- },
259
- dataIndex: 'itemCode',
260
- render: (text: any) => (
261
- <Tooltip placement="topLeft" title={text}>
262
- {text}
263
- </Tooltip>
264
- ),
265
- },
266
- {
267
- title: '外部编码',
268
- width: 100,
269
- ellipsis: {
270
- showTitle: false,
271
- },
272
- render: (text: any) => (
273
- <Tooltip placement="topLeft" title={text}>
274
- {text}
275
- </Tooltip>
276
- ),
277
- dataIndex: 'externalCode',
278
- },
279
- {
280
- title: '规格',
281
- width: 100,
282
- ellipsis: {
283
- showTitle: false,
284
- },
285
- render: (text: any) => (
286
- <Tooltip placement="topLeft" title={text}>
287
- {text}
288
- </Tooltip>
289
- ),
290
- dataIndex: 'propertyNameAndValue',
291
- },
292
- {
293
- title: '类目',
294
- width: 100,
295
- ellipsis: {
296
- showTitle: false,
297
- },
298
- render: (text: any) => (
299
- <Tooltip placement="topLeft" title={text}>
300
- {text}
301
- </Tooltip>
302
- ),
303
- dataIndex: 'categoryName',
304
- },
305
- {
306
- title: '品类',
307
- width: 100,
308
- ellipsis: {
309
- showTitle: false,
310
- },
311
- render: (text: any) => (
312
- <Tooltip placement="topLeft" title={text}>
313
- {text}
314
- </Tooltip>
315
- ),
316
- dataIndex: 'className',
317
- },
318
- {
319
- title: '品牌',
320
- width: 100,
321
- ellipsis: {
322
- showTitle: false,
323
- },
324
- render: (text: any) => (
325
- <Tooltip placement="topLeft" title={text}>
326
- {text}
327
- </Tooltip>
328
- ),
329
- dataIndex: 'brandName',
330
- },
331
- ]
332
- const mTpTableColumn = handleSelectColumn(initialTableColumn, parProps);
333
- const initialTableSearchForm = [
334
- {
335
- name: 'qp-skuCode-like', label: 'SKU编码'
336
- },
337
- { name: 'qp-skuName-like', label: 'SKU名称' },
338
- ...(isNoUseItemBarcode ? []: [
339
- { name: 'qp-code-in', label: '商品条码', field: {
340
- type: 'multipleQueryInput',
341
- props: {
342
- ...(parProps.requestConfig?.itemEancodeValueRequestConfig || {}),
343
- },
344
- }}
345
- ]),
346
- { name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
347
- type: 'select',
348
- props: {
349
- mode: 'multiple',
350
- notFoundContent: '暂无数据',
351
- allowClear: true,
352
- showSearch: true,
353
- showArrow: true,
354
- maxTagCount: 1,
355
- optionFilterProp: 'children',
356
- filterOption: (input: string, option: { props: { children: string } }) =>
357
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
358
- },
359
- } },
360
- { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
361
- type: 'treeSelect',
362
- props: {
363
- treeData: [],
364
- treeCheckable: true,
365
- showSearch: true,
366
- allowClear: true,
367
- showArrow: true,
368
- treeNodeFilterProp: 'title',
369
- treeDefaultExpandAll: true,
370
- maxTagCount: 1,
371
- placeholder: '请选择',
372
- style: {
373
- width: '100%',
374
- },
375
- dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
376
- },
377
- } },
378
- ...(parProps?.addTableSearchForm||[])
379
- ]
380
- const mTpTableSearchForm = handleSearchForm(initialTableSearchForm, parProps);
381
- const initialPromiseLoadList = [
382
- {
383
- url: `/items/brand/queryBrandList`,
384
- params: {
385
- pageSize: 5000,
386
- currentPage: 1,
387
- 'ctl-withAuth': true
388
- },
389
- resType: 'list',
390
- resPosition: isNoUseItemBarcode ? 2 : 3,
391
- resKeyValue: ['id','name']
392
- },
393
- {
394
- url: `/items/category/queryCategoryTree`,
395
- params: {
396
- pageSize: 5000,
397
- currentPage: 1,
398
- },
399
- resType: 'treeList',
400
- resPosition: isNoUseItemBarcode ? 3 : 4
401
- },
402
- ]
403
- const mTpPromiseLoadList = handleFormSearchSourceLoad(initialPromiseLoadList, parProps);
404
- const props = {
405
- buttonText: parProps.buttonText || '新增',
406
- buttonProps: parProps.buttonProps || {},
407
- tableCodeList: parProps.tableCodeList || [],
408
- value,
409
- // labelInValue: true, // 非必填 默认为false
410
- requestConfig: {
411
- url: `/items/sku/pager/v2`,
412
- filter: 'qp-name-like', // 过滤参数 支持'qp-name-like'和['qp-name-like', 'qp-code-like']两种结构
413
- otherParams: {
414
- 'qp-combination-eq': false,
415
- 'qp-approveStatus-eq': 1,
416
- 'qp-status-eq': 1,
417
- // 'useOrgSign': getCurrentTargetBgId(), // 根据品牌、账号授权的组织+商品授权使用组织做权限过滤 这个交给业务使用的地方去做,传addOtherParams:{useOrgSign:单据中所选组织}
418
- ...(parProps?.requestConfig?.addOtherParams || {}), // 允许在默认参数基础上,追加/覆盖已有 参数
419
- }, // 默认参数
420
- mappingTextField: 'name',
421
- mappingValueField: 'skuCode',
422
- ...parProps.requestConfig
423
- },
424
- selectProps,
425
- onChange: (value: any) => {
426
- console.log(value)
427
- setValue(value)
428
- },
429
- beforeShowModal: parProps?.beforeShowModal,
430
- onSaveCallback: parProps.onSaveCallback,
431
- businessType: 'sku',
432
- isAllowRepeatedSelect: !!parProps?.isAllowRepeatedSelect,
433
- };
434
- const modalTableProps = {
435
- modalTableTitle: '选择商品',
436
- tableSearchForm: mTpTableSearchForm,
437
- tableColumns: mTpTableColumn,
438
- selectColumn: mTpSelectColumn,
439
- promiseLoadList: mTpPromiseLoadList,
440
- }
441
-
442
- return (
443
- <div>
444
- <AddSelect
445
- {...props}
446
- modalTableProps={modalTableProps}
447
- />
448
- </div>
449
- );
450
- };
451
-
452
- export const AddSkcSelect = (parProps: any) => {
453
- const selectProps = {
454
- mode: 'multiple',
455
- }
456
- const [value, setValue] = useState(selectProps?.mode ? [] : null);
457
- const [propertyList, setPropertyList] = useState([]);
458
-
459
- useEffect(() => {
460
- // type: 1 尺码组; 2 配码组
461
- axios.get(`/items/itemPropertyValueGroup/listNoPage?qp-type-eq=2&qp-status-eq=1`).then((result: any) => {
462
- result = result.data;
463
- if ((result?.status && result.status !== '0') || (result?.code && result.code !== '000000')) {
464
- message.error(result.msg);
465
- return;
466
- }
467
- const data = result.data || [];
468
- setPropertyList(data)
469
- }).catch((err) => {});
470
- },[])
471
-
472
- //注⚠️:自定义过表头的请记得传tableCodeList参数
473
- const initialSelectColumn = [
474
- {
475
- title: 'SKC编码',
476
- width: 150,
477
- dataIndex: 'code',
478
- },
479
- {
480
- title: 'SKC名称',
481
- width: 200,
482
- ellipsis: {
483
- showTitle: false,
484
- },
485
- render: (text: any) => (
486
- <Tooltip placement="topLeft" title={text}>
487
- {text}
488
- </Tooltip>
489
- ),
490
- dataIndex: 'name',
491
- },
492
- {
493
- title: '颜色',
494
- width: 200,
495
- ellipsis: {
496
- showTitle: false,
497
- },
498
- render: (text: any) => (
499
- <Tooltip placement="topLeft" title={text}>
500
- {text}
501
- </Tooltip>
502
- ),
503
- dataIndex: 'colorName',
504
- },
505
- {
506
- title: '配码',
507
- dataIndex: 'selectPropertyGroupCode',
508
- width: 160,
509
- isSelectItem: true,
510
- dataSource: propertyList,
511
- },
512
- {
513
- title: '数量',
514
- width: 100,
515
- isInputItem: true,
516
- dataIndex: 'count',
517
- },
518
- ]
519
- const mTpSelectColumn = handleSelectColumn(initialSelectColumn, parProps)
520
- const initialPromiseLoadList = [
521
- {
522
- url: `/items/item/propertyValue/sizeBySkcConfig`,
523
- params: {
524
- pageSize: 10000,
525
- currentPage: 1,
526
- type: 2, // 类型:1尺码;2颜色
527
- },
528
- resType: 'list',
529
- resPosition: 3,
530
- resKeyValue: ['value','value']
531
- },
532
- {
533
- url: `/items/category/queryCategoryTree`,
534
- params: {
535
- pageSize: 5000,
536
- currentPage: 1,
537
- },
538
- resType: 'treeList',
539
- resPosition: 4,
540
- },
541
- {
542
- url: `/items/class/withProperty`,
543
- params: {
544
- pageSize: 5000,
545
- currentPage: 1,
546
- },
547
- resType: 'list',
548
- resPosition: 5,
549
- resKeyValue: ['id','name']
550
- },
551
- {
552
- url: `/items/brand/queryBrandList`,
553
- params: {
554
- pageSize: 5000,
555
- currentPage: 1,
556
- 'ctl-withAuth': true
557
- },
558
- resType: 'list',
559
- resPosition: 6,
560
- resKeyValue: ['id','name']
561
- },
562
- ]
563
- const props = {
564
- buttonText: parProps.buttonText || '新增',
565
- buttonProps: parProps.buttonProps || {},
566
- tableCodeList: parProps.tableCodeList || ['skcSelect-tableOptionsToChoosePartCode','skcSelect-tableSelectedItemPartCode'],
567
- value,
568
- // labelInValue: true, // 非必填 默认为false
569
- requestConfig: {
570
- url: `/items/skc/skcSelect`,
571
- filter: 'qp-name-like', // 过滤参数 支持'qp-name-like'和['qp-name-like', 'qp-code-like']两种结构
572
- otherParams: {
573
- 'qp-skcStatus-eq': 1,
574
- ...(parProps?.requestConfig?.addOtherParams || {}), // 允许在默认参数基础上,追加/覆盖已有 参数
575
- }, // 默认参数
576
- mappingTextField: 'name',
577
- mappingValueField: 'code',
578
- ...parProps.requestConfig
579
- },
580
- selectProps,
581
- onChange: (value: any) => {
582
- console.log(value)
583
- setValue(value)
584
- },
585
- beforeShowModal: parProps?.beforeShowModal,
586
- onSaveCallback: parProps.onSaveCallback,
587
- businessType: 'skc',
588
- isAllowRepeatedSelect: parProps?.isAllowRepeatedSelect!==undefined ? !!parProps?.isAllowRepeatedSelect : true, // 默认开启一行选多次
589
- };
590
- const modalTableProps = {
591
- modalTableTitle: '选择商品',
592
- tableSearchForm: [
593
- { name: 'qp-code-like', label: 'SKC编码' },
594
- { name: 'qp-skcName-like', label: 'SKC名称' },
595
- { name: 'qp-itemName-like', label: '商品名称' },
596
- { name: 'qp-colorName-in', type: 'select', label: '颜色', field: {
597
- type: 'select',
598
- props: {
599
- mode: 'multiple',
600
- notFoundContent: '暂无数据',
601
- allowClear: true,
602
- showSearch: true,
603
- showArrow: true,
604
- maxTagCount: 1,
605
- optionFilterProp: 'children',
606
- filterOption: (input: string, option: { props: { children: string } }) =>
607
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
608
- },
609
- } },
610
- { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
611
- type: 'treeSelect',
612
- props: {
613
- treeData: [],
614
- treeCheckable: true,
615
- showSearch: true,
616
- allowClear: true,
617
- showArrow: true,
618
- treeNodeFilterProp: 'title',
619
- treeDefaultExpandAll: true,
620
- maxTagCount: 1,
621
- placeholder: '请选择',
622
- style: {
623
- width: '100%',
624
- },
625
- dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
626
- },
627
- } },
628
- { name: 'qp-classId-in', type: 'select', label: '品类', field: {
629
- type: 'select',
630
- props: {
631
- mode: 'multiple',
632
- notFoundContent: '暂无数据',
633
- allowClear: true,
634
- showSearch: true,
635
- showArrow: true,
636
- maxTagCount: 1,
637
- optionFilterProp: 'children',
638
- filterOption: (input: string, option: { props: { children: string } }) =>
639
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
640
- },
641
- } },
642
- { name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
643
- type: 'select',
644
- props: {
645
- mode: 'multiple',
646
- notFoundContent: '暂无数据',
647
- allowClear: true,
648
- showSearch: true,
649
- showArrow: true,
650
- maxTagCount: 1,
651
- optionFilterProp: 'children',
652
- filterOption: (input: string, option: { props: { children: string } }) =>
653
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
654
- },
655
- } },
656
- ],
657
- tableColumns: [
658
- {
659
- title: 'SKC编码',
660
- width: 150,
661
- dataIndex: 'code',
662
- },
663
- {
664
- title: 'SKC名称',
665
- width: 200,
666
- ellipsis: {
667
- showTitle: false,
668
- },
669
- render: (text: any) => (
670
- <Tooltip placement="topLeft" title={text}>
671
- {text}
672
- </Tooltip>
673
- ),
674
- dataIndex: 'name',
675
- },
676
- {
677
- title: '商品名称',
678
- width: 100,
679
- ellipsis: {
680
- showTitle: false,
681
- },
682
- dataIndex: 'itemName',
683
- render: (text: any) => (
684
- <Tooltip placement="topLeft" title={text}>
685
- {text}
686
- </Tooltip>
687
- ),
688
- },
689
- {
690
- title: '颜色',
691
- width: 100,
692
- ellipsis: {
693
- showTitle: false,
694
- },
695
- render: (text: any) => (
696
- <Tooltip placement="topLeft" title={text}>
697
- {text}
698
- </Tooltip>
699
- ),
700
- dataIndex: 'colorName',
701
- },
702
- {
703
- title: '类目',
704
- width: 100,
705
- ellipsis: {
706
- showTitle: false,
707
- },
708
- render: (text: any) => (
709
- <Tooltip placement="topLeft" title={text}>
710
- {text}
711
- </Tooltip>
712
- ),
713
- dataIndex: 'categoryName',
714
- },
715
- {
716
- title: '品类',
717
- width: 100,
718
- ellipsis: {
719
- showTitle: false,
720
- },
721
- render: (text: any) => (
722
- <Tooltip placement="topLeft" title={text}>
723
- {text}
724
- </Tooltip>
725
- ),
726
- dataIndex: 'className',
727
- },
728
- {
729
- title: '品牌',
730
- width: 100,
731
- ellipsis: {
732
- showTitle: false,
733
- },
734
- render: (text: any) => (
735
- <Tooltip placement="topLeft" title={text}>
736
- {text}
737
- </Tooltip>
738
- ),
739
- dataIndex: 'brandName',
740
- },
741
- ],
742
- selectColumn: mTpSelectColumn,
743
- promiseLoadList: initialPromiseLoadList
744
- }
745
-
746
- return (
747
- <div>
748
- <AddSelect
749
- {...props}
750
- modalTableProps={modalTableProps}
751
- />
752
- </div>
753
- );
754
- };
755
-
756
- export const AddSpuSelect = (parProps: any) => {
757
- const selectProps = {
758
- mode: 'multiple',
759
- }
760
- const [value, setValue] = useState(selectProps?.mode ? [] : null);
761
- const [propertyList, setPropertyList] = useState([]);
762
-
763
- useEffect(() => {
764
- if(parProps?.isSingleColor) {
765
- // type: 1 尺码组; 2 配码组
766
- axios.get(`/items/itemPropertyValueGroup/listNoPage?qp-type-eq=2&qp-status-eq=1`).then((result: any) => {
767
- result = result.data;
768
- if ((result?.status && result.status !== '0') || (result?.code && result.code !== '000000')) {
769
- message.error(result.msg);
770
- return;
771
- }
772
- const data = result.data || [];
773
- setPropertyList(data)
774
- }).catch((err) => {});
775
- }
776
- },[])
777
-
778
- //注⚠️:自定义过表头的请记得传tableCodeList参数
779
- const initialSelectColumn = [
780
- {
781
- title: '商品编码',
782
- width: 150,
783
- dataIndex: 'itemCode',
784
- },
785
- {
786
- title: '商品名称',
787
- width: 200,
788
- ellipsis: {
789
- showTitle: false,
790
- },
791
- render: (text: any) => (
792
- <Tooltip placement="topLeft" title={text}>
793
- {text}
794
- </Tooltip>
795
- ),
796
- dataIndex: 'name',
797
- },
798
- {
799
- title: '颜色',
800
- dataIndex: 'colorName',
801
- width: 200,
802
- isSelectItem: true,
803
- dataSourceCode: 'colorValues',
804
- dataSourceMapping: ['value', 'value']
805
- },
806
- {
807
- title: '配码',
808
- dataIndex: 'selectPropertyGroupCode',
809
- width: 160,
810
- isSelectItem: true,
811
- dataSource: propertyList,
812
- filterDataSourceCode: 'matchingCodes',
813
- },
814
- {
815
- title: '数量',
816
- width: 100,
817
- isInputItem: true,
818
- dataIndex: 'count',
819
- },
820
- {
821
- title: '所属组织',
822
- dataIndex: 'ownOrgSignName',
823
- },
824
- {
825
- title: '品牌',
826
- dataIndex: 'brandName',
827
- },
828
- {
829
- title: '类目',
830
- dataIndex: 'categoryText',
831
- },
832
- {
833
- title: '品类',
834
- dataIndex: 'className',
835
- },
836
- ]
837
- const mTpSelectColumn = handleSelectColumn(initialSelectColumn, parProps)
838
- const initialPromiseLoadList = [
839
- {
840
- url: `/user/orgViewNode/listNoPage`,
841
- params: {
842
- 'qp-employeeId-eq': getEmployeeId(),
843
- 'qp-orgViewCode-eq': 'business-organizational-view',
844
- 'ctl-withDefaultOrg': true,
845
- },
846
- resType: 'list',
847
- resPosition: 2,
848
- resKeyValue: ['targetId','name']
849
- },
850
- {
851
- url: `/items/brand/queryBrandList`,
852
- params: {
853
- pageSize: 5000,
854
- currentPage: 1,
855
- 'ctl-withAuth': true
856
- },
857
- resType: 'list',
858
- resPosition: 3,
859
- resKeyValue: ['id','name']
860
- },
861
- {
862
- url: `/items/category/queryCategoryTree`,
863
- params: {
864
- pageSize: 5000,
865
- currentPage: 1,
866
- },
867
- resType: 'treeList',
868
- resPosition: 4,
869
- },
870
- {
871
- url: `/items/class/withProperty`,
872
- params: {
873
- pageSize: 5000,
874
- currentPage: 1,
875
- },
876
- resType: 'list',
877
- resPosition: 5,
878
- resKeyValue: ['id','name']
879
- },
880
- ]
881
- const props = {
882
- buttonText: parProps.buttonText || '新增',
883
- buttonProps: parProps.buttonProps || {},
884
- tableCodeList: parProps.tableCodeList || [],
885
- value,
886
- // labelInValue: true, // 非必填 默认为false
887
- requestConfig: {
888
- url: `/items/item`,
889
- filter: 'qp-itemCode,name-orGroup,like', // 过滤参数
890
- otherParams: {
891
- 'qp-approveStatus-eq': 1, // 审核状态(0.待审批;1.审批通过;2.驳回;3.审批未通过)
892
- 'qp-status-eq': 1,
893
- sorter: 'desc-id',
894
- ...(parProps?.requestConfig?.addOtherParams || {}), // 允许在默认参数基础上,追加/覆盖已有 参数
895
- }, // 默认参数
896
- mappingTextField: 'name',
897
- mappingValueField: 'itemCode',
898
- ...parProps.requestConfig
899
- },
900
- selectProps,
901
- onChange: (value: any) => {
902
- console.log(value)
903
- setValue(value)
904
- },
905
- beforeShowModal: parProps?.beforeShowModal,
906
- onSaveCallback: parProps.onSaveCallback,
907
- businessType: 'spu',
908
- isAllowRepeatedSelect: !!parProps?.isAllowRepeatedSelect,
909
- };
910
- const modalTableProps = {
911
- modalTableTitle: '选择商品',
912
- tableSearchForm: [
913
- { name: 'qp-itemCode-like', label: '商品编码' },
914
- { name: 'qp-name-like', label: '商品名称' },
915
- { name: 'qp-ownOrgSign-in', type: 'select', label: '所属组织', field: {
916
- type: 'select',
917
- props: {
918
- mode: 'multiple',
919
- notFoundContent: '暂无数据',
920
- allowClear: true,
921
- showSearch: true,
922
- showArrow: true,
923
- maxTagCount: 1,
924
- optionFilterProp: 'children',
925
- filterOption: (input: string, option: { props: { children: string } }) =>
926
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
927
- },
928
- } },
929
- { name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
930
- type: 'select',
931
- props: {
932
- mode: 'multiple',
933
- notFoundContent: '暂无数据',
934
- allowClear: true,
935
- showSearch: true,
936
- showArrow: true,
937
- maxTagCount: 1,
938
- optionFilterProp: 'children',
939
- filterOption: (input: string, option: { props: { children: string } }) =>
940
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
941
- },
942
- } },
943
- { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
944
- type: 'treeSelect',
945
- props: {
946
- treeData: [],
947
- treeCheckable: true,
948
- showSearch: true,
949
- allowClear: true,
950
- showArrow: true,
951
- treeNodeFilterProp: 'title',
952
- treeDefaultExpandAll: true,
953
- maxTagCount: 1,
954
- placeholder: '请选择',
955
- style: {
956
- width: '100%',
957
- },
958
- dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
959
- },
960
- } },
961
- { name: 'qp-classId-in', type: 'select', label: '品类', field: {
962
- type: 'select',
963
- props: {
964
- mode: 'multiple',
965
- notFoundContent: '暂无数据',
966
- allowClear: true,
967
- showSearch: true,
968
- showArrow: true,
969
- maxTagCount: 1,
970
- optionFilterProp: 'children',
971
- filterOption: (input: string, option: { props: { children: string } }) =>
972
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
973
- },
974
- } },
975
- ],
976
- tableColumns: [
977
- {
978
- title: '商品编码',
979
- width: 150,
980
- dataIndex: 'itemCode',
981
- },
982
- {
983
- title: '商品名称',
984
- width: 200,
985
- ellipsis: {
986
- showTitle: false,
987
- },
988
- render: (text: any) => (
989
- <Tooltip placement="topLeft" title={text}>
990
- {text}
991
- </Tooltip>
992
- ),
993
- dataIndex: 'name',
994
- },
995
- {
996
- title: '所属组织',
997
- width: 100,
998
- ellipsis: {
999
- showTitle: false,
1000
- },
1001
- render: (text: any) => (
1002
- <Tooltip placement="topLeft" title={text}>
1003
- {text}
1004
- </Tooltip>
1005
- ),
1006
- dataIndex: 'ownOrgSignName',
1007
- },
1008
- {
1009
- title: '品牌',
1010
- width: 100,
1011
- ellipsis: {
1012
- showTitle: false,
1013
- },
1014
- render: (text: any) => (
1015
- <Tooltip placement="topLeft" title={text}>
1016
- {text}
1017
- </Tooltip>
1018
- ),
1019
- dataIndex: 'brandName',
1020
- },
1021
- {
1022
- title: '类目',
1023
- width: 100,
1024
- ellipsis: {
1025
- showTitle: false,
1026
- },
1027
- render: (text: any) => (
1028
- <Tooltip placement="topLeft" title={text}>
1029
- {text}
1030
- </Tooltip>
1031
- ),
1032
- dataIndex: 'categoryName',
1033
- },
1034
- {
1035
- title: '品类',
1036
- width: 100,
1037
- ellipsis: {
1038
- showTitle: false,
1039
- },
1040
- render: (text: any) => (
1041
- <Tooltip placement="topLeft" title={text}>
1042
- {text}
1043
- </Tooltip>
1044
- ),
1045
- dataIndex: 'className',
1046
- },
1047
- ],
1048
- selectColumn: mTpSelectColumn,
1049
- promiseLoadList: initialPromiseLoadList
1050
- }
1051
-
1052
- return (
1053
- <div>
1054
- <AddSelect
1055
- {...props}
1056
- modalTableProps={modalTableProps}
1057
- />
1058
- </div>
1059
- );
1060
- };
1
+ /*
2
+ * @Description:
3
+ * @Author: rodchen
4
+ * @Date: 2022-05-07 15:17:28
5
+ * @LastEditTime: 2022-05-08 21:01:21
6
+ * @LastEditors: rodchen
7
+ */
8
+ import React, { useState, useEffect } from 'react';
9
+ import { Tooltip, Select, message } from 'antd';
10
+ import axios from 'axios';
11
+ import { AddSelect } from '../../../index';
12
+ import { tableColumnsImage } from '@/components/Business/BsSulaQueryTable/utils';
13
+ import { getSkuImg } from '@/utils/TableUtils';
14
+ import { getEmployeeId } from '@/utils/LocalstorageUtils';
15
+ // import { getCurrentTargetBgId } from '@/utils/LocalstorageUtils';
16
+
17
+ function handleSelectColumn(c: any, parentProps: any) {
18
+ let result = c;
19
+ const showColumns = parentProps?.showColumns || [];
20
+ const exceptColumns = parentProps?.exceptColumns || [];
21
+ const coverColumns = parentProps?.coverColumns || [];
22
+ const additionColumns = parentProps?.additionColumns || [];
23
+ // 仅展示内容
24
+ if(showColumns?.length) {
25
+ result = result.filter((i: any) => showColumns.includes(i.dataIndex))
26
+ }
27
+ // 过滤不需要展示内容
28
+ if(exceptColumns?.length) {
29
+ result = result.filter((i: any) => !exceptColumns.includes(i.dataIndex))
30
+ }
31
+ // 追加(最好不用这个,当组件不固定时候会有影响)
32
+ if(additionColumns?.length) {
33
+ additionColumns.forEach((i: any) => {
34
+ result.splice(i.position,0,i.column)
35
+ })
36
+ }
37
+ // 覆盖内容
38
+ if(coverColumns?.length) {
39
+ result = coverColumns;
40
+ }
41
+ return result
42
+ }
43
+ function handleSearchForm(c: any, parentProps: any) {
44
+ let result = c;
45
+ const showTableSearchForm = parentProps?.showTableSearchForm || [];
46
+ const exceptTableSearchForm= parentProps?.exceptTableSearchForm|| [];
47
+ const coverTableSearchForm = parentProps?.coverTableSearchForm || [];
48
+ // 仅展示内容
49
+ if(showTableSearchForm?.length) {
50
+ result = result.filter((i: any) => showTableSearchForm.includes(i.name))
51
+ }
52
+ // 过滤不需要展示内容
53
+ if(exceptTableSearchForm?.length) {
54
+ result = result.filter((i: any) => !exceptTableSearchForm.includes(i.name))
55
+ }
56
+ // 覆盖内容
57
+ if(coverTableSearchForm?.length) {
58
+ result = coverTableSearchForm;
59
+ }
60
+ return result;
61
+ }
62
+ function handleFormSearchSourceLoad(c: any, parentProps: any) {
63
+ let result = c;
64
+ const showTableFormSearchSourceLoad = parentProps?.showTableFormSearchSourceLoad || [];
65
+ const exceptTableFormSearchSourceLoad= parentProps?.exceptTableFormSearchSourceLoad|| [];
66
+ const coverTableFormSearchSourceLoad = parentProps?.coverTableFormSearchSourceLoad || [];
67
+ const noNeedTableFormSearchSourceLoad = parentProps?.noNeedTableFormSearchSourceLoad
68
+ // 仅展示内容
69
+ if(showTableFormSearchSourceLoad?.length) {
70
+ result = result.filter((i: any) => showTableFormSearchSourceLoad.includes(i.url))
71
+ }
72
+ // 过滤不需要展示内容
73
+ if(exceptTableFormSearchSourceLoad?.length) {
74
+ result = result.filter((i: any) => !exceptTableFormSearchSourceLoad.includes(i.url))
75
+ }
76
+ // 覆盖内容
77
+ if(coverTableFormSearchSourceLoad?.length) {
78
+ result = coverTableFormSearchSourceLoad;
79
+ }
80
+ // 不需要默认请求
81
+ if(noNeedTableFormSearchSourceLoad) {
82
+ result = [];
83
+ }
84
+ return result;
85
+ }
86
+
87
+ export const AddSkuSelect = (parProps: any) => {
88
+ const selectProps = {
89
+ mode: 'multiple',
90
+ }
91
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
92
+ const isNoUseItemBarcode = parProps?.noUseItemEancode !== undefined ? parProps?.noUseItemEancode : true; // 默认不加商品条码,兼容老项目
93
+ //注⚠️:自定义过表头的请记得传tableCodeList参数
94
+ const initialSelectColumn = [
95
+ {
96
+ title: 'SKU编码',
97
+ width: 150,
98
+ dataIndex: 'skuCode',
99
+ },
100
+ ...(isNoUseItemBarcode ? [] : [
101
+ {
102
+ title: '商品条码',
103
+ width: 100,
104
+ ellipsis: {
105
+ showTitle: false,
106
+ },
107
+ dataIndex: 'itemEancode',
108
+ render: (text: any) => (
109
+ <Tooltip placement="topLeft" title={text}>
110
+ {text}
111
+ </Tooltip>
112
+ ),
113
+ }
114
+ ]),
115
+ {
116
+ title: 'SKU名称',
117
+ width: 200,
118
+ ellipsis: {
119
+ showTitle: false,
120
+ },
121
+ render: (text: any) => (
122
+ <Tooltip placement="topLeft" title={text}>
123
+ {text}
124
+ </Tooltip>
125
+ ),
126
+ dataIndex: 'name',
127
+ },
128
+ {
129
+ title: '图片',
130
+ dataIndex: 'itemUrl',
131
+ width: 200,
132
+ ellipsis: {
133
+ showTitle: false,
134
+ },
135
+ render: (text: any,record: any) => (
136
+ <Tooltip placement="topLeft" title={text}>
137
+ {tableColumnsImage(getSkuImg(record),{ width: 28, height: 28 })}
138
+ </Tooltip>
139
+ ),
140
+ },
141
+ {
142
+ title: '数量',
143
+ width: 100,
144
+ isInputItem: true,
145
+ dataIndex: 'count',
146
+ },
147
+ {
148
+ title: '单位',
149
+ dataIndex: 'selectUnitCode',
150
+ width: 80,
151
+ ellipsis: {
152
+ showTitle: false,
153
+ },
154
+ render: (text: any, record: any) => {
155
+ if (record?.packingUnitList?.length) {
156
+ const basePackUnit = record?.packingUnitList[0]
157
+ record.selectUnitCode = basePackUnit.unitCode
158
+ return basePackUnit.name || basePackUnit.unitCode
159
+ }
160
+
161
+
162
+ return <></>
163
+ },
164
+ },
165
+ {
166
+ title: '所属SPU编码',
167
+ width: 150,
168
+ ellipsis: {
169
+ showTitle: false,
170
+ },
171
+ dataIndex: 'itemCode',
172
+ render: (text: any) => (
173
+ <Tooltip placement="topLeft" title={text}>
174
+ {text}
175
+ </Tooltip>
176
+ ),
177
+ },
178
+ {
179
+ title: '规格',
180
+ width: 200,
181
+ ellipsis: {
182
+ showTitle: false,
183
+ },
184
+ render: (text: any) => (
185
+ <Tooltip placement="topLeft" title={text}>
186
+ {text}
187
+ </Tooltip>
188
+ ),
189
+ dataIndex: 'propertyNameAndValue',
190
+ }
191
+ ]
192
+ const mTpSelectColumn = handleSelectColumn(initialSelectColumn, parProps);
193
+ const initialTableColumn = [
194
+ {
195
+ title: 'SKU编码',
196
+ width: 150,
197
+ dataIndex: 'skuCode',
198
+ },
199
+ {
200
+ title: 'SKU名称',
201
+ width: 200,
202
+ ellipsis: {
203
+ showTitle: false,
204
+ },
205
+ render: (text: any) => (
206
+ <Tooltip placement="topLeft" title={text}>
207
+ {text}
208
+ </Tooltip>
209
+ ),
210
+ dataIndex: 'name',
211
+ },
212
+ {
213
+ title: '图片',
214
+ dataIndex: 'itemUrl',
215
+ width: 200,
216
+ ellipsis: {
217
+ showTitle: false,
218
+ },
219
+ render: (text: any,record: any) => (
220
+ <Tooltip placement="topLeft" title={text}>
221
+ {tableColumnsImage(getSkuImg(record),{ width: 20, height: 20 })}
222
+ </Tooltip>
223
+ ),
224
+ },
225
+ ...(isNoUseItemBarcode ? []: [
226
+ {
227
+ title: '商品条码',
228
+ width: 100,
229
+ ellipsis: {
230
+ showTitle: false,
231
+ },
232
+ dataIndex: 'itemEancode',
233
+ render: (text: any) => (
234
+ <Tooltip placement="topLeft" title={text}>
235
+ {text}
236
+ </Tooltip>
237
+ ),
238
+ }
239
+ ]),
240
+ {
241
+ title: '所属SPU名称',
242
+ width: 100,
243
+ ellipsis: {
244
+ showTitle: false,
245
+ },
246
+ dataIndex: 'itemName',
247
+ render: (text: any) => (
248
+ <Tooltip placement="topLeft" title={text}>
249
+ {text}
250
+ </Tooltip>
251
+ ),
252
+ },
253
+ {
254
+ title: '所属SPU编码',
255
+ width: 100,
256
+ ellipsis: {
257
+ showTitle: false,
258
+ },
259
+ dataIndex: 'itemCode',
260
+ render: (text: any) => (
261
+ <Tooltip placement="topLeft" title={text}>
262
+ {text}
263
+ </Tooltip>
264
+ ),
265
+ },
266
+ {
267
+ title: '外部编码',
268
+ width: 100,
269
+ ellipsis: {
270
+ showTitle: false,
271
+ },
272
+ render: (text: any) => (
273
+ <Tooltip placement="topLeft" title={text}>
274
+ {text}
275
+ </Tooltip>
276
+ ),
277
+ dataIndex: 'externalCode',
278
+ },
279
+ {
280
+ title: '规格',
281
+ width: 100,
282
+ ellipsis: {
283
+ showTitle: false,
284
+ },
285
+ render: (text: any) => (
286
+ <Tooltip placement="topLeft" title={text}>
287
+ {text}
288
+ </Tooltip>
289
+ ),
290
+ dataIndex: 'propertyNameAndValue',
291
+ },
292
+ {
293
+ title: '类目',
294
+ width: 100,
295
+ ellipsis: {
296
+ showTitle: false,
297
+ },
298
+ render: (text: any) => (
299
+ <Tooltip placement="topLeft" title={text}>
300
+ {text}
301
+ </Tooltip>
302
+ ),
303
+ dataIndex: 'categoryName',
304
+ },
305
+ {
306
+ title: '品类',
307
+ width: 100,
308
+ ellipsis: {
309
+ showTitle: false,
310
+ },
311
+ render: (text: any) => (
312
+ <Tooltip placement="topLeft" title={text}>
313
+ {text}
314
+ </Tooltip>
315
+ ),
316
+ dataIndex: 'className',
317
+ },
318
+ {
319
+ title: '品牌',
320
+ width: 100,
321
+ ellipsis: {
322
+ showTitle: false,
323
+ },
324
+ render: (text: any) => (
325
+ <Tooltip placement="topLeft" title={text}>
326
+ {text}
327
+ </Tooltip>
328
+ ),
329
+ dataIndex: 'brandName',
330
+ },
331
+ ]
332
+ const mTpTableColumn = handleSelectColumn(initialTableColumn, parProps);
333
+ const initialTableSearchForm = [
334
+ {
335
+ name: 'qp-skuCode-like', label: 'SKU编码'
336
+ },
337
+ { name: 'qp-skuName-like', label: 'SKU名称' },
338
+ ...(isNoUseItemBarcode ? []: [
339
+ { name: 'qp-code-in', label: '商品条码', field: {
340
+ type: 'multipleQueryInput',
341
+ props: {
342
+ ...(parProps.requestConfig?.itemEancodeValueRequestConfig || {}),
343
+ },
344
+ }}
345
+ ]),
346
+ { name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
347
+ type: 'select',
348
+ props: {
349
+ mode: 'multiple',
350
+ notFoundContent: '暂无数据',
351
+ allowClear: true,
352
+ showSearch: true,
353
+ showArrow: true,
354
+ maxTagCount: 1,
355
+ optionFilterProp: 'children',
356
+ filterOption: (input: string, option: { props: { children: string } }) =>
357
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
358
+ },
359
+ } },
360
+ { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
361
+ type: 'treeSelect',
362
+ props: {
363
+ treeData: [],
364
+ treeCheckable: true,
365
+ showSearch: true,
366
+ allowClear: true,
367
+ showArrow: true,
368
+ treeNodeFilterProp: 'title',
369
+ treeDefaultExpandAll: true,
370
+ maxTagCount: 1,
371
+ placeholder: '请选择',
372
+ style: {
373
+ width: '100%',
374
+ },
375
+ dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
376
+ },
377
+ } },
378
+ ...(parProps?.addTableSearchForm||[])
379
+ ]
380
+ const mTpTableSearchForm = handleSearchForm(initialTableSearchForm, parProps);
381
+ const initialPromiseLoadList = [
382
+ {
383
+ url: `/items/brand/queryBrandList`,
384
+ params: {
385
+ pageSize: 5000,
386
+ currentPage: 1,
387
+ 'ctl-withAuth': true
388
+ },
389
+ resType: 'list',
390
+ resPosition: isNoUseItemBarcode ? 2 : 3,
391
+ resKeyValue: ['id','name']
392
+ },
393
+ {
394
+ url: `/items/category/queryCategoryTree`,
395
+ params: {
396
+ pageSize: 5000,
397
+ currentPage: 1,
398
+ },
399
+ resType: 'treeList',
400
+ resPosition: isNoUseItemBarcode ? 3 : 4
401
+ },
402
+ ]
403
+ const mTpPromiseLoadList = handleFormSearchSourceLoad(initialPromiseLoadList, parProps);
404
+ const props = {
405
+ buttonText: parProps.buttonText || '新增',
406
+ buttonProps: parProps.buttonProps || {},
407
+ tableCodeList: parProps.tableCodeList || [],
408
+ value,
409
+ // labelInValue: true, // 非必填 默认为false
410
+ requestConfig: {
411
+ url: `/items/sku/pager/v2`,
412
+ filter: 'qp-name-like', // 过滤参数 支持'qp-name-like'和['qp-name-like', 'qp-code-like']两种结构
413
+ otherParams: {
414
+ 'qp-combination-eq': false,
415
+ 'qp-approveStatus-eq': 1,
416
+ 'qp-status-eq': 1,
417
+ // 'useOrgSign': getCurrentTargetBgId(), // 根据品牌、账号授权的组织+商品授权使用组织做权限过滤 这个交给业务使用的地方去做,传addOtherParams:{useOrgSign:单据中所选组织}
418
+ ...(parProps?.requestConfig?.addOtherParams || {}), // 允许在默认参数基础上,追加/覆盖已有 参数
419
+ }, // 默认参数
420
+ mappingTextField: 'name',
421
+ mappingValueField: 'skuCode',
422
+ ...parProps.requestConfig
423
+ },
424
+ selectProps,
425
+ onChange: (value: any) => {
426
+ console.log(value)
427
+ setValue(value)
428
+ },
429
+ beforeShowModal: parProps?.beforeShowModal,
430
+ onSaveCallback: parProps.onSaveCallback,
431
+ businessType: 'sku',
432
+ isAllowRepeatedSelect: !!parProps?.isAllowRepeatedSelect,
433
+ };
434
+ const modalTableProps = {
435
+ modalTableTitle: '选择商品',
436
+ tableSearchForm: mTpTableSearchForm,
437
+ tableColumns: mTpTableColumn,
438
+ selectColumn: mTpSelectColumn,
439
+ promiseLoadList: mTpPromiseLoadList,
440
+ }
441
+
442
+ return (
443
+ <div>
444
+ <AddSelect
445
+ {...props}
446
+ modalTableProps={modalTableProps}
447
+ />
448
+ </div>
449
+ );
450
+ };
451
+
452
+ export const AddSkcSelect = (parProps: any) => {
453
+ const selectProps = {
454
+ mode: 'multiple',
455
+ }
456
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
457
+ const [propertyList, setPropertyList] = useState([]);
458
+
459
+ useEffect(() => {
460
+ // type: 1 尺码组; 2 配码组
461
+ axios.get(`/items/itemPropertyValueGroup/listNoPage?qp-type-eq=2&qp-status-eq=1`).then((result: any) => {
462
+ result = result.data;
463
+ if ((result?.status && result.status !== '0') || (result?.code && result.code !== '000000')) {
464
+ message.error(result.msg);
465
+ return;
466
+ }
467
+ const data = result.data || [];
468
+ setPropertyList(data)
469
+ }).catch((err) => {});
470
+ },[])
471
+
472
+ //注⚠️:自定义过表头的请记得传tableCodeList参数
473
+ const initialSelectColumn = [
474
+ {
475
+ title: 'SKC编码',
476
+ width: 150,
477
+ dataIndex: 'code',
478
+ },
479
+ {
480
+ title: 'SKC名称',
481
+ width: 200,
482
+ ellipsis: {
483
+ showTitle: false,
484
+ },
485
+ render: (text: any) => (
486
+ <Tooltip placement="topLeft" title={text}>
487
+ {text}
488
+ </Tooltip>
489
+ ),
490
+ dataIndex: 'name',
491
+ },
492
+ {
493
+ title: '颜色',
494
+ width: 200,
495
+ ellipsis: {
496
+ showTitle: false,
497
+ },
498
+ render: (text: any) => (
499
+ <Tooltip placement="topLeft" title={text}>
500
+ {text}
501
+ </Tooltip>
502
+ ),
503
+ dataIndex: 'colorName',
504
+ },
505
+ {
506
+ title: '配码',
507
+ dataIndex: 'selectPropertyGroupCode',
508
+ width: 160,
509
+ isSelectItem: true,
510
+ dataSource: propertyList,
511
+ },
512
+ {
513
+ title: '数量',
514
+ width: 100,
515
+ isInputItem: true,
516
+ dataIndex: 'count',
517
+ },
518
+ ]
519
+ const mTpSelectColumn = handleSelectColumn(initialSelectColumn, parProps)
520
+ const initialPromiseLoadList = [
521
+ {
522
+ url: `/items/item/propertyValue/sizeBySkcConfig`,
523
+ params: {
524
+ pageSize: 10000,
525
+ currentPage: 1,
526
+ type: 2, // 类型:1尺码;2颜色
527
+ },
528
+ resType: 'list',
529
+ resPosition: 3,
530
+ resKeyValue: ['value','value']
531
+ },
532
+ {
533
+ url: `/items/category/queryCategoryTree`,
534
+ params: {
535
+ pageSize: 5000,
536
+ currentPage: 1,
537
+ },
538
+ resType: 'treeList',
539
+ resPosition: 4,
540
+ },
541
+ {
542
+ url: `/items/class/withProperty`,
543
+ params: {
544
+ pageSize: 5000,
545
+ currentPage: 1,
546
+ },
547
+ resType: 'list',
548
+ resPosition: 5,
549
+ resKeyValue: ['id','name']
550
+ },
551
+ {
552
+ url: `/items/brand/queryBrandList`,
553
+ params: {
554
+ pageSize: 5000,
555
+ currentPage: 1,
556
+ 'ctl-withAuth': true
557
+ },
558
+ resType: 'list',
559
+ resPosition: 6,
560
+ resKeyValue: ['id','name']
561
+ },
562
+ ]
563
+ const props = {
564
+ buttonText: parProps.buttonText || '新增',
565
+ buttonProps: parProps.buttonProps || {},
566
+ tableCodeList: parProps.tableCodeList || ['skcSelect-tableOptionsToChoosePartCode','skcSelect-tableSelectedItemPartCode'],
567
+ value,
568
+ // labelInValue: true, // 非必填 默认为false
569
+ requestConfig: {
570
+ url: `/items/skc/skcSelect`,
571
+ filter: 'qp-name-like', // 过滤参数 支持'qp-name-like'和['qp-name-like', 'qp-code-like']两种结构
572
+ otherParams: {
573
+ 'qp-skcStatus-eq': 1,
574
+ ...(parProps?.requestConfig?.addOtherParams || {}), // 允许在默认参数基础上,追加/覆盖已有 参数
575
+ }, // 默认参数
576
+ mappingTextField: 'name',
577
+ mappingValueField: 'code',
578
+ ...parProps.requestConfig
579
+ },
580
+ selectProps,
581
+ onChange: (value: any) => {
582
+ console.log(value)
583
+ setValue(value)
584
+ },
585
+ beforeShowModal: parProps?.beforeShowModal,
586
+ onSaveCallback: parProps.onSaveCallback,
587
+ businessType: 'skc',
588
+ isAllowRepeatedSelect: parProps?.isAllowRepeatedSelect!==undefined ? !!parProps?.isAllowRepeatedSelect : true, // 默认开启一行选多次
589
+ };
590
+ const modalTableProps = {
591
+ modalTableTitle: '选择商品',
592
+ tableSearchForm: [
593
+ { name: 'qp-code-like', label: 'SKC编码' },
594
+ { name: 'qp-skcName-like', label: 'SKC名称' },
595
+ { name: 'qp-itemName-like', label: '商品名称' },
596
+ { name: 'qp-colorName-in', type: 'select', label: '颜色', field: {
597
+ type: 'select',
598
+ props: {
599
+ mode: 'multiple',
600
+ notFoundContent: '暂无数据',
601
+ allowClear: true,
602
+ showSearch: true,
603
+ showArrow: true,
604
+ maxTagCount: 1,
605
+ optionFilterProp: 'children',
606
+ filterOption: (input: string, option: { props: { children: string } }) =>
607
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
608
+ },
609
+ } },
610
+ { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
611
+ type: 'treeSelect',
612
+ props: {
613
+ treeData: [],
614
+ treeCheckable: true,
615
+ showSearch: true,
616
+ allowClear: true,
617
+ showArrow: true,
618
+ treeNodeFilterProp: 'title',
619
+ treeDefaultExpandAll: true,
620
+ maxTagCount: 1,
621
+ placeholder: '请选择',
622
+ style: {
623
+ width: '100%',
624
+ },
625
+ dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
626
+ },
627
+ } },
628
+ { name: 'qp-classId-in', type: 'select', label: '品类', field: {
629
+ type: 'select',
630
+ props: {
631
+ mode: 'multiple',
632
+ notFoundContent: '暂无数据',
633
+ allowClear: true,
634
+ showSearch: true,
635
+ showArrow: true,
636
+ maxTagCount: 1,
637
+ optionFilterProp: 'children',
638
+ filterOption: (input: string, option: { props: { children: string } }) =>
639
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
640
+ },
641
+ } },
642
+ { name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
643
+ type: 'select',
644
+ props: {
645
+ mode: 'multiple',
646
+ notFoundContent: '暂无数据',
647
+ allowClear: true,
648
+ showSearch: true,
649
+ showArrow: true,
650
+ maxTagCount: 1,
651
+ optionFilterProp: 'children',
652
+ filterOption: (input: string, option: { props: { children: string } }) =>
653
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
654
+ },
655
+ } },
656
+ ],
657
+ tableColumns: [
658
+ {
659
+ title: 'SKC编码',
660
+ width: 150,
661
+ dataIndex: 'code',
662
+ },
663
+ {
664
+ title: 'SKC名称',
665
+ width: 200,
666
+ ellipsis: {
667
+ showTitle: false,
668
+ },
669
+ render: (text: any) => (
670
+ <Tooltip placement="topLeft" title={text}>
671
+ {text}
672
+ </Tooltip>
673
+ ),
674
+ dataIndex: 'name',
675
+ },
676
+ {
677
+ title: '商品名称',
678
+ width: 100,
679
+ ellipsis: {
680
+ showTitle: false,
681
+ },
682
+ dataIndex: 'itemName',
683
+ render: (text: any) => (
684
+ <Tooltip placement="topLeft" title={text}>
685
+ {text}
686
+ </Tooltip>
687
+ ),
688
+ },
689
+ {
690
+ title: '颜色',
691
+ width: 100,
692
+ ellipsis: {
693
+ showTitle: false,
694
+ },
695
+ render: (text: any) => (
696
+ <Tooltip placement="topLeft" title={text}>
697
+ {text}
698
+ </Tooltip>
699
+ ),
700
+ dataIndex: 'colorName',
701
+ },
702
+ {
703
+ title: '类目',
704
+ width: 100,
705
+ ellipsis: {
706
+ showTitle: false,
707
+ },
708
+ render: (text: any) => (
709
+ <Tooltip placement="topLeft" title={text}>
710
+ {text}
711
+ </Tooltip>
712
+ ),
713
+ dataIndex: 'categoryName',
714
+ },
715
+ {
716
+ title: '品类',
717
+ width: 100,
718
+ ellipsis: {
719
+ showTitle: false,
720
+ },
721
+ render: (text: any) => (
722
+ <Tooltip placement="topLeft" title={text}>
723
+ {text}
724
+ </Tooltip>
725
+ ),
726
+ dataIndex: 'className',
727
+ },
728
+ {
729
+ title: '品牌',
730
+ width: 100,
731
+ ellipsis: {
732
+ showTitle: false,
733
+ },
734
+ render: (text: any) => (
735
+ <Tooltip placement="topLeft" title={text}>
736
+ {text}
737
+ </Tooltip>
738
+ ),
739
+ dataIndex: 'brandName',
740
+ },
741
+ ],
742
+ selectColumn: mTpSelectColumn,
743
+ promiseLoadList: initialPromiseLoadList
744
+ }
745
+
746
+ return (
747
+ <div>
748
+ <AddSelect
749
+ {...props}
750
+ modalTableProps={modalTableProps}
751
+ />
752
+ </div>
753
+ );
754
+ };
755
+
756
+ export const AddSpuSelect = (parProps: any) => {
757
+ const selectProps = {
758
+ mode: 'multiple',
759
+ }
760
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
761
+ const [propertyList, setPropertyList] = useState([]);
762
+
763
+ useEffect(() => {
764
+ if(parProps?.isSingleColor) {
765
+ // type: 1 尺码组; 2 配码组
766
+ axios.get(`/items/itemPropertyValueGroup/listNoPage?qp-type-eq=2&qp-status-eq=1`).then((result: any) => {
767
+ result = result.data;
768
+ if ((result?.status && result.status !== '0') || (result?.code && result.code !== '000000')) {
769
+ message.error(result.msg);
770
+ return;
771
+ }
772
+ const data = result.data || [];
773
+ setPropertyList(data)
774
+ }).catch((err) => {});
775
+ }
776
+ },[])
777
+
778
+ //注⚠️:自定义过表头的请记得传tableCodeList参数
779
+ const initialSelectColumn = [
780
+ {
781
+ title: '商品编码',
782
+ width: 150,
783
+ dataIndex: 'itemCode',
784
+ },
785
+ {
786
+ title: '商品名称',
787
+ width: 200,
788
+ ellipsis: {
789
+ showTitle: false,
790
+ },
791
+ render: (text: any) => (
792
+ <Tooltip placement="topLeft" title={text}>
793
+ {text}
794
+ </Tooltip>
795
+ ),
796
+ dataIndex: 'name',
797
+ },
798
+ {
799
+ title: '颜色',
800
+ dataIndex: 'colorName',
801
+ width: 200,
802
+ isSelectItem: true,
803
+ dataSourceCode: 'colorValues',
804
+ dataSourceMapping: ['value', 'value']
805
+ },
806
+ {
807
+ title: '配码',
808
+ dataIndex: 'selectPropertyGroupCode',
809
+ width: 160,
810
+ isSelectItem: true,
811
+ dataSource: propertyList,
812
+ filterDataSourceCode: 'matchingCodes',
813
+ },
814
+ {
815
+ title: '数量',
816
+ width: 100,
817
+ isInputItem: true,
818
+ dataIndex: 'count',
819
+ },
820
+ {
821
+ title: '所属组织',
822
+ dataIndex: 'ownOrgSignName',
823
+ },
824
+ {
825
+ title: '品牌',
826
+ dataIndex: 'brandName',
827
+ },
828
+ {
829
+ title: '类目',
830
+ dataIndex: 'categoryText',
831
+ },
832
+ {
833
+ title: '品类',
834
+ dataIndex: 'className',
835
+ },
836
+ ]
837
+ const mTpSelectColumn = handleSelectColumn(initialSelectColumn, parProps)
838
+ const initialPromiseLoadList = [
839
+ {
840
+ url: `/user/orgViewNode/listNoPage`,
841
+ params: {
842
+ 'qp-employeeId-eq': getEmployeeId(),
843
+ 'qp-orgViewCode-eq': 'business-organizational-view',
844
+ 'ctl-withDefaultOrg': true,
845
+ },
846
+ resType: 'list',
847
+ resPosition: 2,
848
+ resKeyValue: ['targetId','name']
849
+ },
850
+ {
851
+ url: `/items/brand/queryBrandList`,
852
+ params: {
853
+ pageSize: 5000,
854
+ currentPage: 1,
855
+ 'ctl-withAuth': true
856
+ },
857
+ resType: 'list',
858
+ resPosition: 3,
859
+ resKeyValue: ['id','name']
860
+ },
861
+ {
862
+ url: `/items/category/queryCategoryTree`,
863
+ params: {
864
+ pageSize: 5000,
865
+ currentPage: 1,
866
+ },
867
+ resType: 'treeList',
868
+ resPosition: 4,
869
+ },
870
+ {
871
+ url: `/items/class/withProperty`,
872
+ params: {
873
+ pageSize: 5000,
874
+ currentPage: 1,
875
+ },
876
+ resType: 'list',
877
+ resPosition: 5,
878
+ resKeyValue: ['id','name']
879
+ },
880
+ ]
881
+ const props = {
882
+ buttonText: parProps.buttonText || '新增',
883
+ buttonProps: parProps.buttonProps || {},
884
+ tableCodeList: parProps.tableCodeList || [],
885
+ value,
886
+ // labelInValue: true, // 非必填 默认为false
887
+ requestConfig: {
888
+ url: `/items/item`,
889
+ filter: 'qp-itemCode,name-orGroup,like', // 过滤参数
890
+ otherParams: {
891
+ 'qp-approveStatus-eq': 1, // 审核状态(0.待审批;1.审批通过;2.驳回;3.审批未通过)
892
+ 'qp-status-eq': 1,
893
+ sorter: 'desc-id',
894
+ ...(parProps?.requestConfig?.addOtherParams || {}), // 允许在默认参数基础上,追加/覆盖已有 参数
895
+ }, // 默认参数
896
+ mappingTextField: 'name',
897
+ mappingValueField: 'itemCode',
898
+ ...parProps.requestConfig
899
+ },
900
+ selectProps,
901
+ onChange: (value: any) => {
902
+ console.log(value)
903
+ setValue(value)
904
+ },
905
+ beforeShowModal: parProps?.beforeShowModal,
906
+ onSaveCallback: parProps.onSaveCallback,
907
+ businessType: 'spu',
908
+ isAllowRepeatedSelect: !!parProps?.isAllowRepeatedSelect,
909
+ };
910
+ const modalTableProps = {
911
+ modalTableTitle: '选择商品',
912
+ tableSearchForm: [
913
+ { name: 'qp-itemCode-like', label: '商品编码' },
914
+ { name: 'qp-name-like', label: '商品名称' },
915
+ { name: 'qp-ownOrgSign-in', type: 'select', label: '所属组织', field: {
916
+ type: 'select',
917
+ props: {
918
+ mode: 'multiple',
919
+ notFoundContent: '暂无数据',
920
+ allowClear: true,
921
+ showSearch: true,
922
+ showArrow: true,
923
+ maxTagCount: 1,
924
+ optionFilterProp: 'children',
925
+ filterOption: (input: string, option: { props: { children: string } }) =>
926
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
927
+ },
928
+ } },
929
+ { name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
930
+ type: 'select',
931
+ props: {
932
+ mode: 'multiple',
933
+ notFoundContent: '暂无数据',
934
+ allowClear: true,
935
+ showSearch: true,
936
+ showArrow: true,
937
+ maxTagCount: 1,
938
+ optionFilterProp: 'children',
939
+ filterOption: (input: string, option: { props: { children: string } }) =>
940
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
941
+ },
942
+ } },
943
+ { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
944
+ type: 'treeSelect',
945
+ props: {
946
+ treeData: [],
947
+ treeCheckable: true,
948
+ showSearch: true,
949
+ allowClear: true,
950
+ showArrow: true,
951
+ treeNodeFilterProp: 'title',
952
+ treeDefaultExpandAll: true,
953
+ maxTagCount: 1,
954
+ placeholder: '请选择',
955
+ style: {
956
+ width: '100%',
957
+ },
958
+ dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
959
+ },
960
+ } },
961
+ { name: 'qp-classId-in', type: 'select', label: '品类', field: {
962
+ type: 'select',
963
+ props: {
964
+ mode: 'multiple',
965
+ notFoundContent: '暂无数据',
966
+ allowClear: true,
967
+ showSearch: true,
968
+ showArrow: true,
969
+ maxTagCount: 1,
970
+ optionFilterProp: 'children',
971
+ filterOption: (input: string, option: { props: { children: string } }) =>
972
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
973
+ },
974
+ } },
975
+ ],
976
+ tableColumns: [
977
+ {
978
+ title: '商品编码',
979
+ width: 150,
980
+ dataIndex: 'itemCode',
981
+ },
982
+ {
983
+ title: '商品名称',
984
+ width: 200,
985
+ ellipsis: {
986
+ showTitle: false,
987
+ },
988
+ render: (text: any) => (
989
+ <Tooltip placement="topLeft" title={text}>
990
+ {text}
991
+ </Tooltip>
992
+ ),
993
+ dataIndex: 'name',
994
+ },
995
+ {
996
+ title: '所属组织',
997
+ width: 100,
998
+ ellipsis: {
999
+ showTitle: false,
1000
+ },
1001
+ render: (text: any) => (
1002
+ <Tooltip placement="topLeft" title={text}>
1003
+ {text}
1004
+ </Tooltip>
1005
+ ),
1006
+ dataIndex: 'ownOrgSignName',
1007
+ },
1008
+ {
1009
+ title: '品牌',
1010
+ width: 100,
1011
+ ellipsis: {
1012
+ showTitle: false,
1013
+ },
1014
+ render: (text: any) => (
1015
+ <Tooltip placement="topLeft" title={text}>
1016
+ {text}
1017
+ </Tooltip>
1018
+ ),
1019
+ dataIndex: 'brandName',
1020
+ },
1021
+ {
1022
+ title: '类目',
1023
+ width: 100,
1024
+ ellipsis: {
1025
+ showTitle: false,
1026
+ },
1027
+ render: (text: any) => (
1028
+ <Tooltip placement="topLeft" title={text}>
1029
+ {text}
1030
+ </Tooltip>
1031
+ ),
1032
+ dataIndex: 'categoryName',
1033
+ },
1034
+ {
1035
+ title: '品类',
1036
+ width: 100,
1037
+ ellipsis: {
1038
+ showTitle: false,
1039
+ },
1040
+ render: (text: any) => (
1041
+ <Tooltip placement="topLeft" title={text}>
1042
+ {text}
1043
+ </Tooltip>
1044
+ ),
1045
+ dataIndex: 'className',
1046
+ },
1047
+ ],
1048
+ selectColumn: mTpSelectColumn,
1049
+ promiseLoadList: initialPromiseLoadList
1050
+ }
1051
+
1052
+ return (
1053
+ <div>
1054
+ <AddSelect
1055
+ {...props}
1056
+ modalTableProps={modalTableProps}
1057
+ />
1058
+ </div>
1059
+ );
1060
+ };