@bit-sun/business-component 2.4.31-alpha.9 → 2.4.32

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