feat(diagnosis): 优化门诊医生站诊断模块
- 诊断字段显示框改为div样式,支持完整显示诊断名称 - 新增诊断选择器弹窗,带标题栏和关闭按钮 - 诊断选择器支持搜索功能(按诊断名称/ICD代码) - 优化字段对齐,统一列宽和间距 - 修复数据保存问题(longTermFlag字段、日期格式)
This commit is contained in:
@@ -103,32 +103,45 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="诊断" align="center" prop="name" width="180" :show-overflow-tooltip="true">
|
<el-table-column label="诊断" align="center" prop="name" min-width="220">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-form-item :prop="`diagnosisList.${scope.$index}.name`" :rules="rules.name" style="margin-bottom: 0;">
|
<el-form-item :prop="`diagnosisList.${scope.$index}.name`" :rules="rules.name" style="margin-bottom: 0;">
|
||||||
<el-popover
|
<el-popover
|
||||||
:popper-style="{ padding: '0' }"
|
:popper-style="{ padding: '0', width: '600px' }"
|
||||||
placement="bottom-start"
|
placement="bottom-start"
|
||||||
:visible="scope.row.showPopover"
|
:visible="scope.row.showPopover"
|
||||||
trigger="manual"
|
trigger="manual"
|
||||||
:width="800"
|
:show-arrow="false"
|
||||||
>
|
>
|
||||||
<template #default>
|
<template #default>
|
||||||
<diagnosislist
|
<div class="diagnosis-popover-container">
|
||||||
:diagnosisSearchkey="diagnosisSearchkey"
|
<div class="diagnosis-popover-header">
|
||||||
@selectDiagnosis="handleSelsectDiagnosis"
|
<span class="diagnosis-popover-title">选择诊断</span>
|
||||||
/>
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
:icon="Close"
|
||||||
|
@click="closeDiagnosisPopover(scope.row)"
|
||||||
|
class="diagnosis-popover-close"
|
||||||
|
>关闭</el-button>
|
||||||
|
</div>
|
||||||
|
<div class="diagnosis-popover-body">
|
||||||
|
<diagnosislist
|
||||||
|
:diagnosisSearchkey="diagnosisSearchkey"
|
||||||
|
@selectDiagnosis="(row) => handleSelectDiagnosis(row, scope.row, scope.$index)"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #reference>
|
<template #reference>
|
||||||
<el-input
|
<div
|
||||||
v-model="scope.row.name"
|
class="diagnosis-text"
|
||||||
placeholder="请选择诊断"
|
@click="handleFocus(scope.row, scope.$index)"
|
||||||
@input="handleChange"
|
:title="scope.row.name || '点击选择诊断'"
|
||||||
@focus="handleFocus(scope.row, scope.$index)"
|
>
|
||||||
@blur="handleBlur(scope.row)"
|
<span class="diagnosis-text-content">{{ scope.row.name || '点击选择诊断' }}</span>
|
||||||
style="width: 180px"
|
<el-icon class="diagnosis-text-icon"><ArrowDown /></el-icon>
|
||||||
:title="scope.row.name"
|
</div>
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -251,6 +264,7 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {getCurrentInstance} from 'vue';
|
import {getCurrentInstance} from 'vue';
|
||||||
|
import { Close, ArrowDown } from '@element-plus/icons-vue';
|
||||||
import useUserStore from '@/store/modules/user';
|
import useUserStore from '@/store/modules/user';
|
||||||
import {
|
import {
|
||||||
delEncounterDiagnosis,
|
delEncounterDiagnosis,
|
||||||
@@ -721,12 +735,22 @@ function handleChange(value) {
|
|||||||
/**
|
/**
|
||||||
* 选择诊断并赋值到列表
|
* 选择诊断并赋值到列表
|
||||||
*/
|
*/
|
||||||
function handleSelsectDiagnosis(row) {
|
function handleSelectDiagnosis(row, rowData, index) {
|
||||||
console.log(row);
|
console.log('选择诊断:', row);
|
||||||
form.value.diagnosisList[rowIndex.value].ybNo = row.ybNo;
|
rowData.name = row.name;
|
||||||
form.value.diagnosisList[rowIndex.value].name = row.name;
|
rowData.ybNo = row.ybNo;
|
||||||
form.value.diagnosisList[rowIndex.value].definitionId = row.id;
|
rowData.definitionId = row.id;
|
||||||
|
rowData.showPopover = false;
|
||||||
|
emits('diagnosisSave', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关闭诊断选择弹窗
|
||||||
|
*/
|
||||||
|
function closeDiagnosisPopover(row) {
|
||||||
|
row.showPopover = false;
|
||||||
|
}
|
||||||
|
|
||||||
/**获取焦点时 打开列表 */
|
/**获取焦点时 打开列表 */
|
||||||
function handleFocus(row, index) {
|
function handleFocus(row, index) {
|
||||||
if(row.typeName==='中医诊断'){
|
if(row.typeName==='中医诊断'){
|
||||||
@@ -743,16 +767,16 @@ function handleFocus(row, index) {
|
|||||||
});
|
});
|
||||||
openAddDiagnosisDialog.value = true;
|
openAddDiagnosisDialog.value = true;
|
||||||
}else{
|
}else{
|
||||||
|
// 关闭其他行的弹窗
|
||||||
|
form.value.diagnosisList.forEach((item, idx) => {
|
||||||
|
if (idx !== index) {
|
||||||
|
item.showPopover = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
rowIndex.value = index;
|
rowIndex.value = index;
|
||||||
row.showPopover = true;
|
row.showPopover = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
/**失去焦点时 关闭列表 */
|
|
||||||
function handleBlur(row) {
|
|
||||||
row.showPopover = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleNodeClick(data) {
|
function handleNodeClick(data) {
|
||||||
console.log(data.children);
|
console.log(data.children);
|
||||||
// 检查节点是否为根节点
|
// 检查节点是否为根节点
|
||||||
@@ -830,4 +854,89 @@ defineExpose({ getList, getDetail, handleSaveDiagnosis });
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.diagnosis-text {
|
||||||
|
min-height: 32px;
|
||||||
|
line-height: 1.4;
|
||||||
|
padding: 6px 12px;
|
||||||
|
border: 1px solid #dcdfe6;
|
||||||
|
border-radius: 4px;
|
||||||
|
background-color: #fff;
|
||||||
|
cursor: pointer;
|
||||||
|
text-align: left;
|
||||||
|
word-break: break-all;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
max-width: 200px;
|
||||||
|
transition: border-color 0.2s;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.diagnosis-text:hover {
|
||||||
|
border-color: #409eff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.diagnosis-text-content {
|
||||||
|
flex: 1;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
}
|
||||||
|
|
||||||
|
.diagnosis-text-icon {
|
||||||
|
color: #909399;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.diagnosis-text:hover .diagnosis-text-icon {
|
||||||
|
color: #409eff;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 诊断选择弹窗样式 */
|
||||||
|
.diagnosis-popover-container {
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 4px;
|
||||||
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.diagnosis-popover-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 12px 16px;
|
||||||
|
border-bottom: 1px solid #e4e7ed;
|
||||||
|
background-color: #f5f7fa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.diagnosis-popover-title {
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #303133;
|
||||||
|
}
|
||||||
|
|
||||||
|
.diagnosis-popover-close {
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.diagnosis-popover-body {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.diagnosis-text:empty::before {
|
||||||
|
content: '点击选择诊断';
|
||||||
|
color: #a8abb2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.diagnosis-text:hover {
|
||||||
|
border-color: #409eff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.diagnosis-text:empty::before {
|
||||||
|
content: '请选择诊断';
|
||||||
|
color: #a8abb2;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,21 +1,48 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div class="diagnosis-list-container">
|
||||||
|
<div class="diagnosis-search-box">
|
||||||
|
<el-input
|
||||||
|
v-model="searchText"
|
||||||
|
placeholder="输入诊断名称或ICD代码搜索"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleSearch"
|
||||||
|
@clear="handleClear"
|
||||||
|
>
|
||||||
|
<template #append>
|
||||||
|
<el-button :icon="Search" @click="handleSearch" />
|
||||||
|
</template>
|
||||||
|
</el-input>
|
||||||
|
</div>
|
||||||
<el-table
|
<el-table
|
||||||
ref="diagnosisDefinitionRef"
|
ref="diagnosisDefinitionRef"
|
||||||
:data="diagnosisDefinitionList"
|
:data="diagnosisDefinitionList"
|
||||||
row-key="patientId"
|
row-key="id"
|
||||||
@cell-click="clickRow"
|
@cell-click="clickRow"
|
||||||
max-height="400"
|
max-height="350"
|
||||||
|
highlight-current-row
|
||||||
|
border
|
||||||
>
|
>
|
||||||
<el-table-column label="诊断名称" align="center" prop="name" />
|
<el-table-column label="诊断名称" align="left" prop="name" min-width="200" show-overflow-tooltip />
|
||||||
<el-table-column label="ICD代码" align="center" prop="ybNo" />
|
<el-table-column label="ICD代码" align="center" prop="ybNo" width="120" />
|
||||||
<el-table-column label="诊断类型" align="center" prop="typeName" width="180"/>
|
<el-table-column label="诊断类型" align="center" prop="typeName" width="100" />
|
||||||
</el-table>
|
</el-table>
|
||||||
|
<div class="diagnosis-pagination" v-if="total > queryParams.pageSize">
|
||||||
|
<el-pagination
|
||||||
|
small
|
||||||
|
layout="prev, pager, next"
|
||||||
|
:total="total"
|
||||||
|
:page-size="queryParams.pageSize"
|
||||||
|
:current-page="queryParams.pageNo"
|
||||||
|
@current-change="handlePageChange"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {getDiagnosisDefinitionList} from '../api';
|
import { ref, watch } from 'vue';
|
||||||
|
import { Search } from '@element-plus/icons-vue';
|
||||||
|
import { getDiagnosisDefinitionList } from '../api';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
diagnosisSearchkey: {
|
diagnosisSearchkey: {
|
||||||
@@ -23,36 +50,87 @@ const props = defineProps({
|
|||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits(['selectDiagnosis']);
|
const emit = defineEmits(['selectDiagnosis']);
|
||||||
|
|
||||||
|
const searchText = ref('');
|
||||||
const total = ref(0);
|
const total = ref(0);
|
||||||
const queryParams = ref({
|
const queryParams = ref({
|
||||||
pageSize: 1000,
|
pageSize: 10,
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
// typeCode: 1,
|
|
||||||
});
|
});
|
||||||
const diagnosisDefinitionList = ref([]);
|
const diagnosisDefinitionList = ref([]);
|
||||||
|
|
||||||
|
// 监听外部传入的搜索关键字
|
||||||
watch(
|
watch(
|
||||||
() => props.diagnosisSearchkey,
|
() => props.diagnosisSearchkey,
|
||||||
(newValue) => {
|
(newValue) => {
|
||||||
|
searchText.value = newValue;
|
||||||
queryParams.value.searchKey = newValue;
|
queryParams.value.searchKey = newValue;
|
||||||
|
queryParams.value.pageNo = 1;
|
||||||
getList();
|
getList();
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
);
|
);
|
||||||
|
|
||||||
getList();
|
// 获取诊断列表
|
||||||
function getList() {
|
function getList() {
|
||||||
getDiagnosisDefinitionList(queryParams.value).then((res) => {
|
getDiagnosisDefinitionList(queryParams.value).then((res) => {
|
||||||
diagnosisDefinitionList.value = res.data.records;
|
diagnosisDefinitionList.value = res.data.records || [];
|
||||||
total.value = res.data.total;
|
total.value = res.data.total || 0;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 搜索
|
||||||
|
function handleSearch() {
|
||||||
|
queryParams.value.searchKey = searchText.value;
|
||||||
|
queryParams.value.pageNo = 1;
|
||||||
|
getList();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 清空搜索
|
||||||
|
function handleClear() {
|
||||||
|
searchText.value = '';
|
||||||
|
queryParams.value.searchKey = '';
|
||||||
|
queryParams.value.pageNo = 1;
|
||||||
|
getList();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 分页变化
|
||||||
|
function handlePageChange(page) {
|
||||||
|
queryParams.value.pageNo = page;
|
||||||
|
getList();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 点击行选择诊断
|
||||||
function clickRow(row) {
|
function clickRow(row) {
|
||||||
emit('selectDiagnosis', row);
|
emit('selectDiagnosis', row);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
.diagnosis-list-container {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.diagnosis-search-box {
|
||||||
|
padding: 12px 16px;
|
||||||
|
border-bottom: 1px solid #e4e7ed;
|
||||||
|
background-color: #f5f7fa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.diagnosis-pagination {
|
||||||
|
padding: 8px 16px;
|
||||||
|
border-top: 1px solid #e4e7ed;
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-table__row) {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-table__row:hover) {
|
||||||
|
background-color: #f5f7fa;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
Reference in New Issue
Block a user