Files
dvcp_v2_wxcp_app/src/apps/AppEpidemicSituation/ErrorDetail.vue

367 lines
9.3 KiB
Vue
Raw Normal View History

2022-01-10 15:05:53 +08:00
<template>
2022-01-10 17:55:30 +08:00
<div class="ErrorDetail">
<div class="header">
2022-01-11 19:18:22 +08:00
<div class="name">
{{ userList.name }}<span>{{ userList.phone }}</span
><img :src="$cdn + 'common/phone.png'" alt="" @click="callPhone(userList.phone)" class="phone-icon" />
</div>
2022-01-10 17:55:30 +08:00
<p>身份证号</p>
2022-01-12 14:33:37 +08:00
<p class="mar-b8" style="color: #333">{{ userList.idNumber && userList.idNumber.replace(/^(\w{6})\w{8}(.*)$/, '$1********$2') }}</p>
2022-01-10 17:55:30 +08:00
<p>异常情况</p>
2022-01-12 09:53:32 +08:00
<div v-if="datas.length">
2022-01-12 16:37:23 +08:00
<div v-for="(item, index) in datas" :key="index" style="color: #ff4466">
<span style="color: #666" v-if="item.status == 0">{{ item.checkTime && item.checkTime.substring(0, 10) }}:</span>
2022-01-12 16:39:06 +08:00
<div v-if="item.temperature * 1 >= 37.3">
2022-01-12 16:37:23 +08:00
<span>当前体温</span>
<span style="margin-left: 10px">{{ item.temperature }}</span>
</div>
<div v-if="item.touchInFourteen * 1 !== 0">
<span>14天内是否接触新冠确诊或疑似患者</span>
<span style="margin-left: 10px">
{{ $dict.getLabel('epidemicTouchInFourteen', item.touchInFourteen) }}
</span>
</div>
<div v-if="item.health !== '0'">
<span>当前健康状况</span>
2022-01-12 17:55:10 +08:00
<div class="healths">
<span v-for="(items, index) in item.health && item.health.split(',')" :key="index">
<span v-if="index > 0"> ; </span>
<span>
{{ $dict.getLabel('epidemicRecentHealth', items) }}
</span>
2022-01-12 16:37:23 +08:00
</span>
2022-01-12 17:55:10 +08:00
</div>
2022-01-12 16:37:23 +08:00
</div>
<div v-if="item.checkResult != 0">
<span>核酸检测结果</span>
<span style="margin-left: 10px">
{{ $dict.getLabel('epidemicRecentTestResult', item.checkResult) }}
</span>
</div>
<div v-if="item.healthCode == 2 || item.healthCode == 3 || item.healthCode == 4">
<span>健康码</span>
<span style="margin-left: 10px">
{{ $dict.getLabel('epidemicHealthCode', item.healthCode) }}
</span>
</div>
</div>
2022-01-11 19:18:22 +08:00
</div>
2022-01-12 09:53:32 +08:00
<p style="color: #333" v-else>暂无异常情况</p>
2022-01-10 17:55:30 +08:00
</div>
2022-01-11 19:18:22 +08:00
2022-01-12 17:55:10 +08:00
<div class="info" v-if="data.length">
2022-01-10 17:55:30 +08:00
<div class="title">异常情况记录</div>
2022-01-12 14:23:18 +08:00
<div class="error-list" v-if="data.length">
<div class="itemes" v-for="(item, i) in data" :key="i">
<p>{{ item.content }}</p>
<div>
<span>{{ item.createTime }}</span>
<span class="names">{{ item.createUserName }}</span>
2022-01-11 19:18:22 +08:00
</div>
2022-01-10 17:55:30 +08:00
</div>
</div>
2022-01-12 14:23:18 +08:00
<AiEmpty description="暂无数据" class="emptyWrap" v-else></AiEmpty>
2022-01-10 17:55:30 +08:00
</div>
2022-01-11 19:18:22 +08:00
2022-01-12 14:23:18 +08:00
<!-- <div class="bg-line"></div> -->
2022-01-10 17:55:30 +08:00
<div class="footer">
2022-01-11 14:33:59 +08:00
<div class="add" @click="show = true">新增记录</div>
2022-01-12 08:59:29 +08:00
<div class="confirm" @click="cancel">解除异常</div>
2022-01-10 17:55:30 +08:00
</div>
2022-01-11 19:18:22 +08:00
2022-01-10 17:55:30 +08:00
<u-popup v-model="show" mode="bottom">
<div class="textarea">
2022-01-12 18:25:17 +08:00
<u-input v-model="value" type="textarea" :height="120" :auto-height="true" placeholder="异常情况记录" :clearable="false" maxlength="1000" />
2022-01-12 14:06:42 +08:00
<p>字数{{ value.length }}/1000</p>
2022-01-10 17:55:30 +08:00
</div>
<div class="btn">
2022-01-12 14:06:42 +08:00
<span @click="value = ''">清空内容</span>
2022-01-12 08:59:29 +08:00
<span class="confirm" @click="confirm">保存</span>
2022-01-10 17:55:30 +08:00
</div>
</u-popup>
</div>
2022-01-10 15:05:53 +08:00
</template>
<script>
2022-01-10 16:59:50 +08:00
import { mapState } from 'vuex'
2022-01-10 15:05:53 +08:00
export default {
components: {},
props: {},
data() {
2022-01-10 17:55:30 +08:00
return {
show: false,
2022-01-11 14:33:59 +08:00
value: '',
2022-01-11 19:18:22 +08:00
userList: [],
data: [],
2022-01-12 09:53:32 +08:00
datas: [],
2022-01-13 14:52:28 +08:00
size: 10,
current: 1,
2022-01-10 17:55:30 +08:00
}
2022-01-10 15:05:53 +08:00
},
2022-01-11 14:33:59 +08:00
computed: {
...mapState(['user']),
},
2022-01-11 19:18:22 +08:00
onLoad(o) {
console.log(o)
2022-01-12 16:37:23 +08:00
this.$dict.load('epidemicMemberType', 'epidemicRecentTravel', 'epidemicTouchInFourteen', 'epidemicRecentTestResult', 'epidemicRecentHealth', 'epidemicHealthCode').then(() => {
2022-01-11 19:18:22 +08:00
if (o) {
this.id = o.id
this.getUser()
this.getRecord()
2022-01-12 09:53:32 +08:00
this.getErrThing()
2022-01-11 19:18:22 +08:00
}
})
},
2022-01-11 14:33:59 +08:00
onShow() {
document.title = '异常情况处理'
},
2022-01-11 19:18:22 +08:00
methods: {
getUser() {
2022-01-18 10:05:35 +08:00
this.$http.post(`/app/appepidemicreportmember/queryDetailById?id=${this.id}`).then((res) => {
if (res.code == 0) {
this.userList = res.data
}
})
2022-01-11 19:18:22 +08:00
},
2022-01-12 09:53:32 +08:00
// 异常情况
getErrThing() {
this.$loading()
2022-01-18 10:05:35 +08:00
this.$http.post(`/app/appepidemichealthreport/list?memberId=${this.id}`).then((res) => {
if (res.code == 0) {
this.datas = res.data.records
}
})
2022-01-12 09:53:32 +08:00
},
// 异常情况记录
2022-01-11 19:18:22 +08:00
getRecord() {
this.$http
2022-01-13 14:52:28 +08:00
.post(`/app/appepidemicunusuallog/list`, null, {
params: {
recordId: this.id,
size: this.size,
current: this.current,
},
})
2022-01-11 19:18:22 +08:00
.then((res) => {
2022-01-12 14:26:18 +08:00
if (res.code == 0) {
2022-01-11 19:18:22 +08:00
this.data = this.current > 1 ? [...this.data, ...res.data.records] : res.data.records
}
})
},
2022-01-12 09:44:05 +08:00
// 新增记录
2022-01-11 19:18:22 +08:00
confirm() {
if (!this.value) {
return this.$u.toast('请输入异常情况')
}
var params = {
content: this.value,
createUserId: this.user.id,
createUserName: this.user.name,
recordId: this.id,
}
2022-01-12 09:44:05 +08:00
this.$http.post('/app/appepidemicunusuallog/addOrUpdate', params).then((res) => {
2022-01-11 19:18:22 +08:00
if (res.code == 0) {
this.$u.toast('新增成功!')
this.show = false
this.value = ''
this.getUser()
this.getRecord()
}
})
},
2022-01-12 09:44:05 +08:00
cancel() {
this.$confirm(`是否解除该条异常信息?`).then(() => {
this.$http.post('/app/appepidemicreportmember/release', { id: this.id }).then((res) => {
2022-01-12 14:26:18 +08:00
if (res.code == 0) {
2022-01-12 09:44:05 +08:00
this.$u.toast('解除成功!')
2022-01-17 18:31:00 +08:00
uni.$emit('updateDetails')
uni.$emit('updateLists')
2022-01-12 09:44:05 +08:00
setTimeout(() => {
uni.navigateBack()
2022-01-12 18:10:58 +08:00
}, 600)
2022-01-12 09:44:05 +08:00
}
})
})
},
2022-01-12 14:33:37 +08:00
callPhone(phone) {
uni.makePhoneCall({ phoneNumber: phone })
},
2022-01-11 19:18:22 +08:00
},
2022-01-13 14:52:28 +08:00
onReachBottom() {
this.current++
this.getRecord()
},
2022-01-10 15:05:53 +08:00
}
</script>
<style scoped lang="scss">
.ErrorDetail {
height: 100%;
2022-01-11 14:33:59 +08:00
.header {
2022-01-10 17:55:30 +08:00
padding: 32px 48px;
box-sizing: border-box;
background-color: #fff;
margin-bottom: 24px;
2022-01-11 14:33:59 +08:00
.name {
2022-01-10 17:55:30 +08:00
font-size: 36px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #333;
line-height: 50px;
margin-bottom: 16px;
2022-01-11 14:33:59 +08:00
span {
2022-01-10 17:55:30 +08:00
font-size: 32px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
2022-01-11 14:33:59 +08:00
color: #4181ff;
2022-01-10 17:55:30 +08:00
line-height: 44px;
margin: 0 20px 0 32px;
}
2022-01-11 14:33:59 +08:00
img {
2022-01-10 17:55:30 +08:00
width: 32px;
height: 32px;
vertical-align: middle;
}
}
2022-01-11 14:33:59 +08:00
p {
2022-01-10 17:55:30 +08:00
font-size: 30px;
font-family: PingFangSC-Regular, PingFang SC;
color: #999;
line-height: 42px;
color: #999;
}
2022-01-11 14:33:59 +08:00
.mar-b8 {
2022-01-10 17:55:30 +08:00
margin-bottom: 8px;
}
}
2022-01-11 14:33:59 +08:00
.info {
2022-01-12 18:14:32 +08:00
padding-bottom: 112px;
2022-01-11 14:33:59 +08:00
.title {
2022-01-12 14:23:18 +08:00
padding: 0 32px;
2022-01-10 17:55:30 +08:00
font-size: 38px;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #333;
line-height: 116px;
2022-01-12 14:23:18 +08:00
background-color: #fff;
2022-01-10 17:55:30 +08:00
}
2022-01-11 14:33:59 +08:00
.error-list {
2022-01-12 14:23:18 +08:00
background-color: #fff !important;
padding-bottom: 24px;
2022-01-12 09:44:05 +08:00
.itemes {
2022-01-12 14:23:18 +08:00
margin: 0 32px;
2022-01-11 14:33:59 +08:00
background: #f4f7fe;
2022-01-10 17:55:30 +08:00
border-radius: 8px;
padding: 24px 24px 18px 24px;
box-sizing: border-box;
margin-bottom: 16px;
2022-01-12 14:23:18 +08:00
2022-01-12 17:37:11 +08:00
span {
2022-01-10 17:55:30 +08:00
font-size: 28px;
font-family: PingFangSC-Regular, PingFang SC;
2022-01-11 14:33:59 +08:00
color: #343d65;
2022-01-10 17:55:30 +08:00
line-height: 40px;
word-break: break-all;
margin-bottom: 12px;
}
2022-01-11 14:33:59 +08:00
div {
2022-01-10 17:55:30 +08:00
font-size: 24px;
font-family: PingFangSC-Regular, PingFang SC;
color: #666;
line-height: 34px;
2022-01-12 09:44:05 +08:00
span:last-child {
2022-01-10 17:55:30 +08:00
display: inline-block;
margin-left: 32px;
}
}
}
}
}
2022-01-11 14:33:59 +08:00
.footer {
2022-01-10 17:55:30 +08:00
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 112px;
line-height: 112px;
background: #fff;
display: flex;
font-size: 36px;
font-family: PingFangSC-Regular, PingFang SC;
2022-01-11 14:33:59 +08:00
.add {
2022-01-10 17:55:30 +08:00
flex: 1;
color: #333;
}
2022-01-11 14:33:59 +08:00
.confirm {
2022-01-10 17:55:30 +08:00
flex: 2;
color: #fff;
2022-01-11 14:33:59 +08:00
background: #1365dd;
2022-01-10 17:55:30 +08:00
}
2022-01-11 14:33:59 +08:00
div {
2022-01-10 17:55:30 +08:00
text-align: center;
}
}
2022-01-11 14:33:59 +08:00
.bg-line {
2022-01-10 17:55:30 +08:00
width: 100%;
height: 130px;
}
2022-01-11 14:33:59 +08:00
.textarea {
2022-01-10 17:55:30 +08:00
margin: 32px 32px 24px;
width: calc(100% - 64px);
padding: 16px;
box-sizing: border-box;
2022-01-11 14:33:59 +08:00
background: #f7f7f7;
2022-01-10 17:55:30 +08:00
border-radius: 8px;
2022-01-11 14:33:59 +08:00
p {
2022-01-10 17:55:30 +08:00
font-size: 26px;
font-family: PingFangSC-Regular, PingFang SC;
color: #999;
line-height: 36px;
text-align: right;
}
}
2022-01-11 14:33:59 +08:00
.btn {
2022-01-10 17:55:30 +08:00
padding: 0 32px 24px;
height: 64px;
display: flex;
justify-content: space-between;
2022-01-11 14:33:59 +08:00
span {
2022-01-10 17:55:30 +08:00
display: inline-block;
line-height: 64px;
font-size: 26px;
font-family: PingFangSC-Regular, PingFang SC;
color: #666;
}
2022-01-11 14:33:59 +08:00
.confirm {
2022-01-10 17:55:30 +08:00
width: 144px;
text-align: center;
2022-01-11 14:33:59 +08:00
background: #1365dd;
2022-01-10 17:55:30 +08:00
border-radius: 32px;
font-size: 28px;
font-family: PingFangSC-Regular, PingFang SC;
2022-01-11 14:33:59 +08:00
color: #fff;
2022-01-10 17:55:30 +08:00
}
}
2022-01-10 15:05:53 +08:00
}
</style>