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

This commit is contained in:
itcast
2026-01-16 15:46:43 +08:00
parent 2b3add4808
commit be0514bc08
86 changed files with 2224 additions and 3929 deletions

View File

@@ -19,7 +19,7 @@
<span>{{ item.prescriptionNo }}</span>
</div>
<div style="text-align: center">
<h2>{{ userStore.hospitalName }}</h2>
<h2>长春市朝阳区中医院医院</h2>
</div>
<div style="text-align: center">
<h3>处方单</h3>
@@ -144,9 +144,6 @@
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 +
' [' +
(scope.row.unitPrice !== undefined && scope.row.unitPrice !== null && !isNaN(scope.row.unitPrice) && isFinite(scope.row.unitPrice) ? Number(scope.row.unitPrice).toFixed(2) : '-') +
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 !== undefined && scope.row.totalPrice !== null && !isNaN(scope.row.totalPrice) && isFinite(scope.row.totalPrice))
scope.row.totalPrice
? Number(scope.row.totalPrice).toFixed(2) + ' 元'
: '0.00 元'
}}
@@ -631,7 +631,7 @@
" " +
scope.row.volume +
" [" +
(scope.row.unitPrice !== undefined && scope.row.unitPrice !== null && !isNaN(scope.row.unitPrice) && isFinite(scope.row.unitPrice) ? Number(scope.row.unitPrice).toFixed(2) : '-') +
Number(scope.row.unitPrice).toFixed(2) +
" " +
"/" +
scope.row.unitCode_dictText +
@@ -687,7 +687,7 @@
</el-form-item>
<span class="total-amount">
总金额:{{
(scope.row.totalPrice !== undefined && scope.row.totalPrice !== null && !isNaN(scope.row.totalPrice) && isFinite(scope.row.totalPrice))
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 !== undefined && scope.row.unitPrice !== null && !isNaN(scope.row.unitPrice) && isFinite(scope.row.unitPrice))
scope.row.unitPrice
? Number(scope.row.unitPrice).toFixed(2) + '/次'
: '-' + '元'
}}
@@ -748,7 +748,7 @@
<span class="total-amount">
总金额:
{{
(scope.row.totalPrice !== undefined && scope.row.totalPrice !== null && !isNaN(scope.row.totalPrice) && isFinite(scope.row.totalPrice))
scope.row.totalPrice
? Number(scope.row.totalPrice).toFixed(2) + ' 元'
: '0.00 元'
}}
@@ -766,128 +766,77 @@
</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="130">
<el-table-column label="医嘱" align="center" prop="productName" width="400">
<template #default="scope">
<template v-if="scope.row.isEdit">
<el-select
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 = '';
}
"
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;
}
"
>
<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;
}
"
>
<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>
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;
}
"
/>
</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"
trigger="manual"
:popper-style="{ padding: '0' }"
placement="bottom-start"
:visible="scope.row.showPopover"
:width="1200"
>
<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"
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);
}
: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);
}
"
>
<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>
<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>
<span v-else>{{ scope.row.adviceName }}</span>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="" width="90">
@@ -920,7 +869,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 !== undefined && scope.row.totalPrice !== null && !isNaN(scope.row.totalPrice) && isFinite(scope.row.totalPrice)) ? Number(scope.row.totalPrice).toFixed(2) + ' 元' : '-' }}
{{ scope.row.totalPrice ? Number(scope.row.totalPrice).toFixed(2) + ' 元' : '-' }}
</span>
</template>
</el-table-column>
@@ -1042,9 +991,8 @@ import SkinTestInfo from './skinTestInfo';
import Decimal from 'decimal.js';
import useUserStore from '@/store/modules/user';
import {ElMessage, ElMessageBox} from 'element-plus';
import {ArrowDown, Search, Memo} from '@element-plus/icons-vue';
import {ArrowDown} 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);
@@ -1158,7 +1106,7 @@ onMounted(() => {
document.addEventListener('keydown', escKeyListener);
// 初始化时自动创建第一个西药处方
if (westernPrescriptions.value.length === 0) {
handleAddPrescription(null, false);
handleAddPrescription();
}
});
@@ -1583,7 +1531,7 @@ function getListInfo(addNewRow) {
});
getGroupMarkers(); // 更新标记
if (props.activeTab == 'prescription' && addNewRow) {
handleAddPrescription(null, false);
handleAddPrescription();
}
// 在所有异步操作完成后 resolve Promise
@@ -1647,16 +1595,14 @@ function handleSelectionChange(selection, row) {
}
// 新增医嘱
function handleAddPrescription(prescriptionId, showWarning = true) {
function handleAddPrescription(prescriptionId) {
// 如果传入了处方ID先切换到该处方
if (prescriptionId && prescriptionId !== currentPrescriptionId.value) {
switchToActivePrescription(prescriptionId);
}
if (diagnosisList.value.length == 0) {
if (showWarning) {
proxy.$modal.msgWarning('请先保存诊断后再开立医嘱');
}
proxy.$modal.msgWarning('请先保存诊断后再开立医嘱');
return;
}
if (isAdding.value) {
@@ -2345,7 +2291,7 @@ function handleSaveSign(row, index, prescriptionId) {
});
} else {
if (prescriptionList.value[0].adviceName) {
handleAddPrescription(null, false);
handleAddPrescription();
}
}
adviceQueryParams.value.adviceType = undefined;
@@ -2485,8 +2431,8 @@ function setValue(row) {
? (typeof row.skinTestFlag === 'number' ? row.skinTestFlag : (row.skinTestFlag ? 1 : 0))
: 0;
prescriptionList.value[rowIndex.value] = {
...prescriptionList.value[rowIndex.value],
prescriptionList.value[targetIndex] = {
...prescriptionList.value[targetIndex],
...JSON.parse(JSON.stringify(row)),
// 确保adviceType为数字类型避免类型不匹配导致的显示问题
adviceType: Number(row.adviceType),
@@ -2865,25 +2811,12 @@ function getGroupMarkers() {
function calculateTotalPrice(row, index) {
nextTick(() => {
if (row.adviceType == 3) {
// 检查价格是否为有效数字
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
}
row.totalPrice = (row.unitPrice * row.quantity).toFixed(6);
} else {
if (row.unitCode == row.minUnitCode) {
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';
}
row.totalPrice = (row.minUnitPrice * row.quantity).toFixed(6);
} else {
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';
}
row.totalPrice = (row.unitPrice * row.quantity).toFixed(6);
}
}
});