卡口登记

This commit is contained in:
liuye
2022-09-21 16:15:58 +08:00
parent 84386707b1
commit 2ff5bc1c3c
12 changed files with 571 additions and 836 deletions

View File

@@ -3,22 +3,19 @@
<AiTopFixed>
<div class="header">
<div class="tab-item">
<h2 style="color: #5aad6a">{{ userList.today }}</h2>
<h2 style="color:#5AAD6A;">{{totalInfo.today}}</h2>
<p>今日返乡</p>
</div>
<div class="tab-item">
<h2 style="color: #f5a319">{{ userList.unReport }}</h2>
<h2 style="color:#F5A319;">{{totalInfo.todayUnusual}}</h2>
<p>今日风险</p>
</div>
<div class="tab-item">
<h2 style="color: #2c51ce">{{ userList.total }}</h2>
<div class="tab-item">
<h2 style="color:#CD413A;border-right:0;">{{totalInfo.release}}</h2>
<p>风险处理</p>
</div>
</div>
<div class="line1"></div>
<div class="middle">
<div class="search">
<div class="left">
<AiAreaPicker v-model="areaId" :areaId="user.areaId" @select="areaSelect" :name.sync="areaName" style="color: #666" selectRoot>
<u-icon name="map-fill" color="#3192F4" size="20px" style="vertical-align: text-bottom"></u-icon>
@@ -27,50 +24,23 @@
<u-icon name="arrow-down" color="#666" size="28" style="margin-left: 4px" />
</AiAreaPicker>
</div>
<u-search v-model="keyword" :clearabled="true" placeholder="请输入姓名/身份证号" :show-action="false" bg-color="#F5F5F5" search-icon-color="#999" color="#999" height="58" @search="handerSearch" @clear="handerClear"></u-search>
<u-search v-model="name" :clearabled="true" placeholder="请输入姓名" :show-action="false" bg-color="#F5F5F5" search-icon-color="#999" color="#999" height="58" @search="getListInit" @clear="name='',getListInit"></u-search>
</div>
<div class="tab-select">
<div class="item" :class="!tabIndex ? 'active' : ''" @click="tabClick(0)">返乡人员<span></span></div>
<div class="item" :class="tabIndex ? 'active' : ''" @click="tabClick(1)">异常人员<span></span></div>
</div>
<div class="line2"></div>
<u-tabs :list="tabList" :is-scroll="false" :current="currentTabs" height="96" bg-color="#fff" inactive-color="#333" bar-width="192" active-color="#135AB8 " @change="change"></u-tabs>
<div class="line3"></div>
</AiTopFixed>
<div class="bottoms">
<template v-if="data.length">
<div class="templates" v-for="(item, i) in data" :key="i" @click="goDetail(item)">
<img :src="item.avatar" alt="" v-if="item.avatar" />
<img src="./components/img/user-img.png" alt="" v-else />
<div class="rightCont">
<div class="rightContLeft">
<div class="nameLeft">
<div class="nameTop">
<div class="names">{{ item.name }}</div>
<div class="types" v-if="item.status == '0'">异常</div>
</div>
<div class="nameBottom">
登记时间: 2022-05-19
</div>
</div>
<div style="padding-right: 8px;">
<div class="day-info"><span>7</span>/14</div>
<div class="typeRight2" v-if="item.today == '0'">今日未上报</div>
<div class="typeRight1" v-else>今日已上报</div>
</div>
</div>
<u-icon name="arrow-right" color="#ccc"></u-icon>
</div>
</div>
</template>
<AiEmpty description="暂无数据" class="emptyWrap" v-else></AiEmpty>
<div class="user-list">
<div class="item" @click="toUser(item)" v-for="(item,index) in list" :key="index">
<h2 class="name">{{item.name}}<span class="status" v-if="item.status == 0">有异常</span></h2>
<p class="color-999">{{item.idNumber}}</p>
<p><img src="./components/img/org-icon.png" alt=""><span class="start-name">{{item.startAreaName}}</span></p>
<p><img src="./components/img/blue-icon.png" alt=""><span class="start-name">{{item.arriveAreaName}}</span></p>
<p><img src="./components/img/time-icon.png" alt="">{{item.arriveTime}}</p>
</div>
</div>
<AiEmpty v-if="!list.length"></AiEmpty>
</div>
</template>
@@ -78,141 +48,94 @@
import { mapState } from 'vuex'
export default {
appName: '卡口登记',
name: 'AppCheckpointRegistration',
appName: '卡口登记',
data() {
return {
keyword: '',
areaId: '',
areaName: '',
tabIndex: 0,
current: 1,
size: 10,
tabList: [
{
name: '返乡人员',
},
{
name: '异常人员',
},
],
currentTabs: 0,
userList: [],
data: [{name: '123'}],
list: [],
name: '',
totalInfo: {}
}
},
computed: {
...mapState(['user']),
},
watch: {},
onLoad() {
computed: { ...mapState(['user']) },
created() {
this.areaId = this.user.areaId
this.areaName = this.user.areaName
// this.getList()
// this.getUserList()
uni.$on('updateLists', () => {
this.current = 1
this.getList()
this.getUserList()
})
},
onShow() {
document.title = '卡口登记'
this.getList()
this.getTotal()
uni.$on('updateList', () => {
this.getListInit()
})
},
methods: {
getList() {
this.$http
.post('/app/appepidemicreportmember/list', null, {
params: { size: this.size, current: this.current, status: this.currentTabs == 1 ? '0' : '', areaId: this.areaId, name: this.keyword },
})
.then((res) => {
if (res.code == 0) {
this.data = this.current > 1 ? [...this.data, ...res.data.records] : res.data.records
this.$forceUpdate()
}
})
.catch(() => {
this.$forceUpdate()
})
.finally(() => {
this.$forceUpdate()
})
areaSelect(e) {
this.areaId =e
this.$nextTick(() => {
this.getListInit()
})
this.getTotal()
},
getUserList() {
this.$http.post(`/app/appepidemicreportmember/statistic?areaId=${this.areaId}`).then((res) => {
tabClick(index) {
this.tabIndex = index
this.getListInit()
},
getListInit() {
this.current = 1
this.list = []
this.getList()
},
getList() {
var status = ''
if(this.tabIndex == 1) {
status = 0
}
this.$http.post(`/app/appepidemicbackhomerecord/list?current=${this.current}&size=10&status=${status}&name=${this.name}&arriveAreaId=${this.areaId}`)
.then((res) => {
if (res.code == 0) {
this.userList = res.data
res.data.records.map((item) => {
item.idNumber = item.idNumber.replace(/(.{6}).*(.{4})/,"$1********$2")
})
this.list = this.current > 1 ? [...this.list, ...res.data.records] : res.data.records
}
})
},
goDetail(item) {
uni.navigateTo({
url: `./Detail?id=${item.id}&diffNum=${item.diffNum}&today=${item.today}`,
getTotal() {
this.$http.post(`/app/appepidemicbackhomerecord/statistic?areaId=${this.areaId}`).then((res) => {
if (res.code == 0) {
this.totalInfo = res.data
}
})
},
areaSelect(e) {
this.areaId = e
this.getList()
this.getUserList()
},
change(index) {
this.data = []
// this.areaId = this.user.areaId
this.keyword = ''
this.currentTabs = index
this.current = 1
this.getList()
},
handerSearch(e) {
this.keyword = e
this.current = 1
this.getList()
},
handerClear() {
this.keyword = ''
this.current = 1
this.getList()
},
toUser(row) {
uni.navigateTo({url: `./UserInfo?id=${row.id}`})
}
},
onReachBottom() {
this.current++
this.current ++
this.getList()
},
}
}
</script>
<style scoped lang="scss">
<style lang="scss" scoped>
.AppCheckpointRegistration {
height: 100%;
::v-deep .AiTopFixed {
.placeholder {
.content {
padding: 0 !important;
}
}
.fixed {
margin: 0 !important;
.content {
padding: 0 !important;
}
}
}
.header {
.header{
padding: 54px 32px 48px 32px;
display: flex;
background-color: #fff;
margin-bottom: 4px;
.tab-item {
.tab-item{
flex: 1;
text-align: center;
h2 {
h2{
font-size: 52px;
font-family: DINAlternate-Bold, DINAlternate;
font-weight: bold;
@@ -222,7 +145,7 @@ export default {
border-right: 1px solid #ddd;
line-height: 44px;
}
p {
p{
font-size: 28px;
font-family: PingFangSC-Regular, PingFang SC;
color: #999;
@@ -231,121 +154,105 @@ export default {
}
}
.tab-item:nth-last-of-type(1) {
h2 {
border-right: 0;
}
border-right: 0;
}
}
.line1 {
height: 4px;
background: #f5f5f5;
}
.middle {
.search{
width: 100%;
height: 112px;
padding: 32px;
box-sizing: border-box;
background: #FFF;
display: flex;
padding: 24px 32px;
.left {
width: 40%;
display: flex;
align-items: center;
img {
width: 48px;
height: 48px;
}
}
.u-search {
margin-bottom: 0 !important;
margin-bottom: 8px;
.left{
width: calc(100% - 402px);
}
}
.line2 {
height: 8px;
background: #f5f5f5;
}
.line3 {
height: 6px;
background: #f5f5f5;
}
.bottoms {
.templates {
display: flex;
align-items: center;
padding: 32px;
box-shadow: inset 0px -1px 0px 0px #dddddd;
background: #fff;
img {
width: 128px;
height: 128px;
// border-radius: 50%;
// border: 1px solid #cccccc;
.tab-select{
width: 100%;
height: 96px;
background: #FFF;
display: flex;
margin-bottom: 4px;
.item{
flex: 1;
font-size: 32px;
line-height: 96px;
font-family: PingFangSC-Regular, PingFang SC;
color: #333;
text-align: center;
}
.active{
color: #135AB8;
position: relative;
span{
position: absolute;
bottom: 0;
left: 50%;
width: 192px;
margin-left: -96px;
border-bottom: 4px solid #135AB8;
}
.rightCont {
display: flex;
justify-content: space-between;
margin-left: 32px;
width: 100%;
.rightContLeft {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
.nameLeft {
.nameTop {
display: flex;
.names {
font-size: 32px;
font-weight: 500;
color: #333333;
}
.types {
margin-left: 16px;
padding: 4px 16px 8px 16px;
background: #faeceb;
border-radius: 20px;
font-size: 24px;
color: #cd413a;
}
}
.nameBottom {
margin-top: 12px;
font-size: 28px;
color: #999999;
.num {
color: #135ab8;
}
}
}
.typeRight1 {
font-size: 28px;
color: #999999;
}
.typeRight2 {
font-size: 28px;
color: #f5a319;
}
.day-info{
font-size: 32px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
line-height: 44px;
margin-bottom: 12px;
text-align: right;
span{
color: #5AAD6A;
}
}
}
}
.user-list{
background-color: #f5f5f5;
.item{
padding: 32px 64px 24px;
background-color: #fff;
margin-bottom: 8px;
.name{
font-size: 36px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #333;
line-height: 50px;
margin-bottom: 8px;
.status{
float: right;
font-size: 28px;
font-family: PingFangSC-Regular, PingFang SC;
color: #FF4466;
line-height: 40px;
}
}
p{
font-size: 28px;
font-family: PingFangSC-Regular, PingFang SC;
color: #333;
line-height: 40px;
margin-bottom: 8px;
img{
width: 32px;
height: 32px;
margin-right: 18px;
vertical-align: top;
}
}
.start-name{
display: inline-block;
width: calc(100% - 50px);
}
.color-999{
margin-bottom: 24px;
color: #999;
}
}
}
::v-deep .AiTopFixed {
.placeholder {
.content {
padding: 0 !important;
.emptyWrap {
margin-top: 0;
background: #f5f5f5;
}
}
.fixed {
margin: 0 !important;
background-color: #f5f5f5!important;
.content {
padding: 0 !important;
}
}
}
}