@bit-sun/business-component 2.4.19 → 2.4.21

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 (197) 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.esm.js +10 -6
  9. package/dist/index.js +10 -6
  10. package/docs/index.md +21 -21
  11. package/lib/assets/drag.svg +17 -17
  12. package/lib/assets/exportFail.svg +37 -37
  13. package/lib/assets/exportProcessing.svg +28 -28
  14. package/lib/assets/exportSuccess.svg +34 -34
  15. package/lib/assets/label_icon_bottom.svg +25 -25
  16. package/lib/assets/upExport.svg +22 -22
  17. package/package.json +79 -79
  18. package/src/assets/32.svg +27 -27
  19. package/src/assets/addIcon.svg +17 -17
  20. package/src/assets/allfunc.svg +27 -27
  21. package/src/assets/arrowRight.svg +24 -24
  22. package/src/assets/btn-delete.svg +29 -29
  23. package/src/assets/btn-edit.svg +19 -19
  24. package/src/assets/btn-more.svg +17 -17
  25. package/src/assets/btn-submit.svg +19 -19
  26. package/src/assets/caidan.svg +11 -11
  27. package/src/assets/close.svg +26 -26
  28. package/src/assets/drag.svg +17 -17
  29. package/src/assets/exportFail.svg +37 -37
  30. package/src/assets/exportProcessing.svg +28 -28
  31. package/src/assets/exportSuccess.svg +34 -34
  32. package/src/assets/fixed-left-active.svg +11 -11
  33. package/src/assets/fixed-left.svg +15 -15
  34. package/src/assets/fixed-right-active.svg +11 -11
  35. package/src/assets/fixed-right.svg +15 -15
  36. package/src/assets/guanbi.svg +15 -15
  37. package/src/assets/icon-quanping.svg +15 -15
  38. package/src/assets/icon-shezhi.svg +17 -17
  39. package/src/assets/label_icon_bottom.svg +25 -25
  40. package/src/assets/list-no-img.svg +21 -21
  41. package/src/assets/morentouxiang-32.svg +23 -23
  42. package/src/assets/scanning.svg +24 -24
  43. package/src/assets/upExport.svg +22 -22
  44. package/src/common/ENUM.ts +41 -41
  45. package/src/components/Business/AddSelectBusiness/index.md +162 -162
  46. package/src/components/Business/AddSelectBusiness/index.tsx +1061 -1061
  47. package/src/components/Business/BsLayouts/Components/AllFunc/drawContent.tsx +111 -111
  48. package/src/components/Business/BsLayouts/Components/AllFunc/index.less +153 -153
  49. package/src/components/Business/BsLayouts/Components/AllFunc/index.tsx +70 -70
  50. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.less +90 -90
  51. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.tsx +37 -37
  52. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/leftTree.tsx +242 -242
  53. package/src/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/rightTree.tsx +384 -384
  54. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/DrawContent.tsx +285 -285
  55. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/customMenuHeader.tsx +74 -74
  56. package/src/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/drawContent.less +170 -170
  57. package/src/components/Business/BsLayouts/Components/CustomerMenu/index.less +64 -64
  58. package/src/components/Business/BsLayouts/Components/CustomerMenu/index.tsx +153 -153
  59. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.less +72 -72
  60. package/src/components/Business/BsLayouts/Components/GlobalHeader/index.tsx +157 -157
  61. package/src/components/Business/BsLayouts/Components/RightContent/LoginModal.tsx +85 -85
  62. package/src/components/Business/BsLayouts/Components/RightContent/home.less +218 -218
  63. package/src/components/Business/BsLayouts/Components/RightContent/index.tsx +155 -155
  64. package/src/components/Business/BsLayouts/Components/SearchFunc/index.less +160 -160
  65. package/src/components/Business/BsLayouts/Components/SearchFunc/index.tsx +75 -75
  66. package/src/components/Business/BsLayouts/index.less +79 -79
  67. package/src/components/Business/BsLayouts/index.tsx +1484 -1484
  68. package/src/components/Business/BsLayouts/service.ts +10 -10
  69. package/src/components/Business/BsLayouts/utils.tsx +203 -203
  70. package/src/components/Business/BsSulaQueryTable/SearchItemSetting.tsx +566 -566
  71. package/src/components/Business/BsSulaQueryTable/index.less +221 -221
  72. package/src/components/Business/BsSulaQueryTable/index.tsx +558 -558
  73. package/src/components/Business/BsSulaQueryTable/setting.tsx +854 -854
  74. package/src/components/Business/BsSulaQueryTable/utils.less +65 -65
  75. package/src/components/Business/BsSulaQueryTable/utils.tsx +690 -690
  76. package/src/components/Business/CommodityEntry/index.md +70 -70
  77. package/src/components/Business/CommodityEntry/index.tsx +80 -80
  78. package/src/components/Business/CommonAlert/index.tsx +23 -23
  79. package/src/components/Business/CommonGuideWrapper/index.less +111 -111
  80. package/src/components/Business/CommonGuideWrapper/index.md +39 -39
  81. package/src/components/Business/CommonGuideWrapper/index.tsx +83 -83
  82. package/src/components/Business/DetailPageWrapper/index.less +79 -79
  83. package/src/components/Business/DetailPageWrapper/index.tsx +315 -315
  84. package/src/components/Business/DetailPageWrapper/utils.tsx +100 -100
  85. package/src/components/Business/HomePageWrapper/index.less +33 -33
  86. package/src/components/Business/HomePageWrapper/index.md +45 -45
  87. package/src/components/Business/HomePageWrapper/index.tsx +162 -162
  88. package/src/components/Business/JsonQueryTable/components/FieldsModifyModal.tsx +824 -824
  89. package/src/components/Business/JsonQueryTable/components/FieldsSettingsTable.tsx +205 -205
  90. package/src/components/Business/JsonQueryTable/components/Formula.tsx +206 -206
  91. package/src/components/Business/JsonQueryTable/components/MaintainOptions.tsx +127 -127
  92. package/src/components/Business/JsonQueryTable/configButton/index.js +20 -20
  93. package/src/components/Business/JsonQueryTable/configTree/component/compactArrayView.js +25 -25
  94. package/src/components/Business/JsonQueryTable/configTree/component/compactObjectView.js +30 -30
  95. package/src/components/Business/JsonQueryTable/configTree/index.js +82 -82
  96. package/src/components/Business/JsonQueryTable/configTree/index.less +44 -44
  97. package/src/components/Business/JsonQueryTable/configTree/parser/highlight.js +57 -57
  98. package/src/components/Business/JsonQueryTable/configTree/parser/index.js +124 -124
  99. package/src/components/Business/JsonQueryTable/configTree/render/iconRender.js +29 -29
  100. package/src/components/Business/JsonQueryTable/configTree/render/nameRender.js +22 -22
  101. package/src/components/Business/JsonQueryTable/configTree/treeNode.js +116 -116
  102. package/src/components/Business/JsonQueryTable/drawer/index.tsx +12 -12
  103. package/src/components/Business/JsonQueryTable/function.ts +62 -62
  104. package/src/components/Business/JsonQueryTable/index.less +16 -16
  105. package/src/components/Business/JsonQueryTable/index.md +328 -328
  106. package/src/components/Business/JsonQueryTable/index.tsx +537 -537
  107. package/src/components/Business/JsonQueryTable/jsonEditor/index.js +346 -346
  108. package/src/components/Business/JsonQueryTable/jsonEditor/index.less +22 -22
  109. package/src/components/Business/JsonQueryTable/jsonEditor/lint/basicType.js +147 -147
  110. package/src/components/Business/JsonQueryTable/jsonEditor/lint/index.js +389 -389
  111. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/actions.js +118 -118
  112. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/dependency.js +22 -22
  113. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/index.js +21 -21
  114. package/src/components/Business/JsonQueryTable/jsonEditor/suggestions/request.js +65 -65
  115. package/src/components/Business/JsonQueryTable/static.ts +450 -450
  116. package/src/components/Business/SearchSelect/BusinessUtils.ts +2057 -2057
  117. package/src/components/Business/SearchSelect/common.ts +134 -134
  118. package/src/components/Business/SearchSelect/index.md +1444 -1444
  119. package/src/components/Business/SearchSelect/index.tsx +55 -55
  120. package/src/components/Business/SearchSelect/utils.ts +101 -101
  121. package/src/components/Business/StateFlow/index.less +130 -130
  122. package/src/components/Business/StateFlow/index.md +60 -60
  123. package/src/components/Business/StateFlow/index.tsx +29 -29
  124. package/src/components/Business/TreeSearchSelect/index.md +185 -185
  125. package/src/components/Business/TreeSearchSelect/index.tsx +33 -33
  126. package/src/components/Business/TreeSearchSelect/utils.ts +104 -104
  127. package/src/components/Business/columnSettingTable/columnSetting.tsx +766 -766
  128. package/src/components/Business/columnSettingTable/index.less +247 -247
  129. package/src/components/Business/columnSettingTable/index.md +357 -357
  130. package/src/components/Business/columnSettingTable/index.tsx +235 -234
  131. package/src/components/Business/columnSettingTable/sulaSettingTable.tsx +243 -242
  132. package/src/components/Business/columnSettingTable/utils.tsx +71 -71
  133. package/src/components/Business/moreTreeTable/FixedScrollBar.tsx +87 -87
  134. package/src/components/Business/moreTreeTable/hooks/useSticky.ts +21 -21
  135. package/src/components/Business/moreTreeTable/index.less +99 -99
  136. package/src/components/Business/moreTreeTable/index.md +448 -448
  137. package/src/components/Business/moreTreeTable/index.tsx +387 -387
  138. package/src/components/Business/moreTreeTable/utils.ts +126 -126
  139. package/src/components/Functional/AddSelect/helps.ts +80 -80
  140. package/src/components/Functional/AddSelect/index.less +367 -367
  141. package/src/components/Functional/AddSelect/index.md +155 -155
  142. package/src/components/Functional/AddSelect/index.tsx +1171 -1171
  143. package/src/components/Functional/BillEntry/index.less +371 -371
  144. package/src/components/Functional/BillEntry/index.md +39 -39
  145. package/src/components/Functional/BillEntry/index.tsx +773 -773
  146. package/src/components/Functional/BsAntdSula/BsCascader/index.md +62 -62
  147. package/src/components/Functional/BsAntdSula/BsCascader/index.tsx +178 -178
  148. package/src/components/Functional/BsAntdSula/index.ts +2 -2
  149. package/src/components/Functional/DataImport/index.less +63 -63
  150. package/src/components/Functional/DataImport/index.md +44 -44
  151. package/src/components/Functional/DataImport/index.tsx +696 -696
  152. package/src/components/Functional/DataValidation/index.less +63 -63
  153. package/src/components/Functional/DataValidation/index.md +39 -39
  154. package/src/components/Functional/DataValidation/index.tsx +688 -688
  155. package/src/components/Functional/EllipsisTooltip/index.d.ts +5 -5
  156. package/src/components/Functional/EllipsisTooltip/index.js +36 -36
  157. package/src/components/Functional/EllipsisTooltip/index.md +30 -30
  158. package/src/components/Functional/ExportFunctions/ExportIcon/index.md +37 -37
  159. package/src/components/Functional/ExportFunctions/ExportIcon/index.tsx +60 -60
  160. package/src/components/Functional/QueryMutipleInput/index.less +37 -37
  161. package/src/components/Functional/QueryMutipleInput/index.md +33 -33
  162. package/src/components/Functional/QueryMutipleInput/index.tsx +128 -128
  163. package/src/components/Functional/SearchSelect/index.less +115 -115
  164. package/src/components/Functional/SearchSelect/index.md +141 -141
  165. package/src/components/Functional/SearchSelect/index.tsx +896 -896
  166. package/src/components/Functional/SearchSelect/utils.ts +3 -3
  167. package/src/components/Functional/TreeSearchSelect/index.md +47 -47
  168. package/src/components/Functional/TreeSearchSelect/index.tsx +204 -204
  169. package/src/components/Solution/RuleComponent/Formula.tsx +335 -335
  170. package/src/components/Solution/RuleComponent/InnerSelect.tsx +62 -62
  171. package/src/components/Solution/RuleComponent/index.d.ts +29 -29
  172. package/src/components/Solution/RuleComponent/index.js +2073 -2073
  173. package/src/components/Solution/RuleComponent/index.less +230 -230
  174. package/src/components/Solution/RuleComponent/renderSpecificAction.js +99 -99
  175. package/src/components/Solution/RuleComponent/ruleFiled.js +2281 -2281
  176. package/src/components/Solution/RuleComponent/services.ts +13 -13
  177. package/src/components/Solution/RuleComponent/util.js +143 -143
  178. package/src/index.ts +38 -38
  179. package/src/plugin/TableColumnSetting/index.less +247 -247
  180. package/src/plugin/TableColumnSetting/index.md +50 -50
  181. package/src/plugin/TableColumnSetting/index.tsx +725 -725
  182. package/src/plugin/TableColumnSetting/utils.ts +19 -19
  183. package/src/styles/bsDefault.less +1912 -1912
  184. package/src/utils/CheckOneUser/index.md +39 -39
  185. package/src/utils/CheckOneUser/index.ts +51 -51
  186. package/src/utils/CustomLoginInfo.ts +55 -55
  187. package/src/utils/LocalstorageUtils.ts +95 -95
  188. package/src/utils/TableUtils.tsx +18 -18
  189. package/src/utils/checkUtils.ts +39 -39
  190. package/src/utils/enumConfig.ts +11 -11
  191. package/src/utils/getFormMode.js +12 -12
  192. package/src/utils/index.ts +4 -4
  193. package/src/utils/requestUtils.ts +166 -166
  194. package/src/utils/serialize.js +7 -7
  195. package/src/utils/utils.ts +195 -195
  196. package/tsconfig.json +29 -29
  197. package/typings.d.ts +4 -4
@@ -1,2281 +1,2281 @@
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']; //集合类型
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={values[0]}
1147
- style={styleCommon}
1148
- onChange={(value) => {
1149
- if (dataInputBusinessType === 12) {
1150
- values[0] = value.map((i) => i.key);
1151
- valueNames[0] = value.map((i) => i.label || '');
1152
- } else {
1153
- values[0] = [value.key];
1154
- valueNames[0] = [value.label || ''];
1155
- }
1156
- callback(values, valueNames);
1157
- }}
1158
- getPopupContainer={() => document.body}
1159
- />
1160
- <span>~</span>
1161
- <BusinessTreeSearchSelect
1162
- disabled={disabled}
1163
- treeCheckable={dataInputBusinessType === 12}
1164
- businessType="department"
1165
- labelInValue={true}
1166
- value={values[0]}
1167
- style={styleCommon}
1168
- onChange={(value) => {
1169
- if (dataInputBusinessType === 12) {
1170
- values[1] = value.map((i) => i.key);
1171
- valueNames[1] = value.map((i) => i.label || '');
1172
- } else {
1173
- values[1] = [value.key];
1174
- valueNames[1] = [value.label || ''];
1175
- }
1176
- callback(values, valueNames);
1177
- }}
1178
- getPopupContainer={() => document.body}
1179
- />
1180
- </>
1181
- );
1182
- } else {
1183
- return (
1184
- <BusinessTreeSearchSelect
1185
- disabled={disabled}
1186
- treeCheckable={dataInputBusinessType === 12}
1187
- businessType="department"
1188
- labelInValue={true}
1189
- value={values[0]}
1190
- style={styleCommon}
1191
- onChange={(value) => {
1192
- if (dataInputBusinessType === 12) {
1193
- values = value.map((i) => i.key)||[];
1194
- valueNames = value.map((i) => i.label || '')||[];
1195
- } else {
1196
- values = value?.key?[value.key]:[];
1197
- valueNames = value?.label?[value.label]:[];
1198
- }
1199
- callback(values, valueNames);
1200
- }}
1201
- getPopupContainer={() => document.body}
1202
- />
1203
- );
1204
- }
1205
- }
1206
- // 采购组织选择器
1207
- if (dataChoiceBusinessType == 220) {
1208
- if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
1209
- return (
1210
- <>
1211
- <BusinessTreeSearchSelect
1212
- disabled={disabled}
1213
- treeCheckable={dataInputBusinessType === 12}
1214
- businessType="purchase-organization"
1215
- labelInValue={true}
1216
- value={values[0]}
1217
- style={styleCommon}
1218
- onChange={(value) => {
1219
- if (dataInputBusinessType === 12) {
1220
- values[0] = value.map((i) => i.key);
1221
- valueNames[0] = value.map((i) => i.label || '');
1222
- } else {
1223
- values[0] = [value.key];
1224
- valueNames[0] = [value.label || ''];
1225
- }
1226
- callback(values, valueNames);
1227
- }}
1228
- getPopupContainer={() => document.body}
1229
- />
1230
- <span>~</span>
1231
- <BusinessTreeSearchSelect
1232
- disabled={disabled}
1233
- treeCheckable={dataInputBusinessType === 12}
1234
- businessType="purchase-organization"
1235
- labelInValue={true}
1236
- value={values[0]}
1237
- style={styleCommon}
1238
- onChange={(value) => {
1239
- if (dataInputBusinessType === 12) {
1240
- values[1] = value.map((i) => i.key);
1241
- valueNames[1] = value.map((i) => i.label || '');
1242
- } else {
1243
- values[1] = [value.key];
1244
- valueNames[1] = [value.label || ''];
1245
- }
1246
- callback(values, valueNames);
1247
- }}
1248
- getPopupContainer={() => document.body}
1249
- />
1250
- </>
1251
- );
1252
- } else {
1253
- return (
1254
- <BusinessTreeSearchSelect
1255
- disabled={disabled}
1256
- treeCheckable={dataInputBusinessType === 12}
1257
- businessType="purchase-organization"
1258
- labelInValue={true}
1259
- value={values[0]}
1260
- style={styleCommon}
1261
- onChange={(value) => {
1262
- if (dataInputBusinessType === 12) {
1263
- values = value.map((i) => i.key)||[];
1264
- valueNames = value.map((i) => i.label || '')||[];
1265
- } else {
1266
- values = value?.key?[value.key]:[];
1267
- valueNames = value?.label?[value.label]:[];
1268
- }
1269
- callback(values, valueNames);
1270
- }}
1271
- getPopupContainer={() => document.body}
1272
- />
1273
- );
1274
- }
1275
- }
1276
- // 销售组织选择器
1277
- if (dataChoiceBusinessType == 230) {
1278
- if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
1279
- return (
1280
- <>
1281
- <BusinessTreeSearchSelect
1282
- disabled={disabled}
1283
- treeCheckable={dataInputBusinessType === 12}
1284
- businessType="sales-organization"
1285
- labelInValue={true}
1286
- value={values[0]}
1287
- style={styleCommon}
1288
- onChange={(value) => {
1289
- if (dataInputBusinessType === 12) {
1290
- values[0] = value.map((i) => i.key);
1291
- valueNames[0] = value.map((i) => i.label || '');
1292
- } else {
1293
- values[0] = [value.key];
1294
- valueNames[0] = [value.label || ''];
1295
- }
1296
- callback(values, valueNames);
1297
- }}
1298
- getPopupContainer={() => document.body}
1299
- />
1300
- <span>~</span>
1301
- <BusinessTreeSearchSelect
1302
- disabled={disabled}
1303
- treeCheckable={dataInputBusinessType === 12}
1304
- businessType="sales-organization"
1305
- labelInValue={true}
1306
- value={values[0]}
1307
- style={styleCommon}
1308
- onChange={(value) => {
1309
- if (dataInputBusinessType === 12) {
1310
- values[1] = value.map((i) => i.key);
1311
- valueNames[1] = value.map((i) => i.label || '');
1312
- } else {
1313
- values[1] = [value.key];
1314
- valueNames[1] = [value.label || ''];
1315
- }
1316
- callback(values, valueNames);
1317
- }}
1318
- getPopupContainer={() => document.body}
1319
- />
1320
- </>
1321
- );
1322
- } else {
1323
- return (
1324
- <BusinessTreeSearchSelect
1325
- disabled={disabled}
1326
- treeCheckable={dataInputBusinessType === 12}
1327
- businessType="sales-organization"
1328
- labelInValue={true}
1329
- value={values[0]}
1330
- style={styleCommon}
1331
- onChange={(value) => {
1332
- if (dataInputBusinessType === 12) {
1333
- values = value.map((i) => i.key)||[];
1334
- valueNames = value.map((i) => i.label || '')||[];
1335
- } else {
1336
- values = value?.key?[value.key]:[];
1337
- valueNames = value?.label?[value.label]:[];
1338
- }
1339
- callback(values, valueNames);
1340
- }}
1341
- getPopupContainer={() => document.body}
1342
- />
1343
- );
1344
- }
1345
- }
1346
- // 供应商选择器
1347
- if (dataChoiceBusinessType == 240) {
1348
- if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
1349
- return (
1350
- <>
1351
- <BusinessSearchSelect
1352
- selectBusinessType="supplier2"
1353
- selectProps={{
1354
- style: styleCommon,
1355
- placeholder: '请选择供应商',
1356
- ...(dataInputBusinessType === 12
1357
- ? {
1358
- mode: 'multiple',
1359
- maxTagCount: 1,
1360
- }
1361
- : {}),
1362
- }}
1363
- disabled={disabled}
1364
- labelInValue={true}
1365
- value={values[0]}
1366
- requestConfig={{
1367
- filterInit: 'qp-code-in',
1368
- }}
1369
- onChange={(value) => {
1370
- if (dataInputBusinessType === 12) {
1371
- values[0] = value.map((i) => i.key);
1372
- valueNames[0] = value.map((i) => i.label || '');
1373
- } else {
1374
- values[0] = [value.key];
1375
- valueNames[0] = [value.label || ''];
1376
- }
1377
- callback(values, valueNames);
1378
- }}
1379
- getPopupContainer={() => document.body}
1380
- />
1381
- <span>~</span>
1382
- <BusinessSearchSelect
1383
- selectBusinessType="supplier2"
1384
- selectProps={{
1385
- style: styleCommon,
1386
- placeholder: '请选择供应商',
1387
- ...(dataInputBusinessType === 12
1388
- ? {
1389
- mode: 'multiple',
1390
- maxTagCount: 1,
1391
- }
1392
- : {}),
1393
- }}
1394
- disabled={disabled}
1395
- labelInValue={true}
1396
- value={values[1]}
1397
- requestConfig={{
1398
- filterInit: 'qp-code-in',
1399
- }}
1400
- onChange={(value) => {
1401
- if (dataInputBusinessType === 12) {
1402
- values[1] = value.map((i) => i.key);
1403
- valueNames[1] = value.map((i) => i.label || '');
1404
- } else {
1405
- values[1] = [value.key];
1406
- valueNames[1] = [value.label || ''];
1407
- }
1408
- callback(values, valueNames);
1409
- }}
1410
- getPopupContainer={() => document.body}
1411
- />
1412
- </>
1413
- );
1414
- } else {
1415
- const currentValue = dataInputBusinessType === 12 ?
1416
- values?.map((s,vIndex)=> ({key: s, label: valueNames[vIndex]}))||[]
1417
- : values[0]&&{key:values[0],label:valueNames[0]}||{}
1418
- return (
1419
- <BusinessSearchSelect
1420
- selectBusinessType="supplier2"
1421
- selectProps={{
1422
- style: styleCommon,
1423
- placeholder: '请选择供应商',
1424
- ...(dataInputBusinessType === 12
1425
- ? {
1426
- mode: 'multiple',
1427
- maxTagCount: 1,
1428
- }
1429
- : {}),
1430
- }}
1431
- disabled={disabled}
1432
- labelInValue={true}
1433
- value={currentValue}
1434
- requestConfig={{
1435
- filterInit: 'qp-code-in',
1436
- }}
1437
- onChange={(value) => {
1438
- if (dataInputBusinessType === 12) {
1439
- values = value.map((i) => i.key)||[];
1440
- valueNames = value.map((i) => i.label || '')||[];
1441
- } else {
1442
- values = value?.key?[value.key]:[];
1443
- valueNames = value?.label?[value.label]:[];
1444
- }
1445
- callback(values, valueNames);
1446
- }}
1447
- getPopupContainer={() => document.body}
1448
- />
1449
- );
1450
- }
1451
- }
1452
- // 客户选择器
1453
- if (dataChoiceBusinessType == 250) {
1454
- if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
1455
- return (
1456
- <>
1457
- <BusinessSearchSelect
1458
- selectBusinessType="customer2"
1459
- selectProps={{
1460
- style: styleCommon,
1461
- placeholder: '请选择客户',
1462
- ...(dataInputBusinessType === 12
1463
- ? {
1464
- mode: 'multiple',
1465
- maxTagCount: 1,
1466
- }
1467
- : {}),
1468
- }}
1469
- disabled={disabled}
1470
- labelInValue={true}
1471
- value={values[0]}
1472
- requestConfig={{
1473
- filterInit: 'qp-code-in',
1474
- }}
1475
- onChange={(value) => {
1476
- if (dataInputBusinessType === 12) {
1477
- values[0] = value.map((i) => i.key);
1478
- valueNames[0] = value.map((i) => i.label || '');
1479
- } else {
1480
- values[0] = [value.key];
1481
- valueNames[0] = [value.label || ''];
1482
- }
1483
- callback(values, valueNames);
1484
- }}
1485
- getPopupContainer={() => document.body}
1486
- />
1487
- <span>~</span>
1488
- <BusinessSearchSelect
1489
- selectBusinessType="customer2"
1490
- selectProps={{
1491
- style: styleCommon,
1492
- placeholder: '请选择客户',
1493
- ...(dataInputBusinessType === 12
1494
- ? {
1495
- mode: 'multiple',
1496
- maxTagCount: 1,
1497
- }
1498
- : {}),
1499
- }}
1500
- disabled={disabled}
1501
- labelInValue={true}
1502
- value={values[1]}
1503
- requestConfig={{
1504
- filterInit: 'qp-code-in',
1505
- }}
1506
- onChange={(value) => {
1507
- if (dataInputBusinessType === 12) {
1508
- values[1] = value.map((i) => i.key);
1509
- valueNames[1] = value.map((i) => i.label || '');
1510
- } else {
1511
- values[1] = [value.key];
1512
- valueNames[1] = [value.label || ''];
1513
- }
1514
- callback(values, valueNames);
1515
- }}
1516
- getPopupContainer={() => document.body}
1517
- />
1518
- </>
1519
- );
1520
- } else {
1521
- const currentValue = dataInputBusinessType === 12 ?
1522
- values?.map((s,vIndex)=> ({key: s, label: valueNames[vIndex]}))||[]
1523
- : values[0]&&{key:values[0],label:valueNames[0]}||{}
1524
- return (
1525
- <BusinessSearchSelect
1526
- selectBusinessType="customer2"
1527
- selectProps={{
1528
- style: styleCommon,
1529
- placeholder: '请选择客户',
1530
- ...(dataInputBusinessType === 12
1531
- ? {
1532
- mode: 'multiple',
1533
- maxTagCount: 1,
1534
- }
1535
- : {}),
1536
- }}
1537
- disabled={disabled}
1538
- labelInValue={true}
1539
- value={currentValue}
1540
- requestConfig={{
1541
- filterInit: 'qp-code-in',
1542
- }}
1543
- onChange={(value) => {
1544
- if (dataInputBusinessType === 12) {
1545
- values = value.map((i) => i.key)||[];
1546
- valueNames = value.map((i) => i.label || '')||[];
1547
- } else {
1548
- values = value?.key?[value.key]:[];
1549
- valueNames = value?.label?[value.label]:[];
1550
- }
1551
- callback(values, valueNames);
1552
- }}
1553
- getPopupContainer={() => document.body}
1554
- />
1555
- );
1556
- }
1557
- }
1558
- // 店铺选择器
1559
- if (dataChoiceBusinessType == 260) {
1560
- if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
1561
- return (
1562
- <>
1563
- <BusinessSearchSelect
1564
- selectBusinessType="shopFile2"
1565
- selectProps={{
1566
- style: styleCommon,
1567
- placeholder: '请选择店铺',
1568
- ...(dataInputBusinessType === 12
1569
- ? {
1570
- mode: 'multiple',
1571
- maxTagCount: 1,
1572
- }
1573
- : {}),
1574
- }}
1575
- disabled={disabled}
1576
- labelInValue={true}
1577
- value={values[0]}
1578
- requestConfig={{
1579
- filterInit: 'qp-code-in',
1580
- }}
1581
- onChange={(value) => {
1582
- if (dataInputBusinessType === 12) {
1583
- values[0] = value.map((i) => i.key);
1584
- valueNames[0] = value.map((i) => i.label || '');
1585
- } else {
1586
- values[0] = [value.key];
1587
- valueNames[0] = [value.label || ''];
1588
- }
1589
- callback(values, valueNames);
1590
- }}
1591
- getPopupContainer={() => document.body}
1592
- />
1593
- <span>~</span>
1594
- <BusinessSearchSelect
1595
- selectBusinessType="shopFile2"
1596
- selectProps={{
1597
- style: styleCommon,
1598
- placeholder: '请选择店铺',
1599
- ...(dataInputBusinessType === 12
1600
- ? {
1601
- mode: 'multiple',
1602
- maxTagCount: 1,
1603
- }
1604
- : {}),
1605
- }}
1606
- disabled={disabled}
1607
- labelInValue={true}
1608
- value={values[1]}
1609
- requestConfig={{
1610
- filterInit: 'qp-code-in',
1611
- }}
1612
- onChange={(value) => {
1613
- if (dataInputBusinessType === 12) {
1614
- values[1] = value.map((i) => i.key);
1615
- valueNames[1] = value.map((i) => i.label || '');
1616
- } else {
1617
- values[1] = [value.key];
1618
- valueNames[1] = [value.label || ''];
1619
- }
1620
- callback(values, valueNames);
1621
- }}
1622
- getPopupContainer={() => document.body}
1623
- />
1624
- </>
1625
- );
1626
- } else {
1627
- const currentValue = dataInputBusinessType === 12 ?
1628
- values?.map((s,vIndex)=> ({key: s, label: valueNames[vIndex]}))||[]
1629
- : values[0]&&{key:values[0],label:valueNames[0]}||{}
1630
- return (
1631
- <BusinessSearchSelect
1632
- selectBusinessType="shopFile2"
1633
- selectProps={{
1634
- style: styleCommon,
1635
- placeholder: '请选择店铺',
1636
- ...(dataInputBusinessType === 12
1637
- ? {
1638
- mode: 'multiple',
1639
- maxTagCount: 1,
1640
- }
1641
- : {}),
1642
- }}
1643
- disabled={disabled}
1644
- labelInValue={true}
1645
- value={currentValue}
1646
- requestConfig={{
1647
- filterInit: 'qp-code-in',
1648
- }}
1649
- onChange={(value) => {
1650
- if (dataInputBusinessType === 12) {
1651
- values = value.map((i) => i.key)||[];
1652
- valueNames = value.map((i) => i.label || '')||[];
1653
- } else {
1654
- values = value?.key?[value.key]:[];
1655
- valueNames = value?.label?[value.label]:[];
1656
- }
1657
- callback(values, valueNames);
1658
- }}
1659
- getPopupContainer={() => document.body}
1660
- />
1661
- );
1662
- }
1663
- }
1664
- // 员工选择器
1665
- if (dataChoiceBusinessType == 270) {
1666
- if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
1667
- return (
1668
- <>
1669
- <BusinessSearchSelect
1670
- selectBusinessType="employee2"
1671
- selectProps={{
1672
- style: styleCommon,
1673
- placeholder: '请选择员工',
1674
- ...(dataInputBusinessType === 12
1675
- ? {
1676
- mode: 'multiple',
1677
- maxTagCount: 1,
1678
- }
1679
- : {}),
1680
- }}
1681
- disabled={disabled}
1682
- labelInValue={true}
1683
- value={values[0]}
1684
- requestConfig={{
1685
- filterInit: 'qp-id-in',
1686
- }}
1687
- onChange={(value) => {
1688
- if (dataInputBusinessType === 12) {
1689
- values[0] = value.map((i) => i.key);
1690
- valueNames[0] = value.map((i) => i.label || '');
1691
- } else {
1692
- values[0] = [value.key];
1693
- valueNames[0] = [value.label || ''];
1694
- }
1695
- callback(values, valueNames);
1696
- }}
1697
- getPopupContainer={() => document.body}
1698
- />
1699
- <span>~</span>
1700
- <BusinessSearchSelect
1701
- selectBusinessType="employee2"
1702
- selectProps={{
1703
- style: styleCommon,
1704
- placeholder: '请选择员工',
1705
- ...(dataInputBusinessType === 12
1706
- ? {
1707
- mode: 'multiple',
1708
- maxTagCount: 1,
1709
- }
1710
- : {}),
1711
- }}
1712
- disabled={disabled}
1713
- labelInValue={true}
1714
- value={values[1]}
1715
- requestConfig={{
1716
- filterInit: 'qp-id-in',
1717
- }}
1718
- onChange={(value) => {
1719
- if (dataInputBusinessType === 12) {
1720
- values[1] = value.map((i) => i.key);
1721
- valueNames[1] = value.map((i) => i.label || '');
1722
- } else {
1723
- values[1] = [value.key];
1724
- valueNames[1] = [value.label || ''];
1725
- }
1726
- callback(values, valueNames);
1727
- }}
1728
- getPopupContainer={() => document.body}
1729
- />
1730
- </>
1731
- );
1732
- } else {
1733
- const currentValue = dataInputBusinessType === 12 ?
1734
- values?.map((s,vIndex)=> ({key: s, label: valueNames[vIndex]}))||[]
1735
- : values[0]&&{key:values[0],label:valueNames[0]}||{}
1736
- return (
1737
- <BusinessSearchSelect
1738
- selectBusinessType="employee2"
1739
- selectProps={{
1740
- style: styleCommon,
1741
- placeholder: '请选择员工',
1742
- ...(dataInputBusinessType === 12
1743
- ? {
1744
- mode: 'multiple',
1745
- maxTagCount: 1,
1746
- }
1747
- : {}),
1748
- }}
1749
- disabled={disabled}
1750
- labelInValue={true}
1751
- value={currentValue}
1752
- requestConfig={{
1753
- filterInit: 'qp-id-in',
1754
- }}
1755
- onChange={(value) => {
1756
- if (dataInputBusinessType === 12) {
1757
- values = value.map((i) => i.key)||[];
1758
- valueNames = value.map((i) => i.label || '')||[];
1759
- } else {
1760
- values = value?.key?[value.key]:[];
1761
- valueNames = value?.label?[value.label]:[];
1762
- }
1763
- callback(values, valueNames);
1764
- }}
1765
- getPopupContainer={() => document.body}
1766
- />
1767
- );
1768
- }
1769
- }
1770
- // 库存组织选择器
1771
- if (dataChoiceBusinessType == 280) {
1772
- if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
1773
- return (
1774
- <>
1775
- <BusinessTreeSearchSelect
1776
- disabled={disabled}
1777
- treeCheckable={dataInputBusinessType === 12}
1778
- businessType="stock-organization"
1779
- labelInValue={true}
1780
- value={values[0]}
1781
- style={styleCommon}
1782
- onChange={(value) => {
1783
- if (dataInputBusinessType === 12) {
1784
- values[0] = value.map((i) => i.key);
1785
- valueNames[0] = value.map((i) => i.label || '');
1786
- } else {
1787
- values[0] = [value.key];
1788
- valueNames[0] = [value.label || ''];
1789
- }
1790
- callback(values, valueNames);
1791
- }}
1792
- getPopupContainer={() => document.body}
1793
- />
1794
- <span>~</span>
1795
- <BusinessTreeSearchSelect
1796
- disabled={disabled}
1797
- treeCheckable={dataInputBusinessType === 12}
1798
- businessType="stock-organization"
1799
- labelInValue={true}
1800
- value={values[0]}
1801
- style={styleCommon}
1802
- onChange={(value) => {
1803
- if (dataInputBusinessType === 12) {
1804
- values[1] = value.map((i) => i.key);
1805
- valueNames[1] = value.map((i) => i.label || '');
1806
- } else {
1807
- values[1] = [value.key];
1808
- valueNames[1] = [value.label || ''];
1809
- }
1810
- callback(values, valueNames);
1811
- }}
1812
- getPopupContainer={() => document.body}
1813
- />
1814
- </>
1815
- );
1816
- } else {
1817
- return (
1818
- <BusinessTreeSearchSelect
1819
- disabled={disabled}
1820
- treeCheckable={dataInputBusinessType === 12}
1821
- businessType="stock-organization"
1822
- labelInValue={true}
1823
- value={values[0]}
1824
- style={styleCommon}
1825
- onChange={(value) => {
1826
- if (dataInputBusinessType === 12) {
1827
- values = value.map((i) => i.key)||[];
1828
- valueNames = value.map((i) => i.label || '')||[];
1829
- } else {
1830
- values = value?.key?[value.key]:[];
1831
- valueNames = value?.label?[value.label]:[];
1832
- }
1833
- callback(values, valueNames);
1834
- }}
1835
- getPopupContainer={() => document.body}
1836
- />
1837
- );
1838
- }
1839
- }
1840
- // 结算组织选择器
1841
- if (dataChoiceBusinessType == 290) {
1842
- if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
1843
- return (
1844
- <>
1845
- <BusinessTreeSearchSelect
1846
- disabled={disabled}
1847
- treeCheckable={dataInputBusinessType === 12}
1848
- businessType="settle-organization"
1849
- labelInValue={true}
1850
- value={values[0]}
1851
- style={styleCommon}
1852
- onChange={(value) => {
1853
- if (dataInputBusinessType === 12) {
1854
- values[0] = value.map((i) => i.key);
1855
- valueNames[0] = value.map((i) => i.label || '');
1856
- } else {
1857
- values[0] = [value.key];
1858
- valueNames[0] = [value.label || ''];
1859
- }
1860
- callback(values, valueNames);
1861
- }}
1862
- getPopupContainer={() => document.body}
1863
- />
1864
- <span>~</span>
1865
- <BusinessTreeSearchSelect
1866
- disabled={disabled}
1867
- treeCheckable={dataInputBusinessType === 12}
1868
- businessType="settle-organization"
1869
- labelInValue={true}
1870
- value={values[0]}
1871
- style={styleCommon}
1872
- onChange={(value) => {
1873
- if (dataInputBusinessType === 12) {
1874
- values[1] = value.map((i) => i.key);
1875
- valueNames[1] = value.map((i) => i.label || '');
1876
- } else {
1877
- values[1] = [value.key];
1878
- valueNames[1] = [value.label || ''];
1879
- }
1880
- callback(values, valueNames);
1881
- }}
1882
- getPopupContainer={() => document.body}
1883
- />
1884
- </>
1885
- );
1886
- } else {
1887
- return (
1888
- <BusinessTreeSearchSelect
1889
- disabled={disabled}
1890
- treeCheckable={dataInputBusinessType === 12}
1891
- businessType="settle-organization"
1892
- labelInValue={true}
1893
- value={values[0]}
1894
- style={styleCommon}
1895
- onChange={(value) => {
1896
- if (dataInputBusinessType === 12) {
1897
- values = value.map((i) => i.key)||[];
1898
- valueNames = value.map((i) => i.label || '')||[];
1899
- } else {
1900
- values = value?.key?[value.key]:[];
1901
- valueNames = value?.label?[value.label]:[];
1902
- }
1903
- callback(values, valueNames);
1904
- }}
1905
- getPopupContainer={() => document.body}
1906
- />
1907
- );
1908
- }
1909
- }
1910
- // 配送方式选择器
1911
- if (dataChoiceBusinessType == 310) {
1912
- if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
1913
- return (
1914
- <>
1915
- <BusinessSearchSelect
1916
- selectBusinessType="deliveryMode"
1917
- selectProps={{
1918
- style: styleCommon,
1919
- placeholder: '请选择配送方式',
1920
- ...(dataInputBusinessType === 12
1921
- ? {
1922
- mode: 'multiple',
1923
- maxTagCount: 1,
1924
- }
1925
- : {}),
1926
- }}
1927
- disabled={disabled}
1928
- labelInValue={true}
1929
- value={values[0]}
1930
- requestConfig={{
1931
- filterInit: 'qp-code-in',
1932
- }}
1933
- onChange={(value) => {
1934
- if (dataInputBusinessType === 12) {
1935
- values[0] = value.map((i) => i.key);
1936
- valueNames[0] = value.map((i) => i.label || '');
1937
- } else {
1938
- values[0] = [value.key];
1939
- valueNames[0] = [value.label || ''];
1940
- }
1941
- callback(values, valueNames);
1942
- }}
1943
- getPopupContainer={() => document.body}
1944
- />
1945
- <span>~</span>
1946
- <BusinessSearchSelect
1947
- selectBusinessType="deliveryMode"
1948
- selectProps={{
1949
- style: styleCommon,
1950
- placeholder: '请选择配送方式',
1951
- ...(dataInputBusinessType === 12
1952
- ? {
1953
- mode: 'multiple',
1954
- maxTagCount: 1,
1955
- }
1956
- : {}),
1957
- }}
1958
- disabled={disabled}
1959
- labelInValue={true}
1960
- value={values[1]}
1961
- requestConfig={{
1962
- filterInit: 'qp-code-in',
1963
- }}
1964
- onChange={(value) => {
1965
- if (dataInputBusinessType === 12) {
1966
- values[1] = value.map((i) => i.key);
1967
- valueNames[1] = value.map((i) => i.label || '');
1968
- } else {
1969
- values[1] = [value.key];
1970
- valueNames[1] = [value.label || ''];
1971
- }
1972
- callback(values, valueNames);
1973
- }}
1974
- getPopupContainer={() => document.body}
1975
- />
1976
- </>
1977
- );
1978
- } else {
1979
- const currentValue = dataInputBusinessType === 12 ?
1980
- values?.map((s,vIndex)=> ({key: s, label: valueNames[vIndex]}))||[]
1981
- : values[0]&&{key:values[0],label:valueNames[0]}||{}
1982
- return (
1983
- <BusinessSearchSelect
1984
- selectBusinessType="deliveryMode"
1985
- selectProps={{
1986
- style: styleCommon,
1987
- placeholder: '请选择配送方式',
1988
- ...(dataInputBusinessType === 12
1989
- ? {
1990
- mode: 'multiple',
1991
- maxTagCount: 1,
1992
- }
1993
- : {}),
1994
- }}
1995
- disabled={disabled}
1996
- labelInValue={true}
1997
- value={currentValue}
1998
- requestConfig={{
1999
- filterInit: 'qp-code-in',
2000
- }}
2001
- onChange={(value) => {
2002
- if (dataInputBusinessType === 12) {
2003
- values = value.map((i) => i.key)||[];
2004
- valueNames = value.map((i) => i.label || '')||[];
2005
- } else {
2006
- values = value?.key?[value.key]:[];
2007
- valueNames = value?.label?[value.label]:[];
2008
- }
2009
- callback(values, valueNames);
2010
- }}
2011
- getPopupContainer={() => document.body}
2012
- />
2013
- );
2014
- }
2015
- }
2016
- // 角色选择器
2017
- if (dataChoiceBusinessType == 360) {
2018
- if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
2019
- return (
2020
- <>
2021
- <BusinessSearchSelect
2022
- selectBusinessType="role"
2023
- selectProps={{
2024
- style: styleCommon,
2025
- placeholder: '请选择角色',
2026
- ...(dataInputBusinessType === 12
2027
- ? {
2028
- mode: 'multiple',
2029
- maxTagCount: 1,
2030
- }
2031
- : {}),
2032
- }}
2033
- disabled={disabled}
2034
- labelInValue={true}
2035
- value={values[0]}
2036
- requestConfig={{
2037
- filterInit: 'qp-code-in',
2038
- }}
2039
- onChange={(value) => {
2040
- if (dataInputBusinessType === 12) {
2041
- values[0] = value.map((i) => i.key);
2042
- valueNames[0] = value.map((i) => i.label || '');
2043
- } else {
2044
- values[0] = [value.key];
2045
- valueNames[0] = [value.label || ''];
2046
- }
2047
- callback(values, valueNames);
2048
- }}
2049
- getPopupContainer={() => document.body}
2050
- />
2051
- <span>~</span>
2052
- <BusinessSearchSelect
2053
- selectBusinessType="role"
2054
- selectProps={{
2055
- style: styleCommon,
2056
- placeholder: '请选择角色',
2057
- ...(dataInputBusinessType === 12
2058
- ? {
2059
- mode: 'multiple',
2060
- maxTagCount: 1,
2061
- }
2062
- : {}),
2063
- }}
2064
- disabled={disabled}
2065
- labelInValue={true}
2066
- value={values[1]}
2067
- requestConfig={{
2068
- filterInit: 'qp-code-in',
2069
- }}
2070
- onChange={(value) => {
2071
- if (dataInputBusinessType === 12) {
2072
- values[1] = value.map((i) => i.key);
2073
- valueNames[1] = value.map((i) => i.label || '');
2074
- } else {
2075
- values[1] = [value.key];
2076
- valueNames[1] = [value.label || ''];
2077
- }
2078
- callback(values, valueNames);
2079
- }}
2080
- getPopupContainer={() => document.body}
2081
- />
2082
- </>
2083
- );
2084
- } else {
2085
- const currentValue = dataInputBusinessType === 12 ?
2086
- values?.map((s,vIndex)=> ({key: s, label: valueNames[vIndex]}))||[]
2087
- : values[0]&&{key:values[0],label:valueNames[0]}||{}
2088
- return (
2089
- <BusinessSearchSelect
2090
- selectBusinessType="role"
2091
- selectProps={{
2092
- style: styleCommon,
2093
- placeholder: '请选择角色',
2094
- ...(dataInputBusinessType === 12
2095
- ? {
2096
- mode: 'multiple',
2097
- maxTagCount: 1,
2098
- }
2099
- : {}),
2100
- }}
2101
- disabled={disabled}
2102
- labelInValue={true}
2103
- value={currentValue}
2104
- requestConfig={{
2105
- filterInit: 'qp-code-in',
2106
- }}
2107
- onChange={(value) => {
2108
- if (dataInputBusinessType === 12) {
2109
- values = value.map((i) => i.key)||[];
2110
- valueNames = value.map((i) => i.label || '')||[];
2111
- } else {
2112
- values = value?.key?[value.key]:[];
2113
- valueNames = value?.label?[value.label]:[];
2114
- }
2115
- callback(values, valueNames);
2116
- }}
2117
- getPopupContainer={() => document.body}
2118
- />
2119
- );
2120
- }
2121
- }
2122
- } else {
2123
- if (
2124
- dataTypeCode == 22 ||
2125
- dataTypeCode == 21 ||
2126
- dataTypeCode == 24 ||
2127
- dataTypeCode == 23
2128
- ) {
2129
- //数值22, 字符串21, 布尔类型24, long23
2130
- if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
2131
- return (
2132
- <>
2133
- <Input
2134
- defaultValue={values[0]}
2135
- disabled={disabled}
2136
- style={styleCommon}
2137
- onBlur={(e) => {
2138
- values[0] = e.target.value;
2139
- valueNames[0] = e.target.value;
2140
- callback(values, valueNames);
2141
- }}
2142
- />
2143
- <span>~</span>
2144
- <Input
2145
- defaultValue={values[1]}
2146
- disabled={disabled}
2147
- style={styleCommon}
2148
- onBlur={(e) => {
2149
- values[1] = e.target.value;
2150
- valueNames[1] = e.target.value;
2151
- callback(values, valueNames);
2152
- }}
2153
- />
2154
- </>
2155
- );
2156
- } else {
2157
- return (
2158
- <Input
2159
- defaultValue={values.join(',')}
2160
- disabled={disabled}
2161
- style={styleCommon}
2162
- onBlur={(e) => {
2163
- values = e.target.value.split(',');
2164
- valueNames = e.target.value.split(',');
2165
- callback(values, valueNames);
2166
- }}
2167
- />
2168
- );
2169
- }
2170
- } else if (dataTypeCode == 41 || dataTypeCode == 32) {
2171
- // 日期41 日期时间32
2172
- if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
2173
- return (
2174
- <RangePicker
2175
- showTime={dataTypeCode == 32}
2176
- disabled={disabled}
2177
- style={{ width: customerWidth || '300px' }}
2178
- format={dataTypeCode == 41 ? dateFormat : fullDateFormat}
2179
- value={[
2180
- values[0] ? moment(values[0]) : '',
2181
- values[1] ? moment(values[1]) : '',
2182
- ]}
2183
- onChange={(dates, dateStrings) => {
2184
- // 业务产品要求时间范围取值固定00:00:00-23:59:59,有问题请找产品业务
2185
- let dateStringFormat = [];
2186
- if (dataTypeCode == 41) {
2187
- dateStringFormat[0] = dateStrings[0]
2188
- ? moment(dateStrings[0]).format('YYYY-MM-DD')
2189
- : '';
2190
- dateStringFormat[1] = dateStrings[1]
2191
- ? moment(dateStrings[1]).format('YYYY-MM-DD')
2192
- : '';
2193
- } else {
2194
- dateStringFormat[0] = dateStrings[0]
2195
- ? moment(dateStrings[0]).format('YYYY-MM-DD 00:00:00')
2196
- : '';
2197
- dateStringFormat[1] = dateStrings[1]
2198
- ? moment(dateStrings[1]).format('YYYY-MM-DD 23:59:59')
2199
- : '';
2200
- }
2201
- values = [...dateStringFormat];
2202
- valueNames = [...dateStringFormat];
2203
- callback(values, valueNames);
2204
- }}
2205
- />
2206
- );
2207
- } else {
2208
- return (
2209
- <>
2210
- <DatePicker
2211
- showTime={dataTypeCode == 32}
2212
- format={dataTypeCode == 41 ? dateFormat : fullDateFormat}
2213
- disabled={disabled}
2214
- style={{ width: customerWidth || '300px' }}
2215
- value={values[0] ? moment(values[0]) : ''}
2216
- onChange={(date, dateString) => {
2217
- values[0] = dateString;
2218
- valueNames[0] = dateString;
2219
- callback(values, valueNames);
2220
- }}
2221
- />
2222
- </>
2223
- );
2224
- }
2225
- } else if (dataTypeCode == 40) {
2226
- // 时间40
2227
- if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
2228
- return (
2229
- <>
2230
- <TimePicker
2231
- key="1"
2232
- disabled={disabled}
2233
- value={values[0] ? moment(values[0]) : ''}
2234
- style={styleCommon}
2235
- onChange={(time, timeString) => {
2236
- values[0] = timeString;
2237
- valueNames[0] = timeString;
2238
- callback(values, valueNames);
2239
- }}
2240
- />
2241
- <span>~</span>
2242
- <TimePicker
2243
- key="2"
2244
- disabled={disabled}
2245
- value={values[1] ? moment(values[1]) : ''}
2246
- style={styleCommon}
2247
- onChange={(time, timeString) => {
2248
- values[1] = timeString;
2249
- valueNames[1] = timeString;
2250
- callback(values, valueNames);
2251
- }}
2252
- />
2253
- </>
2254
- );
2255
- } else {
2256
- return (
2257
- <TimePicker
2258
- defaultValue={values[0] ? moment(values[0]) : ''}
2259
- disabled={disabled}
2260
- style={styleCommon}
2261
- onChange={(time, timeString) => {
2262
- values[0] = timeString;
2263
- valueNames[0] = timeString;
2264
- callback(values, valueNames);
2265
- }}
2266
- />
2267
- );
2268
- }
2269
- }
2270
- }
2271
- return '';
2272
- };
2273
-
2274
- render() {
2275
- return (
2276
- <div style={{ marginLeft: '10px' }} className={styles.rule_field_style}>
2277
- {this.renderConditionField()}
2278
- </div>
2279
- );
2280
- }
2281
- }
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']; //集合类型
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={values[0]}
1147
+ style={styleCommon}
1148
+ onChange={(value) => {
1149
+ if (dataInputBusinessType === 12) {
1150
+ values[0] = value.map((i) => i.key);
1151
+ valueNames[0] = value.map((i) => i.label || '');
1152
+ } else {
1153
+ values[0] = [value.key];
1154
+ valueNames[0] = [value.label || ''];
1155
+ }
1156
+ callback(values, valueNames);
1157
+ }}
1158
+ getPopupContainer={() => document.body}
1159
+ />
1160
+ <span>~</span>
1161
+ <BusinessTreeSearchSelect
1162
+ disabled={disabled}
1163
+ treeCheckable={dataInputBusinessType === 12}
1164
+ businessType="department"
1165
+ labelInValue={true}
1166
+ value={values[0]}
1167
+ style={styleCommon}
1168
+ onChange={(value) => {
1169
+ if (dataInputBusinessType === 12) {
1170
+ values[1] = value.map((i) => i.key);
1171
+ valueNames[1] = value.map((i) => i.label || '');
1172
+ } else {
1173
+ values[1] = [value.key];
1174
+ valueNames[1] = [value.label || ''];
1175
+ }
1176
+ callback(values, valueNames);
1177
+ }}
1178
+ getPopupContainer={() => document.body}
1179
+ />
1180
+ </>
1181
+ );
1182
+ } else {
1183
+ return (
1184
+ <BusinessTreeSearchSelect
1185
+ disabled={disabled}
1186
+ treeCheckable={dataInputBusinessType === 12}
1187
+ businessType="department"
1188
+ labelInValue={true}
1189
+ value={values[0]}
1190
+ style={styleCommon}
1191
+ onChange={(value) => {
1192
+ if (dataInputBusinessType === 12) {
1193
+ values = value.map((i) => i.key)||[];
1194
+ valueNames = value.map((i) => i.label || '')||[];
1195
+ } else {
1196
+ values = value?.key?[value.key]:[];
1197
+ valueNames = value?.label?[value.label]:[];
1198
+ }
1199
+ callback(values, valueNames);
1200
+ }}
1201
+ getPopupContainer={() => document.body}
1202
+ />
1203
+ );
1204
+ }
1205
+ }
1206
+ // 采购组织选择器
1207
+ if (dataChoiceBusinessType == 220) {
1208
+ if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
1209
+ return (
1210
+ <>
1211
+ <BusinessTreeSearchSelect
1212
+ disabled={disabled}
1213
+ treeCheckable={dataInputBusinessType === 12}
1214
+ businessType="purchase-organization"
1215
+ labelInValue={true}
1216
+ value={values[0]}
1217
+ style={styleCommon}
1218
+ onChange={(value) => {
1219
+ if (dataInputBusinessType === 12) {
1220
+ values[0] = value.map((i) => i.key);
1221
+ valueNames[0] = value.map((i) => i.label || '');
1222
+ } else {
1223
+ values[0] = [value.key];
1224
+ valueNames[0] = [value.label || ''];
1225
+ }
1226
+ callback(values, valueNames);
1227
+ }}
1228
+ getPopupContainer={() => document.body}
1229
+ />
1230
+ <span>~</span>
1231
+ <BusinessTreeSearchSelect
1232
+ disabled={disabled}
1233
+ treeCheckable={dataInputBusinessType === 12}
1234
+ businessType="purchase-organization"
1235
+ labelInValue={true}
1236
+ value={values[0]}
1237
+ style={styleCommon}
1238
+ onChange={(value) => {
1239
+ if (dataInputBusinessType === 12) {
1240
+ values[1] = value.map((i) => i.key);
1241
+ valueNames[1] = value.map((i) => i.label || '');
1242
+ } else {
1243
+ values[1] = [value.key];
1244
+ valueNames[1] = [value.label || ''];
1245
+ }
1246
+ callback(values, valueNames);
1247
+ }}
1248
+ getPopupContainer={() => document.body}
1249
+ />
1250
+ </>
1251
+ );
1252
+ } else {
1253
+ return (
1254
+ <BusinessTreeSearchSelect
1255
+ disabled={disabled}
1256
+ treeCheckable={dataInputBusinessType === 12}
1257
+ businessType="purchase-organization"
1258
+ labelInValue={true}
1259
+ value={values[0]}
1260
+ style={styleCommon}
1261
+ onChange={(value) => {
1262
+ if (dataInputBusinessType === 12) {
1263
+ values = value.map((i) => i.key)||[];
1264
+ valueNames = value.map((i) => i.label || '')||[];
1265
+ } else {
1266
+ values = value?.key?[value.key]:[];
1267
+ valueNames = value?.label?[value.label]:[];
1268
+ }
1269
+ callback(values, valueNames);
1270
+ }}
1271
+ getPopupContainer={() => document.body}
1272
+ />
1273
+ );
1274
+ }
1275
+ }
1276
+ // 销售组织选择器
1277
+ if (dataChoiceBusinessType == 230) {
1278
+ if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
1279
+ return (
1280
+ <>
1281
+ <BusinessTreeSearchSelect
1282
+ disabled={disabled}
1283
+ treeCheckable={dataInputBusinessType === 12}
1284
+ businessType="sales-organization"
1285
+ labelInValue={true}
1286
+ value={values[0]}
1287
+ style={styleCommon}
1288
+ onChange={(value) => {
1289
+ if (dataInputBusinessType === 12) {
1290
+ values[0] = value.map((i) => i.key);
1291
+ valueNames[0] = value.map((i) => i.label || '');
1292
+ } else {
1293
+ values[0] = [value.key];
1294
+ valueNames[0] = [value.label || ''];
1295
+ }
1296
+ callback(values, valueNames);
1297
+ }}
1298
+ getPopupContainer={() => document.body}
1299
+ />
1300
+ <span>~</span>
1301
+ <BusinessTreeSearchSelect
1302
+ disabled={disabled}
1303
+ treeCheckable={dataInputBusinessType === 12}
1304
+ businessType="sales-organization"
1305
+ labelInValue={true}
1306
+ value={values[0]}
1307
+ style={styleCommon}
1308
+ onChange={(value) => {
1309
+ if (dataInputBusinessType === 12) {
1310
+ values[1] = value.map((i) => i.key);
1311
+ valueNames[1] = value.map((i) => i.label || '');
1312
+ } else {
1313
+ values[1] = [value.key];
1314
+ valueNames[1] = [value.label || ''];
1315
+ }
1316
+ callback(values, valueNames);
1317
+ }}
1318
+ getPopupContainer={() => document.body}
1319
+ />
1320
+ </>
1321
+ );
1322
+ } else {
1323
+ return (
1324
+ <BusinessTreeSearchSelect
1325
+ disabled={disabled}
1326
+ treeCheckable={dataInputBusinessType === 12}
1327
+ businessType="sales-organization"
1328
+ labelInValue={true}
1329
+ value={values[0]}
1330
+ style={styleCommon}
1331
+ onChange={(value) => {
1332
+ if (dataInputBusinessType === 12) {
1333
+ values = value.map((i) => i.key)||[];
1334
+ valueNames = value.map((i) => i.label || '')||[];
1335
+ } else {
1336
+ values = value?.key?[value.key]:[];
1337
+ valueNames = value?.label?[value.label]:[];
1338
+ }
1339
+ callback(values, valueNames);
1340
+ }}
1341
+ getPopupContainer={() => document.body}
1342
+ />
1343
+ );
1344
+ }
1345
+ }
1346
+ // 供应商选择器
1347
+ if (dataChoiceBusinessType == 240) {
1348
+ if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
1349
+ return (
1350
+ <>
1351
+ <BusinessSearchSelect
1352
+ selectBusinessType="supplier2"
1353
+ selectProps={{
1354
+ style: styleCommon,
1355
+ placeholder: '请选择供应商',
1356
+ ...(dataInputBusinessType === 12
1357
+ ? {
1358
+ mode: 'multiple',
1359
+ maxTagCount: 1,
1360
+ }
1361
+ : {}),
1362
+ }}
1363
+ disabled={disabled}
1364
+ labelInValue={true}
1365
+ value={values[0]}
1366
+ requestConfig={{
1367
+ filterInit: 'qp-code-in',
1368
+ }}
1369
+ onChange={(value) => {
1370
+ if (dataInputBusinessType === 12) {
1371
+ values[0] = value.map((i) => i.key);
1372
+ valueNames[0] = value.map((i) => i.label || '');
1373
+ } else {
1374
+ values[0] = [value.key];
1375
+ valueNames[0] = [value.label || ''];
1376
+ }
1377
+ callback(values, valueNames);
1378
+ }}
1379
+ getPopupContainer={() => document.body}
1380
+ />
1381
+ <span>~</span>
1382
+ <BusinessSearchSelect
1383
+ selectBusinessType="supplier2"
1384
+ selectProps={{
1385
+ style: styleCommon,
1386
+ placeholder: '请选择供应商',
1387
+ ...(dataInputBusinessType === 12
1388
+ ? {
1389
+ mode: 'multiple',
1390
+ maxTagCount: 1,
1391
+ }
1392
+ : {}),
1393
+ }}
1394
+ disabled={disabled}
1395
+ labelInValue={true}
1396
+ value={values[1]}
1397
+ requestConfig={{
1398
+ filterInit: 'qp-code-in',
1399
+ }}
1400
+ onChange={(value) => {
1401
+ if (dataInputBusinessType === 12) {
1402
+ values[1] = value.map((i) => i.key);
1403
+ valueNames[1] = value.map((i) => i.label || '');
1404
+ } else {
1405
+ values[1] = [value.key];
1406
+ valueNames[1] = [value.label || ''];
1407
+ }
1408
+ callback(values, valueNames);
1409
+ }}
1410
+ getPopupContainer={() => document.body}
1411
+ />
1412
+ </>
1413
+ );
1414
+ } else {
1415
+ const currentValue = dataInputBusinessType === 12 ?
1416
+ values?.map((s,vIndex)=> ({key: s, label: valueNames[vIndex]}))||[]
1417
+ : values[0]&&{key:values[0],label:valueNames[0]}||{}
1418
+ return (
1419
+ <BusinessSearchSelect
1420
+ selectBusinessType="supplier2"
1421
+ selectProps={{
1422
+ style: styleCommon,
1423
+ placeholder: '请选择供应商',
1424
+ ...(dataInputBusinessType === 12
1425
+ ? {
1426
+ mode: 'multiple',
1427
+ maxTagCount: 1,
1428
+ }
1429
+ : {}),
1430
+ }}
1431
+ disabled={disabled}
1432
+ labelInValue={true}
1433
+ value={currentValue}
1434
+ requestConfig={{
1435
+ filterInit: 'qp-code-in',
1436
+ }}
1437
+ onChange={(value) => {
1438
+ if (dataInputBusinessType === 12) {
1439
+ values = value.map((i) => i.key)||[];
1440
+ valueNames = value.map((i) => i.label || '')||[];
1441
+ } else {
1442
+ values = value?.key?[value.key]:[];
1443
+ valueNames = value?.label?[value.label]:[];
1444
+ }
1445
+ callback(values, valueNames);
1446
+ }}
1447
+ getPopupContainer={() => document.body}
1448
+ />
1449
+ );
1450
+ }
1451
+ }
1452
+ // 客户选择器
1453
+ if (dataChoiceBusinessType == 250) {
1454
+ if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
1455
+ return (
1456
+ <>
1457
+ <BusinessSearchSelect
1458
+ selectBusinessType="customer2"
1459
+ selectProps={{
1460
+ style: styleCommon,
1461
+ placeholder: '请选择客户',
1462
+ ...(dataInputBusinessType === 12
1463
+ ? {
1464
+ mode: 'multiple',
1465
+ maxTagCount: 1,
1466
+ }
1467
+ : {}),
1468
+ }}
1469
+ disabled={disabled}
1470
+ labelInValue={true}
1471
+ value={values[0]}
1472
+ requestConfig={{
1473
+ filterInit: 'qp-code-in',
1474
+ }}
1475
+ onChange={(value) => {
1476
+ if (dataInputBusinessType === 12) {
1477
+ values[0] = value.map((i) => i.key);
1478
+ valueNames[0] = value.map((i) => i.label || '');
1479
+ } else {
1480
+ values[0] = [value.key];
1481
+ valueNames[0] = [value.label || ''];
1482
+ }
1483
+ callback(values, valueNames);
1484
+ }}
1485
+ getPopupContainer={() => document.body}
1486
+ />
1487
+ <span>~</span>
1488
+ <BusinessSearchSelect
1489
+ selectBusinessType="customer2"
1490
+ selectProps={{
1491
+ style: styleCommon,
1492
+ placeholder: '请选择客户',
1493
+ ...(dataInputBusinessType === 12
1494
+ ? {
1495
+ mode: 'multiple',
1496
+ maxTagCount: 1,
1497
+ }
1498
+ : {}),
1499
+ }}
1500
+ disabled={disabled}
1501
+ labelInValue={true}
1502
+ value={values[1]}
1503
+ requestConfig={{
1504
+ filterInit: 'qp-code-in',
1505
+ }}
1506
+ onChange={(value) => {
1507
+ if (dataInputBusinessType === 12) {
1508
+ values[1] = value.map((i) => i.key);
1509
+ valueNames[1] = value.map((i) => i.label || '');
1510
+ } else {
1511
+ values[1] = [value.key];
1512
+ valueNames[1] = [value.label || ''];
1513
+ }
1514
+ callback(values, valueNames);
1515
+ }}
1516
+ getPopupContainer={() => document.body}
1517
+ />
1518
+ </>
1519
+ );
1520
+ } else {
1521
+ const currentValue = dataInputBusinessType === 12 ?
1522
+ values?.map((s,vIndex)=> ({key: s, label: valueNames[vIndex]}))||[]
1523
+ : values[0]&&{key:values[0],label:valueNames[0]}||{}
1524
+ return (
1525
+ <BusinessSearchSelect
1526
+ selectBusinessType="customer2"
1527
+ selectProps={{
1528
+ style: styleCommon,
1529
+ placeholder: '请选择客户',
1530
+ ...(dataInputBusinessType === 12
1531
+ ? {
1532
+ mode: 'multiple',
1533
+ maxTagCount: 1,
1534
+ }
1535
+ : {}),
1536
+ }}
1537
+ disabled={disabled}
1538
+ labelInValue={true}
1539
+ value={currentValue}
1540
+ requestConfig={{
1541
+ filterInit: 'qp-code-in',
1542
+ }}
1543
+ onChange={(value) => {
1544
+ if (dataInputBusinessType === 12) {
1545
+ values = value.map((i) => i.key)||[];
1546
+ valueNames = value.map((i) => i.label || '')||[];
1547
+ } else {
1548
+ values = value?.key?[value.key]:[];
1549
+ valueNames = value?.label?[value.label]:[];
1550
+ }
1551
+ callback(values, valueNames);
1552
+ }}
1553
+ getPopupContainer={() => document.body}
1554
+ />
1555
+ );
1556
+ }
1557
+ }
1558
+ // 店铺选择器
1559
+ if (dataChoiceBusinessType == 260) {
1560
+ if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
1561
+ return (
1562
+ <>
1563
+ <BusinessSearchSelect
1564
+ selectBusinessType="shopFile2"
1565
+ selectProps={{
1566
+ style: styleCommon,
1567
+ placeholder: '请选择店铺',
1568
+ ...(dataInputBusinessType === 12
1569
+ ? {
1570
+ mode: 'multiple',
1571
+ maxTagCount: 1,
1572
+ }
1573
+ : {}),
1574
+ }}
1575
+ disabled={disabled}
1576
+ labelInValue={true}
1577
+ value={values[0]}
1578
+ requestConfig={{
1579
+ filterInit: 'qp-code-in',
1580
+ }}
1581
+ onChange={(value) => {
1582
+ if (dataInputBusinessType === 12) {
1583
+ values[0] = value.map((i) => i.key);
1584
+ valueNames[0] = value.map((i) => i.label || '');
1585
+ } else {
1586
+ values[0] = [value.key];
1587
+ valueNames[0] = [value.label || ''];
1588
+ }
1589
+ callback(values, valueNames);
1590
+ }}
1591
+ getPopupContainer={() => document.body}
1592
+ />
1593
+ <span>~</span>
1594
+ <BusinessSearchSelect
1595
+ selectBusinessType="shopFile2"
1596
+ selectProps={{
1597
+ style: styleCommon,
1598
+ placeholder: '请选择店铺',
1599
+ ...(dataInputBusinessType === 12
1600
+ ? {
1601
+ mode: 'multiple',
1602
+ maxTagCount: 1,
1603
+ }
1604
+ : {}),
1605
+ }}
1606
+ disabled={disabled}
1607
+ labelInValue={true}
1608
+ value={values[1]}
1609
+ requestConfig={{
1610
+ filterInit: 'qp-code-in',
1611
+ }}
1612
+ onChange={(value) => {
1613
+ if (dataInputBusinessType === 12) {
1614
+ values[1] = value.map((i) => i.key);
1615
+ valueNames[1] = value.map((i) => i.label || '');
1616
+ } else {
1617
+ values[1] = [value.key];
1618
+ valueNames[1] = [value.label || ''];
1619
+ }
1620
+ callback(values, valueNames);
1621
+ }}
1622
+ getPopupContainer={() => document.body}
1623
+ />
1624
+ </>
1625
+ );
1626
+ } else {
1627
+ const currentValue = dataInputBusinessType === 12 ?
1628
+ values?.map((s,vIndex)=> ({key: s, label: valueNames[vIndex]}))||[]
1629
+ : values[0]&&{key:values[0],label:valueNames[0]}||{}
1630
+ return (
1631
+ <BusinessSearchSelect
1632
+ selectBusinessType="shopFile2"
1633
+ selectProps={{
1634
+ style: styleCommon,
1635
+ placeholder: '请选择店铺',
1636
+ ...(dataInputBusinessType === 12
1637
+ ? {
1638
+ mode: 'multiple',
1639
+ maxTagCount: 1,
1640
+ }
1641
+ : {}),
1642
+ }}
1643
+ disabled={disabled}
1644
+ labelInValue={true}
1645
+ value={currentValue}
1646
+ requestConfig={{
1647
+ filterInit: 'qp-code-in',
1648
+ }}
1649
+ onChange={(value) => {
1650
+ if (dataInputBusinessType === 12) {
1651
+ values = value.map((i) => i.key)||[];
1652
+ valueNames = value.map((i) => i.label || '')||[];
1653
+ } else {
1654
+ values = value?.key?[value.key]:[];
1655
+ valueNames = value?.label?[value.label]:[];
1656
+ }
1657
+ callback(values, valueNames);
1658
+ }}
1659
+ getPopupContainer={() => document.body}
1660
+ />
1661
+ );
1662
+ }
1663
+ }
1664
+ // 员工选择器
1665
+ if (dataChoiceBusinessType == 270) {
1666
+ if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
1667
+ return (
1668
+ <>
1669
+ <BusinessSearchSelect
1670
+ selectBusinessType="employee2"
1671
+ selectProps={{
1672
+ style: styleCommon,
1673
+ placeholder: '请选择员工',
1674
+ ...(dataInputBusinessType === 12
1675
+ ? {
1676
+ mode: 'multiple',
1677
+ maxTagCount: 1,
1678
+ }
1679
+ : {}),
1680
+ }}
1681
+ disabled={disabled}
1682
+ labelInValue={true}
1683
+ value={values[0]}
1684
+ requestConfig={{
1685
+ filterInit: 'qp-id-in',
1686
+ }}
1687
+ onChange={(value) => {
1688
+ if (dataInputBusinessType === 12) {
1689
+ values[0] = value.map((i) => i.key);
1690
+ valueNames[0] = value.map((i) => i.label || '');
1691
+ } else {
1692
+ values[0] = [value.key];
1693
+ valueNames[0] = [value.label || ''];
1694
+ }
1695
+ callback(values, valueNames);
1696
+ }}
1697
+ getPopupContainer={() => document.body}
1698
+ />
1699
+ <span>~</span>
1700
+ <BusinessSearchSelect
1701
+ selectBusinessType="employee2"
1702
+ selectProps={{
1703
+ style: styleCommon,
1704
+ placeholder: '请选择员工',
1705
+ ...(dataInputBusinessType === 12
1706
+ ? {
1707
+ mode: 'multiple',
1708
+ maxTagCount: 1,
1709
+ }
1710
+ : {}),
1711
+ }}
1712
+ disabled={disabled}
1713
+ labelInValue={true}
1714
+ value={values[1]}
1715
+ requestConfig={{
1716
+ filterInit: 'qp-id-in',
1717
+ }}
1718
+ onChange={(value) => {
1719
+ if (dataInputBusinessType === 12) {
1720
+ values[1] = value.map((i) => i.key);
1721
+ valueNames[1] = value.map((i) => i.label || '');
1722
+ } else {
1723
+ values[1] = [value.key];
1724
+ valueNames[1] = [value.label || ''];
1725
+ }
1726
+ callback(values, valueNames);
1727
+ }}
1728
+ getPopupContainer={() => document.body}
1729
+ />
1730
+ </>
1731
+ );
1732
+ } else {
1733
+ const currentValue = dataInputBusinessType === 12 ?
1734
+ values?.map((s,vIndex)=> ({key: s, label: valueNames[vIndex]}))||[]
1735
+ : values[0]&&{key:values[0],label:valueNames[0]}||{}
1736
+ return (
1737
+ <BusinessSearchSelect
1738
+ selectBusinessType="employee2"
1739
+ selectProps={{
1740
+ style: styleCommon,
1741
+ placeholder: '请选择员工',
1742
+ ...(dataInputBusinessType === 12
1743
+ ? {
1744
+ mode: 'multiple',
1745
+ maxTagCount: 1,
1746
+ }
1747
+ : {}),
1748
+ }}
1749
+ disabled={disabled}
1750
+ labelInValue={true}
1751
+ value={currentValue}
1752
+ requestConfig={{
1753
+ filterInit: 'qp-id-in',
1754
+ }}
1755
+ onChange={(value) => {
1756
+ if (dataInputBusinessType === 12) {
1757
+ values = value.map((i) => i.key)||[];
1758
+ valueNames = value.map((i) => i.label || '')||[];
1759
+ } else {
1760
+ values = value?.key?[value.key]:[];
1761
+ valueNames = value?.label?[value.label]:[];
1762
+ }
1763
+ callback(values, valueNames);
1764
+ }}
1765
+ getPopupContainer={() => document.body}
1766
+ />
1767
+ );
1768
+ }
1769
+ }
1770
+ // 库存组织选择器
1771
+ if (dataChoiceBusinessType == 280) {
1772
+ if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
1773
+ return (
1774
+ <>
1775
+ <BusinessTreeSearchSelect
1776
+ disabled={disabled}
1777
+ treeCheckable={dataInputBusinessType === 12}
1778
+ businessType="stock-organization"
1779
+ labelInValue={true}
1780
+ value={values[0]}
1781
+ style={styleCommon}
1782
+ onChange={(value) => {
1783
+ if (dataInputBusinessType === 12) {
1784
+ values[0] = value.map((i) => i.key);
1785
+ valueNames[0] = value.map((i) => i.label || '');
1786
+ } else {
1787
+ values[0] = [value.key];
1788
+ valueNames[0] = [value.label || ''];
1789
+ }
1790
+ callback(values, valueNames);
1791
+ }}
1792
+ getPopupContainer={() => document.body}
1793
+ />
1794
+ <span>~</span>
1795
+ <BusinessTreeSearchSelect
1796
+ disabled={disabled}
1797
+ treeCheckable={dataInputBusinessType === 12}
1798
+ businessType="stock-organization"
1799
+ labelInValue={true}
1800
+ value={values[0]}
1801
+ style={styleCommon}
1802
+ onChange={(value) => {
1803
+ if (dataInputBusinessType === 12) {
1804
+ values[1] = value.map((i) => i.key);
1805
+ valueNames[1] = value.map((i) => i.label || '');
1806
+ } else {
1807
+ values[1] = [value.key];
1808
+ valueNames[1] = [value.label || ''];
1809
+ }
1810
+ callback(values, valueNames);
1811
+ }}
1812
+ getPopupContainer={() => document.body}
1813
+ />
1814
+ </>
1815
+ );
1816
+ } else {
1817
+ return (
1818
+ <BusinessTreeSearchSelect
1819
+ disabled={disabled}
1820
+ treeCheckable={dataInputBusinessType === 12}
1821
+ businessType="stock-organization"
1822
+ labelInValue={true}
1823
+ value={values[0]}
1824
+ style={styleCommon}
1825
+ onChange={(value) => {
1826
+ if (dataInputBusinessType === 12) {
1827
+ values = value.map((i) => i.key)||[];
1828
+ valueNames = value.map((i) => i.label || '')||[];
1829
+ } else {
1830
+ values = value?.key?[value.key]:[];
1831
+ valueNames = value?.label?[value.label]:[];
1832
+ }
1833
+ callback(values, valueNames);
1834
+ }}
1835
+ getPopupContainer={() => document.body}
1836
+ />
1837
+ );
1838
+ }
1839
+ }
1840
+ // 结算组织选择器
1841
+ if (dataChoiceBusinessType == 290) {
1842
+ if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
1843
+ return (
1844
+ <>
1845
+ <BusinessTreeSearchSelect
1846
+ disabled={disabled}
1847
+ treeCheckable={dataInputBusinessType === 12}
1848
+ businessType="settle-organization"
1849
+ labelInValue={true}
1850
+ value={values[0]}
1851
+ style={styleCommon}
1852
+ onChange={(value) => {
1853
+ if (dataInputBusinessType === 12) {
1854
+ values[0] = value.map((i) => i.key);
1855
+ valueNames[0] = value.map((i) => i.label || '');
1856
+ } else {
1857
+ values[0] = [value.key];
1858
+ valueNames[0] = [value.label || ''];
1859
+ }
1860
+ callback(values, valueNames);
1861
+ }}
1862
+ getPopupContainer={() => document.body}
1863
+ />
1864
+ <span>~</span>
1865
+ <BusinessTreeSearchSelect
1866
+ disabled={disabled}
1867
+ treeCheckable={dataInputBusinessType === 12}
1868
+ businessType="settle-organization"
1869
+ labelInValue={true}
1870
+ value={values[0]}
1871
+ style={styleCommon}
1872
+ onChange={(value) => {
1873
+ if (dataInputBusinessType === 12) {
1874
+ values[1] = value.map((i) => i.key);
1875
+ valueNames[1] = value.map((i) => i.label || '');
1876
+ } else {
1877
+ values[1] = [value.key];
1878
+ valueNames[1] = [value.label || ''];
1879
+ }
1880
+ callback(values, valueNames);
1881
+ }}
1882
+ getPopupContainer={() => document.body}
1883
+ />
1884
+ </>
1885
+ );
1886
+ } else {
1887
+ return (
1888
+ <BusinessTreeSearchSelect
1889
+ disabled={disabled}
1890
+ treeCheckable={dataInputBusinessType === 12}
1891
+ businessType="settle-organization"
1892
+ labelInValue={true}
1893
+ value={values[0]}
1894
+ style={styleCommon}
1895
+ onChange={(value) => {
1896
+ if (dataInputBusinessType === 12) {
1897
+ values = value.map((i) => i.key)||[];
1898
+ valueNames = value.map((i) => i.label || '')||[];
1899
+ } else {
1900
+ values = value?.key?[value.key]:[];
1901
+ valueNames = value?.label?[value.label]:[];
1902
+ }
1903
+ callback(values, valueNames);
1904
+ }}
1905
+ getPopupContainer={() => document.body}
1906
+ />
1907
+ );
1908
+ }
1909
+ }
1910
+ // 配送方式选择器
1911
+ if (dataChoiceBusinessType == 310) {
1912
+ if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
1913
+ return (
1914
+ <>
1915
+ <BusinessSearchSelect
1916
+ selectBusinessType="deliveryMode"
1917
+ selectProps={{
1918
+ style: styleCommon,
1919
+ placeholder: '请选择配送方式',
1920
+ ...(dataInputBusinessType === 12
1921
+ ? {
1922
+ mode: 'multiple',
1923
+ maxTagCount: 1,
1924
+ }
1925
+ : {}),
1926
+ }}
1927
+ disabled={disabled}
1928
+ labelInValue={true}
1929
+ value={values[0]}
1930
+ requestConfig={{
1931
+ filterInit: 'qp-code-in',
1932
+ }}
1933
+ onChange={(value) => {
1934
+ if (dataInputBusinessType === 12) {
1935
+ values[0] = value.map((i) => i.key);
1936
+ valueNames[0] = value.map((i) => i.label || '');
1937
+ } else {
1938
+ values[0] = [value.key];
1939
+ valueNames[0] = [value.label || ''];
1940
+ }
1941
+ callback(values, valueNames);
1942
+ }}
1943
+ getPopupContainer={() => document.body}
1944
+ />
1945
+ <span>~</span>
1946
+ <BusinessSearchSelect
1947
+ selectBusinessType="deliveryMode"
1948
+ selectProps={{
1949
+ style: styleCommon,
1950
+ placeholder: '请选择配送方式',
1951
+ ...(dataInputBusinessType === 12
1952
+ ? {
1953
+ mode: 'multiple',
1954
+ maxTagCount: 1,
1955
+ }
1956
+ : {}),
1957
+ }}
1958
+ disabled={disabled}
1959
+ labelInValue={true}
1960
+ value={values[1]}
1961
+ requestConfig={{
1962
+ filterInit: 'qp-code-in',
1963
+ }}
1964
+ onChange={(value) => {
1965
+ if (dataInputBusinessType === 12) {
1966
+ values[1] = value.map((i) => i.key);
1967
+ valueNames[1] = value.map((i) => i.label || '');
1968
+ } else {
1969
+ values[1] = [value.key];
1970
+ valueNames[1] = [value.label || ''];
1971
+ }
1972
+ callback(values, valueNames);
1973
+ }}
1974
+ getPopupContainer={() => document.body}
1975
+ />
1976
+ </>
1977
+ );
1978
+ } else {
1979
+ const currentValue = dataInputBusinessType === 12 ?
1980
+ values?.map((s,vIndex)=> ({key: s, label: valueNames[vIndex]}))||[]
1981
+ : values[0]&&{key:values[0],label:valueNames[0]}||{}
1982
+ return (
1983
+ <BusinessSearchSelect
1984
+ selectBusinessType="deliveryMode"
1985
+ selectProps={{
1986
+ style: styleCommon,
1987
+ placeholder: '请选择配送方式',
1988
+ ...(dataInputBusinessType === 12
1989
+ ? {
1990
+ mode: 'multiple',
1991
+ maxTagCount: 1,
1992
+ }
1993
+ : {}),
1994
+ }}
1995
+ disabled={disabled}
1996
+ labelInValue={true}
1997
+ value={currentValue}
1998
+ requestConfig={{
1999
+ filterInit: 'qp-code-in',
2000
+ }}
2001
+ onChange={(value) => {
2002
+ if (dataInputBusinessType === 12) {
2003
+ values = value.map((i) => i.key)||[];
2004
+ valueNames = value.map((i) => i.label || '')||[];
2005
+ } else {
2006
+ values = value?.key?[value.key]:[];
2007
+ valueNames = value?.label?[value.label]:[];
2008
+ }
2009
+ callback(values, valueNames);
2010
+ }}
2011
+ getPopupContainer={() => document.body}
2012
+ />
2013
+ );
2014
+ }
2015
+ }
2016
+ // 角色选择器
2017
+ if (dataChoiceBusinessType == 360) {
2018
+ if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
2019
+ return (
2020
+ <>
2021
+ <BusinessSearchSelect
2022
+ selectBusinessType="role"
2023
+ selectProps={{
2024
+ style: styleCommon,
2025
+ placeholder: '请选择角色',
2026
+ ...(dataInputBusinessType === 12
2027
+ ? {
2028
+ mode: 'multiple',
2029
+ maxTagCount: 1,
2030
+ }
2031
+ : {}),
2032
+ }}
2033
+ disabled={disabled}
2034
+ labelInValue={true}
2035
+ value={values[0]}
2036
+ requestConfig={{
2037
+ filterInit: 'qp-code-in',
2038
+ }}
2039
+ onChange={(value) => {
2040
+ if (dataInputBusinessType === 12) {
2041
+ values[0] = value.map((i) => i.key);
2042
+ valueNames[0] = value.map((i) => i.label || '');
2043
+ } else {
2044
+ values[0] = [value.key];
2045
+ valueNames[0] = [value.label || ''];
2046
+ }
2047
+ callback(values, valueNames);
2048
+ }}
2049
+ getPopupContainer={() => document.body}
2050
+ />
2051
+ <span>~</span>
2052
+ <BusinessSearchSelect
2053
+ selectBusinessType="role"
2054
+ selectProps={{
2055
+ style: styleCommon,
2056
+ placeholder: '请选择角色',
2057
+ ...(dataInputBusinessType === 12
2058
+ ? {
2059
+ mode: 'multiple',
2060
+ maxTagCount: 1,
2061
+ }
2062
+ : {}),
2063
+ }}
2064
+ disabled={disabled}
2065
+ labelInValue={true}
2066
+ value={values[1]}
2067
+ requestConfig={{
2068
+ filterInit: 'qp-code-in',
2069
+ }}
2070
+ onChange={(value) => {
2071
+ if (dataInputBusinessType === 12) {
2072
+ values[1] = value.map((i) => i.key);
2073
+ valueNames[1] = value.map((i) => i.label || '');
2074
+ } else {
2075
+ values[1] = [value.key];
2076
+ valueNames[1] = [value.label || ''];
2077
+ }
2078
+ callback(values, valueNames);
2079
+ }}
2080
+ getPopupContainer={() => document.body}
2081
+ />
2082
+ </>
2083
+ );
2084
+ } else {
2085
+ const currentValue = dataInputBusinessType === 12 ?
2086
+ values?.map((s,vIndex)=> ({key: s, label: valueNames[vIndex]}))||[]
2087
+ : values[0]&&{key:values[0],label:valueNames[0]}||{}
2088
+ return (
2089
+ <BusinessSearchSelect
2090
+ selectBusinessType="role"
2091
+ selectProps={{
2092
+ style: styleCommon,
2093
+ placeholder: '请选择角色',
2094
+ ...(dataInputBusinessType === 12
2095
+ ? {
2096
+ mode: 'multiple',
2097
+ maxTagCount: 1,
2098
+ }
2099
+ : {}),
2100
+ }}
2101
+ disabled={disabled}
2102
+ labelInValue={true}
2103
+ value={currentValue}
2104
+ requestConfig={{
2105
+ filterInit: 'qp-code-in',
2106
+ }}
2107
+ onChange={(value) => {
2108
+ if (dataInputBusinessType === 12) {
2109
+ values = value.map((i) => i.key)||[];
2110
+ valueNames = value.map((i) => i.label || '')||[];
2111
+ } else {
2112
+ values = value?.key?[value.key]:[];
2113
+ valueNames = value?.label?[value.label]:[];
2114
+ }
2115
+ callback(values, valueNames);
2116
+ }}
2117
+ getPopupContainer={() => document.body}
2118
+ />
2119
+ );
2120
+ }
2121
+ }
2122
+ } else {
2123
+ if (
2124
+ dataTypeCode == 22 ||
2125
+ dataTypeCode == 21 ||
2126
+ dataTypeCode == 24 ||
2127
+ dataTypeCode == 23
2128
+ ) {
2129
+ //数值22, 字符串21, 布尔类型24, long23
2130
+ if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
2131
+ return (
2132
+ <>
2133
+ <Input
2134
+ defaultValue={values[0]}
2135
+ disabled={disabled}
2136
+ style={styleCommon}
2137
+ onBlur={(e) => {
2138
+ values[0] = e.target.value;
2139
+ valueNames[0] = e.target.value;
2140
+ callback(values, valueNames);
2141
+ }}
2142
+ />
2143
+ <span>~</span>
2144
+ <Input
2145
+ defaultValue={values[1]}
2146
+ disabled={disabled}
2147
+ style={styleCommon}
2148
+ onBlur={(e) => {
2149
+ values[1] = e.target.value;
2150
+ valueNames[1] = e.target.value;
2151
+ callback(values, valueNames);
2152
+ }}
2153
+ />
2154
+ </>
2155
+ );
2156
+ } else {
2157
+ return (
2158
+ <Input
2159
+ defaultValue={values.join(',')}
2160
+ disabled={disabled}
2161
+ style={styleCommon}
2162
+ onBlur={(e) => {
2163
+ values = e.target.value.split(',');
2164
+ valueNames = e.target.value.split(',');
2165
+ callback(values, valueNames);
2166
+ }}
2167
+ />
2168
+ );
2169
+ }
2170
+ } else if (dataTypeCode == 41 || dataTypeCode == 32) {
2171
+ // 日期41 日期时间32
2172
+ if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
2173
+ return (
2174
+ <RangePicker
2175
+ showTime={dataTypeCode == 32}
2176
+ disabled={disabled}
2177
+ style={{ width: customerWidth || '300px' }}
2178
+ format={dataTypeCode == 41 ? dateFormat : fullDateFormat}
2179
+ value={[
2180
+ values[0] ? moment(values[0]) : '',
2181
+ values[1] ? moment(values[1]) : '',
2182
+ ]}
2183
+ onChange={(dates, dateStrings) => {
2184
+ // 业务产品要求时间范围取值固定00:00:00-23:59:59,有问题请找产品业务
2185
+ let dateStringFormat = [];
2186
+ if (dataTypeCode == 41) {
2187
+ dateStringFormat[0] = dateStrings[0]
2188
+ ? moment(dateStrings[0]).format('YYYY-MM-DD')
2189
+ : '';
2190
+ dateStringFormat[1] = dateStrings[1]
2191
+ ? moment(dateStrings[1]).format('YYYY-MM-DD')
2192
+ : '';
2193
+ } else {
2194
+ dateStringFormat[0] = dateStrings[0]
2195
+ ? moment(dateStrings[0]).format('YYYY-MM-DD 00:00:00')
2196
+ : '';
2197
+ dateStringFormat[1] = dateStrings[1]
2198
+ ? moment(dateStrings[1]).format('YYYY-MM-DD 23:59:59')
2199
+ : '';
2200
+ }
2201
+ values = [...dateStringFormat];
2202
+ valueNames = [...dateStringFormat];
2203
+ callback(values, valueNames);
2204
+ }}
2205
+ />
2206
+ );
2207
+ } else {
2208
+ return (
2209
+ <>
2210
+ <DatePicker
2211
+ showTime={dataTypeCode == 32}
2212
+ format={dataTypeCode == 41 ? dateFormat : fullDateFormat}
2213
+ disabled={disabled}
2214
+ style={{ width: customerWidth || '300px' }}
2215
+ value={values[0] ? moment(values[0]) : ''}
2216
+ onChange={(date, dateString) => {
2217
+ values[0] = dateString;
2218
+ valueNames[0] = dateString;
2219
+ callback(values, valueNames);
2220
+ }}
2221
+ />
2222
+ </>
2223
+ );
2224
+ }
2225
+ } else if (dataTypeCode == 40) {
2226
+ // 时间40
2227
+ if (INTERVAL_TYPE.indexOf(selectOperation) > -1) {
2228
+ return (
2229
+ <>
2230
+ <TimePicker
2231
+ key="1"
2232
+ disabled={disabled}
2233
+ value={values[0] ? moment(values[0]) : ''}
2234
+ style={styleCommon}
2235
+ onChange={(time, timeString) => {
2236
+ values[0] = timeString;
2237
+ valueNames[0] = timeString;
2238
+ callback(values, valueNames);
2239
+ }}
2240
+ />
2241
+ <span>~</span>
2242
+ <TimePicker
2243
+ key="2"
2244
+ disabled={disabled}
2245
+ value={values[1] ? moment(values[1]) : ''}
2246
+ style={styleCommon}
2247
+ onChange={(time, timeString) => {
2248
+ values[1] = timeString;
2249
+ valueNames[1] = timeString;
2250
+ callback(values, valueNames);
2251
+ }}
2252
+ />
2253
+ </>
2254
+ );
2255
+ } else {
2256
+ return (
2257
+ <TimePicker
2258
+ defaultValue={values[0] ? moment(values[0]) : ''}
2259
+ disabled={disabled}
2260
+ style={styleCommon}
2261
+ onChange={(time, timeString) => {
2262
+ values[0] = timeString;
2263
+ valueNames[0] = timeString;
2264
+ callback(values, valueNames);
2265
+ }}
2266
+ />
2267
+ );
2268
+ }
2269
+ }
2270
+ }
2271
+ return '';
2272
+ };
2273
+
2274
+ render() {
2275
+ return (
2276
+ <div style={{ marginLeft: '10px' }} className={styles.rule_field_style}>
2277
+ {this.renderConditionField()}
2278
+ </div>
2279
+ );
2280
+ }
2281
+ }