@bit-sun/business-component 2.3.18 → 2.3.20

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 (210) hide show
  1. package/.editorconfig +16 -16
  2. package/.fatherrc.ts +5 -5
  3. package/.gitlab-ci.yml +179 -179
  4. package/.prettierignore +7 -7
  5. package/.prettierrc +11 -11
  6. package/.umirc.ts +74 -74
  7. package/README.md +27 -27
  8. package/dist/components/Business/BsLayouts/Components/AllFunc/drawContent.d.ts +1 -1
  9. package/dist/components/Business/BsLayouts/Components/AllFunc/index.d.ts +1 -1
  10. package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.d.ts +1 -1
  11. package/dist/components/Business/BsLayouts/Components/CustomerMenu/index.d.ts +1 -1
  12. package/dist/components/Business/BsLayouts/Components/RightContent/index.d.ts +2 -2
  13. package/dist/components/Business/BsLayouts/Components/SearchFunc/index.d.ts +2 -2
  14. package/dist/components/Business/BsLayouts/index.d.ts +2 -2
  15. package/dist/components/Business/BsSulaQueryTable/utils.d.ts +2 -2
  16. package/dist/components/Business/SearchSelect/index.d.ts +1 -1
  17. package/dist/components/Business/moreTreeTable/FixedScrollBar.d.ts +1 -1
  18. package/dist/components/Functional/BsAntdSula/BsCascader/index.d.ts +1 -1
  19. package/dist/components/Functional/SearchSelect/index.d.ts +1 -1
  20. package/dist/index.esm.js +994 -932
  21. package/dist/index.js +993 -931
  22. package/dist/utils/LocalstorageUtils.d.ts +1 -0
  23. package/dist/utils/TableUtils.d.ts +2 -2
  24. package/dist/utils/utils.d.ts +1 -1
  25. package/docs/index.md +21 -21
  26. package/lib/assets/drag.svg +17 -17
  27. package/lib/assets/exportFail.svg +37 -37
  28. package/lib/assets/exportProcessing.svg +28 -28
  29. package/lib/assets/exportSuccess.svg +34 -34
  30. package/lib/assets/label_icon_bottom.svg +25 -25
  31. package/lib/assets/upExport.svg +22 -22
  32. package/package.json +78 -78
  33. package/src/assets/32.svg +27 -27
  34. package/src/assets/addIcon.svg +17 -17
  35. package/src/assets/allfunc.svg +27 -27
  36. package/src/assets/arrowRight.svg +24 -24
  37. package/src/assets/btn-delete.svg +29 -29
  38. package/src/assets/btn-edit.svg +19 -19
  39. package/src/assets/btn-more.svg +17 -17
  40. package/src/assets/btn-submit.svg +19 -19
  41. package/src/assets/caidan.svg +11 -11
  42. package/src/assets/close.svg +26 -26
  43. package/src/assets/drag.svg +17 -17
  44. package/src/assets/exportFail.svg +37 -37
  45. package/src/assets/exportProcessing.svg +28 -28
  46. package/src/assets/exportSuccess.svg +34 -34
  47. package/src/assets/fixed-left-active.svg +11 -11
  48. package/src/assets/fixed-left.svg +15 -15
  49. package/src/assets/fixed-right-active.svg +11 -11
  50. package/src/assets/fixed-right.svg +15 -15
  51. package/src/assets/guanbi.svg +15 -15
  52. package/src/assets/icon-quanping.svg +15 -15
  53. package/src/assets/icon-shezhi.svg +17 -17
  54. package/src/assets/label_icon_bottom.svg +25 -25
  55. package/src/assets/list-no-img.svg +21 -21
  56. package/src/assets/morentouxiang-32.svg +23 -23
  57. package/src/assets/scanning.svg +24 -24
  58. package/src/assets/upExport.svg +22 -22
  59. package/src/common/ENUM.ts +41 -41
  60. package/src/components/Business/AddSelectBusiness/index.md +162 -161
  61. package/src/components/Business/AddSelectBusiness/index.tsx +895 -861
  62. package/src/components/Business/BsLayouts/Components/AllFunc/drawContent.tsx +111 -111
  63. package/src/components/Business/BsLayouts/Components/AllFunc/index.less +153 -153
  64. package/src/components/Business/BsLayouts/Components/AllFunc/index.tsx +70 -70
  65. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.less +90 -90
  66. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.tsx +37 -37
  67. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/leftTree.tsx +242 -242
  68. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/rightTree.tsx +384 -384
  69. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/DrawContent.tsx +285 -285
  70. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/customMenuHeader.tsx +74 -74
  71. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/drawContent.less +170 -170
  72. package/src/components/Business/BsLayouts/Components/CustomerMenu/index.less +64 -64
  73. package/src/components/Business/BsLayouts/Components/CustomerMenu/index.tsx +153 -153
  74. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.less +72 -72
  75. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.tsx +157 -157
  76. package/src/components/Business/BsLayouts/Components/RightContent/LoginModal.tsx +85 -85
  77. package/src/components/Business/BsLayouts/Components/RightContent/home.less +218 -218
  78. package/src/components/Business/BsLayouts/Components/RightContent/index.tsx +155 -155
  79. package/src/components/Business/BsLayouts/Components/SearchFunc/index.less +160 -160
  80. package/src/components/Business/BsLayouts/Components/SearchFunc/index.tsx +75 -75
  81. package/src/components/Business/BsLayouts/index.less +79 -79
  82. package/src/components/Business/BsLayouts/index.tsx +1484 -1484
  83. package/src/components/Business/BsLayouts/service.ts +10 -10
  84. package/src/components/Business/BsLayouts/utils.tsx +203 -203
  85. package/src/components/Business/BsSulaQueryTable/SearchItemSetting.tsx +564 -564
  86. package/src/components/Business/BsSulaQueryTable/index.less +221 -221
  87. package/src/components/Business/BsSulaQueryTable/index.tsx +535 -535
  88. package/src/components/Business/BsSulaQueryTable/setting.tsx +852 -852
  89. package/src/components/Business/BsSulaQueryTable/utils.less +65 -65
  90. package/src/components/Business/BsSulaQueryTable/utils.tsx +688 -688
  91. package/src/components/Business/CommodityEntry/index.md +70 -70
  92. package/src/components/Business/CommodityEntry/index.tsx +80 -80
  93. package/src/components/Business/CommonAlert/index.tsx +23 -23
  94. package/src/components/Business/CommonGuideWrapper/index.less +111 -111
  95. package/src/components/Business/CommonGuideWrapper/index.md +39 -39
  96. package/src/components/Business/CommonGuideWrapper/index.tsx +83 -83
  97. package/src/components/Business/DetailPageWrapper/index.less +79 -79
  98. package/src/components/Business/DetailPageWrapper/index.tsx +313 -313
  99. package/src/components/Business/DetailPageWrapper/utils.tsx +100 -100
  100. package/src/components/Business/HomePageWrapper/index.less +33 -33
  101. package/src/components/Business/HomePageWrapper/index.md +45 -45
  102. package/src/components/Business/HomePageWrapper/index.tsx +162 -162
  103. package/src/components/Business/JsonQueryTable/components/FieldsModifyModal.tsx +824 -824
  104. package/src/components/Business/JsonQueryTable/components/FieldsSettingsTable.tsx +205 -205
  105. package/src/components/Business/JsonQueryTable/components/Formula.tsx +205 -205
  106. package/src/components/Business/JsonQueryTable/components/MaintainOptions.tsx +127 -127
  107. package/src/components/Business/JsonQueryTable/configButton/index.js +20 -20
  108. package/src/components/Business/JsonQueryTable/configTree/component/compactArrayView.js +25 -25
  109. package/src/components/Business/JsonQueryTable/configTree/component/compactObjectView.js +30 -30
  110. package/src/components/Business/JsonQueryTable/configTree/index.js +82 -82
  111. package/src/components/Business/JsonQueryTable/configTree/index.less +44 -44
  112. package/src/components/Business/JsonQueryTable/configTree/parser/highlight.js +57 -57
  113. package/src/components/Business/JsonQueryTable/configTree/parser/index.js +124 -124
  114. package/src/components/Business/JsonQueryTable/configTree/render/iconRender.js +29 -29
  115. package/src/components/Business/JsonQueryTable/configTree/render/nameRender.js +22 -22
  116. package/src/components/Business/JsonQueryTable/configTree/treeNode.js +116 -116
  117. package/src/components/Business/JsonQueryTable/drawer/index.tsx +12 -12
  118. package/src/components/Business/JsonQueryTable/function.ts +62 -62
  119. package/src/components/Business/JsonQueryTable/index.less +16 -16
  120. package/src/components/Business/JsonQueryTable/index.md +328 -328
  121. package/src/components/Business/JsonQueryTable/index.tsx +535 -535
  122. package/src/components/Business/JsonQueryTable/jsonEditor/index.js +346 -346
  123. package/src/components/Business/JsonQueryTable/jsonEditor/index.less +22 -22
  124. package/src/components/Business/JsonQueryTable/jsonEditor/lint/basicType.js +147 -147
  125. package/src/components/Business/JsonQueryTable/jsonEditor/lint/index.js +389 -389
  126. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/actions.js +118 -118
  127. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/dependency.js +22 -22
  128. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/index.js +21 -21
  129. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/request.js +65 -65
  130. package/src/components/Business/JsonQueryTable/static.ts +390 -390
  131. package/src/components/Business/SearchSelect/BusinessUtils.ts +1762 -1762
  132. package/src/components/Business/SearchSelect/common.ts +75 -75
  133. package/src/components/Business/SearchSelect/index.md +1329 -1329
  134. package/src/components/Business/SearchSelect/index.tsx +55 -52
  135. package/src/components/Business/SearchSelect/utils.ts +100 -100
  136. package/src/components/Business/StateFlow/index.less +130 -130
  137. package/src/components/Business/StateFlow/index.md +60 -60
  138. package/src/components/Business/StateFlow/index.tsx +29 -29
  139. package/src/components/Business/TreeSearchSelect/index.md +156 -156
  140. package/src/components/Business/TreeSearchSelect/index.tsx +33 -33
  141. package/src/components/Business/TreeSearchSelect/utils.ts +75 -75
  142. package/src/components/Business/columnSettingTable/columnSetting.tsx +764 -764
  143. package/src/components/Business/columnSettingTable/index.less +247 -247
  144. package/src/components/Business/columnSettingTable/index.md +357 -357
  145. package/src/components/Business/columnSettingTable/index.tsx +232 -232
  146. package/src/components/Business/columnSettingTable/sulaSettingTable.tsx +240 -240
  147. package/src/components/Business/columnSettingTable/utils.tsx +69 -69
  148. package/src/components/Business/moreTreeTable/FixedScrollBar.tsx +87 -86
  149. package/src/components/Business/moreTreeTable/hooks/useSticky.ts +21 -21
  150. package/src/components/Business/moreTreeTable/index.less +99 -99
  151. package/src/components/Business/moreTreeTable/index.md +448 -448
  152. package/src/components/Business/moreTreeTable/index.tsx +387 -387
  153. package/src/components/Business/moreTreeTable/utils.ts +126 -126
  154. package/src/components/Functional/AddSelect/helps.ts +14 -14
  155. package/src/components/Functional/AddSelect/index.less +367 -367
  156. package/src/components/Functional/AddSelect/index.md +155 -155
  157. package/src/components/Functional/AddSelect/index.tsx +1282 -1279
  158. package/src/components/Functional/BillEntry/index.less +371 -371
  159. package/src/components/Functional/BillEntry/index.md +39 -39
  160. package/src/components/Functional/BillEntry/index.tsx +772 -772
  161. package/src/components/Functional/BsAntdSula/BsCascader/index.md +62 -62
  162. package/src/components/Functional/BsAntdSula/BsCascader/index.tsx +178 -178
  163. package/src/components/Functional/BsAntdSula/index.ts +2 -2
  164. package/src/components/Functional/DataImport/index.less +63 -63
  165. package/src/components/Functional/DataImport/index.md +44 -44
  166. package/src/components/Functional/DataImport/index.tsx +695 -695
  167. package/src/components/Functional/DataValidation/index.less +63 -63
  168. package/src/components/Functional/DataValidation/index.md +39 -39
  169. package/src/components/Functional/DataValidation/index.tsx +687 -687
  170. package/src/components/Functional/EllipsisTooltip/index.d.ts +5 -5
  171. package/src/components/Functional/EllipsisTooltip/index.js +36 -36
  172. package/src/components/Functional/EllipsisTooltip/index.md +30 -30
  173. package/src/components/Functional/ExportFunctions/ExportIcon/index.md +37 -37
  174. package/src/components/Functional/ExportFunctions/ExportIcon/index.tsx +59 -59
  175. package/src/components/Functional/QueryMutipleInput/index.less +37 -37
  176. package/src/components/Functional/QueryMutipleInput/index.md +33 -33
  177. package/src/components/Functional/QueryMutipleInput/index.tsx +128 -128
  178. package/src/components/Functional/SearchSelect/index.less +115 -115
  179. package/src/components/Functional/SearchSelect/index.md +141 -141
  180. package/src/components/Functional/SearchSelect/index.tsx +879 -870
  181. package/src/components/Functional/SearchSelect/utils.ts +3 -3
  182. package/src/components/Functional/TreeSearchSelect/index.md +47 -47
  183. package/src/components/Functional/TreeSearchSelect/index.tsx +199 -199
  184. package/src/components/Solution/RuleComponent/Formula.tsx +335 -335
  185. package/src/components/Solution/RuleComponent/index.d.ts +29 -29
  186. package/src/components/Solution/RuleComponent/index.js +2032 -2028
  187. package/src/components/Solution/RuleComponent/index.less +230 -230
  188. package/src/components/Solution/RuleComponent/renderSpecificAction.js +99 -99
  189. package/src/components/Solution/RuleComponent/ruleFiled.js +2107 -2107
  190. package/src/components/Solution/RuleComponent/services.ts +13 -13
  191. package/src/components/Solution/RuleComponent/util.js +139 -139
  192. package/src/index.ts +38 -38
  193. package/src/plugin/TableColumnSetting/index.less +247 -247
  194. package/src/plugin/TableColumnSetting/index.md +50 -50
  195. package/src/plugin/TableColumnSetting/index.tsx +724 -724
  196. package/src/plugin/TableColumnSetting/utils.ts +19 -19
  197. package/src/styles/bsDefault.less +1912 -1912
  198. package/src/utils/CheckOneUser/index.md +39 -39
  199. package/src/utils/CheckOneUser/index.ts +51 -51
  200. package/src/utils/LocalstorageUtils.ts +95 -90
  201. package/src/utils/TableUtils.tsx +18 -18
  202. package/src/utils/checkUtils.ts +39 -39
  203. package/src/utils/enumConfig.ts +11 -11
  204. package/src/utils/getFormMode.js +12 -12
  205. package/src/utils/index.ts +4 -4
  206. package/src/utils/requestUtils.ts +34 -34
  207. package/src/utils/serialize.js +7 -7
  208. package/src/utils/utils.ts +212 -212
  209. package/tsconfig.json +29 -29
  210. package/typings.d.ts +4 -4
@@ -1,861 +1,895 @@
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
-
15
- function handleSelectColumn(c: any, parentProps: any) {
16
- let result = c;
17
- const exceptColumns = parentProps?.exceptColumns || [];
18
- const coverColumns = parentProps?.coverColumns || [];
19
- const additionColumns = parentProps?.additionColumns || [];
20
- // 过滤不需要展示内容
21
- if(exceptColumns?.length) {
22
- result = result.filter((i: any) => !exceptColumns.includes(i.dataIndex))
23
- }
24
- // 追加
25
- if(additionColumns?.length) {
26
- additionColumns.forEach((i: any) => {
27
- result.splice(i.position,0,i.column)
28
- })
29
- }
30
- // 覆盖内容
31
- if(coverColumns?.length) {
32
- result = coverColumns;
33
- }
34
- return result
35
- }
36
-
37
- export const AddSkuSelect = (parProps: any) => {
38
- const selectProps = {
39
- mode: 'multiple',
40
- }
41
- const [value, setValue] = useState(selectProps?.mode ? [] : null);
42
- //注⚠️:自定义过表头的请记得传tableCodeList参数
43
- const initialSelectColumn = [
44
- {
45
- title: 'SKU编码',
46
- width: 150,
47
- dataIndex: 'skuCode',
48
- },
49
- {
50
- title: 'SKU名称',
51
- width: 200,
52
- ellipsis: {
53
- showTitle: false,
54
- },
55
- render: (text: any) => (
56
- <Tooltip placement="topLeft" title={text}>
57
- {text}
58
- </Tooltip>
59
- ),
60
- dataIndex: 'name',
61
- },
62
- {
63
- title: '图片',
64
- dataIndex: 'itemUrl',
65
- width: 200,
66
- ellipsis: {
67
- showTitle: false,
68
- },
69
- render: (text: any,record: any) => (
70
- <Tooltip placement="topLeft" title={text}>
71
- {tableColumnsImage(getSkuImg(record),{ width: 28, height: 28 })}
72
- </Tooltip>
73
- ),
74
- },
75
- {
76
- title: '数量',
77
- width: 100,
78
- isInputItem: true,
79
- dataIndex: 'count',
80
- },
81
- {
82
- title: '单位',
83
- dataIndex: 'selectUnitCode',
84
- width: 80,
85
- ellipsis: {
86
- showTitle: false,
87
- },
88
- render: (text: any, record: any) => {
89
- if (record?.packingUnitList?.length) {
90
- const basePackUnit = record?.packingUnitList[0]
91
- record.selectUnitCode = basePackUnit.unitCode
92
- return basePackUnit.name || basePackUnit.unitCode
93
- }
94
-
95
-
96
- return <></>
97
- },
98
- },
99
- {
100
- title: '所属SPU编码',
101
- width: 150,
102
- ellipsis: {
103
- showTitle: false,
104
- },
105
- dataIndex: 'itemCode',
106
- render: (text: any) => (
107
- <Tooltip placement="topLeft" title={text}>
108
- {text}
109
- </Tooltip>
110
- ),
111
- },
112
- {
113
- title: '规格',
114
- width: 200,
115
- ellipsis: {
116
- showTitle: false,
117
- },
118
- render: (text: any) => (
119
- <Tooltip placement="topLeft" title={text}>
120
- {text}
121
- </Tooltip>
122
- ),
123
- dataIndex: 'propertyNameAndValue',
124
- }
125
- ]
126
- const mTpSelectColumn = handleSelectColumn(initialSelectColumn, parProps)
127
- const props = {
128
- buttonText: parProps.buttonText || '新增',
129
- buttonProps: parProps.buttonProps || {},
130
- tableCodeList: parProps.tableCodeList || [],
131
- value,
132
- // labelInValue: true, // 非必填 默认为false
133
- requestConfig: {
134
- url: `/items/sku/pager/v2`,
135
- filter: 'qp-name-like', // 过滤参数 支持'qp-name-like'和['qp-name-like', 'qp-code-like']两种结构
136
- otherParams: {
137
- 'qp-combination-eq': false,
138
- 'qp-approveStatus-eq': 1,
139
- 'qp-status-eq': 1,
140
- }, // 默认参数
141
- mappingTextField: 'name',
142
- mappingValueField: 'skuCode',
143
- ...parProps.requestConfig
144
- },
145
- selectProps,
146
- onChange: (value: any) => {
147
- console.log(value)
148
- setValue(value)
149
- },
150
- beforeShowModal: parProps?.beforeShowModal,
151
- onSaveCallback: parProps.onSaveCallback,
152
- businessType: 'sku',
153
- isAllowRepeatedSelect: !!parProps?.isAllowRepeatedSelect,
154
- };
155
- const modalTableProps = {
156
- modalTableTitle: '选择商品',
157
- tableSearchForm: [
158
- {
159
- name: 'qp-skuCode-like', label: 'SKU编码'
160
- },
161
- { name: 'qp-skuName-like', label: 'SKU名称' },
162
- { name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
163
- type: 'select',
164
- props: {
165
- mode: 'multiple',
166
- notFoundContent: '暂无数据',
167
- allowClear: true,
168
- showSearch: true,
169
- showArrow: true,
170
- maxTagCount: 1,
171
- optionFilterProp: 'children',
172
- filterOption: (input: string, option: { props: { children: string } }) =>
173
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
174
- },
175
- } },
176
- { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
177
- type: 'treeSelect',
178
- props: {
179
- treeData: [],
180
- treeCheckable: true,
181
- showSearch: true,
182
- allowClear: true,
183
- showArrow: true,
184
- treeNodeFilterProp: 'title',
185
- treeDefaultExpandAll: true,
186
- maxTagCount: 1,
187
- placeholder: '请选择',
188
- style: {
189
- width: '100%',
190
- },
191
- dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
192
- },
193
- } }
194
- ],
195
- tableColumns: [
196
- {
197
- title: 'SKU编码',
198
- width: 150,
199
- dataIndex: 'skuCode',
200
- },
201
- {
202
- title: 'SKU名称',
203
- width: 200,
204
- ellipsis: {
205
- showTitle: false,
206
- },
207
- render: (text: any) => (
208
- <Tooltip placement="topLeft" title={text}>
209
- {text}
210
- </Tooltip>
211
- ),
212
- dataIndex: 'name',
213
- },
214
- {
215
- title: '图片',
216
- dataIndex: 'itemUrl',
217
- width: 200,
218
- ellipsis: {
219
- showTitle: false,
220
- },
221
- render: (text: any,record: any) => (
222
- <Tooltip placement="topLeft" title={text}>
223
- {tableColumnsImage(getSkuImg(record),{ width: 20, height: 20 })}
224
- </Tooltip>
225
- ),
226
- },
227
- {
228
- title: '国际条码',
229
- width: 100,
230
- ellipsis: {
231
- showTitle: false,
232
- },
233
- dataIndex: 'barCode',
234
- render: (text: any) => (
235
- <Tooltip placement="topLeft" title={text}>
236
- {text}
237
- </Tooltip>
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
- selectColumn: mTpSelectColumn
333
- }
334
-
335
- return (
336
- <div>
337
- <AddSelect
338
- {...props}
339
- modalTableProps={modalTableProps}
340
- />
341
- </div>
342
- );
343
- };
344
-
345
- export const AddSkcSelect = (parProps: any) => {
346
- const selectProps = {
347
- mode: 'multiple',
348
- }
349
- const [value, setValue] = useState(selectProps?.mode ? [] : null);
350
- const [propertyList, setPropertyList] = useState([]);
351
-
352
- useEffect(() => {
353
- // type: 1 尺码组; 2 配码组
354
- axios.get(`/items/itemPropertyValueGroup/listNoPage?qp-type-eq=2&qp-status-eq=1`).then((result: any) => {
355
- result = result.data;
356
- if ((result?.status && result.status !== '0') || (result?.code && result.code !== '000000')) {
357
- message.error(result.msg);
358
- return;
359
- }
360
- const data = result.data || [];
361
- setPropertyList(data)
362
- }).catch((err) => {});
363
- },[])
364
-
365
- //注⚠️:自定义过表头的请记得传tableCodeList参数
366
- const initialSelectColumn = [
367
- {
368
- title: 'SKC编码',
369
- width: 150,
370
- dataIndex: 'code',
371
- },
372
- {
373
- title: 'SKC名称',
374
- width: 200,
375
- ellipsis: {
376
- showTitle: false,
377
- },
378
- render: (text: any) => (
379
- <Tooltip placement="topLeft" title={text}>
380
- {text}
381
- </Tooltip>
382
- ),
383
- dataIndex: 'name',
384
- },
385
- {
386
- title: '颜色',
387
- width: 200,
388
- ellipsis: {
389
- showTitle: false,
390
- },
391
- render: (text: any) => (
392
- <Tooltip placement="topLeft" title={text}>
393
- {text}
394
- </Tooltip>
395
- ),
396
- dataIndex: 'colorName',
397
- },
398
- {
399
- title: '配码',
400
- dataIndex: 'selectPropertyGroupCode',
401
- width: 160,
402
- isSelectItem: true,
403
- dataSource: propertyList,
404
- },
405
- {
406
- title: '数量',
407
- width: 100,
408
- isInputItem: true,
409
- dataIndex: 'count',
410
- },
411
- ]
412
- const mTpSelectColumn = handleSelectColumn(initialSelectColumn, parProps)
413
- const props = {
414
- buttonText: parProps.buttonText || '新增',
415
- buttonProps: parProps.buttonProps || {},
416
- tableCodeList: parProps.tableCodeList || ['skcSelect-tableOptionsToChoosePartCode','skcSelect-tableSelectedItemPartCode'],
417
- value,
418
- // labelInValue: true, // 非必填 默认为false
419
- requestConfig: {
420
- url: `/items/skc/skcSelect`,
421
- filter: 'qp-name-like', // 过滤参数 支持'qp-name-like'和['qp-name-like', 'qp-code-like']两种结构
422
- otherParams: { 'qp-skcStatus-eq': 1, }, // 默认参数
423
- mappingTextField: 'name',
424
- mappingValueField: 'code',
425
- ...parProps.requestConfig
426
- },
427
- selectProps,
428
- onChange: (value: any) => {
429
- console.log(value)
430
- setValue(value)
431
- },
432
- beforeShowModal: parProps?.beforeShowModal,
433
- onSaveCallback: parProps.onSaveCallback,
434
- businessType: 'skc',
435
- isAllowRepeatedSelect: parProps?.isAllowRepeatedSelect!==undefined ? !!parProps?.isAllowRepeatedSelect : true, // 默认开启一行选多次
436
- };
437
- const modalTableProps = {
438
- modalTableTitle: '选择商品',
439
- tableSearchForm: [
440
- { name: 'qp-code-like', label: 'SKC编码' },
441
- { name: 'qp-skcName-like', label: 'SKC名称' },
442
- { name: 'qp-itemName-like', label: '商品名称' },
443
- { name: 'qp-colorName-in', type: 'select', label: '颜色', field: {
444
- type: 'select',
445
- props: {
446
- mode: 'multiple',
447
- notFoundContent: '暂无数据',
448
- allowClear: true,
449
- showSearch: true,
450
- showArrow: true,
451
- maxTagCount: 1,
452
- optionFilterProp: 'children',
453
- filterOption: (input: string, option: { props: { children: string } }) =>
454
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
455
- },
456
- } },
457
- { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
458
- type: 'treeSelect',
459
- props: {
460
- treeData: [],
461
- treeCheckable: true,
462
- showSearch: true,
463
- allowClear: true,
464
- showArrow: true,
465
- treeNodeFilterProp: 'title',
466
- treeDefaultExpandAll: true,
467
- maxTagCount: 1,
468
- placeholder: '请选择',
469
- style: {
470
- width: '100%',
471
- },
472
- dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
473
- },
474
- } },
475
- { name: 'qp-classId-in', type: 'select', label: '品类', field: {
476
- type: 'select',
477
- props: {
478
- mode: 'multiple',
479
- notFoundContent: '暂无数据',
480
- allowClear: true,
481
- showSearch: true,
482
- showArrow: true,
483
- maxTagCount: 1,
484
- optionFilterProp: 'children',
485
- filterOption: (input: string, option: { props: { children: string } }) =>
486
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
487
- },
488
- } },
489
- { name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
490
- type: 'select',
491
- props: {
492
- mode: 'multiple',
493
- notFoundContent: '暂无数据',
494
- allowClear: true,
495
- showSearch: true,
496
- showArrow: true,
497
- maxTagCount: 1,
498
- optionFilterProp: 'children',
499
- filterOption: (input: string, option: { props: { children: string } }) =>
500
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
501
- },
502
- } },
503
- ],
504
- tableColumns: [
505
- {
506
- title: 'SKC编码',
507
- width: 150,
508
- dataIndex: 'code',
509
- },
510
- {
511
- title: 'SKC名称',
512
- width: 200,
513
- ellipsis: {
514
- showTitle: false,
515
- },
516
- render: (text: any) => (
517
- <Tooltip placement="topLeft" title={text}>
518
- {text}
519
- </Tooltip>
520
- ),
521
- dataIndex: 'name',
522
- },
523
- {
524
- title: '商品名称',
525
- width: 100,
526
- ellipsis: {
527
- showTitle: false,
528
- },
529
- dataIndex: 'itemName',
530
- render: (text: any) => (
531
- <Tooltip placement="topLeft" title={text}>
532
- {text}
533
- </Tooltip>
534
- ),
535
- },
536
- {
537
- title: '颜色',
538
- width: 100,
539
- ellipsis: {
540
- showTitle: false,
541
- },
542
- render: (text: any) => (
543
- <Tooltip placement="topLeft" title={text}>
544
- {text}
545
- </Tooltip>
546
- ),
547
- dataIndex: 'colorName',
548
- },
549
- {
550
- title: '类目',
551
- width: 100,
552
- ellipsis: {
553
- showTitle: false,
554
- },
555
- render: (text: any) => (
556
- <Tooltip placement="topLeft" title={text}>
557
- {text}
558
- </Tooltip>
559
- ),
560
- dataIndex: 'categoryName',
561
- },
562
- {
563
- title: '品类',
564
- width: 100,
565
- ellipsis: {
566
- showTitle: false,
567
- },
568
- render: (text: any) => (
569
- <Tooltip placement="topLeft" title={text}>
570
- {text}
571
- </Tooltip>
572
- ),
573
- dataIndex: 'className',
574
- },
575
- {
576
- title: '品牌',
577
- width: 100,
578
- ellipsis: {
579
- showTitle: false,
580
- },
581
- render: (text: any) => (
582
- <Tooltip placement="topLeft" title={text}>
583
- {text}
584
- </Tooltip>
585
- ),
586
- dataIndex: 'brandName',
587
- },
588
- ],
589
- selectColumn: mTpSelectColumn,
590
- }
591
-
592
- return (
593
- <div>
594
- <AddSelect
595
- {...props}
596
- modalTableProps={modalTableProps}
597
- />
598
- </div>
599
- );
600
- };
601
-
602
- export const AddSpuSelect = (parProps: any) => {
603
- const selectProps = {
604
- mode: 'multiple',
605
- }
606
- const [value, setValue] = useState(selectProps?.mode ? [] : null);
607
- const [propertyList, setPropertyList] = useState([]);
608
-
609
- useEffect(() => {
610
- if(parProps?.isSingleColor) {
611
- // type: 1 尺码组; 2 配码组
612
- axios.get(`/items/itemPropertyValueGroup/listNoPage?qp-type-eq=2&qp-status-eq=1`).then((result: any) => {
613
- result = result.data;
614
- if ((result?.status && result.status !== '0') || (result?.code && result.code !== '000000')) {
615
- message.error(result.msg);
616
- return;
617
- }
618
- const data = result.data || [];
619
- setPropertyList(data)
620
- }).catch((err) => {});
621
- }
622
- },[])
623
-
624
- //注⚠️:自定义过表头的请记得传tableCodeList参数
625
- const initialSelectColumn = [
626
- {
627
- title: '商品编码',
628
- width: 150,
629
- dataIndex: 'itemCode',
630
- },
631
- {
632
- title: '商品名称',
633
- width: 200,
634
- ellipsis: {
635
- showTitle: false,
636
- },
637
- render: (text: any) => (
638
- <Tooltip placement="topLeft" title={text}>
639
- {text}
640
- </Tooltip>
641
- ),
642
- dataIndex: 'name',
643
- },
644
- {
645
- title: '颜色',
646
- dataIndex: 'colorName',
647
- width: 200,
648
- isSelectItem: true,
649
- dataSourceCode: 'colorValues',
650
- dataSourceMapping: ['value', 'value']
651
- },
652
- {
653
- title: '配码',
654
- dataIndex: 'selectPropertyGroupCode',
655
- width: 160,
656
- isSelectItem: true,
657
- dataSource: propertyList,
658
- filterDataSourceCode: 'matchingCodes',
659
- },
660
- {
661
- title: '数量',
662
- width: 100,
663
- isInputItem: true,
664
- dataIndex: 'count',
665
- },
666
- {
667
- title: '所属组织',
668
- dataIndex: 'ownOrgSignName',
669
- },
670
- {
671
- title: '品牌',
672
- dataIndex: 'brandName',
673
- },
674
- {
675
- title: '类目',
676
- dataIndex: 'categoryText',
677
- },
678
- {
679
- title: '品类',
680
- dataIndex: 'className',
681
- },
682
- ]
683
- const mTpSelectColumn = handleSelectColumn(initialSelectColumn, parProps)
684
- const props = {
685
- buttonText: parProps.buttonText || '新增',
686
- buttonProps: parProps.buttonProps || {},
687
- tableCodeList: parProps.tableCodeList || [],
688
- value,
689
- // labelInValue: true, // 非必填 默认为false
690
- requestConfig: {
691
- url: `/items/item`,
692
- filter: 'qp-itemCode,name-orGroup,like', // 过滤参数
693
- otherParams: {
694
- 'qp-approveStatus-eq': 1, // 审核状态(0.待审批;1.审批通过;2.驳回;3.审批未通过)
695
- 'qp-status-eq': 1,
696
- sorter: 'desc-id'
697
- }, // 默认参数
698
- mappingTextField: 'name',
699
- mappingValueField: 'itemCode',
700
- ...parProps.requestConfig
701
- },
702
- selectProps,
703
- onChange: (value: any) => {
704
- console.log(value)
705
- setValue(value)
706
- },
707
- beforeShowModal: parProps?.beforeShowModal,
708
- onSaveCallback: parProps.onSaveCallback,
709
- businessType: 'spu',
710
- isAllowRepeatedSelect: !!parProps?.isAllowRepeatedSelect,
711
- };
712
- const modalTableProps = {
713
- modalTableTitle: '选择商品',
714
- tableSearchForm: [
715
- { name: 'qp-itemCode-like', label: '商品编码' },
716
- { name: 'qp-name-like', label: '商品名称' },
717
- { name: 'qp-ownOrgSign-in', type: 'select', label: '所属组织', field: {
718
- type: 'select',
719
- props: {
720
- mode: 'multiple',
721
- notFoundContent: '暂无数据',
722
- allowClear: true,
723
- showSearch: true,
724
- showArrow: true,
725
- maxTagCount: 1,
726
- optionFilterProp: 'children',
727
- filterOption: (input: string, option: { props: { children: string } }) =>
728
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
729
- },
730
- } },
731
- { name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
732
- type: 'select',
733
- props: {
734
- mode: 'multiple',
735
- notFoundContent: '暂无数据',
736
- allowClear: true,
737
- showSearch: true,
738
- showArrow: true,
739
- maxTagCount: 1,
740
- optionFilterProp: 'children',
741
- filterOption: (input: string, option: { props: { children: string } }) =>
742
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
743
- },
744
- } },
745
- { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
746
- type: 'treeSelect',
747
- props: {
748
- treeData: [],
749
- treeCheckable: true,
750
- showSearch: true,
751
- allowClear: true,
752
- showArrow: true,
753
- treeNodeFilterProp: 'title',
754
- treeDefaultExpandAll: true,
755
- maxTagCount: 1,
756
- placeholder: '请选择',
757
- style: {
758
- width: '100%',
759
- },
760
- dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
761
- },
762
- } },
763
- { name: 'qp-classId-in', type: 'select', label: '品类', field: {
764
- type: 'select',
765
- props: {
766
- mode: 'multiple',
767
- notFoundContent: '暂无数据',
768
- allowClear: true,
769
- showSearch: true,
770
- showArrow: true,
771
- maxTagCount: 1,
772
- optionFilterProp: 'children',
773
- filterOption: (input: string, option: { props: { children: string } }) =>
774
- option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
775
- },
776
- } },
777
- ],
778
- tableColumns: [
779
- {
780
- title: '商品编码',
781
- width: 150,
782
- dataIndex: 'itemCode',
783
- },
784
- {
785
- title: '商品名称',
786
- width: 200,
787
- ellipsis: {
788
- showTitle: false,
789
- },
790
- render: (text: any) => (
791
- <Tooltip placement="topLeft" title={text}>
792
- {text}
793
- </Tooltip>
794
- ),
795
- dataIndex: 'name',
796
- },
797
- {
798
- title: '所属组织',
799
- width: 100,
800
- ellipsis: {
801
- showTitle: false,
802
- },
803
- render: (text: any) => (
804
- <Tooltip placement="topLeft" title={text}>
805
- {text}
806
- </Tooltip>
807
- ),
808
- dataIndex: 'ownOrgSignName',
809
- },
810
- {
811
- title: '品牌',
812
- width: 100,
813
- ellipsis: {
814
- showTitle: false,
815
- },
816
- render: (text: any) => (
817
- <Tooltip placement="topLeft" title={text}>
818
- {text}
819
- </Tooltip>
820
- ),
821
- dataIndex: 'brandName',
822
- },
823
- {
824
- title: '类目',
825
- width: 100,
826
- ellipsis: {
827
- showTitle: false,
828
- },
829
- render: (text: any) => (
830
- <Tooltip placement="topLeft" title={text}>
831
- {text}
832
- </Tooltip>
833
- ),
834
- dataIndex: 'categoryName',
835
- },
836
- {
837
- title: '品类',
838
- width: 100,
839
- ellipsis: {
840
- showTitle: false,
841
- },
842
- render: (text: any) => (
843
- <Tooltip placement="topLeft" title={text}>
844
- {text}
845
- </Tooltip>
846
- ),
847
- dataIndex: 'className',
848
- },
849
- ],
850
- selectColumn: mTpSelectColumn
851
- }
852
-
853
- return (
854
- <div>
855
- <AddSelect
856
- {...props}
857
- modalTableProps={modalTableProps}
858
- />
859
- </div>
860
- );
861
- };
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 { getCurrentTargetBgId } from '@/utils/LocalstorageUtils';
15
+
16
+ function handleSelectColumn(c: any, parentProps: any) {
17
+ let result = c;
18
+ const exceptColumns = parentProps?.exceptColumns || [];
19
+ const coverColumns = parentProps?.coverColumns || [];
20
+ const additionColumns = parentProps?.additionColumns || [];
21
+ // 过滤不需要展示内容
22
+ if(exceptColumns?.length) {
23
+ result = result.filter((i: any) => !exceptColumns.includes(i.dataIndex))
24
+ }
25
+ // 追加(最好不用这个,当组件不固定时候会有影响)
26
+ if(additionColumns?.length) {
27
+ additionColumns.forEach((i: any) => {
28
+ result.splice(i.position,0,i.column)
29
+ })
30
+ }
31
+ // 覆盖内容
32
+ if(coverColumns?.length) {
33
+ result = coverColumns;
34
+ }
35
+ return result
36
+ }
37
+
38
+ export const AddSkuSelect = (parProps: any) => {
39
+ const selectProps = {
40
+ mode: 'multiple',
41
+ }
42
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
43
+ const isNoUseItemBarcode = parProps?.noUseItemEancode !== undefined ? parProps?.noUseItemEancode : true; // 默认不加商品条码,兼容老项目
44
+ //注⚠️:自定义过表头的请记得传tableCodeList参数
45
+ const initialSelectColumn = [
46
+ {
47
+ title: 'SKU编码',
48
+ width: 150,
49
+ dataIndex: 'skuCode',
50
+ },
51
+ ...(isNoUseItemBarcode ? [] : [
52
+ {
53
+ title: '商品条码',
54
+ width: 100,
55
+ ellipsis: {
56
+ showTitle: false,
57
+ },
58
+ dataIndex: 'itemEancode',
59
+ render: (text: any) => (
60
+ <Tooltip placement="topLeft" title={text}>
61
+ {text}
62
+ </Tooltip>
63
+ ),
64
+ }
65
+ ]),
66
+ {
67
+ title: 'SKU名称',
68
+ width: 200,
69
+ ellipsis: {
70
+ showTitle: false,
71
+ },
72
+ render: (text: any) => (
73
+ <Tooltip placement="topLeft" title={text}>
74
+ {text}
75
+ </Tooltip>
76
+ ),
77
+ dataIndex: 'name',
78
+ },
79
+ {
80
+ title: '图片',
81
+ dataIndex: 'itemUrl',
82
+ width: 200,
83
+ ellipsis: {
84
+ showTitle: false,
85
+ },
86
+ render: (text: any,record: any) => (
87
+ <Tooltip placement="topLeft" title={text}>
88
+ {tableColumnsImage(getSkuImg(record),{ width: 28, height: 28 })}
89
+ </Tooltip>
90
+ ),
91
+ },
92
+ {
93
+ title: '数量',
94
+ width: 100,
95
+ isInputItem: true,
96
+ dataIndex: 'count',
97
+ },
98
+ {
99
+ title: '单位',
100
+ dataIndex: 'selectUnitCode',
101
+ width: 80,
102
+ ellipsis: {
103
+ showTitle: false,
104
+ },
105
+ render: (text: any, record: any) => {
106
+ if (record?.packingUnitList?.length) {
107
+ const basePackUnit = record?.packingUnitList[0]
108
+ record.selectUnitCode = basePackUnit.unitCode
109
+ return basePackUnit.name || basePackUnit.unitCode
110
+ }
111
+
112
+
113
+ return <></>
114
+ },
115
+ },
116
+ {
117
+ title: '所属SPU编码',
118
+ width: 150,
119
+ ellipsis: {
120
+ showTitle: false,
121
+ },
122
+ dataIndex: 'itemCode',
123
+ render: (text: any) => (
124
+ <Tooltip placement="topLeft" title={text}>
125
+ {text}
126
+ </Tooltip>
127
+ ),
128
+ },
129
+ {
130
+ title: '规格',
131
+ width: 200,
132
+ ellipsis: {
133
+ showTitle: false,
134
+ },
135
+ render: (text: any) => (
136
+ <Tooltip placement="topLeft" title={text}>
137
+ {text}
138
+ </Tooltip>
139
+ ),
140
+ dataIndex: 'propertyNameAndValue',
141
+ }
142
+ ]
143
+ const mTpSelectColumn = handleSelectColumn(initialSelectColumn, parProps)
144
+ const props = {
145
+ buttonText: parProps.buttonText || '新增',
146
+ buttonProps: parProps.buttonProps || {},
147
+ tableCodeList: parProps.tableCodeList || [],
148
+ value,
149
+ // labelInValue: true, // 非必填 默认为false
150
+ requestConfig: {
151
+ url: `/items/sku/pager/v2`,
152
+ filter: 'qp-name-like', // 过滤参数 支持'qp-name-like'和['qp-name-like', 'qp-code-like']两种结构
153
+ otherParams: {
154
+ 'qp-combination-eq': false,
155
+ 'qp-approveStatus-eq': 1,
156
+ 'qp-status-eq': 1,
157
+ // 'useOrgSign': getCurrentTargetBgId(), // 根据品牌、账号授权的组织+商品授权使用组织做权限过滤 这个交给业务使用的地方去做,传addOtherParams:{useOrgSign:单据中所选组织}
158
+ ...(parProps?.requestConfig?.addOtherParams || {}), // 允许在默认参数基础上,追加/覆盖已有 参数
159
+ }, // 默认参数
160
+ mappingTextField: 'name',
161
+ mappingValueField: 'skuCode',
162
+ ...parProps.requestConfig
163
+ },
164
+ selectProps,
165
+ onChange: (value: any) => {
166
+ console.log(value)
167
+ setValue(value)
168
+ },
169
+ beforeShowModal: parProps?.beforeShowModal,
170
+ onSaveCallback: parProps.onSaveCallback,
171
+ businessType: 'sku',
172
+ isAllowRepeatedSelect: !!parProps?.isAllowRepeatedSelect,
173
+ noUseItemEancode: isNoUseItemBarcode
174
+ };
175
+ const modalTableProps = {
176
+ modalTableTitle: '选择商品',
177
+ tableSearchForm: [
178
+ {
179
+ name: 'qp-skuCode-like', label: 'SKU编码'
180
+ },
181
+ { name: 'qp-skuName-like', label: 'SKU名称' },
182
+ ...(isNoUseItemBarcode ? []: [
183
+ { name: 'qp-code-in', label: '商品条码', field: {
184
+ type: 'multipleQueryInput',
185
+ props: {
186
+ ...(parProps.requestConfig?.itemEancodeValueRequestConfig || {}),
187
+ },
188
+ }}
189
+ ]),
190
+ { name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
191
+ type: 'select',
192
+ props: {
193
+ mode: 'multiple',
194
+ notFoundContent: '暂无数据',
195
+ allowClear: true,
196
+ showSearch: true,
197
+ showArrow: true,
198
+ maxTagCount: 1,
199
+ optionFilterProp: 'children',
200
+ filterOption: (input: string, option: { props: { children: string } }) =>
201
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
202
+ },
203
+ } },
204
+ { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
205
+ type: 'treeSelect',
206
+ props: {
207
+ treeData: [],
208
+ treeCheckable: true,
209
+ showSearch: true,
210
+ allowClear: true,
211
+ showArrow: true,
212
+ treeNodeFilterProp: 'title',
213
+ treeDefaultExpandAll: true,
214
+ maxTagCount: 1,
215
+ placeholder: '请选择',
216
+ style: {
217
+ width: '100%',
218
+ },
219
+ dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
220
+ },
221
+ } }
222
+ ],
223
+ tableColumns: [
224
+ {
225
+ title: 'SKU编码',
226
+ width: 150,
227
+ dataIndex: 'skuCode',
228
+ },
229
+ {
230
+ title: 'SKU名称',
231
+ width: 200,
232
+ ellipsis: {
233
+ showTitle: false,
234
+ },
235
+ render: (text: any) => (
236
+ <Tooltip placement="topLeft" title={text}>
237
+ {text}
238
+ </Tooltip>
239
+ ),
240
+ dataIndex: 'name',
241
+ },
242
+ {
243
+ title: '图片',
244
+ dataIndex: 'itemUrl',
245
+ width: 200,
246
+ ellipsis: {
247
+ showTitle: false,
248
+ },
249
+ render: (text: any,record: any) => (
250
+ <Tooltip placement="topLeft" title={text}>
251
+ {tableColumnsImage(getSkuImg(record),{ width: 20, height: 20 })}
252
+ </Tooltip>
253
+ ),
254
+ },
255
+ ...(isNoUseItemBarcode ? []: [
256
+ {
257
+ title: '商品条码',
258
+ width: 100,
259
+ ellipsis: {
260
+ showTitle: false,
261
+ },
262
+ dataIndex: 'itemEancode',
263
+ render: (text: any) => (
264
+ <Tooltip placement="topLeft" title={text}>
265
+ {text}
266
+ </Tooltip>
267
+ ),
268
+ }
269
+ ]),
270
+ {
271
+ title: '所属SPU名称',
272
+ width: 100,
273
+ ellipsis: {
274
+ showTitle: false,
275
+ },
276
+ dataIndex: 'itemName',
277
+ render: (text: any) => (
278
+ <Tooltip placement="topLeft" title={text}>
279
+ {text}
280
+ </Tooltip>
281
+ ),
282
+ },
283
+ {
284
+ title: '所属SPU编码',
285
+ width: 100,
286
+ ellipsis: {
287
+ showTitle: false,
288
+ },
289
+ dataIndex: 'itemCode',
290
+ render: (text: any) => (
291
+ <Tooltip placement="topLeft" title={text}>
292
+ {text}
293
+ </Tooltip>
294
+ ),
295
+ },
296
+ {
297
+ title: '外部编码',
298
+ width: 100,
299
+ ellipsis: {
300
+ showTitle: false,
301
+ },
302
+ render: (text: any) => (
303
+ <Tooltip placement="topLeft" title={text}>
304
+ {text}
305
+ </Tooltip>
306
+ ),
307
+ dataIndex: 'externalCode',
308
+ },
309
+ {
310
+ title: '规格',
311
+ width: 100,
312
+ ellipsis: {
313
+ showTitle: false,
314
+ },
315
+ render: (text: any) => (
316
+ <Tooltip placement="topLeft" title={text}>
317
+ {text}
318
+ </Tooltip>
319
+ ),
320
+ dataIndex: 'propertyNameAndValue',
321
+ },
322
+ {
323
+ title: '类目',
324
+ width: 100,
325
+ ellipsis: {
326
+ showTitle: false,
327
+ },
328
+ render: (text: any) => (
329
+ <Tooltip placement="topLeft" title={text}>
330
+ {text}
331
+ </Tooltip>
332
+ ),
333
+ dataIndex: 'categoryName',
334
+ },
335
+ {
336
+ title: '品类',
337
+ width: 100,
338
+ ellipsis: {
339
+ showTitle: false,
340
+ },
341
+ render: (text: any) => (
342
+ <Tooltip placement="topLeft" title={text}>
343
+ {text}
344
+ </Tooltip>
345
+ ),
346
+ dataIndex: 'className',
347
+ },
348
+ {
349
+ title: '品牌',
350
+ width: 100,
351
+ ellipsis: {
352
+ showTitle: false,
353
+ },
354
+ render: (text: any) => (
355
+ <Tooltip placement="topLeft" title={text}>
356
+ {text}
357
+ </Tooltip>
358
+ ),
359
+ dataIndex: 'brandName',
360
+ },
361
+ ],
362
+ selectColumn: mTpSelectColumn
363
+ }
364
+
365
+ return (
366
+ <div>
367
+ <AddSelect
368
+ {...props}
369
+ modalTableProps={modalTableProps}
370
+ />
371
+ </div>
372
+ );
373
+ };
374
+
375
+ export const AddSkcSelect = (parProps: any) => {
376
+ const selectProps = {
377
+ mode: 'multiple',
378
+ }
379
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
380
+ const [propertyList, setPropertyList] = useState([]);
381
+
382
+ useEffect(() => {
383
+ // type: 1 尺码组; 2 配码组
384
+ axios.get(`/items/itemPropertyValueGroup/listNoPage?qp-type-eq=2&qp-status-eq=1`).then((result: any) => {
385
+ result = result.data;
386
+ if ((result?.status && result.status !== '0') || (result?.code && result.code !== '000000')) {
387
+ message.error(result.msg);
388
+ return;
389
+ }
390
+ const data = result.data || [];
391
+ setPropertyList(data)
392
+ }).catch((err) => {});
393
+ },[])
394
+
395
+ //注⚠️:自定义过表头的请记得传tableCodeList参数
396
+ const initialSelectColumn = [
397
+ {
398
+ title: 'SKC编码',
399
+ width: 150,
400
+ dataIndex: 'code',
401
+ },
402
+ {
403
+ title: 'SKC名称',
404
+ width: 200,
405
+ ellipsis: {
406
+ showTitle: false,
407
+ },
408
+ render: (text: any) => (
409
+ <Tooltip placement="topLeft" title={text}>
410
+ {text}
411
+ </Tooltip>
412
+ ),
413
+ dataIndex: 'name',
414
+ },
415
+ {
416
+ title: '颜色',
417
+ width: 200,
418
+ ellipsis: {
419
+ showTitle: false,
420
+ },
421
+ render: (text: any) => (
422
+ <Tooltip placement="topLeft" title={text}>
423
+ {text}
424
+ </Tooltip>
425
+ ),
426
+ dataIndex: 'colorName',
427
+ },
428
+ {
429
+ title: '配码',
430
+ dataIndex: 'selectPropertyGroupCode',
431
+ width: 160,
432
+ isSelectItem: true,
433
+ dataSource: propertyList,
434
+ },
435
+ {
436
+ title: '数量',
437
+ width: 100,
438
+ isInputItem: true,
439
+ dataIndex: 'count',
440
+ },
441
+ ]
442
+ const mTpSelectColumn = handleSelectColumn(initialSelectColumn, parProps)
443
+ const props = {
444
+ buttonText: parProps.buttonText || '新增',
445
+ buttonProps: parProps.buttonProps || {},
446
+ tableCodeList: parProps.tableCodeList || ['skcSelect-tableOptionsToChoosePartCode','skcSelect-tableSelectedItemPartCode'],
447
+ value,
448
+ // labelInValue: true, // 非必填 默认为false
449
+ requestConfig: {
450
+ url: `/items/skc/skcSelect`,
451
+ filter: 'qp-name-like', // 过滤参数 支持'qp-name-like'和['qp-name-like', 'qp-code-like']两种结构
452
+ otherParams: {
453
+ 'qp-skcStatus-eq': 1,
454
+ ...(parProps?.requestConfig?.addOtherParams || {}), // 允许在默认参数基础上,追加/覆盖已有 参数
455
+ }, // 默认参数
456
+ mappingTextField: 'name',
457
+ mappingValueField: 'code',
458
+ ...parProps.requestConfig
459
+ },
460
+ selectProps,
461
+ onChange: (value: any) => {
462
+ console.log(value)
463
+ setValue(value)
464
+ },
465
+ beforeShowModal: parProps?.beforeShowModal,
466
+ onSaveCallback: parProps.onSaveCallback,
467
+ businessType: 'skc',
468
+ isAllowRepeatedSelect: parProps?.isAllowRepeatedSelect!==undefined ? !!parProps?.isAllowRepeatedSelect : true, // 默认开启一行选多次
469
+ };
470
+ const modalTableProps = {
471
+ modalTableTitle: '选择商品',
472
+ tableSearchForm: [
473
+ { name: 'qp-code-like', label: 'SKC编码' },
474
+ { name: 'qp-skcName-like', label: 'SKC名称' },
475
+ { name: 'qp-itemName-like', label: '商品名称' },
476
+ { name: 'qp-colorName-in', type: 'select', label: '颜色', field: {
477
+ type: 'select',
478
+ props: {
479
+ mode: 'multiple',
480
+ notFoundContent: '暂无数据',
481
+ allowClear: true,
482
+ showSearch: true,
483
+ showArrow: true,
484
+ maxTagCount: 1,
485
+ optionFilterProp: 'children',
486
+ filterOption: (input: string, option: { props: { children: string } }) =>
487
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
488
+ },
489
+ } },
490
+ { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
491
+ type: 'treeSelect',
492
+ props: {
493
+ treeData: [],
494
+ treeCheckable: true,
495
+ showSearch: true,
496
+ allowClear: true,
497
+ showArrow: true,
498
+ treeNodeFilterProp: 'title',
499
+ treeDefaultExpandAll: true,
500
+ maxTagCount: 1,
501
+ placeholder: '请选择',
502
+ style: {
503
+ width: '100%',
504
+ },
505
+ dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
506
+ },
507
+ } },
508
+ { name: 'qp-classId-in', type: 'select', label: '品类', field: {
509
+ type: 'select',
510
+ props: {
511
+ mode: 'multiple',
512
+ notFoundContent: '暂无数据',
513
+ allowClear: true,
514
+ showSearch: true,
515
+ showArrow: true,
516
+ maxTagCount: 1,
517
+ optionFilterProp: 'children',
518
+ filterOption: (input: string, option: { props: { children: string } }) =>
519
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
520
+ },
521
+ } },
522
+ { name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
523
+ type: 'select',
524
+ props: {
525
+ mode: 'multiple',
526
+ notFoundContent: '暂无数据',
527
+ allowClear: true,
528
+ showSearch: true,
529
+ showArrow: true,
530
+ maxTagCount: 1,
531
+ optionFilterProp: 'children',
532
+ filterOption: (input: string, option: { props: { children: string } }) =>
533
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
534
+ },
535
+ } },
536
+ ],
537
+ tableColumns: [
538
+ {
539
+ title: 'SKC编码',
540
+ width: 150,
541
+ dataIndex: 'code',
542
+ },
543
+ {
544
+ title: 'SKC名称',
545
+ width: 200,
546
+ ellipsis: {
547
+ showTitle: false,
548
+ },
549
+ render: (text: any) => (
550
+ <Tooltip placement="topLeft" title={text}>
551
+ {text}
552
+ </Tooltip>
553
+ ),
554
+ dataIndex: 'name',
555
+ },
556
+ {
557
+ title: '商品名称',
558
+ width: 100,
559
+ ellipsis: {
560
+ showTitle: false,
561
+ },
562
+ dataIndex: 'itemName',
563
+ render: (text: any) => (
564
+ <Tooltip placement="topLeft" title={text}>
565
+ {text}
566
+ </Tooltip>
567
+ ),
568
+ },
569
+ {
570
+ title: '颜色',
571
+ width: 100,
572
+ ellipsis: {
573
+ showTitle: false,
574
+ },
575
+ render: (text: any) => (
576
+ <Tooltip placement="topLeft" title={text}>
577
+ {text}
578
+ </Tooltip>
579
+ ),
580
+ dataIndex: 'colorName',
581
+ },
582
+ {
583
+ title: '类目',
584
+ width: 100,
585
+ ellipsis: {
586
+ showTitle: false,
587
+ },
588
+ render: (text: any) => (
589
+ <Tooltip placement="topLeft" title={text}>
590
+ {text}
591
+ </Tooltip>
592
+ ),
593
+ dataIndex: 'categoryName',
594
+ },
595
+ {
596
+ title: '品类',
597
+ width: 100,
598
+ ellipsis: {
599
+ showTitle: false,
600
+ },
601
+ render: (text: any) => (
602
+ <Tooltip placement="topLeft" title={text}>
603
+ {text}
604
+ </Tooltip>
605
+ ),
606
+ dataIndex: 'className',
607
+ },
608
+ {
609
+ title: '品牌',
610
+ width: 100,
611
+ ellipsis: {
612
+ showTitle: false,
613
+ },
614
+ render: (text: any) => (
615
+ <Tooltip placement="topLeft" title={text}>
616
+ {text}
617
+ </Tooltip>
618
+ ),
619
+ dataIndex: 'brandName',
620
+ },
621
+ ],
622
+ selectColumn: mTpSelectColumn,
623
+ }
624
+
625
+ return (
626
+ <div>
627
+ <AddSelect
628
+ {...props}
629
+ modalTableProps={modalTableProps}
630
+ />
631
+ </div>
632
+ );
633
+ };
634
+
635
+ export const AddSpuSelect = (parProps: any) => {
636
+ const selectProps = {
637
+ mode: 'multiple',
638
+ }
639
+ const [value, setValue] = useState(selectProps?.mode ? [] : null);
640
+ const [propertyList, setPropertyList] = useState([]);
641
+
642
+ useEffect(() => {
643
+ if(parProps?.isSingleColor) {
644
+ // type: 1 尺码组; 2 配码组
645
+ axios.get(`/items/itemPropertyValueGroup/listNoPage?qp-type-eq=2&qp-status-eq=1`).then((result: any) => {
646
+ result = result.data;
647
+ if ((result?.status && result.status !== '0') || (result?.code && result.code !== '000000')) {
648
+ message.error(result.msg);
649
+ return;
650
+ }
651
+ const data = result.data || [];
652
+ setPropertyList(data)
653
+ }).catch((err) => {});
654
+ }
655
+ },[])
656
+
657
+ //注⚠️:自定义过表头的请记得传tableCodeList参数
658
+ const initialSelectColumn = [
659
+ {
660
+ title: '商品编码',
661
+ width: 150,
662
+ dataIndex: 'itemCode',
663
+ },
664
+ {
665
+ title: '商品名称',
666
+ width: 200,
667
+ ellipsis: {
668
+ showTitle: false,
669
+ },
670
+ render: (text: any) => (
671
+ <Tooltip placement="topLeft" title={text}>
672
+ {text}
673
+ </Tooltip>
674
+ ),
675
+ dataIndex: 'name',
676
+ },
677
+ {
678
+ title: '颜色',
679
+ dataIndex: 'colorName',
680
+ width: 200,
681
+ isSelectItem: true,
682
+ dataSourceCode: 'colorValues',
683
+ dataSourceMapping: ['value', 'value']
684
+ },
685
+ {
686
+ title: '配码',
687
+ dataIndex: 'selectPropertyGroupCode',
688
+ width: 160,
689
+ isSelectItem: true,
690
+ dataSource: propertyList,
691
+ filterDataSourceCode: 'matchingCodes',
692
+ },
693
+ {
694
+ title: '数量',
695
+ width: 100,
696
+ isInputItem: true,
697
+ dataIndex: 'count',
698
+ },
699
+ {
700
+ title: '所属组织',
701
+ dataIndex: 'ownOrgSignName',
702
+ },
703
+ {
704
+ title: '品牌',
705
+ dataIndex: 'brandName',
706
+ },
707
+ {
708
+ title: '类目',
709
+ dataIndex: 'categoryText',
710
+ },
711
+ {
712
+ title: '品类',
713
+ dataIndex: 'className',
714
+ },
715
+ ]
716
+ const mTpSelectColumn = handleSelectColumn(initialSelectColumn, parProps)
717
+ const props = {
718
+ buttonText: parProps.buttonText || '新增',
719
+ buttonProps: parProps.buttonProps || {},
720
+ tableCodeList: parProps.tableCodeList || [],
721
+ value,
722
+ // labelInValue: true, // 非必填 默认为false
723
+ requestConfig: {
724
+ url: `/items/item`,
725
+ filter: 'qp-itemCode,name-orGroup,like', // 过滤参数
726
+ otherParams: {
727
+ 'qp-approveStatus-eq': 1, // 审核状态(0.待审批;1.审批通过;2.驳回;3.审批未通过)
728
+ 'qp-status-eq': 1,
729
+ sorter: 'desc-id',
730
+ ...(parProps?.requestConfig?.addOtherParams || {}), // 允许在默认参数基础上,追加/覆盖已有 参数
731
+ }, // 默认参数
732
+ mappingTextField: 'name',
733
+ mappingValueField: 'itemCode',
734
+ ...parProps.requestConfig
735
+ },
736
+ selectProps,
737
+ onChange: (value: any) => {
738
+ console.log(value)
739
+ setValue(value)
740
+ },
741
+ beforeShowModal: parProps?.beforeShowModal,
742
+ onSaveCallback: parProps.onSaveCallback,
743
+ businessType: 'spu',
744
+ isAllowRepeatedSelect: !!parProps?.isAllowRepeatedSelect,
745
+ };
746
+ const modalTableProps = {
747
+ modalTableTitle: '选择商品',
748
+ tableSearchForm: [
749
+ { name: 'qp-itemCode-like', label: '商品编码' },
750
+ { name: 'qp-name-like', label: '商品名称' },
751
+ { name: 'qp-ownOrgSign-in', type: 'select', label: '所属组织', field: {
752
+ type: 'select',
753
+ props: {
754
+ mode: 'multiple',
755
+ notFoundContent: '暂无数据',
756
+ allowClear: true,
757
+ showSearch: true,
758
+ showArrow: true,
759
+ maxTagCount: 1,
760
+ optionFilterProp: 'children',
761
+ filterOption: (input: string, option: { props: { children: string } }) =>
762
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
763
+ },
764
+ } },
765
+ { name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
766
+ type: 'select',
767
+ props: {
768
+ mode: 'multiple',
769
+ notFoundContent: '暂无数据',
770
+ allowClear: true,
771
+ showSearch: true,
772
+ showArrow: true,
773
+ maxTagCount: 1,
774
+ optionFilterProp: 'children',
775
+ filterOption: (input: string, option: { props: { children: string } }) =>
776
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
777
+ },
778
+ } },
779
+ { name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
780
+ type: 'treeSelect',
781
+ props: {
782
+ treeData: [],
783
+ treeCheckable: true,
784
+ showSearch: true,
785
+ allowClear: true,
786
+ showArrow: true,
787
+ treeNodeFilterProp: 'title',
788
+ treeDefaultExpandAll: true,
789
+ maxTagCount: 1,
790
+ placeholder: '请选择',
791
+ style: {
792
+ width: '100%',
793
+ },
794
+ dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
795
+ },
796
+ } },
797
+ { name: 'qp-classId-in', type: 'select', label: '品类', field: {
798
+ type: 'select',
799
+ props: {
800
+ mode: 'multiple',
801
+ notFoundContent: '暂无数据',
802
+ allowClear: true,
803
+ showSearch: true,
804
+ showArrow: true,
805
+ maxTagCount: 1,
806
+ optionFilterProp: 'children',
807
+ filterOption: (input: string, option: { props: { children: string } }) =>
808
+ option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
809
+ },
810
+ } },
811
+ ],
812
+ tableColumns: [
813
+ {
814
+ title: '商品编码',
815
+ width: 150,
816
+ dataIndex: 'itemCode',
817
+ },
818
+ {
819
+ title: '商品名称',
820
+ width: 200,
821
+ ellipsis: {
822
+ showTitle: false,
823
+ },
824
+ render: (text: any) => (
825
+ <Tooltip placement="topLeft" title={text}>
826
+ {text}
827
+ </Tooltip>
828
+ ),
829
+ dataIndex: 'name',
830
+ },
831
+ {
832
+ title: '所属组织',
833
+ width: 100,
834
+ ellipsis: {
835
+ showTitle: false,
836
+ },
837
+ render: (text: any) => (
838
+ <Tooltip placement="topLeft" title={text}>
839
+ {text}
840
+ </Tooltip>
841
+ ),
842
+ dataIndex: 'ownOrgSignName',
843
+ },
844
+ {
845
+ title: '品牌',
846
+ width: 100,
847
+ ellipsis: {
848
+ showTitle: false,
849
+ },
850
+ render: (text: any) => (
851
+ <Tooltip placement="topLeft" title={text}>
852
+ {text}
853
+ </Tooltip>
854
+ ),
855
+ dataIndex: 'brandName',
856
+ },
857
+ {
858
+ title: '类目',
859
+ width: 100,
860
+ ellipsis: {
861
+ showTitle: false,
862
+ },
863
+ render: (text: any) => (
864
+ <Tooltip placement="topLeft" title={text}>
865
+ {text}
866
+ </Tooltip>
867
+ ),
868
+ dataIndex: 'categoryName',
869
+ },
870
+ {
871
+ title: '品类',
872
+ width: 100,
873
+ ellipsis: {
874
+ showTitle: false,
875
+ },
876
+ render: (text: any) => (
877
+ <Tooltip placement="topLeft" title={text}>
878
+ {text}
879
+ </Tooltip>
880
+ ),
881
+ dataIndex: 'className',
882
+ },
883
+ ],
884
+ selectColumn: mTpSelectColumn
885
+ }
886
+
887
+ return (
888
+ <div>
889
+ <AddSelect
890
+ {...props}
891
+ modalTableProps={modalTableProps}
892
+ />
893
+ </div>
894
+ );
895
+ };