fix(medical-order): 解决医嘱编辑界面显示和验证问题 BUG#250,145
- 修复医嘱集合对话框中的条件判断逻辑,统一新增行的显示规则 - 更新医嘱集合对话框中剂量、给药途径、频次、天数等字段的显示逻辑 - 为西药类医嘱添加必填字段验证功能,包括剂量、给药途径、频次等 - 优化处方列表组件中编辑状态下的输入控件显示 - 修复处方详情数据合并逻辑,确保正确的字段优先级处理 - 解决多个库存管理模块中API请求数据格式错误的问题 - 修复医嘱库信息保存和数据回填的相关问题
This commit is contained in:
@@ -648,21 +648,49 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="单次剂量" align="center" prop="">
|
||||
<template #default="scope">
|
||||
<span v-if="!scope.row.isEdit">
|
||||
<template v-if="scope.row.isEdit">
|
||||
<el-input-number
|
||||
v-model="scope.row.dose"
|
||||
:min="0"
|
||||
:precision="2"
|
||||
:controls="false"
|
||||
style="width: 70px"
|
||||
size="small"
|
||||
/>
|
||||
<span style="margin-left: 4px">{{ scope.row.doseUnitCode_dictText }}</span>
|
||||
</template>
|
||||
<span v-else>
|
||||
{{ scope.row.dose ? scope.row.dose + ' ' + scope.row.doseUnitCode_dictText : '' }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="总量" align="center" prop="">
|
||||
<template #default="scope">
|
||||
<span v-if="!scope.row.isEdit">
|
||||
<template v-if="scope.row.isEdit">
|
||||
<el-input-number
|
||||
v-model="scope.row.quantity"
|
||||
:min="1"
|
||||
:precision="0"
|
||||
:controls="false"
|
||||
style="width: 60px"
|
||||
size="small"
|
||||
/>
|
||||
<span style="margin-left: 4px">{{ scope.row.unitCode_dictText }}</span>
|
||||
</template>
|
||||
<span v-else>
|
||||
{{ scope.row.quantity ? scope.row.quantity + ' ' + scope.row.unitCode_dictText : '' }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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">
|
||||
<template v-if="scope.row.isEdit">
|
||||
<span style="text-align: right; color: var(--el-color-primary); font-weight: bold;">
|
||||
{{ (scope.row.totalPrice !== undefined && scope.row.totalPrice !== null && !isNaN(scope.row.totalPrice) &&
|
||||
isFinite(scope.row.totalPrice)) ? Number(scope.row.totalPrice).toFixed(2) : '0.00' }} 元
|
||||
</span>
|
||||
</template>
|
||||
<span v-else 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) + ' 元' : '-' }}
|
||||
</span>
|
||||
@@ -670,14 +698,34 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="药房/科室" align="center" prop="" width="200">
|
||||
<template #default="scope">
|
||||
<span v-if="!scope.row.isEdit">
|
||||
<template v-if="scope.row.isEdit">
|
||||
<span style="color: var(--el-text-color-secondary);">{{ scope.row.positionName || '请选择药房' }}</span>
|
||||
</template>
|
||||
<span v-else>
|
||||
{{ scope.row.positionName }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="频次/用法" align="center" prop="" width="180">
|
||||
<template #default="scope">
|
||||
<span v-if="!scope.row.isEdit && scope.row.adviceType == 1" style="text-align: right">
|
||||
<template v-if="scope.row.isEdit && scope.row.adviceType == 1">
|
||||
<el-select v-model="scope.row.rateCode" size="small" style="width: 65px" placeholder="频次">
|
||||
<el-option v-for="item in rate_code" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
<el-input-number
|
||||
v-model="scope.row.dispensePerDuration"
|
||||
:min="1"
|
||||
:precision="0"
|
||||
:controls="false"
|
||||
style="width: 45px; margin-left: 2px"
|
||||
size="small"
|
||||
/>
|
||||
<span style="margin: 0 2px; font-size: 12px;">天</span>
|
||||
<el-select v-model="scope.row.methodCode" size="small" style="width: 65px" placeholder="用法">
|
||||
<el-option v-for="item in method_code" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</template>
|
||||
<span v-else-if="scope.row.adviceType == 1" style="text-align: right">
|
||||
{{
|
||||
scope.row.rateCode_dictText
|
||||
? scope.row.rateCode_dictText +
|
||||
@@ -3041,25 +3089,29 @@ function handleSaveGroup(orderGroupList) {
|
||||
// 🔥 新版组件已经预处理了数据,优先使用 mergedDetail
|
||||
// 如果没有 mergedDetail,则回退到旧版处理逻辑
|
||||
const mergedDetail = item.mergedDetail || {
|
||||
// 医嘱库基础信息
|
||||
// 医嘱库基础信息(作为默认值)
|
||||
...(item.orderDetailInfos || {}),
|
||||
|
||||
// 组套级别字段
|
||||
adviceName: item.orderDetailInfos?.adviceName || item.orderDefinitionName || '未知项目',
|
||||
adviceType: item.orderDetailInfos?.adviceType,
|
||||
// 组套级别字段(优先级更高,覆盖医嘱库字段)
|
||||
adviceName: item.orderDefinitionName || item.orderDetailInfos?.adviceName || '未知项目',
|
||||
adviceType: item.adviceType || item.orderDetailInfos?.adviceType,
|
||||
adviceDefinitionId: item.orderDefinitionId || item.orderDetailInfos?.adviceDefinitionId,
|
||||
quantity: item.quantity,
|
||||
unitCode: item.unitCode || item.orderDetailInfos?.unitCode,
|
||||
unitCodeName: item.unitCodeName,
|
||||
dose: item.dose || item.orderDetailInfos?.dose,
|
||||
unitCodeName: item.unitCodeName || item.orderDetailInfos?.unitCode_dictText,
|
||||
dose: item.dose !== undefined && item.dose !== null ? item.dose : item.orderDetailInfos?.dose,
|
||||
rateCode: item.rateCode || item.orderDetailInfos?.rateCode,
|
||||
methodCode: item.methodCode || item.orderDetailInfos?.methodCode,
|
||||
dispensePerDuration: item.dispensePerDuration || item.orderDetailInfos?.dispensePerDuration,
|
||||
doseQuantity: item.doseQuantity,
|
||||
dispensePerDuration: item.dispensePerDuration !== undefined && item.dispensePerDuration !== null
|
||||
? item.dispensePerDuration
|
||||
: item.orderDetailInfos?.dispensePerDuration,
|
||||
doseQuantity: item.doseQuantity !== undefined && item.doseQuantity !== null
|
||||
? item.doseQuantity
|
||||
: item.orderDetailInfos?.doseQuantity,
|
||||
inventoryList: item.orderDetailInfos?.inventoryList || [],
|
||||
priceList: item.orderDetailInfos?.priceList || [],
|
||||
partPercent: item.orderDetailInfos?.partPercent || 1,
|
||||
// 🔧 Bug #218 修复:positionId 可能存储在 item 本身,优先使用 item.positionId
|
||||
// positionId 优先使用 item 中设置的(从 checkOrderGroupAvailability 中)
|
||||
positionId: item.positionId || item.orderDetailInfos?.positionId,
|
||||
defaultLotNumber: item.orderDetailInfos?.defaultLotNumber,
|
||||
};
|
||||
@@ -3715,6 +3767,11 @@ async function checkOrderGroupAvailability(detailList) {
|
||||
}
|
||||
|
||||
const adviceInfo = res.data.records[0];
|
||||
|
||||
// 🔧 Bug Fix: 将医嘱库信息保存到 item 中,供后续使用
|
||||
item.orderDetailInfos = adviceInfo;
|
||||
item.adviceType = adviceInfo.adviceType;
|
||||
item.positionId = adviceInfo.positionId;
|
||||
|
||||
if (adviceInfo.adviceType != 3) {
|
||||
if (!adviceInfo.positionId) {
|
||||
|
||||
Reference in New Issue
Block a user