Merge remote-tracking branch 'origin/develop' into guanyu
This commit is contained in:
@@ -131,7 +131,7 @@
|
|||||||
<vxe-column
|
<vxe-column
|
||||||
title="类型"
|
title="类型"
|
||||||
align="center"
|
align="center"
|
||||||
width="120"
|
width="160"
|
||||||
>
|
>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<template v-if="!scope.row.groupPackageId">
|
<template v-if="!scope.row.groupPackageId">
|
||||||
@@ -205,7 +205,6 @@
|
|||||||
title="单次剂量"
|
title="单次剂量"
|
||||||
align="center"
|
align="center"
|
||||||
width="250"
|
width="250"
|
||||||
field="sortNumber"
|
|
||||||
>
|
>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<template v-if="!scope.row.groupPackageId">
|
<template v-if="!scope.row.groupPackageId">
|
||||||
@@ -214,11 +213,7 @@
|
|||||||
<el-input
|
<el-input
|
||||||
v-model="scope.row.doseQuantity"
|
v-model="scope.row.doseQuantity"
|
||||||
style="width: 70px; margin-right: 10px"
|
style="width: 70px; margin-right: 10px"
|
||||||
@input="
|
@input="(value) => handleDoseQuantityChange(value, scope.row)"
|
||||||
(value) => {
|
|
||||||
scope.row.dose = value * scope.row.unitConversionRatio;
|
|
||||||
}
|
|
||||||
"
|
|
||||||
/>
|
/>
|
||||||
<span>
|
<span>
|
||||||
{{
|
{{
|
||||||
@@ -232,11 +227,7 @@
|
|||||||
<el-input
|
<el-input
|
||||||
v-model="scope.row.dose"
|
v-model="scope.row.dose"
|
||||||
style="width: 70px; margin-right: 10px"
|
style="width: 70px; margin-right: 10px"
|
||||||
@input="
|
@input="(value) => handleDoseChange(value, scope.row)"
|
||||||
(value) => {
|
|
||||||
scope.row.doseQuantity = value / scope.row.unitConversionRatio;
|
|
||||||
}
|
|
||||||
"
|
|
||||||
/>
|
/>
|
||||||
<span>
|
<span>
|
||||||
{{
|
{{
|
||||||
@@ -260,7 +251,6 @@
|
|||||||
title="给药途径"
|
title="给药途径"
|
||||||
align="center"
|
align="center"
|
||||||
width="150"
|
width="150"
|
||||||
field="sortNumber"
|
|
||||||
>
|
>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<template v-if="!scope.row.groupPackageId">
|
<template v-if="!scope.row.groupPackageId">
|
||||||
@@ -292,7 +282,6 @@
|
|||||||
title="用药频次"
|
title="用药频次"
|
||||||
align="center"
|
align="center"
|
||||||
width="150"
|
width="150"
|
||||||
field="sortNumber"
|
|
||||||
>
|
>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<template v-if="!scope.row.groupPackageId">
|
<template v-if="!scope.row.groupPackageId">
|
||||||
@@ -324,7 +313,6 @@
|
|||||||
title="用药天数"
|
title="用药天数"
|
||||||
align="center"
|
align="center"
|
||||||
width="100"
|
width="100"
|
||||||
field="sortNumber"
|
|
||||||
>
|
>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<template v-if="!scope.row.groupPackageId">
|
<template v-if="!scope.row.groupPackageId">
|
||||||
@@ -547,8 +535,7 @@ function openAdd(tab) {
|
|||||||
} else if (tab === 'department') {
|
} else if (tab === 'department') {
|
||||||
formData.organizationId = userStore.orgId;
|
formData.organizationId = userStore.orgId;
|
||||||
}
|
}
|
||||||
|
// 不再默认新增空行,用户点击"新增"按钮时才添加
|
||||||
addEmptyRow();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleRangeChange(tab) {
|
function handleRangeChange(tab) {
|
||||||
@@ -680,7 +667,7 @@ function openEdit(tab, row) {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
nextId.value = prescriptionList.value.length + 1;
|
nextId.value = prescriptionList.value.length + 1;
|
||||||
addEmptyRow();
|
// 不再默认新增空行,用户点击"新增"按钮时才添加
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -939,8 +926,9 @@ function selectAdviceBase(key, row) {
|
|||||||
JSON.stringify(row)
|
JSON.stringify(row)
|
||||||
).chargeItemDefinitionId;
|
).chargeItemDefinitionId;
|
||||||
prescriptionList.value[rowIndex.value].therapyEnum = preservedTherapyEnum;
|
prescriptionList.value[rowIndex.value].therapyEnum = preservedTherapyEnum;
|
||||||
addEmptyRow();
|
// 不再自动新增空行,用户点击"新增"按钮时才添加
|
||||||
expandOrder.value = [key];
|
// 强制触发 vxe-table v4 响应式更新(v4 不响应数组元素直接索引赋值)
|
||||||
|
prescriptionList.value = [...prescriptionList.value];
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleFocus(row, index) {
|
function handleFocus(row, index) {
|
||||||
@@ -972,6 +960,38 @@ function handleQuantityChange(row) {
|
|||||||
prescriptionList.value = [...prescriptionList.value];
|
prescriptionList.value = [...prescriptionList.value];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 单次剂量数量变化 → 自动计算剂量
|
||||||
|
function handleDoseQuantityChange(value, row) {
|
||||||
|
if (value === '' || value === null || value === undefined) {
|
||||||
|
row.dose = undefined;
|
||||||
|
} else {
|
||||||
|
const ratio = row.unitConversionRatio;
|
||||||
|
const numValue = Number(value) || 0;
|
||||||
|
if (ratio && Number(ratio) > 0) {
|
||||||
|
row.dose = numValue * Number(ratio);
|
||||||
|
} else {
|
||||||
|
row.dose = numValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
prescriptionList.value = [...prescriptionList.value];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 剂量变化 → 反算单次剂量数量
|
||||||
|
function handleDoseChange(value, row) {
|
||||||
|
if (value === '' || value === null || value === undefined) {
|
||||||
|
row.doseQuantity = undefined;
|
||||||
|
} else {
|
||||||
|
const ratio = row.unitConversionRatio;
|
||||||
|
const numValue = Number(value) || 0;
|
||||||
|
if (ratio && Number(ratio) > 0) {
|
||||||
|
row.doseQuantity = numValue / Number(ratio);
|
||||||
|
} else {
|
||||||
|
row.doseQuantity = numValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
prescriptionList.value = [...prescriptionList.value];
|
||||||
|
}
|
||||||
|
|
||||||
function handleUnitChange(row) {
|
function handleUnitChange(row) {
|
||||||
prescriptionList.value = [...prescriptionList.value];
|
prescriptionList.value = [...prescriptionList.value];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user