门诊医生站-》开立诊断 页面调整

This commit is contained in:
itcast
2026-01-16 16:32:36 +08:00
parent be0514bc08
commit 8fcfb481c9
83 changed files with 3808 additions and 2205 deletions

View File

@@ -197,7 +197,10 @@ watch(
// 直接更新查询参数
queryParams.value.searchKey = newValue.searchKey || '';
// 更新categoryCode
queryParams.value.categoryCode = newValue.categoryCode || '';
// 处理类型筛选
if (newValue.adviceType !== undefined && newValue.adviceType !== null && newValue.adviceType !== '') {
// 单个类型
@@ -215,8 +218,18 @@ getList();
// 从priceList列表中获取价格
function getPriceFromInventory(row) {
if (row.priceList && row.priceList.length > 0) {
const price = row.priceList[0].price || 0;
return Number(price).toFixed(2) + ' 元';
const price = row.priceList[0].price;
// 检查价格是否为有效数字
if (price !== undefined && price !== null && !isNaN(price) && isFinite(price)) {
return Number(price).toFixed(2) + ' 元';
}
// 如果价格无效,尝试从其他可能的字段获取价格
if (row.totalPrice !== undefined && row.totalPrice !== null && !isNaN(row.totalPrice) && isFinite(row.totalPrice)) {
return Number(row.totalPrice).toFixed(2) + ' 元';
}
if (row.price !== undefined && row.price !== null && !isNaN(row.price) && isFinite(row.price)) {
return Number(row.price).toFixed(2) + ' 元';
}
}
return '-';
}

View File

@@ -808,6 +808,17 @@ export function getInspectionApplicationList(queryParams) {
});
}
/**
* 获取诊疗项目列表
*/
export function getDiagnosisTreatmentList(queryParams) {
return request({
url: '/data-dictionary/diagnosis-treatment/information-page',
method: 'get',
params: queryParams,
});
}
/**
* 保存检验申请单
*/

View File

@@ -2,7 +2,7 @@
<el-dialog
title="添加中医诊断"
v-model="props.openAddDiagnosisDialog"
width="1500px"
width="1300px"
append-to-body
destroy-on-close
@open="handleOpen"
@@ -92,6 +92,7 @@ import {
getTcmSyndrome,
saveTcmDiagnosis,
updateTcmDiagnosis,
getTcmDiagnosis,
} from '@/views/doctorstation/components/api';
const props = defineProps({
@@ -120,141 +121,144 @@ const { proxy } = getCurrentInstance();
const emit = defineEmits(['close']);
function handleOpen() {
// 获取诊断列表
getTcmCondition().then((res) => {
conditionList.value = res.data.records;
});
tcmDiagonsisSaveList.value=[];
tcmDiagonsisList.value=[];
debugger;
if (props.updateZy.length>0) {
// 清空数据
tcmDiagonsisSaveList.value = [];
tcmDiagonsisList.value = [];
syndromeSelected.value = true; // 设置为true允许添加新的诊断
// 如果是修改模式,加载传入的诊断数据
if (props.updateZy.length > 0) {
props.updateZy.forEach((item) => {
let updateIds=item.updateId.split("-");
let name=item.name.split("-");
tcmDiagonsisSaveList.value.push({
let updateIds = item.updateId.split("-");
let name = item.name.split("-");
tcmDiagonsisSaveList.value.push(
{
conditionId: updateIds[0],
definitionId: item.illnessDefinitionId,
ybNo: item.ybNo,
syndromeGroupNo: item.syndromeGroupNo,
verificationStatusEnum: 4,
medTypeCode: '11',
diagSrtNo:item.diagSrtNo,
});
tcmDiagonsisList.value.push({
conditionName: name[0],
syndromeGroupNo: item.syndromeGroupNo,
});
tcmDiagonsisSaveList.value.push({
diagSrtNo: item.diagSrtNo,
isExisting: true // 标记为已存在
},
{
conditionId: updateIds[1],
definitionId: item.symptomDefinitionId,
ybNo: item.symptomYbNo,
syndromeGroupNo: item.syndromeGroupNo,
diagSrtNo:item.diagSrtNo,
diagSrtNo: item.diagSrtNo,
isExisting: true // 标记为已存在
}
);
tcmDiagonsisList.value.push({
conditionName: name[0],
syndromeName: name[1],
syndromeGroupNo: item.syndromeGroupNo,
isExisting: true // 标记为已存在
});
tcmDiagonsisList.value[tcmDiagonsisList.value.length - 1].syndromeName = name[1];
console.log("这是修改时带入的数据");
console.log(tcmDiagonsisList.value);
console.log(tcmDiagonsisSaveList.value);
syndromeSelected.value = true;
syndromeSelected.value = true;
});
} else {
// 不是修改模式,加载已保存的中医诊断
if (props.patientInfo && props.patientInfo.encounterId) {
getTcmDiagnosis({ encounterId: props.patientInfo.encounterId }).then((res) => {
if (res.code === 200 && res.data.illness && res.data.illness.length > 0) {
res.data.illness.forEach((item, index) => {
const symptom = res.data.symptom[index];
if (symptom) {
// 添加到显示列表
tcmDiagonsisList.value.push({
conditionName: item.name,
syndromeName: symptom.name,
syndromeGroupNo: item.syndromeGroupNo,
isExisting: true // 标记为已存在
});
// 添加到保存列表
tcmDiagonsisSaveList.value.push(
{
conditionId: item.conditionId,
definitionId: item.definitionId,
ybNo: item.ybNo,
syndromeGroupNo: item.syndromeGroupNo,
verificationStatusEnum: item.verificationStatusEnum || 4,
medTypeCode: item.medTypeCode || '11',
diagSrtNo: item.diagSrtNo,
isExisting: true // 标记为已存在
},
{
conditionId: symptom.conditionId,
definitionId: symptom.definitionId,
ybNo: symptom.ybNo,
syndromeGroupNo: item.syndromeGroupNo,
diagSrtNo: item.diagSrtNo,
isExisting: true // 标记为已存在
}
);
}
});
}
}).catch(err => {
console.error('加载已保存的中医诊断失败:', err);
});
}
}
}
// 点击诊断列表处理,点击以后才显示证候列表
function handleClickRow(row) {
if (syndromeSelected.value || tcmDiagonsisList.value.length == 0) {
syndromeSelected.value = false;
syndromeSelected.value = false;
selectedDisease.value = true;
timestamp.value = Date.now();
getTcmSyndrome().then((res) => {
syndromeList.value = res.data.records;
});
if (props.updateZy.length>0) {
props.updateZy.forEach((item) => {
let updateIds=item.updateId.split("-");
tcmDiagonsisSaveList.value.push({
updateId:updateIds[0],
conditionId: updateIds[0],
definitionId: row.id,
ybNo: row.ybNo,
syndromeGroupNo: timestamp.value,
verificationStatusEnum: 4,
medTypeCode: '11',
diagSrtNo:item.diagSrtNo,
});
debugger;
if(tcmDiagonsisList.value.length>0){
tcmDiagonsisList.value[tcmDiagonsisList.value.length - 1].conditionName = row.name;
}else{
tcmDiagonsisList.value.push({
conditionName: row.name,
syndromeGroupNo: timestamp.value,
});
}
});
}else{
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,
});
}
}
// tcmDiagonsisList.value.push({
// conditionName: row.name,
// syndromeGroupNo: timestamp.value,
// });
// 添加新的诊断
tcmDiagonsisSaveList.value.push({
definitionId: row.id,
ybNo: row.ybNo,
syndromeGroupNo: timestamp.value,
verificationStatusEnum: 4,
medTypeCode: '11',
isExisting: false // 标记为新增
});
tcmDiagonsisList.value.push({
conditionName: row.name,
syndromeGroupNo: timestamp.value,
isExisting: false // 标记为新增
});
}
}
function clickSyndromeRow(row) {
debugger;
let flag=true;
tcmDiagonsisList.value.forEach( item => {
if(tcmDiagonsisList.value[tcmDiagonsisList.value.length - 1].conditionName==item.conditionName){
if(item.syndromeName==row.name ){
proxy.$modal.msgWarning('不能存在完全相同的诊断和证侯');
flag=false;
}
// 检查是否已存在完全相同的诊断和证候
let flag = true;
const currentConditionName = tcmDiagonsisList.value[tcmDiagonsisList.value.length - 1].conditionName;
tcmDiagonsisList.value.forEach(item => {
if (item.conditionName === currentConditionName && item.syndromeName === row.name) {
proxy.$modal.msgWarning('不能存在完全相同的诊断和证候');
flag = false;
}
});
if(flag){
if(props.updateZy.length>0){
props.updateZy.forEach((item) => {
let updateIds=item.updateId.split("-");
tcmDiagonsisSaveList.value.push({
updateId:updateIds[1],
conditionId: updateIds[1],
definitionId: row.id,
ybNo: row.ybNo,
syndromeGroupNo: timestamp.value,
});
tcmDiagonsisList.value[tcmDiagonsisList.value.length - 1].syndromeName = row.name;
syndromeSelected.value = true;
});
}else{
tcmDiagonsisSaveList.value.push({
definitionId: row.id,
ybNo: row.ybNo,
syndromeGroupNo: timestamp.value,
});
tcmDiagonsisList.value[tcmDiagonsisList.value.length - 1].syndromeName = row.name;
syndromeSelected.value = true;
}
// tcmDiagonsisList.value[tcmDiagonsisList.value.length - 1].syndromeName = row.name;
// syndromeSelected.value = true;
if (flag) {
tcmDiagonsisSaveList.value.push({
definitionId: row.id,
ybNo: row.ybNo,
syndromeGroupNo: timestamp.value,
isExisting: false // 标记为新增
});
tcmDiagonsisList.value[tcmDiagonsisList.value.length - 1].syndromeName = row.name;
syndromeSelected.value = true;
}
}
@@ -268,38 +272,52 @@ function removeDiagnosis(row, index) {
}
function save() {
if(props.updateZy.length>0){
// 只保存新增的诊断,过滤掉已存在的
const newDiagnosisList = tcmDiagonsisSaveList.value.filter(item => !item.isExisting);
if (newDiagnosisList.length === 0) {
proxy.$modal.msgWarning('没有新增的诊断需要保存');
return;
}
if (props.updateZy.length > 0) {
// 修改模式
updateTcmDiagnosis({
patientId: props.patientInfo.patientId,
encounterId: props.patientInfo.encounterId,
diagnosisChildList: tcmDiagonsisSaveList.value,
}).then((res) => {
if (res.code == 200) {
emit('close');
proxy.$modal.msgSuccess('诊断已保存');
}
diagnosisChildList: newDiagnosisList,
}).then((res) => {
if (res.code == 200) {
emit('close');
proxy.$modal.msgSuccess('诊断已保存');
}
});
}else{
} else {
// 新增模式
saveTcmDiagnosis({
patientId: props.patientInfo.patientId,
encounterId: props.patientInfo.encounterId,
diagnosisChildList: tcmDiagonsisSaveList.value,
}).then((res) => {
if (res.code == 200) {
emit('close');
proxy.$modal.msgSuccess('诊断已保存');
}
diagnosisChildList: newDiagnosisList,
}).then((res) => {
if (res.code == 200) {
emit('close');
proxy.$modal.msgSuccess('诊断已保存');
}
});
}
}
function submit() {
debugger;
if (
tcmDiagonsisSaveList.value.length > 0 &&
(syndromeSelected.value || tcmDiagonsisSaveList.value.length % 2 == 0)
) {
// 检查是否有新增的诊断
const hasNewDiagnosis = tcmDiagonsisSaveList.value.some(item => !item.isExisting);
if (!hasNewDiagnosis) {
// 如果没有新增诊断,直接关闭
emit('close');
return;
}
if (syndromeSelected.value || tcmDiagonsisSaveList.value.length % 2 == 0) {
save();
} else {
proxy.$modal.msgWarning('请选择证候');

View File

@@ -75,19 +75,17 @@
<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="typeName" width="120">
<el-table-column label="诊断排序" align="center" prop="diagSrtNo" width="120">
<template #default="scope">
<el-select v-model="scope.row.typeName" placeholder="请选择">
<el-option label="西医" value="西医" />
<el-option label="中医" value="中医" />
<el-option label="证型" value="证型" />
<el-option label="其他" value="其他" />
</el-select>
<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="medTypeCode" width="180">
<el-table-column label="诊断类" align="center" prop="diagSrtNo" width="180">
<template #default="scope">
<el-form-item :prop="`diagnosisList.${scope.$index}.medTypeCode`" :rules="rules.medTypeCode" style="margin-bottom: 0;">
<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 diag_type"
@@ -99,9 +97,9 @@
</el-form-item>
</template>
</el-table-column>
<el-table-column label="诊断" align="center" prop="name">
<el-table-column label="诊断名称" align="center" prop="name">
<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">
<el-popover
:popper-style="{ padding: '0' }"
placement="bottom-start"
@@ -122,26 +120,24 @@
</el-form-item>
</template>
</el-table-column>
<el-table-column label="主诊断" align="center" width="120">
<template #default="scope">
<el-select v-model="scope.row.maindiseFlag" placeholder="是否为主诊断" @change="(value) => handleMaindise(value, scope.$index)">
<el-option label="是" :value="1"/>
<el-option label="否" :value="0"/>
</el-select>
</template>
</el-table-column>
<el-table-column label="诊断备注" align="center" prop="diagnosisDesc" min-width="150">
<template #default="scope">
<el-input v-model="scope.row.diagnosisDesc" placeholder="请输入备注" />
</template>
</el-table-column>
<el-table-column label="ICD编码" align="center" prop="ybNo" width="180" />
<el-table-column label="诊断状态" align="center" prop="maindiseFlag" width="150">
<el-table-column label="医保码" align="center" prop="ybNo" width="180" />
<el-table-column label="类别" align="center" prop="typeName" width="100" />
<el-table-column label="诊断类型" align="center" prop="maindiseFlag">
<template #default="scope">
<div style="display:flex;flex-direction:column;align-items:center;gap:5px;">
<el-checkbox
label="主诊断"
:true-value="1"
:false-value="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: 100%;"
style="width: 100%; padding-bottom: 5px; padding-left: 10px"
size="small"
>
<el-option
@@ -151,32 +147,7 @@
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column label="发病日期" align="center" prop="onsetDate" width="180">
<template #default="scope">
<el-date-picker
v-model="scope.row.onsetDate"
type="date"
placeholder="选择日期"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
style="width: 100%"
/>
</template>
</el-table-column>
<el-table-column label="诊断日期" align="center" prop="diagnosisTime" width="180">
<template #default="scope">
{{ scope.row.diagnosisTime ? scope.row.diagnosisTime.split(' ')[0] : '' }}
</template>
</el-table-column>
<el-table-column label="医生" align="center" prop="diagnosisDoctor" width="120" />
<el-table-column label="长效诊断标识" align="center" prop="longTermDiagnosisFlag" width="150">
<template #default="scope">
<el-select v-model="scope.row.longTermDiagnosisFlag" placeholder="请选择" clearable>
<el-option label="长期有效" value="1" />
<el-option label="临时" value="2" />
</el-select>
</div>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="130">
@@ -247,7 +218,7 @@ const props = defineProps({
const emits = defineEmits(['diagnosisSave']);
const { proxy } = getCurrentInstance();
const userStore = useUserStore();
const { diag_type, long_term_diagnosis_flag } = proxy.useDict('diag_type', 'long_term_diagnosis_flag');
const { diag_type } = proxy.useDict('diag_type');
const rules = ref({
name: [{ required: true, message: '请选择诊断', trigger: 'change' }],
medTypeCode: [{ required: true, message: '请选择诊断类型', trigger: 'change' }],
@@ -281,7 +252,8 @@ function getList() {
getEncounterDiagnosis(props.patientInfo.encounterId)
.then((res) => {
if (res.code == 200) {
form.value.diagnosisList = res.data;
// 过滤掉中医诊断,只保留西医诊断
form.value.diagnosisList = res.data.filter(item => item.typeName !== '中医诊断');
emits('diagnosisSave', false);
}
maxNo = form.value.diagnosisList.length;
@@ -437,13 +409,10 @@ function getTree() {
function handleAddDiagnosis() {
proxy.$refs.formRef.validate((valid) => {
if (valid) {
// if (!allowAdd.value) {
// proxy.$modal.msgWarning('请先填写病历');
// return;
// }
const maxSortNo = form.value.diagnosisList.length > 0
? Math.max(...form.value.diagnosisList.map(item => item.diagSrtNo || 0))
const maxSortNo = form.value.diagnosisList.length > 0
? Math.max(...form.value.diagnosisList.map(item => item.diagSrtNo || 0))
: 0;
form.value.diagnosisList.push({
showPopover: false,
name: undefined,
@@ -453,9 +422,7 @@ function handleAddDiagnosis() {
iptDiseTypeCode: 2,
diagnosisDesc: '',
diagnosisDoctor: props.patientInfo.practitionerName || props.patientInfo.doctorName || props.patientInfo.physicianName || userStore.name,
diagnosisTime: new Date().toLocaleString('zh-CN'),
typeName: '西医',
longTermDiagnosisFlag: ''
diagnosisTime: new Date().toLocaleString('zh-CN')
});
// 添加后按排序号排序
@@ -524,6 +491,7 @@ function handleSaveDiagnosis() {
return false;
} else if (!form.value.diagnosisList.some((diagnosis) => diagnosis.maindiseFlag === 1)) {
proxy.$modal.msgWarning('至少添加一条主诊断');
return false;
} else {
// 保存前按排序号排序
form.value.diagnosisList.sort((a, b) => (a.diagSrtNo || 0) - (b.diagSrtNo || 0));

View File

@@ -38,7 +38,7 @@ watch(
queryParams.value.searchKey = newValue;
getList();
},
{ immdiate: true }
{ immediate: true }
);
getList();

View File

@@ -19,7 +19,7 @@
<span>{{ item.prescriptionNo }}</span>
</div>
<div style="text-align: center">
<h2>长春市朝阳区中医院医院</h2>
<h2>{{ userStore.hospitalName }}</h2>
</div>
<div style="text-align: center">
<h3>处方单</h3>
@@ -144,6 +144,9 @@
import {formatDateStr} from '@/utils/index';
//高精度库
import Decimal from 'decimal.js';
import useUserStore from '@/store/modules/user';
const userStore = useUserStore();
const props = defineProps({
open: {

View File

@@ -96,7 +96,7 @@
' ' +
scope.row.volume +
' [' +
Number(scope.row.unitPrice).toFixed(2) +
(scope.row.unitPrice !== undefined && scope.row.unitPrice !== null && !isNaN(scope.row.unitPrice) && isFinite(scope.row.unitPrice) ? Number(scope.row.unitPrice).toFixed(2) : '-') +
' 元' +
'/' +
scope.row.unitCode_dictText +
@@ -145,7 +145,7 @@
<span class="medicine-info"> 注射药品{{ scope.row.injectFlag_enumText }} </span>
<span class="total-amount">
总金额{{
scope.row.totalPrice
(scope.row.totalPrice !== undefined && scope.row.totalPrice !== null && !isNaN(scope.row.totalPrice) && isFinite(scope.row.totalPrice))
? Number(scope.row.totalPrice).toFixed(2) + ' 元'
: '0.00 元'
}}
@@ -631,7 +631,7 @@
" " +
scope.row.volume +
" [" +
Number(scope.row.unitPrice).toFixed(2) +
(scope.row.unitPrice !== undefined && scope.row.unitPrice !== null && !isNaN(scope.row.unitPrice) && isFinite(scope.row.unitPrice) ? Number(scope.row.unitPrice).toFixed(2) : '-') +
" " +
"/" +
scope.row.unitCode_dictText +
@@ -687,7 +687,7 @@
</el-form-item>
<span class="total-amount">
总金额:{{
scope.row.totalPrice
(scope.row.totalPrice !== undefined && scope.row.totalPrice !== null && !isNaN(scope.row.totalPrice) && isFinite(scope.row.totalPrice))
? Number(scope.row.totalPrice).toFixed(2) + ' 元'
: '0.00 元'
}}
@@ -702,7 +702,7 @@
<span style="font-size: 16px; font-weight: 600">
{{ scope.row.adviceName }}
{{
scope.row.unitPrice
(scope.row.unitPrice !== undefined && scope.row.unitPrice !== null && !isNaN(scope.row.unitPrice) && isFinite(scope.row.unitPrice))
? Number(scope.row.unitPrice).toFixed(2) + '/次'
: '-' + '元'
}}
@@ -748,7 +748,7 @@
<span class="total-amount">
总金额:
{{
scope.row.totalPrice
(scope.row.totalPrice !== undefined && scope.row.totalPrice !== null && !isNaN(scope.row.totalPrice) && isFinite(scope.row.totalPrice))
? Number(scope.row.totalPrice).toFixed(2) + ' 元'
: '0.00 元'
}}
@@ -766,77 +766,128 @@
</el-table-column>
<el-table-column type="selection" align="center" width="60" />
<el-table-column label="" align="center" width="60" prop="groupIcon" />
<el-table-column label="医嘱" align="center" prop="productName" width="400">
<el-table-column label="医嘱类型" align="center" prop="productName" width="130">
<template #default="scope">
<template v-if="scope.row.isEdit">
<el-select
style="width: 35%; margin-right: 20px"
v-model="scope.row.adviceType"
:ref="'adviceTypeRef' + scope.$index"
@change="
(value) => {
expandOrder = [];
prescriptionList[scope.$index].adviceName = undefined;
adviceQueryParams.adviceType = value;
}
"
size="default"
style="width: 100%;"
v-model="scope.row.adviceType"
:ref="'adviceTypeRef' + scope.$index"
placeholder="选择类型"
clearable
@change="
(value) => {
expandOrder = [];
// 当医嘱类型改变时,清空当前选择的项目名称,因为不同类型项目的数据结构可能不兼容
prescriptionList[scope.$index].adviceName = undefined;
adviceQueryParams.adviceType = value;
// 根据选择的类型设置categoryCode用于药品分类筛选
if (value == 1) { // 西药
adviceQueryParams.categoryCode = '2';
} else if (value == 2) { // 中成药
adviceQueryParams.categoryCode = '1';
} else if (value == 3) { // 耗材
adviceQueryParams.categoryCode = ''; // 耗材不需要categoryCode筛选
} else if (value == 4) { // 诊疗
adviceQueryParams.categoryCode = ''; // 诊疗不需要categoryCode筛选
} else {
adviceQueryParams.categoryCode = ''; // 全部类型
}
}
"
@clear="
() => {
prescriptionList[scope.$index].adviceName = undefined;
prescriptionList[scope.$index].adviceType_dictText = '';
}
"
>
<el-option
v-for="item in adviceTypeList"
:key="item.value"
:label="item.label"
:value="item.value"
@click="
() => {
prescriptionList[scope.$index].adviceType = item.value;
prescriptionList[scope.$index].adviceType_dictText = item.label;
}
"
/>
v-for="item in adviceTypeList"
:key="item.value"
:label="item.label"
:value="item.value"
@click="
() => {
prescriptionList[scope.$index].adviceType = item.value;
prescriptionList[scope.$index].adviceType_dictText = item.label;
}
"
>
<span style="float: left">{{ item.label }}</span>
<span style="float: right; color: var(--el-text-color-secondary); font-size: 12px">
{{ item.value }}
</span>
</el-option>
</el-select>
</template>
<el-tag v-else size="small" type="primary">{{ scope.row.adviceType_dictText }}</el-tag>
</template>
</el-table-column>
<el-table-column label="项目" align="center" prop="" width="280">
<template #default="scope">
<template v-if="scope.row.isEdit">
<el-popover
:popper-style="{ padding: '0' }"
placement="bottom-start"
:visible="scope.row.showPopover"
:width="1200"
:popper-style="{ padding: '0' }"
placement="bottom-start"
:visible="scope.row.showPopover"
:width="1200"
trigger="manual"
>
<adviceBaseList
ref="adviceTableRef"
:popoverVisible="scope.row.showPopover"
:adviceQueryParams="adviceQueryParams"
:patientInfo="props.patientInfo"
@selectAdviceBase="
(row) => {
selectAdviceBase(scope.row.uniqueKey, row);
}
"
ref="adviceTableRef"
:popoverVisible="scope.row.showPopover"
:adviceQueryParams="adviceQueryParams"
:patientInfo="props.patientInfo"
@selectAdviceBase="
(row) => {
selectAdviceBase(scope.row.uniqueKey, row);
}
"
/>
<template #reference>
<el-input
:ref="'adviceRef' + scope.$index"
style="width: 50%"
v-model="scope.row.adviceName"
placeholder="请选择项目"
@input="handleChange"
@click="handleFocus(scope.row, scope.$index)"
@blur="handleBlur(scope.row)"
@keyup.enter.stop="handleFocus(scope.row, scope.$index)"
@keydown="
(e) => {
if (!scope.row.showPopover) return;
// 拦截上下键和回车事件
if (['ArrowUp', 'ArrowDown', 'Enter'].includes(e.key)) {
e.preventDefault();
// 传递事件到弹窗容器
adviceTableRef.handleKeyDown(e);
:ref="'adviceRef' + scope.$index"
size="default"
style="width: 100%;"
v-model="scope.row.adviceName"
placeholder="输入项目名称搜索或点击选择"
clearable
@input="handleChange"
@click="handleFocus(scope.row, scope.$index)"
@blur="handleBlur(scope.row)"
@clear="() => { scope.row.adviceName = undefined; }"
@keyup.enter.stop="handleFocus(scope.row, scope.$index)"
@keydown="
(e) => {
if (!scope.row.showPopover) return;
// 拦截上下键和回车事件
if (['ArrowUp', 'ArrowDown', 'Enter'].includes(e.key)) {
e.preventDefault();
// 传递事件到弹窗容器
adviceTableRef.handleKeyDown(e);
}
}
}
"
/>
"
>
<template #prefix>
<el-icon><Search /></el-icon>
</template>
<template #suffix v-if="scope.row.adviceName">
<el-icon style="cursor: pointer; color: var(--el-color-info);" title="快速选择">
<ArrowDown />
</el-icon>
</template>
</el-input>
</template>
</el-popover>
</template>
<span v-else>{{ scope.row.adviceName }}</span>
<div v-else style="display: flex; align-items: center; gap: 8px;">
<el-icon color="var(--el-color-primary)"><Memo /></el-icon>
<span>{{ scope.row.adviceName }}</span>
</div>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="" width="90">
@@ -869,7 +920,7 @@
<el-table-column label="总金额" align="right" prop="" header-align="center" width="100">
<template #default="scope">
<span v-if="!scope.row.isEdit" style="text-align: right">
{{ scope.row.totalPrice ? Number(scope.row.totalPrice).toFixed(2) + ' 元' : '-' }}
{{ (scope.row.totalPrice !== undefined && scope.row.totalPrice !== null && !isNaN(scope.row.totalPrice) && isFinite(scope.row.totalPrice)) ? Number(scope.row.totalPrice).toFixed(2) + ' 元' : '-' }}
</span>
</template>
</el-table-column>
@@ -991,8 +1042,9 @@ import SkinTestInfo from './skinTestInfo';
import Decimal from 'decimal.js';
import useUserStore from '@/store/modules/user';
import {ElMessage, ElMessageBox} from 'element-plus';
import {ArrowDown} from '@element-plus/icons-vue';
import {ArrowDown, Search, Memo} from '@element-plus/icons-vue';
import printUtils, {getPrinterList, PRINT_TEMPLATE, savePrinterToCache,} from '@/utils/printUtils';
import Template from "@/views/inpatientDoctor/home/emr/components/template.vue";
const emit = defineEmits(['selectDiagnosis']);
const total = ref(0);
@@ -1106,7 +1158,7 @@ onMounted(() => {
document.addEventListener('keydown', escKeyListener);
// 初始化时自动创建第一个西药处方
if (westernPrescriptions.value.length === 0) {
handleAddPrescription();
handleAddPrescription(null, false);
}
});
@@ -1531,7 +1583,7 @@ function getListInfo(addNewRow) {
});
getGroupMarkers(); // 更新标记
if (props.activeTab == 'prescription' && addNewRow) {
handleAddPrescription();
handleAddPrescription(null, false);
}
// 在所有异步操作完成后 resolve Promise
@@ -1595,14 +1647,16 @@ function handleSelectionChange(selection, row) {
}
// 新增医嘱
function handleAddPrescription(prescriptionId) {
function handleAddPrescription(prescriptionId, showWarning = true) {
// 如果传入了处方ID先切换到该处方
if (prescriptionId && prescriptionId !== currentPrescriptionId.value) {
switchToActivePrescription(prescriptionId);
}
if (diagnosisList.value.length == 0) {
proxy.$modal.msgWarning('请先保存诊断后再开立医嘱');
if (showWarning) {
proxy.$modal.msgWarning('请先保存诊断后再开立医嘱');
}
return;
}
if (isAdding.value) {
@@ -2291,7 +2345,7 @@ function handleSaveSign(row, index, prescriptionId) {
});
} else {
if (prescriptionList.value[0].adviceName) {
handleAddPrescription();
handleAddPrescription(null, false);
}
}
adviceQueryParams.value.adviceType = undefined;
@@ -2431,8 +2485,8 @@ function setValue(row) {
? (typeof row.skinTestFlag === 'number' ? row.skinTestFlag : (row.skinTestFlag ? 1 : 0))
: 0;
prescriptionList.value[targetIndex] = {
...prescriptionList.value[targetIndex],
prescriptionList.value[rowIndex.value] = {
...prescriptionList.value[rowIndex.value],
...JSON.parse(JSON.stringify(row)),
// 确保adviceType为数字类型避免类型不匹配导致的显示问题
adviceType: Number(row.adviceType),
@@ -2811,12 +2865,25 @@ function getGroupMarkers() {
function calculateTotalPrice(row, index) {
nextTick(() => {
if (row.adviceType == 3) {
row.totalPrice = (row.unitPrice * row.quantity).toFixed(6);
// 检查价格是否为有效数字
if (row.unitPrice !== undefined && row.unitPrice !== null && !isNaN(row.unitPrice) && isFinite(row.unitPrice)) {
row.totalPrice = (row.unitPrice * row.quantity).toFixed(6);
} else {
row.totalPrice = '0.000000'; // 或者设置为 0
}
} else {
if (row.unitCode == row.minUnitCode) {
row.totalPrice = (row.minUnitPrice * row.quantity).toFixed(6);
if (row.minUnitPrice !== undefined && row.minUnitPrice !== null && !isNaN(row.minUnitPrice) && isFinite(row.minUnitPrice)) {
row.totalPrice = (row.minUnitPrice * row.quantity).toFixed(6);
} else {
row.totalPrice = '0.000000';
}
} else {
row.totalPrice = (row.unitPrice * row.quantity).toFixed(6);
if (row.unitPrice !== undefined && row.unitPrice !== null && !isNaN(row.unitPrice) && isFinite(row.unitPrice)) {
row.totalPrice = (row.unitPrice * row.quantity).toFixed(6);
} else {
row.totalPrice = '0.000000';
}
}
}
});

View File

@@ -145,14 +145,20 @@ const fetchAll = async () => {
}
loadingCheck.value = true;
loadingInspection.value = true;
try {
await Promise.all([fetchCheckReport(), fetchInspectionReport()]);
} catch (e) {
proxy.$modal?.msgError?.(e.message || '查询报告失败');
} finally {
loadingCheck.value = false;
loadingInspection.value = false;
}
// 独立处理,互不影响
const runFetch = async (fn, loadingRef, name) => {
try {
await fn();
} catch (e) {
proxy.$modal?.msgError?.(`${name}查询失败: ${e.message || '未知错误'}`);
} finally {
loadingRef.value = false;
}
};
runFetch(fetchCheckReport, loadingCheck, '检查报告');
runFetch(fetchInspectionReport, loadingInspection, '检验报告');
};
const handleRefreshCheck = async () => {

View File

@@ -542,7 +542,17 @@ async function getListInfo(addNewRow) {
tcmPrescriptionList.value.forEach((prescription) => {
prescription.isAdding = false;
});
// 如果没有encounterId,不调用接口
if (!props.patientInfo || !props.patientInfo.encounterId) {
console.warn('【中医处方】patientInfo或encounterId为空,不调用接口')
tcmPrescriptionList.value = []
return
}
console.log('【中医处方】调用API,encounterId:', props.patientInfo.encounterId)
await getTcmAdviceList({ encounterId: props.patientInfo.encounterId }).then(async (res) => {
console.log('【中医处方】获取数据成功,处方数量:', res.data?.length || 0)
// 按 groupId 分组数据
const groupedData = {};
res.data.forEach((item) => {
@@ -623,7 +633,15 @@ async function getListInfo(addNewRow) {
}
function getDiagnosisInfo() {
// 如果没有encounterId,不调用接口
if (!props.patientInfo || !props.patientInfo.encounterId) {
console.warn('【中医诊断】patientInfo或encounterId为空,不调用接口')
diagnosisList.value = []
return
}
diagnosisList.value = [];
console.log('【中医诊断】调用API,encounterId:', props.patientInfo.encounterId)
getTcmDiagnosis({ encounterId: props.patientInfo.encounterId }).then((res) => {
if (res.data.illness.length > 0) {
res.data.illness.forEach((item, index) => {
@@ -635,6 +653,7 @@ function getDiagnosisInfo() {
});
});
}
console.log('【中医诊断】获取数据成功,诊断数量:', diagnosisList.value.length)
// 默认选择第一个诊断
if (diagnosisList.value.length > 0) {
const firstDiagnosis = diagnosisList.value[0];
@@ -756,6 +775,19 @@ function deletePrescription(prescription) {
const index = tcmPrescriptionList.value.findIndex((p) => p.id === prescription.id);
if (index !== -1) {
const prescriptionData = tcmPrescriptionList.value[index];
if (prescriptionData.prescriptionList && prescriptionData.prescriptionList.length > 0) {
proxy.$modal.msgWarning('该处方单还有药品,请先删除所有药品后再删除处方单');
return;
}
const hasChargedItems = prescriptionData.prescriptionList && prescriptionData.prescriptionList.some(item => item.statusEnum === 2);
if (hasChargedItems) {
proxy.$modal.msgWarning('该处方单已收费,不能删除');
return;
}
tcmPrescriptionList.value.splice(index, 1);
}
}
@@ -874,7 +906,7 @@ function selectAdviceBase(key, row, pIndex) {
).chargeItemDefinitionId;
// 库存列表 + 价格列表拼成批次号的下拉框
if (row.adviceType != 3) {
if (row.adviceType == 1 || row.adviceType == 2) {
if (row.inventoryList && row.inventoryList.length == 0) {
prescription.expandOrder = [];
proxy.$modal.msgWarning('该项目无库存');
@@ -1050,23 +1082,32 @@ function handleSaveSign(row, index, pIndex) {
const prescription = tcmPrescriptionList.value[pIndex];
const formRefName = 'formRef' + pIndex + '-' + index;
proxy.$refs[formRefName][0].validate((valid) => {
row.isEdit = false;
prescription.isAdding = false;
prescription.expandOrder = [];
row.contentJson = undefined;
row.patientId = props.patientInfo.patientId;
row.encounterId = props.patientInfo.encounterId;
row.accountId = prescription.accountId;
row.quantity = row.minUnitQuantity;
row.conditionId = prescription.conditionId;
row.unitPrice =
row.unitCodeList.find((item) => item.value == row.unitCode).type == 'unit'
? row.unitPrice
: new Decimal(row.unitPrice).div(row.partPercent).toFixed(2);
row.conditionDefinitionId = prescription.conditionDefinitionId;
row.encounterDiagnosisId = prescription.encounterDiagnosisId;
row.diagnosisName = prescription.diagnosisName;
row.contentJson = JSON.stringify(row);
if (valid) {
row.isEdit = false;
prescription.isAdding = false;
prescription.expandOrder = [];
row.contentJson = undefined;
row.patientId = props.patientInfo.patientId;
row.encounterId = props.patientInfo.encounterId;
row.accountId = prescription.accountId;
row.quantity = row.minUnitQuantity;
row.chineseHerbsDoseQuantity = prescription.chineseHerbsDoseQuantity;
row.unitPrice =
row.unitCodeList.find((item) => item.value == row.unitCode).type == 'unit'
? row.unitPrice
: new Decimal(row.unitPrice).div(row.partPercent).toFixed(2);
row.conditionDefinitionId = prescription.conditionDefinitionId;
row.encounterDiagnosisId = prescription.encounterDiagnosisId;
row.diagnosisName = prescription.diagnosisName;
// 寻找当前选中的单位字典值
const selectedUnit = row.unitCodeList.find((item) => item.value === row.minUnitCode);
if (selectedUnit) {
row.doseUnitCode_dictText = selectedUnit.label;
}
row.contentJson = JSON.stringify(row);
}
});
}

View File

@@ -81,11 +81,11 @@
{{
Object.keys(patientInfo).length !== 0
? patientInfo.patientName +
' / ' +
patientInfo.age +
' / ' +
patientInfo.genderEnum_enumText +
' / ' +
' / ' +
patientInfo.age +
' / ' +
patientInfo.genderEnum_enumText +
' / ' +
(patientInfo?.contractName ? patientInfo.contractName : '') +
'/' +
patientInfo.phone +
@@ -117,7 +117,7 @@
</el-descriptions-item>
</el-descriptions>
</div>
<div style="padding: 10px">
<div style="padding: 10px; position: relative">
<el-tabs
type="card"
style="width: 100%; height: 100%"
@@ -137,9 +137,9 @@
:patientInfo="patientInfo"
ref="emrRef"
@save="
(value) => {
saveStatus = value;
}
(value) => {
saveStatus = value;
}
"
/>
</el-tab-pane> -->
@@ -164,6 +164,9 @@
<el-tab-pane label="检验" name="inspection">
<inspectionApplication :patientInfo="patientInfo" :activeTab="activeTab" ref="inspectionRef" />
</el-tab-pane>
<el-tab-pane label="手术申请" name="surgery">
<surgeryApplication :patientInfo="patientInfo" :activeTab="activeTab" ref="surgeryRef" />
</el-tab-pane>
<el-tab-pane label="电子处方" name="eprescription">
<eprescriptionlist :patientInfo="patientInfo" ref="eprescriptionRef" />
</el-tab-pane>
@@ -217,6 +220,7 @@ import eprescriptionlist from './components/eprescriptionlist.vue';
import HospitalizationDialog from './components/hospitalizationDialog.vue';
import tcmAdvice from './components/tcm/tcmAdvice.vue';
import inspectionApplication from './components/inspection/inspectionApplication.vue';
import surgeryApplication from './components/surgery/surgeryApplication.vue';
import {formatDate, formatDateStr} from '@/utils/index';
import useUserStore from '@/store/modules/user';
import {nextTick} from 'vue';
@@ -266,6 +270,7 @@ const patientDrawerRef = ref();
const prescriptionRef = ref();
const tcmRef = ref();
const inspectionRef = ref();
const surgeryRef = ref();
const emrRef = ref();
const diagnosisRef = ref();
const waitCount = ref(0);
@@ -316,7 +321,10 @@ getPatientList();
function getPatientList() {
queryParams.value.statusEnum = 2;
getList(queryParams.value).then((res) => {
// console.log('API返回的完整数据:', res); // 添加这行来查看完整返回
// console.log('API返回的数据记录:', res.data.records); // 查看具体数据记录
patientList.value = res.data.records.map((item) => {
// console.log('处理的单个患者数据:', item); // 查看处理的单个患者数据
return {
...item,
active: currentEncounterId.value ? item.encounterId == currentEncounterId.value : false,
@@ -402,6 +410,9 @@ function handleClick(tab) {
case 'inspection':
// 检验tab点击处理逻辑可以在这里添加
break;
case 'surgery':
surgeryRef.value.getList();
break;
case 'eprescription':
eprescriptionRef.value.getList();
break;
@@ -423,17 +434,17 @@ function handleClick(tab) {
// 查看本次就诊处方单从医嘱Tab页获取已开立的处方单信息
function getEnPrescription(encounterId) {
getEnPrescriptionInfo({ encounterId: encounterId }).then((res) => {
console.log('处方单 res', res);
// console.log('处方单 res', res);
let dataArr = res.data.records || [];
if (dataArr.length <= 0) {
ElMessage({
type: 'error',
message: '暂无处方单',
});
return;
}
return;
}
prescriptionInfo.value = res.data.records;
openPrescriptionDialog.value = true;
openPrescriptionDialog.value = true;
});
}
@@ -453,6 +464,7 @@ function handleCardClick(item, index) {
patient.active = patient.encounterId === item.encounterId;
});
patientInfo.value = item;
// console.log('patientInfo.value.cardNo:', patientInfo.value.cardNo)
// 将患者信息保存到store中供hospitalizationEmr组件使用
updatePatientInfo(item);
activeTab.value = 'hospitalizationEmr';
@@ -460,6 +472,7 @@ function handleCardClick(item, index) {
prescriptionRef.value.getListInfo();
tcmRef.value.getListInfo();
inspectionRef.value.getList();
surgeryRef.value.getList();
diagnosisRef.value.getList();
eprescriptionRef.value.getList();
// emrRef.value.getDetail(item.encounterId);
@@ -540,7 +553,7 @@ const onHospitalization = async () => {
ElMessage({
type: 'error',
message: '该患者,已办理入院,不允许重复办理',
});
});
}
};
</script>
@@ -729,12 +742,14 @@ const onHospitalization = async () => {
.disabled-wrapper .overlay {
position: absolute;
top: 0;
top: 50px;
left: 0;
width: 100%;
height: 100%;
height: calc(100% - 50px);
z-index: 999;
/* 确保覆盖在内容上方 */
/* 确保覆盖在内容上方,但不覆盖顶部按钮区域 */
cursor: not-allowed;
background-color: rgba(255, 255, 255, 0.01);
pointer-events: auto;
}
</style>