2022-02-14 15:06:54 +08:00
|
|
|
<template>
|
2022-02-16 14:23:54 +08:00
|
|
|
<div class="PeopleList">
|
2022-03-17 17:02:10 +08:00
|
|
|
<AiTopFixed>
|
|
|
|
|
<div class="areatop">
|
|
|
|
|
<!-- <div>区域选择</div>
|
|
|
|
|
<AiAreaPicker v-model="areaId" :areaId="user.areaId" @select="seachObj"></AiAreaPicker>
|
|
|
|
|
<u-icon name="photo"></u-icon> -->
|
|
|
|
|
<!-- @select="areaSelect" -->
|
|
|
|
|
<u-form label-width="auto">
|
|
|
|
|
<u-form-item label="区域选择" right-icon="arrow-right" class="areaIds">
|
|
|
|
|
<AiAreaPicker v-model="areaId" :areaId="user.areaId" @select="seachObj"
|
|
|
|
|
:name.sync="areaName"></AiAreaPicker>
|
|
|
|
|
</u-form-item>
|
|
|
|
|
</u-form>
|
|
|
|
|
</div>
|
2022-02-14 15:06:54 +08:00
|
|
|
|
2022-03-17 17:02:10 +08:00
|
|
|
<div class="line"></div>
|
2022-02-14 15:06:54 +08:00
|
|
|
|
2022-03-17 17:02:10 +08:00
|
|
|
<u-tabs :list="tabList" :is-scroll="false" :current="currentTabs" height="96" @change="change"></u-tabs>
|
2022-02-14 15:06:54 +08:00
|
|
|
|
2022-03-17 17:02:10 +08:00
|
|
|
<div class="seachObjs">
|
|
|
|
|
<u-search v-model="keyword" :clearabled="true" placeholder="姓名/联系方式/身份证后6位" :show-action="false"
|
|
|
|
|
bg-color="#F5F5F5" search-icon-color="#E2E8F1" color="#666" height="58" @search="handerSearch"
|
|
|
|
|
@clear="handerClear"></u-search>
|
|
|
|
|
</div>
|
|
|
|
|
</AiTopFixed>
|
2022-02-14 15:06:54 +08:00
|
|
|
<div class="dataes" v-if="datas.length > 0">
|
|
|
|
|
<div class="datass" v-for="(item, iindex) in datas" :key="iindex" @click="toDetailCard(item)">
|
|
|
|
|
<div class="left">
|
2022-03-17 17:02:10 +08:00
|
|
|
<img :src="item.photo" alt="" v-if="item.photo"/>
|
|
|
|
|
<img src="./components/img/4.png" alt="" v-else/>
|
2022-02-14 15:06:54 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="right">
|
2022-03-15 09:18:12 +08:00
|
|
|
<div class="rightTop">
|
|
|
|
|
<span class="name">{{ item.name }}</span>
|
2022-03-15 14:02:30 +08:00
|
|
|
<span class="btn" v-if="user.id == item.createUserId">
|
2022-03-15 09:18:12 +08:00
|
|
|
<img src="./components/img/edit-icon.png" alt="" @click.stop="edit(item.id)">
|
|
|
|
|
<img src="./components/img/del-icon.png" alt="" @click.stop="del(item.id)">
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
2022-02-14 15:06:54 +08:00
|
|
|
<div class="rightBottom">
|
|
|
|
|
<span>{{ item.idNumber.replace(/^(\w{6})\w{8}(.*)$/, '$1********$2') }}</span>
|
|
|
|
|
|
|
|
|
|
<span>{{ item.phone }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2022-03-15 09:18:12 +08:00
|
|
|
<div class="empty" v-else>
|
|
|
|
|
<img src="https://cdn.cunwuyun.cn/dvcp/h5/no-data.png" alt="">
|
|
|
|
|
<p>暂无居民信息<br/>点击<span @click="edit('')">新增按钮</span>新增居民信息,也可在管理系统批量导入</p>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- <AiEmpty class="emptyWrap" v-else></AiEmpty> -->
|
2022-03-14 16:41:48 +08:00
|
|
|
<div style="height: 60px"></div>
|
2022-03-15 09:18:12 +08:00
|
|
|
<div class="addBtn" @click="edit('')">新增居民</div>
|
2022-02-14 15:06:54 +08:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2022-03-17 17:02:10 +08:00
|
|
|
import {mapState} from 'vuex'
|
2022-02-14 15:06:54 +08:00
|
|
|
|
|
|
|
|
export default {
|
2022-02-16 14:23:54 +08:00
|
|
|
name: 'PeopleList',
|
2022-02-14 15:06:54 +08:00
|
|
|
props: {},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
keyword: '',
|
|
|
|
|
datas: [],
|
|
|
|
|
current: 1,
|
|
|
|
|
size: 10,
|
|
|
|
|
tabList: [
|
2022-02-22 11:41:21 +08:00
|
|
|
{
|
|
|
|
|
name: '全部居民',
|
|
|
|
|
},
|
2022-02-14 15:06:54 +08:00
|
|
|
{
|
|
|
|
|
name: '本地居民',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '流动人员',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
currentTabs: 0,
|
|
|
|
|
areaId: '',
|
|
|
|
|
areaName: '',
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
...mapState(['user']),
|
|
|
|
|
},
|
|
|
|
|
watch: {},
|
|
|
|
|
onLoad() {
|
|
|
|
|
this.areaId = this.user.areaId
|
|
|
|
|
this.areaName = this.user.areaName
|
2022-03-17 17:02:10 +08:00
|
|
|
uni.$on('reload', () => {
|
2022-03-15 10:27:34 +08:00
|
|
|
this.current = 1
|
2022-03-14 16:41:48 +08:00
|
|
|
this.getList()
|
|
|
|
|
})
|
2022-02-14 15:06:54 +08:00
|
|
|
this.getList()
|
|
|
|
|
},
|
|
|
|
|
onShow() {
|
2022-02-22 11:53:39 +08:00
|
|
|
document.title = '查看居民档案'
|
2022-02-14 15:06:54 +08:00
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
getList() {
|
2022-02-22 11:41:21 +08:00
|
|
|
var residentType = ['', 0, 1][this.currentTabs]
|
2022-02-14 15:06:54 +08:00
|
|
|
this.$http
|
2022-03-17 17:02:10 +08:00
|
|
|
.post('/app/appresident/list', null, {
|
|
|
|
|
params: {
|
|
|
|
|
size: 20,
|
|
|
|
|
current: this.current,
|
|
|
|
|
con: this.keyword,
|
|
|
|
|
areaId: this.areaId,
|
|
|
|
|
residentType: residentType,
|
|
|
|
|
auditStatus: 1
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
.then((res) => {
|
|
|
|
|
if (res.code == 0) {
|
|
|
|
|
this.datas = this.current > 1 ? [...this.datas, ...res.data.records] : res.data.records
|
2022-02-14 15:06:54 +08:00
|
|
|
|
2022-03-17 17:02:10 +08:00
|
|
|
this.pages = res.data.pages
|
|
|
|
|
}
|
|
|
|
|
})
|
2022-02-14 15:06:54 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
change(index) {
|
|
|
|
|
this.currentTabs = index
|
|
|
|
|
this.current = 1
|
|
|
|
|
this.datas = []
|
|
|
|
|
this.getList()
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
toDetailCard(item) {
|
2022-03-17 17:02:10 +08:00
|
|
|
uni.navigateTo({url: `./DetailCard?id=${item.id}`})
|
2022-02-14 15:06:54 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
seachObj(e) {
|
|
|
|
|
this.areaId = e
|
|
|
|
|
this.current = 1
|
|
|
|
|
this.getList()
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
handerSearch(e) {
|
|
|
|
|
this.keyword = e
|
|
|
|
|
this.current = 1
|
|
|
|
|
this.getList()
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
handerClear() {
|
|
|
|
|
this.keyword = ''
|
|
|
|
|
this.current = 1
|
|
|
|
|
this.getList()
|
|
|
|
|
},
|
2022-03-15 09:18:12 +08:00
|
|
|
edit(id) {
|
2022-03-14 18:27:52 +08:00
|
|
|
var residentType = ['', 0, 1][this.currentTabs]
|
2022-03-15 09:18:12 +08:00
|
|
|
uni.navigateTo({url: `./Add?id=${id}&type=${residentType}`})
|
|
|
|
|
},
|
|
|
|
|
del(id) {
|
|
|
|
|
this.$confirm('确定删除该数据?').then(() => {
|
|
|
|
|
uni.showLoading()
|
|
|
|
|
this.$http.post(`/app/appresident/delete?ids=${id}`).then((res) => {
|
|
|
|
|
if (res.code == 0) {
|
|
|
|
|
this.$u.toast('删除成功!')
|
|
|
|
|
this.current = 1
|
|
|
|
|
this.getList()
|
|
|
|
|
}
|
|
|
|
|
uni.hideLoading()
|
|
|
|
|
})
|
2022-03-17 17:02:10 +08:00
|
|
|
}).catch(() => {
|
|
|
|
|
})
|
2022-03-14 16:41:48 +08:00
|
|
|
}
|
2022-02-14 15:06:54 +08:00
|
|
|
},
|
|
|
|
|
onReachBottom() {
|
|
|
|
|
this.current = this.current + 1
|
|
|
|
|
this.getList()
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
2022-02-16 14:23:54 +08:00
|
|
|
.PeopleList {
|
2022-02-14 15:06:54 +08:00
|
|
|
height: 100%;
|
2022-03-17 17:02:10 +08:00
|
|
|
|
2022-02-14 15:06:54 +08:00
|
|
|
.areatop {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
align-items: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.line {
|
|
|
|
|
height: 16px;
|
|
|
|
|
background: #f5f5f5;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.seachObjs {
|
|
|
|
|
border-bottom: 2px solid #f5f5f5;
|
|
|
|
|
border-top: 2px solid #f5f5f5;
|
|
|
|
|
padding: 20px 32px;
|
|
|
|
|
background: #fff;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
::v-deep .u-form {
|
|
|
|
|
width: 100%;
|
2022-03-17 17:02:10 +08:00
|
|
|
|
2022-02-14 15:06:54 +08:00
|
|
|
.areaIds {
|
|
|
|
|
.u-form-item__body {
|
|
|
|
|
.u-form-item--right {
|
|
|
|
|
.u-form-item--right__content {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
2022-03-17 17:02:10 +08:00
|
|
|
|
2022-02-14 15:06:54 +08:00
|
|
|
.u-form-item--right__content__slot {
|
|
|
|
|
.AiAreaPicker {
|
|
|
|
|
width: 100%;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: flex-end;
|
2022-03-17 17:02:10 +08:00
|
|
|
|
2022-02-14 15:06:54 +08:00
|
|
|
.areaSelector {
|
|
|
|
|
.location {
|
|
|
|
|
opacity: 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-03-17 17:02:10 +08:00
|
|
|
|
2022-02-14 15:06:54 +08:00
|
|
|
.u-form-item--right__content__icon {
|
|
|
|
|
margin-bottom: 8px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.dataes {
|
|
|
|
|
background: #fff;
|
2022-03-17 17:02:10 +08:00
|
|
|
|
2022-02-14 15:06:54 +08:00
|
|
|
.datass {
|
|
|
|
|
display: flex;
|
|
|
|
|
padding: 24px 32px;
|
2022-03-17 17:02:10 +08:00
|
|
|
|
2022-02-14 15:06:54 +08:00
|
|
|
.left {
|
|
|
|
|
img {
|
|
|
|
|
width: 80px;
|
|
|
|
|
height: 80px;
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-03-17 17:02:10 +08:00
|
|
|
|
2022-02-14 15:06:54 +08:00
|
|
|
.right {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
margin-left: 32px;
|
|
|
|
|
width: 100%;
|
2022-03-17 17:02:10 +08:00
|
|
|
|
2022-02-14 15:06:54 +08:00
|
|
|
.rightTop {
|
|
|
|
|
font-size: 32px;
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
color: #333333;
|
2022-03-15 09:18:12 +08:00
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
2022-03-17 17:02:10 +08:00
|
|
|
|
|
|
|
|
.btn {
|
|
|
|
|
img {
|
2022-03-15 09:18:12 +08:00
|
|
|
width: 48px;
|
|
|
|
|
height: 48px;
|
|
|
|
|
margin-left: 40px;
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-02-14 15:06:54 +08:00
|
|
|
}
|
2022-03-17 17:02:10 +08:00
|
|
|
|
2022-02-14 15:06:54 +08:00
|
|
|
.rightBottom {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
margin-top: 8px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.emptyWrap {
|
|
|
|
|
background: #f5f5f5;
|
|
|
|
|
margin: 0;
|
|
|
|
|
}
|
2022-03-17 17:02:10 +08:00
|
|
|
|
2022-03-14 16:41:48 +08:00
|
|
|
.addBtn {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 112px;
|
|
|
|
|
line-height: 112px;
|
|
|
|
|
background: #1365DD;
|
|
|
|
|
text-align: center;
|
|
|
|
|
color: #FFF;
|
|
|
|
|
font-size: 32px;
|
|
|
|
|
position: fixed;
|
|
|
|
|
bottom: 0;
|
|
|
|
|
}
|
2022-03-17 17:02:10 +08:00
|
|
|
|
|
|
|
|
.empty {
|
2022-03-15 09:18:12 +08:00
|
|
|
height: 100%;
|
2022-03-17 17:02:10 +08:00
|
|
|
|
|
|
|
|
img {
|
2022-03-15 09:18:12 +08:00
|
|
|
width: 282px;
|
|
|
|
|
height: 306px;
|
|
|
|
|
margin: 168px 0 0 234px;
|
|
|
|
|
}
|
2022-03-17 17:02:10 +08:00
|
|
|
|
|
|
|
|
p {
|
2022-03-15 09:18:12 +08:00
|
|
|
text-align: center;
|
|
|
|
|
font-size: 28px;
|
|
|
|
|
font-family: PingFangSC-Regular, PingFang SC;
|
|
|
|
|
color: #999;
|
|
|
|
|
line-height: 44px;
|
2022-03-17 17:02:10 +08:00
|
|
|
|
|
|
|
|
span {
|
2022-03-15 09:18:12 +08:00
|
|
|
color: #467DFE;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-02-14 15:06:54 +08:00
|
|
|
}
|
|
|
|
|
</style>
|