@bit-sun/business-component 4.0.0-alpha.3 → 4.0.2

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