健康监测

This commit is contained in:
花有清香月有阴
2022-01-11 15:56:08 +08:00
parent 086c4fbc91
commit 2cbcf2198c
4 changed files with 109 additions and 12 deletions

View File

@@ -57,6 +57,7 @@ export default {
computed: { computed: {
...mapState(['user']), ...mapState(['user']),
}, },
onLoad() {},
onShow() { onShow() {
document.title = '异常情况处理' document.title = '异常情况处理'
}, },

View File

@@ -2,19 +2,19 @@
<div class="Health"> <div class="Health">
<div class="header"> <div class="header">
<div class="tab-item"> <div class="tab-item">
<h2 style="color: #2c51ce">274</h2> <h2 style="color: #2c51ce">{{ userList.total }}</h2>
<p>返乡人员</p> <p>返乡人员</p>
</div> </div>
<div class="tab-item"> <div class="tab-item">
<h2 style="color: #5aad6a">274</h2> <h2 style="color: #5aad6a">{{ userList.today }}</h2>
<p>今日返乡</p> <p>今日返乡</p>
</div> </div>
<div class="tab-item"> <div class="tab-item">
<h2 style="color: #f5a319">274</h2> <h2 style="color: #f5a319">{{ userList.unReport }}</h2>
<p>今日异常</p> <p>今日异常</p>
</div> </div>
<div class="tab-item"> <div class="tab-item">
<h2 style="color: #cd413a; border-right: 0">274</h2> <h2 style="color: #cd413a; border-right: 0">{{ userList.unusual }}</h2>
<p>异常处理</p> <p>异常处理</p>
</div> </div>
</div> </div>
@@ -36,7 +36,7 @@
<div class="line2"></div> <div class="line2"></div>
<div class="bottom"> <div class="bottoms">
<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> <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> <div class="line3"></div>
@@ -101,7 +101,7 @@ export default {
}, },
], ],
currentTabs: 0, currentTabs: 0,
userList: [],
data: [], data: [],
} }
}, },
@@ -113,6 +113,7 @@ export default {
this.areaId = this.user.areaId this.areaId = this.user.areaId
this.areaName = this.user.areaName this.areaName = this.user.areaName
this.getList() this.getList()
this.getUserList()
}, },
onShow() { onShow() {
document.title = '健康监测' document.title = '健康监测'
@@ -123,7 +124,7 @@ export default {
title: '加载数据中', title: '加载数据中',
}) })
this.$http this.$http
.post('/app/appepidemichealthreport/list', null, { .post('/app/appepidemicreportmember/list', null, {
params: { size: 20, current: this.current, areaId: this.areaId, status: this.currentTabs == 1 ? '0' : '' }, params: { size: 20, current: this.current, areaId: this.areaId, status: this.currentTabs == 1 ? '0' : '' },
}) })
.then((res) => { .then((res) => {
@@ -139,12 +140,36 @@ export default {
}) })
}, },
getUserList() {
uni.showLoading({
title: '加载数据中',
})
this.$http
.post('/app/appepidemicreportmember/statistic')
.then((res) => {
if (res?.code == 0) {
this.userList = res.data
uni.hideLoading()
} else {
uni.hideLoading()
}
})
.catch(() => {
uni.hideLoading()
})
},
goDetail() { goDetail() {
uni.navigateTo({ uni.navigateTo({
url: `./HealthDetail`, url: `./HealthDetail`,
}) })
}, },
areaSelect(e) {
this.areaId = e
this.getList()
},
change(index) { change(index) {
this.data = [] this.data = []
this.areaId = this.user.areaId this.areaId = this.user.areaId
@@ -232,7 +257,11 @@ export default {
background: #f3f6f9; background: #f3f6f9;
} }
.bottom { .bottoms {
.u-tabs {
margin-bottom: -8px;
}
.line3 { .line3 {
height: 4px; height: 4px;
background: #f3f6f9; background: #f3f6f9;

View File

@@ -66,15 +66,59 @@ export default {
data() { data() {
return { return {
data: [], data: [],
id: '',
} }
}, },
computed: { computed: {
...mapState(['user']), ...mapState(['user']),
}, },
watch: {}, watch: {},
onLoad() {}, onLoad(o) {
onShow() {}, if (o.id) {
this.id = o.id
this.getDetail()
}
this.getRecord()
},
onShow() {
document.title = '健康监测'
},
methods: { methods: {
getDetail() {
this.$loading()
this.$http
.post(`/app/appepidemichealthreport/list`)
.then((res) => {
if (res?.code == 0) {
console.log(res.data)
this.data = this.current > 1 ? [...this.data, ...res.data.records] : res.data.records
this.$hideLoading()
} else {
this.$hideLoading()
}
})
.catch(() => {
this.$hideLoading()
})
},
getRecord() {
this.$loading()
this.$http
.post(`/app/appepidemicunusuallog/list`)
.then((res) => {
if (res?.code == 0) {
console.log(res.data)
this.$hideLoading()
} else {
this.$hideLoading()
}
})
.catch(() => {
this.$hideLoading()
})
},
toUserDetail() { toUserDetail() {
uni.navigateTo({ uni.navigateTo({
url: `./UserDetail`, url: `./UserDetail`,

View File

@@ -79,9 +79,32 @@ export default {
components: {}, components: {},
props: {}, props: {},
data() { data() {
return {} return {
id: '',
}
},
onLoad() {},
onShow() {
document.title = '健康监测'
},
methods: {
getDetail() {
this.$loading()
this.$http
.post(`/app/appepidemichealthreport/queryDetailById?memberId=${this.id}`)
.then((res) => {
if (res?.code == 0) {
console.log(res.data)
this.$hideLoading()
} else {
this.$hideLoading()
}
})
.catch(() => {
this.$hideLoading()
})
},
}, },
methods: {},
} }
</script> </script>