开立医嘱的执行科室默认获取诊疗项目维护的所属科室

This commit is contained in:
2025-10-31 12:30:22 +08:00

View File

@@ -550,51 +550,36 @@
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column label="序号" align="center" width="60" prop="sortNumber"> </el-table-column> --> <!-- <el-table-column label="序号" align="center" width="60" prop="sortNumber"> </el-table-column> -->
<el-table-column label="医嘱" align="center" prop="productName" width="400"> <!-- 医嘱类型列 -->
<el-table-column label="医嘱类型" align="center" width="120">
<template #default="scope"> <template #default="scope">
<template v-if="getRowDisabled(scope.row)"> <template v-if="getRowDisabled(scope.row)">
<el-select <el-select
style="width: 35%; margin-right: 20px"
v-model="scope.row.adviceType" v-model="scope.row.adviceType"
:ref="'adviceTypeRef' + scope.$index" :ref="'adviceTypeRef' + scope.$index"
@change=" @change="handleAdviceTypeChange(scope.row, scope.$index)"
(value) => { placeholder="请选择"
expandOrder = []; style="width: 100%">
prescriptionList[scope.$index].adviceName = undefined;
// 直接更新查询参数
adviceQueryParams.value.adviceType = value;
adviceQueryParams.value.searchKey = '';
console.log('医嘱类型改变为:', value, '查询参数:', adviceQueryParams.value);
// 确保弹窗重新打开
nextTick(() => {
row.showPopover = true;
handleFocus(scope.row, scope.$index);
});
}
"
>
<el-option <el-option
v-for="item in adviceTypeList" v-for="item in adviceTypeList"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
@click="
() => {
prescriptionList[scope.$index].adviceType = item.value;
prescriptionList[scope.$index].adviceType_dictText = item.label;
}
"
/> />
</el-select> </el-select>
</template>
<span v-else>{{ getAdviceTypeText(scope.row.adviceType) }}</span>
</template>
</el-table-column>
<!-- 项目列 -->
<el-table-column label="项目" align="center" prop="productName" width="280">
<template #default="scope">
<template v-if="getRowDisabled(scope.row)">
<el-popover <el-popover
:popper-style="{ padding: '0' }" :popper-style="{ padding: '0' }"
placement="bottom-start" placement="bottom-start"
:visible="scope.row.showPopover" :visible="scope.row.showPopover"
:width="1200" :width="1200">
>
<adviceBaseList <adviceBaseList
ref="adviceTableRef" ref="adviceTableRef"
:popoverVisible="scope.row.showPopover" :popoverVisible="scope.row.showPopover"
@@ -605,24 +590,14 @@
<template #reference> <template #reference>
<el-input <el-input
:ref="'adviceRef' + scope.$index" :ref="'adviceRef' + scope.$index"
style="width: 50%"
v-model="scope.row.adviceName" v-model="scope.row.adviceName"
placeholder="请选择项目" placeholder="请选择项目"
@input="handleChange" @input="handleChange"
@click="handleFocus(scope.row, scope.$index)" @click="handleFocus(scope.row, scope.$index)"
@keyup.enter.stop="handleFocus(scope.row, scope.$index)" @keyup.enter.stop="handleFocus(scope.row, scope.$index)"
@keydown=" @keydown="handleInputKeyDown(scope.row, $event)"
(e) => {
if (!scope.row.showPopover) return;
// 拦截上下键和回车事件
if (['ArrowUp', 'ArrowDown', 'Enter'].includes(e.key)) {
e.preventDefault();
// 传递事件到弹窗容器
adviceTableRef.handleKeyDown(e);
}
}
"
@blur="handleBlur(scope.row)" @blur="handleBlur(scope.row)"
style="width: 100%"
/> />
</template> </template>
</el-popover> </el-popover>
@@ -877,6 +852,15 @@ watch(
}, },
{ immediate: true } { immediate: true }
); );
// 获取医嘱类别显示文本
function getAdviceTypeText(adviceType) {
const typeMap = {
1: '西药中成药',
2: '耗材',
3: '诊疗'
};
return typeMap[adviceType] || '未知';
}
function handleTotalAmount() { function handleTotalAmount() {
totalAmount.value = prescriptionList.value.reduce((accumulator, currentRow) => { totalAmount.value = prescriptionList.value.reduce((accumulator, currentRow) => {
if (currentRow.chargeStatus != 8) { if (currentRow.chargeStatus != 8) {
@@ -1119,9 +1103,11 @@ function selectAdviceBase(key, row) {
prescriptionList.value[rowIndex.value].positionName = stock.locationName; prescriptionList.value[rowIndex.value].positionName = stock.locationName;
} }
} else { } else {
prescriptionList.value[rowIndex.value].orgId = JSON.parse(JSON.stringify(row)).positionId; // 执行科室默认逻辑:优先使用诊疗项目维护的所属科室,如果没有则使用开单科室
const defaultOrgId = row.positionId || props.patientInfo.orgId;
prescriptionList.value[rowIndex.value].orgId = defaultOrgId;
prescriptionList.value[rowIndex.value].unitPrice = row.priceList[0].price; prescriptionList.value[rowIndex.value].unitPrice = row.priceList[0].price;
} }
expandOrder.value = [key]; expandOrder.value = [key];
nextTick(() => { nextTick(() => {
if (row.adviceType == 1) { if (row.adviceType == 1) {
@@ -1515,9 +1501,11 @@ function setValue(row) {
.toFixed(2); .toFixed(2);
} }
} else { } else {
prescriptionList.value[rowIndex.value].orgId = JSON.parse(JSON.stringify(row)).positionId; // 执行科室默认逻辑:优先使用诊疗项目维护的所属科室,如果没有则使用开单科室
const defaultOrgId = row.positionId || props.patientInfo.orgId;
prescriptionList.value[rowIndex.value].orgId = defaultOrgId;
prescriptionList.value[rowIndex.value].unitPrice = row.priceList[0].price; prescriptionList.value[rowIndex.value].unitPrice = row.priceList[0].price;
} }
} }
// 组套保存 // 组套保存