CopdDetail.vue 25.2 KB
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 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534
<template>
    <div class="p-3 grow cont-box">
        <div class="p-3 h-full cont-inner">
            <div class="flex justify-between collapse-head mt-2">
                <span class="text-16 font-semibold">全部内容</span>
                <span @click="toggleAll">
                    <span v-if="!collapseAll">展开全部</span>
                    <span v-else>收起全部</span>
                    <span :class="['ml-2 icon-down', { 'icon-down-expanded': collapseAll }]">
                        <doc-icon type="doc-down" />
                    </span>
                </span>
            </div>

            <van-collapse :model-value="activeCollapse" ref="collapse" class="doc-collapse" @change="collapseChange">
                <van-collapse-item key="1" title="居民信息" name="1">
                    <template #right-icon>
                        <doc-icon type="doc-down" />
                    </template>
                    <div class="list">
                        <div v-for="item in columnsBase" :key="item.key">
                            <div class="flex justify-between py-1 border-bottom item">
                                <span class="shrink-0 mr-2 label">{{ item.title }}</span>
                                <span v-if="item.key === 'idCard'">{{ $idCardHide(residentInfo.idCard) || '-' }}</span>
                                <span class="text-end" v-else>
                                    <span>{{ residentInfo[item.key] || '-' }}</span>
                                    <span v-if="item.unit" class="ml-1">{{ item.unit }}</span>
                                </span>
                            </div>
                        </div>
                    </div>
                </van-collapse-item>
                <van-collapse-item key="2" title="症状" name="2">
                    <template #right-icon>
                        <doc-icon type="doc-down" />
                    </template>
                    <div class="list">
                        <div class="flex justify-between py-1 border-bottom item">
                            <span class="shrink-0 mr-2 label">症状</span>
                            <span class="text-end">
                                {{ info.symptomName || '-' }}
                            </span>
                        </div>
                    </div>
                </van-collapse-item>
                <van-collapse-item key="3" title="体征" name="3">
                    <template #right-icon>
                        <doc-icon type="doc-down" />
                    </template>
                    <div class="list">
                        <div v-for="item in columnsPhysical" :key="item.key">
                            <div class="flex justify-between py-1 border-bottom item">
                                <span class="shrink-0 mr-2 label">{{ item.title }}</span>
                                <span class="text-end">
                                    <span>{{ info[item.key] || '-' }}</span>
                                    <span v-if="item.unit" class="ml-1">{{ item.unit }}</span>
                                </span>
                            </div>
                        </div>
                    </div>
                </van-collapse-item>
                <van-collapse-item key="4" title="生活方式指导" name="4">
                    <template #right-icon>
                        <doc-icon type="doc-down" />
                    </template>
                    <div style="color: #262626">吸烟</div>
                    <div class="box">
                        <div>
                            <span>是否正在吸烟:</span>
                            <span>{{ info.isSmokingName }}</span>
                        </div>
                        <div v-if="info.isSmoking === 1">
                            <span>您大约从几岁起开始养成每天或基本每天都吸烟的习惯:</span>
                            <span>{{ info.startSmokeAge || '-' }}岁</span>
                        </div>
                        <div v-if="info.isSmoking === 1 || info.isSmoking === 2">
                            <span>您最近7天是否吸烟:</span>
                            <span>{{ info.lastSevenSmokeName }}</span>
                        </div>
                        <div v-if="info.isSmoking === 1 || info.isSmoking === 2">
                            <span>日吸烟量:</span>
                            <span>{{ info.daySmoking || '-' }}支</span>
                            <span class="ml-4">目标日吸烟量:</span>
                            <span>{{ info.goalDaySmoking || '-' }}支</span>
                        </div>
                    </div>
                    <div style="color: #262626" class="mt-2">运动</div>
                    <div class="box">
                        <div>
                            <span>有无规律活动:</span>
                            <span>{{ info.regularExerciseName }}</span>
                        </div>
                        <div v-if="info.regularExercise === 1">
                            <span>运动强度:</span>
                            <span>{{ info.exerciseStrengthName }}</span>
                        </div>
                        <div v-if="info.regularExercise === 1">
                            <span>目前运动情况:</span>
                            <span>{{ info.nowExerciseWeek || '-' }}次/周、</span>
                            <span>{{ info.nowExerciseMinute || '-' }}分钟/次</span>
                        </div>
                    </div>
                    <div style="color: #262626" class="mt-2">呼吸锻炼</div>
                    <div class="box">
                        <div>
                            <span>有无呼吸锻炼:</span>
                            <span>{{ info.isBreathExerciseName }}</span>
                        </div>
                        <div v-if="info.isBreathExercise === 1">
                            <span>呼吸锻炼频率:</span>
                            <span>{{ info.breathExerciseWeek || '-' }}次/周、</span>
                            <span>{{ info.breathExerciseMinute || '-' }}分钟/次</span>
                        </div>
                    </div>
                    <div class="list mt-2">
                        <div class="flex justify-between py-1 border-bottom item">
                            <span class="shrink-0 mr-2 label">健康教育</span>
                            <span class="text-end">{{ info.healthEducationName || '-' }}</span>
                        </div>
                        <div class="flex justify-between py-1 border-bottom item">
                            <span class="shrink-0 mr-2 label">心理调整</span>
                            <span class="text-end">{{ info.psychologicalRecoveryName || '-' }}</span>
                        </div>
                        <div class="flex justify-between py-1 border-bottom item">
                            <span class="shrink-0 mr-2 label">遵医行为</span>
                            <span class="text-end">{{ info.doctorAdviceName || '-' }}</span>
                        </div>
                    </div>
                </van-collapse-item>
                <van-collapse-item key="5" title="辅助检查" name="5">
                    <template #right-icon>
                        <doc-icon type="doc-down" />
                    </template>
                    <div class="list">
                        <div v-for="item in columnsAuxiliary" :key="item.key">
                            <div class="flex justify-between py-1 border-bottom item">
                                <span class="shrink-0 mr-2 label">{{ item.title }}</span>
                                <span class="text-end">
                                    <span>{{ info[item.key] || '-' }}</span>
                                    <span v-if="item.unit" class="ml-1">{{ item.unit }}</span>
                                </span>
                            </div>
                        </div>
                    </div>
                    <div v-for="(x, xIndex) in inspectList" :key="x.insType">
                        <div style="color: #262626" :class="[xIndex === 0 ? '' : 'mt-2']">{{ x.insName }}</div>
                        <div class="box">
                            <div v-for="y in x.items">
                                <span>{{ y.itemName }}:</span>
                                <span>{{ y.itemValue }}</span>
                                <span class="ml-1">{{ y.unit }}</span>
                            </div>
                        </div>
                    </div>
                </van-collapse-item>
                <van-collapse-item key="6" title="服药依从性" name="6">
                    <template #right-icon>
                        <doc-icon type="doc-down" />
                    </template>
                    <div class="list">
                        <div class="flex justify-between py-1 border-bottom item">
                            <span class="shrink-0 mr-2 label">服药依从性</span>
                            <span class="text-end">{{ info.medicationComplianceName || '-' }}</span>
                        </div>
                    </div>
                </van-collapse-item>
                <van-collapse-item key="7" title="药物不良反应" name="7">
                    <template #right-icon>
                        <doc-icon type="doc-down" />
                    </template>
                    <div class="list">
                        <div class="flex justify-between py-1 border-bottom item">
                            <span class="shrink-0 mr-2 label">药物不良反应</span>
                            <span class="text-end">{{ info.drugsAdverseName || '-' }}</span>
                        </div>
                    </div>
                </van-collapse-item>
                <van-collapse-item key="8" title="此次随访分类" name="8">
                    <template #right-icon>
                        <doc-icon type="doc-down" />
                    </template>
                    <div class="list">
                        <div class="flex justify-between py-1 border-bottom item">
                            <span class="shrink-0 mr-2 label">此次随访分类</span>
                            <span class="text-end">{{ info.visitTypeName || '-' }}</span>
                        </div>
                    </div>
                </van-collapse-item>
                <van-collapse-item key="9" title="目前诊断" name="9">
                    <template #right-icon>
                        <doc-icon type="doc-down" />
                    </template>
                    <div class="list">
                        <div class="flex justify-between py-1 border-bottom item">
                            <span class="shrink-0 mr-2 label">目前诊断</span>
                            <span class="text-end">
                                {{ info.currentDiagnosisName || '-' }}
                            </span>
                        </div>
                    </div>
                    <!-- <div v-for="(x, xIndex) in info.diagnoseInfoList" :key="xIndex">
                        <div style="color: #262626">
                            {{ (store.getDict('CP00086').find(e => e.value === x.currentDiagnoseType)).name }}
                        </div>
                        <div class="box" >
                            <div v-if="x.currentDiagnoseType === 1">
                                <span>高血压分级:</span>
                                <span>{{ x.diagnoseResultValue }}</span>
                                <span class="ml-4">高血压危险分层:</span>
                                <span>{{ x.diagnoseLevelValue }}</span>
                            </div>
                            <div v-if="x.currentDiagnoseType === 2">
                                <span>糖尿病:</span>
                                <span>{{ x.diagnoseResultValue }}</span>
                            </div>
                            <div v-if="x.currentDiagnoseType === 3">
                                <span>冠心病:</span>
                                <span>{{ x.diagnoseResultValue }}</span>
                            </div>
                            <div v-if="x.currentDiagnoseType === 4">
                                <span>缺血性脑卒中:</span>
                                <span>{{ x.diagnoseResultValue || '-' }}</span>
                                <span class="ml-4">出血性脑卒中:</span>
                                <span>{{ x.diagnoseLevelValue }}</span>
                            </div>
                            <div v-if="x.currentDiagnoseType === 5">
                                <span>慢阻肺:</span>
                                <span>{{ x.diagnoseResultValue }}</span>
                            </div>
                            <div v-if="x.currentDiagnoseType === 6">
                                <span>慢性肾病:</span>
                                <span>{{ x.diagnoseResultValue }}</span>
                            </div>
                            <div v-if="x.currentDiagnoseType === 7">
                                <span>血脂异常:</span>
                                <span>{{ x.diagnoseResultValue }}</span>
                            </div>
                            <div>
                                <span>纳入管理日期:</span>
                                <span>{{ x.inclusionManageDate }}</span>
                            </div>
                            <div v-for="(y, yIndex) in x.diagnoseItemList" :key="yIndex">
                                <div>
                                    <span>诊断名称:</span>
                                    <span>{{ y.diagnosisResultName }}</span>
                                </div>
                                <div>
                                    <span>诊断日期:</span>
                                    <span>{{ y.diagnosisDate }}</span>
                                </div>
                                <div>
                                    <span>诊断单位:</span>
                                    <span>{{ y.diagnosisUnitName }}</span>
                                </div>
                                <div>
                                    <span>诊断科室:</span>
                                    <span>{{ y.diagnosisOfficeName }}</span>
                                </div>
                                <div>
                                    <span>诊断医生:</span>
                                    <span>{{ y.diagnosisUserName }}</span>
                                </div>
                            </div>
                        </div>
                    </div> -->
                </van-collapse-item>
                <van-collapse-item key="10" title="用药情况" name="10">
                    <template #right-icon>
                        <doc-icon type="doc-down" />
                    </template>
                    <div class="list">
                        <div class="flex justify-between py-1 border-bottom item">
                            <span class="shrink-0 mr-2 label">是否调整治疗方案</span>
                            <span class="text-end">{{ info.adjustTreatName }}</span>
                        </div>
                    </div>
                    <div v-if="info.adjustTreat === 1">
                        <div style="color: #262626" class="mt-2">用药</div>
                        <div v-for="(item, index) in medicateCase" :key="index" class="box mt-2">
                            <div>
                                <span>药物名称:</span>
                                <span>{{ item.drugName }}</span>
                                <span class="ml-4">剂量:</span>
                                <span class="mr-1">{{ item.dose }}</span>
                                <span>{{ store.getDictValue('CP00081', item.unit) }}</span>
                            </div>
                            <div>
                                <span>频次:</span>
                                <span>{{ store.getDictValue('CP00084', item.frequency) }}</span>
                                <span class="ml-4">用法:</span>
                                <span>{{ store.getDictValue('CP00083', item.usage) }}</span>
                            </div>
                        </div>
                    </div>
                </van-collapse-item>
                <van-collapse-item key="11" title="转诊" name="11">
                    <template #right-icon>
                        <doc-icon type="doc-down" />
                    </template>
                    <div class="list">
                        <div class="flex justify-between py-1 border-bottom item">
                            <span class="shrink-0 mr-2 label">转诊</span>
                            <span class="text-end">{{ info.isReferralName }}</span>
                        </div>
                        <div v-if="info.isReferral === 1" class="flex justify-between py-1 border-bottom item">
                            <span class="shrink-0 mr-2 label">转诊原因</span>
                            <span class="text-end">{{ info.referralReason }}</span>
                        </div>
                        <div v-if="info.isReferral === 1" class="flex justify-between py-1 border-bottom item">
                            <span class="shrink-0 mr-2 label">转诊机构</span>
                            <span class="text-end">{{ info.referralUnitName }}</span>
                        </div>
                        <div v-if="info.isReferral === 1" class="flex justify-between py-1 border-bottom item">
                            <span class="shrink-0 mr-2 label">转诊科室</span>
                            <span class="text-end">{{ info.referralOfficeName }}</span>
                        </div>
                    </div>
                </van-collapse-item>
                <van-collapse-item key="12" title="现场随访照片" name="12">
                    <template #right-icon>
                        <doc-icon type="doc-down" />
                    </template>
                    <div>
                        <image-preview :img-list='info.visitImageList'></image-preview>
                    </div>
                </van-collapse-item>
                <van-collapse-item key="13" title="下次随访日期" name="13">
                    <template #right-icon>
                        <doc-icon type="doc-down" />
                    </template>
                    <div class="list">
                        <div class="flex justify-between py-1 border-bottom item">
                            <span class="shrink-0 mr-2 label">下次随访日期</span>
                            <span class="text-end">{{ info.nextVisitDate }}</span>
                        </div>
                    </div>
                </van-collapse-item>
                <van-collapse-item key="14" title="随访机构" name="14">
                    <template #right-icon>
                        <doc-icon type="doc-down" />
                    </template>
                    <div class="list">
                        <div v-for="item in columnsOrg" :key="item.key">
                            <div class="flex justify-between py-1 border-bottom item">
                                <span class="shrink-0 mr-2 label">{{ item.title }}</span>
                                <span class="text-end">{{ info[item.key] }}</span>
                            </div>
                        </div>
                    </div>
                </van-collapse-item>
            </van-collapse>
        </div>
    </div>
</template>
<script>
import { fetchDataHandle } from '@/utils/common.js'
import { useStore } from '@/resident/store/index.js'
import ImagePreview from '@/residentWX/components/imagePreview/imagePreview'
export default {
    components: { ImagePreview },
    props: {
        visitInfo: {
            type: Object,
            default: () => {}
        }
    },
    data() {
        return {
            info: {},
            store: useStore(),
            // 辅助检查
            inspectList: [],
            // 用药情况
            medicateCase: [],
            // 全部展开、收起
            collapseAll: false,
            activeCollapse: [],
            // 居民信息
            columnsBase: [
                { title: '姓名', key: 'residentName' },
                { title: '证件号码', key: 'idCard' },
                { title: '性别', key: 'genderName' },
                { title: '出生日期', key: 'dataBirth' },
                { title: '年龄', key: 'currentAge' },
                { title: '民族', key: 'nationalName' },
                { title: '本人电话', key: 'telephone' },
                { title: '现住址', key: 'presentCodeName' },
                { title: '详细地址', key: 'nowAddress' },
                { title: '户籍地址', key: 'registeredCodeName' },
                { title: '详细地址', key: 'permanentAddress' }
            ],
            // 体征
            columnsPhysical: [
                { title: '身高', key: 'signHeight', unit: 'cm' },
                { title: '体重', key: 'signWeight', unit: 'kg' },
                { title: 'BMI', key: 'signBmi', unit: 'kg/m²' },
                { title: '口唇紫绀', key: 'signCyanosisName' },
                { title: '下肢水肿', key: 'signEdemaName' },
                { title: '其他', key: 'signOther' }
            ],
            // 辅助检查
            columnsAuxiliary: [
                { title: 'FEV1', key: 'fev1', unit: 'L' },
                { title: 'FVC', key: 'fvc', unit: 'L' },
                { title: 'FEV1%pred', key: 'fev1Pred', unit: '%' },
                { title: 'FVC%pred', key: 'fvcPred', unit: '%' },
                { title: 'FEV1/FVC', key: 'fev1Fvc', unit: '%' },
            ],
            // 随访机构
            columnsOrg: [
                { title: '随访日期', key: 'visitDate' },
                { title: '随访单位', key: 'visitUnitName' },
                { title: '随访科室', key: 'visitOfficeName' },
                { title: '随访医生', key: 'visitDoctorName' },
                { title: '录入日期', key: 'createDate' },
                { title: '录入单位', key: 'createUnitName' },
                { title: '录入科室', key: 'createOfficeName' },
                { title: '录入医生', key: 'createDoctorName' },
            ]
        }
    },
    computed: {
        residentInfo() {
            return this.info.residentsRecord || {}
        }
    },
    methods: {
        dataHandle() {
            // 字符串转数组
            const form = fetchDataHandle(this.visitInfo, {
                auxiliaryExamination: 'strToArrNum'
            })
            this.info = form
            // 辅助检查处理
            let { auxiliaryExamination = [], inspectList = [], medicateCase = [] } = form
            let list = []
            auxiliaryExamination.forEach(item => {
                const items = inspectList.filter(e => e.insType === item)
                if (items.length > 0) {
                    list.push({
                        insType: items[0].insType,
                        insName: items[0].insName,
                        items: [...items]
                    })
                }
            })
            this.inspectList = list
            // 用药情况处理
            this.medicateCase = JSON.parse(medicateCase)
            console.log(2, form)
        },
        // 全部展开、收起
        toggleAll() {
            if (this.collapseAll) {
                this.activeCollapse = []
            } else {
                let list = []
                for (let i = 1; i < 15; i++) {
                    list.push(i.toString())
                }
                this.activeCollapse = list
            }
            this.collapseAll = !this.collapseAll
        },
        // 折叠面板切换
        collapseChange(val) {
            if (val && val.length <= 2) {
                this.activeCollapse = val.slice(val.length - 1)
            } else {
                if (this.activeCollapse.length > val.length) {
                    this.activeCollapse = val
                }
                if (this.activeCollapse.length < val.length) {
                    this.activeCollapse = val.slice(val.length - 1)
                }
            }
            if (val.length === 14) {
                this.collapseAll = true
            } else {
                this.collapseAll = false
            }
        }
    },
    watch: {
        visitInfo: {
            handler() {
                console.log(1, this.visitInfo)
                this.dataHandle()
            }
        }
    }
}
</script>
<style lang="less" scoped>
.cont-box {
    background-color: #f9f9f9;

    .cont-inner {
        background: linear-gradient(to bottom, #DFF5F4, #fff .6rem);
        border-top-left-radius: .08rem;
        border-top-right-radius: .08rem;
    }
}

.collapse-head {
    .icon-down {
        vertical-align: middle;
        font-size: .12rem;

        .svg-icon {
            transition: all .2s;
        }
    }

    .icon-down-expanded {
        .svg-icon {
            transform: rotate(-180deg);
        }
    }
}

.list {
    color: #262626;
    .label {
        min-width: 5em;
    }
}
.box {
    background: #F8FAFC;
    padding: 8px;
    color: #4D5665;

}
</style>