居民档案

This commit is contained in:
花有清香月有阴
2021-12-21 15:45:52 +08:00
parent 2d81852c6f
commit 88e358a8ad
7 changed files with 436 additions and 65 deletions

View File

@@ -2,7 +2,7 @@
<div class="AppResidentFile"> <div class="AppResidentFile">
<u-tabbar v-model="currentTabBar" :list="list" @change="changeTab" style="height: 0"></u-tabbar> <u-tabbar v-model="currentTabBar" :list="list" @change="changeTab" style="height: 0"></u-tabbar>
<div v-if="currentTabBar == 0"> <div class="currentTabBar0" v-if="currentTabBar == 0">
<u-tabs :list="tabList" :is-scroll="false" :current="currentTabs" height="96" bg-color="#3975C6" inactive-color="#fff" active-color="#fff" @change="change"></u-tabs> <u-tabs :list="tabList" :is-scroll="false" :current="currentTabs" height="96" bg-color="#3975C6" inactive-color="#fff" active-color="#fff" @change="change"></u-tabs>
<div class="peopleGroup" v-if="currentTabs == 0"> <div class="peopleGroup" v-if="currentTabs == 0">
@@ -66,9 +66,41 @@
</div> </div>
</div> </div>
<div v-if="currentTabBar == 1">1</div> <div class="currentTabBar1" v-if="currentTabBar == 1">
<AiAreaPicker v-model="areaId" all :areaId="areaId" @select="areaSelect"></AiAreaPicker>
<div v-if="currentTabBar == 2">2</div> <div class="line"></div>
<div class="peopleCard">
<u-tabs :list="tabPeopleList" :is-scroll="false" :current="currentPeople" height="96" inactive-color="#000" active-color="#1365DD" @change="changePeople"></u-tabs>
<div class="seachObj">
<u-search v-model="keyword" :clearabled="true" placeholder="搜索" :show-action="false" bg-color="#F5F5F5" search-icon-color="#E2E8F1" color="#666" height="58" @search="handerSearch" @clear="handerClear"></u-search>
</div>
<div class="datas" v-if="data.length > 0">
<div class="datass" v-for="(item, i) in data" :key="i" @click="toDetailCard(item)">
<div class="left">
<img :src="item.photo" alt="" v-if="item.photo" />
<img src="./components/img/4.png" alt="" v-else />
</div>
<div class="right">
<div class="rightTop">{{ item.name }}</div>
<div class="rightBottom">
<span>{{ item.idNumber.replace(/^(\w{6})\w{8}(.*)$/, '$1****$2') }}</span>
<span>{{ item.phone }}</span>
</div>
</div>
</div>
</div>
<AiEmpty v-else></AiEmpty>
</div>
</div>
<div class="currentTabBar2" v-if="currentTabBar == 2">2</div>
</div> </div>
</template> </template>
@@ -117,6 +149,19 @@ export default {
], ],
Echarts1: null, Echarts1: null,
Echarts2: null, Echarts2: null,
areaId: '',
currentPeople: 0,
tabPeopleList: [
{
name: '本地居民',
},
{
name: '流动人员',
},
],
current: 1,
keyword: '',
data: [],
} }
}, },
computed: { computed: {
@@ -125,11 +170,31 @@ export default {
watch: {}, watch: {},
onLoad() { onLoad() {
this.getEchart() this.getEchart()
this.areaId = this.user.areaId
}, },
mounted() { mounted() {
this.Echarts1 = echarts.init(document.getElementById('echarts1')) this.Echarts1 = echarts.init(document.getElementById('echarts1'))
}, },
methods: { methods: {
getList() {
this.$http
.post('/app/appresident/list', null, {
params: {
size: 10,
current: this.current,
areaId: this.areaId,
con: this.keyword,
residentType: this.currentPeople == 0 ? '0' : '1',
},
})
.then((res) => {
if (res.code == 0) {
this.data = this.current > 1 ? [...this.data, ...res.data.records] : res.data.records
this.pages = res.data.pages
}
})
},
getEchart() { getEchart() {
this.$http.post(`/app/appresident/queryCustInfoByAreaId?areaId=${this.user.areaId}`).then((res) => { this.$http.post(`/app/appresident/queryCustInfoByAreaId?areaId=${this.user.areaId}`).then((res) => {
if (res.code === 0) { if (res.code === 0) {
@@ -233,8 +298,33 @@ export default {
options && this.Echarts2.setOption(options) options && this.Echarts2.setOption(options)
}, },
toDetailCard(item) {
uni.navigateTo({ url: `./DetailCard?id=${item.id}` })
},
areaSelect(e) {
console.log(e)
this.areaId = e.id
this.getList()
},
handerSearch(e) {
this.keyword = e
this.current = 1
this.getList()
},
handerClear() {
this.keyword = ''
this.current = 1
this.getList()
},
changeTab(e) { changeTab(e) {
this.currentTabBar = e this.currentTabBar = e
if (this.currentTabBar == 1) {
this.getList()
}
}, },
change(index) { change(index) {
@@ -247,14 +337,16 @@ export default {
} }
this.getEchart() this.getEchart()
}) })
},
// this.getList() changePeople(e) {
// this.getEchart() this.currentPeople = e
this.getList()
}, },
}, },
onReachBottom() { onReachBottom() {
// this.current = this.current + 1 this.current = this.current + 1
// this.getList() this.getList()
}, },
} }
</script> </script>
@@ -265,6 +357,7 @@ uni-page-body {
} }
.AppResidentFile { .AppResidentFile {
height: 100%; height: 100%;
.currentTabBar0 {
.peopleGroup, .peopleGroup,
.people { .people {
.topcard { .topcard {
@@ -335,4 +428,56 @@ uni-page-body {
} }
} }
} }
.currentTabBar1 {
height: 100%;
background: #fff;
.AiAreaPicker {
padding: 16px 0 14px 12px;
}
.line {
height: 16px;
background: #f5f5f5;
}
.peopleCard {
background: #fff;
.seachObj {
border-bottom: 2px solid #f5f5f5;
border-top: 2px solid #f5f5f5;
padding: 20px 32px;
}
.datas {
.datass {
display: flex;
padding: 24px 32px;
.left {
img {
width: 80px;
height: 80px;
border-radius: 50%;
}
}
.right {
display: flex;
flex-direction: column;
margin-left: 32px;
width: 100%;
.rightTop {
font-size: 32px;
font-weight: 500;
color: #333333;
}
.rightBottom {
display: flex;
justify-content: space-between;
margin-top: 8px;
}
}
}
}
}
}
}
</style> </style>

View File

@@ -0,0 +1,182 @@
<template>
<div class="DetailCard">
<div class="top"></div>
<div class="middle">
<div class="hint">家庭地址</div>
<div class="areaHint">
<u-icon name="map-fill" color="#73ABFF"></u-icon>
<span>{{ currentAreaName }}</span>
</div>
</div>
<div class="bottom">
<div class="hints">家庭成员</div>
<div v-if="data.family && data.family.length > 0">
<div class="card" v-for="(item, i) in data.family" :key="i" @click="toDetailPeople(item)">
<div class="photos">
<img :src="item.photo" alt="" v-if="item.photo" />
<img src="./components/img/2.png" alt="" v-else />
</div>
<div class="right">
<div class="rightTop">
<div class="rightTop-lefts">
<span class="names">{{ item.name }}</span>
<span class="householdNames" v-if="item.householdName == 1">户主</span>
<span class="householdNames" v-else>
{{ $dict.getLabel('householdRelation', item.householdName) }}
</span>
</div>
<div class="rightTop-rights">
<u-section :show-line="false" sub-title="详情"></u-section>
</div>
</div>
<div class="rightBottom">
<span>身份证号</span>
<span>{{ item.idNumber.replace(/^(\w{6})\w{8}(.*)$/, '$1****$2') }}</span>
</div>
</div>
</div>
</div>
<AiEmpty v-else></AiEmpty>
</div>
</div>
</template>
<script>
export default {
name: 'DetailCard',
components: {},
props: {},
data() {
return {
id: '',
data: [],
currentAreaName: '',
}
},
computed: {},
watch: {},
onLoad(o) {
this.id = o.id
this.$dict.load('householdRelation').then(() => {
this.getDetail()
})
},
onShow() {},
methods: {
getDetail() {
this.$http.post(`/app/appresident/detail?id=${this.id}`).then((res) => {
if (res.code == 0) {
this.data = res.data
this.$nextTick(() => {
this.currentAreaName = res.data.resident.currentAreaName
})
}
})
},
toDetailPeople(item) {
uni.navigateTo({ url: `./DetailPeople?id=${item.id}` })
},
},
}
</script>
<style scoped lang="scss">
.DetailCard {
height: 100%;
.top {
height: 112px;
background: #3975c6;
}
.middle {
margin: -80px 32px 0 32px;
padding: 38px 30px 78px 28px;
background: #ffffff;
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.02);
border-radius: 16px;
z-index: 999;
.hint {
font-size: 32px;
font-weight: 500;
color: #333333;
}
.areaHint {
margin-top: 38px;
span {
margin-left: 14px;
}
}
}
.bottom {
margin: 32px 30px 48px 30px;
background: #fff;
padding: 38px 30px 30px 30px;
.hints {
margin-bottom: 38px;
}
.card {
display: flex;
box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.08);
border-radius: 16px;
padding: 48px 32px;
.photos {
img {
width: 96px;
height: 96px;
border-radius: 50%;
}
}
.right {
display: flex;
flex-direction: column;
margin-left: 40px;
width: 100%;
.rightTop {
display: flex;
justify-content: space-between;
.rightTop-lefts {
.names {
font-size: 32px;
font-weight: 600;
}
.householdNames {
margin-left: 30px;
font-size: 26px;
font-weight: 500;
color: #5aad6a;
}
}
.rightTop-rights {
::v-deep .u-section {
.u-section__right-info {
color: #3975c6 !important;
.u-section__right-info__icon-arrow {
.u-icon {
.u-icon__icon {
color: #3975c6 !important;
}
}
}
}
}
}
}
.rightBottom {
margin-top: 20px;
}
}
}
}
}
</style>

View File

@@ -0,0 +1,44 @@
<template>
<div class="DetailPeople">DetailPeople</div>
</template>
<script>
export default {
name: 'DetailPeople',
components: {},
props: {},
data() {
return {
id: '',
data: [],
}
},
computed: {},
watch: {},
onLoad(o) {
this.id = o.id
this.$dict.load('householdRelation').then(() => {
this.getDetail()
})
},
onShow() {},
methods: {
getDetail() {
this.$http.post(`/app/appresident/detail?id=${this.id}`).then((res) => {
if (res.code == 0) {
this.data = res.data
// this.$nextTick(() => {
// this.currentAreaName = res.data.resident.currentAreaName
// })
}
})
},
},
}
</script>
<style scoped lang="scss">
.DetailPeople {
height: 100%;
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB