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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<template>
<div class="h-full flex flex-col diagnose-form">
<DocNavBar :title="`${id ? '修改' : '新增'}慢病诊断`" class="shrink-0"
:backFunc="onBack"></DocNavBar>
<div class="p-4 overflow-y-auto grow" ref="all">
<DiseaseSelect v-if="step == 1" :excludeType="excludeType" ref="DiseaseSelect"/>
<archiveCommon :info="baseInfo" v-else-if="step == 2"></archiveCommon>
<FormCont :diseaseType="innerDiseaseType" v-else-if="step == 3"/>
</div>
<div class="shrink-0">
<div class='bottom-small-line'></div>
<div class='px-5 py-2 grow flex justify-between'>
<template v-if='step == 1'>
<van-button type='primary' block round
@click='toNext'>下一步</van-button>
</template>
<template v-else-if="step == 3">
<van-button type='primary' block round
@click='submit'>提交</van-button>
</template>
<template v-else>
<van-button type='primary' round plain style='width: 48%'
@click='toPrev'>上一步
</van-button>
<van-button type='primary' round style='width: 48%'
@click='toNext'>下一步
</van-button>
</template>
</div>
</div>
</div>
</template>
<script>
import DocNavBar from '@/doctor/components/docNavBar/DocNavBar.vue'
import archiveCommon from '@/doctor/components/archiveCommon/archiveCommon.vue'
import DiseaseSelect from './DiseaseSelect.vue'
import FormCont from './FormCont.vue'
import { getChronicResidentsId } from '@/api/doctor/generalFU'
import { showSuccessToast } from 'vant'
export default {
components: {
DocNavBar,
archiveCommon,
DiseaseSelect,
FormCont
},
data() {
return {
step: 1,
// 患者基础信息
baseInfo: {},
innerDiseaseType: null
}
},
computed: {
id() {
return this.$route.query.id
},
diseaseType() {
return this.$route.query.diseaseType
},
residentInfoId() {
return this.$route.query.residentInfoId
},
excludeType() {
const excludeType = this.$route.query.excludeType
return excludeType && excludeType.split(',').map(e => Number(e))
}
},
created() {
this.init()
},
methods: {
async init() {
if (this.id) {
} else {
let res = await getChronicResidentsId(this.residentInfoId)
this.baseInfo = res.data || {}
}
},
submit() {
showSuccessToast('提交成功')
setTimeout(() => {
this.$router.replace({
path: '/doctor/workbench'
})
}, 600)
},
// 上一步
toPrev() {
this.onStep(this.step -1)
},
async toNext() {
try {
if (this.step == 1) {
const diseaseType = await this.$refs.DiseaseSelect.submit()
console.log(diseaseType)
this.innerDiseaseType = diseaseType
}
this.onStep(this.step + 1)
} catch (e) {
console.warn(e)
}
},
onStep(val) {
this.$refs.all.scrollTo(0, 0)
this.step = val
},
onBack() {
if (this.step == 1) {
this.$router.back()
} else {
this.step--
}
}
}
}
</script>
<style lang="less" scoped>
</style>