1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<template>
<div class="pb-5 flex flex-col" style="height: 100vh;">
<div class="p-3 text-16 text-black text-center shrink-0 top-bar">
<span class="back-bt" v-if="step >= 2">
<span @click="onClose" v-if="[5].includes(step)">
<doc-icon type="doc-close" />
</span>
<span @click="onBack" v-else>
<doc-icon type="doc-left" />
</span>
</span>
<span>居民慢病筛查</span>
</div>
<div class="grow overflow-y-auto">
<div ref="top"></div>
<IdCheck v-show="step === 1"/>
<CheckTip v-if="step === 2"/>
<!-- 居民基础信息 -->
<BaseInfo v-else-if="step === 3"/>
<!-- 筛查表单 -->
<ScreenInfo v-else-if="step === 4"/>
<!-- 筛查结果 -->
<Result v-else-if="step === 5"/>
</div>
</div>
</template>
<script>
import { computed } from 'vue'
import { showNotify } from 'vant'
import { backHome } from '@/utils/common.js'
import IdCheck from './IdCheck.vue'
import CheckTip from './CheckTip.vue'
import BaseInfo from './BaseInfo.vue'
import ScreenInfo from './ScreenInfo.vue'
import Result from './Result.vue'
export default {
components: {
IdCheck,
CheckTip,
BaseInfo,
ScreenInfo,
Result
},
data() {
return {
// 操作步骤
step: 1,
setpHistory: [1],
// 查询信息
checkInfo: {},
// 表单暂时保存的信息
recordForm: {}
}
},
provide() {
return {
checkInfo: computed(() => this.checkInfo),
recordForm: computed(() => this.recordForm)
}
},
computed: {
routeQuery() {
return this.$route.query
},
doctorId() {
return this.routeQuery.doctorId
}
},
created() {
if (!this.doctorId) {
showNotify({ type: 'warning', message: '未获取到医生信息' })
return
}
this.recordForm.doctorId = this.doctorId
},
methods: {
onNext(step) {
this.step = step ? step : this.step + 1
this.setpHistory.push(this.step)
const dom = this.$refs.top
console.log(dom)
dom && dom.scrollIntoView()
},
onBack() {
if (this.step === 1) return
this.setpHistory.pop()
this.step = this.setpHistory[this.setpHistory.length - 1]
if (this.step === 1) {
this.recordForm = {}
this.checkInfo = {}
this.recordForm.doctorId = this.doctorId
}
},
onClose() {
backHome()
}
}
}
</script>
<style lang="less" scoped>
@import '../../../utils/common.less';
</style>