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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
<template>
<div>
<div class="label-title mt-2">{{ diseaseType === 1 ? '辅助检查' : '其他检查' }}</div>
<van-field
v-model="form.auxiliaryExaminationName"
isLink
readonly
placeholder="请选择"
@click="showAuxiliaryExamination = true"
class="form-input"
/>
<van-popup v-model:show="showAuxiliaryExamination" position="bottom">
<div class="p-4" style="height: 100%">
<div class="flex justify-between items-center mb-4 pop-title">
<div class="greyColor" @click="showAuxiliaryExamination = false">取消</div>
<div>辅助检查(可多选)</div>
<div class="blueColor" @click="auxiliaryConfirm">确定</div>
</div>
<div style="height: 80%; overflow: auto">
<CheckBtn
multiple
column-2
:options="dictList"
v-model:value="form.auxiliaryExamination"
:fieldNames="{ text: 'name', value: 'value' }"
/>
</div>
</div>
</van-popup>
<div v-for="x in viewData" :key="x.insType" class="bg-fa mt-2">
<div class="label-title" required style="color: #262626; font-size: 14px">{{ x.insName }}</div>
<template v-for="y in x.items" :key="y.itemCode" v-if="x.insType !== 99">
<van-field
:label="getItemName(y)"
v-model="y.itemValue"
:rules="getRule(y)"
placeholder="请输入"
class="card-input mt-2"
v-if="y.itemType === 1"
>
<template #extra v-if="y.unit">
<span class="ml-1">{{ y.unit }}</span>
</template>
</van-field>
<van-field
:label="getItemName(y)"
is-link
:modelValue="y.itemValue"
:rules="getRule(y)"
readonly
placeholder="请选择或录入"
@click="setSelectOption(y, y.itemType)"
class="card-input mt-2"
v-if="y.itemType === 4"
>
<template #extra v-if="y.unit">
<span class="ml-1">{{ y.unit }}</span>
</template>
</van-field>
</template>
<template v-for="y in x.items" :key="y.itemCode" v-if="x.insType === 99">
<div style="background-color: #fff; padding: 8px; border-radius: 8px">
<div class="label-title">检查结果</div>
<van-field style="padding: 0">
<template #input>
<van-radio-group
v-model="y.itemValue"
shape="dot"
direction="horizontal"
class="w-full doc-radio-group"
>
<van-radio
v-for="item in store.getDict('CP00157')"
:key="item.value"
:name="item.value"
label-position="left"
>
{{ item.name }}
</van-radio>
</van-radio-group>
</template>
</van-field>
<van-field
v-if="y.itemValue === 2"
v-model="y.abnormalSituation"
placeholder="异常情况"
class="form-input mt-2"
/>
</div>
<div v-if="y.itemValue === 2" style="background-color: #fff; padding: 8px; border-radius: 8px" class="mt-2">
<div class="label-title">影像报告</div>
<DocImageUpload
description="最多支持上传4个文件,支持上传图片或PDF文件,图片支持上传jpg、png、jpeg格式,文件大小请勿超过10M。"
:imageData="y.picturesList"
@change="(ids, option) => y.img = ids"
:maxLength="4">
</DocImageUpload>
</div>
</template>
</div>
<InputSelect
v-model:show="selectOption.show4"
:dict="selectOption.dict"
@change="onSelectInputConfirm">
</InputSelect>
</div>
</template>
<script>
import { useStore } from '@/doctor/store'
import { getInspectCode } from '@/api/doctor/separateFU'
import CheckBtn from '@/doctor/components/checkBtn/CheckBtn.vue'
import InputSelect from '@/doctor/diagnose/common/InputSelect.vue'
import DocImageUpload from '@/doctor/components/docImageUpload/DocImageUpload.vue'
export default {
components: { CheckBtn, InputSelect, DocImageUpload },
props: {
form: {
type: Object,
default: () => {}
},
diseaseInfo: {
type: Object,
default: () => {}
}
},
data() {
return {
store: useStore(),
showAuxiliaryExamination: false,
inspectList: [],
viewData: [],
selectOption: {
show4: false,
item: {},
dict: []
}
}
},
computed: {
diseaseType() {
return this.diseaseInfo.diseaseType
},
dictList() {
if (this.diseaseInfo.diseaseType === 1) return this.store.getDict('CP00073')
if (this.diseaseInfo.diseaseType === 2) return this.store.getDict('CP00074')
}
},
async created() {
// this.inspectList = await this.getCode()
// this.dataProcess()
},
methods: {
auxiliaryConfirm() {
let list = []
this.dictList.forEach(item => {
let selected = this.form.auxiliaryExamination.filter(e => e === item.value)
if (selected && selected.length) {
list.push(item.name)
}
})
this.form.auxiliaryExaminationName = list.join()
this.showAuxiliaryExamination = false
let inspectList = []
this.form.auxiliaryExamination.forEach(item => {
const items = this.inspectList.filter(e => e.insType === item)
inspectList.push({
insType: items[0].insType,
insName: items[0].insName,
items: [...items]
})
})
this.viewData = inspectList
},
getCode() {
return new Promise((resolve, reject) => {
getInspectCode(1).then(res => {
// 删除肾功能下的尿素氮,只保留血肌酐
let array = res.data.filter(item => !(item.insType === 4 && item.itemCode === 'BUN'))
let list = []
list = [
...array,
{
configType: 2,
insType: 99,
insName: '心电图',
itemCode: '99-1',
itemName: null,
itemType: 2
},
{
configType: 2,
insType: 34,
insName: '并发症检查',
itemCode: '34-1',
itemName: null,
itemType: 1
}
]
resolve(list)
})
})
},
setSelectOption(item, itemType) {
this.selectOption['show' + itemType] = true
this.selectOption.item = item
this.selectOption.dict = item.dictItemList
},
onSelectInputConfirm(option) {
this.selectOption.item.itemValue = option.value
this.selectOption.show4 = false
},
submit() {
return new Promise((resolve, reject) => {
let list = []
this.viewData.forEach(x => {
x.items.forEach(y => {
list.push({
diseaseType: this.diseaseInfo.diseaseType,
dataType: y.configType,
insType: y.insType,
insName: y.insName,
itemCode: y.itemCode,
itemName: y.itemName,
itemType: y.itemType,
itemValue: y.itemValue,
abnormalSituation: y.abnormalSituation,
img: y.img,
unit: y.unit
})
})
})
resolve(list)
})
},
getRule(item) {
if (!item.pattern) {
return [{ required: true, message: '请录入' }]
}
return [
{ required: true, message: '请录入' },
{ pattern: new RegExp(item.pattern), message: item.message }
]
},
getItemName(item) {
if (!item.itemName) {
return ''
}
return `${item.itemName}(${item.itemCode}) : `
},
dataProcess() {
let { inspectList = [], auxiliaryExamination = [] } = this.form
let list = []
inspectList.forEach(x => {
this.inspectList.forEach(y => {
if (x.insType === y.insType && x.itemCode === y.itemCode) {
if (y.insType === 99) {
y.itemValue = parseInt(x.itemValue)
} else {
y.itemValue = x.itemValue
}
y.abnormalSituation = x.abnormalSituation
y.img = x.img
y.picturesList = x.picturesList
list.push(y)
}
})
})
let array = []
auxiliaryExamination?.forEach(x => {
const items = list.filter(e => e.insType === x)
if (items.length > 0) {
array.push({
insType: items[0].insType,
insName: items[0].insName,
items: [...items]
})
}
})
this.viewData = array
}
},
watch: {
'form.inspectList': {
async handler() {
this.inspectList = await this.getCode()
this.dataProcess()
},
immediate: true
}
}
}
</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;
}
.pop-title {
color: #262626;
font-size: 16px;
font-weight: 600;
}
.greyColor {
color: var(--van-text-color-2);
font-weight: 400;
}
.blueColor {
color: #607FF0;
font-weight: 500;
}
.bg-fa {
background-color: #FAFAFA;
padding: 8px;
border-radius: 8px;
}
.card-input {
padding: 8px 12px;
border-radius: 8px;
}
</style>