Files
dvcp_v2_wxcp_app/src/apps/AppMonitoringObject/AppMonitoringObject.vue

381 lines
8.4 KiB
Vue
Raw Normal View History

2022-03-24 11:17:05 +08:00
<template>
<div class="AppMonitoringObject">
2022-04-29 18:00:47 +08:00
<div v-if="isAdmin">
<AiTopFixed>
<!-- <div class="area">
<i>可选范围</i>
<span class="separat">/</span>
<AiAreaPicker ref="area" class="aiArea" :value="areaId" :areaId="user.areaId" :name.sync="areaName" mode="custom"
@select="seachObj">
<span class="label" v-if="areaName">{{ areaName }}</span>
<i v-else>请选择</i>
</AiAreaPicker>
</div>
<div class="line"></div> -->
<u-tabs :list="tabList" :is-scroll="false" :current="currentTabs" height="96" bar-width="150" @change="change"></u-tabs>
<div class="seach-obj">
<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>
</AiTopFixed>
<div class="list-data" v-if="list.length > 0">
<div class="item" v-for="(item, iindex) in list" :key="iindex" @click="toDetail(item)">
<div class="left">
<img :src="item.photo" alt="" v-if="item.photo"/>
<img src="./components/img/user-img.png" alt="" v-else/>
</div>
<div class="right">
<div class="right-top">
<span class="name">{{ item.name }}</span>
<span class="status" :class="`status${item.status}`">{{ $dict.getLabel('fpPrtpStatus', item.status) }}</span>
</div>
<div class="right-bottom">
<p>{{ item.idNumber || '' }}</p>
<p>{{ item.countyName + item.townName + item.villageName }}{{ item.currentAddress || '' }}</p>
</div>
</div>
</div>
</div>
<AiEmpty class="emptyWrap" v-else></AiEmpty>
<AiFixedBtn v-if="checkType == 1">
<div class="addBtn iconfont iconfont-iconfangda" @tap="toAdd"></div>
</AiFixedBtn>
</div>
<div v-else class="empty">
<img src="https://cdn.cunwuyun.cn/dvcp/h5/no-admin.png" alt="">
<p>没有网格员权限<br/>无法查看监测信息哦~</p>
</div>
2022-03-24 11:17:05 +08:00
</div>
</template>
<script>
2022-04-29 18:00:47 +08:00
import {mapState} from "vuex";
2022-03-24 11:17:05 +08:00
export default {
name: 'AppMonitoringObject',
appName: '监测对象',
data() {
return {
2022-04-29 18:00:47 +08:00
keyword: '',
list: [],
current: 1,
size: 10,
tabList: [
{
name: '已登记监测对象',
},
{
name: '已消除风险对象',
},
],
currentTabs: 0,
areaId: '',
areaName: '',
isAdmin: false,
checkType: ''
2022-03-24 11:17:05 +08:00
}
},
2022-04-29 18:00:47 +08:00
computed: {
...mapState(['user']),
},
2022-03-24 11:17:05 +08:00
onShow() {
2022-04-29 18:00:47 +08:00
document.title = '监测对象'
this.areaId = this.user.areaId
this.areaName = this.user.areaName
this.$dict.load('fpPrtpStatus').then(() => {
this.isGirdUser()
})
uni.$on('reload', () => {
this.getListInit()
})
},
methods: {
isGirdUser() {
this.isAdmin = false
this.$http.post('/app/appgirdmemberinfo/checkLogOnUser').then((res) => {
2022-04-29 19:55:45 +08:00
if (res?.data) {
2022-04-29 18:00:47 +08:00
if (res.data.checkType != '0') {
this.isAdmin = true
this.checkType = res.data.checkType
this.getList()
}
}
})
},
getListInit() {
this.current = 1
this.list = []
this.getList()
},
getList() {
this.$http.post('/app/appgirdmemberpoverty/listByGirdMember', null, {
params: {
current: this.current,
size: 15,
status: this.currentTabs,
// addressAreaId: this.areaId,
name: this.keyword
},
})
.then((res) => {
if (res.code == 0) {
res.data.records.map((item) => {
if (item.idNumber) {
item.idNumber = item.idNumber.replace(/^(\w{6})\w{8}(.*)$/, '$1********$2')
}
})
this.list = this.current > 1 ? [...this.list, ...res.data.records] : res.data.records
this.pages = res.data.pages
}
})
},
change(index) {
this.currentTabs = index
this.getListInit()
},
toDetail(item) {
uni.navigateTo({url: `./Detail?id=${item.id}`})
},
seachObj(e) {
this.areaId = e
this.getListInit()
},
handerSearch(e) {
this.keyword = e
this.getListInit()
},
handerClear() {
this.keyword = ''
this.getListInit()
},
toAdd() {
uni.navigateTo({url: './Add'})
}
},
onReachBottom() {
this.current++
this.getList()
2022-03-24 11:17:05 +08:00
},
}
</script>
<style lang="scss" scoped>
.AppMonitoringObject {
height: 100%;
2022-04-29 18:00:47 +08:00
.area {
display: flex;
align-items: center;
width: 100%;
padding: 0 32px;
height: 112px;
color: #333333;
font-size: 30px;
background: #fff;
box-sizing: border-box;
.separat {
padding: 0 8px;
}
i {
color: #3F8DF5;
font-size: 30px;
font-style: normal;
}
span {
color: #333333;
font-size: 30px;
}
}
.line {
height: 16px;
background: #f5f5f5;
}
.seach-obj {
border-bottom: 2px solid #f5f5f5;
border-top: 2px solid #f5f5f5;
padding: 20px 32px;
background: #fff;
}
::v-deep .u-form {
width: 100%;
.areaIds {
.u-form-item__body {
.u-form-item--right {
.u-form-item--right__content {
display: flex;
align-items: center;
.u-form-item--right__content__slot {
.AiAreaPicker {
width: 100%;
display: flex;
justify-content: flex-end;
.areaSelector {
.location {
opacity: 0;
}
}
}
}
.u-form-item--right__content__icon {
margin-bottom: 8px;
}
}
}
}
}
}
.list-data {
background: #fff;
.item {
display: flex;
padding: 24px 0 0 32px;
box-sizing: border-box;
.left {
img {
width: 80px;
height: 80px;
border-radius: 50%;
}
}
.right {
display: flex;
flex-direction: column;
margin-left: 32px;
width: 100%;
border-bottom: 2px solid #E4E5E6;
padding-right: 32px;
.right-top {
font-size: 36px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #333;
line-height: 44px;
display: flex;
justify-content: space-between;
margin-bottom: 8px;
.status {
font-size: 26px;
font-family: PingFangSC-Regular, PingFang SC;
line-height: 36px;
}
.status0 {
color: #F82;
}
.status1 {
color: #3975C6;
}
.status2, .status4 {
color: #F46;
}
.status3 {
color: #2EA222;
}
}
.right-bottom {
p {
font-size: 26px;
font-family: PingFangSC-Regular, PingFang SC;
color: #999;
line-height: 36px;
word-break: break-all;
margin-bottom: 16px;
}
p:nth-of-type(1) {
margin-bottom: 16px;
}
}
}
}
}
.emptyWrap {
margin: 0;
}
::v-deep .AiTopFixed .content {
padding: 0;
}
::v-deep .u-tab-bar {
bottom: -6px !important;
}
.addBtn {
width: 96px;
height: 96px;
flex-shrink: 0;
background: $uni-color-primary;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
font-size: 48px;
color: #fff;
border-radius: 50%;
justify-content: center;
align-items: center;
display: flex;
}
.empty {
text-align: center;
img {
width: 282px;
height: 306px;
margin: 136px auto 0;
}
p {
font-size: 28px;
font-family: PingFangSC-Regular, PingFang SC;
color: #999;
line-height: 40px;
}
.add-btn {
width: 400px;
height: 88px;
line-height: 88px;
text-align: center;
border-radius: 8px;
background-color: #3267f0;
color: #fff;
font-size: 30px;
margin: 200px auto 0;
}
}
::v-deep .u-search {
margin-bottom: 0 !important;
}
2022-03-24 11:17:05 +08:00
}
</style>