Files
dvcp_v2_wxcp_app/src/project/pingchang/AppCheckpointRegistration/ErrorInfo.vue

273 lines
6.6 KiB
Vue
Raw Normal View History

2022-09-21 11:37:24 +08:00
<template>
2022-09-21 16:15:58 +08:00
<div class="ErrorInfo">
2022-09-21 11:37:24 +08:00
<div class="header">
2022-09-21 16:15:58 +08:00
<div class="name">{{info.name}}<span @click="callPhone(info.phone)">{{info.phone}}</span><img :src="$cdn + 'common/phone.png'" alt="" @click="callPhone(info.phone)" class="phone-icon" /></div>
<p>身份证号</p>
<p class="mar-b8" style="color: #333">{{info.idNumber}}</p>
<p>异常情况</p>
<p style="color: #ff4466">
<span>{{info.unusual}}</span>
</p>
2022-09-21 11:37:24 +08:00
</div>
2022-09-21 16:15:58 +08:00
<div class="info" v-if="list.length">
<div class="title">异常情况记录</div>
2022-09-21 11:37:24 +08:00
<div class="error-list">
2022-09-21 16:15:58 +08:00
<div class="item" v-for="(item, index) in list" :key="index">
<p>{{item.content}}</p>
<div>{{item.createTime}}
<span>{{item.createUserName}}</span>
2022-09-21 11:37:24 +08:00
</div>
</div>
</div>
</div>
<div class="bg-line"></div>
<div class="footer">
2022-09-21 16:15:58 +08:00
<div class="add" @click="show = true">新增记录</div>
<div class="confirm" @click="cancel()">解除异常</div>
2022-09-21 11:37:24 +08:00
</div>
2022-09-21 16:15:58 +08:00
<u-popup v-model="show" mode="bottom">
<div class="textarea">
<u-input v-model="value" type="textarea" :height="120" :auto-height="true" placeholder="异常情况记录" :clearable="false" maxlength="1000" />
<p>字数{{value.length}}/1000</p>
</div>
<div class="btn">
<span @click="value=''">清空内容</span>
<span class="confirm" @click="confirm">保存</span>
</div>
</u-popup>
2022-09-21 11:37:24 +08:00
</div>
</template>
<script>
import { mapState } from 'vuex'
export default {
2022-09-21 16:15:58 +08:00
components: {},
props: {},
2022-09-21 11:37:24 +08:00
data() {
return {
show: false,
value: '',
id: '',
list: [],
info: {}
}
},
computed: {
...mapState(['user']),
},
onShow() {
document.title = '异常情况处理'
},
onLoad(option) {
2022-09-21 16:15:58 +08:00
this.id = option.id
2022-09-21 11:37:24 +08:00
this.$dict.load('epidemicRecentHealth').then(() => {
this.getDetail()
})
this.getList()
},
methods: {
getList() {
this.$http.post(`/app/appepidemicunusuallog/list?recordId=${this.id}`).then((res) => {
if (res.code == 0) {
this.list = res.data.records
}
})
},
getDetail() {
this.$http.post(`/app/appepidemicbackhomerecord/queryDetailById?id=${this.id}`).then((res) => {
if (res.code == 0) {
res.data.idNumber = res.data.idNumber.replace(/(.{6}).*(.{4})/,"$1********$2")
this.info = res.data
this.info.health = this.info.health.split(',')
}
})
},
cancel() {
this.$confirm(`是否解除该条异常信息?`).then(() => {
this.$http.post("/app/appepidemicbackhomerecord/release", {id: this.id}).then(res => {
if (res.code == 0) {
this.$u.toast("解除成功!")
uni.$emit('updateDetail')
uni.$emit('updateList')
setTimeout(() => {
uni.navigateBack()
}, 600);
}
})
})
},
confirm() {
if(!this.value) {
return this.$u.toast('请输入异常情况')
}
var params = {
"content": this.value,
"createUserId": this.user.id,
"createUserName": this.user.name,
"recordId": this.id
}
this.$http.post("/app/appepidemicunusuallog/addOrUpdate", params).then(res => {
if (res.code == 0) {
this.$u.toast("新增成功!")
this.show = false
this.value = ''
this.getList()
}
})
},
callPhone(phone) {
uni.makePhoneCall({phoneNumber: phone})
},
},
}
</script>
<style scoped lang="scss">
2022-09-21 16:15:58 +08:00
.ErrorInfo {
2022-09-21 11:37:24 +08:00
height: 100%;
.header {
2022-09-21 16:15:58 +08:00
padding: 32px 48px;
box-sizing: border-box;
2022-09-21 11:37:24 +08:00
background-color: #fff;
2022-09-21 16:15:58 +08:00
margin-bottom: 24px;
.name {
2022-09-21 11:37:24 +08:00
font-size: 36px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #333;
line-height: 50px;
2022-09-21 16:15:58 +08:00
margin-bottom: 16px;
2022-09-21 11:37:24 +08:00
span {
font-size: 32px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #4181ff;
line-height: 44px;
margin: 0 20px 0 32px;
}
img {
width: 32px;
height: 32px;
vertical-align: middle;
}
}
2022-09-21 16:15:58 +08:00
p {
font-size: 30px;
2022-09-21 11:37:24 +08:00
font-family: PingFangSC-Regular, PingFang SC;
2022-09-21 16:15:58 +08:00
color: #999;
line-height: 42px;
2022-09-21 11:37:24 +08:00
color: #999;
}
2022-09-21 16:15:58 +08:00
.mar-b8 {
margin-bottom: 8px;
2022-09-21 11:37:24 +08:00
}
}
.info {
2022-09-21 16:15:58 +08:00
padding: 0 32px 32px;
2022-09-21 11:37:24 +08:00
background-color: #fff;
.title {
font-size: 38px;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #333;
2022-09-21 16:15:58 +08:00
line-height: 116px;
2022-09-21 11:37:24 +08:00
}
.error-list {
.item {
width: 100%;
background: #f4f7fe;
border-radius: 8px;
2022-09-21 16:15:58 +08:00
padding: 24px 24px 18px 24px;
2022-09-21 11:37:24 +08:00
box-sizing: border-box;
margin-bottom: 16px;
2022-09-21 16:15:58 +08:00
p {
font-size: 28px;
font-family: PingFangSC-Regular, PingFang SC;
color: #343d65;
line-height: 40px;
word-break: break-all;
margin-bottom: 12px;
2022-09-21 11:37:24 +08:00
}
2022-09-21 16:15:58 +08:00
div {
font-size: 24px;
2022-09-21 11:37:24 +08:00
font-family: PingFangSC-Regular, PingFang SC;
2022-09-21 16:15:58 +08:00
color: #666;
line-height: 34px;
span {
2022-09-21 11:37:24 +08:00
display: inline-block;
2022-09-21 16:15:58 +08:00
margin-left: 32px;
2022-09-21 11:37:24 +08:00
}
}
}
}
}
.footer {
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;
.add {
flex: 1;
color: #333;
}
.confirm {
flex: 2;
color: #fff;
background: #1365dd;
}
div {
text-align: center;
}
}
.bg-line {
width: 100%;
height: 130px;
}
.textarea {
margin: 32px 32px 24px;
width: calc(100% - 64px);
padding: 16px;
box-sizing: border-box;
background: #f7f7f7;
border-radius: 8px;
p {
font-size: 26px;
font-family: PingFangSC-Regular, PingFang SC;
color: #999;
line-height: 36px;
text-align: right;
}
}
.btn {
padding: 0 32px 24px;
height: 64px;
display: flex;
justify-content: space-between;
span {
display: inline-block;
line-height: 64px;
font-size: 26px;
font-family: PingFangSC-Regular, PingFang SC;
color: #666;
}
.confirm {
width: 144px;
text-align: center;
background: #1365dd;
border-radius: 32px;
font-size: 28px;
font-family: PingFangSC-Regular, PingFang SC;
color: #fff;
}
}
}
</style>