This commit is contained in:
yanran200730
2022-01-14 17:42:10 +08:00
9 changed files with 145 additions and 82 deletions

View File

@@ -1,9 +1,15 @@
<template>
<div class="AddFamily">
<div class="search">
<div class="searchBox">
<u-search v-model="value" placeholder:clearabled="true" placeholder="搜索" :show-action="false" bg-color="#F5F5F5" search-icon-color="#999" color="#999" height="58" @search="getListInit" @clear="value='',getListInit"></u-search>
<div class="left">
<AiAreaPicker v-model="areaId" :areaId="user.areaId" @select="areaSelect" :name.sync="areaName" style="color: #666">
<u-icon name="map-fill" color="#3192F4" size="20px" style="vertical-align: text-bottom"></u-icon>
<span style="margin-left: 4px" v-if="areaName">{{ areaName }}</span>
<span v-else>请选择</span>
<u-icon name="arrow-down" color="#666" size="28" style="margin-left: 4px" />
</AiAreaPicker>
</div>
<u-search v-model="value" placeholder:clearabled="true" placeholder="搜索" :show-action="false" bg-color="#F5F5F5" search-icon-color="#999" color="#999" height="58" @search="getListInit" @clear="value='',getListInit"></u-search>
</div>
<div class="userList">
<ul v-for="(item,index) in list" :key="index">
@@ -22,7 +28,7 @@
<span class="user-name">{{item.name}}</span>
<span class="user-tel">{{item.phone}}</span>
</div>
<div class="idCard">{{item.idNumber && item.idNumber.replace(/(.{6}).*(.{4})/,"$1********$2")}}</div>
<div class="idCard">{{item.idNumber && item.idNumber.replace(/^(\d{6})\d{8}(.{4}$)/g, `$1${Array(9).join('*')}$2`)}}</div>
<div class="address">{{item.currentAreaName || '' + item.currentAddress}}</div>
</div>
</div>
@@ -46,13 +52,15 @@ export default {
value: '',
checked: true,
userList: {},
userId: ''
userId: '',
areaId: '',
areaName:''
}
},
computed: { ...mapState(['user']) },
methods: {
getList(){
this.$http.post(`/app/appresident/list?residentType=0&areaId=${this.user.areaId}&householdName=1&current=${this.current}&con=${this.value}`).then((res) => {
this.$http.post(`/app/appresident/list?areaId=${this.areaId}&householdName=1&current=${this.current}&con=${this.value}`).then((res) => {
if (res.code == 0) {
res.data.records.map((item) => {
item.checked = false
@@ -84,7 +92,7 @@ export default {
}
})
if(!checkUserList.length) {
this.$u.toast('请选择家庭')
return this.$u.toast('请选择户主')
}
this.$http.post(`/app/appgirdmemberresident/add`, {residentList:checkUserList}).then((res) => {
if (res.code == 0) {
@@ -97,10 +105,16 @@ export default {
}).catch((err) => {
this.$u.toast(err)
})
}
},
areaSelect(e) {
this.areaId =e
this.getListInit()
},
},
onLoad(option) {
this.userId = option.id
this.areaId = this.user.areaId
this.areaName = this.user.areaName
console.log(this.userId)
},
onShow() {
@@ -117,27 +131,17 @@ export default {
<style lang="scss" scoped>
.AddFamily {
background-color: #FFFFFF;
.search{
padding: 20px 32px;
height: 64px;
.searchBox {
display: flex;
justify-content: flex-start;
width: 100%;
height: 64px;
border-radius: 32px;
background-color: #F5F5F5;
.searchIcon {
width: 32px;
height: 32px;
padding: 16px 6px 16px 32px;
}
.input {
width: 540px;
padding: 14px 6px 14px 6px;
}
.search{
width: 100%;
height: 112px;
padding: 32px;
box-sizing: border-box;
background: #FFF;
display: flex;
margin-bottom: 8px;
.left{
width: calc(100% - 402px);
}
;
}
.userList {
width: 100%;

View File

@@ -77,7 +77,7 @@ export default {
this.isAdmin = false
this.$http.post('/app/appgirdmemberinfo/checkLogOnUser').then((res) => {
if (res.code == 0) {
if (res.data.checkType) {
if (res.data.checkType != '0') {
this.isAdmin = true
}
}

View File

@@ -10,7 +10,7 @@
</div>
<div class="title">网格人员</div>
<div class="user-content" v-for="(item, index) in dataInfo.parentGirdMembers" :key="index">
<img :src="item.photo" alt="" v-if="item.photo">
<image :src="item.photo" alt="" mode="aspectFill" v-if="item.photo" />
<img src="./components/img/big-user.png" alt="" v-else>
<div class="right">
<div class="name">{{item.name}}</div>
@@ -19,12 +19,12 @@
</div>
</div>
<div class="user-content user-item" v-for="(item, index) in dataInfo.girdMembers" :key="index">
<img :src="item.photo" alt="" v-if="item.photo">
<img src="./components/img/user-img.png" alt="" v-else>
<image :src="item.photo" alt="" mode="aspectFill" v-if="item.photo" />
<img src="./components/img/user-img.png" alt="" v-else />
<div class="right">
<div class="name">{{item.name}}
<span class="gird">{{item.checkType == 2 ? '网格长' : '网格员'}}</span>
<span class="family-btn" @click="linkTo(`./FamilyList?id=${item.id}`)">责任家庭 ></span>
<span class="family-btn" @click="linkTo(`./FamilyList?id=${item.id}`)" v-if="item.checkType == 1">责任家庭 ></span>
</div>
<p>{{item.girdName}} </p>
</div>
@@ -58,13 +58,11 @@ export default {
isGirdUser() {
this.$http.post('/app/appgirdmemberinfo/checkLogOnUser').then((res) => {
if (res.code == 0) {
if (res.data.checkType) {
if (res.data.checkType != '0') {
this.checkType = res.data.checkType
this.userGird = res.data.appGirdInfo
this.getGirdUserList()
} else {
this.$u.toast('当前人员不是网格员或网格管理员')
}
}
}
})
},
@@ -85,6 +83,7 @@ export default {
<style lang="scss" scoped>
.Organization {
padding-top: 32px;
background-color: #f5f5f5;
.select-gird{
width: calc(100% - 60px);
padding: 24px 32px;
@@ -142,7 +141,11 @@ export default {
width: 200px;
height: 200px;
margin-right: 32px;
border-radius: 50%;
}
image{
width: 200px;
height: 200px;
margin-right: 32px;
}
.right{
width: 100%;
@@ -177,6 +180,12 @@ export default {
img{
width: 96px;
height: 96px;
border-radius: 50%;
}
image{
width: 96px;
height: 96px;
border-radius: 50%;
}
.gird{
display: inline-block;

View File

@@ -60,7 +60,7 @@ export default {
item.isChecked = false
})
this.userList = this.current > 1 ? res.data.records : [...this.userList, ...res.data.records]
this.userList = this.current > 1 ? [...this.userList, ...res.data.records] : res.data.records
this.userList.map((item) => {
this.selectUserList.map((e) => {

View File

@@ -105,8 +105,6 @@ export default {
this.girdMsgList = this.girdUser.appGirdInfo
this.getList()
}
} else {
this.$u.toast('当前人员不是网格员或网格管理员')
}
}
})