版本更新
This commit is contained in:
@@ -0,0 +1,421 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="添加中医诊断"
|
||||
v-model="props.openAddDiagnosisDialog"
|
||||
width="1500px"
|
||||
append-to-body
|
||||
destroy-on-close
|
||||
@open="handleOpen"
|
||||
@close="close"
|
||||
>
|
||||
<div class="main-content">
|
||||
<!-- 左侧疾病选择区 -->
|
||||
<div class="disease-section">
|
||||
<div class="section-title">诊断</div>
|
||||
<div class="search-box">
|
||||
<el-input v-model="searchDisease" placeholder="搜索疾病名称或编码" clearable>
|
||||
<template #prefix>
|
||||
<el-icon><search /></el-icon>
|
||||
</template>
|
||||
</el-input>
|
||||
</div>
|
||||
<el-table
|
||||
:data="conditionList"
|
||||
max-height="460"
|
||||
@row-click="handleClickRow"
|
||||
highlight-current-row
|
||||
>
|
||||
<el-table-column label="疾病名称" align="center" prop="name"></el-table-column>
|
||||
<el-table-column label="医保编码" align="center" prop="ybNo"></el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<!-- 中间疾病-证型关系区 -->
|
||||
<div class="syndrome-section">
|
||||
<div class="section-title">证候</div>
|
||||
<div class="search-box">
|
||||
<el-input v-model="searchDisease" placeholder="搜索疾病名称或编码" clearable>
|
||||
<template #prefix>
|
||||
<el-icon><search /></el-icon>
|
||||
</template>
|
||||
</el-input>
|
||||
</div>
|
||||
<div v-if="selectedDisease">
|
||||
<el-table
|
||||
:data="syndromeList"
|
||||
max-height="460"
|
||||
@row-click="clickSyndromeRow"
|
||||
highlight-current-row
|
||||
>
|
||||
<el-table-column label="证候名称" align="center" prop="name"></el-table-column>
|
||||
<el-table-column label="医保编码" align="center" prop="ybNo"></el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<div class="empty-state" v-else>
|
||||
<el-empty description="请从左侧选择疾病" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 右侧诊断详情区 -->
|
||||
<div class="diagnosis-section">
|
||||
<div class="section-title">诊断详情</div>
|
||||
<div class="diagnosis-list">
|
||||
<div v-for="(item, index) in tcmDiagonsisList" :key="index" class="history-item">
|
||||
<div class="history-diagnosis">
|
||||
<div>
|
||||
<strong>{{ item.conditionName }}</strong> - {{ item.syndromeName }}
|
||||
</div>
|
||||
<el-button
|
||||
size="small"
|
||||
type="danger"
|
||||
plain
|
||||
icon="close"
|
||||
@click="removeDiagnosis(item, index)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
<el-button @click="close">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
getTcmCondition,
|
||||
getTcmSyndrome,
|
||||
saveTcmDiagnosis,
|
||||
} from '@/views/doctorstation/components/api';
|
||||
|
||||
const props = defineProps({
|
||||
openAddDiagnosisDialog: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
patientInfo: {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
|
||||
const conditionList = ref([]);
|
||||
const syndromeList = ref([]);
|
||||
const tcmDiagonsisList = ref([]);
|
||||
const tcmDiagonsisSaveList = ref([]);
|
||||
const syndromeSelected = ref(false); // 当前诊断是否选择对应证候
|
||||
const timestamp = ref('');
|
||||
const selectedDisease = ref(false);
|
||||
const { proxy } = getCurrentInstance();
|
||||
const emit = defineEmits(['close']);
|
||||
|
||||
function handleOpen() {
|
||||
getTcmCondition().then((res) => {
|
||||
conditionList.value = res.data.records;
|
||||
});
|
||||
}
|
||||
|
||||
// 点击诊断列表处理,点击以后才显示证候列表
|
||||
function handleClickRow(row) {
|
||||
if (syndromeSelected.value || tcmDiagonsisList.value == 0) {
|
||||
selectedDisease.value = true;
|
||||
syndromeSelected.value = false;
|
||||
timestamp.value = Date.now();
|
||||
getTcmSyndrome().then((res) => {
|
||||
syndromeList.value = res.data.records;
|
||||
});
|
||||
tcmDiagonsisSaveList.value.push({
|
||||
definitionId: row.id,
|
||||
ybNo: row.ybNo,
|
||||
syndromeGroupNo: timestamp.value,
|
||||
verificationStatusEnum: 4,
|
||||
medTypeCode: '11',
|
||||
});
|
||||
tcmDiagonsisList.value.push({
|
||||
conditionName: row.name,
|
||||
syndromeGroupNo: timestamp.value,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function clickSyndromeRow(row) {
|
||||
tcmDiagonsisSaveList.value.push({
|
||||
definitionId: row.id,
|
||||
ybNo: row.ybNo,
|
||||
syndromeGroupNo: timestamp.value,
|
||||
});
|
||||
tcmDiagonsisList.value[tcmDiagonsisList.value.length - 1].syndromeName = row.name;
|
||||
syndromeSelected.value = true;
|
||||
}
|
||||
|
||||
// 删除诊断
|
||||
function removeDiagnosis(row, index) {
|
||||
tcmDiagonsisList.value.splice(index, 1);
|
||||
tcmDiagonsisSaveList.value = tcmDiagonsisSaveList.filter((item) => {
|
||||
return item.syndromeGroupNo !== row.syndromeGroupNo;
|
||||
});
|
||||
}
|
||||
|
||||
function save() {
|
||||
saveTcmDiagnosis({
|
||||
patientId: props.patientInfo.patientId,
|
||||
encounterId: props.patientInfo.encounterId,
|
||||
diagnosisChildList: tcmDiagonsisSaveList.value,
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
emit('close');
|
||||
proxy.$modal.msgSuccess('诊断已保存');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function submit() {
|
||||
if (tcmDiagonsisSaveList.value.length > 0 && syndromeSelected.value) {
|
||||
save();
|
||||
} else {
|
||||
proxy.$modal.msgWarning('请选择证候');
|
||||
}
|
||||
}
|
||||
function close() {
|
||||
emit('close');
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
:deep(.pagination-container .el-pagination) {
|
||||
right: 20px !important;
|
||||
}
|
||||
|
||||
.app-container {
|
||||
max-width: 1400px;
|
||||
margin: 20px auto;
|
||||
padding: 20px;
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding-bottom: 15px;
|
||||
border-bottom: 1px solid var(--el-border-color);
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.header h1 {
|
||||
color: var(--el-color-primary);
|
||||
font-size: 24px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.patient-info {
|
||||
background: var(--el-color-primary-light-9);
|
||||
padding: 15px;
|
||||
border-radius: 8px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.patient-info .info-row {
|
||||
display: flex;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.patient-info .info-label {
|
||||
width: 100px;
|
||||
color: var(--el-text-color-secondary);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.main-content {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr 1.2fr;
|
||||
gap: 20px;
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
|
||||
.disease-section,
|
||||
.syndrome-section,
|
||||
.diagnosis-section {
|
||||
border: 1px solid var(--el-border-color);
|
||||
border-radius: 8px;
|
||||
padding: 20px;
|
||||
background: white;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
color: var(--el-color-primary);
|
||||
margin-bottom: 15px;
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 1px solid var(--el-border-color);
|
||||
}
|
||||
|
||||
.disease-list {
|
||||
max-height: 400px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.disease-item {
|
||||
padding: 12px 15px;
|
||||
border-bottom: 1px solid var(--el-border-color-lighter);
|
||||
cursor: pointer;
|
||||
transition: all 0.3s;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.disease-item:hover {
|
||||
background-color: var(--el-color-primary-light-9);
|
||||
}
|
||||
|
||||
.disease-item.active {
|
||||
background-color: var(--el-color-primary-light-8);
|
||||
border-left: 3px solid var(--el-color-primary);
|
||||
}
|
||||
|
||||
.disease-name {
|
||||
font-weight: 500;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.disease-code {
|
||||
font-size: 12px;
|
||||
color: var(--el-text-color-secondary);
|
||||
}
|
||||
|
||||
.search-box {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.disease-categories {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.category-tag {
|
||||
cursor: pointer;
|
||||
padding: 5px 12px;
|
||||
border-radius: 15px;
|
||||
background: var(--el-fill-color-light);
|
||||
font-size: 13px;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
|
||||
.category-tag.active {
|
||||
background: var(--el-color-primary);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.relation-container {
|
||||
text-align: center;
|
||||
padding: 30px 0;
|
||||
border: 2px dashed var(--el-border-color);
|
||||
border-radius: 8px;
|
||||
margin: 20px 0;
|
||||
background: var(--el-fill-color-lighter);
|
||||
}
|
||||
|
||||
.relation-icon {
|
||||
margin-bottom: 15px;
|
||||
color: var(--el-color-primary);
|
||||
}
|
||||
|
||||
.relation-text {
|
||||
font-size: 18px;
|
||||
font-weight: 500;
|
||||
color: var(--el-text-color-primary);
|
||||
}
|
||||
|
||||
.syndrome-details {
|
||||
padding: 15px;
|
||||
background: var(--el-color-primary-light-9);
|
||||
border-radius: 8px;
|
||||
border: 1px solid var(--el-color-primary-light-5);
|
||||
}
|
||||
|
||||
.detail-item {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.detail-label {
|
||||
font-weight: 500;
|
||||
color: var(--el-text-color-secondary);
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
|
||||
.actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 15px;
|
||||
padding-top: 20px;
|
||||
border-top: 1px solid var(--el-border-color);
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
text-align: center;
|
||||
padding: 40px 0;
|
||||
color: var(--el-text-color-secondary);
|
||||
}
|
||||
|
||||
.diagnosis-history {
|
||||
margin-top: 20px;
|
||||
border-top: 1px solid var(--el-border-color);
|
||||
padding-top: 20px;
|
||||
}
|
||||
|
||||
.history-title {
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
margin-bottom: 12px;
|
||||
color: var(--el-text-color-primary);
|
||||
}
|
||||
|
||||
.history-item {
|
||||
padding: 12px;
|
||||
border-left: 3px solid var(--el-border-color);
|
||||
margin-bottom: 10px;
|
||||
background: var(--el-fill-color-lighter);
|
||||
border-radius: 0 4px 4px 0;
|
||||
}
|
||||
|
||||
.diagnosis-list {
|
||||
max-height: 520px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.history-date {
|
||||
font-size: 12px;
|
||||
color: var(--el-text-color-secondary);
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.history-diagnosis {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 14px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.history-note {
|
||||
font-size: 13px;
|
||||
color: var(--el-text-color-secondary);
|
||||
padding-top: 5px;
|
||||
border-top: 1px dashed var(--el-border-color);
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.empty-list {
|
||||
padding: 20px 0;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,551 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="4" :xs="24">
|
||||
<el-input
|
||||
v-model="diagnosis"
|
||||
placeholder="诊断名称"
|
||||
clearable
|
||||
style="width: 100%; margin-bottom: 10px"
|
||||
@keyup.enter="queryDiagnosisUse"
|
||||
>
|
||||
<template #append>
|
||||
<el-button icon="Search" @click="queryDiagnosisUse" />
|
||||
</template>
|
||||
</el-input>
|
||||
<el-tree
|
||||
ref="treeRef"
|
||||
:data="tree"
|
||||
node-key="id"
|
||||
:props="{ label: 'name', children: 'children' }"
|
||||
highlight-current
|
||||
default-expand-all
|
||||
:filter-node-method="filterNode"
|
||||
@node-click="handleNodeClick"
|
||||
>
|
||||
<template #default="{ node, data }">
|
||||
<div class="custom-tree-node">
|
||||
<span>{{ node.label }}</span>
|
||||
<span class="tree-node-actions">
|
||||
<template v-if="node.level === 1 && data.name != '常用' && data.name != '历史'">
|
||||
<el-button
|
||||
style="color: #000000"
|
||||
type="text"
|
||||
size="small"
|
||||
@click.stop="addChild(data)"
|
||||
>
|
||||
<el-icon><Plus /></el-icon>
|
||||
</el-button>
|
||||
</template>
|
||||
<el-popconfirm
|
||||
width="200"
|
||||
:hide-after="10"
|
||||
title="确认删除此常用诊断吗"
|
||||
placement="top-start"
|
||||
@confirm="deleteChild(data)"
|
||||
>
|
||||
<template #reference>
|
||||
<el-button
|
||||
style="color: #000000"
|
||||
v-if="
|
||||
node.level === 2 &&
|
||||
node.parent.data.name != '常用' &&
|
||||
node.parent.data.name != '历史'
|
||||
"
|
||||
type="text"
|
||||
size="small"
|
||||
@click.stop=""
|
||||
>
|
||||
<el-icon><Minus /></el-icon>
|
||||
</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-tree>
|
||||
</el-col>
|
||||
<el-col :span="20" :xs="24">
|
||||
<div style="margin-bottom: 10px">
|
||||
<el-button type="primary" plain @click="handleAddDiagnosis()"> 新增诊断 </el-button>
|
||||
<el-button type="primary" plain @click="handleSaveDiagnosis()"> 保存诊断 </el-button>
|
||||
<el-button type="primary" plain @click="handleAddTcmDiagonsis()"> 中医诊断 </el-button>
|
||||
<el-button type="primary" plain @click="handleImport()"> 导入慢性病诊断 </el-button>
|
||||
</div>
|
||||
|
||||
<el-form :model="form" :rules="rules" ref="formRef">
|
||||
<el-table ref="diagnosisTableRef" :data="form.diagnosisList" height="650">
|
||||
<el-table-column label="序号" type="index" width="50" />
|
||||
<el-table-column label="诊断排序" align="center" prop="diagSrtNo" width="180">
|
||||
<template #default="scope">
|
||||
<el-form-item
|
||||
:prop="`diagnosisList.${scope.$index}.diagSrtNo`"
|
||||
:rules="rules.diagSrtNo"
|
||||
>
|
||||
<el-input-number
|
||||
v-model="scope.row.diagSrtNo"
|
||||
controls-position="right"
|
||||
:controls="false"
|
||||
style="width: 80px"
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="诊断类别" align="center" prop="diagSrtNo" width="180">
|
||||
<template #default="scope">
|
||||
<el-form-item
|
||||
:prop="`diagnosisList.${scope.$index}.medTypeCode`"
|
||||
:rules="rules.medTypeCode"
|
||||
>
|
||||
<el-select v-model="scope.row.medTypeCode" placeholder=" " style="width: 150px">
|
||||
<el-option
|
||||
v-for="item in med_type"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="诊断名称" align="center" prop="name">
|
||||
<template #default="scope">
|
||||
<el-form-item :prop="`diagnosisList.${scope.$index}.name`" :rules="rules.name">
|
||||
<el-popover
|
||||
:popper-style="{ padding: '0' }"
|
||||
placement="bottom-start"
|
||||
:visible="scope.row.showPopover"
|
||||
trigger="manual"
|
||||
:width="800"
|
||||
>
|
||||
<diagnosislist
|
||||
:diagnosisSearchkey="diagnosisSearchkey"
|
||||
@selectDiagnosis="handleSelsectDiagnosis"
|
||||
/>
|
||||
<template #reference>
|
||||
<el-input
|
||||
v-model="scope.row.name"
|
||||
placeholder="请选择诊断"
|
||||
@input="handleChange"
|
||||
@focus="handleFocus(scope.row, scope.$index)"
|
||||
@blur="handleBlur(scope.row)"
|
||||
/>
|
||||
</template>
|
||||
</el-popover>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="医保码" align="center" prop="ybNo" width="180" />
|
||||
<el-table-column label="诊断类型" align="center" prop="maindiseFlag">
|
||||
<template #default="scope">
|
||||
<el-checkbox
|
||||
label="主诊断"
|
||||
:trueLabel="1"
|
||||
:falseLabel="0"
|
||||
v-model="scope.row.maindiseFlag"
|
||||
border
|
||||
size="small"
|
||||
@change="(value) => handleMaindise(value, scope.$index)"
|
||||
/>
|
||||
<el-select
|
||||
v-model="scope.row.verificationStatusEnum"
|
||||
placeholder=" "
|
||||
style="width: 40%; padding-bottom: 5px; padding-left: 10px"
|
||||
size="small"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in diagnosisOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="130">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="handleDeleteDiagnosis(scope.row, scope.$index)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<diagnosisdialog
|
||||
:openDiagnosis="openDiagnosis"
|
||||
@close="closeDiagnosisDialog"
|
||||
:radio="orgOrUser"
|
||||
/>
|
||||
<AddDiagnosisDialog
|
||||
:openAddDiagnosisDialog="openAddDiagnosisDialog"
|
||||
:patientInfo="props.patientInfo"
|
||||
@close="closeDiagnosisDialog"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getCurrentInstance } from 'vue';
|
||||
import {
|
||||
getConditionDefinitionInfo,
|
||||
saveDiagnosis,
|
||||
diagnosisInit,
|
||||
deleteDiagnosisBind,
|
||||
getEncounterDiagnosis,
|
||||
getEmrDetail,
|
||||
getChronicDisease,
|
||||
getTcmDiagnosis,
|
||||
delEncounterDiagnosis,
|
||||
} from '../api';
|
||||
import diagnosisdialog from '../diagnosis/diagnosisdialog.vue';
|
||||
import AddDiagnosisDialog from './addDiagnosisDialog.vue';
|
||||
import diagnosislist from '../diagnosis/diagnosislist.vue';
|
||||
// const diagnosisList = ref([]);
|
||||
const allowAdd = ref(false);
|
||||
const tree = ref([]);
|
||||
const openDiagnosis = ref(false);
|
||||
const openAddDiagnosisDialog = ref(false);
|
||||
const diagnosisSearchkey = ref('');
|
||||
const diagnosisOptions = ref([]);
|
||||
const rowIndex = ref();
|
||||
const diagnosis = ref();
|
||||
const orgOrUser = ref();
|
||||
const form = ref({
|
||||
diagnosisList: [],
|
||||
});
|
||||
const props = defineProps({
|
||||
patientInfo: {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
const emits = defineEmits(['diagnosisSave']);
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { med_type } = proxy.useDict('med_type');
|
||||
const rules = ref({
|
||||
name: [{ required: true, message: '请选择诊断', trigger: 'change' }],
|
||||
medTypeCode: [{ required: true, message: '请选择诊断类型', trigger: 'change' }],
|
||||
diagSrtNo: [{ required: true, message: '请输入诊断序号', trigger: 'change' }],
|
||||
});
|
||||
|
||||
watch(
|
||||
() => form.value.diagnosisList,
|
||||
() => {
|
||||
emits('diagnosisSave', false);
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
|
||||
function getDetail(encounterId) {
|
||||
getEmrDetail(encounterId).then((res) => {
|
||||
allowAdd.value = res.data ? true : false;
|
||||
});
|
||||
}
|
||||
|
||||
function getList() {
|
||||
getEncounterDiagnosis(props.patientInfo.encounterId).then((res) => {
|
||||
if (res.code == 200) {
|
||||
form.value.diagnosisList = res.data;
|
||||
emits('diagnosisSave', false);
|
||||
console.log(form.value.diagnosisList);
|
||||
}
|
||||
});
|
||||
getTcmDiagnosis({ encounterId: props.patientInfo.encounterId }).then((res) => {
|
||||
if (res.code == 200) {
|
||||
if (res.data.illness.length > 0) {
|
||||
res.data.illness.forEach((item, index) => {
|
||||
form.value.diagnosisList.push({
|
||||
name: item.name + '-' + res.data.symptom[index].name,
|
||||
ybNo: item.ybNo,
|
||||
medTypeCode: item.medTypeCode,
|
||||
});
|
||||
});
|
||||
}
|
||||
emits('diagnosisSave', false);
|
||||
console.log(form.value.diagnosisList);
|
||||
}
|
||||
});
|
||||
getTree();
|
||||
}
|
||||
|
||||
init();
|
||||
function init() {
|
||||
diagnosisInit().then((res) => {
|
||||
if (res.code == 200) {
|
||||
diagnosisOptions.value = res.data.verificationStatusOptions;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function handleImport() {
|
||||
if (props.patientInfo.contractName != '自费') {
|
||||
// 获取患者慢性病信息
|
||||
getChronicDisease({ encounterId: props.patientInfo.encounterId }).then((res) => {
|
||||
if (res.data.length > 0) {
|
||||
res.data.forEach((item, index) => {
|
||||
form.value.diagnosisList.push({
|
||||
...item,
|
||||
...{
|
||||
medTypeCode: '140104',
|
||||
verificationStatusEnum: 4,
|
||||
definitionId: item.id,
|
||||
diagSrtNo: form.value.diagnosisList.length + 1,
|
||||
iptDiseTypeCode: 2,
|
||||
diagnosisDesc: '',
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加子节点
|
||||
*/
|
||||
function addChild(data) {
|
||||
orgOrUser.value = data.name;
|
||||
openDiagnosis.value = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除子节点
|
||||
*/
|
||||
function deleteChild(data) {
|
||||
deleteDiagnosisBind(data.id).then((res) => {
|
||||
if (res.code == 200) {
|
||||
proxy.$modal.msgSuccess('删除成功');
|
||||
getTree();
|
||||
}
|
||||
});
|
||||
}
|
||||
watch(diagnosis, (val) => {
|
||||
proxy.$refs['treeRef'].filter(val);
|
||||
});
|
||||
|
||||
/** 通过条件过滤节点 */
|
||||
const filterNode = (value, data) => {
|
||||
console.log('filterNode', value, data);
|
||||
|
||||
if (!value) return true;
|
||||
return data.name.indexOf(value) !== -1;
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取诊断树列表
|
||||
*/
|
||||
function getTree() {
|
||||
getConditionDefinitionInfo(props.patientInfo ? props.patientInfo.patientId : '').then((res) => {
|
||||
if (res.code == 200) {
|
||||
let list = [];
|
||||
list = res.data.patientHistoryList;
|
||||
list.children = [];
|
||||
// 手动构造树列表;
|
||||
tree.value[0] = {
|
||||
id: '1',
|
||||
name: '历史',
|
||||
children: list,
|
||||
};
|
||||
tree.value[1] = {
|
||||
id: '2',
|
||||
name: '常用',
|
||||
children: res.data.doctorCommonUseList,
|
||||
};
|
||||
tree.value[2] = {
|
||||
id: '3',
|
||||
name: '个人',
|
||||
children: res.data.userPersonalList,
|
||||
};
|
||||
tree.value[3] = {
|
||||
id: '4',
|
||||
name: '科室',
|
||||
children: res.data.organizationList,
|
||||
};
|
||||
console.log(tree.value);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加西医诊断
|
||||
*/
|
||||
function handleAddDiagnosis() {
|
||||
proxy.$refs.formRef.validate((valid) => {
|
||||
if (valid) {
|
||||
if (!allowAdd.value) {
|
||||
proxy.$modal.msgWarning('请先填写病历');
|
||||
return;
|
||||
}
|
||||
form.value.diagnosisList.push({
|
||||
showPopover: false,
|
||||
name: undefined,
|
||||
verificationStatusEnum: 4,
|
||||
medTypeCode: '11',
|
||||
diagSrtNo: form.value.diagnosisList.length + 1,
|
||||
iptDiseTypeCode: 2,
|
||||
diagnosisDesc: '',
|
||||
});
|
||||
if (form.value.diagnosisList.length == 1) {
|
||||
form.value.diagnosisList[0].maindiseFlag = 1;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 添加中医诊断
|
||||
function handleAddTcmDiagonsis() {
|
||||
openAddDiagnosisDialog.value = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除诊断
|
||||
*/
|
||||
function handleDeleteDiagnosis(row, index) {
|
||||
if (row.conditionId) {
|
||||
delEncounterDiagnosis(row.conditionId).then(() => {
|
||||
getList();
|
||||
getTree();
|
||||
});
|
||||
} else {
|
||||
form.value.diagnosisList.splice(index, 1);
|
||||
}
|
||||
}
|
||||
|
||||
function handleMaindise(value, index) {
|
||||
if (value == 1) {
|
||||
let flag = 0;
|
||||
form.value.diagnosisList.forEach((item) => {
|
||||
console.log(item);
|
||||
if (item.maindiseFlag == 1) {
|
||||
flag++;
|
||||
}
|
||||
});
|
||||
if (flag > 1) {
|
||||
form.value.diagnosisList[index].maindiseFlag = 0;
|
||||
proxy.$modal.msgWarning('只能有一条主诊断');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存诊断
|
||||
*/
|
||||
function handleSaveDiagnosis() {
|
||||
proxy.$refs.formRef.validate((valid) => {
|
||||
if (valid) {
|
||||
if (form.value.diagnosisList.length == 0) {
|
||||
proxy.$modal.msgWarning('诊断不能为空');
|
||||
return false;
|
||||
} else if (!form.value.diagnosisList.some((diagnosis) => diagnosis.maindiseFlag === 1)) {
|
||||
proxy.$modal.msgWarning('至少添加一条主诊断');
|
||||
} else {
|
||||
saveDiagnosis({
|
||||
patientId: props.patientInfo.patientId,
|
||||
encounterId: props.patientInfo.encounterId,
|
||||
diagnosisChildList: form.value.diagnosisList,
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
getTree();
|
||||
getList();
|
||||
emits('diagnosisSave', false);
|
||||
proxy.$modal.msgSuccess('诊断已保存');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭诊断弹窗
|
||||
*/
|
||||
function closeDiagnosisDialog(str) {
|
||||
if (str === 'success') {
|
||||
proxy.$modal.msgSuccess('操作成功');
|
||||
}
|
||||
|
||||
openAddDiagnosisDialog.value = false;
|
||||
openDiagnosis.value = false;
|
||||
getTree();
|
||||
}
|
||||
|
||||
function queryDiagnosisUse(value) {}
|
||||
|
||||
function handleChange(value) {
|
||||
diagnosisSearchkey.value = value;
|
||||
}
|
||||
/**
|
||||
* 选择诊断并赋值到列表
|
||||
*/
|
||||
function handleSelsectDiagnosis(row) {
|
||||
console.log(row);
|
||||
form.value.diagnosisList[rowIndex.value].ybNo = row.ybNo;
|
||||
form.value.diagnosisList[rowIndex.value].name = row.name;
|
||||
form.value.diagnosisList[rowIndex.value].definitionId = row.id;
|
||||
}
|
||||
/**获取焦点时 打开列表 */
|
||||
function handleFocus(row, index) {
|
||||
rowIndex.value = index;
|
||||
row.showPopover = true;
|
||||
}
|
||||
/**失去焦点时 关闭列表 */
|
||||
function handleBlur(row) {
|
||||
row.showPopover = false;
|
||||
}
|
||||
|
||||
function handleNodeClick(data) {
|
||||
console.log(data.children);
|
||||
// 检查节点是否为根节点
|
||||
if (data.children != undefined) {
|
||||
// 如果是根节点,不执行任何操作
|
||||
return;
|
||||
}
|
||||
if (!allowAdd.value) {
|
||||
proxy.$modal.msgWarning('请先填写病历');
|
||||
return;
|
||||
}
|
||||
const isDuplicate = form.value.diagnosisList.some(
|
||||
(diagnosis) => diagnosis.ybNo === data.ybNo || diagnosis.name === data.name
|
||||
);
|
||||
if (isDuplicate) {
|
||||
proxy.$modal.msgWarning('该诊断项已存在');
|
||||
return;
|
||||
}
|
||||
form.value.diagnosisList.push({
|
||||
ybNo: data.ybNo,
|
||||
name: data.name,
|
||||
verificationStatusEnum: 4,
|
||||
medTypeCode: '11',
|
||||
diagSrtNo: form.value.diagnosisList.length + 1,
|
||||
definitionId: data.definitionId,
|
||||
});
|
||||
if (form.value.diagnosisList.length == 1) {
|
||||
form.value.diagnosisList[0].maindiseFlag = 1;
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({ getList, getDetail, handleSaveDiagnosis });
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.el-checkbox.is-bordered.el-checkbox--small {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
.custom-tree-node {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.tree-node-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,126 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="title"
|
||||
v-model="props.openDiagnosis"
|
||||
width="1000px"
|
||||
append-to-body
|
||||
destroy-on-close
|
||||
@close="close"
|
||||
>
|
||||
<div>
|
||||
<el-row :gutter="24" class="mb8">
|
||||
<el-col :span="12">
|
||||
<el-input
|
||||
v-model="queryParams.searchKey"
|
||||
placeholder="诊断名称/拼音码"
|
||||
clearable
|
||||
style="width: 50%; margin-bottom: 10px"
|
||||
@keyup.enter="queryDiagnosisUse"
|
||||
>
|
||||
<template #append>
|
||||
<el-button icon="Search" @click="queryDiagnosisUse" />
|
||||
</template>
|
||||
</el-input>
|
||||
</el-col>
|
||||
<!-- <el-col :span="12">
|
||||
<span>使用范围:</span>
|
||||
<el-radio-group v-model="radio">
|
||||
<el-radio :label="1" size="default">个人</el-radio>
|
||||
<el-radio :label="2" size="default">科室</el-radio>
|
||||
</el-radio-group>
|
||||
</el-col> -->
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
ref="diagnosisDefinitionRef"
|
||||
:data="diagnosisDefinitionList"
|
||||
row-key="patientId"
|
||||
@cell-click="clickRow"
|
||||
highlight-current-row
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column label="诊断名称" align="center" prop="name" />
|
||||
<el-table-column label="医保编码" align="center" prop="ybNo" />
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
<el-button @click="close">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed } from "vue";
|
||||
import { getDiagnosisDefinitionList, saveDiagnosisBind } from "../api";
|
||||
|
||||
const radio = ref(1);
|
||||
const props = defineProps({
|
||||
openDiagnosis: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
radio: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(["close"]);
|
||||
const total = ref(0);
|
||||
const queryParams = ref({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
});
|
||||
const diagnosisDefinitionList = ref([]);
|
||||
const selectRow = ref({});
|
||||
const title = computed(() => {
|
||||
return props.radio == "个人" ? "个人常用诊断" : "科室常用诊断";
|
||||
});
|
||||
|
||||
getList();
|
||||
function getList() {
|
||||
getDiagnosisDefinitionList(queryParams.value).then((res) => {
|
||||
diagnosisDefinitionList.value = res.data.records;
|
||||
total.value = res.data.total;
|
||||
});
|
||||
}
|
||||
|
||||
function submit() {
|
||||
saveDiagnosisBind({
|
||||
definitionId: selectRow.value.id,
|
||||
definitionName: selectRow.value.name,
|
||||
bindingEnum: props.radio == "个人" ? 1 : 2,
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
emit("close", "success");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function queryDiagnosisUse() {
|
||||
getList();
|
||||
}
|
||||
|
||||
function close() {
|
||||
emit("close");
|
||||
}
|
||||
|
||||
function clickRow(row) {
|
||||
selectRow.value = row;
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
:deep( .pagination-container .el-pagination) {
|
||||
right: 20px !important;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,58 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-table
|
||||
ref="diagnosisDefinitionRef"
|
||||
:data="diagnosisDefinitionList"
|
||||
row-key="patientId"
|
||||
@cell-click="clickRow"
|
||||
max-height="400"
|
||||
>
|
||||
<el-table-column label="诊断名称" align="center" prop="name" />
|
||||
<el-table-column label="医保编码" align="center" prop="ybNo" />
|
||||
<el-table-column label="诊断类型" align="center" prop="typeName" width="180"/>
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { getDiagnosisDefinitionList } from '../api';
|
||||
|
||||
const props = defineProps({
|
||||
diagnosisSearchkey: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(['selectDiagnosis']);
|
||||
const total = ref(0);
|
||||
const queryParams = ref({
|
||||
pageSize: 1000,
|
||||
pageNo: 1,
|
||||
// typeCode: 1,
|
||||
});
|
||||
const diagnosisDefinitionList = ref([]);
|
||||
|
||||
watch(
|
||||
() => props.diagnosisSearchkey,
|
||||
(newValue) => {
|
||||
queryParams.value.searchKey = newValue;
|
||||
getList();
|
||||
},
|
||||
{ immdiate: true }
|
||||
);
|
||||
|
||||
getList();
|
||||
function getList() {
|
||||
getDiagnosisDefinitionList(queryParams.value).then((res) => {
|
||||
diagnosisDefinitionList.value = res.data.records;
|
||||
total.value = res.data.total;
|
||||
});
|
||||
}
|
||||
|
||||
function clickRow(row) {
|
||||
emit('selectDiagnosis', row);
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
Reference in New Issue
Block a user