健康上报

This commit is contained in:
liuye
2022-02-09 14:47:06 +08:00
parent ef27a36a58
commit 2d90591da4
2 changed files with 208 additions and 50 deletions

View File

@@ -67,7 +67,7 @@
</div>
</div>
</div>
<div class="pad-b112"></div>
<div class="pad-b112" v-if="!isUpload && currentTabs != 1"></div>
</div>
<AiEmpty v-else :noPermit="true" description="今日已上报"></AiEmpty>
</div>
@@ -84,27 +84,27 @@
</div>
</div>
<div class="time-content">
<div class="title">上报记录<span>(12)</span></div>
<div class="title">上报记录<span>({{month}})</span></div>
<div class="time">
<div class="week-list">
<span v-for="(item, index) in weekList" :key="index">{{item}}</span>
</div>
<div class="day-list">
<div v-for="(item, index) in 30" :key="index" class="item" :class="index == 7 ? 'active' : ''">
<div class="num">{{item}}</div>
<span class="status"></span>
<div v-for="(item, index) in dayList" :key="index" class="item" :class="selectDay == item.day ? 'active' : ''" @click="dayClick(item)">
<div class="num">{{item.day}}</div>
<span class="status" :class="'bg-'+item.status" v-if="item.day"></span>
</div>
</div>
</div>
</div>
<div class="form-item__group">
<div class="form-item__group" v-if="healthInfo.id">
<div class="group_title">健康状况</div>
<div class="form-item">
<div class="form-item__wrapper">
<div class="form-item__title">
<span class="label">当前体温</span>
</div>
<div class="form-item__right">36.2</div>
<div class="form-item__right" :style="healthInfo.temperature >= 37.3 ? 'color:#f46;' : ''">{{healthInfo.temperature}}</div>
</div>
</div>
<div class="form-item">
@@ -112,7 +112,9 @@
<div class="form-item__title">
<span class="label" style="width:190px;">14天内是否接触新冠确诊或疑似患者</span>
</div>
<div class="form-item__right"></div>
<div class="form-item__right">
<div class="value" :class="'color-'+healthInfo.touchInFourteen">{{$dict.getLabel('epidemicTouchInFourteen', healthInfo.touchInFourteen)}}</div>
</div>
</div>
</div>
<div class="form-item">
@@ -120,17 +122,21 @@
<div class="form-item__title">
<span class="label">当前健康状况</span>
</div>
<div class="form-item__right">感冒症状;乏力咳嗽发烧肌肉痛头痛</div>
<div class="form-item__right">
<span>
<span v-for="(item, index) in healthInfo.health" :key="index" :style="item != 0 ? 'color:#FF4466;' : ''"><span v-if="index>0">;</span>{{$dict.getLabel('epidemicRecentHealth', item)}}</span>
</span>
</div>
</div>
</div>
</div>
<div class="pad-b112"></div>
<div class="pad-b112" v-if="currentTabs == 1 && isAdmin"></div>
</div>
<div class="add-btn" v-if="!isUpload && currentTabs != 1">
<div class="add-btn" v-if="!isUpload && currentTabs != 1" @click="submit">
<div>提交</div>
</div>
<div class="add-btn" v-if="currentTabs == 1" @click="toOther">
<div class="add-btn" v-if="currentTabs == 1 && isAdmin" @click="toOther">
<div>查看其他成员</div>
</div>
</div>
@@ -146,25 +152,99 @@ export default {
return {
tabList: [{ name: '健康上报'},{ name: '上报统计'}],
currentTabs: 0,
form: {},
form: {temperature: '', touchInFourteen: '', health: []},
isUpload: false,
weekList: ['一', '二', '三', '四', '五', '六', '日']
weekList: ['一', '二', '三', '四', '五', '六', '日'],
dayList: [],
month: '',
selectDay: '',
healthInfo: {},
isAdmin: false, //是否网格长
}
},
computed: {
...mapState(['user']),
},
onLoad() {
this.$dict.load('epidemicTouchInFourteen', 'epidemicRecentHealth')
var date = new Date();
this.selectDay = date.getDate()
this.month = date.getMonth() + 1
this.getStatis()
this.getCheckTodayReport()
},
onShow() {
document.title = '健康上报'
},
methods: {
dayClick(item) {
this.healthInfo = {}
this.selectDay = item.day
if(!item.id) {
return this.$u.toast("当日未上报");
}
this.$http.post(`/app/appepidemichealthreport/queryDetailById?id=${item.id}`).then((res) => {
if (res.code == 0) {
this.healthInfo = res.data
this.healthInfo.health = res.data.health.split(',')
}
})
},
submit() {
if (!this.form.temperature) {
return this.$u.toast("请输入当前体温");
}
if (!this.form.touchInFourteen) {
return this.$u.toast("请选择14天内是否接触新冠确诊或疑似患者");
}
if (!this.form.health.length) {
return this.$u.toast("请选择当前健康状况");
}
this.$http.post(`/app/appepidemichealthreport/addOrUpdate`, {
...this.form,
health: this.form.health.join(',')
}).then((res) => {
if (res.code == 0) {
this.$u.toast("上报成功");
this.getCheckTodayReport()
this.getStatis()
}
});
},
getCheckTodayReport() {
this.$http.post(`/app/appepidemichealthreport/checkTodayReport`).then((res) => {
if (res.code == 0) {
this.isUpload = res.data
}
})
},
getStatis() {
this.dayList = []
this.$http.post(`/app/appepidemichealthreport/statistic`).then((res) => {
if (res.code == 0) {
// this.dataInfo = res.data
Object.keys(res.data).forEach((key) => {
var info = {
week: res.data[key].week,
day: key,
status: res.data[key].status || '2',
id: res.data[key].id || '',
}
this.dayList.push(info)
})
var week = Number(this.dayList[0].week) - 1
if(week > 0) {
for(var i= 0; i<week; i++){
var info = {
id: '',
}
this.dayList.unshift(info)
}
}
this.dayList.map((item) => {
if(item.day == this.selectDay && item.id) {
this.dayClick(item)
}
})
}
})
},
@@ -173,7 +253,17 @@ export default {
},
toOther() {
uni.navigateTo({ url: './OtherUser'})
}
},
isGirdUser() {
this.isAdmin = false
this.$http.post('/app/appgirdmemberinfo/checkLogOnUser').then((res) => {
if (res.code == 0) {
if (res.data.checkType == 2) {
this.isAdmin = true
}
}
})
},
},
}
</script>
@@ -298,8 +388,7 @@ uni-page-body {
display: flex;
align-items: center;
justify-content: space-between;
height: 128px;
padding-right: 28px;
padding: 40px 28px 40px 0;
border-bottom: 1px solid #dddddd;
input {
@@ -325,9 +414,7 @@ uni-page-body {
max-width: 400px;
margin-right: 8px;
color: #333333;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
word-break: break-all;
}
i {
@@ -437,7 +524,6 @@ uni-page-body {
font-size: 32px!important;
}
.group_title{
width: 100%;
height: 116px;
line-height: 116px;
background: #FFF;
@@ -510,15 +596,14 @@ uni-page-body {
top: 60px;
left: 50%;
margin-left: -4px;
background: #3B87F6;
}
.status0{
.bg-2{
background: #999;
}
.status1{
.bg-1{
background: #3B87F6;
}
.status2{
.bg-0{
background: #f46;
}
}
@@ -537,5 +622,14 @@ uni-page-body {
.pad-b112{
padding-bottom: 112px;
}
.color-0{
color: #42D784;
}
.color-1{
color: #f46;
}
.color-2{
color: #1365DD;
}
}
</style>

View File

@@ -7,32 +7,32 @@
<div class="form-item__title">
<span class="label">姓名</span>
</div>
<div class="form-item__right">张三</div>
<div class="form-item__right"><AiOpenData v-if="user.wxUserId" type="userName" :openid="user.wxUserId" /></div>
</div>
</div>
</div>
<div class="time-content">
<div class="title">上报记录<span>(12)</span></div>
<div class="title">上报记录<span>({{month}})</span></div>
<div class="time">
<div class="week-list">
<span v-for="(item, index) in weekList" :key="index">{{item}}</span>
</div>
<div class="day-list">
<div v-for="(item, index) in 30" :key="index" class="item" :class="index == 7 ? 'active' : ''">
<div class="num">{{item}}</div>
<span class="status"></span>
<div v-for="(item, index) in dayList" :key="index" class="item" :class="selectDay == item.day ? 'active' : ''" @click="dayClick(item)">
<div class="num">{{item.day}}</div>
<span class="status" :class="'bg-'+item.status" v-if="item.day"></span>
</div>
</div>
</div>
</div>
<div class="form-item__group">
<div class="form-item__group" v-if="healthInfo.id">
<div class="group_title">健康状况</div>
<div class="form-item">
<div class="form-item__wrapper">
<div class="form-item__title">
<span class="label">当前体温</span>
</div>
<div class="form-item__right">36.2</div>
<div class="form-item__right" :style="healthInfo.temperature >= 37.3 ? 'color:#f46;' : ''">{{healthInfo.temperature}}</div>
</div>
</div>
<div class="form-item">
@@ -40,7 +40,9 @@
<div class="form-item__title">
<span class="label" style="width:190px;">14天内是否接触新冠确诊或疑似患者</span>
</div>
<div class="form-item__right"></div>
<div class="form-item__right">
<div class="value" :class="'color-'+healthInfo.touchInFourteen">{{$dict.getLabel('epidemicTouchInFourteen', healthInfo.touchInFourteen)}}</div>
</div>
</div>
</div>
<div class="form-item">
@@ -48,7 +50,11 @@
<div class="form-item__title">
<span class="label">当前健康状况</span>
</div>
<div class="form-item__right">感冒症状;乏力咳嗽发烧肌肉痛头痛</div>
<div class="form-item__right">
<span>
<span v-for="(item, index) in healthInfo.health" :key="index" :style="item != 0 ? 'color:#FF4466;' : ''"><span v-if="index>0">;</span>{{$dict.getLabel('epidemicRecentHealth', item)}}</span>
</span>
</div>
</div>
</div>
</div>
@@ -66,22 +72,76 @@ export default {
name: 'OtherStatistics',
data() {
return {
weekList: ['一', '二', '三', '四', '五', '六', '日']
weekList: ['一', '二', '三', '四', '五', '六', '日'],
dayList: [],
month: '',
selectDay: '',
healthInfo: {},
userId: ''
}
},
computed: {
...mapState(['user']),
},
onLoad() {
onLoad(option) {
this.userId = option.id
var date = new Date();
this.selectDay = date.getDate()
this.month = date.getMonth() + 1
this.$dict.load('epidemicTouchInFourteen', 'epidemicRecentHealth').then(() => {
this.getStatis()
})
},
onShow() {
document.title = '健康上报'
},
methods: {
dayClick(item) {
this.healthInfo = {}
this.selectDay = item.day
if(!item.id) {
return this.$u.toast("当日未上报");
}
this.$http.post(`/app/appepidemichealthreport/queryDetailById?id=${item.id}`).then((res) => {
if (res.code == 0) {
this.healthInfo = res.data
this.healthInfo.health = res.data.health.split(',')
}
})
},
getStatis() {
this.dayList = []
this.$http.post(`/app/appepidemichealthreport/statistic?userId=${this.userId}`).then((res) => {
if (res.code == 0) {
Object.keys(res.data).forEach((key) => {
var info = {
week: res.data[key].week,
day: key,
status: res.data[key].status || '2',
id: res.data[key].id || '',
}
this.dayList.push(info)
})
var week = Number(this.dayList[0].week) - 1
if(week > 0) {
for(var i= 0; i<week; i++){
var info = {
id: '',
}
this.dayList.unshift(info)
}
}
this.dayList.map((item) => {
if(item.day == this.selectDay && item.id) {
this.dayClick(item)
}
})
}
})
},
back() {
uni.navigateBack()
}
},
},
}
</script>
@@ -206,8 +266,7 @@ uni-page-body {
display: flex;
align-items: center;
justify-content: space-between;
height: 128px;
padding-right: 28px;
padding: 40px 28px 40px 0;
border-bottom: 1px solid #dddddd;
input {
@@ -233,9 +292,7 @@ uni-page-body {
max-width: 400px;
margin-right: 8px;
color: #333333;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
word-break: break-all;
}
i {
@@ -345,7 +402,6 @@ uni-page-body {
font-size: 32px!important;
}
.group_title{
width: 100%;
height: 116px;
line-height: 116px;
background: #FFF;
@@ -418,15 +474,14 @@ uni-page-body {
top: 60px;
left: 50%;
margin-left: -4px;
background: #3B87F6;
}
.status0{
.bg-2{
background: #999;
}
.status1{
.bg-1{
background: #3B87F6;
}
.status2{
.bg-0{
background: #f46;
}
}
@@ -445,5 +500,14 @@ uni-page-body {
.pad-b112{
padding-bottom: 112px;
}
.color-0{
color: #42D784;
}
.color-1{
color: #f46;
}
.color-2{
color: #1365DD;
}
}
</style>