fix(medical-order): 解决医嘱编辑界面显示和验证问题 BUG#250,145

- 修复医嘱集合对话框中的条件判断逻辑,统一新增行的显示规则
- 更新医嘱集合对话框中剂量、给药途径、频次、天数等字段的显示逻辑
- 为西药类医嘱添加必填字段验证功能,包括剂量、给药途径、频次等
- 优化处方列表组件中编辑状态下的输入控件显示
- 修复处方详情数据合并逻辑,确保正确的字段优先级处理
- 解决多个库存管理模块中API请求数据格式错误的问题
- 修复医嘱库信息保存和数据回填的相关问题
This commit is contained in:
2026-03-23 15:46:30 +08:00
parent 316c1478fc
commit b5cf685b13
10 changed files with 144 additions and 46 deletions

View File

@@ -138,9 +138,9 @@
<el-table-column label="单次剂量" align="center" width="250" prop="sortNumber">
<template #default="scope">
<template v-if="scope.row.adviceType == 1">
<!-- 新增/未保存行统一按数量 + 单位 = 剂量 + 单位展示 -->
<template v-if="!scope.row.groupPackageId">
<template v-if="!scope.row.groupPackageId">
<template v-if="scope.row.adviceType == 1 || !scope.row.adviceDefinitionId">
<!-- 新增/未保存行统一按"数量 + 单位 = 剂量 + 单位"展示 -->
<el-input
style="width: 70px; margin-right: 10px"
v-model="scope.row.doseQuantity"
@@ -177,16 +177,19 @@
}}
</span>
</template>
<span v-else>{{ scope.row.dose }}</span>
<span v-else>-</span>
</template>
<template v-else>
<span v-if="scope.row.adviceType == 1">{{ scope.row.dose }}</span>
<span v-else>-</span>
</template>
<span v-else>{{ '-' }}</span>
</template>
</el-table-column>
<el-table-column label="给药途径" align="center" width="150" prop="sortNumber">
<template #default="scope">
<template v-if="scope.row.adviceType == 1">
<template v-if="!scope.row.groupPackageId">
<template v-if="!scope.row.groupPackageId">
<template v-if="scope.row.adviceType == 1 || !scope.row.adviceDefinitionId">
<el-select v-model="scope.row.methodCode" placeholder="给药途径" clearable filterable>
<el-option
v-for="dict in method_code"
@@ -196,16 +199,19 @@
/>
</el-select>
</template>
<span v-else>{{ scope.row.methodCode }}</span>
<span v-else>-</span>
</template>
<template v-else>
<span v-if="scope.row.adviceType == 1">{{ scope.row.methodCode_dictText || scope.row.methodCode }}</span>
<span v-else>-</span>
</template>
<span v-else>{{ '-' }}</span>
</template>
</el-table-column>
<el-table-column label="用药频次" align="center" width="150" prop="sortNumber">
<template #default="scope">
<template v-if="scope.row.adviceType == 1">
<template v-if="!scope.row.groupPackageId">
<template v-if="!scope.row.groupPackageId">
<template v-if="scope.row.adviceType == 1 || !scope.row.adviceDefinitionId">
<el-select
v-model="scope.row.rateCode"
placeholder="频次"
@@ -220,24 +226,30 @@
/>
</el-select>
</template>
<span v-else>{{ scope.row.rateCode_dictText }}</span>
<span v-else>-</span>
</template>
<template v-else>
<span v-if="scope.row.adviceType == 1">{{ scope.row.rateCode_dictText }}</span>
<span v-else>-</span>
</template>
<span v-else>{{ '-' }}</span>
</template>
</el-table-column>
<el-table-column label="用药天数" align="center" width="100" prop="sortNumber">
<template #default="scope">
<template v-if="scope.row.adviceType == 1">
<template v-if="!scope.row.groupPackageId">
<template v-if="!scope.row.groupPackageId">
<template v-if="scope.row.adviceType == 1 || !scope.row.adviceDefinitionId">
<el-input
v-model="scope.row.dispensePerDuration"
@change="handleQuantityChange(scope.row)"
/>
</template>
<span v-else>{{ scope.row.dispensePerDuration }}</span>
<span v-else>-</span>
</template>
<template v-else>
<span v-if="scope.row.adviceType == 1">{{ scope.row.dispensePerDuration }}</span>
<span v-else>-</span>
</template>
<span v-else>{{ '-' }}</span>
</template>
</el-table-column>
@@ -700,6 +712,35 @@ function submitForm() {
return;
}
// 验证西药类医嘱的必填字段
const westernMedicineRows = detailList.filter((item) => item.adviceType == 1);
for (const row of westernMedicineRows) {
if (!row.dose && row.dose !== 0) {
proxy?.$modal?.msgWarning?.('单次剂量为必填项');
return;
}
if (!row.methodCode) {
proxy?.$modal?.msgWarning?.('给药途径为必填项');
return;
}
if (!row.rateCode) {
proxy?.$modal?.msgWarning?.('用药频次为必填项');
return;
}
if (!row.dispensePerDuration && row.dispensePerDuration !== 0) {
proxy?.$modal?.msgWarning?.('用药天数为必填项');
return;
}
if (!row.sortNumber && row.sortNumber !== 0) {
proxy?.$modal?.msgWarning?.('总量/执行次数为必填项');
return;
}
if (!row.selectUnitCode) {
proxy?.$modal?.msgWarning?.('单位为必填项');
return;
}
}
submitLoading.value = true;
setTimeout(() => {
console.log('[submitForm] 当前tab:', currentTab.value);