BUG 30003

This commit is contained in:
aixianling
2022-06-06 11:22:15 +08:00
parent 34dd2fcbcc
commit 94331d6ba0
9 changed files with 274 additions and 322 deletions

View File

@@ -1,27 +1,7 @@
<template> <template>
<ai-list class="AppGridMember" v-if="!isShowDetail"> <keep-alive include="GmList">
<template slot="title"> <component :is="currentPage" v-bind="$props" @change="onChange"/>
<ai-title title="网格员管理" :isShowBottomBorder="false"></ai-title> </keep-alive>
</template>
<template slot="tabs">
<el-tabs v-model="currIndex">
<el-tab-pane v-for="(tab,i) in tabs" :key="i" :label="tab.label">
<component :ref="String(i)" v-if="currIndex == i" :is="tab.comp" @change="onChange" lazy :instance="instance"
:dict="dict" :permissions="permissions"/>
</el-tab-pane>
</el-tabs>
</template>
</ai-list>
<Add v-else-if="component === 'Add'" :params="params" :instance="instance" :dict="dict" :permissions="permissions"
@change="onChange"></Add>
<Family v-else-if="component === 'Family'" :params="params" :instance="instance" :dict="dict"
:permissions="permissions" @change="onChange"></Family>
<MonitorUser v-else-if="component === 'MonitorUser'" :params="params" :instance="instance" :dict="dict"
:permissions="permissions" @change="onChange"></MonitorUser>
<ApplyDetail v-else-if="component === 'ApplyDetail'" :params="params" :instance="instance" :dict="dict"
:permissions="permissions" @change="onChange"></ApplyDetail>
<ApplyAdd v-else-if="component === 'ApplyAdd'" :params="params" :instance="instance" :dict="dict"
:permissions="permissions" @change="onChange"></ApplyAdd>
</template> </template>
<script> <script>
@@ -32,39 +12,29 @@ import ApplyDetail from './components/ApplyDetail'
import ApplyAdd from './components/ApplyAdd' import ApplyAdd from './components/ApplyAdd'
import Family from './components/Family' import Family from './components/Family'
import MonitorUser from './components/MonitorUser' import MonitorUser from './components/MonitorUser'
import GmList from "./components/gmList";
export default { export default {
name: "AppGridMember", name: "AppGridMember",
label: "网格管理员", label: "网格管理员",
props: { props: {
instance: Function, instance: Function,
dict: Object, dict: Object,
permissions: Function permissions: Function
}, },
data() {
return {
component: "List",
params: {},
include: [],
currIndex: '0',
isShowDetail: false
};
},
computed: { computed: {
tabs() { currentPage() {
return [ let {hash} = this.$route
{label: '网格员信息', name: 'List', comp: List, permission: ''}, return hash == "#Family" ? Family :
{label: '申报信息', name: 'ApplyList', comp: ApplyList, permission: 'app_appgirdmemberapply_detail'} hash == "#MonitorUser" ? MonitorUser :
].filter(item => { hash == "#Add" ? Add :
return item.name !== 'ApplyList' || this.permissions(item.permission) hash == "#ApplyAdd" ? ApplyAdd :
}) hash == "#ApplyDetail" ? ApplyDetail :
GmList
} }
}, },
components: { components: {
GmList,
Add, Add,
List, List,
Family, Family,
@@ -76,46 +46,9 @@ export default {
methods: { methods: {
onChange(data) { onChange(data) {
if (data.type === "Add") { let {type, params: query} = data,
this.component = "Add" hash = ["ApplyList", "list"].includes(type) ? "" : "#" + type
this.isShowDetail = true this.$router.push({hash, query})
this.params = data.params
}
if (data.type === "Family") {
this.component = "Family"
this.isShowDetail = true
this.params = data.params
}
if (data.type === "MonitorUser") {
this.component = "MonitorUser"
this.isShowDetail = true
this.params = data.params
}
if (data.type === "ApplyDetail") {
this.component = "ApplyDetail"
this.isShowDetail = true
this.params = data.params
}
if (data.type === "ApplyAdd") {
this.component = "ApplyAdd"
this.isShowDetail = true
this.params = data.params
}
if (data.type === "list") {
this.component = "List"
this.isShowDetail = false
this.params = data.params
}
if (data.type === "ApplyList") {
this.component = "ApplyList"
this.isShowDetail = false
this.params = data.params
}
} }
} }
} }

View File

@@ -1,7 +1,7 @@
<template> <template>
<ai-detail class="content-add"> <ai-detail class="content-add">
<template slot="title"> <template slot="title">
<ai-title :title="params.id ? '编辑' : '添加'" isShowBack isShowBottomBorder @onBackClick="cancel(false)"> <ai-title :title="$route.query.id ? '编辑' : '添加'" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
</ai-title> </ai-title>
</template> </template>
<template slot="content"> <template slot="content">
@@ -35,7 +35,6 @@
props: { props: {
instance: Function, instance: Function,
dict: Object, dict: Object,
params: Object
}, },
data () { data () {
@@ -51,9 +50,9 @@
}, },
created () { created () {
if (this.params && this.params.id) { if ( this.$route.query.id) {
this.id = this.params.id this.id = this.$route.query.id
this.getInfo(this.params.id) this.getInfo(this.$route.query.id)
} }
}, },
@@ -76,7 +75,7 @@
this.isLoading = true this.isLoading = true
this.instance.post(`/app/appgirdmemberapply/addOrUpdate`, { this.instance.post(`/app/appgirdmemberapply/addOrUpdate`, {
...this.form, ...this.form,
id: this.params.id || '' id: this.$route.query.id || ''
}).then(res => { }).then(res => {
if (res.code == 0) { if (res.code == 0) {
this.$message.success('提交成功') this.$message.success('提交成功')

View File

@@ -25,7 +25,6 @@
props: { props: {
instance: Function, instance: Function,
dict: Object, dict: Object,
params: Object
}, },
data() { data() {
@@ -36,9 +35,9 @@
}, },
created() { created() {
if (this.params && this.params.id) { if (this.$route.query.id) {
this.id = this.params.id this.id = this.$route.query.id
this.getInfo(this.params.id) this.getInfo(this.$route.query.id)
} }
}, },

View File

@@ -144,18 +144,14 @@
add (id) { add (id) {
this.$emit('change', { this.$emit('change', {
type: 'ApplyAdd', type: 'ApplyAdd',
params: { params: {id}
id: id || ''
}
}) })
}, },
toDetail (id) { toDetail (id) {
this.$emit('change', { this.$emit('change', {
type: 'ApplyDetail', type: 'ApplyDetail',
params: { params: {id}
id
}
}) })
}, },

View File

@@ -65,7 +65,7 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<ai-table-select :instance="instance" :action="`/app/appresident/list?householdName=1&areaId=${areaId}`" <ai-table-select :instance="instance" :action="`/app/appresident/list?householdName=1&areaId=${areaId}`"
@select="v=>chooseUser=v"/> @select="v=>chooseUser=v" multiple/>
</el-form-item> </el-form-item>
</el-form> </el-form>
</ai-dialog> </ai-dialog>
@@ -81,7 +81,6 @@ export default {
props: { props: {
instance: Function, instance: Function,
dict: Object, dict: Object,
params: Object
}, },
data() { data() {
@@ -118,19 +117,16 @@ export default {
computed: { computed: {
...mapState(['user']) ...mapState(['user'])
}, },
created() { created() {
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.getGirdList() this.getGirdList()
this.getList() this.getList()
}) this.dict.load('epidemicDangerousAreaLevel')
}, },
methods: { methods: {
getGirdList() { getGirdList() {
this.instance.post(`/app/appgirdmemberinfo/queryMyGirdListByLevel2?girdMemberId=${this.params.id}`).then(res => { this.instance.post(`/app/appgirdmemberinfo/queryMyGirdListByLevel2?girdMemberId=${this.$route.query.id}`).then(res => {
if (res.code == 0) { if (res.code == 0) {
this.girdList = res.data this.girdList = res.data
} }
@@ -144,7 +140,7 @@ export default {
this.instance.post(`/app/appgirdmemberresident/listByGirdMember`, null, { this.instance.post(`/app/appgirdmemberresident/listByGirdMember`, null, {
params: { params: {
...this.search, ...this.search,
girdMemberId: this.params.id, girdMemberId: this.$route.query.id,
areaId: this.areaId areaId: this.areaId
} }
}).then(res => { }).then(res => {
@@ -175,7 +171,7 @@ export default {
const residentList = this.chooseUser.map(v => { const residentList = this.chooseUser.map(v => {
return { return {
girdMemberId: this.params.id, girdMemberId: this.$route.query.id,
name: v.name, name: v.name,
residentId: v.id, residentId: v.id,
girdId: this.girdId girdId: this.girdId

View File

@@ -66,7 +66,7 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<ai-table-select :instance="instance" :action="`/app/appresident/list?householdName=1&areaId=${areaId}`" <ai-table-select :instance="instance" :action="`/app/appresident/list?householdName=1&areaId=${areaId}`"
@select="v=>chooseUser=v"/> @select="v=>chooseUser=v" multiple/>
</el-form-item> </el-form-item>
</el-form> </el-form>
</ai-dialog> </ai-dialog>
@@ -83,7 +83,6 @@ export default {
props: { props: {
instance: Function, instance: Function,
dict: Object, dict: Object,
params: Object
}, },
data() { data() {
@@ -94,9 +93,7 @@ export default {
name: '', name: '',
girdId: '' girdId: ''
}, },
isLoading: false,
form: {}, form: {},
userList: [],
name: '', name: '',
chooseUser: [], chooseUser: [],
isShow: false, isShow: false,
@@ -129,13 +126,12 @@ export default {
this.dict.load('epidemicDangerousAreaLevel').then(() => { this.dict.load('epidemicDangerousAreaLevel').then(() => {
this.getGirdList() this.getGirdList()
this.getList() this.getList()
this.getUserList()
}) })
}, },
methods: { methods: {
getGirdList() { getGirdList() {
this.instance.post(`/app/appgirdmemberinfo/queryMyGirdListByLevel2?girdMemberId=${this.params.id}`).then(res => { this.instance.post(`/app/appgirdmemberinfo/queryMyGirdListByLevel2?girdMemberId=${this.$route.query.id}`).then(res => {
if (res.code == 0) { if (res.code == 0) {
this.girdList = res.data this.girdList = res.data
} }
@@ -149,7 +145,7 @@ export default {
this.instance.post(`/app/appgirdmemberpoverty/listByGirdMemberByWeb`, null, { this.instance.post(`/app/appgirdmemberpoverty/listByGirdMemberByWeb`, null, {
params: { params: {
...this.search, ...this.search,
girdMemberId: this.params.id, girdMemberId: this.$route.query.id,
} }
}).then(res => { }).then(res => {
if (res.code == 0) { if (res.code == 0) {
@@ -168,11 +164,6 @@ export default {
handleSelectionChange(e) { handleSelectionChange(e) {
this.ids = e.map(v => v.gmpId) this.ids = e.map(v => v.gmpId)
}, },
clearAll() {
this.chooseUser = []
},
onConfirm() { onConfirm() {
if (!this.girdId) { if (!this.girdId) {
return this.$message.error('请选择网格') return this.$message.error('请选择网格')
@@ -184,7 +175,7 @@ export default {
const povertyList = this.chooseUser.map(v => { const povertyList = this.chooseUser.map(v => {
return { return {
girdMemberId: this.params.id, girdMemberId: this.$route.query.id,
name: v.split('~')[0], name: v.split('~')[0],
girdId: this.girdId, girdId: this.girdId,
povertyId: v.split('~')[1] povertyId: v.split('~')[1]
@@ -207,38 +198,12 @@ export default {
this.girdId = '' this.girdId = ''
this.name = '' this.name = ''
this.areaId = this.user.info.areaId this.areaId = this.user.info.areaId
this.getUserList()
}, },
del(e) {
this.chooseUser.splice(this.chooseUser.indexOf(e), 1)
},
getUserList() {
this.isLoading = true
this.instance.post(`/app/apppreventionreturntopoverty/list`, null, {
params: {
current: 1,
size: 200,
con: this.name,
isHousehold: 1,
areaId: this.areaId
}
}).then(res => {
if (res.code == 0) {
this.userList = res.data.records
}
this.isLoading = false
})
},
onBack() { onBack() {
this.$emit('change', { this.$emit('change', {
type: 'list' type: 'list'
}) })
}, },
remove(ids) { remove(ids) {
this.$confirm('确定删除该数据?').then(() => { this.$confirm('确定删除该数据?').then(() => {
this.instance.post(`/app/appgirdmemberpoverty/delete`, null, { this.instance.post(`/app/appgirdmemberpoverty/delete`, null, {

View File

@@ -12,10 +12,12 @@
size="small" size="small"
label-suffix="" label-suffix=""
label-width="136px"> label-width="136px">
<ai-edit-card
<ai-card title="基础信息"> <ai-card title="基础信息">
<template #right v-if="title=='网格员详情'"> <template #right v-if="title=='网格员详情'">
<span style="color:#2266FF;cursor: pointer;font-size: 12px;" class="iconfont iconEdit" v-if="editOne==false" @click="editOne=true">修改</span> <span style="color:#2266FF;cursor: pointer;font-size: 12px;" class="iconfont iconEdit" v-if="editOne==false" @click="editOne=true">修改</span>
<span style="color:#2266FF;margin-left: 16px;cursor: pointer;font-size: 12px;" v-if="editOne==true" @click="searchDetail(),editOne=false">取消</span> <span style="color:#2266FF;margin-left: 16px;cursor: pointer;font-size: 12px;" v-if="editOne==true"
@click="searchDetail(),editOne=false">取消</span>
<span style="color:#2266FF;margin-left: 16px;cursor: pointer;font-size: 12px;" v-if="editOne==true" @click="save()">保存</span> <span style="color:#2266FF;margin-left: 16px;cursor: pointer;font-size: 12px;" v-if="editOne==true" @click="save()">保存</span>
</template> </template>
<template slot="content"> <template slot="content">
@@ -113,13 +115,15 @@
<ai-card title="关联信息"> <ai-card title="关联信息">
<template #right v-if="title=='网格员详情'"> <template #right v-if="title=='网格员详情'">
<span style="color:#2266FF;cursor: pointer;font-size: 12px;" class="iconfont iconEdit" v-if="editTwo==false" @click="editTwo=true">修改</span> <span style="color:#2266FF;cursor: pointer;font-size: 12px;" class="iconfont iconEdit" v-if="editTwo==false" @click="editTwo=true">修改</span>
<span style="color:#2266FF;margin-left: 16px;cursor: pointer;font-size: 12px;" v-if="editTwo==true" @click="searchDetail(),editTwo=false">取消</span> <span style="color:#2266FF;margin-left: 16px;cursor: pointer;font-size: 12px;" v-if="editTwo==true"
@click="searchDetail(),editTwo=false">取消</span>
<span style="color:#2266FF;margin-left: 16px;cursor: pointer;font-size: 12px;" v-if="editTwo==true" @click="save()">保存</span> <span style="color:#2266FF;margin-left: 16px;cursor: pointer;font-size: 12px;" v-if="editTwo==true" @click="save()">保存</span>
</template> </template>
<template slot="content"> <template slot="content">
<template v-if="editTwo==true"> <template v-if="editTwo==true">
<el-form-item label="责任网格" prop="girdInfoList" style="margin-top: 8px;"> <el-form-item label="责任网格" prop="girdInfoList" style="margin-top: 8px;">
<el-form-item style="width: 100%" label-width="80px" :label="'网格' + (index + 1)" v-for="(item, index) in forms.girdInfoList" :key="'选项' + (index + 1)"> <el-form-item style="width: 100%" label-width="80px" :label="'网格' + (index + 1)" v-for="(item, index) in forms.girdInfoList"
:key="'选项' + (index + 1)">
<div class="form-flex"> <div class="form-flex">
<el-select v-model="item.checkType" placeholder="请选择网格角色"> <el-select v-model="item.checkType" placeholder="请选择网格角色">
<el-option <el-option
@@ -194,7 +198,8 @@
<ai-info-item label="是否特殊网格员:"> <ai-info-item label="是否特殊网格员:">
<span>{{ !forms.isGirdMember ? '-' : forms.isGirdMember === '0' ? '否' : '是' }}</span> <span>{{ !forms.isGirdMember ? '-' : forms.isGirdMember === '0' ? '否' : '是' }}</span>
</ai-info-item> </ai-info-item>
<ai-info-item label="特殊网格员:" v-if="forms.isGirdMember==1"><span >{{dict.getLabel('girdMemberType', forms.girdMemberType)}}</span></ai-info-item> <ai-info-item label="特殊网格员:" v-if="forms.isGirdMember==1"><span>{{ dict.getLabel('girdMemberType', forms.girdMemberType) }}</span>
</ai-info-item>
<ai-info-item label="政治面貌:"><span>{{ dict.getLabel('politicsStatus', forms.politicsStatus) }}</span></ai-info-item> <ai-info-item label="政治面貌:"><span>{{ dict.getLabel('politicsStatus', forms.politicsStatus) }}</span></ai-info-item>
<ai-info-item label="学历:"><span>{{ dict.getLabel('education', forms.education) }}</span></ai-info-item> <ai-info-item label="学历:"><span>{{ dict.getLabel('education', forms.education) }}</span></ai-info-item>
<ai-info-item label="人生格言:" style="width: 100%;"><span>{{ forms.motto }}</span></ai-info-item> <ai-info-item label="人生格言:" style="width: 100%;"><span>{{ forms.motto }}</span></ai-info-item>
@@ -239,7 +244,6 @@ export default {
instance: Function, instance: Function,
dict: Object, dict: Object,
permissions: Function, permissions: Function,
params: Object,
}, },
data() { data() {
return { return {
@@ -290,7 +294,7 @@ export default {
}, },
created() { created() {
this.beforeSelectTree() this.beforeSelectTree()
if (this.params.id) { if (this.$route.query.id) {
this.searchDetail(); this.searchDetail();
this.title = "网格员详情"; this.title = "网格员详情";
this.editOne = false; this.editOne = false;
@@ -448,11 +452,10 @@ export default {
}); });
}, },
searchDetail() { searchDetail() {
this.instance let {id} = this.$route.query
.post(`/app/appgirdmemberinfo/queryDetailById`, null, { this.instance.post(`/app/appgirdmemberinfo/queryDetailById`, null, {
params: { id: this.params.id }, params: {id}
}) }).then((res) => {
.then((res) => {
if (res.code == 0) { if (res.code == 0) {
this.forms = { this.forms = {
...res.data, ...res.data,
@@ -499,9 +502,11 @@ export default {
margin-left: 0 !important; margin-left: 0 !important;
} }
} }
.ai-detail__title { .ai-detail__title {
background-color: #fff; background-color: #fff;
} }
.ai-detail__content { .ai-detail__content {
.ai-detail__content--wrapper { .ai-detail__content--wrapper {
.el-form { .el-form {
@@ -511,9 +516,11 @@ export default {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: space-between; justify-content: space-between;
.el-form-item { .el-form-item {
width: 48%; width: 48%;
} }
.buildingTypes { .buildingTypes {
width: 100%; width: 100%;
} }
@@ -521,15 +528,19 @@ export default {
} }
} }
} }
::v-deep .el-tag { ::v-deep .el-tag {
margin-right: 8px; margin-right: 8px;
color: #333333; color: #333333;
} }
.footer-btn { .footer-btn {
width: 92px; width: 92px;
} }
.above { .above {
display: flex; display: flex;
.left, .right { .left, .right {
flex: 1; flex: 1;
} }

View File

@@ -0,0 +1,55 @@
<template>
<section class="gmList">
<ai-list class="AppGridMember">
<template slot="title">
<ai-title title="网格员管理" :isShowBottomBorder="false"></ai-title>
</template>
<template slot="tabs">
<el-tabs v-model="currIndex">
<el-tab-pane v-for="(tab,i) in tabs" :key="i" :label="tab.label">
<component :ref="String(i)" v-if="currIndex == i" :is="tab.comp" lazy :instance="instance"
:dict="dict" :permissions="permissions" v-on="$listeners"/>
</el-tab-pane>
</el-tabs>
</template>
</ai-list>
</section>
</template>
<script>
import List from "./list";
import ApplyList from "./ApplyList";
export default {
name: "gmList",
props: {
instance: Function,
dict: Object,
permissions: Function
},
computed: {
tabs() {
return [
{label: '网格员信息', name: 'List', comp: List, permission: ''},
{label: '申报信息', name: 'ApplyList', comp: ApplyList, permission: 'app_appgirdmemberapply_detail'}
].filter(item => {
return item.name !== 'ApplyList' || this.permissions(item.permission)
})
}
},
data() {
return {
currIndex: '0',
}
},
methods: {},
created() {
}
}
</script>
<style lang="scss" scoped>
.gmList {
height: 100%;
}
</style>

View File

@@ -143,7 +143,6 @@ export default {
} }
}) })
}, },
toMonitorUser(id) { toMonitorUser(id) {
this.$emit('change', { this.$emit('change', {
type: 'MonitorUser', type: 'MonitorUser',
@@ -152,7 +151,6 @@ export default {
} }
}) })
}, },
toFamily(id) { toFamily(id) {
this.$emit('change', { this.$emit('change', {
type: 'Family', type: 'Family',