@bit-sun/business-component 2.3.24 → 2.3.26

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 (213) 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/JsonQueryTable/static.d.ts +1 -0
  17. package/dist/components/Business/SearchSelect/index.d.ts +1 -1
  18. package/dist/components/Business/moreTreeTable/FixedScrollBar.d.ts +1 -1
  19. package/dist/components/Functional/AddSelect/helps.d.ts +13 -0
  20. package/dist/components/Functional/BsAntdSula/BsCascader/index.d.ts +1 -1
  21. package/dist/components/Functional/SearchSelect/index.d.ts +1 -1
  22. package/dist/components/Solution/RuleComponent/InnerSelect.d.ts +11 -0
  23. package/dist/index.esm.js +1568 -1300
  24. package/dist/index.js +1568 -1300
  25. package/dist/utils/TableUtils.d.ts +2 -2
  26. package/dist/utils/utils.d.ts +1 -1
  27. package/docs/index.md +21 -21
  28. package/lib/assets/drag.svg +17 -17
  29. package/lib/assets/exportFail.svg +37 -37
  30. package/lib/assets/exportProcessing.svg +28 -28
  31. package/lib/assets/exportSuccess.svg +34 -34
  32. package/lib/assets/label_icon_bottom.svg +25 -25
  33. package/lib/assets/upExport.svg +22 -22
  34. package/package.json +78 -78
  35. package/src/assets/32.svg +27 -27
  36. package/src/assets/addIcon.svg +17 -17
  37. package/src/assets/allfunc.svg +27 -27
  38. package/src/assets/arrowRight.svg +24 -24
  39. package/src/assets/btn-delete.svg +29 -29
  40. package/src/assets/btn-edit.svg +19 -19
  41. package/src/assets/btn-more.svg +17 -17
  42. package/src/assets/btn-submit.svg +19 -19
  43. package/src/assets/caidan.svg +11 -11
  44. package/src/assets/close.svg +26 -26
  45. package/src/assets/drag.svg +17 -17
  46. package/src/assets/exportFail.svg +37 -37
  47. package/src/assets/exportProcessing.svg +28 -28
  48. package/src/assets/exportSuccess.svg +34 -34
  49. package/src/assets/fixed-left-active.svg +11 -11
  50. package/src/assets/fixed-left.svg +15 -15
  51. package/src/assets/fixed-right-active.svg +11 -11
  52. package/src/assets/fixed-right.svg +15 -15
  53. package/src/assets/guanbi.svg +15 -15
  54. package/src/assets/icon-quanping.svg +15 -15
  55. package/src/assets/icon-shezhi.svg +17 -17
  56. package/src/assets/label_icon_bottom.svg +25 -25
  57. package/src/assets/list-no-img.svg +21 -21
  58. package/src/assets/morentouxiang-32.svg +23 -23
  59. package/src/assets/scanning.svg +24 -24
  60. package/src/assets/upExport.svg +22 -22
  61. package/src/common/ENUM.ts +41 -41
  62. package/src/components/Business/AddSelectBusiness/index.md +162 -162
  63. package/src/components/Business/AddSelectBusiness/index.tsx +1060 -895
  64. package/src/components/Business/BsLayouts/Components/AllFunc/drawContent.tsx +111 -111
  65. package/src/components/Business/BsLayouts/Components/AllFunc/index.less +153 -153
  66. package/src/components/Business/BsLayouts/Components/AllFunc/index.tsx +70 -70
  67. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.less +90 -90
  68. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.tsx +37 -37
  69. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/leftTree.tsx +242 -242
  70. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/rightTree.tsx +384 -384
  71. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/DrawContent.tsx +285 -285
  72. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/customMenuHeader.tsx +74 -74
  73. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/drawContent.less +170 -170
  74. package/src/components/Business/BsLayouts/Components/CustomerMenu/index.less +64 -64
  75. package/src/components/Business/BsLayouts/Components/CustomerMenu/index.tsx +153 -153
  76. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.less +72 -72
  77. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.tsx +157 -157
  78. package/src/components/Business/BsLayouts/Components/RightContent/LoginModal.tsx +85 -85
  79. package/src/components/Business/BsLayouts/Components/RightContent/home.less +218 -218
  80. package/src/components/Business/BsLayouts/Components/RightContent/index.tsx +155 -155
  81. package/src/components/Business/BsLayouts/Components/SearchFunc/index.less +160 -160
  82. package/src/components/Business/BsLayouts/Components/SearchFunc/index.tsx +75 -75
  83. package/src/components/Business/BsLayouts/index.less +79 -79
  84. package/src/components/Business/BsLayouts/index.tsx +1484 -1484
  85. package/src/components/Business/BsLayouts/service.ts +10 -10
  86. package/src/components/Business/BsLayouts/utils.tsx +203 -203
  87. package/src/components/Business/BsSulaQueryTable/SearchItemSetting.tsx +564 -564
  88. package/src/components/Business/BsSulaQueryTable/index.less +221 -221
  89. package/src/components/Business/BsSulaQueryTable/index.tsx +535 -535
  90. package/src/components/Business/BsSulaQueryTable/setting.tsx +852 -852
  91. package/src/components/Business/BsSulaQueryTable/utils.less +65 -65
  92. package/src/components/Business/BsSulaQueryTable/utils.tsx +690 -688
  93. package/src/components/Business/CommodityEntry/index.md +70 -70
  94. package/src/components/Business/CommodityEntry/index.tsx +80 -80
  95. package/src/components/Business/CommonAlert/index.tsx +23 -23
  96. package/src/components/Business/CommonGuideWrapper/index.less +111 -111
  97. package/src/components/Business/CommonGuideWrapper/index.md +39 -39
  98. package/src/components/Business/CommonGuideWrapper/index.tsx +83 -83
  99. package/src/components/Business/DetailPageWrapper/index.less +79 -79
  100. package/src/components/Business/DetailPageWrapper/index.tsx +313 -314
  101. package/src/components/Business/DetailPageWrapper/utils.tsx +100 -100
  102. package/src/components/Business/HomePageWrapper/index.less +33 -33
  103. package/src/components/Business/HomePageWrapper/index.md +45 -45
  104. package/src/components/Business/HomePageWrapper/index.tsx +162 -162
  105. package/src/components/Business/JsonQueryTable/components/FieldsModifyModal.tsx +824 -824
  106. package/src/components/Business/JsonQueryTable/components/FieldsSettingsTable.tsx +205 -205
  107. package/src/components/Business/JsonQueryTable/components/Formula.tsx +205 -205
  108. package/src/components/Business/JsonQueryTable/components/MaintainOptions.tsx +127 -127
  109. package/src/components/Business/JsonQueryTable/configButton/index.js +20 -20
  110. package/src/components/Business/JsonQueryTable/configTree/component/compactArrayView.js +25 -25
  111. package/src/components/Business/JsonQueryTable/configTree/component/compactObjectView.js +30 -30
  112. package/src/components/Business/JsonQueryTable/configTree/index.js +82 -82
  113. package/src/components/Business/JsonQueryTable/configTree/index.less +44 -44
  114. package/src/components/Business/JsonQueryTable/configTree/parser/highlight.js +57 -57
  115. package/src/components/Business/JsonQueryTable/configTree/parser/index.js +124 -124
  116. package/src/components/Business/JsonQueryTable/configTree/render/iconRender.js +29 -29
  117. package/src/components/Business/JsonQueryTable/configTree/render/nameRender.js +22 -22
  118. package/src/components/Business/JsonQueryTable/configTree/treeNode.js +116 -116
  119. package/src/components/Business/JsonQueryTable/drawer/index.tsx +12 -12
  120. package/src/components/Business/JsonQueryTable/function.ts +62 -62
  121. package/src/components/Business/JsonQueryTable/index.less +16 -16
  122. package/src/components/Business/JsonQueryTable/index.md +328 -328
  123. package/src/components/Business/JsonQueryTable/index.tsx +535 -535
  124. package/src/components/Business/JsonQueryTable/jsonEditor/index.js +346 -346
  125. package/src/components/Business/JsonQueryTable/jsonEditor/index.less +22 -22
  126. package/src/components/Business/JsonQueryTable/jsonEditor/lint/basicType.js +147 -147
  127. package/src/components/Business/JsonQueryTable/jsonEditor/lint/index.js +389 -389
  128. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/actions.js +118 -118
  129. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/dependency.js +22 -22
  130. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/index.js +21 -21
  131. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/request.js +65 -65
  132. package/src/components/Business/JsonQueryTable/static.ts +407 -390
  133. package/src/components/Business/SearchSelect/BusinessUtils.ts +1762 -1762
  134. package/src/components/Business/SearchSelect/common.ts +75 -75
  135. package/src/components/Business/SearchSelect/index.md +1329 -1329
  136. package/src/components/Business/SearchSelect/index.tsx +55 -55
  137. package/src/components/Business/SearchSelect/utils.ts +100 -100
  138. package/src/components/Business/StateFlow/index.less +130 -130
  139. package/src/components/Business/StateFlow/index.md +60 -60
  140. package/src/components/Business/StateFlow/index.tsx +29 -29
  141. package/src/components/Business/TreeSearchSelect/index.md +185 -156
  142. package/src/components/Business/TreeSearchSelect/index.tsx +33 -33
  143. package/src/components/Business/TreeSearchSelect/utils.ts +86 -75
  144. package/src/components/Business/columnSettingTable/columnSetting.tsx +764 -764
  145. package/src/components/Business/columnSettingTable/index.less +247 -247
  146. package/src/components/Business/columnSettingTable/index.md +357 -357
  147. package/src/components/Business/columnSettingTable/index.tsx +232 -232
  148. package/src/components/Business/columnSettingTable/sulaSettingTable.tsx +240 -240
  149. package/src/components/Business/columnSettingTable/utils.tsx +71 -69
  150. package/src/components/Business/moreTreeTable/FixedScrollBar.tsx +87 -87
  151. package/src/components/Business/moreTreeTable/hooks/useSticky.ts +21 -21
  152. package/src/components/Business/moreTreeTable/index.less +99 -99
  153. package/src/components/Business/moreTreeTable/index.md +448 -448
  154. package/src/components/Business/moreTreeTable/index.tsx +387 -387
  155. package/src/components/Business/moreTreeTable/utils.ts +126 -126
  156. package/src/components/Functional/AddSelect/helps.ts +79 -14
  157. package/src/components/Functional/AddSelect/index.less +367 -367
  158. package/src/components/Functional/AddSelect/index.md +155 -155
  159. package/src/components/Functional/AddSelect/index.tsx +1170 -1282
  160. package/src/components/Functional/BillEntry/index.less +371 -371
  161. package/src/components/Functional/BillEntry/index.md +39 -39
  162. package/src/components/Functional/BillEntry/index.tsx +772 -772
  163. package/src/components/Functional/BsAntdSula/BsCascader/index.md +62 -62
  164. package/src/components/Functional/BsAntdSula/BsCascader/index.tsx +178 -178
  165. package/src/components/Functional/BsAntdSula/index.ts +2 -2
  166. package/src/components/Functional/DataImport/index.less +63 -63
  167. package/src/components/Functional/DataImport/index.md +44 -44
  168. package/src/components/Functional/DataImport/index.tsx +695 -695
  169. package/src/components/Functional/DataValidation/index.less +63 -63
  170. package/src/components/Functional/DataValidation/index.md +39 -39
  171. package/src/components/Functional/DataValidation/index.tsx +687 -687
  172. package/src/components/Functional/EllipsisTooltip/index.d.ts +5 -5
  173. package/src/components/Functional/EllipsisTooltip/index.js +36 -36
  174. package/src/components/Functional/EllipsisTooltip/index.md +30 -30
  175. package/src/components/Functional/ExportFunctions/ExportIcon/index.md +37 -37
  176. package/src/components/Functional/ExportFunctions/ExportIcon/index.tsx +59 -59
  177. package/src/components/Functional/QueryMutipleInput/index.less +37 -37
  178. package/src/components/Functional/QueryMutipleInput/index.md +33 -33
  179. package/src/components/Functional/QueryMutipleInput/index.tsx +128 -128
  180. package/src/components/Functional/SearchSelect/index.less +115 -115
  181. package/src/components/Functional/SearchSelect/index.md +141 -141
  182. package/src/components/Functional/SearchSelect/index.tsx +879 -879
  183. package/src/components/Functional/SearchSelect/utils.ts +3 -3
  184. package/src/components/Functional/TreeSearchSelect/index.md +47 -47
  185. package/src/components/Functional/TreeSearchSelect/index.tsx +199 -199
  186. package/src/components/Solution/RuleComponent/Formula.tsx +335 -335
  187. package/src/components/Solution/RuleComponent/InnerSelect.tsx +62 -0
  188. package/src/components/Solution/RuleComponent/index.d.ts +29 -29
  189. package/src/components/Solution/RuleComponent/index.js +2041 -2032
  190. package/src/components/Solution/RuleComponent/index.less +230 -230
  191. package/src/components/Solution/RuleComponent/renderSpecificAction.js +99 -99
  192. package/src/components/Solution/RuleComponent/ruleFiled.js +2175 -2107
  193. package/src/components/Solution/RuleComponent/services.ts +13 -13
  194. package/src/components/Solution/RuleComponent/util.js +139 -139
  195. package/src/index.ts +38 -38
  196. package/src/plugin/TableColumnSetting/index.less +247 -247
  197. package/src/plugin/TableColumnSetting/index.md +50 -50
  198. package/src/plugin/TableColumnSetting/index.tsx +724 -724
  199. package/src/plugin/TableColumnSetting/utils.ts +19 -19
  200. package/src/styles/bsDefault.less +1912 -1912
  201. package/src/utils/CheckOneUser/index.md +39 -39
  202. package/src/utils/CheckOneUser/index.ts +51 -51
  203. package/src/utils/LocalstorageUtils.ts +95 -95
  204. package/src/utils/TableUtils.tsx +18 -18
  205. package/src/utils/checkUtils.ts +39 -39
  206. package/src/utils/enumConfig.ts +11 -11
  207. package/src/utils/getFormMode.js +12 -12
  208. package/src/utils/index.ts +4 -4
  209. package/src/utils/requestUtils.ts +34 -34
  210. package/src/utils/serialize.js +7 -7
  211. package/src/utils/utils.ts +212 -212
  212. package/tsconfig.json +29 -29
  213. package/typings.d.ts +4 -4
@@ -1,2107 +1,2175 @@
1
- import React, { Component } from 'react';
2
- import { Select, Input, InputNumber, DatePicker, TimePicker } from 'antd';
3
- import styles from './index.less';
4
- import { getRegularThresholdRange } from './services';
5
- import moment from 'moment';
6
- import { handleError, judgeIsEmpty } from '../../../utils/utils';
7
- import { queryIdentityInfo, findChangedThresholdQuery, setParams } from './util';
8
- import { request as SulaRequest } from 'bssula';
9
- import { stringify } from 'querystring';
10
- import {
11
- BusinessSearchSelect,
12
- BusinessTreeSearchSelect,
13
- BsCascader
14
- } from '../../../index';
15
- const { RangePicker } = DatePicker;
16
-
17
- export default class RuleField extends Component {
18
- constructor(props) {
19
- super(props);
20
- this.state = {
21
- selectOperation: '',
22
- dataTypeCode: '',
23
- dataChoiceBusinessType: '',
24
- dataInputBusinessType: '',
25
- fieldValues: [],
26
- thresholdQuery: {},
27
- thresholdList: [],
28
- options: [],
29
- };
30
- }
31
-
32
- componentDidMount() {
33
- const {
34
- selectOperation,
35
- dataTypeCode,
36
- dataChoiceBusinessType,
37
- dataInputBusinessType,
38
- options,
39
- values,
40
- initialThresholdQuery,
41
- queryIdentify,
42
- propertyCode,
43
- queryIdentifyType,
44
- } = this.props;
45
- this.setState(
46
- {
47
- selectOperation,
48
- thresholdQuery: initialThresholdQuery
49
- ? {
50
- ...initialThresholdQuery,
51
- }
52
- : {},
53
- dataTypeCode,
54
- dataChoiceBusinessType,
55
- dataInputBusinessType,
56
- fieldValues: [...values],
57
- options,
58
- },
59
- () => {
60
- !judgeIsEmpty(queryIdentify) &&
61
- this.getRegularThresholdRange(
62
- queryIdentify,
63
- propertyCode,
64
- queryIdentifyType,
65
- );
66
- },
67
- );
68
- window.addEventListener('testEvent', this.eventHandle);
69
- }
70
-
71
- eventHandle = (obj) => {
72
- const { thresholdQuery } = this.state;
73
- const { queryIdentify, propertyCode, queryIdentifyType } = this.props;
74
- this.setState(
75
- {
76
- thresholdQuery: {
77
- ...thresholdQuery,
78
- ...obj.data,
79
- },
80
- },
81
- () => {
82
- this.getRegularThresholdRange(
83
- queryIdentify,
84
- propertyCode,
85
- queryIdentifyType,
86
- );
87
- },
88
- );
89
- };
90
-
91
- componentWillUnmount() {
92
- window.removeEventListener('testEvent', this.eventHandle);
93
- }
94
-
95
- componentWillReceiveProps(nextProps) {
96
- if (nextProps.selectOperation != this.props.selectOperation) {
97
- this.setState({
98
- selectOperation: nextProps.selectOperation,
99
- });
100
- }
101
- if (nextProps.dataTypeCode != this.props.dataTypeCode) {
102
- this.setState({
103
- dataTypeCode: nextProps.dataTypeCode,
104
- });
105
- }
106
- if (nextProps.dataChoiceBusinessType != this.props.dataChoiceBusinessType) {
107
- this.setState({
108
- dataChoiceBusinessType: nextProps.dataChoiceBusinessType,
109
- });
110
- }
111
- if (nextProps.dataInputBusinessType != this.props.dataInputBusinessType) {
112
- this.setState({
113
- dataInputBusinessType: nextProps.dataInputBusinessType,
114
- });
115
- }
116
- // if (nextProps.selectOperation != this.props.selectOperation) {
117
- // this.setState({
118
- // options: nextProps.options
119
- // })
120
- // }
121
- if (
122
- nextProps.queryIdentify &&
123
- nextProps.queryIdentify != this.props.queryIdentify
124
- ) {
125
- this.getRegularThresholdRange(
126
- nextProps.queryIdentify,
127
- nextProps.propertyCode,
128
- nextProps.queryIdentifyType,
129
- );
130
- }
131
-
132
- if (
133
- JSON.stringify(nextProps.initialThresholdQuery) !=
134
- JSON.stringify(this.props.initialThresholdQuery)
135
- ) {
136
- console.log(
137
- findChangedThresholdQuery(
138
- this.props.initialThresholdQuery,
139
- nextProps.initialThresholdQuery,
140
- ),
141
- );
142
- let changedPropsVal = findChangedThresholdQuery(
143
- this.props.initialThresholdQuery,
144
- nextProps.initialThresholdQuery,
145
- );
146
- this.setState(
147
- {
148
- thresholdQuery: {
149
- ...nextProps.initialThresholdQuery,
150
- },
151
- },
152
- () => {
153
- if (changedPropsVal.indexOf(nextProps.propertyCode) > -1) {
154
- this.getRegularThresholdRange(
155
- nextProps.queryIdentify,
156
- nextProps.propertyCode,
157
- nextProps.queryIdentifyType,
158
- );
159
- }
160
- },
161
- );
162
- }
163
- }
164
-
165
- //规则对象属性枚举值查询处理 queryIdentify有值是表示该属性有枚举选择
166
- getRegularThresholdRange = async (
167
- queryIdentify,
168
- propertyCode,
169
- queryIdentifyType,
170
- ) => {
171
- if (!queryIdentify) return;
172
- const { thresholdQuery } = this.state;
173
- let extraRequestUrl = '';
174
- let querParams = setParams(propertyCode, thresholdQuery);
175
- if (queryIdentityInfo.find((item) => item.identity == propertyCode)) {
176
- //判断查询属性枚举时有没有必传参数,如果必传参数没有值则不调用查询接口
177
- let needQueryList = queryIdentityInfo
178
- .find((item) => item.identity == propertyCode)
179
- .queryParam.filter((item) => item.isRequired)
180
- .map((item) => item.queryKey);
181
- if (
182
- needQueryList.some(
183
- (item) => !querParams[item] || !querParams[item].length,
184
- )
185
- ) {
186
- return;
187
- }
188
- extraRequestUrl =
189
- queryIdentityInfo.find((item) => item.identity == propertyCode)
190
- .requestUrl || '';
191
- }
192
- if (queryIdentifyType === 'dictCodeIdentify') {
193
- extraRequestUrl = `bscDictItem/selectDictItemsByDictCode`; // 字典接口
194
- querParams = { dictCode: queryIdentify };
195
- } else if (queryIdentifyType === 'dynamicDictCodeIdentify') {
196
- extraRequestUrl = `dictDynamicItem/getDynamicData/${queryIdentify}`; // 字典接口
197
- // querParams = { dictCode: queryIdentify }
198
- }
199
-
200
- if (extraRequestUrl) {
201
- if (queryIdentify == 'maintain_area_code') {
202
- extraRequestUrl = `/basic/${extraRequestUrl}${
203
- querParams.memberCardCode
204
- }?${stringify(querParams)}`;
205
- } else if (queryIdentifyType == 'dictCodeIdentify') {
206
- extraRequestUrl = `/basic/${extraRequestUrl}?${stringify(querParams)}`;
207
- } else if (queryIdentifyType == 'dynamicDictCodeIdentify') {
208
- extraRequestUrl = `/basic/${extraRequestUrl}`;
209
- }
210
-
211
- SulaRequest({
212
- url: extraRequestUrl,
213
- method: 'get',
214
- converter: (res) => {
215
- if (handleError(res)) {
216
- let handleData = res?.data || [];
217
- if (queryIdentifyType === 'dictCodeIdentify') {
218
- handleData = handleData?.length
219
- ? handleData.map((i) => ({
220
- code: i.dictItemCode,
221
- name: i.dictItemName,
222
- }))
223
- : [];
224
- }
225
- if (queryIdentifyType === 'dynamicDictCodeIdentify') {
226
- handleData = handleData?.length
227
- ? handleData.map((i) => ({
228
- code: i.code.toString(),
229
- name: i.name,
230
- }))
231
- : [];
232
- }
233
- this.setState({
234
- thresholdList: handleData,
235
- });
236
- }
237
- return handleData;
238
- },
239
- });
240
- } else {
241
- if (queryIdentifyType == 'objectPropertyListIdentify') {
242
- this.setState({
243
- thresholdList: queryIdentify,
244
- });
245
- } else if (queryIdentifyType == 'objectPropertyCodeIdentify') {
246
- // TODO待处理
247
- this.setState({
248
- thresholdList: [],
249
- });
250
- } else {
251
- querParams.queryIdentify = queryIdentify;
252
- let res = await getRegularThresholdRange(querParams);
253
- if (handleError(res)) {
254
- this.setState({
255
- thresholdList: res?.data || [],
256
- });
257
- }
258
- }
259
- }
260
- };
261
-
262
- renderConditionField = () => {
263
- let {
264
- selectOperation,
265
- dataTypeCode,
266
- dataChoiceBusinessType,
267
- dataInputBusinessType,
268
- options,
269
- values,
270
- valueNames,
271
- callback,
272
- queryIdentify,
273
- disabled,
274
- customerWidth,
275
- } = this.props;
276
- const { thresholdList } = this.state;
277
- const dateFormat = 'YYYY-MM-DD';
278
- const fullDateFormat = 'YYYY-MM-DD HH:mm:ss';
279
- const styleCommon = {
280
- width: customerWidth || '150px',
281
- };
282
- if (!selectOperation) return <Input disabled style={styleCommon}></Input>;
283
- const SET_TYPE = ['in', 'nin', 'cn', 'ncn']; //集合类型
284
- const INTERVAL_TYPE = ['be', 'bed', 'nbe', 'nbed', 'ber', 'bel']; //区间类型
285
- const IS_KONG = ['en']; // 为空
286
- if (IS_KONG.indexOf(selectOperation) > -1) {
287
- return '';
288
- }
289
- // queryIdentify有值是表示该属性有枚举选择
290
- if (!judgeIsEmpty(queryIdentify)) {
291
- if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
292
- return (
293
- <>
294
- <Select
295
- disabled={disabled}
296
- showSearch
297
- filterOption={(input, option) =>
298
- option.props.children
299
- ?.toLowerCase()
300
- .indexOf(input.toLowerCase()) >= 0
301
- }
302
- onChange={(value, option) => {
303
- values[0] = value;
304
- valueNames[0] = option?.props?.children || '';
305
- callback(values, valueNames);
306
- }}
307
- value={values[0]}
308
- style={styleCommon}
309
- >
310
- {thresholdList.map((item) => (
311
- <Select.Option value={item.code}>{item.name}</Select.Option>
312
- ))}
313
- </Select>
314
- <span>~</span>
315
- <Select
316
- value={values[1]}
317
- disabled={disabled}
318
- showSearch
319
- filterOption={(input, option) =>
320
- option.props.children
321
- ?.toLowerCase()
322
- .indexOf(input.toLowerCase()) >= 0
323
- }
324
- onChange={(value, option) => {
325
- values[1] = value;
326
- valueNames[1] = option?.props?.children || '';
327
- callback(values, valueNames);
328
- }}
329
- style={styleCommon}
330
- >
331
- {thresholdList.map((item) => (
332
- <Select.Option value={item.code}>{item.name}</Select.Option>
333
- ))}
334
- </Select>
335
- </>
336
- );
337
- } else {
338
- return (
339
- <Select
340
- disabled={disabled}
341
- showSearch
342
- filterOption={(input, option) =>
343
- option.props.children
344
- ?.toLowerCase()
345
- .indexOf(input.toLowerCase()) >= 0
346
- }
347
- onChange={(value, option) => {
348
- if (SET_TYPE.indexOf(selectOperation) > -1) {
349
- let valueNames1 = Array.isArray(option)
350
- ? option.map((item) => item?.props?.children || '')
351
- : [];
352
- values = [...value];
353
- valueNames = [...valueNames1];
354
- } else {
355
- values = [value];
356
- valueNames = [option?.props?.children || ''];
357
- }
358
- callback(values, valueNames);
359
- }}
360
- value={SET_TYPE.indexOf(selectOperation) > -1 ? values : values[0]}
361
- style={styleCommon}
362
- mode={
363
- SET_TYPE.indexOf(selectOperation) > -1 ? 'multiple' : 'default'
364
- }
365
- >
366
- {thresholdList.map((item) => (
367
- <Select.Option value={item.code}>{item.name}</Select.Option>
368
- ))}
369
- </Select>
370
- );
371
- }
372
- } else if (dataInputBusinessType == 11 || dataInputBusinessType == 12) {
373
- // 11 单选 12 多选
374
- // 物理仓
375
- if (dataChoiceBusinessType == 110) {
376
- if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
377
- return (
378
- <>
379
- <BusinessSearchSelect
380
- selectBusinessType="physicalWarehouse"
381
- selectProps={{
382
- style: styleCommon,
383
- placeholder: '请选择物理仓',
384
- ...(dataInputBusinessType === 12
385
- ? {
386
- mode: 'multiple',
387
- maxTagCount: 1,
388
- }
389
- : {}),
390
- }}
391
- disabled={disabled}
392
- labelInValue={true}
393
- value={values[0]}
394
- requestConfig={{
395
- mappingValueField: 'physicalWarehouseCode',
396
- filterInit: 'qp-physicalWarehouseCode-in',
397
- }}
398
- onChange={(value) => {
399
- if (dataInputBusinessType === 12) {
400
- values[0] = value.map((i) => i.key);
401
- valueNames[0] = value.map((i) => i.label || '');
402
- } else {
403
- values[0] = [value.key];
404
- valueNames[0] = [value.label || ''];
405
- }
406
- callback(values, valueNames);
407
- }}
408
- getPopupContainer={() => document.body}
409
- />
410
- <span>~</span>
411
- <BusinessSearchSelect
412
- selectBusinessType="physicalWarehouse"
413
- selectProps={{
414
- style: styleCommon,
415
- placeholder: '请选择物理仓',
416
- ...(dataInputBusinessType === 12
417
- ? {
418
- mode: 'multiple',
419
- maxTagCount: 1,
420
- }
421
- : {}),
422
- }}
423
- disabled={disabled}
424
- labelInValue={true}
425
- value={values[1]}
426
- requestConfig={{
427
- mappingValueField: 'physicalWarehouseCode',
428
- filterInit: 'qp-physicalWarehouseCode-in',
429
- }}
430
- onChange={(value) => {
431
- if (dataInputBusinessType === 12) {
432
- values[1] = value.map((i) => i.key);
433
- valueNames[1] = value.map((i) => i.label || '');
434
- } else {
435
- values[1] = [value.key];
436
- valueNames[1] = [value.label || ''];
437
- }
438
- callback(values, valueNames);
439
- }}
440
- getPopupContainer={() => document.body}
441
- />
442
- </>
443
- );
444
- } else {
445
- const currentValue = dataInputBusinessType === 12 ?
446
- values?.map((s,vIndex)=> ({key: s, label: valueNames[vIndex]}))||[]
447
- : values[0]&&{key:values[0],label:valueNames[0]}||{}
448
- return (
449
- <BusinessSearchSelect
450
- selectBusinessType="physicalWarehouse"
451
- selectProps={{
452
- style: styleCommon,
453
- placeholder: '请选择物理仓',
454
- ...(dataInputBusinessType === 12
455
- ? {
456
- mode: 'multiple',
457
- maxTagCount: 1,
458
- }
459
- : {}),
460
- }}
461
- disabled={disabled}
462
- labelInValue={true}
463
- value={currentValue}
464
- requestConfig={{
465
- mappingValueField: 'physicalWarehouseCode',
466
- filterInit: 'qp-physicalWarehouseCode-in',
467
- }}
468
- onChange={(value) => {
469
- if (dataInputBusinessType === 12) {
470
- values = value.map((i) => i.key)||[];
471
- valueNames = value.map((i) => i.label || '')||[];
472
- } else {
473
- values = value?.key?[value.key]:[];
474
- valueNames = value?.label?[value.label]:[];
475
- }
476
- callback(values, valueNames);
477
- }}
478
- getPopupContainer={() => document.body}
479
- />
480
- );
481
- }
482
- }
483
- // 逻辑仓
484
- if (dataChoiceBusinessType == 120) {
485
- if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
486
- return (
487
- <>
488
- <BusinessSearchSelect
489
- selectBusinessType="realWarehouse"
490
- selectProps={{
491
- style: styleCommon,
492
- placeholder: '请选择逻辑仓',
493
- ...(dataInputBusinessType === 12
494
- ? {
495
- mode: 'multiple',
496
- maxTagCount: 1,
497
- }
498
- : {}),
499
- }}
500
- disabled={disabled}
501
- labelInValue={true}
502
- value={values[0]}
503
- requestConfig={{
504
- mappingValueField: 'realWarehouseCode',
505
- filterInit: 'qp-realWarehouseCode-in',
506
- }}
507
- onChange={(value) => {
508
- if (dataInputBusinessType === 12) {
509
- values[0] = value.map((i) => i.key);
510
- valueNames[0] = value.map((i) => i.label || '');
511
- } else {
512
- values[0] = [value.key];
513
- valueNames[0] = [value.label || ''];
514
- }
515
- callback(values, valueNames);
516
- }}
517
- getPopupContainer={() => document.body}
518
- />
519
- <span>~</span>
520
- <BusinessSearchSelect
521
- selectBusinessType="realWarehouse"
522
- selectProps={{
523
- style: styleCommon,
524
- placeholder: '请选择逻辑仓',
525
- ...(dataInputBusinessType === 12
526
- ? {
527
- mode: 'multiple',
528
- maxTagCount: 1,
529
- }
530
- : {}),
531
- }}
532
- disabled={disabled}
533
- labelInValue={true}
534
- value={values[1]}
535
- requestConfig={{
536
- mappingValueField: 'realWarehouseCode',
537
- filterInit: 'qp-realWarehouseCode-in',
538
- }}
539
- onChange={(value) => {
540
- if (dataInputBusinessType === 12) {
541
- values[1] = value.map((i) => i.key);
542
- valueNames[1] = value.map((i) => i.label || '');
543
- } else {
544
- values[1] = [value.key];
545
- valueNames[1] = [value.label || ''];
546
- }
547
- callback(values, valueNames);
548
- }}
549
- getPopupContainer={() => document.body}
550
- />
551
- </>
552
- );
553
- } else {
554
- const currentValue = dataInputBusinessType === 12 ?
555
- values?.map((s,vIndex)=> ({key: s, label: valueNames[vIndex]}))||[]
556
- : values[0]&&{key:values[0],label:valueNames[0]}||{}
557
- return (
558
- <BusinessSearchSelect
559
- selectBusinessType="realWarehouse"
560
- selectProps={{
561
- style: styleCommon,
562
- placeholder: '请选择逻辑仓',
563
- ...(dataInputBusinessType === 12
564
- ? {
565
- mode: 'multiple',
566
- maxTagCount: 1,
567
- }
568
- : {}),
569
- }}
570
- disabled={disabled}
571
- labelInValue={true}
572
- value={currentValue}
573
- requestConfig={{
574
- mappingValueField: 'realWarehouseCode',
575
- filterInit: 'qp-realWarehouseCode-in',
576
- }}
577
- onChange={(value) => {
578
- if (dataInputBusinessType === 12) {
579
- values = value.map((i) => i.key)||[];
580
- valueNames = value.map((i) => i.label || '')||[];
581
- } else {
582
- values = value?.key?[value.key]:[];
583
- valueNames = value?.label?[value.label]:[];
584
- }
585
- callback(values, valueNames);
586
- }}
587
- getPopupContainer={() => document.body}
588
- />
589
- );
590
- }
591
- }
592
- // 虚拟仓
593
- if (dataChoiceBusinessType == 130) {
594
- if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
595
- return (
596
- <>
597
- <BusinessSearchSelect
598
- selectBusinessType="virtualWarehouse"
599
- selectProps={{
600
- style: styleCommon,
601
- placeholder: '请选择虚拟仓',
602
- ...(dataInputBusinessType === 12
603
- ? {
604
- mode: 'multiple',
605
- maxTagCount: 1,
606
- }
607
- : {}),
608
- }}
609
- disabled={disabled}
610
- labelInValue={true}
611
- value={values[0]}
612
- requestConfig={{
613
- mappingValueField: 'virtualWarehouseCode',
614
- filterInit: 'qp-virtualWarehouseCode-in',
615
- }}
616
- onChange={(value) => {
617
- if (dataInputBusinessType === 12) {
618
- values[0] = value.map((i) => i.key);
619
- valueNames[0] = value.map((i) => i.label || '');
620
- } else {
621
- values[0] = [value.key];
622
- valueNames[0] = [value.label || ''];
623
- }
624
- callback(values, valueNames);
625
- }}
626
- getPopupContainer={() => document.body}
627
- />
628
- <span>~</span>
629
- <BusinessSearchSelect
630
- selectBusinessType="virtualWarehouse"
631
- selectProps={{
632
- style: styleCommon,
633
- placeholder: '请选择虚拟仓',
634
- ...(dataInputBusinessType === 12
635
- ? {
636
- mode: 'multiple',
637
- maxTagCount: 1,
638
- }
639
- : {}),
640
- }}
641
- disabled={disabled}
642
- labelInValue={true}
643
- value={values[1]}
644
- requestConfig={{
645
- mappingValueField: 'virtualWarehouseCode',
646
- filterInit: 'qp-virtualWarehouseCode-in',
647
- }}
648
- onChange={(value) => {
649
- if (dataInputBusinessType === 12) {
650
- values[1] = value.map((i) => i.key);
651
- valueNames[1] = value.map((i) => i.label || '');
652
- } else {
653
- values[1] = [value.key];
654
- valueNames[1] = [value.label || ''];
655
- }
656
- callback(values, valueNames);
657
- }}
658
- getPopupContainer={() => document.body}
659
- />
660
- </>
661
- );
662
- } else {
663
- const currentValue = dataInputBusinessType === 12 ?
664
- values?.map((s,vIndex)=> ({key: s, label: valueNames[vIndex]}))||[]
665
- : values[0]&&{key:values[0],label:valueNames[0]}||{}
666
- return (
667
- <BusinessSearchSelect
668
- selectBusinessType="virtualWarehouse"
669
- selectProps={{
670
- style: styleCommon,
671
- placeholder: '请选择虚拟仓',
672
- ...(dataInputBusinessType === 12
673
- ? {
674
- mode: 'multiple',
675
- maxTagCount: 1,
676
- }
677
- : {}),
678
- }}
679
- disabled={disabled}
680
- labelInValue={true}
681
- value={currentValue}
682
- requestConfig={{
683
- mappingValueField: 'virtualWarehouseCode',
684
- filterInit: 'qp-virtualWarehouseCode-in',
685
- }}
686
- onChange={(value) => {
687
- if (dataInputBusinessType === 12) {
688
- values = value.map((i) => i.key)||[];
689
- valueNames = value.map((i) => i.label || '')||[];
690
- } else {
691
- values = value?.key?[value.key]:[];
692
- valueNames = value?.label?[value.label]:[];
693
- }
694
- callback(values, valueNames);
695
- }}
696
- getPopupContainer={() => document.body}
697
- />
698
- );
699
- }
700
- }
701
- // 渠道仓
702
- if (dataChoiceBusinessType == 140) {
703
- if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
704
- return (
705
- <>
706
- <BusinessSearchSelect
707
- selectBusinessType="channelWarehouse"
708
- selectProps={{
709
- style: styleCommon,
710
- placeholder: '请选择渠道仓',
711
- ...(dataInputBusinessType === 12
712
- ? {
713
- mode: 'multiple',
714
- maxTagCount: 1,
715
- }
716
- : {}),
717
- }}
718
- disabled={disabled}
719
- labelInValue={true}
720
- value={values[0]}
721
- requestConfig={{
722
- mappingValueField: 'channelWarehouseCode',
723
- filterInit: 'qp-channelWarehouseCode-in',
724
- }}
725
- onChange={(value) => {
726
- if (dataInputBusinessType === 12) {
727
- values[0] = value.map((i) => i.key);
728
- valueNames[0] = value.map((i) => i.label || '');
729
- } else {
730
- values[0] = [value.key];
731
- valueNames[0] = [value.label || ''];
732
- }
733
- callback(values, valueNames);
734
- }}
735
- getPopupContainer={() => document.body}
736
- />
737
- <span>~</span>
738
- <BusinessSearchSelect
739
- selectBusinessType="channelWarehouse"
740
- selectProps={{
741
- style: styleCommon,
742
- placeholder: '请选择渠道仓',
743
- ...(dataInputBusinessType === 12
744
- ? {
745
- mode: 'multiple',
746
- maxTagCount: 1,
747
- }
748
- : {}),
749
- }}
750
- disabled={disabled}
751
- labelInValue={true}
752
- value={values[1]}
753
- requestConfig={{
754
- mappingValueField: 'channelWarehouseCode',
755
- filterInit: 'qp-channelWarehouseCode-in',
756
- }}
757
- onChange={(value) => {
758
- if (dataInputBusinessType === 12) {
759
- values[1] = value.map((i) => i.key);
760
- valueNames[1] = value.map((i) => i.label || '');
761
- } else {
762
- values[1] = [value.key];
763
- valueNames[1] = [value.label || ''];
764
- }
765
- callback(values, valueNames);
766
- }}
767
- getPopupContainer={() => document.body}
768
- />
769
- </>
770
- );
771
- } else {
772
- const currentValue = dataInputBusinessType === 12 ?
773
- values?.map((s,vIndex)=> ({key: s, label: valueNames[vIndex]}))||[]
774
- : values[0]&&{key:values[0],label:valueNames[0]}||{}
775
- return (
776
- <BusinessSearchSelect
777
- selectBusinessType="channelWarehouse"
778
- selectProps={{
779
- style: styleCommon,
780
- placeholder: '请选择渠道仓',
781
- ...(dataInputBusinessType === 12
782
- ? {
783
- mode: 'multiple',
784
- maxTagCount: 1,
785
- }
786
- : {}),
787
- }}
788
- disabled={disabled}
789
- labelInValue={true}
790
- value={currentValue}
791
- requestConfig={{
792
- mappingValueField: 'channelWarehouseCode',
793
- filterInit: 'qp-channelWarehouseCode-in',
794
- }}
795
- onChange={(value) => {
796
- if (dataInputBusinessType === 12) {
797
- values = value.map((i) => i.key)||[];
798
- valueNames = value.map((i) => i.label || '')||[];
799
- } else {
800
- values = value?.key?[value.key]:[];
801
- valueNames = value?.label?[value.label]:[];
802
- }
803
- callback(values, valueNames);
804
- }}
805
- getPopupContainer={() => document.body}
806
- />
807
- );
808
- }
809
- }
810
- // 商品SPU选择器
811
- if (dataChoiceBusinessType == 150) {
812
- if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
813
- return (
814
- <>
815
- <BusinessSearchSelect
816
- selectBusinessType="spuCommodity"
817
- selectProps={{
818
- style: styleCommon,
819
- placeholder: '请选择SPU',
820
- ...(dataInputBusinessType === 12
821
- ? {
822
- mode: 'multiple',
823
- maxTagCount: 1,
824
- }
825
- : {}),
826
- }}
827
- disabled={disabled}
828
- labelInValue={true}
829
- value={values[0]}
830
- requestConfig={{
831
- filterInit: 'qp-itemCode-in',
832
- }}
833
- onChange={(value) => {
834
- if (dataInputBusinessType === 12) {
835
- values[0] = value.map((i) => i.key);
836
- valueNames[0] = value.map((i) => i.label || '');
837
- } else {
838
- values[0] = [value.key];
839
- valueNames[0] = [value.label || ''];
840
- }
841
- callback(values, valueNames);
842
- }}
843
- getPopupContainer={() => document.body}
844
- />
845
- <span>~</span>
846
- <BusinessSearchSelect
847
- selectBusinessType="spuCommodity"
848
- selectProps={{
849
- style: styleCommon,
850
- placeholder: '请选择SPU',
851
- ...(dataInputBusinessType === 12
852
- ? {
853
- mode: 'multiple',
854
- maxTagCount: 1,
855
- }
856
- : {}),
857
- }}
858
- disabled={disabled}
859
- labelInValue={true}
860
- value={values[1]}
861
- requestConfig={{
862
- filterInit: 'qp-itemCode-in',
863
- }}
864
- onChange={(value) => {
865
- if (dataInputBusinessType === 12) {
866
- values[1] = value.map((i) => i.key);
867
- valueNames[1] = value.map((i) => i.label || '');
868
- } else {
869
- values[1] = [value.key];
870
- valueNames[1] = [value.label || ''];
871
- }
872
- callback(values, valueNames);
873
- }}
874
- getPopupContainer={() => document.body}
875
- />
876
- </>
877
- );
878
- } else {
879
- const currentValue = dataInputBusinessType === 12 ?
880
- values?.map((s,vIndex)=> ({key: s, label: valueNames[vIndex]}))||[]
881
- : values[0]&&{key:values[0],label:valueNames[0]}||{}
882
- return (
883
- <BusinessSearchSelect
884
- selectBusinessType="spuCommodity"
885
- selectProps={{
886
- style: styleCommon,
887
- placeholder: '请选择SPU',
888
- ...(dataInputBusinessType === 12
889
- ? {
890
- mode: 'multiple',
891
- maxTagCount: 1,
892
- }
893
- : {}),
894
- }}
895
- disabled={disabled}
896
- labelInValue={true}
897
- value={currentValue}
898
- requestConfig={{
899
- filterInit: 'qp-itemCode-in',
900
- }}
901
- onChange={(value) => {
902
- if (dataInputBusinessType === 12) {
903
- values = value.map((i) => i.key)||[];
904
- valueNames = value.map((i) => i.label || '')||[];
905
- } else {
906
- values = value?.key?[value.key]:[];
907
- valueNames = value?.label?[value.label]:[];
908
- }
909
- callback(values, valueNames);
910
- }}
911
- getPopupContainer={() => document.body}
912
- />
913
- );
914
- }
915
- }
916
- // 商品SKU选择器
917
- if (dataChoiceBusinessType == 160) {
918
- if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
919
- return (
920
- <>
921
- <BusinessSearchSelect
922
- selectBusinessType="skuCommodity"
923
- selectProps={{
924
- style: styleCommon,
925
- placeholder: '请选择商品',
926
- ...(dataInputBusinessType === 12
927
- ? {
928
- mode: 'multiple',
929
- maxTagCount: 1,
930
- }
931
- : {}),
932
- }}
933
- disabled={disabled}
934
- labelInValue={true}
935
- value={values[0]}
936
- requestConfig={{
937
- filterInit: 'qp-skuCode-in',
938
- }}
939
- onChange={(value) => {
940
- if (dataInputBusinessType === 12) {
941
- values[0] = value.map((i) => i.key);
942
- valueNames[0] = value.map((i) => i.label || '');
943
- } else {
944
- values[0] = [value.key];
945
- valueNames[0] = [value.label || ''];
946
- }
947
- callback(values, valueNames);
948
- }}
949
- getPopupContainer={() => document.body}
950
- />
951
- <span>~</span>
952
- <BusinessSearchSelect
953
- selectBusinessType="skuCommodity"
954
- selectProps={{
955
- style: styleCommon,
956
- placeholder: '请选择商品',
957
- ...(dataInputBusinessType === 12
958
- ? {
959
- mode: 'multiple',
960
- maxTagCount: 1,
961
- }
962
- : {}),
963
- }}
964
- disabled={disabled}
965
- labelInValue={true}
966
- value={values[1]}
967
- requestConfig={{
968
- filterInit: 'qp-skuCode-in',
969
- }}
970
- onChange={(value) => {
971
- if (dataInputBusinessType === 12) {
972
- values[1] = value.map((i) => i.key);
973
- valueNames[1] = value.map((i) => i.label || '');
974
- } else {
975
- values[1] = [value.key];
976
- valueNames[1] = [value.label || ''];
977
- }
978
- callback(values, valueNames);
979
- }}
980
- getPopupContainer={() => document.body}
981
- />
982
- </>
983
- );
984
- } else {
985
- const currentValue = dataInputBusinessType === 12 ?
986
- values?.map((s,vIndex)=> ({key: s, label: valueNames[vIndex]}))||[]
987
- : values[0]&&{key:values[0],label:valueNames[0]}||{}
988
- return (
989
- <BusinessSearchSelect
990
- selectBusinessType="skuCommodity"
991
- selectProps={{
992
- style: styleCommon,
993
- placeholder: '请选择商品',
994
- ...(dataInputBusinessType === 12
995
- ? {
996
- mode: 'multiple',
997
- maxTagCount: 1,
998
- }
999
- : {}),
1000
- }}
1001
- disabled={disabled}
1002
- labelInValue={true}
1003
- value={currentValue}
1004
- requestConfig={{
1005
- filterInit: 'qp-skuCode-in',
1006
- }}
1007
- onChange={(value) => {
1008
- if (dataInputBusinessType === 12) {
1009
- values = value.map((i) => i.key)||[];
1010
- valueNames = value.map((i) => i.label || '')||[];
1011
- } else {
1012
- values = value?.key?[value.key]:[];
1013
- valueNames = value?.label?[value.label]:[];
1014
- }
1015
- callback(values, valueNames);
1016
- }}
1017
- getPopupContainer={() => document.body}
1018
- />
1019
- );
1020
- }
1021
- }
1022
- // 省市区
1023
- if (dataChoiceBusinessType == 190) {
1024
- if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
1025
- return (
1026
- <>
1027
- <BsCascader
1028
- disabled={disabled}
1029
- isAll={true}
1030
- needNameAndCode={true}
1031
- notChangeOnSelect={true}
1032
- initRequestSource={async () => {
1033
- return await SulaRequest({
1034
- url: '/basic/bscArea/getBscAreaList?qp-level-eq=1&qp-pid-eq=100000',
1035
- method: 'get',
1036
- converter: ({ data }) => {
1037
- const handleData =
1038
- data && data[0]
1039
- ? data?.map((item) => {
1040
- return {
1041
- text: item.name,
1042
- value: item.id,
1043
- level: item.level,
1044
- id: item.id,
1045
- };
1046
- })
1047
- : [];
1048
- return handleData;
1049
- },
1050
- });
1051
- }}
1052
- style={{ width: 240 }}
1053
- value={{ PCDName: valueNames[0] || [] }}
1054
- onChange={(value) => {
1055
- values[0] = value.PCDCode;
1056
- valueNames[0] = value.PCDName;
1057
- callback(values, valueNames);
1058
- }}
1059
- getPopupContainer={() => document.body}
1060
- />
1061
- <span>~</span>
1062
- <BsCascader
1063
- disabled={disabled}
1064
- onlyCode={true}
1065
- isAll={true}
1066
- needNameAndCode={true}
1067
- notChangeOnSelect={true}
1068
- initRequestSource={async () => {
1069
- return await SulaRequest({
1070
- url: '/basic/bscArea/getBscAreaList?qp-level-eq=1&qp-pid-eq=100000',
1071
- method: 'get',
1072
- converter: ({ data }) => {
1073
- const handleData =
1074
- data && data[0]
1075
- ? data?.map((item) => {
1076
- return {
1077
- text: item.name,
1078
- value: item.id,
1079
- level: item.level,
1080
- id: item.id,
1081
- };
1082
- })
1083
- : [];
1084
- return handleData;
1085
- },
1086
- });
1087
- }}
1088
- style={{ width: 240 }}
1089
- value={{ PCDName: valueNames[1] || [] }}
1090
- onChange={(value) => {
1091
- values[1] = value.PCDCode;
1092
- valueNames[1] = value.PCDName;
1093
- callback(values, valueNames);
1094
- }}
1095
- getPopupContainer={() => document.body}
1096
- />
1097
- </>
1098
- );
1099
- } else {
1100
- return (
1101
- <BsCascader
1102
- disabled={disabled}
1103
- onlyCode={true}
1104
- isAll={true}
1105
- needNameAndCode={true}
1106
- notChangeOnSelect={true}
1107
- initRequestSource={async () => {
1108
- return await SulaRequest({
1109
- url: '/basic/bscArea/getBscAreaList?qp-level-eq=1&qp-pid-eq=100000',
1110
- method: 'get',
1111
- converter: ({ data }) => {
1112
- const handleData =
1113
- data && data[0]
1114
- ? data?.map((item) => {
1115
- return {
1116
- text: item.name,
1117
- value: item.id,
1118
- level: item.level,
1119
- id: item.id,
1120
- };
1121
- })
1122
- : [];
1123
- return handleData;
1124
- },
1125
- });
1126
- }}
1127
- style={{ width: 240 }}
1128
- value={{ PCDName: valueNames || [] }}
1129
- onChange={(value) => {
1130
- values = value.PCDCode;
1131
- valueNames = value.PCDName;
1132
- callback(values, valueNames);
1133
- }}
1134
- getPopupContainer={() => document.body}
1135
- />
1136
- );
1137
- }
1138
- }
1139
- // 行政组织选择器
1140
- if (dataChoiceBusinessType == 210) {
1141
- if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
1142
- return (
1143
- <>
1144
- <BusinessTreeSearchSelect
1145
- disabled={disabled}
1146
- treeCheckable={dataInputBusinessType === 12}
1147
- businessType="department"
1148
- labelInValue={true}
1149
- value={values[0]}
1150
- style={styleCommon}
1151
- onChange={(value) => {
1152
- if (dataInputBusinessType === 12) {
1153
- values[0] = value.map((i) => i.key);
1154
- valueNames[0] = value.map((i) => i.label || '');
1155
- } else {
1156
- values[0] = [value.key];
1157
- valueNames[0] = [value.label || ''];
1158
- }
1159
- callback(values, valueNames);
1160
- }}
1161
- getPopupContainer={() => document.body}
1162
- />
1163
- <span>~</span>
1164
- <BusinessTreeSearchSelect
1165
- disabled={disabled}
1166
- treeCheckable={dataInputBusinessType === 12}
1167
- businessType="department"
1168
- labelInValue={true}
1169
- value={values[0]}
1170
- style={styleCommon}
1171
- onChange={(value) => {
1172
- if (dataInputBusinessType === 12) {
1173
- values[1] = value.map((i) => i.key);
1174
- valueNames[1] = value.map((i) => i.label || '');
1175
- } else {
1176
- values[1] = [value.key];
1177
- valueNames[1] = [value.label || ''];
1178
- }
1179
- callback(values, valueNames);
1180
- }}
1181
- getPopupContainer={() => document.body}
1182
- />
1183
- </>
1184
- );
1185
- } else {
1186
- return (
1187
- <BusinessTreeSearchSelect
1188
- disabled={disabled}
1189
- treeCheckable={dataInputBusinessType === 12}
1190
- businessType="department"
1191
- labelInValue={true}
1192
- value={values[0]}
1193
- style={styleCommon}
1194
- onChange={(value) => {
1195
- if (dataInputBusinessType === 12) {
1196
- values = value.map((i) => i.key)||[];
1197
- valueNames = value.map((i) => i.label || '')||[];
1198
- } else {
1199
- values = value?.key?[value.key]:[];
1200
- valueNames = value?.label?[value.label]:[];
1201
- }
1202
- callback(values, valueNames);
1203
- }}
1204
- getPopupContainer={() => document.body}
1205
- />
1206
- );
1207
- }
1208
- }
1209
- // 采购组织选择器
1210
- if (dataChoiceBusinessType == 220) {
1211
- if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
1212
- return (
1213
- <>
1214
- <BusinessTreeSearchSelect
1215
- disabled={disabled}
1216
- treeCheckable={dataInputBusinessType === 12}
1217
- businessType="purchase-organization"
1218
- labelInValue={true}
1219
- value={values[0]}
1220
- style={styleCommon}
1221
- onChange={(value) => {
1222
- if (dataInputBusinessType === 12) {
1223
- values[0] = value.map((i) => i.key);
1224
- valueNames[0] = value.map((i) => i.label || '');
1225
- } else {
1226
- values[0] = [value.key];
1227
- valueNames[0] = [value.label || ''];
1228
- }
1229
- callback(values, valueNames);
1230
- }}
1231
- getPopupContainer={() => document.body}
1232
- />
1233
- <span>~</span>
1234
- <BusinessTreeSearchSelect
1235
- disabled={disabled}
1236
- treeCheckable={dataInputBusinessType === 12}
1237
- businessType="purchase-organization"
1238
- labelInValue={true}
1239
- value={values[0]}
1240
- style={styleCommon}
1241
- onChange={(value) => {
1242
- if (dataInputBusinessType === 12) {
1243
- values[1] = value.map((i) => i.key);
1244
- valueNames[1] = value.map((i) => i.label || '');
1245
- } else {
1246
- values[1] = [value.key];
1247
- valueNames[1] = [value.label || ''];
1248
- }
1249
- callback(values, valueNames);
1250
- }}
1251
- getPopupContainer={() => document.body}
1252
- />
1253
- </>
1254
- );
1255
- } else {
1256
- return (
1257
- <BusinessTreeSearchSelect
1258
- disabled={disabled}
1259
- treeCheckable={dataInputBusinessType === 12}
1260
- businessType="purchase-organization"
1261
- labelInValue={true}
1262
- value={values[0]}
1263
- style={styleCommon}
1264
- onChange={(value) => {
1265
- if (dataInputBusinessType === 12) {
1266
- values = value.map((i) => i.key)||[];
1267
- valueNames = value.map((i) => i.label || '')||[];
1268
- } else {
1269
- values = value?.key?[value.key]:[];
1270
- valueNames = value?.label?[value.label]:[];
1271
- }
1272
- callback(values, valueNames);
1273
- }}
1274
- getPopupContainer={() => document.body}
1275
- />
1276
- );
1277
- }
1278
- }
1279
- // 销售组织选择器
1280
- if (dataChoiceBusinessType == 230) {
1281
- if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
1282
- return (
1283
- <>
1284
- <BusinessTreeSearchSelect
1285
- disabled={disabled}
1286
- treeCheckable={dataInputBusinessType === 12}
1287
- businessType="sales-organization"
1288
- labelInValue={true}
1289
- value={values[0]}
1290
- style={styleCommon}
1291
- onChange={(value) => {
1292
- if (dataInputBusinessType === 12) {
1293
- values[0] = value.map((i) => i.key);
1294
- valueNames[0] = value.map((i) => i.label || '');
1295
- } else {
1296
- values[0] = [value.key];
1297
- valueNames[0] = [value.label || ''];
1298
- }
1299
- callback(values, valueNames);
1300
- }}
1301
- getPopupContainer={() => document.body}
1302
- />
1303
- <span>~</span>
1304
- <BusinessTreeSearchSelect
1305
- disabled={disabled}
1306
- treeCheckable={dataInputBusinessType === 12}
1307
- businessType="sales-organization"
1308
- labelInValue={true}
1309
- value={values[0]}
1310
- style={styleCommon}
1311
- onChange={(value) => {
1312
- if (dataInputBusinessType === 12) {
1313
- values[1] = value.map((i) => i.key);
1314
- valueNames[1] = value.map((i) => i.label || '');
1315
- } else {
1316
- values[1] = [value.key];
1317
- valueNames[1] = [value.label || ''];
1318
- }
1319
- callback(values, valueNames);
1320
- }}
1321
- getPopupContainer={() => document.body}
1322
- />
1323
- </>
1324
- );
1325
- } else {
1326
- return (
1327
- <BusinessTreeSearchSelect
1328
- disabled={disabled}
1329
- treeCheckable={dataInputBusinessType === 12}
1330
- businessType="sales-organization"
1331
- labelInValue={true}
1332
- value={values[0]}
1333
- style={styleCommon}
1334
- onChange={(value) => {
1335
- if (dataInputBusinessType === 12) {
1336
- values = value.map((i) => i.key)||[];
1337
- valueNames = value.map((i) => i.label || '')||[];
1338
- } else {
1339
- values = value?.key?[value.key]:[];
1340
- valueNames = value?.label?[value.label]:[];
1341
- }
1342
- callback(values, valueNames);
1343
- }}
1344
- getPopupContainer={() => document.body}
1345
- />
1346
- );
1347
- }
1348
- }
1349
- // 供应商选择器
1350
- if (dataChoiceBusinessType == 240) {
1351
- if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
1352
- return (
1353
- <>
1354
- <BusinessSearchSelect
1355
- selectBusinessType="supplier2"
1356
- selectProps={{
1357
- style: styleCommon,
1358
- placeholder: '请选择供应商',
1359
- ...(dataInputBusinessType === 12
1360
- ? {
1361
- mode: 'multiple',
1362
- maxTagCount: 1,
1363
- }
1364
- : {}),
1365
- }}
1366
- disabled={disabled}
1367
- labelInValue={true}
1368
- value={values[0]}
1369
- requestConfig={{
1370
- filterInit: 'qp-code-in',
1371
- }}
1372
- onChange={(value) => {
1373
- if (dataInputBusinessType === 12) {
1374
- values[0] = value.map((i) => i.key);
1375
- valueNames[0] = value.map((i) => i.label || '');
1376
- } else {
1377
- values[0] = [value.key];
1378
- valueNames[0] = [value.label || ''];
1379
- }
1380
- callback(values, valueNames);
1381
- }}
1382
- getPopupContainer={() => document.body}
1383
- />
1384
- <span>~</span>
1385
- <BusinessSearchSelect
1386
- selectBusinessType="supplier2"
1387
- selectProps={{
1388
- style: styleCommon,
1389
- placeholder: '请选择供应商',
1390
- ...(dataInputBusinessType === 12
1391
- ? {
1392
- mode: 'multiple',
1393
- maxTagCount: 1,
1394
- }
1395
- : {}),
1396
- }}
1397
- disabled={disabled}
1398
- labelInValue={true}
1399
- value={values[1]}
1400
- requestConfig={{
1401
- filterInit: 'qp-code-in',
1402
- }}
1403
- onChange={(value) => {
1404
- if (dataInputBusinessType === 12) {
1405
- values[1] = value.map((i) => i.key);
1406
- valueNames[1] = value.map((i) => i.label || '');
1407
- } else {
1408
- values[1] = [value.key];
1409
- valueNames[1] = [value.label || ''];
1410
- }
1411
- callback(values, valueNames);
1412
- }}
1413
- getPopupContainer={() => document.body}
1414
- />
1415
- </>
1416
- );
1417
- } else {
1418
- const currentValue = dataInputBusinessType === 12 ?
1419
- values?.map((s,vIndex)=> ({key: s, label: valueNames[vIndex]}))||[]
1420
- : values[0]&&{key:values[0],label:valueNames[0]}||{}
1421
- return (
1422
- <BusinessSearchSelect
1423
- selectBusinessType="supplier2"
1424
- selectProps={{
1425
- style: styleCommon,
1426
- placeholder: '请选择供应商',
1427
- ...(dataInputBusinessType === 12
1428
- ? {
1429
- mode: 'multiple',
1430
- maxTagCount: 1,
1431
- }
1432
- : {}),
1433
- }}
1434
- disabled={disabled}
1435
- labelInValue={true}
1436
- value={currentValue}
1437
- requestConfig={{
1438
- filterInit: 'qp-code-in',
1439
- }}
1440
- onChange={(value) => {
1441
- if (dataInputBusinessType === 12) {
1442
- values = value.map((i) => i.key)||[];
1443
- valueNames = value.map((i) => i.label || '')||[];
1444
- } else {
1445
- values = value?.key?[value.key]:[];
1446
- valueNames = value?.label?[value.label]:[];
1447
- }
1448
- callback(values, valueNames);
1449
- }}
1450
- getPopupContainer={() => document.body}
1451
- />
1452
- );
1453
- }
1454
- }
1455
- // 客户选择器
1456
- if (dataChoiceBusinessType == 250) {
1457
- if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
1458
- return (
1459
- <>
1460
- <BusinessSearchSelect
1461
- selectBusinessType="customer2"
1462
- selectProps={{
1463
- style: styleCommon,
1464
- placeholder: '请选择客户',
1465
- ...(dataInputBusinessType === 12
1466
- ? {
1467
- mode: 'multiple',
1468
- maxTagCount: 1,
1469
- }
1470
- : {}),
1471
- }}
1472
- disabled={disabled}
1473
- labelInValue={true}
1474
- value={values[0]}
1475
- requestConfig={{
1476
- filterInit: 'qp-code-in',
1477
- }}
1478
- onChange={(value) => {
1479
- if (dataInputBusinessType === 12) {
1480
- values[0] = value.map((i) => i.key);
1481
- valueNames[0] = value.map((i) => i.label || '');
1482
- } else {
1483
- values[0] = [value.key];
1484
- valueNames[0] = [value.label || ''];
1485
- }
1486
- callback(values, valueNames);
1487
- }}
1488
- getPopupContainer={() => document.body}
1489
- />
1490
- <span>~</span>
1491
- <BusinessSearchSelect
1492
- selectBusinessType="customer2"
1493
- selectProps={{
1494
- style: styleCommon,
1495
- placeholder: '请选择客户',
1496
- ...(dataInputBusinessType === 12
1497
- ? {
1498
- mode: 'multiple',
1499
- maxTagCount: 1,
1500
- }
1501
- : {}),
1502
- }}
1503
- disabled={disabled}
1504
- labelInValue={true}
1505
- value={values[1]}
1506
- requestConfig={{
1507
- filterInit: 'qp-code-in',
1508
- }}
1509
- onChange={(value) => {
1510
- if (dataInputBusinessType === 12) {
1511
- values[1] = value.map((i) => i.key);
1512
- valueNames[1] = value.map((i) => i.label || '');
1513
- } else {
1514
- values[1] = [value.key];
1515
- valueNames[1] = [value.label || ''];
1516
- }
1517
- callback(values, valueNames);
1518
- }}
1519
- getPopupContainer={() => document.body}
1520
- />
1521
- </>
1522
- );
1523
- } else {
1524
- const currentValue = dataInputBusinessType === 12 ?
1525
- values?.map((s,vIndex)=> ({key: s, label: valueNames[vIndex]}))||[]
1526
- : values[0]&&{key:values[0],label:valueNames[0]}||{}
1527
- return (
1528
- <BusinessSearchSelect
1529
- selectBusinessType="customer2"
1530
- selectProps={{
1531
- style: styleCommon,
1532
- placeholder: '请选择客户',
1533
- ...(dataInputBusinessType === 12
1534
- ? {
1535
- mode: 'multiple',
1536
- maxTagCount: 1,
1537
- }
1538
- : {}),
1539
- }}
1540
- disabled={disabled}
1541
- labelInValue={true}
1542
- value={currentValue}
1543
- requestConfig={{
1544
- filterInit: 'qp-code-in',
1545
- }}
1546
- onChange={(value) => {
1547
- if (dataInputBusinessType === 12) {
1548
- values = value.map((i) => i.key)||[];
1549
- valueNames = value.map((i) => i.label || '')||[];
1550
- } else {
1551
- values = value?.key?[value.key]:[];
1552
- valueNames = value?.label?[value.label]:[];
1553
- }
1554
- callback(values, valueNames);
1555
- }}
1556
- getPopupContainer={() => document.body}
1557
- />
1558
- );
1559
- }
1560
- }
1561
- // 店铺选择器
1562
- if (dataChoiceBusinessType == 260) {
1563
- if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
1564
- return (
1565
- <>
1566
- <BusinessSearchSelect
1567
- selectBusinessType="shopFile2"
1568
- selectProps={{
1569
- style: styleCommon,
1570
- placeholder: '请选择店铺',
1571
- ...(dataInputBusinessType === 12
1572
- ? {
1573
- mode: 'multiple',
1574
- maxTagCount: 1,
1575
- }
1576
- : {}),
1577
- }}
1578
- disabled={disabled}
1579
- labelInValue={true}
1580
- value={values[0]}
1581
- requestConfig={{
1582
- filterInit: 'qp-code-in',
1583
- }}
1584
- onChange={(value) => {
1585
- if (dataInputBusinessType === 12) {
1586
- values[0] = value.map((i) => i.key);
1587
- valueNames[0] = value.map((i) => i.label || '');
1588
- } else {
1589
- values[0] = [value.key];
1590
- valueNames[0] = [value.label || ''];
1591
- }
1592
- callback(values, valueNames);
1593
- }}
1594
- getPopupContainer={() => document.body}
1595
- />
1596
- <span>~</span>
1597
- <BusinessSearchSelect
1598
- selectBusinessType="shopFile2"
1599
- selectProps={{
1600
- style: styleCommon,
1601
- placeholder: '请选择店铺',
1602
- ...(dataInputBusinessType === 12
1603
- ? {
1604
- mode: 'multiple',
1605
- maxTagCount: 1,
1606
- }
1607
- : {}),
1608
- }}
1609
- disabled={disabled}
1610
- labelInValue={true}
1611
- value={values[1]}
1612
- requestConfig={{
1613
- filterInit: 'qp-code-in',
1614
- }}
1615
- onChange={(value) => {
1616
- if (dataInputBusinessType === 12) {
1617
- values[1] = value.map((i) => i.key);
1618
- valueNames[1] = value.map((i) => i.label || '');
1619
- } else {
1620
- values[1] = [value.key];
1621
- valueNames[1] = [value.label || ''];
1622
- }
1623
- callback(values, valueNames);
1624
- }}
1625
- getPopupContainer={() => document.body}
1626
- />
1627
- </>
1628
- );
1629
- } else {
1630
- const currentValue = dataInputBusinessType === 12 ?
1631
- values?.map((s,vIndex)=> ({key: s, label: valueNames[vIndex]}))||[]
1632
- : values[0]&&{key:values[0],label:valueNames[0]}||{}
1633
- return (
1634
- <BusinessSearchSelect
1635
- selectBusinessType="shopFile2"
1636
- selectProps={{
1637
- style: styleCommon,
1638
- placeholder: '请选择店铺',
1639
- ...(dataInputBusinessType === 12
1640
- ? {
1641
- mode: 'multiple',
1642
- maxTagCount: 1,
1643
- }
1644
- : {}),
1645
- }}
1646
- disabled={disabled}
1647
- labelInValue={true}
1648
- value={currentValue}
1649
- requestConfig={{
1650
- filterInit: 'qp-code-in',
1651
- }}
1652
- onChange={(value) => {
1653
- if (dataInputBusinessType === 12) {
1654
- values = value.map((i) => i.key)||[];
1655
- valueNames = value.map((i) => i.label || '')||[];
1656
- } else {
1657
- values = value?.key?[value.key]:[];
1658
- valueNames = value?.label?[value.label]:[];
1659
- }
1660
- callback(values, valueNames);
1661
- }}
1662
- getPopupContainer={() => document.body}
1663
- />
1664
- );
1665
- }
1666
- }
1667
- // 员工选择器
1668
- if (dataChoiceBusinessType == 270) {
1669
- if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
1670
- return (
1671
- <>
1672
- <BusinessSearchSelect
1673
- selectBusinessType="employee2"
1674
- selectProps={{
1675
- style: styleCommon,
1676
- placeholder: '请选择员工',
1677
- ...(dataInputBusinessType === 12
1678
- ? {
1679
- mode: 'multiple',
1680
- maxTagCount: 1,
1681
- }
1682
- : {}),
1683
- }}
1684
- disabled={disabled}
1685
- labelInValue={true}
1686
- value={values[0]}
1687
- requestConfig={{
1688
- filterInit: 'qp-id-in',
1689
- }}
1690
- onChange={(value) => {
1691
- if (dataInputBusinessType === 12) {
1692
- values[0] = value.map((i) => i.key);
1693
- valueNames[0] = value.map((i) => i.label || '');
1694
- } else {
1695
- values[0] = [value.key];
1696
- valueNames[0] = [value.label || ''];
1697
- }
1698
- callback(values, valueNames);
1699
- }}
1700
- getPopupContainer={() => document.body}
1701
- />
1702
- <span>~</span>
1703
- <BusinessSearchSelect
1704
- selectBusinessType="employee2"
1705
- selectProps={{
1706
- style: styleCommon,
1707
- placeholder: '请选择员工',
1708
- ...(dataInputBusinessType === 12
1709
- ? {
1710
- mode: 'multiple',
1711
- maxTagCount: 1,
1712
- }
1713
- : {}),
1714
- }}
1715
- disabled={disabled}
1716
- labelInValue={true}
1717
- value={values[1]}
1718
- requestConfig={{
1719
- filterInit: 'qp-id-in',
1720
- }}
1721
- onChange={(value) => {
1722
- if (dataInputBusinessType === 12) {
1723
- values[1] = value.map((i) => i.key);
1724
- valueNames[1] = value.map((i) => i.label || '');
1725
- } else {
1726
- values[1] = [value.key];
1727
- valueNames[1] = [value.label || ''];
1728
- }
1729
- callback(values, valueNames);
1730
- }}
1731
- getPopupContainer={() => document.body}
1732
- />
1733
- </>
1734
- );
1735
- } else {
1736
- const currentValue = dataInputBusinessType === 12 ?
1737
- values?.map((s,vIndex)=> ({key: s, label: valueNames[vIndex]}))||[]
1738
- : values[0]&&{key:values[0],label:valueNames[0]}||{}
1739
- return (
1740
- <BusinessSearchSelect
1741
- selectBusinessType="employee2"
1742
- selectProps={{
1743
- style: styleCommon,
1744
- placeholder: '请选择员工',
1745
- ...(dataInputBusinessType === 12
1746
- ? {
1747
- mode: 'multiple',
1748
- maxTagCount: 1,
1749
- }
1750
- : {}),
1751
- }}
1752
- disabled={disabled}
1753
- labelInValue={true}
1754
- value={currentValue}
1755
- requestConfig={{
1756
- filterInit: 'qp-id-in',
1757
- }}
1758
- onChange={(value) => {
1759
- if (dataInputBusinessType === 12) {
1760
- values = value.map((i) => i.key)||[];
1761
- valueNames = value.map((i) => i.label || '')||[];
1762
- } else {
1763
- values = value?.key?[value.key]:[];
1764
- valueNames = value?.label?[value.label]:[];
1765
- }
1766
- callback(values, valueNames);
1767
- }}
1768
- getPopupContainer={() => document.body}
1769
- />
1770
- );
1771
- }
1772
- }
1773
- // 库存组织选择器
1774
- if (dataChoiceBusinessType == 280) {
1775
- if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
1776
- return (
1777
- <>
1778
- <BusinessTreeSearchSelect
1779
- disabled={disabled}
1780
- treeCheckable={dataInputBusinessType === 12}
1781
- businessType="stock-organization"
1782
- labelInValue={true}
1783
- value={values[0]}
1784
- style={styleCommon}
1785
- onChange={(value) => {
1786
- if (dataInputBusinessType === 12) {
1787
- values[0] = value.map((i) => i.key);
1788
- valueNames[0] = value.map((i) => i.label || '');
1789
- } else {
1790
- values[0] = [value.key];
1791
- valueNames[0] = [value.label || ''];
1792
- }
1793
- callback(values, valueNames);
1794
- }}
1795
- getPopupContainer={() => document.body}
1796
- />
1797
- <span>~</span>
1798
- <BusinessTreeSearchSelect
1799
- disabled={disabled}
1800
- treeCheckable={dataInputBusinessType === 12}
1801
- businessType="stock-organization"
1802
- labelInValue={true}
1803
- value={values[0]}
1804
- style={styleCommon}
1805
- onChange={(value) => {
1806
- if (dataInputBusinessType === 12) {
1807
- values[1] = value.map((i) => i.key);
1808
- valueNames[1] = value.map((i) => i.label || '');
1809
- } else {
1810
- values[1] = [value.key];
1811
- valueNames[1] = [value.label || ''];
1812
- }
1813
- callback(values, valueNames);
1814
- }}
1815
- getPopupContainer={() => document.body}
1816
- />
1817
- </>
1818
- );
1819
- } else {
1820
- return (
1821
- <BusinessTreeSearchSelect
1822
- disabled={disabled}
1823
- treeCheckable={dataInputBusinessType === 12}
1824
- businessType="stock-organization"
1825
- labelInValue={true}
1826
- value={values[0]}
1827
- style={styleCommon}
1828
- onChange={(value) => {
1829
- if (dataInputBusinessType === 12) {
1830
- values = value.map((i) => i.key)||[];
1831
- valueNames = value.map((i) => i.label || '')||[];
1832
- } else {
1833
- values = value?.key?[value.key]:[];
1834
- valueNames = value?.label?[value.label]:[];
1835
- }
1836
- callback(values, valueNames);
1837
- }}
1838
- getPopupContainer={() => document.body}
1839
- />
1840
- );
1841
- }
1842
- }
1843
- // 配送方式选择器
1844
- if (dataChoiceBusinessType == 310) {
1845
- if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
1846
- return (
1847
- <>
1848
- <BusinessSearchSelect
1849
- selectBusinessType="deliveryMode"
1850
- selectProps={{
1851
- style: styleCommon,
1852
- placeholder: '请选择配送方式',
1853
- ...(dataInputBusinessType === 12
1854
- ? {
1855
- mode: 'multiple',
1856
- maxTagCount: 1,
1857
- }
1858
- : {}),
1859
- }}
1860
- disabled={disabled}
1861
- labelInValue={true}
1862
- value={values[0]}
1863
- requestConfig={{
1864
- filterInit: 'qp-code-in',
1865
- }}
1866
- onChange={(value) => {
1867
- if (dataInputBusinessType === 12) {
1868
- values[0] = value.map((i) => i.key);
1869
- valueNames[0] = value.map((i) => i.label || '');
1870
- } else {
1871
- values[0] = [value.key];
1872
- valueNames[0] = [value.label || ''];
1873
- }
1874
- callback(values, valueNames);
1875
- }}
1876
- getPopupContainer={() => document.body}
1877
- />
1878
- <span>~</span>
1879
- <BusinessSearchSelect
1880
- selectBusinessType="deliveryMode"
1881
- selectProps={{
1882
- style: styleCommon,
1883
- placeholder: '请选择配送方式',
1884
- ...(dataInputBusinessType === 12
1885
- ? {
1886
- mode: 'multiple',
1887
- maxTagCount: 1,
1888
- }
1889
- : {}),
1890
- }}
1891
- disabled={disabled}
1892
- labelInValue={true}
1893
- value={values[1]}
1894
- requestConfig={{
1895
- filterInit: 'qp-code-in',
1896
- }}
1897
- onChange={(value) => {
1898
- if (dataInputBusinessType === 12) {
1899
- values[1] = value.map((i) => i.key);
1900
- valueNames[1] = value.map((i) => i.label || '');
1901
- } else {
1902
- values[1] = [value.key];
1903
- valueNames[1] = [value.label || ''];
1904
- }
1905
- callback(values, valueNames);
1906
- }}
1907
- getPopupContainer={() => document.body}
1908
- />
1909
- </>
1910
- );
1911
- } else {
1912
- const currentValue = dataInputBusinessType === 12 ?
1913
- values?.map((s,vIndex)=> ({key: s, label: valueNames[vIndex]}))||[]
1914
- : values[0]&&{key:values[0],label:valueNames[0]}||{}
1915
- return (
1916
- <BusinessSearchSelect
1917
- selectBusinessType="deliveryMode"
1918
- selectProps={{
1919
- style: styleCommon,
1920
- placeholder: '请选择配送方式',
1921
- ...(dataInputBusinessType === 12
1922
- ? {
1923
- mode: 'multiple',
1924
- maxTagCount: 1,
1925
- }
1926
- : {}),
1927
- }}
1928
- disabled={disabled}
1929
- labelInValue={true}
1930
- value={currentValue}
1931
- requestConfig={{
1932
- filterInit: 'qp-code-in',
1933
- }}
1934
- onChange={(value) => {
1935
- if (dataInputBusinessType === 12) {
1936
- values = value.map((i) => i.key)||[];
1937
- valueNames = value.map((i) => i.label || '')||[];
1938
- } else {
1939
- values = value?.key?[value.key]:[];
1940
- valueNames = value?.label?[value.label]:[];
1941
- }
1942
- callback(values, valueNames);
1943
- }}
1944
- getPopupContainer={() => document.body}
1945
- />
1946
- );
1947
- }
1948
- }
1949
- } else {
1950
- if (
1951
- dataTypeCode == 22 ||
1952
- dataTypeCode == 21 ||
1953
- dataTypeCode == 24 ||
1954
- dataTypeCode == 23
1955
- ) {
1956
- //数值22, 字符串21, 布尔类型24, long23
1957
- if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
1958
- return (
1959
- <>
1960
- <Input
1961
- defaultValue={values[0]}
1962
- disabled={disabled}
1963
- style={styleCommon}
1964
- onBlur={(e) => {
1965
- values[0] = e.target.value;
1966
- valueNames[0] = e.target.value;
1967
- callback(values, valueNames);
1968
- }}
1969
- />
1970
- <span>~</span>
1971
- <Input
1972
- defaultValue={values[1]}
1973
- disabled={disabled}
1974
- style={styleCommon}
1975
- onBlur={(e) => {
1976
- values[1] = e.target.value;
1977
- valueNames[1] = e.target.value;
1978
- callback(values, valueNames);
1979
- }}
1980
- />
1981
- </>
1982
- );
1983
- } else {
1984
- return (
1985
- <Input
1986
- defaultValue={values.join(',')}
1987
- disabled={disabled}
1988
- style={styleCommon}
1989
- onBlur={(e) => {
1990
- values = e.target.value.split(',');
1991
- valueNames = e.target.value.split(',');
1992
- callback(values, valueNames);
1993
- }}
1994
- />
1995
- );
1996
- }
1997
- } else if (dataTypeCode == 41) {
1998
- // 日期41
1999
- if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
2000
- return (
2001
- <RangePicker
2002
- // showTime
2003
- disabled={disabled}
2004
- style={{ width: customerWidth || '300px' }}
2005
- format={dataTypeCode == 41 ? dateFormat : fullDateFormat}
2006
- value={[
2007
- values[0] ? moment(values[0]) : '',
2008
- values[1] ? moment(values[1]) : '',
2009
- ]}
2010
- onChange={(dates, dateStrings) => {
2011
- // 业务产品要求时间范围取值固定00:00:00-23:59:59,有问题请找产品业务
2012
- let dateStringFormat = [];
2013
- if (dataTypeCode == 41) {
2014
- dateStringFormat[0] = dateStrings[0]
2015
- ? moment(dateStrings[0]).format('YYYY-MM-DD')
2016
- : '';
2017
- dateStringFormat[1] = dateStrings[1]
2018
- ? moment(dateStrings[1]).format('YYYY-MM-DD')
2019
- : '';
2020
- } else {
2021
- dateStringFormat[0] = dateStrings[0]
2022
- ? moment(dateStrings[0]).format('YYYY-MM-DD 00:00:00')
2023
- : '';
2024
- dateStringFormat[1] = dateStrings[1]
2025
- ? moment(dateStrings[1]).format('YYYY-MM-DD 23:59:59')
2026
- : '';
2027
- }
2028
- values = [...dateStringFormat];
2029
- valueNames = [...dateStringFormat];
2030
- callback(values, valueNames);
2031
- }}
2032
- />
2033
- );
2034
- } else {
2035
- return (
2036
- <>
2037
- <DatePicker
2038
- format={dataTypeCode == 41 ? dateFormat : fullDateFormat}
2039
- disabled={disabled}
2040
- style={{ width: customerWidth || '300px' }}
2041
- value={values[0] ? moment(values[0]) : ''}
2042
- onChange={(date, dateString) => {
2043
- values[0] = dateString;
2044
- valueNames[0] = dateString;
2045
- callback(values, valueNames);
2046
- }}
2047
- />
2048
- </>
2049
- );
2050
- }
2051
- } else if (dataTypeCode == 40) {
2052
- // 时间40
2053
- if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
2054
- return (
2055
- <>
2056
- <TimePicker
2057
- key="1"
2058
- disabled={disabled}
2059
- value={values[0] ? moment(values[0]) : ''}
2060
- style={styleCommon}
2061
- onChange={(time, timeString) => {
2062
- values[0] = timeString;
2063
- valueNames[0] = timeString;
2064
- callback(values, valueNames);
2065
- }}
2066
- />
2067
- <span>~</span>
2068
- <TimePicker
2069
- key="2"
2070
- disabled={disabled}
2071
- value={values[1] ? moment(values[1]) : ''}
2072
- style={styleCommon}
2073
- onChange={(time, timeString) => {
2074
- values[1] = timeString;
2075
- valueNames[1] = timeString;
2076
- callback(values, valueNames);
2077
- }}
2078
- />
2079
- </>
2080
- );
2081
- } else {
2082
- return (
2083
- <TimePicker
2084
- defaultValue={values[0] ? moment(values[0]) : ''}
2085
- disabled={disabled}
2086
- style={styleCommon}
2087
- onChange={(time, timeString) => {
2088
- values[0] = timeString;
2089
- valueNames[0] = timeString;
2090
- callback(values, valueNames);
2091
- }}
2092
- />
2093
- );
2094
- }
2095
- }
2096
- }
2097
- return '';
2098
- };
2099
-
2100
- render() {
2101
- return (
2102
- <div style={{ marginLeft: '10px' }} className={styles.rule_field_style}>
2103
- {this.renderConditionField()}
2104
- </div>
2105
- );
2106
- }
2107
- }
1
+ import React, { Component } from 'react';
2
+ import { Select, Input, InputNumber, DatePicker, TimePicker } from 'antd';
3
+ import styles from './index.less';
4
+ import { getRegularThresholdRange } from './services';
5
+ import moment from 'moment';
6
+ import { handleError, judgeIsEmpty } from '../../../utils/utils';
7
+ import { queryIdentityInfo, findChangedThresholdQuery, setParams } from './util';
8
+ import { request as SulaRequest } from 'bssula';
9
+ import { stringify } from 'querystring';
10
+ import {
11
+ BusinessSearchSelect,
12
+ BusinessTreeSearchSelect,
13
+ BsCascader
14
+ } from '../../../index';
15
+ const { RangePicker } = DatePicker;
16
+
17
+ export default class RuleField extends Component {
18
+ constructor(props) {
19
+ super(props);
20
+ this.state = {
21
+ selectOperation: '',
22
+ dataTypeCode: '',
23
+ dataChoiceBusinessType: '',
24
+ dataInputBusinessType: '',
25
+ fieldValues: [],
26
+ thresholdQuery: {},
27
+ thresholdList: [],
28
+ options: [],
29
+ };
30
+ }
31
+
32
+ componentDidMount() {
33
+ const {
34
+ selectOperation,
35
+ dataTypeCode,
36
+ dataChoiceBusinessType,
37
+ dataInputBusinessType,
38
+ options,
39
+ values,
40
+ initialThresholdQuery,
41
+ queryIdentify,
42
+ propertyCode,
43
+ queryIdentifyType,
44
+ } = this.props;
45
+ this.setState(
46
+ {
47
+ selectOperation,
48
+ thresholdQuery: initialThresholdQuery
49
+ ? {
50
+ ...initialThresholdQuery,
51
+ }
52
+ : {},
53
+ dataTypeCode,
54
+ dataChoiceBusinessType,
55
+ dataInputBusinessType,
56
+ fieldValues: [...values],
57
+ options,
58
+ },
59
+ () => {
60
+ !judgeIsEmpty(queryIdentify) &&
61
+ this.getRegularThresholdRange(
62
+ queryIdentify,
63
+ propertyCode,
64
+ queryIdentifyType,
65
+ );
66
+ },
67
+ );
68
+ window.addEventListener('testEvent', this.eventHandle);
69
+ }
70
+
71
+ eventHandle = (obj) => {
72
+ const { thresholdQuery } = this.state;
73
+ const { queryIdentify, propertyCode, queryIdentifyType } = this.props;
74
+ this.setState(
75
+ {
76
+ thresholdQuery: {
77
+ ...thresholdQuery,
78
+ ...obj.data,
79
+ },
80
+ },
81
+ () => {
82
+ this.getRegularThresholdRange(
83
+ queryIdentify,
84
+ propertyCode,
85
+ queryIdentifyType,
86
+ );
87
+ },
88
+ );
89
+ };
90
+
91
+ componentWillUnmount() {
92
+ window.removeEventListener('testEvent', this.eventHandle);
93
+ }
94
+
95
+ componentWillReceiveProps(nextProps) {
96
+ if (nextProps.selectOperation != this.props.selectOperation) {
97
+ this.setState({
98
+ selectOperation: nextProps.selectOperation,
99
+ });
100
+ }
101
+ if (nextProps.dataTypeCode != this.props.dataTypeCode) {
102
+ this.setState({
103
+ dataTypeCode: nextProps.dataTypeCode,
104
+ });
105
+ }
106
+ if (nextProps.dataChoiceBusinessType != this.props.dataChoiceBusinessType) {
107
+ this.setState({
108
+ dataChoiceBusinessType: nextProps.dataChoiceBusinessType,
109
+ });
110
+ }
111
+ if (nextProps.dataInputBusinessType != this.props.dataInputBusinessType) {
112
+ this.setState({
113
+ dataInputBusinessType: nextProps.dataInputBusinessType,
114
+ });
115
+ }
116
+ // if (nextProps.selectOperation != this.props.selectOperation) {
117
+ // this.setState({
118
+ // options: nextProps.options
119
+ // })
120
+ // }
121
+ if (
122
+ nextProps.queryIdentify &&
123
+ nextProps.queryIdentify != this.props.queryIdentify
124
+ ) {
125
+ this.getRegularThresholdRange(
126
+ nextProps.queryIdentify,
127
+ nextProps.propertyCode,
128
+ nextProps.queryIdentifyType,
129
+ );
130
+ }
131
+
132
+ if (
133
+ JSON.stringify(nextProps.initialThresholdQuery) !=
134
+ JSON.stringify(this.props.initialThresholdQuery)
135
+ ) {
136
+ console.log(
137
+ findChangedThresholdQuery(
138
+ this.props.initialThresholdQuery,
139
+ nextProps.initialThresholdQuery,
140
+ ),
141
+ );
142
+ let changedPropsVal = findChangedThresholdQuery(
143
+ this.props.initialThresholdQuery,
144
+ nextProps.initialThresholdQuery,
145
+ );
146
+ this.setState(
147
+ {
148
+ thresholdQuery: {
149
+ ...nextProps.initialThresholdQuery,
150
+ },
151
+ },
152
+ () => {
153
+ if (changedPropsVal.indexOf(nextProps.propertyCode) > -1) {
154
+ this.getRegularThresholdRange(
155
+ nextProps.queryIdentify,
156
+ nextProps.propertyCode,
157
+ nextProps.queryIdentifyType,
158
+ );
159
+ }
160
+ },
161
+ );
162
+ }
163
+ }
164
+
165
+ //规则对象属性枚举值查询处理 queryIdentify有值是表示该属性有枚举选择
166
+ getRegularThresholdRange = async (
167
+ queryIdentify,
168
+ propertyCode,
169
+ queryIdentifyType,
170
+ ) => {
171
+ if (!queryIdentify) return;
172
+ const { thresholdQuery } = this.state;
173
+ let extraRequestUrl = '';
174
+ let querParams = setParams(propertyCode, thresholdQuery);
175
+ if (queryIdentityInfo.find((item) => item.identity == propertyCode)) {
176
+ //判断查询属性枚举时有没有必传参数,如果必传参数没有值则不调用查询接口
177
+ let needQueryList = queryIdentityInfo
178
+ .find((item) => item.identity == propertyCode)
179
+ .queryParam.filter((item) => item.isRequired)
180
+ .map((item) => item.queryKey);
181
+ if (
182
+ needQueryList.some(
183
+ (item) => !querParams[item] || !querParams[item].length,
184
+ )
185
+ ) {
186
+ return;
187
+ }
188
+ extraRequestUrl =
189
+ queryIdentityInfo.find((item) => item.identity == propertyCode)
190
+ .requestUrl || '';
191
+ }
192
+ if (queryIdentifyType === 'dictCodeIdentify') {
193
+ extraRequestUrl = `bscDictItem/selectDictItemsByDictCode`; // 字典接口
194
+ querParams = { dictCode: queryIdentify };
195
+ } else if (queryIdentifyType === 'dynamicDictCodeIdentify') {
196
+ extraRequestUrl = `dictDynamicItem/getDynamicData/${queryIdentify}`; // 字典接口
197
+ // querParams = { dictCode: queryIdentify }
198
+ }
199
+
200
+ if (extraRequestUrl) {
201
+ if (queryIdentify == 'maintain_area_code') {
202
+ extraRequestUrl = `/basic/${extraRequestUrl}${
203
+ querParams.memberCardCode
204
+ }?${stringify(querParams)}`;
205
+ } else if (queryIdentifyType == 'dictCodeIdentify') {
206
+ extraRequestUrl = `/basic/${extraRequestUrl}?${stringify(querParams)}`;
207
+ } else if (queryIdentifyType == 'dynamicDictCodeIdentify') {
208
+ extraRequestUrl = `/basic/${extraRequestUrl}`;
209
+ }
210
+
211
+ SulaRequest({
212
+ url: extraRequestUrl,
213
+ method: 'get',
214
+ converter: (res) => {
215
+ let handleData = res?.data || [];
216
+ if (queryIdentifyType === 'dictCodeIdentify') {
217
+ handleData = handleData?.length
218
+ ? handleData.map((i) => ({
219
+ code: i.dictItemCode,
220
+ name: i.dictItemName,
221
+ }))
222
+ : [];
223
+ }
224
+ if (queryIdentifyType === 'dynamicDictCodeIdentify') {
225
+ handleData = handleData?.length
226
+ ? handleData.map((i) => ({
227
+ code: i.code.toString(),
228
+ name: i.name,
229
+ }))
230
+ : [];
231
+ }
232
+ this.setState({
233
+ thresholdList: handleData,
234
+ });
235
+ return handleData;
236
+ },
237
+ });
238
+ } else {
239
+ if (queryIdentifyType == 'objectPropertyListIdentify') {
240
+ this.setState({
241
+ thresholdList: queryIdentify,
242
+ });
243
+ } else if (queryIdentifyType == 'objectPropertyCodeIdentify') {
244
+ // TODO待处理
245
+ this.setState({
246
+ thresholdList: [],
247
+ });
248
+ } else {
249
+ querParams.queryIdentify = queryIdentify;
250
+ let res = await getRegularThresholdRange(querParams);
251
+ if (handleError(res)) {
252
+ this.setState({
253
+ thresholdList: res?.data || [],
254
+ });
255
+ }
256
+ }
257
+ }
258
+ };
259
+
260
+ renderConditionField = () => {
261
+ let {
262
+ selectOperation,
263
+ dataTypeCode,
264
+ dataChoiceBusinessType,
265
+ dataInputBusinessType,
266
+ options,
267
+ values,
268
+ valueNames,
269
+ callback,
270
+ queryIdentify,
271
+ disabled,
272
+ customerWidth,
273
+ } = this.props;
274
+ const { thresholdList } = this.state;
275
+ const dateFormat = 'YYYY-MM-DD';
276
+ const fullDateFormat = 'YYYY-MM-DD HH:mm:ss';
277
+ const styleCommon = {
278
+ width: customerWidth || '150px',
279
+ };
280
+ if (!selectOperation) return <Input disabled style={styleCommon}></Input>;
281
+ const SET_TYPE = ['in', 'nin', 'cn', 'ncn']; //集合类型
282
+ const INTERVAL_TYPE = ['be', 'bed', 'nbe', 'nbed', 'ber', 'bel']; //区间类型
283
+ const IS_KONG = ['en']; // 为空
284
+ if (IS_KONG.indexOf(selectOperation) > -1) {
285
+ return '';
286
+ }
287
+ // queryIdentify有值是表示该属性有枚举选择
288
+ if (!judgeIsEmpty(queryIdentify)) {
289
+ if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
290
+ return (
291
+ <>
292
+ <Select
293
+ disabled={disabled}
294
+ showSearch
295
+ filterOption={(input, option) =>
296
+ option.props.children
297
+ ?.toLowerCase()
298
+ .indexOf(input.toLowerCase()) >= 0
299
+ }
300
+ onChange={(value, option) => {
301
+ values[0] = value;
302
+ valueNames[0] = option?.props?.children || '';
303
+ callback(values, valueNames);
304
+ }}
305
+ value={values[0]}
306
+ style={styleCommon}
307
+ >
308
+ {thresholdList.map((item) => (
309
+ <Select.Option value={item.code}>{item.name}</Select.Option>
310
+ ))}
311
+ </Select>
312
+ <span>~</span>
313
+ <Select
314
+ value={values[1]}
315
+ disabled={disabled}
316
+ showSearch
317
+ filterOption={(input, option) =>
318
+ option.props.children
319
+ ?.toLowerCase()
320
+ .indexOf(input.toLowerCase()) >= 0
321
+ }
322
+ onChange={(value, option) => {
323
+ values[1] = value;
324
+ valueNames[1] = option?.props?.children || '';
325
+ callback(values, valueNames);
326
+ }}
327
+ style={styleCommon}
328
+ >
329
+ {thresholdList.map((item) => (
330
+ <Select.Option value={item.code}>{item.name}</Select.Option>
331
+ ))}
332
+ </Select>
333
+ </>
334
+ );
335
+ } else {
336
+ return (
337
+ <Select
338
+ disabled={disabled}
339
+ showSearch
340
+ filterOption={(input, option) =>
341
+ option.props.children
342
+ ?.toLowerCase()
343
+ .indexOf(input.toLowerCase()) >= 0
344
+ }
345
+ onChange={(value, option) => {
346
+ if (SET_TYPE.indexOf(selectOperation) > -1) {
347
+ let valueNames1 = Array.isArray(option)
348
+ ? option.map((item) => item?.props?.children || '')
349
+ : [];
350
+ values = [...value];
351
+ valueNames = [...valueNames1];
352
+ } else {
353
+ values = [value];
354
+ valueNames = [option?.props?.children || ''];
355
+ }
356
+ callback(values, valueNames);
357
+ }}
358
+ value={SET_TYPE.indexOf(selectOperation) > -1 ? values : values[0]}
359
+ style={styleCommon}
360
+ mode={
361
+ SET_TYPE.indexOf(selectOperation) > -1 ? 'multiple' : 'default'
362
+ }
363
+ >
364
+ {thresholdList.map((item) => (
365
+ <Select.Option value={item.code}>{item.name}</Select.Option>
366
+ ))}
367
+ </Select>
368
+ );
369
+ }
370
+ } else if (dataInputBusinessType == 11 || dataInputBusinessType == 12) {
371
+ // 11 单选 12 多选
372
+ // 物理仓
373
+ if (dataChoiceBusinessType == 110) {
374
+ if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
375
+ return (
376
+ <>
377
+ <BusinessSearchSelect
378
+ selectBusinessType="physicalWarehouse"
379
+ selectProps={{
380
+ style: styleCommon,
381
+ placeholder: '请选择物理仓',
382
+ ...(dataInputBusinessType === 12
383
+ ? {
384
+ mode: 'multiple',
385
+ maxTagCount: 1,
386
+ }
387
+ : {}),
388
+ }}
389
+ disabled={disabled}
390
+ labelInValue={true}
391
+ value={values[0]}
392
+ requestConfig={{
393
+ mappingValueField: 'physicalWarehouseCode',
394
+ filterInit: 'qp-physicalWarehouseCode-in',
395
+ }}
396
+ onChange={(value) => {
397
+ if (dataInputBusinessType === 12) {
398
+ values[0] = value.map((i) => i.key);
399
+ valueNames[0] = value.map((i) => i.label || '');
400
+ } else {
401
+ values[0] = [value.key];
402
+ valueNames[0] = [value.label || ''];
403
+ }
404
+ callback(values, valueNames);
405
+ }}
406
+ getPopupContainer={() => document.body}
407
+ />
408
+ <span>~</span>
409
+ <BusinessSearchSelect
410
+ selectBusinessType="physicalWarehouse"
411
+ selectProps={{
412
+ style: styleCommon,
413
+ placeholder: '请选择物理仓',
414
+ ...(dataInputBusinessType === 12
415
+ ? {
416
+ mode: 'multiple',
417
+ maxTagCount: 1,
418
+ }
419
+ : {}),
420
+ }}
421
+ disabled={disabled}
422
+ labelInValue={true}
423
+ value={values[1]}
424
+ requestConfig={{
425
+ mappingValueField: 'physicalWarehouseCode',
426
+ filterInit: 'qp-physicalWarehouseCode-in',
427
+ }}
428
+ onChange={(value) => {
429
+ if (dataInputBusinessType === 12) {
430
+ values[1] = value.map((i) => i.key);
431
+ valueNames[1] = value.map((i) => i.label || '');
432
+ } else {
433
+ values[1] = [value.key];
434
+ valueNames[1] = [value.label || ''];
435
+ }
436
+ callback(values, valueNames);
437
+ }}
438
+ getPopupContainer={() => document.body}
439
+ />
440
+ </>
441
+ );
442
+ } else {
443
+ const currentValue = dataInputBusinessType === 12 ?
444
+ values?.map((s,vIndex)=> ({key: s, label: valueNames[vIndex]}))||[]
445
+ : values[0]&&{key:values[0],label:valueNames[0]}||{}
446
+ return (
447
+ <BusinessSearchSelect
448
+ selectBusinessType="physicalWarehouse"
449
+ selectProps={{
450
+ style: styleCommon,
451
+ placeholder: '请选择物理仓',
452
+ ...(dataInputBusinessType === 12
453
+ ? {
454
+ mode: 'multiple',
455
+ maxTagCount: 1,
456
+ }
457
+ : {}),
458
+ }}
459
+ disabled={disabled}
460
+ labelInValue={true}
461
+ value={currentValue}
462
+ requestConfig={{
463
+ mappingValueField: 'physicalWarehouseCode',
464
+ filterInit: 'qp-physicalWarehouseCode-in',
465
+ }}
466
+ onChange={(value) => {
467
+ if (dataInputBusinessType === 12) {
468
+ values = value.map((i) => i.key)||[];
469
+ valueNames = value.map((i) => i.label || '')||[];
470
+ } else {
471
+ values = value?.key?[value.key]:[];
472
+ valueNames = value?.label?[value.label]:[];
473
+ }
474
+ callback(values, valueNames);
475
+ }}
476
+ getPopupContainer={() => document.body}
477
+ />
478
+ );
479
+ }
480
+ }
481
+ // 逻辑仓
482
+ if (dataChoiceBusinessType == 120) {
483
+ if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
484
+ return (
485
+ <>
486
+ <BusinessSearchSelect
487
+ selectBusinessType="realWarehouse"
488
+ selectProps={{
489
+ style: styleCommon,
490
+ placeholder: '请选择逻辑仓',
491
+ ...(dataInputBusinessType === 12
492
+ ? {
493
+ mode: 'multiple',
494
+ maxTagCount: 1,
495
+ }
496
+ : {}),
497
+ }}
498
+ disabled={disabled}
499
+ labelInValue={true}
500
+ value={values[0]}
501
+ requestConfig={{
502
+ mappingValueField: 'realWarehouseCode',
503
+ filterInit: 'qp-realWarehouseCode-in',
504
+ }}
505
+ onChange={(value) => {
506
+ if (dataInputBusinessType === 12) {
507
+ values[0] = value.map((i) => i.key);
508
+ valueNames[0] = value.map((i) => i.label || '');
509
+ } else {
510
+ values[0] = [value.key];
511
+ valueNames[0] = [value.label || ''];
512
+ }
513
+ callback(values, valueNames);
514
+ }}
515
+ getPopupContainer={() => document.body}
516
+ />
517
+ <span>~</span>
518
+ <BusinessSearchSelect
519
+ selectBusinessType="realWarehouse"
520
+ selectProps={{
521
+ style: styleCommon,
522
+ placeholder: '请选择逻辑仓',
523
+ ...(dataInputBusinessType === 12
524
+ ? {
525
+ mode: 'multiple',
526
+ maxTagCount: 1,
527
+ }
528
+ : {}),
529
+ }}
530
+ disabled={disabled}
531
+ labelInValue={true}
532
+ value={values[1]}
533
+ requestConfig={{
534
+ mappingValueField: 'realWarehouseCode',
535
+ filterInit: 'qp-realWarehouseCode-in',
536
+ }}
537
+ onChange={(value) => {
538
+ if (dataInputBusinessType === 12) {
539
+ values[1] = value.map((i) => i.key);
540
+ valueNames[1] = value.map((i) => i.label || '');
541
+ } else {
542
+ values[1] = [value.key];
543
+ valueNames[1] = [value.label || ''];
544
+ }
545
+ callback(values, valueNames);
546
+ }}
547
+ getPopupContainer={() => document.body}
548
+ />
549
+ </>
550
+ );
551
+ } else {
552
+ const currentValue = dataInputBusinessType === 12 ?
553
+ values?.map((s,vIndex)=> ({key: s, label: valueNames[vIndex]}))||[]
554
+ : values[0]&&{key:values[0],label:valueNames[0]}||{}
555
+ return (
556
+ <BusinessSearchSelect
557
+ selectBusinessType="realWarehouse"
558
+ selectProps={{
559
+ style: styleCommon,
560
+ placeholder: '请选择逻辑仓',
561
+ ...(dataInputBusinessType === 12
562
+ ? {
563
+ mode: 'multiple',
564
+ maxTagCount: 1,
565
+ }
566
+ : {}),
567
+ }}
568
+ disabled={disabled}
569
+ labelInValue={true}
570
+ value={currentValue}
571
+ requestConfig={{
572
+ mappingValueField: 'realWarehouseCode',
573
+ filterInit: 'qp-realWarehouseCode-in',
574
+ }}
575
+ onChange={(value) => {
576
+ if (dataInputBusinessType === 12) {
577
+ values = value.map((i) => i.key)||[];
578
+ valueNames = value.map((i) => i.label || '')||[];
579
+ } else {
580
+ values = value?.key?[value.key]:[];
581
+ valueNames = value?.label?[value.label]:[];
582
+ }
583
+ callback(values, valueNames);
584
+ }}
585
+ getPopupContainer={() => document.body}
586
+ />
587
+ );
588
+ }
589
+ }
590
+ // 虚拟仓
591
+ if (dataChoiceBusinessType == 130) {
592
+ if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
593
+ return (
594
+ <>
595
+ <BusinessSearchSelect
596
+ selectBusinessType="virtualWarehouse"
597
+ selectProps={{
598
+ style: styleCommon,
599
+ placeholder: '请选择虚拟仓',
600
+ ...(dataInputBusinessType === 12
601
+ ? {
602
+ mode: 'multiple',
603
+ maxTagCount: 1,
604
+ }
605
+ : {}),
606
+ }}
607
+ disabled={disabled}
608
+ labelInValue={true}
609
+ value={values[0]}
610
+ requestConfig={{
611
+ mappingValueField: 'virtualWarehouseCode',
612
+ filterInit: 'qp-virtualWarehouseCode-in',
613
+ }}
614
+ onChange={(value) => {
615
+ if (dataInputBusinessType === 12) {
616
+ values[0] = value.map((i) => i.key);
617
+ valueNames[0] = value.map((i) => i.label || '');
618
+ } else {
619
+ values[0] = [value.key];
620
+ valueNames[0] = [value.label || ''];
621
+ }
622
+ callback(values, valueNames);
623
+ }}
624
+ getPopupContainer={() => document.body}
625
+ />
626
+ <span>~</span>
627
+ <BusinessSearchSelect
628
+ selectBusinessType="virtualWarehouse"
629
+ selectProps={{
630
+ style: styleCommon,
631
+ placeholder: '请选择虚拟仓',
632
+ ...(dataInputBusinessType === 12
633
+ ? {
634
+ mode: 'multiple',
635
+ maxTagCount: 1,
636
+ }
637
+ : {}),
638
+ }}
639
+ disabled={disabled}
640
+ labelInValue={true}
641
+ value={values[1]}
642
+ requestConfig={{
643
+ mappingValueField: 'virtualWarehouseCode',
644
+ filterInit: 'qp-virtualWarehouseCode-in',
645
+ }}
646
+ onChange={(value) => {
647
+ if (dataInputBusinessType === 12) {
648
+ values[1] = value.map((i) => i.key);
649
+ valueNames[1] = value.map((i) => i.label || '');
650
+ } else {
651
+ values[1] = [value.key];
652
+ valueNames[1] = [value.label || ''];
653
+ }
654
+ callback(values, valueNames);
655
+ }}
656
+ getPopupContainer={() => document.body}
657
+ />
658
+ </>
659
+ );
660
+ } else {
661
+ const currentValue = dataInputBusinessType === 12 ?
662
+ values?.map((s,vIndex)=> ({key: s, label: valueNames[vIndex]}))||[]
663
+ : values[0]&&{key:values[0],label:valueNames[0]}||{}
664
+ return (
665
+ <BusinessSearchSelect
666
+ selectBusinessType="virtualWarehouse"
667
+ selectProps={{
668
+ style: styleCommon,
669
+ placeholder: '请选择虚拟仓',
670
+ ...(dataInputBusinessType === 12
671
+ ? {
672
+ mode: 'multiple',
673
+ maxTagCount: 1,
674
+ }
675
+ : {}),
676
+ }}
677
+ disabled={disabled}
678
+ labelInValue={true}
679
+ value={currentValue}
680
+ requestConfig={{
681
+ mappingValueField: 'virtualWarehouseCode',
682
+ filterInit: 'qp-virtualWarehouseCode-in',
683
+ }}
684
+ onChange={(value) => {
685
+ if (dataInputBusinessType === 12) {
686
+ values = value.map((i) => i.key)||[];
687
+ valueNames = value.map((i) => i.label || '')||[];
688
+ } else {
689
+ values = value?.key?[value.key]:[];
690
+ valueNames = value?.label?[value.label]:[];
691
+ }
692
+ callback(values, valueNames);
693
+ }}
694
+ getPopupContainer={() => document.body}
695
+ />
696
+ );
697
+ }
698
+ }
699
+ // 渠道仓
700
+ if (dataChoiceBusinessType == 140) {
701
+ if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
702
+ return (
703
+ <>
704
+ <BusinessSearchSelect
705
+ selectBusinessType="channelWarehouse"
706
+ selectProps={{
707
+ style: styleCommon,
708
+ placeholder: '请选择渠道仓',
709
+ ...(dataInputBusinessType === 12
710
+ ? {
711
+ mode: 'multiple',
712
+ maxTagCount: 1,
713
+ }
714
+ : {}),
715
+ }}
716
+ disabled={disabled}
717
+ labelInValue={true}
718
+ value={values[0]}
719
+ requestConfig={{
720
+ mappingValueField: 'channelWarehouseCode',
721
+ filterInit: 'qp-channelWarehouseCode-in',
722
+ }}
723
+ onChange={(value) => {
724
+ if (dataInputBusinessType === 12) {
725
+ values[0] = value.map((i) => i.key);
726
+ valueNames[0] = value.map((i) => i.label || '');
727
+ } else {
728
+ values[0] = [value.key];
729
+ valueNames[0] = [value.label || ''];
730
+ }
731
+ callback(values, valueNames);
732
+ }}
733
+ getPopupContainer={() => document.body}
734
+ />
735
+ <span>~</span>
736
+ <BusinessSearchSelect
737
+ selectBusinessType="channelWarehouse"
738
+ selectProps={{
739
+ style: styleCommon,
740
+ placeholder: '请选择渠道仓',
741
+ ...(dataInputBusinessType === 12
742
+ ? {
743
+ mode: 'multiple',
744
+ maxTagCount: 1,
745
+ }
746
+ : {}),
747
+ }}
748
+ disabled={disabled}
749
+ labelInValue={true}
750
+ value={values[1]}
751
+ requestConfig={{
752
+ mappingValueField: 'channelWarehouseCode',
753
+ filterInit: 'qp-channelWarehouseCode-in',
754
+ }}
755
+ onChange={(value) => {
756
+ if (dataInputBusinessType === 12) {
757
+ values[1] = value.map((i) => i.key);
758
+ valueNames[1] = value.map((i) => i.label || '');
759
+ } else {
760
+ values[1] = [value.key];
761
+ valueNames[1] = [value.label || ''];
762
+ }
763
+ callback(values, valueNames);
764
+ }}
765
+ getPopupContainer={() => document.body}
766
+ />
767
+ </>
768
+ );
769
+ } else {
770
+ const currentValue = dataInputBusinessType === 12 ?
771
+ values?.map((s,vIndex)=> ({key: s, label: valueNames[vIndex]}))||[]
772
+ : values[0]&&{key:values[0],label:valueNames[0]}||{}
773
+ return (
774
+ <BusinessSearchSelect
775
+ selectBusinessType="channelWarehouse"
776
+ selectProps={{
777
+ style: styleCommon,
778
+ placeholder: '请选择渠道仓',
779
+ ...(dataInputBusinessType === 12
780
+ ? {
781
+ mode: 'multiple',
782
+ maxTagCount: 1,
783
+ }
784
+ : {}),
785
+ }}
786
+ disabled={disabled}
787
+ labelInValue={true}
788
+ value={currentValue}
789
+ requestConfig={{
790
+ mappingValueField: 'channelWarehouseCode',
791
+ filterInit: 'qp-channelWarehouseCode-in',
792
+ }}
793
+ onChange={(value) => {
794
+ if (dataInputBusinessType === 12) {
795
+ values = value.map((i) => i.key)||[];
796
+ valueNames = value.map((i) => i.label || '')||[];
797
+ } else {
798
+ values = value?.key?[value.key]:[];
799
+ valueNames = value?.label?[value.label]:[];
800
+ }
801
+ callback(values, valueNames);
802
+ }}
803
+ getPopupContainer={() => document.body}
804
+ />
805
+ );
806
+ }
807
+ }
808
+ // 商品SPU选择器
809
+ if (dataChoiceBusinessType == 150) {
810
+ if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
811
+ return (
812
+ <>
813
+ <BusinessSearchSelect
814
+ selectBusinessType="spuCommodity"
815
+ selectProps={{
816
+ style: styleCommon,
817
+ placeholder: '请选择SPU',
818
+ ...(dataInputBusinessType === 12
819
+ ? {
820
+ mode: 'multiple',
821
+ maxTagCount: 1,
822
+ }
823
+ : {}),
824
+ }}
825
+ disabled={disabled}
826
+ labelInValue={true}
827
+ value={values[0]}
828
+ requestConfig={{
829
+ filterInit: 'qp-itemCode-in',
830
+ }}
831
+ onChange={(value) => {
832
+ if (dataInputBusinessType === 12) {
833
+ values[0] = value.map((i) => i.key);
834
+ valueNames[0] = value.map((i) => i.label || '');
835
+ } else {
836
+ values[0] = [value.key];
837
+ valueNames[0] = [value.label || ''];
838
+ }
839
+ callback(values, valueNames);
840
+ }}
841
+ getPopupContainer={() => document.body}
842
+ />
843
+ <span>~</span>
844
+ <BusinessSearchSelect
845
+ selectBusinessType="spuCommodity"
846
+ selectProps={{
847
+ style: styleCommon,
848
+ placeholder: '请选择SPU',
849
+ ...(dataInputBusinessType === 12
850
+ ? {
851
+ mode: 'multiple',
852
+ maxTagCount: 1,
853
+ }
854
+ : {}),
855
+ }}
856
+ disabled={disabled}
857
+ labelInValue={true}
858
+ value={values[1]}
859
+ requestConfig={{
860
+ filterInit: 'qp-itemCode-in',
861
+ }}
862
+ onChange={(value) => {
863
+ if (dataInputBusinessType === 12) {
864
+ values[1] = value.map((i) => i.key);
865
+ valueNames[1] = value.map((i) => i.label || '');
866
+ } else {
867
+ values[1] = [value.key];
868
+ valueNames[1] = [value.label || ''];
869
+ }
870
+ callback(values, valueNames);
871
+ }}
872
+ getPopupContainer={() => document.body}
873
+ />
874
+ </>
875
+ );
876
+ } else {
877
+ const currentValue = dataInputBusinessType === 12 ?
878
+ values?.map((s,vIndex)=> ({key: s, label: valueNames[vIndex]}))||[]
879
+ : values[0]&&{key:values[0],label:valueNames[0]}||{}
880
+ return (
881
+ <BusinessSearchSelect
882
+ selectBusinessType="spuCommodity"
883
+ selectProps={{
884
+ style: styleCommon,
885
+ placeholder: '请选择SPU',
886
+ ...(dataInputBusinessType === 12
887
+ ? {
888
+ mode: 'multiple',
889
+ maxTagCount: 1,
890
+ }
891
+ : {}),
892
+ }}
893
+ disabled={disabled}
894
+ labelInValue={true}
895
+ value={currentValue}
896
+ requestConfig={{
897
+ filterInit: 'qp-itemCode-in',
898
+ }}
899
+ onChange={(value) => {
900
+ if (dataInputBusinessType === 12) {
901
+ values = value.map((i) => i.key)||[];
902
+ valueNames = value.map((i) => i.label || '')||[];
903
+ } else {
904
+ values = value?.key?[value.key]:[];
905
+ valueNames = value?.label?[value.label]:[];
906
+ }
907
+ callback(values, valueNames);
908
+ }}
909
+ getPopupContainer={() => document.body}
910
+ />
911
+ );
912
+ }
913
+ }
914
+ // 商品SKU选择器
915
+ if (dataChoiceBusinessType == 160) {
916
+ if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
917
+ return (
918
+ <>
919
+ <BusinessSearchSelect
920
+ selectBusinessType="skuCommodity"
921
+ selectProps={{
922
+ style: styleCommon,
923
+ placeholder: '请选择商品',
924
+ ...(dataInputBusinessType === 12
925
+ ? {
926
+ mode: 'multiple',
927
+ maxTagCount: 1,
928
+ }
929
+ : {}),
930
+ }}
931
+ disabled={disabled}
932
+ labelInValue={true}
933
+ value={values[0]}
934
+ requestConfig={{
935
+ filterInit: 'qp-skuCode-in',
936
+ }}
937
+ onChange={(value) => {
938
+ if (dataInputBusinessType === 12) {
939
+ values[0] = value.map((i) => i.key);
940
+ valueNames[0] = value.map((i) => i.label || '');
941
+ } else {
942
+ values[0] = [value.key];
943
+ valueNames[0] = [value.label || ''];
944
+ }
945
+ callback(values, valueNames);
946
+ }}
947
+ getPopupContainer={() => document.body}
948
+ />
949
+ <span>~</span>
950
+ <BusinessSearchSelect
951
+ selectBusinessType="skuCommodity"
952
+ selectProps={{
953
+ style: styleCommon,
954
+ placeholder: '请选择商品',
955
+ ...(dataInputBusinessType === 12
956
+ ? {
957
+ mode: 'multiple',
958
+ maxTagCount: 1,
959
+ }
960
+ : {}),
961
+ }}
962
+ disabled={disabled}
963
+ labelInValue={true}
964
+ value={values[1]}
965
+ requestConfig={{
966
+ filterInit: 'qp-skuCode-in',
967
+ }}
968
+ onChange={(value) => {
969
+ if (dataInputBusinessType === 12) {
970
+ values[1] = value.map((i) => i.key);
971
+ valueNames[1] = value.map((i) => i.label || '');
972
+ } else {
973
+ values[1] = [value.key];
974
+ valueNames[1] = [value.label || ''];
975
+ }
976
+ callback(values, valueNames);
977
+ }}
978
+ getPopupContainer={() => document.body}
979
+ />
980
+ </>
981
+ );
982
+ } else {
983
+ const currentValue = dataInputBusinessType === 12 ?
984
+ values?.map((s,vIndex)=> ({key: s, label: valueNames[vIndex]}))||[]
985
+ : values[0]&&{key:values[0],label:valueNames[0]}||{}
986
+ return (
987
+ <BusinessSearchSelect
988
+ selectBusinessType="skuCommodity"
989
+ selectProps={{
990
+ style: styleCommon,
991
+ placeholder: '请选择商品',
992
+ ...(dataInputBusinessType === 12
993
+ ? {
994
+ mode: 'multiple',
995
+ maxTagCount: 1,
996
+ }
997
+ : {}),
998
+ }}
999
+ disabled={disabled}
1000
+ labelInValue={true}
1001
+ value={currentValue}
1002
+ requestConfig={{
1003
+ filterInit: 'qp-skuCode-in',
1004
+ }}
1005
+ onChange={(value) => {
1006
+ if (dataInputBusinessType === 12) {
1007
+ values = value.map((i) => i.key)||[];
1008
+ valueNames = value.map((i) => i.label || '')||[];
1009
+ } else {
1010
+ values = value?.key?[value.key]:[];
1011
+ valueNames = value?.label?[value.label]:[];
1012
+ }
1013
+ callback(values, valueNames);
1014
+ }}
1015
+ getPopupContainer={() => document.body}
1016
+ />
1017
+ );
1018
+ }
1019
+ }
1020
+ // 省市区
1021
+ if (dataChoiceBusinessType == 190) {
1022
+ if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
1023
+ return (
1024
+ <>
1025
+ <BsCascader
1026
+ disabled={disabled}
1027
+ isAll={true}
1028
+ needNameAndCode={true}
1029
+ notChangeOnSelect={true}
1030
+ initRequestSource={async () => {
1031
+ return await SulaRequest({
1032
+ url: '/basic/bscArea/getBscAreaList?qp-level-eq=1&qp-pid-eq=100000',
1033
+ method: 'get',
1034
+ converter: ({ data }) => {
1035
+ const handleData =
1036
+ data && data[0]
1037
+ ? data?.map((item) => {
1038
+ return {
1039
+ text: item.name,
1040
+ value: item.id,
1041
+ level: item.level,
1042
+ id: item.id,
1043
+ };
1044
+ })
1045
+ : [];
1046
+ return handleData;
1047
+ },
1048
+ });
1049
+ }}
1050
+ style={{ width: 240 }}
1051
+ value={{ PCDName: valueNames[0] || [] }}
1052
+ onChange={(value) => {
1053
+ values[0] = value.PCDCode;
1054
+ valueNames[0] = value.PCDName;
1055
+ callback(values, valueNames);
1056
+ }}
1057
+ getPopupContainer={() => document.body}
1058
+ />
1059
+ <span>~</span>
1060
+ <BsCascader
1061
+ disabled={disabled}
1062
+ onlyCode={true}
1063
+ isAll={true}
1064
+ needNameAndCode={true}
1065
+ notChangeOnSelect={true}
1066
+ initRequestSource={async () => {
1067
+ return await SulaRequest({
1068
+ url: '/basic/bscArea/getBscAreaList?qp-level-eq=1&qp-pid-eq=100000',
1069
+ method: 'get',
1070
+ converter: ({ data }) => {
1071
+ const handleData =
1072
+ data && data[0]
1073
+ ? data?.map((item) => {
1074
+ return {
1075
+ text: item.name,
1076
+ value: item.id,
1077
+ level: item.level,
1078
+ id: item.id,
1079
+ };
1080
+ })
1081
+ : [];
1082
+ return handleData;
1083
+ },
1084
+ });
1085
+ }}
1086
+ style={{ width: 240 }}
1087
+ value={{ PCDName: valueNames[1] || [] }}
1088
+ onChange={(value) => {
1089
+ values[1] = value.PCDCode;
1090
+ valueNames[1] = value.PCDName;
1091
+ callback(values, valueNames);
1092
+ }}
1093
+ getPopupContainer={() => document.body}
1094
+ />
1095
+ </>
1096
+ );
1097
+ } else {
1098
+ return (
1099
+ <BsCascader
1100
+ disabled={disabled}
1101
+ onlyCode={true}
1102
+ isAll={true}
1103
+ needNameAndCode={true}
1104
+ notChangeOnSelect={true}
1105
+ initRequestSource={async () => {
1106
+ return await SulaRequest({
1107
+ url: '/basic/bscArea/getBscAreaList?qp-level-eq=1&qp-pid-eq=100000',
1108
+ method: 'get',
1109
+ converter: ({ data }) => {
1110
+ const handleData =
1111
+ data && data[0]
1112
+ ? data?.map((item) => {
1113
+ return {
1114
+ text: item.name,
1115
+ value: item.id,
1116
+ level: item.level,
1117
+ id: item.id,
1118
+ };
1119
+ })
1120
+ : [];
1121
+ return handleData;
1122
+ },
1123
+ });
1124
+ }}
1125
+ style={{ width: 240 }}
1126
+ value={{ PCDName: valueNames || [] }}
1127
+ onChange={(value) => {
1128
+ values = value.PCDCode;
1129
+ valueNames = value.PCDName;
1130
+ callback(values, valueNames);
1131
+ }}
1132
+ getPopupContainer={() => document.body}
1133
+ />
1134
+ );
1135
+ }
1136
+ }
1137
+ // 行政组织选择器
1138
+ if (dataChoiceBusinessType == 210) {
1139
+ if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
1140
+ return (
1141
+ <>
1142
+ <BusinessTreeSearchSelect
1143
+ disabled={disabled}
1144
+ treeCheckable={dataInputBusinessType === 12}
1145
+ businessType="department"
1146
+ labelInValue={true}
1147
+ value={values[0]}
1148
+ style={styleCommon}
1149
+ onChange={(value) => {
1150
+ if (dataInputBusinessType === 12) {
1151
+ values[0] = value.map((i) => i.key);
1152
+ valueNames[0] = value.map((i) => i.label || '');
1153
+ } else {
1154
+ values[0] = [value.key];
1155
+ valueNames[0] = [value.label || ''];
1156
+ }
1157
+ callback(values, valueNames);
1158
+ }}
1159
+ getPopupContainer={() => document.body}
1160
+ />
1161
+ <span>~</span>
1162
+ <BusinessTreeSearchSelect
1163
+ disabled={disabled}
1164
+ treeCheckable={dataInputBusinessType === 12}
1165
+ businessType="department"
1166
+ labelInValue={true}
1167
+ value={values[0]}
1168
+ style={styleCommon}
1169
+ onChange={(value) => {
1170
+ if (dataInputBusinessType === 12) {
1171
+ values[1] = value.map((i) => i.key);
1172
+ valueNames[1] = value.map((i) => i.label || '');
1173
+ } else {
1174
+ values[1] = [value.key];
1175
+ valueNames[1] = [value.label || ''];
1176
+ }
1177
+ callback(values, valueNames);
1178
+ }}
1179
+ getPopupContainer={() => document.body}
1180
+ />
1181
+ </>
1182
+ );
1183
+ } else {
1184
+ return (
1185
+ <BusinessTreeSearchSelect
1186
+ disabled={disabled}
1187
+ treeCheckable={dataInputBusinessType === 12}
1188
+ businessType="department"
1189
+ labelInValue={true}
1190
+ value={values[0]}
1191
+ style={styleCommon}
1192
+ onChange={(value) => {
1193
+ if (dataInputBusinessType === 12) {
1194
+ values = value.map((i) => i.key)||[];
1195
+ valueNames = value.map((i) => i.label || '')||[];
1196
+ } else {
1197
+ values = value?.key?[value.key]:[];
1198
+ valueNames = value?.label?[value.label]:[];
1199
+ }
1200
+ callback(values, valueNames);
1201
+ }}
1202
+ getPopupContainer={() => document.body}
1203
+ />
1204
+ );
1205
+ }
1206
+ }
1207
+ // 采购组织选择器
1208
+ if (dataChoiceBusinessType == 220) {
1209
+ if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
1210
+ return (
1211
+ <>
1212
+ <BusinessTreeSearchSelect
1213
+ disabled={disabled}
1214
+ treeCheckable={dataInputBusinessType === 12}
1215
+ businessType="purchase-organization"
1216
+ labelInValue={true}
1217
+ value={values[0]}
1218
+ style={styleCommon}
1219
+ onChange={(value) => {
1220
+ if (dataInputBusinessType === 12) {
1221
+ values[0] = value.map((i) => i.key);
1222
+ valueNames[0] = value.map((i) => i.label || '');
1223
+ } else {
1224
+ values[0] = [value.key];
1225
+ valueNames[0] = [value.label || ''];
1226
+ }
1227
+ callback(values, valueNames);
1228
+ }}
1229
+ getPopupContainer={() => document.body}
1230
+ />
1231
+ <span>~</span>
1232
+ <BusinessTreeSearchSelect
1233
+ disabled={disabled}
1234
+ treeCheckable={dataInputBusinessType === 12}
1235
+ businessType="purchase-organization"
1236
+ labelInValue={true}
1237
+ value={values[0]}
1238
+ style={styleCommon}
1239
+ onChange={(value) => {
1240
+ if (dataInputBusinessType === 12) {
1241
+ values[1] = value.map((i) => i.key);
1242
+ valueNames[1] = value.map((i) => i.label || '');
1243
+ } else {
1244
+ values[1] = [value.key];
1245
+ valueNames[1] = [value.label || ''];
1246
+ }
1247
+ callback(values, valueNames);
1248
+ }}
1249
+ getPopupContainer={() => document.body}
1250
+ />
1251
+ </>
1252
+ );
1253
+ } else {
1254
+ return (
1255
+ <BusinessTreeSearchSelect
1256
+ disabled={disabled}
1257
+ treeCheckable={dataInputBusinessType === 12}
1258
+ businessType="purchase-organization"
1259
+ labelInValue={true}
1260
+ value={values[0]}
1261
+ style={styleCommon}
1262
+ onChange={(value) => {
1263
+ if (dataInputBusinessType === 12) {
1264
+ values = value.map((i) => i.key)||[];
1265
+ valueNames = value.map((i) => i.label || '')||[];
1266
+ } else {
1267
+ values = value?.key?[value.key]:[];
1268
+ valueNames = value?.label?[value.label]:[];
1269
+ }
1270
+ callback(values, valueNames);
1271
+ }}
1272
+ getPopupContainer={() => document.body}
1273
+ />
1274
+ );
1275
+ }
1276
+ }
1277
+ // 销售组织选择器
1278
+ if (dataChoiceBusinessType == 230) {
1279
+ if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
1280
+ return (
1281
+ <>
1282
+ <BusinessTreeSearchSelect
1283
+ disabled={disabled}
1284
+ treeCheckable={dataInputBusinessType === 12}
1285
+ businessType="sales-organization"
1286
+ labelInValue={true}
1287
+ value={values[0]}
1288
+ style={styleCommon}
1289
+ onChange={(value) => {
1290
+ if (dataInputBusinessType === 12) {
1291
+ values[0] = value.map((i) => i.key);
1292
+ valueNames[0] = value.map((i) => i.label || '');
1293
+ } else {
1294
+ values[0] = [value.key];
1295
+ valueNames[0] = [value.label || ''];
1296
+ }
1297
+ callback(values, valueNames);
1298
+ }}
1299
+ getPopupContainer={() => document.body}
1300
+ />
1301
+ <span>~</span>
1302
+ <BusinessTreeSearchSelect
1303
+ disabled={disabled}
1304
+ treeCheckable={dataInputBusinessType === 12}
1305
+ businessType="sales-organization"
1306
+ labelInValue={true}
1307
+ value={values[0]}
1308
+ style={styleCommon}
1309
+ onChange={(value) => {
1310
+ if (dataInputBusinessType === 12) {
1311
+ values[1] = value.map((i) => i.key);
1312
+ valueNames[1] = value.map((i) => i.label || '');
1313
+ } else {
1314
+ values[1] = [value.key];
1315
+ valueNames[1] = [value.label || ''];
1316
+ }
1317
+ callback(values, valueNames);
1318
+ }}
1319
+ getPopupContainer={() => document.body}
1320
+ />
1321
+ </>
1322
+ );
1323
+ } else {
1324
+ return (
1325
+ <BusinessTreeSearchSelect
1326
+ disabled={disabled}
1327
+ treeCheckable={dataInputBusinessType === 12}
1328
+ businessType="sales-organization"
1329
+ labelInValue={true}
1330
+ value={values[0]}
1331
+ style={styleCommon}
1332
+ onChange={(value) => {
1333
+ if (dataInputBusinessType === 12) {
1334
+ values = value.map((i) => i.key)||[];
1335
+ valueNames = value.map((i) => i.label || '')||[];
1336
+ } else {
1337
+ values = value?.key?[value.key]:[];
1338
+ valueNames = value?.label?[value.label]:[];
1339
+ }
1340
+ callback(values, valueNames);
1341
+ }}
1342
+ getPopupContainer={() => document.body}
1343
+ />
1344
+ );
1345
+ }
1346
+ }
1347
+ // 供应商选择器
1348
+ if (dataChoiceBusinessType == 240) {
1349
+ if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
1350
+ return (
1351
+ <>
1352
+ <BusinessSearchSelect
1353
+ selectBusinessType="supplier2"
1354
+ selectProps={{
1355
+ style: styleCommon,
1356
+ placeholder: '请选择供应商',
1357
+ ...(dataInputBusinessType === 12
1358
+ ? {
1359
+ mode: 'multiple',
1360
+ maxTagCount: 1,
1361
+ }
1362
+ : {}),
1363
+ }}
1364
+ disabled={disabled}
1365
+ labelInValue={true}
1366
+ value={values[0]}
1367
+ requestConfig={{
1368
+ filterInit: 'qp-code-in',
1369
+ }}
1370
+ onChange={(value) => {
1371
+ if (dataInputBusinessType === 12) {
1372
+ values[0] = value.map((i) => i.key);
1373
+ valueNames[0] = value.map((i) => i.label || '');
1374
+ } else {
1375
+ values[0] = [value.key];
1376
+ valueNames[0] = [value.label || ''];
1377
+ }
1378
+ callback(values, valueNames);
1379
+ }}
1380
+ getPopupContainer={() => document.body}
1381
+ />
1382
+ <span>~</span>
1383
+ <BusinessSearchSelect
1384
+ selectBusinessType="supplier2"
1385
+ selectProps={{
1386
+ style: styleCommon,
1387
+ placeholder: '请选择供应商',
1388
+ ...(dataInputBusinessType === 12
1389
+ ? {
1390
+ mode: 'multiple',
1391
+ maxTagCount: 1,
1392
+ }
1393
+ : {}),
1394
+ }}
1395
+ disabled={disabled}
1396
+ labelInValue={true}
1397
+ value={values[1]}
1398
+ requestConfig={{
1399
+ filterInit: 'qp-code-in',
1400
+ }}
1401
+ onChange={(value) => {
1402
+ if (dataInputBusinessType === 12) {
1403
+ values[1] = value.map((i) => i.key);
1404
+ valueNames[1] = value.map((i) => i.label || '');
1405
+ } else {
1406
+ values[1] = [value.key];
1407
+ valueNames[1] = [value.label || ''];
1408
+ }
1409
+ callback(values, valueNames);
1410
+ }}
1411
+ getPopupContainer={() => document.body}
1412
+ />
1413
+ </>
1414
+ );
1415
+ } else {
1416
+ const currentValue = dataInputBusinessType === 12 ?
1417
+ values?.map((s,vIndex)=> ({key: s, label: valueNames[vIndex]}))||[]
1418
+ : values[0]&&{key:values[0],label:valueNames[0]}||{}
1419
+ return (
1420
+ <BusinessSearchSelect
1421
+ selectBusinessType="supplier2"
1422
+ selectProps={{
1423
+ style: styleCommon,
1424
+ placeholder: '请选择供应商',
1425
+ ...(dataInputBusinessType === 12
1426
+ ? {
1427
+ mode: 'multiple',
1428
+ maxTagCount: 1,
1429
+ }
1430
+ : {}),
1431
+ }}
1432
+ disabled={disabled}
1433
+ labelInValue={true}
1434
+ value={currentValue}
1435
+ requestConfig={{
1436
+ filterInit: 'qp-code-in',
1437
+ }}
1438
+ onChange={(value) => {
1439
+ if (dataInputBusinessType === 12) {
1440
+ values = value.map((i) => i.key)||[];
1441
+ valueNames = value.map((i) => i.label || '')||[];
1442
+ } else {
1443
+ values = value?.key?[value.key]:[];
1444
+ valueNames = value?.label?[value.label]:[];
1445
+ }
1446
+ callback(values, valueNames);
1447
+ }}
1448
+ getPopupContainer={() => document.body}
1449
+ />
1450
+ );
1451
+ }
1452
+ }
1453
+ // 客户选择器
1454
+ if (dataChoiceBusinessType == 250) {
1455
+ if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
1456
+ return (
1457
+ <>
1458
+ <BusinessSearchSelect
1459
+ selectBusinessType="customer2"
1460
+ selectProps={{
1461
+ style: styleCommon,
1462
+ placeholder: '请选择客户',
1463
+ ...(dataInputBusinessType === 12
1464
+ ? {
1465
+ mode: 'multiple',
1466
+ maxTagCount: 1,
1467
+ }
1468
+ : {}),
1469
+ }}
1470
+ disabled={disabled}
1471
+ labelInValue={true}
1472
+ value={values[0]}
1473
+ requestConfig={{
1474
+ filterInit: 'qp-code-in',
1475
+ }}
1476
+ onChange={(value) => {
1477
+ if (dataInputBusinessType === 12) {
1478
+ values[0] = value.map((i) => i.key);
1479
+ valueNames[0] = value.map((i) => i.label || '');
1480
+ } else {
1481
+ values[0] = [value.key];
1482
+ valueNames[0] = [value.label || ''];
1483
+ }
1484
+ callback(values, valueNames);
1485
+ }}
1486
+ getPopupContainer={() => document.body}
1487
+ />
1488
+ <span>~</span>
1489
+ <BusinessSearchSelect
1490
+ selectBusinessType="customer2"
1491
+ selectProps={{
1492
+ style: styleCommon,
1493
+ placeholder: '请选择客户',
1494
+ ...(dataInputBusinessType === 12
1495
+ ? {
1496
+ mode: 'multiple',
1497
+ maxTagCount: 1,
1498
+ }
1499
+ : {}),
1500
+ }}
1501
+ disabled={disabled}
1502
+ labelInValue={true}
1503
+ value={values[1]}
1504
+ requestConfig={{
1505
+ filterInit: 'qp-code-in',
1506
+ }}
1507
+ onChange={(value) => {
1508
+ if (dataInputBusinessType === 12) {
1509
+ values[1] = value.map((i) => i.key);
1510
+ valueNames[1] = value.map((i) => i.label || '');
1511
+ } else {
1512
+ values[1] = [value.key];
1513
+ valueNames[1] = [value.label || ''];
1514
+ }
1515
+ callback(values, valueNames);
1516
+ }}
1517
+ getPopupContainer={() => document.body}
1518
+ />
1519
+ </>
1520
+ );
1521
+ } else {
1522
+ const currentValue = dataInputBusinessType === 12 ?
1523
+ values?.map((s,vIndex)=> ({key: s, label: valueNames[vIndex]}))||[]
1524
+ : values[0]&&{key:values[0],label:valueNames[0]}||{}
1525
+ return (
1526
+ <BusinessSearchSelect
1527
+ selectBusinessType="customer2"
1528
+ selectProps={{
1529
+ style: styleCommon,
1530
+ placeholder: '请选择客户',
1531
+ ...(dataInputBusinessType === 12
1532
+ ? {
1533
+ mode: 'multiple',
1534
+ maxTagCount: 1,
1535
+ }
1536
+ : {}),
1537
+ }}
1538
+ disabled={disabled}
1539
+ labelInValue={true}
1540
+ value={currentValue}
1541
+ requestConfig={{
1542
+ filterInit: 'qp-code-in',
1543
+ }}
1544
+ onChange={(value) => {
1545
+ if (dataInputBusinessType === 12) {
1546
+ values = value.map((i) => i.key)||[];
1547
+ valueNames = value.map((i) => i.label || '')||[];
1548
+ } else {
1549
+ values = value?.key?[value.key]:[];
1550
+ valueNames = value?.label?[value.label]:[];
1551
+ }
1552
+ callback(values, valueNames);
1553
+ }}
1554
+ getPopupContainer={() => document.body}
1555
+ />
1556
+ );
1557
+ }
1558
+ }
1559
+ // 店铺选择器
1560
+ if (dataChoiceBusinessType == 260) {
1561
+ if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
1562
+ return (
1563
+ <>
1564
+ <BusinessSearchSelect
1565
+ selectBusinessType="shopFile2"
1566
+ selectProps={{
1567
+ style: styleCommon,
1568
+ placeholder: '请选择店铺',
1569
+ ...(dataInputBusinessType === 12
1570
+ ? {
1571
+ mode: 'multiple',
1572
+ maxTagCount: 1,
1573
+ }
1574
+ : {}),
1575
+ }}
1576
+ disabled={disabled}
1577
+ labelInValue={true}
1578
+ value={values[0]}
1579
+ requestConfig={{
1580
+ filterInit: 'qp-code-in',
1581
+ }}
1582
+ onChange={(value) => {
1583
+ if (dataInputBusinessType === 12) {
1584
+ values[0] = value.map((i) => i.key);
1585
+ valueNames[0] = value.map((i) => i.label || '');
1586
+ } else {
1587
+ values[0] = [value.key];
1588
+ valueNames[0] = [value.label || ''];
1589
+ }
1590
+ callback(values, valueNames);
1591
+ }}
1592
+ getPopupContainer={() => document.body}
1593
+ />
1594
+ <span>~</span>
1595
+ <BusinessSearchSelect
1596
+ selectBusinessType="shopFile2"
1597
+ selectProps={{
1598
+ style: styleCommon,
1599
+ placeholder: '请选择店铺',
1600
+ ...(dataInputBusinessType === 12
1601
+ ? {
1602
+ mode: 'multiple',
1603
+ maxTagCount: 1,
1604
+ }
1605
+ : {}),
1606
+ }}
1607
+ disabled={disabled}
1608
+ labelInValue={true}
1609
+ value={values[1]}
1610
+ requestConfig={{
1611
+ filterInit: 'qp-code-in',
1612
+ }}
1613
+ onChange={(value) => {
1614
+ if (dataInputBusinessType === 12) {
1615
+ values[1] = value.map((i) => i.key);
1616
+ valueNames[1] = value.map((i) => i.label || '');
1617
+ } else {
1618
+ values[1] = [value.key];
1619
+ valueNames[1] = [value.label || ''];
1620
+ }
1621
+ callback(values, valueNames);
1622
+ }}
1623
+ getPopupContainer={() => document.body}
1624
+ />
1625
+ </>
1626
+ );
1627
+ } else {
1628
+ const currentValue = dataInputBusinessType === 12 ?
1629
+ values?.map((s,vIndex)=> ({key: s, label: valueNames[vIndex]}))||[]
1630
+ : values[0]&&{key:values[0],label:valueNames[0]}||{}
1631
+ return (
1632
+ <BusinessSearchSelect
1633
+ selectBusinessType="shopFile2"
1634
+ selectProps={{
1635
+ style: styleCommon,
1636
+ placeholder: '请选择店铺',
1637
+ ...(dataInputBusinessType === 12
1638
+ ? {
1639
+ mode: 'multiple',
1640
+ maxTagCount: 1,
1641
+ }
1642
+ : {}),
1643
+ }}
1644
+ disabled={disabled}
1645
+ labelInValue={true}
1646
+ value={currentValue}
1647
+ requestConfig={{
1648
+ filterInit: 'qp-code-in',
1649
+ }}
1650
+ onChange={(value) => {
1651
+ if (dataInputBusinessType === 12) {
1652
+ values = value.map((i) => i.key)||[];
1653
+ valueNames = value.map((i) => i.label || '')||[];
1654
+ } else {
1655
+ values = value?.key?[value.key]:[];
1656
+ valueNames = value?.label?[value.label]:[];
1657
+ }
1658
+ callback(values, valueNames);
1659
+ }}
1660
+ getPopupContainer={() => document.body}
1661
+ />
1662
+ );
1663
+ }
1664
+ }
1665
+ // 员工选择器
1666
+ if (dataChoiceBusinessType == 270) {
1667
+ if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
1668
+ return (
1669
+ <>
1670
+ <BusinessSearchSelect
1671
+ selectBusinessType="employee2"
1672
+ selectProps={{
1673
+ style: styleCommon,
1674
+ placeholder: '请选择员工',
1675
+ ...(dataInputBusinessType === 12
1676
+ ? {
1677
+ mode: 'multiple',
1678
+ maxTagCount: 1,
1679
+ }
1680
+ : {}),
1681
+ }}
1682
+ disabled={disabled}
1683
+ labelInValue={true}
1684
+ value={values[0]}
1685
+ requestConfig={{
1686
+ filterInit: 'qp-id-in',
1687
+ }}
1688
+ onChange={(value) => {
1689
+ if (dataInputBusinessType === 12) {
1690
+ values[0] = value.map((i) => i.key);
1691
+ valueNames[0] = value.map((i) => i.label || '');
1692
+ } else {
1693
+ values[0] = [value.key];
1694
+ valueNames[0] = [value.label || ''];
1695
+ }
1696
+ callback(values, valueNames);
1697
+ }}
1698
+ getPopupContainer={() => document.body}
1699
+ />
1700
+ <span>~</span>
1701
+ <BusinessSearchSelect
1702
+ selectBusinessType="employee2"
1703
+ selectProps={{
1704
+ style: styleCommon,
1705
+ placeholder: '请选择员工',
1706
+ ...(dataInputBusinessType === 12
1707
+ ? {
1708
+ mode: 'multiple',
1709
+ maxTagCount: 1,
1710
+ }
1711
+ : {}),
1712
+ }}
1713
+ disabled={disabled}
1714
+ labelInValue={true}
1715
+ value={values[1]}
1716
+ requestConfig={{
1717
+ filterInit: 'qp-id-in',
1718
+ }}
1719
+ onChange={(value) => {
1720
+ if (dataInputBusinessType === 12) {
1721
+ values[1] = value.map((i) => i.key);
1722
+ valueNames[1] = value.map((i) => i.label || '');
1723
+ } else {
1724
+ values[1] = [value.key];
1725
+ valueNames[1] = [value.label || ''];
1726
+ }
1727
+ callback(values, valueNames);
1728
+ }}
1729
+ getPopupContainer={() => document.body}
1730
+ />
1731
+ </>
1732
+ );
1733
+ } else {
1734
+ const currentValue = dataInputBusinessType === 12 ?
1735
+ values?.map((s,vIndex)=> ({key: s, label: valueNames[vIndex]}))||[]
1736
+ : values[0]&&{key:values[0],label:valueNames[0]}||{}
1737
+ return (
1738
+ <BusinessSearchSelect
1739
+ selectBusinessType="employee2"
1740
+ selectProps={{
1741
+ style: styleCommon,
1742
+ placeholder: '请选择员工',
1743
+ ...(dataInputBusinessType === 12
1744
+ ? {
1745
+ mode: 'multiple',
1746
+ maxTagCount: 1,
1747
+ }
1748
+ : {}),
1749
+ }}
1750
+ disabled={disabled}
1751
+ labelInValue={true}
1752
+ value={currentValue}
1753
+ requestConfig={{
1754
+ filterInit: 'qp-id-in',
1755
+ }}
1756
+ onChange={(value) => {
1757
+ if (dataInputBusinessType === 12) {
1758
+ values = value.map((i) => i.key)||[];
1759
+ valueNames = value.map((i) => i.label || '')||[];
1760
+ } else {
1761
+ values = value?.key?[value.key]:[];
1762
+ valueNames = value?.label?[value.label]:[];
1763
+ }
1764
+ callback(values, valueNames);
1765
+ }}
1766
+ getPopupContainer={() => document.body}
1767
+ />
1768
+ );
1769
+ }
1770
+ }
1771
+ // 库存组织选择器
1772
+ if (dataChoiceBusinessType == 280) {
1773
+ if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
1774
+ return (
1775
+ <>
1776
+ <BusinessTreeSearchSelect
1777
+ disabled={disabled}
1778
+ treeCheckable={dataInputBusinessType === 12}
1779
+ businessType="stock-organization"
1780
+ labelInValue={true}
1781
+ value={values[0]}
1782
+ style={styleCommon}
1783
+ onChange={(value) => {
1784
+ if (dataInputBusinessType === 12) {
1785
+ values[0] = value.map((i) => i.key);
1786
+ valueNames[0] = value.map((i) => i.label || '');
1787
+ } else {
1788
+ values[0] = [value.key];
1789
+ valueNames[0] = [value.label || ''];
1790
+ }
1791
+ callback(values, valueNames);
1792
+ }}
1793
+ getPopupContainer={() => document.body}
1794
+ />
1795
+ <span>~</span>
1796
+ <BusinessTreeSearchSelect
1797
+ disabled={disabled}
1798
+ treeCheckable={dataInputBusinessType === 12}
1799
+ businessType="stock-organization"
1800
+ labelInValue={true}
1801
+ value={values[0]}
1802
+ style={styleCommon}
1803
+ onChange={(value) => {
1804
+ if (dataInputBusinessType === 12) {
1805
+ values[1] = value.map((i) => i.key);
1806
+ valueNames[1] = value.map((i) => i.label || '');
1807
+ } else {
1808
+ values[1] = [value.key];
1809
+ valueNames[1] = [value.label || ''];
1810
+ }
1811
+ callback(values, valueNames);
1812
+ }}
1813
+ getPopupContainer={() => document.body}
1814
+ />
1815
+ </>
1816
+ );
1817
+ } else {
1818
+ return (
1819
+ <BusinessTreeSearchSelect
1820
+ disabled={disabled}
1821
+ treeCheckable={dataInputBusinessType === 12}
1822
+ businessType="stock-organization"
1823
+ labelInValue={true}
1824
+ value={values[0]}
1825
+ style={styleCommon}
1826
+ onChange={(value) => {
1827
+ if (dataInputBusinessType === 12) {
1828
+ values = value.map((i) => i.key)||[];
1829
+ valueNames = value.map((i) => i.label || '')||[];
1830
+ } else {
1831
+ values = value?.key?[value.key]:[];
1832
+ valueNames = value?.label?[value.label]:[];
1833
+ }
1834
+ callback(values, valueNames);
1835
+ }}
1836
+ getPopupContainer={() => document.body}
1837
+ />
1838
+ );
1839
+ }
1840
+ }
1841
+ // 结算组织选择器
1842
+ if (dataChoiceBusinessType == 290) {
1843
+ if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
1844
+ return (
1845
+ <>
1846
+ <BusinessTreeSearchSelect
1847
+ disabled={disabled}
1848
+ treeCheckable={dataInputBusinessType === 12}
1849
+ businessType="settle-organization"
1850
+ labelInValue={true}
1851
+ value={values[0]}
1852
+ style={styleCommon}
1853
+ onChange={(value) => {
1854
+ if (dataInputBusinessType === 12) {
1855
+ values[0] = value.map((i) => i.key);
1856
+ valueNames[0] = value.map((i) => i.label || '');
1857
+ } else {
1858
+ values[0] = [value.key];
1859
+ valueNames[0] = [value.label || ''];
1860
+ }
1861
+ callback(values, valueNames);
1862
+ }}
1863
+ getPopupContainer={() => document.body}
1864
+ />
1865
+ <span>~</span>
1866
+ <BusinessTreeSearchSelect
1867
+ disabled={disabled}
1868
+ treeCheckable={dataInputBusinessType === 12}
1869
+ businessType="settle-organization"
1870
+ labelInValue={true}
1871
+ value={values[0]}
1872
+ style={styleCommon}
1873
+ onChange={(value) => {
1874
+ if (dataInputBusinessType === 12) {
1875
+ values[1] = value.map((i) => i.key);
1876
+ valueNames[1] = value.map((i) => i.label || '');
1877
+ } else {
1878
+ values[1] = [value.key];
1879
+ valueNames[1] = [value.label || ''];
1880
+ }
1881
+ callback(values, valueNames);
1882
+ }}
1883
+ getPopupContainer={() => document.body}
1884
+ />
1885
+ </>
1886
+ );
1887
+ } else {
1888
+ return (
1889
+ <BusinessTreeSearchSelect
1890
+ disabled={disabled}
1891
+ treeCheckable={dataInputBusinessType === 12}
1892
+ businessType="settle-organization"
1893
+ labelInValue={true}
1894
+ value={values[0]}
1895
+ style={styleCommon}
1896
+ onChange={(value) => {
1897
+ if (dataInputBusinessType === 12) {
1898
+ values = value.map((i) => i.key)||[];
1899
+ valueNames = value.map((i) => i.label || '')||[];
1900
+ } else {
1901
+ values = value?.key?[value.key]:[];
1902
+ valueNames = value?.label?[value.label]:[];
1903
+ }
1904
+ callback(values, valueNames);
1905
+ }}
1906
+ getPopupContainer={() => document.body}
1907
+ />
1908
+ );
1909
+ }
1910
+ }
1911
+ // 配送方式选择器
1912
+ if (dataChoiceBusinessType == 310) {
1913
+ if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
1914
+ return (
1915
+ <>
1916
+ <BusinessSearchSelect
1917
+ selectBusinessType="deliveryMode"
1918
+ selectProps={{
1919
+ style: styleCommon,
1920
+ placeholder: '请选择配送方式',
1921
+ ...(dataInputBusinessType === 12
1922
+ ? {
1923
+ mode: 'multiple',
1924
+ maxTagCount: 1,
1925
+ }
1926
+ : {}),
1927
+ }}
1928
+ disabled={disabled}
1929
+ labelInValue={true}
1930
+ value={values[0]}
1931
+ requestConfig={{
1932
+ filterInit: 'qp-code-in',
1933
+ }}
1934
+ onChange={(value) => {
1935
+ if (dataInputBusinessType === 12) {
1936
+ values[0] = value.map((i) => i.key);
1937
+ valueNames[0] = value.map((i) => i.label || '');
1938
+ } else {
1939
+ values[0] = [value.key];
1940
+ valueNames[0] = [value.label || ''];
1941
+ }
1942
+ callback(values, valueNames);
1943
+ }}
1944
+ getPopupContainer={() => document.body}
1945
+ />
1946
+ <span>~</span>
1947
+ <BusinessSearchSelect
1948
+ selectBusinessType="deliveryMode"
1949
+ selectProps={{
1950
+ style: styleCommon,
1951
+ placeholder: '请选择配送方式',
1952
+ ...(dataInputBusinessType === 12
1953
+ ? {
1954
+ mode: 'multiple',
1955
+ maxTagCount: 1,
1956
+ }
1957
+ : {}),
1958
+ }}
1959
+ disabled={disabled}
1960
+ labelInValue={true}
1961
+ value={values[1]}
1962
+ requestConfig={{
1963
+ filterInit: 'qp-code-in',
1964
+ }}
1965
+ onChange={(value) => {
1966
+ if (dataInputBusinessType === 12) {
1967
+ values[1] = value.map((i) => i.key);
1968
+ valueNames[1] = value.map((i) => i.label || '');
1969
+ } else {
1970
+ values[1] = [value.key];
1971
+ valueNames[1] = [value.label || ''];
1972
+ }
1973
+ callback(values, valueNames);
1974
+ }}
1975
+ getPopupContainer={() => document.body}
1976
+ />
1977
+ </>
1978
+ );
1979
+ } else {
1980
+ const currentValue = dataInputBusinessType === 12 ?
1981
+ values?.map((s,vIndex)=> ({key: s, label: valueNames[vIndex]}))||[]
1982
+ : values[0]&&{key:values[0],label:valueNames[0]}||{}
1983
+ return (
1984
+ <BusinessSearchSelect
1985
+ selectBusinessType="deliveryMode"
1986
+ selectProps={{
1987
+ style: styleCommon,
1988
+ placeholder: '请选择配送方式',
1989
+ ...(dataInputBusinessType === 12
1990
+ ? {
1991
+ mode: 'multiple',
1992
+ maxTagCount: 1,
1993
+ }
1994
+ : {}),
1995
+ }}
1996
+ disabled={disabled}
1997
+ labelInValue={true}
1998
+ value={currentValue}
1999
+ requestConfig={{
2000
+ filterInit: 'qp-code-in',
2001
+ }}
2002
+ onChange={(value) => {
2003
+ if (dataInputBusinessType === 12) {
2004
+ values = value.map((i) => i.key)||[];
2005
+ valueNames = value.map((i) => i.label || '')||[];
2006
+ } else {
2007
+ values = value?.key?[value.key]:[];
2008
+ valueNames = value?.label?[value.label]:[];
2009
+ }
2010
+ callback(values, valueNames);
2011
+ }}
2012
+ getPopupContainer={() => document.body}
2013
+ />
2014
+ );
2015
+ }
2016
+ }
2017
+ } else {
2018
+ if (
2019
+ dataTypeCode == 22 ||
2020
+ dataTypeCode == 21 ||
2021
+ dataTypeCode == 24 ||
2022
+ dataTypeCode == 23
2023
+ ) {
2024
+ //数值22, 字符串21, 布尔类型24, long23
2025
+ if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
2026
+ return (
2027
+ <>
2028
+ <Input
2029
+ defaultValue={values[0]}
2030
+ disabled={disabled}
2031
+ style={styleCommon}
2032
+ onBlur={(e) => {
2033
+ values[0] = e.target.value;
2034
+ valueNames[0] = e.target.value;
2035
+ callback(values, valueNames);
2036
+ }}
2037
+ />
2038
+ <span>~</span>
2039
+ <Input
2040
+ defaultValue={values[1]}
2041
+ disabled={disabled}
2042
+ style={styleCommon}
2043
+ onBlur={(e) => {
2044
+ values[1] = e.target.value;
2045
+ valueNames[1] = e.target.value;
2046
+ callback(values, valueNames);
2047
+ }}
2048
+ />
2049
+ </>
2050
+ );
2051
+ } else {
2052
+ return (
2053
+ <Input
2054
+ defaultValue={values.join(',')}
2055
+ disabled={disabled}
2056
+ style={styleCommon}
2057
+ onBlur={(e) => {
2058
+ values = e.target.value.split(',');
2059
+ valueNames = e.target.value.split(',');
2060
+ callback(values, valueNames);
2061
+ }}
2062
+ />
2063
+ );
2064
+ }
2065
+ } else if (dataTypeCode == 41) {
2066
+ // 日期41
2067
+ if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
2068
+ return (
2069
+ <RangePicker
2070
+ // showTime
2071
+ disabled={disabled}
2072
+ style={{ width: customerWidth || '300px' }}
2073
+ format={dataTypeCode == 41 ? dateFormat : fullDateFormat}
2074
+ value={[
2075
+ values[0] ? moment(values[0]) : '',
2076
+ values[1] ? moment(values[1]) : '',
2077
+ ]}
2078
+ onChange={(dates, dateStrings) => {
2079
+ // 业务产品要求时间范围取值固定00:00:00-23:59:59,有问题请找产品业务
2080
+ let dateStringFormat = [];
2081
+ if (dataTypeCode == 41) {
2082
+ dateStringFormat[0] = dateStrings[0]
2083
+ ? moment(dateStrings[0]).format('YYYY-MM-DD')
2084
+ : '';
2085
+ dateStringFormat[1] = dateStrings[1]
2086
+ ? moment(dateStrings[1]).format('YYYY-MM-DD')
2087
+ : '';
2088
+ } else {
2089
+ dateStringFormat[0] = dateStrings[0]
2090
+ ? moment(dateStrings[0]).format('YYYY-MM-DD 00:00:00')
2091
+ : '';
2092
+ dateStringFormat[1] = dateStrings[1]
2093
+ ? moment(dateStrings[1]).format('YYYY-MM-DD 23:59:59')
2094
+ : '';
2095
+ }
2096
+ values = [...dateStringFormat];
2097
+ valueNames = [...dateStringFormat];
2098
+ callback(values, valueNames);
2099
+ }}
2100
+ />
2101
+ );
2102
+ } else {
2103
+ return (
2104
+ <>
2105
+ <DatePicker
2106
+ format={dataTypeCode == 41 ? dateFormat : fullDateFormat}
2107
+ disabled={disabled}
2108
+ style={{ width: customerWidth || '300px' }}
2109
+ value={values[0] ? moment(values[0]) : ''}
2110
+ onChange={(date, dateString) => {
2111
+ values[0] = dateString;
2112
+ valueNames[0] = dateString;
2113
+ callback(values, valueNames);
2114
+ }}
2115
+ />
2116
+ </>
2117
+ );
2118
+ }
2119
+ } else if (dataTypeCode == 40) {
2120
+ // 时间40
2121
+ if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
2122
+ return (
2123
+ <>
2124
+ <TimePicker
2125
+ key="1"
2126
+ disabled={disabled}
2127
+ value={values[0] ? moment(values[0]) : ''}
2128
+ style={styleCommon}
2129
+ onChange={(time, timeString) => {
2130
+ values[0] = timeString;
2131
+ valueNames[0] = timeString;
2132
+ callback(values, valueNames);
2133
+ }}
2134
+ />
2135
+ <span>~</span>
2136
+ <TimePicker
2137
+ key="2"
2138
+ disabled={disabled}
2139
+ value={values[1] ? moment(values[1]) : ''}
2140
+ style={styleCommon}
2141
+ onChange={(time, timeString) => {
2142
+ values[1] = timeString;
2143
+ valueNames[1] = timeString;
2144
+ callback(values, valueNames);
2145
+ }}
2146
+ />
2147
+ </>
2148
+ );
2149
+ } else {
2150
+ return (
2151
+ <TimePicker
2152
+ defaultValue={values[0] ? moment(values[0]) : ''}
2153
+ disabled={disabled}
2154
+ style={styleCommon}
2155
+ onChange={(time, timeString) => {
2156
+ values[0] = timeString;
2157
+ valueNames[0] = timeString;
2158
+ callback(values, valueNames);
2159
+ }}
2160
+ />
2161
+ );
2162
+ }
2163
+ }
2164
+ }
2165
+ return '';
2166
+ };
2167
+
2168
+ render() {
2169
+ return (
2170
+ <div style={{ marginLeft: '10px' }} className={styles.rule_field_style}>
2171
+ {this.renderConditionField()}
2172
+ </div>
2173
+ );
2174
+ }
2175
+ }