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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<template>
<van-form ref="form">
<div class="label-title" required>专病名称</div>
<van-field
v-model="form.diseaseTypeName"
isLink
readonly
placeholder="请选择"
:rules="rules.diseaseTypeName"
@click="showDiseaseType = true"
class="form-input"
/>
<van-popup v-model:show="showDiseaseType" position="bottom">
<div class="p-4" style="height: 100%">
<div class="flex justify-between items-center mb-4 pop-title">
<div class="greyColor" @click="showDiseaseType = false">取消</div>
<div>专病名称(单选)</div>
<div></div>
</div>
<div style="height: 80%; overflow: auto">
<CheckBtn
clearable
column-1
:options="store.getDict('CP00117')"
v-model:value="form.diseaseType"
:fieldNames="{ text: 'name', value: 'value' }"
@change="diseaseTypeChange"
/>
</div>
</div>
</van-popup>
<div class="label-title mt-5" required>请选择</div>
<van-field :rules="rules.serveType" style="padding: 0" class="mb-5">
<template #input>
<van-radio-group
v-model="form.serveType"
shape="dot"
direction="horizontal"
class="doc-radio-group"
>
<van-radio :name="3" label-position="left">新增专病随访(常规)</van-radio>
<van-radio :name="4" label-position="left">新增专病随访(增加)</van-radio>
</van-radio-group>
</template>
</van-field>
<ArchiveCommon ref="archive" :info="info"></ArchiveCommon>
</van-form>
</template>
<script>
import { useStore } from '@/doctor/store'
import ArchiveCommon from '@/doctor/components/archiveCommon/archiveCommon.vue'
import { getChronicResidentsId } from '@/api/doctor/generalFU'
import CheckBtn from '@/doctor/components/checkBtn/CheckBtn.vue'
export default {
components: { ArchiveCommon, CheckBtn },
data() {
return {
store: useStore(),
form: {},
rules: {
diseaseTypeName: [
{ required: true, message: '请选择' }
],
serveType: [
{ required: true, message: '请选择' }
]
},
showDiseaseType: false,
showCertificateType: false,
info: {}
}
},
computed: {
residentInfoId() {
return this.$route.query.residentInfoId
},
diseaseType() {
return this.$route.query.diseaseType
}
},
created() {
this.init()
},
methods: {
async init() {
const res = await getChronicResidentsId(this.residentInfoId)
this.info = res.data || {}
},
diseaseTypeChange() {
this.store.getDict('CP00117').forEach(item => {
if (item.value === this.form.diseaseType) {
this.form.diseaseTypeName = item.name
}
})
this.showDiseaseType = false
},
async onSubmit() {
const baseInfo = await this.$refs.archive.onSubmit()
return new Promise((resolve, reject) => {
this.$refs.form.validate().then(() => {
resolve({
baseInfo,
diseaseInfo: this.form
})
}).catch(e => {
})
})
// let baseInfo = {}
// try {
// baseInfo = await this.$refs.archive.onSubmit()
// } catch(e) {
// }
}
}
}
</script>
<style lang="less" scoped>
.label-title {
font-size: 13px;
color: #595959;
font-weight: 500;
margin-bottom: 8px;
&[required] {
&::after {
content: '*';
color: #FF4D4F;
font-weight: bold;
margin-left: 4px;
}
}
}
.form-input {
background-color: #FAFAFA;
padding: 8px 12px;
border-radius: 8px;
}
:deep(.van-cell:after) {
border-bottom: 0px;
}
:deep(.van-popup) {
height: 50% !important;
}
.greyColor {
color: var(--van-text-color-2);
font-weight: 400;
}
</style>