This commit is contained in:
yanran200730
2022-01-14 14:09:58 +08:00
8 changed files with 372 additions and 25 deletions

View File

@@ -323,6 +323,11 @@ export default {
}
}
}
.emptyWrap {
margin-top: 0;
background: #f5f5f5;
}
}
}
</style>

View File

@@ -1,30 +1,228 @@
<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>
</div>
<div class="userList">
<ul v-for="(item,index) in list" :key="index">
<li class="main">
<div class="user">
<div>
<img src="./components/img/xz.png" alt="" class="checkbox" v-if="!item.checked" @click="userClick(index)">
<img src="./components/img/xzh.png" alt="" class="checkbox" v-else @click="userClick(index)">
</div>
<div class="userInfo">
<div>
<img src="./components/img/user-img.png" alt="" class="userImg" >
</div>
<div class="info">
<div class="name">
<span class="user-name">{{item.name}}</span>
<span class="user-tel">{{item.phone}}</span>
</div>
<div class="idCard">{{item.idNumber}}</div>
<div class="address">{{item.householdAddress}}</div>
</div>
</div>
</div>
</li>
</ul>
</div>
<div class="btn">
<div class="handleCheck" @click="confirm">确定选择</div>
</div>
</div>
</template>
<script>
import { mapState } from 'vuex'
export default {
data() {
return {
list: [],
current: 1,
value: '',
checked: true,
userList: {},
userId: ''
}
},
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) => {
if (res.code == 0) {
res.data.records.map((item) => {
item.checked = false
item.girdMemberId = this.userId
item.residentId = item.id
})
this.list = this.current > 1 ? [...this.list, ...res.data.records] : res.data.records
}
})
},
getListInit(){
this.list = []
this.current = 1
this.getList()
},
userClick(index) {
this.list[index].checked = !this.list[index].checked
},
confirm() {
var checkUserList = []
this.list.map((item) => {
if(item.checked) {
var info = {
girdMemberId: this.userId,
residentId: item.id,
name: item.name
}
checkUserList.push(info)
}
})
if(!checkUserList.length) {
this.$u.toast('请选择家庭')
}
this.$http.post(`/app/appgirdmemberresident/add`, {residentList:checkUserList}).then((res) => {
if (res.code == 0) {
this.$u.toast('提交成功')
uni.$emit('updateList')
setTimeout(() => {
uni.navigateBack()
}, 600)
}
}).catch((err) => {
this.$u.toast(err)
})
}
},
onLoad(option) {
this.userId = option.id
console.log(this.userId)
},
onShow() {
document.title = '新增责任家庭'
this.getList()
},
onReachBottom() {
this.current = this.current + 1
this.getList()
},
linkTo(url) {
uni.navigateTo({url})
}
}
</script>
<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;
}
}
;
}
.userList {
width: 100%;
background-color: #FFFFFF ;
ul {
padding-left: 0px;
li {
list-style-type: none;
height: 176px;
.user {
display: flex;
justify-content: flex-start;
padding-top: 24px;
padding-left: 32px;
height: 85%;
.checkbox{
margin-top: 20px;
margin-right: 32px;
width: 48px;
height: 48px;
}
.userInfo {
display: flex;
justify-content: flex-start;
border-bottom: 1px solid #E4E5E6;
padding-right: 48px;
width: calc(100% - 100px);
.userImg {
padding-right: 32px;
width: 80px;
height: 80px;
}
.info {
width: calc(100% - 120px);
.name {
display: flex;
justify-content: space-between;
font-size: 32px;
margin-bottom: 8px;
.user-name {
font-weight: 800;
}
.user-tel {
font-size: 26px;
color: #999999 ;
}
}
.idCard {
margin-bottom: 16px;
font-size: 26px;
color: #999999;
}
.address {
font-size: 26px;
color: #999999;
}
}
}
}
}
}
}
.btn {
position: fixed;
bottom: 0px;
right: 0px;
width: 100%;
height: 120px;
background-color: #F3F6F9;
.handleCheck {
position: fixed;
bottom: 18px;
right: 34px;
width: 192px;
height: 80px;
line-height: 80px;
text-align: center;
background-color: #1365DD;
color: #FFFFFF;
}
}
}
</style>

View File

@@ -14,7 +14,7 @@
</div>
<div class="value" @click="toAddUser('manage')">
<span v-if="form.girdMemberManageList.length">
<span v-if="form.girdMemberManageList && form.girdMemberManageList.length">
<span v-for="(item, index) in form.girdMemberManageList" :key="index"><span v-if="index>0">,</span>{{item.name}}</span>
</span>
<span style="color:#999;" v-else>请选择</span>
@@ -25,7 +25,7 @@
<span class="tips"></span>网格员
</div>
<div class="value" @click="toAddUser('Member')">
<span v-if="form.girdMemberList.length">
<span v-if="form.girdMemberList && form.girdMemberList.length">
<span v-for="(item, index) in form.girdMemberList" :key="index"><span v-if="index>0">,</span>{{item.name}}</span>
</span>
<span style="color:#999;" v-else>请选择</span>
@@ -93,10 +93,20 @@ export default {
if(!this.form.girdName){
return this.$u.toast('请输入网格名称')
}
if(this.fromType == 'add') {
this.form.parentGirdId = this.detailInfo.id
this.form.parentGirdName = this.detailInfo.girdName
this.form.girdLevel = Number(this.detailInfo.girdLevel)+1
this.form.girdType = Number(this.detailInfo.girdType)+1
this.form.isLastLevel = this.form.girdLevel == 2 ? '1' : '0'
}
this.$http.post(`/app/appgirdinfo/addOrUpdate`, this.form).then((res) => {
if (res.code == 0) {
this.
uni.navigateBack()
this.$u.toast('提交成功')
uni.$emit('update')
setTimeout(() => {
uni.navigateBack()
}, 600)
}
})

View File

@@ -21,7 +21,7 @@ export default {
data() {
return {
component: 'Organization',
component: 'Statistics',
params: {},
refresh: true,
tabIndex: 0,

View File

@@ -1,6 +1,27 @@
<template>
<div class="FamilyList">
<div class="title">户主列表</div>
<div class="main">
<ul v-for="item in list" :key="item.id">
<li>
<div class="user">
<div>
<img src="./components/img/user-img.png" alt="" class="userImg">
<!-- <img src="./components/img/user-img.png" alt="" class="userImg"> -->
</div>
<div class="info">
<div class="name">
<span class="user-name">{{item.name}}</span>
<span class="user-tel">{{item.phone}}</span>
</div>
<div class="idCard">{{item.idNumber}}</div>
<div class="address">{{item.householdAddress}}</div>
</div>
</div>
</li>
</ul>
</div>
<div class="footer" @click="toAddFamily()" v-if="checkType == 2">新增责任家庭</div>
</div>
</template>
@@ -8,23 +29,123 @@
export default {
data() {
return {
list:[],
current:1,
checkType: '',
userId: '',
}
},
methods: {
getList(){
this.$http.post(`/app/appgirdmemberresident/listByGirdMember?current=${this.current}&girdMemberId=${this.userId}`).then((res) => {
if (res.code == 0) {
this.list = this.current > 1 ? [...this.list, ...res.data.records] : res.data.records
}
})
},
toAddFamily(){
uni.navigateTo({url: `./AddFamily?id=${this.userId}`})
},
isGirdUser() {
this.$http.post('/app/appgirdmemberinfo/checkLogOnUser').then((res) => {
if (res.code == 0) {
if (res.data.checkType) {
this.checkType = res.data.checkType
}
}
})
},
},
onLoad(option) {
this.userId = option.id
console.log(this.userId)
},
onShow() {
document.title = '责任家庭'
this.getList()
uni.$on('updateList', () => {
this.current = 1
this.getList()
})
this.isGirdUser()
},
onReachBottom() {
this.current = this.current + 1
this.getList()
},
linkTo(url) {
uni.navigateTo({url})
}
}
</script>
<style lang="scss" scoped>
.FamilyList {
background-color: #FFFFFF;
.title {
padding: 24px 32px;
background-color: #F3F6F9;
font-size: 34px;
font-weight: 800;
}
.main {
background-color: #FFFFFF ;
ul {
padding: 0px 32px;
background-color: #fff;
li {
list-style-type: none;
.user {
display: flex;
justify-content: flex-start;
padding-top: 24px;
.userImg {
padding-right: 32px;
width: 80px;
height: 80px;
}
.info {
border-bottom: 1px solid #E4E5E6;
width: 606px;
div {
margin: 2px 0;
}
.name {
display: flex;
justify-content: space-between;
font-size: 32px;
margin-bottom: 8px;
.user-name {
font-weight: 800;
}
.user-tel {
font-size: 26px;
color: #999999 ;
}
}
.idCard {
margin-bottom: 16px;
font-size: 26px;
color: #999999;
}
.address {
margin-bottom: 18px;
font-size: 26px;
color: #999999;
}
}
}
}
}
}
.footer{
position: fixed;
left: 0px;
bottom: 0px;
width: 100%;
height: 112px;
background-color: #1365DD;
line-height: 112px;
text-align: center;
font-size: 36px;
color: #FFFFFF;
}
}
</style>

View File

@@ -6,7 +6,7 @@
{{userGird.girdName}}
<img src="./components/img/down-icon.png" alt="" class="down-icon">
</div>
<span @click="linkTo('./SetGird')">网格配置</span>
<span @click="linkTo('./SetGird')" v-if="checkType == 2">网格配置</span>
</div>
<div class="title">网格人员</div>
<div class="user-content" v-for="(item, index) in dataInfo.parentGirdMembers" :key="index">
@@ -24,7 +24,7 @@
<div class="right">
<div class="name">{{item.name}}
<span class="gird">{{item.checkType == 2 ? '网格长' : '网格员'}}</span>
<span class="family-btn" @click="linkTo(`./FamilyList?girdId=${item.id}`)">责任家庭 ></span>
<span class="family-btn" @click="linkTo(`./FamilyList?id=${item.id}`)">责任家庭 ></span>
</div>
<p>{{item.girdName}} </p>
</div>

View File

@@ -60,6 +60,7 @@
</span>
</div>
</div>
<div style="height:56px;"></div>
<div class="btn" v-if="form.girdRight == 1">
<span class="del" @click="del">删除网格</span>
<span class="edit" @click="edit">编辑网格</span>
@@ -88,6 +89,10 @@ export default {
onLoad() {
this.$dict.load('girdType', 'girdLevel')
this.isGirdUser()
uni.$on('update', () => {
this.show = false
this.getTree()
})
},
methods: {
isGirdUser() {
@@ -408,9 +413,14 @@ export default {
border-bottom: 0;
}
.btn{
padding: 32px 0;
width: 100%;
padding: 32px;
box-sizing: border-box;
background-color: #fff;
display: flex;
position: fixed;
bottom: 0;
left: 0;
span{
display: inline-block;
height: 92px;

View File

@@ -15,17 +15,20 @@
<div class="card">
<div class="box">
<span class="count">{{ peopleList['网格长'] || 0 }}</span>
<span class="count" v-if="peopleList && peopleList['网格长']">{{ peopleList['网格长']}}</span>
<span class="count" v-else>0</span>
<span class="girdCount">网格长</span>
</div>
<div class="box">
<span class="count">{{ peopleList['网格员'] || 0 }}</span>
<span class="count" v-if="peopleList && peopleList['网格员'] ">{{ peopleList['网格员']}}</span>
<span class="count" v-else>0</span>
<span class="girdCount">网格员</span>
</div>
<div class="box">
<span class="count">{{ peopleList['责任家庭数'] || 0 }}</span>
<span class="count" v-if="peopleList && peopleList['责任家庭数']">{{ peopleList['责任家庭数'] }}</span>
<span class="count" v-else>0</span>
<span class="girdCount">责任家庭数</span>
</div>
</div>