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
<template>
<div>
<van-nav-bar
:title="routeQuery.id ? '修改专病随访' : '新增专病随访'"
left-arrow
@click-left="toBack">
</van-nav-bar>
<div class="p-4 h-overflow">
<BaseInfo v-if="step === 1" ref="baseInfo"></BaseInfo>
<FormCont v-if="step === 2" ref="formCont" :baseInfo="baseInfo" :diseaseInfo="diseaseInfo"></FormCont>
</div>
<div class="bottom-small-line"></div>
<div class="p-4">
<van-button v-if="step === 1" type="primary" block round @click="toNext">下一步</van-button>
<van-button v-if="step === 2" type="primary" block round @click="onSubmit">提交</van-button>
</div>
</div>
</template>
<script>
import BaseInfo from './BaseInfo.vue'
import FormCont from './FormCont.vue'
import { useStore } from '@/doctor/store'
export default {
components: { BaseInfo, FormCont },
data() {
return {
store: useStore(),
step: 1,
baseInfo: {},
diseaseInfo: {}
}
},
computed: {
routeQuery() {
return this.$route.query
}
},
created() {
},
methods: {
toBack() {
if (this.step === 1) {
this.$router.back()
} else {
this.step = 1
}
},
async toNext() {
const { baseInfo, diseaseInfo } = await this.$refs.baseInfo.onSubmit()
this.baseInfo = baseInfo
this.diseaseInfo = diseaseInfo
this.step = 2
},
onSubmit() {
this.$refs.formCont.submit().then(() => {
this.$message.success('新增成功')
// this.$router.go(-1)
this.$router.replace({
path: '/doctor/patient-detail',
query: {
residentInfoId: this.routeQuery.residentInfoId
}
})
this.store.onRefreshMark()
})
}
}
}
</script>
<style lang="less" scoped>
.h-overflow {
height: calc(100vh - 124px);
overflow: auto;
}
.bottom-small-line {
height: 1px;
box-shadow: 0 0.5Px #D7DADE;
}
</style>