Files
dvcp_v2_wxcp_app/src/project/pingchang/AppCommunityManagement/AppCommunityManagement.vue
2022-11-15 15:21:41 +08:00

309 lines
8.6 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<div class="AppCommunityManagement">
<AiTopFixed>
<u-tabs :list="tabList" :is-scroll="false" :current="currentTabs" height="96" bg-color="#3975C6"
inactive-color="#A1C1E8" :bar-style="barStyle" :active-item-style="activeStyle" active-color="#ffffff " @change="change">
</u-tabs>
<div class="top-search">
<u-search v-model="keyword" :clearabled="true" placeholder="请输入姓名/手机号/身份证号" :show-action="false" bg-color="#F5F5F5"
search-icon-color="#999" color="#999" height="58" @search="getListInit" @clear="getListInit">
</u-search>
</div>
<div class="top-select">
<div class="item">
<AiAreaPicker v-model="areaId" :areaId="cropAreaId" @select="areaSelect" :name.sync="areaName" style="color: #666" selectRoot>
<span style="margin-left: 4px" v-if="areaName">{{ areaName }}</span>
<span v-else style="color:#999;">地区选择</span>
<u-icon name="arrow-down" color="#666" size="28" style="margin-left: 4px" />
</AiAreaPicker>
</div>
<!-- <div class="item" @click="showTypeSelect=true">
<span v-if="infoType === ''" style="color:#999;">数据类型</span>
<span v-else>{{ $dict.getLabel('EP_registerInfoType', infoType) }}</span>
<u-icon name="arrow-down" color="#666" size="28" style="margin-left: 4px" />
</div> -->
</div>
</AiTopFixed>
<div class="data-list" v-if="list && list.length">
<div class="item" v-for="(item, index) in list" :key="index" @click="toDetail(item.id)">
<div class="top">
<div class="title">
<div class="name">
{{item.name}}
<!-- <span class="type">{{$dict.getLabel('EP_registerInfoType', item.infoType)}}</span> -->
</div>
<div class="status" :class="item.nucleicAcidSamplingCount >0 ? 'status1' : 'status0'">
<span class="cir"></span>
<span v-if="item.nucleicAcidSamplingCount >0">核酸采样{{item.nucleicAcidSamplingCount}}</span>
<span v-else>核酸未采样</span>
</div>
</div>
<p> {{item.idNumberText}}</p>
<p> {{item.phone}}</p>
<div class="btn" v-if="item.status != 2" @click.stop="toEdit(item.id)">排查</div>
<img src="./components/img/status-img.png" alt="" class="status-img" v-else>
</div>
<div class="bottom">
<div class="text">管控人<span> {{item.controllerUserName}}</span> {{item.createTime}}</div>
</div>
</div>
</div>
<AiEmpty description="暂无数据" class="emptyWrap" v-else></AiEmpty>
<u-select v-model="showTypeSelect" :list="registerTypeList" label-name="dictName" value-name="dictValue" @confirm="typeConfirm"></u-select>
</div>
</template>
<script>
import { mapState } from 'vuex'
export default {
appName: '社区管理',
data() {
return {
areaId: '',
areaName: '',
current: 1,
keyword: '',
currentTabs: 0,
infoType: '',
showTypeSelect: false,
tabList: [
{
name: '待管理',
},
{
name: '已管理',
},
{
name: '已解除',
},
],
barStyle: {
'width': '24px',
'height': '2px',
'border-radius': '0',
'bottom': '5px'
},
activeStyle: {
'font-weight' : '400',
},
list: [],
registerTypeList: [],
cropAreaId: ''
}
},
computed: {
...mapState(['user']),
},
onLoad() {
// this.areaId = this.user.areaId
// this.areaName = this.user.areaName
this.$dict.load('EP_CM_status', 'EP_registerInfoType').then(() => {
this.registerTypeList = this.$dict.getDict('EP_registerInfoType')
this.registerTypeList.unshift({dictValue: '', dictName: '全部'})
this.getListInit()
})
uni.$on('updateList', () => {
this.getListInit()
})
this.getCropAreaId()
},
onShow() {
document.title = '社区管理'
},
methods: {
getCropAreaId() {
this.$http.post(`/app/appdvcpconfig/getCorpArea`).then((res) => {
if (res.code == 0) {
this.areaId = res.data
this.cropAreaId = res.data
}
})
},
getListInit() {
this.current = 1
this.list = []
this.getList()
},
getList() {
this.$http.post('/app/appepidemicpreventioncommunitymanagement/list', null, {
params: { size: 10, current: this.current, status: this.currentTabs, areaId: this.areaId, name: this.keyword, infoType: this.infoType },
}).then((res) => {
if (res.code == 0) {
res.data.records.map((item) => {
item.idNumberText = item.idNumber.replace(/(.{6}).*(.{4})/,"$1********$2")
})
this.list = this.current > 1 ? [...this.list, ...res.data.records] : res.data.records
}
})
},
toDetail(id) {
uni.navigateTo({url: `./Detail?id=${id}`})
},
toEdit(id) {
uni.navigateTo({url: `./Add?id=${id}`})
},
change(index) {
this.keyword = ''
this.currentTabs = index
this.getListInit()
},
areaSelect(e) {
this.areaId = e
this.getListInit()
},
typeConfirm(e) {
this.infoType = e[0].value
this.getListInit()
}
},
onReachBottom() {
this.current++
this.getList()
},
}
</script>
<style scoped lang="scss">
.AppCommunityManagement {
height: 100%;
::v-deep .AiTopFixed {
.placeholder {
.content {
padding: 0 !important;
}
}
.fixed {
margin: 0 !important;
.content {
padding: 0 !important;
}
}
}
.top-search {
padding: 20px 32px;
}
.top-select {
display: flex;
padding: 28px 0;
.item {
flex: 1;
padding: 0 8px;
text-align: center;
span {
display: inline-block;
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 28px;
color: #666;
line-height: 40px;
}
}
}
.data-list {
padding: 32px 32px 0;
.item {
width: 100%;
background: #FFF;
border-radius: 16px;
margin-bottom: 24px;
.top {
padding: 32px 32px 24px 32px;
position: relative;
.title {
display: flex;
justify-content: space-between;
margin-bottom: 24px;
.name {
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 32px;
color: #000;
.type {
line-height: 34px;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 24px;
color: #3975C6;
padding: 2px 4px;
background-color: #F6F9F5;
margin-left: 24px;
}
}
.status {
line-height: 20px;
font-family: PingFangSC-Regular;
font-size: 28px;
.cir {
display: inline-block;
width: 8px;
height: 8px;
border-radius: 50%;
margin-right: 8px;
}
}
.status0 {
color: #FFA938;
.cir {
background-color: #FFA938;
}
}
.status0 {
color: #1CCEB0;
.cir {
background-color: #1CCEB0;
}
}
}
p {
line-height: 40px;
font-family: PingFangSC-Regular;
font-size: 28px;
color: #666;
margin-bottom: 8px;
}
.btn {
width: 160px;
height: 56px;
text-align: center;
line-height: 54px;
background: #FFF;
border: 1px solid #1365DD;
border-radius: 4px;
box-sizing: border-box;
position: absolute;
bottom: 32px;
right: 32px;
font-family: PingFangSC-Regular;
font-size: 28px;
color: #1365DD;
}
.status-img {
position: absolute;
bottom: 0;
right: 32px;
width: 160px;
height: 160px;
}
}
.bottom {
border-top: 2px solid #D8DDE6;
padding: 32px;
.text {
line-height: 40px;
font-family: PingFangSC-Regular;
font-size: 28px;
color: #666;
letter-spacing: 0.58px;
}
span {
display: inline-block;
color: #3975C6;
margin-right: 32px;
}
}
}
}
}
</style>