Files
dvcp_v2_webapp/packages/3.0.0/AppHealthReport/components/Detail.vue

317 lines
12 KiB
Vue
Raw Normal View History

2022-01-12 08:36:15 +08:00
<template>
2022-01-18 16:22:07 +08:00
<ai-detail isHasSidebar>
2022-01-12 08:36:15 +08:00
<template slot="title">
2022-01-13 15:37:17 +08:00
<ai-title title="详情" isShowBack isShowBottomBorder @onBackClick="cancel(true)">
2022-01-12 08:36:15 +08:00
</ai-title>
</template>
<template slot="content">
<AiSidebar :tabTitle="tabList" v-model="currIndex"></AiSidebar>
<div v-show="currIndex === 0">
<ai-card title="基本信息" v-show="currIndex === 0">
<template #content>
<ai-wrapper
label-width="120px">
2022-01-12 10:49:06 +08:00
<ai-info-item label="姓名" :value="info.name"></ai-info-item>
<ai-info-item label="上报时间" :value="info.createTime"></ai-info-item>
<ai-info-item label="身份证号" :value="info.idNumber"></ai-info-item>
2022-01-12 16:14:38 +08:00
<ai-info-item label="所属地区" :value="info.areaName"></ai-info-item>
<ai-info-item label="详细地址" isLine :value="info.address"></ai-info-item>
2022-01-12 08:36:15 +08:00
</ai-wrapper>
</template>
</ai-card>
2022-01-12 10:49:06 +08:00
</div>
<ai-card title="每日上报" v-show="currIndex === 1">
<template #content>
<ai-table
class="detail-table__table"
:tableData="tableData"
:col-configs="colConfigs"
:total="total"
:current.sync="search.current"
:size.sync="search.size"
@getList="getList">
<el-table-column slot="options" width="140px" fixed="right" label="操作" align="center">
<template slot-scope="{ row }">
<div class="table-options">
<el-button type="text" @click="toDetail(row.id)">详情</el-button>
</div>
</template>
</el-table-column>
</ai-table>
<ai-dialog
:visible.sync="isShow"
width="890px"
customFooter
title="上报详情">
<ai-bar title="健康状况"></ai-bar>
2022-01-12 08:36:15 +08:00
<ai-wrapper
label-width="120px">
2022-01-12 10:49:06 +08:00
<ai-info-item label="当前体温">
2022-01-13 15:32:47 +08:00
<span :style="{color: reportInfo.temperature > 37.3 ? '#FF4466' : '#42D784'}">{{ reportInfo.temperature }}</span>
2022-01-12 10:49:06 +08:00
</ai-info-item>
<ai-info-item label="14天内是否接触新冠确诊或疑似患者">
<span :style="{color: reportInfo.touchInFourteen === '0' ? '#42D784' : '#FF4466'}">{{ $dict.getLabel('epidemicTouchInFourteen', reportInfo.touchInFourteen) }}</span>
</ai-info-item>
<ai-info-item label="当前健康状况" isLine>
<span :style="{color: !reportInfo.isHealth ? '#42D784' : '#FF4466'}">{{ reportInfo.healthName }}</span>
</ai-info-item>
2022-01-12 08:36:15 +08:00
</ai-wrapper>
2022-01-12 10:49:06 +08:00
<ai-bar title="核酸检测信息"></ai-bar>
2022-01-12 08:36:15 +08:00
<ai-wrapper
label-width="120px">
2022-01-12 10:49:06 +08:00
<ai-info-item label="检测日期">
<span>{{ reportInfo.checkTime && reportInfo.checkTime.split(' ')[0] }}</span>
</ai-info-item>
<ai-info-item label="检测结果">
<span :style="{color: reportInfo.checkResult === '0' ? '#42D784' : '#FF4466'}">{{ $dict.getLabel('epidemicRecentTestResult', reportInfo.checkResult) }}</span>
</ai-info-item>
<ai-info-item label="健康码状态">
2022-01-13 15:32:47 +08:00
<span :style="{color: (reportInfo.healthCode === '0' || reportInfo.healthCode === '1') ? '#42D784' : '#FF4466'}">{{ $dict.getLabel('epidemicHealthCode', reportInfo.healthCode) }}</span>
2022-01-12 10:49:06 +08:00
</ai-info-item>
<ai-info-item label="已接种疫苗次数">
2022-02-07 15:05:21 +08:00
<span>{{ $dict.getLabel('epidemicVaccineTime', reportInfo.vaccine) }}</span>
2022-01-12 10:49:06 +08:00
</ai-info-item>
<ai-info-item label="本人健康码截图" isLine>
<ai-uploader
:instance="instance"
v-model="reportInfo.checkPhoto"
disabled
:limit="9">
</ai-uploader>
</ai-info-item>
2022-01-12 08:36:15 +08:00
</ai-wrapper>
2022-01-12 10:49:06 +08:00
<div class="dialog-footer" slot="footer">
<el-button @click="isShow = false">关闭</el-button>
</div>
</ai-dialog>
</template>
</ai-card>
<div v-show="currIndex === 2">
<ai-card title="异常处理">
<template #right>
2022-01-12 16:20:35 +08:00
<el-button type="primary" v-if="info.status === '0'" @click="release">解除异常</el-button>
2022-01-12 08:36:15 +08:00
</template>
<template #content>
<ai-wrapper
label-width="120px">
2022-01-12 10:49:06 +08:00
<ai-info-item label="姓名" :value="info.name"></ai-info-item>
<ai-info-item label="填报时间" :value="info.createTime"></ai-info-item>
<ai-info-item label="身份证号" :value="info.idNumber"></ai-info-item>
<ai-info-item label="手机号码" :value="info.phone"></ai-info-item>
2022-01-13 15:31:31 +08:00
<ai-info-item label="异常状况" isLine>
2022-01-12 10:49:06 +08:00
<span :style="{color: info.unusual ? 'red' : '#333'}">{{ info.unusual || '-' }}</span>
</ai-info-item>
2022-01-13 15:31:31 +08:00
<ai-info-item label="异常解除人" v-if="info.releaseName && info.status === '1'" :value="info.releaseName"></ai-info-item>
<ai-info-item label="异常解除时间" v-if="info.releaseTime && info.status === '1'" :value="info.releaseTime"></ai-info-item>
2022-01-12 08:36:15 +08:00
</ai-wrapper>
</template>
</ai-card>
2022-01-12 10:49:06 +08:00
<ai-card title="异常情况记录">
<template #right>
2022-01-12 16:23:11 +08:00
<el-button type="primary" v-if="info.status === '0'" @click="isShowAdd = true">添加记录</el-button>
2022-01-12 10:49:06 +08:00
</template>
<template #content>
<ai-table
:tableData="recordList"
:col-configs="recordConfigs"
:total="recordTotal"
:current.sync="recordSerch.current"
:size.sync="recordSerch.size"
@getList="getRecordList">
<el-table-column slot="options" width="120px" fixed="right" label="操作" align="center">
<template slot-scope="{ row }">
<div class="table-options">
<el-button type="text" @click="remove(row.id)">删除</el-button>
</div>
</template>
</el-table-column>
</ai-table>
</template>
</ai-card>
<ai-dialog
:visible.sync="isShowAdd"
width="800px"
@close="form.content = ''"
title="添加异常记录"
@onConfirm="onConfirm">
<el-form class="ai-form" label-width="120px" :model="form" ref="form">
2022-01-13 15:27:49 +08:00
<el-form-item label="异常记录" prop="content" style="width: 100%;" :rules="[{ required: true, message: '请输入异常记录' }]">
<el-input type="textarea" :rows="5" :maxlength="500" v-model="form.content" clearable placeholder="请输入异常记录" show-word-limit></el-input>
2022-01-12 10:49:06 +08:00
</el-form-item>
</el-form>
</ai-dialog>
2022-01-12 08:36:15 +08:00
</div>
</template>
</ai-detail>
</template>
<script>
export default {
name: 'Detail',
props: {
instance: Function,
dict: Object,
params: Object
},
data () {
return {
total: 0,
info: {},
id: '',
2022-01-12 10:49:06 +08:00
isShowAdd: false,
recordTotal: 0,
recordSerch: {
current: 1,
size: 10
},
2022-01-12 08:36:15 +08:00
search: {
current: 1,
size: 10
},
2022-01-12 10:49:06 +08:00
form: {
content: ''
},
recordConfigs: [
2022-01-13 15:27:49 +08:00
{prop: 'content', label: '异常记录', align: 'center' },
2022-01-12 17:40:27 +08:00
{prop: 'createTime', label: '创建时间', align: 'center'},
{prop: 'createUserName', label: '记录人', align: 'center' }
2022-01-12 10:49:06 +08:00
],
reportInfo: {},
isShow: false,
2022-01-12 08:36:15 +08:00
currIndex: 0,
tableData: [],
2022-01-12 10:49:06 +08:00
recordList: [],
2022-01-12 08:36:15 +08:00
colConfigs: [
2022-04-28 14:30:20 +08:00
{prop: 'createTime', label: '上报日期', align: 'center', dateFormat: 'YYYY-MM-DD'},
2022-01-12 10:49:06 +08:00
{prop: 'status', label: '健康状态', align: 'center', formart: v => v === '0' ? '异常' : '正常' }
2022-01-12 08:36:15 +08:00
],
2022-01-12 16:20:35 +08:00
tabList: ['基本信息', '每日上报', '异常处理']
2022-01-12 08:36:15 +08:00
}
},
created () {
if (this.params && this.params.id) {
this.id = this.params.id
2022-01-12 10:49:06 +08:00
this.dict.load(['epidemicRecentHealth', 'epidemicRecentTravel', 'epidemicTouchInFourteen', 'epidemicMemberType', 'epidemicRecentTestResult']).then(() => {
this.getInfo(this.params.id)
2022-01-12 17:34:01 +08:00
this.getList()
this.getRecordList()
2022-01-12 10:49:06 +08:00
})
2022-01-12 08:36:15 +08:00
}
},
methods: {
getInfo (id) {
2022-01-12 10:49:06 +08:00
this.instance.post(`/app/appepidemicreportmember/queryDetailById?id=${id}`).then(res => {
2022-01-12 08:36:15 +08:00
if (res.code === 0) {
this.info = res.data
2022-01-12 10:49:06 +08:00
this.currIndex = 0
}
})
},
2022-01-12 17:34:01 +08:00
getRecordList () {
2022-01-12 10:49:06 +08:00
this.instance.post(`/app/appepidemicunusuallog/list`, null, {
params: {
...this.search,
2022-01-12 17:34:01 +08:00
recordId: this.params.id
2022-01-12 10:49:06 +08:00
}
}).then(res => {
if (res.code == 0) {
this.recordList = res.data.records
this.recordTotal = res.data.total
}
})
},
onConfirm() {
this.$refs.form.validate(v => {
if (v) {
this.instance.post('/app/appepidemicunusuallog/addOrUpdate', {
...this.form,
recordId: this.params.id
}).then(res => {
if (res?.code == 0) {
this.isShowAdd = false
this.getRecordList(this.params.id)
this.$message.success('添加成功!')
}
})
}
})
},
release () {
this.$confirm('确定解除异常?').then(() => {
this.instance.post(`/app/appepidemicreportmember/release`, {
id: this.params.id
}).then(res => {
if (res.code == 0) {
this.$message.success('解除异常成功!')
this.currIndex = 0
this.getInfo(this.params.id)
}
})
})
},
remove(id) {
this.$confirm('确定删除该数据?').then(() => {
this.instance.post(`/app/appepidemicunusuallog/delete?ids=${id}`).then(res => {
if (res.code == 0) {
this.$message.success('删除成功!')
2022-02-07 14:38:08 +08:00
this.getRecordList(this.params.id)
2022-01-12 10:49:06 +08:00
}
})
})
},
toDetail (id) {
this.instance.post(`/app/appepidemichealthreport/queryDetailById?id=${id}`).then(res => {
if (res.code === 0) {
this.reportInfo = res.data
this.reportInfo.checkPhoto = JSON.parse(res.data.checkPhoto)
let healthName = ''
this.reportInfo.isHealth = false
res.data.health.split(',').forEach(v => {
if (v > 0) {
this.reportInfo.isHealth = true
}
healthName = healthName + this.dict.getLabel('epidemicRecentHealth', v)
})
this.reportInfo.healthName = healthName
this.isShow = true
2022-01-12 08:36:15 +08:00
}
})
},
2022-01-12 17:34:01 +08:00
getList () {
2022-01-12 10:49:06 +08:00
this.instance.post(`/app/appepidemichealthreport/list`, null, {
2022-01-12 08:36:15 +08:00
params: {
...this.search,
2022-01-12 17:34:01 +08:00
memberId: this.params.id
2022-01-12 08:36:15 +08:00
}
}).then(res => {
if (res.code == 0) {
this.tableData = res.data.records
this.total = res.data.total
}
})
},
cancel (isRefresh) {
this.$emit('change', {
type: 'list',
isRefresh: !!isRefresh
})
}
}
}
</script>
<style scoped lang="scss">
</style>