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
126
127
128
129
130
131
132
<template>
<div>
<van-nav-bar title='新增死亡记录' left-text='' left-arrow
@click-left='toBack'></van-nav-bar>
<div class='p-4 h-overflow' ref='all'>
<archive-common :info='info'
v-show='step == 1'
ref='baseInfo'
></archive-common>
<death-record-form
v-show='step == 2'
ref='deathRecordForm'
></death-record-form>
</div>
<div class='bottom-small-line'></div>
<div class='pt-2 pb-2'>
<div class='px-5 grow flex flex-col justify-end' v-if='step == 1'>
<van-button type='primary' block round
@click='toNext(2)'>下一步
</van-button>
</div>
<div class='px-5 grow flex flex-col justify-end' v-if='step == 2'>
<van-button type='primary' block round
@click='onsubmit'>提交
</van-button>
</div>
</div>
</div>
</template>
<script>
import { useStore } from '@/doctor/store'
import ArchiveCommon from '@/doctor/components/archiveCommon/archiveCommon'
import DeathRecordForm from '@/doctor/deathRecord/form/DeathRecordForm'
import { getChronicResidentsId } from '@/api/doctor/generalFU'
import { saveResidentsDeath } from '@/api/doctor/death'
export default {
name: 'deathRecordIndex',
components: { DeathRecordForm, ArchiveCommon },
data() {
return {
store: useStore(),
info: {},
resident: {},
step: 1
}
},
computed: {
routerDetail() {
return this.$route.query
},
authInfo() {
return this.store.authInfo
}
},
created() {
this.init()
},
methods: {
async init() {
this.info = {}
const res = await getChronicResidentsId(this.routerDetail.residentInfoId)
const {
id,
createDate,
createDoctorId,
createDoctorName,
createOfficeId,
createOfficeName,
createUnitId,
createUnitName,
updated,
...others
} = res.data
this.info = {
personId: id,
...others
}
},
async toNext(val) {
this.$refs.all.scrollTo(0, 0)
if (val == 2) {
await this.$refs.baseInfo.onSubmit()
}
this.step = val
},
async onsubmit() {
let baseInfo = await this.$refs.baseInfo.onSubmit()
let deathRecordForm = await this.$refs.deathRecordForm.onSubmit()
let params = {
residentInfoId: this.routerDetail.residentInfoId,
createUnitId: this.authInfo.unitId,
createUnitName: this.authInfo.unitName,
// 录入科室
createOfficeId: this.authInfo.officeId,
createOfficeName: this.authInfo.officeName,
// 录入医生
createDoctorId: this.authInfo.relationId,
createDoctorName: this.authInfo.nickName,
residentsRecord: baseInfo,
...deathRecordForm
}
saveResidentsDeath(params).then(res => {
this.store.onRefreshMark()
this.$router.back()
})
},
toBack() {
if (this.step != 1) {
this.step--
return
}
this.$router.back()
}
}
}
</script>
<style scoped lang='less'>
:deep(.van-nav-bar .van-icon) {
color: #000000;
}
.h-overflow {
height: calc(100vh - 110px);
overflow-y: auto;
}
</style>