This commit is contained in:
yanran200730
2022-01-20 15:25:24 +08:00

View File

@@ -46,6 +46,23 @@
title="添加户主" title="添加户主"
@onConfirm="onConfirm"> @onConfirm="onConfirm">
<ai-area-select clearable always-show :instance="instance" v-model="areaId" :disabled-level="disabledLevel"></ai-area-select> <ai-area-select clearable always-show :instance="instance" v-model="areaId" :disabled-level="disabledLevel"></ai-area-select>
<el-form
ref="rules"
size="small"
label-suffix=""
label-width="80px" style="margin-top:16px;">
<el-form-item label="网格" prop="name" required="true">
<el-select size="medium" style="width: 280px;" v-model="girdId" placeholder="请选择网格" clearable>
<el-option
v-for="(item,i) in girdList"
:key="i"
:label="item.girdName"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
</el-form>
<div class="AiWechatSelecter-container"> <div class="AiWechatSelecter-container">
<div class="AiWechatSelecter-container__left" v-loading="isLoading"> <div class="AiWechatSelecter-container__left" v-loading="isLoading">
<div class="AiWechatSelecter-header"> <div class="AiWechatSelecter-header">
@@ -137,7 +154,9 @@
tableData: [], tableData: [],
areaId: '', areaId: '',
ids: [], ids: [],
disabledLevel: 0 disabledLevel: 0,
girdList: [],
girdId: ''
} }
}, },
@@ -149,12 +168,20 @@
this.areaId = this.user.info.areaId this.areaId = this.user.info.areaId
this.disabledLevel = this.user.info.areaList.length this.disabledLevel = this.user.info.areaList.length
this.dict.load('epidemicDangerousAreaLevel').then(() => { this.dict.load('epidemicDangerousAreaLevel').then(() => {
this.getGirdList()
this.getList() this.getList()
this.getUserList() this.getUserList()
}) })
}, },
methods: { methods: {
getGirdList() {
this.instance.post(`/app/appgirdmemberinfo/queryMyGirdListByLevel2?girdMemberId=${this.params.id}`).then(res => {
if (res.code == 0) {
this.girdList = res.data
}
})
},
getList () { getList () {
this.instance.post(`/app/appgirdmemberresident/listByGirdMember`, null, { this.instance.post(`/app/appgirdmemberresident/listByGirdMember`, null, {
params: { params: {
@@ -184,6 +211,10 @@
}, },
onConfirm () { onConfirm () {
if(!this.girdId) {
return this.$message.error('请选择网格')
}
if (!this.chooseUser.length) { if (!this.chooseUser.length) {
return this.$message.error('请选择户主') return this.$message.error('请选择户主')
} }
@@ -192,7 +223,8 @@
return { return {
girdMemberId: this.params.id, girdMemberId: this.params.id,
name: v.split('~')[0], name: v.split('~')[0],
residentId: v.split('~')[1] residentId: v.split('~')[1],
girdId: this.girdId
} }
}) })
this.instance.post(`/app/appgirdmemberresident/add`, { this.instance.post(`/app/appgirdmemberresident/add`, {
@@ -219,7 +251,7 @@
size: 200, size: 200,
con: this.name, con: this.name,
householdName: 1, householdName: 1,
areaId: this.areaId areaId: this.areaId,
} }
}).then(res => { }).then(res => {
if (res.code == 0) { if (res.code == 0) {