|
@@ -23,7 +23,8 @@ export default function YeZhuRenZheng () {
|
23
|
23
|
{ name: '租客', id: 'TENANT' },
|
24
|
24
|
{ name: '家属', id: 'RELATION' }
|
25
|
25
|
])
|
26
|
|
- const [Level1Value] = useState(user.orgId)
|
|
26
|
+ const [Level1Value, setLevel1Value] = useState(null)
|
|
27
|
+ const [Level1List, setLevel1List] = useState([])
|
27
|
28
|
const [Level2Value, setLevel2Value] = useState(null)
|
28
|
29
|
const [Level2List, setLevel2List] = useState([])
|
29
|
30
|
const [Level3Value, setLevel3Value] = useState(null)
|
|
@@ -41,6 +42,10 @@ export default function YeZhuRenZheng () {
|
41
|
42
|
}
|
42
|
43
|
}, [user])
|
43
|
44
|
|
|
45
|
+ useEffect(() => {
|
|
46
|
+ GetLevel1List()
|
|
47
|
+ }, [])
|
|
48
|
+
|
44
|
49
|
useEffect(() => {
|
45
|
50
|
GetLevel2List()
|
46
|
51
|
}, [Level1Value])
|
|
@@ -157,6 +162,7 @@ export default function YeZhuRenZheng () {
|
157
|
162
|
...apis.checkOwnerVerify,
|
158
|
163
|
params: {
|
159
|
164
|
orgId: user.orgId,
|
|
165
|
+ communityId: Level1List[Level1Value].id,
|
160
|
166
|
phaseId: Level2List[Level2Value].id,
|
161
|
167
|
buildingId: Level3List[Level3Value].id,
|
162
|
168
|
unitId: Level4List[Level4Value].id,
|
|
@@ -169,6 +175,7 @@ export default function YeZhuRenZheng () {
|
169
|
175
|
request({ // 提交认证数据
|
170
|
176
|
...apis.addOwnerVerify,
|
171
|
177
|
data: {
|
|
178
|
+ communityId: Level1List[Level1Value].id,
|
172
|
179
|
phaseId: Level2List[Level2Value].id,
|
173
|
180
|
buildingId: Level3List[Level3Value].id,
|
174
|
181
|
unitId: Level4List[Level4Value].id,
|
|
@@ -206,15 +213,24 @@ export default function YeZhuRenZheng () {
|
206
|
213
|
})
|
207
|
214
|
}
|
208
|
215
|
|
209
|
|
- const GetLevel2List = () => {
|
210
|
|
- request({ ...apis.getRenZhengAddressList, params: { orgId: user.orgId } }).then((res) => {
|
211
|
|
- setLevel2List(res || [])
|
|
216
|
+ const GetLevel1List = () => {
|
|
217
|
+ request({ ...apis.GetCommunityList }).then((res) => {
|
|
218
|
+ console.log(res.records)
|
|
219
|
+ setLevel1List(res.records || [])
|
212
|
220
|
})
|
213
|
221
|
}
|
214
|
222
|
|
|
223
|
+ const GetLevel2List = () => {
|
|
224
|
+ if (Level1Value !== null) {
|
|
225
|
+ request({ ...apis.getRenZhengAddressList, params: { orgId: user.orgId, communityId: Level1List[Level1Value].id } }).then((res) => {
|
|
226
|
+ setLevel2List(res || [])
|
|
227
|
+ })
|
|
228
|
+ }
|
|
229
|
+ }
|
|
230
|
+
|
215
|
231
|
const GetLevel3List = () => {
|
216
|
232
|
if (Level2Value !== null) {
|
217
|
|
- request({ ...apis.getRenZhengAddressList, params: { orgId: user.orgId, phaseId: Level2List[Level2Value].id } }).then((res) => {
|
|
233
|
+ request({ ...apis.getRenZhengAddressList, params: { orgId: user.orgId, communityId: Level1List[Level1Value].id, phaseId: Level2List[Level2Value].id } }).then((res) => {
|
218
|
234
|
setLevel3List(res || [])
|
219
|
235
|
})
|
220
|
236
|
} else {
|
|
@@ -225,7 +241,7 @@ export default function YeZhuRenZheng () {
|
225
|
241
|
|
226
|
242
|
const GetLevel4List = () => {
|
227
|
243
|
if (Level3Value !== null) {
|
228
|
|
- request({ ...apis.getRenZhengAddressList, params: { orgId: user.orgId, phaseId: Level2List[Level2Value].id, buildingId: Level3List[Level3Value].id } }).then((res) => {
|
|
244
|
+ request({ ...apis.getRenZhengAddressList, params: { orgId: user.orgId, communityId: Level1List[Level1Value].id, phaseId: Level2List[Level2Value].id, buildingId: Level3List[Level3Value].id } }).then((res) => {
|
229
|
245
|
setLevel4List(res || [])
|
230
|
246
|
})
|
231
|
247
|
} else {
|
|
@@ -236,7 +252,7 @@ export default function YeZhuRenZheng () {
|
236
|
252
|
|
237
|
253
|
const GetLevel5List = () => {
|
238
|
254
|
if (Level4Value !== null) {
|
239
|
|
- request({ ...apis.getRenZhengAddressList, params: { orgId: user.orgId, phaseId: Level2List[Level2Value].id, buildingId: Level3List[Level3Value].id, unitId: Level4List[Level4Value].id } }).then((res) => {
|
|
255
|
+ request({ ...apis.getRenZhengAddressList, params: { orgId: user.orgId, communityId: Level1List[Level1Value].id, phaseId: Level2List[Level2Value].id, buildingId: Level3List[Level3Value].id, unitId: Level4List[Level4Value].id } }).then((res) => {
|
240
|
256
|
setLevel5List(res || [])
|
241
|
257
|
})
|
242
|
258
|
} else {
|
|
@@ -247,7 +263,7 @@ export default function YeZhuRenZheng () {
|
247
|
263
|
|
248
|
264
|
const GetLevel6List = () => {
|
249
|
265
|
if (Level5Value !== null) {
|
250
|
|
- request({ ...apis.getRenZhengAddressList, params: { orgId: user.orgId, phaseId: Level2List[Level2Value].id, buildingId: Level3List[Level3Value].id, unitId: Level4List[Level4Value].id, levelId: Level5List[Level5Value].id } }).then((res) => {
|
|
266
|
+ request({ ...apis.getRenZhengAddressList, params: { orgId: user.orgId, communityId: Level1List[Level1Value].id, phaseId: Level2List[Level2Value].id, buildingId: Level3List[Level3Value].id, unitId: Level4List[Level4Value].id, levelId: Level5List[Level5Value].id } }).then((res) => {
|
251
|
267
|
setLevel6List(res || [])
|
252
|
268
|
})
|
253
|
269
|
} else {
|
|
@@ -260,6 +276,15 @@ export default function YeZhuRenZheng () {
|
260
|
276
|
setRoleName(RoleList[e.detail.value].name)
|
261
|
277
|
}
|
262
|
278
|
|
|
279
|
+ const Level1Change = (e) => {
|
|
280
|
+ if (Level1Value !== e.detail.value - 0) {
|
|
281
|
+ setLevel2Value(null)
|
|
282
|
+ }
|
|
283
|
+ if (Level1List.length > 0) {
|
|
284
|
+ setLevel1Value(e.detail.value - 0)
|
|
285
|
+ }
|
|
286
|
+ }
|
|
287
|
+
|
263
|
288
|
const Level2Change = (e) => {
|
264
|
289
|
if (Level2Value !== e.detail.value - 0) {
|
265
|
290
|
setLevel3Value(null)
|
|
@@ -331,6 +356,14 @@ export default function YeZhuRenZheng () {
|
331
|
356
|
</Picker>
|
332
|
357
|
</view>
|
333
|
358
|
</view>
|
|
359
|
+ <view className='flex-h'>
|
|
360
|
+ <text>小区</text>
|
|
361
|
+ <view className='flex-item'>
|
|
362
|
+ <Picker value={Level1Value} range-key='name' range={Level1List} onChange={Level1Change}>
|
|
363
|
+ <view className='PickerText'>{Level1List.length > 0 && Level1Value !== null ? Level1List[Level1Value].name : '请选择小区'}</view>
|
|
364
|
+ </Picker>
|
|
365
|
+ </view>
|
|
366
|
+ </view>
|
334
|
367
|
<view className='flex-h'>
|
335
|
368
|
<text>期号</text>
|
336
|
369
|
<view className='flex-item'>
|