From b5527cc07faad7e6340df8f4e6804bb0e78ca427 Mon Sep 17 00:00:00 2001
From: Ranyunqiao <2499115710@qq.com>
Date: Mon, 30 Mar 2026 09:03:49 +0800
Subject: [PATCH] =?UTF-8?q?294=20=E6=A3=80=E6=9F=A5=E9=A1=B9=E7=9B=AE?=
=?UTF-8?q?=E8=AE=BE=E7=BD=AE-=E3=80=8B=E5=A5=97=E9=A4=90=E8=AE=BE?=
=?UTF-8?q?=E7=BD=AE=EF=BC=9A=E5=9F=BA=E6=9C=AC=E4=BF=A1=E6=81=AF=E6=9C=8D?=
=?UTF-8?q?=E5=8A=A1=E8=B4=B9=E5=AD=97=E6=AE=B5=E7=9A=84=E5=80=BC=E7=B3=BB?=
=?UTF-8?q?=E7=BB=9F=E6=B2=A1=E6=9C=89=E8=87=AA=E5=8A=A8=E5=90=88=E8=AE=A1?=
=?UTF-8?q?=E5=A5=97=E9=A4=90=E6=98=8E=E7=BB=86=E6=9C=8D=E5=8A=A1=E8=B4=B9?=
=?UTF-8?q?=E5=AD=97=E6=AE=B5=E6=89=80=E6=9C=89=E8=A1=8C=E7=9A=84=E5=80=BC?=
=?UTF-8?q?=20295=20=E6=A3=80=E6=9F=A5=E9=A1=B9=E7=9B=AE=E8=AE=BE=E7=BD=AE?=
=?UTF-8?q?-=E3=80=8B=E5=A5=97=E9=A4=90=E8=AE=BE=E7=BD=AE=EF=BC=9A?=
=?UTF-8?q?=E5=A5=97=E9=A4=90=E6=98=8E=E7=BB=86=E6=95=B0=E9=87=8F=E5=AD=97?=
=?UTF-8?q?=E6=AE=B5=E5=90=8E=E9=9D=A2=E9=9C=80=E8=A6=81=E5=A2=9E=E5=8A=A0?=
=?UTF-8?q?=E5=8D=95=E4=BD=8D=E5=AD=97=E6=AE=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../web/check/dto/CheckPackageDetailDto.java | 3 ++
.../ActivityDefinitionManageMapper.xml | 1 +
.../check/domain/CheckPackageDetail.java | 3 ++
.../components/PackageSettings.vue | 44 ++++++++++++++++---
4 files changed, 44 insertions(+), 7 deletions(-)
diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/check/dto/CheckPackageDetailDto.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/check/dto/CheckPackageDetailDto.java
index f3d1e442..1047b643 100644
--- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/check/dto/CheckPackageDetailDto.java
+++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/check/dto/CheckPackageDetailDto.java
@@ -49,6 +49,9 @@ public class CheckPackageDetailDto {
@NotNull(message = "数量不能为空")
private Integer quantity;
+ /** 单位 */
+ private String unit;
+
/** 单价 */
@NotNull(message = "单价不能为空")
private BigDecimal unitPrice;
diff --git a/openhis-server-new/openhis-application/src/main/resources/mapper/datadictionary/ActivityDefinitionManageMapper.xml b/openhis-server-new/openhis-application/src/main/resources/mapper/datadictionary/ActivityDefinitionManageMapper.xml
index 91b7b594..53bb90d0 100644
--- a/openhis-server-new/openhis-application/src/main/resources/mapper/datadictionary/ActivityDefinitionManageMapper.xml
+++ b/openhis-server-new/openhis-application/src/main/resources/mapper/datadictionary/ActivityDefinitionManageMapper.xml
@@ -84,6 +84,7 @@
T1.id,
T1.bus_no,
T1.name,
+ T1.permitted_unit_code,
T2.price as retail_price
FROM wor_activity_definition T1
INNER JOIN adm_charge_item_definition T2
diff --git a/openhis-server-new/openhis-domain/src/main/java/com/openhis/check/domain/CheckPackageDetail.java b/openhis-server-new/openhis-domain/src/main/java/com/openhis/check/domain/CheckPackageDetail.java
index 98569618..2e725e8a 100644
--- a/openhis-server-new/openhis-domain/src/main/java/com/openhis/check/domain/CheckPackageDetail.java
+++ b/openhis-server-new/openhis-domain/src/main/java/com/openhis/check/domain/CheckPackageDetail.java
@@ -53,6 +53,9 @@ public class CheckPackageDetail {
/** 数量 */
private Integer quantity;
+ /** 单位 */
+ private String unit;
+
/** 单价 */
private BigDecimal unitPrice;
diff --git a/openhis-ui-vue3/src/views/maintainSystem/checkprojectSettings/components/PackageSettings.vue b/openhis-ui-vue3/src/views/maintainSystem/checkprojectSettings/components/PackageSettings.vue
index 1058c9e4..17769d57 100644
--- a/openhis-ui-vue3/src/views/maintainSystem/checkprojectSettings/components/PackageSettings.vue
+++ b/openhis-ui-vue3/src/views/maintainSystem/checkprojectSettings/components/PackageSettings.vue
@@ -152,11 +152,11 @@
@@ -281,6 +281,12 @@
{{ row.quantity }}
+
+
+ {{ row.unit || '-' }}
+ {{ row.unit || '-' }}
+
+
handleServiceChargeInput(val, row)"
/>
{{ row.serviceCharge?.toFixed(2) || '0.00' }}
@@ -539,6 +545,7 @@ function loadPackageData(data) {
days: item.days || '',
quantity: item.quantity || 1,
unitPrice: item.unitPrice || 0,
+ unit: item.unit || '',
amount: item.amount || 0,
serviceCharge: item.serviceCharge || 0,
total: item.total || 0,
@@ -553,6 +560,9 @@ function loadPackageData(data) {
console.log('formData 加载后:', formData)
console.log('detailData 加载后:', detailData.value)
+
+ // 加载数据后自动计算总服务费
+ calculateTotalServiceFee()
}
onMounted(async () => {
@@ -781,10 +791,12 @@ async function loadDiagnosisTreatmentItem(itemId, itemData) {
async function loadDiagnosisTreatmentList(forceRefresh = false) {
// 如果不是强制刷新且已有数据且未过期,直接返回
if (!forceRefresh && diagnosisTreatmentList.value.length > 0) {
- return
+ // 由于缓存过期时间改为0,始终视为过期,需要重新加载
+ // 这里直接跳过,不返回,让它重新加载
}
// 从session缓存读取
+ let useCache = false
try {
const cachedData = cache.session.getJSON(DIAGNOSIS_TREATMENT_CACHE_KEY)
if (cachedData && cachedData.timestamp) {
@@ -812,7 +824,7 @@ async function loadDiagnosisTreatmentList(forceRefresh = false) {
if (allItems.length > 0) {
diagnosisTreatmentList.value = allItems
-
+
// 保存到缓存
cache.session.setJSON(DIAGNOSIS_TREATMENT_CACHE_KEY, {
data: allItems,
@@ -877,6 +889,7 @@ function handleAddRow() {
frequency: '',
days: '',
quantity: 1,
+ unit: '',
unitPrice: 0,
amount: 0,
serviceCharge: 0,
@@ -914,6 +927,7 @@ function handleDeleteRow(index) {
}).then(() => {
detailData.value.splice(index, 1)
calculatePackagePrice()
+ calculateTotalServiceFee()
ElMessage.success('删除成功')
}).catch(() => {})
}
@@ -1027,7 +1041,9 @@ function handleItemSelect(row) {
row.itemName = item.name || item.itemName || ''
row.code = item.busNo || item.code || item.itemCode || ''
row.unitPrice = parseFloat(item.retailPrice || item.unitPrice || item.price || 0)
- console.log('设置单价:', row.unitPrice)
+ // permittedUnitCode_dictText是字典翻译后的值,permittedUnitCode是后端返回的原始值
+ row.unit = item.permittedUnitCode_dictText || item.permittedUnitCode || ''
+
// 缓存选中的项目
loadDiagnosisTreatmentItem(row.itemId, item)
@@ -1044,10 +1060,23 @@ function calculateAmount(row) {
calculateTotal(row)
}
+// 处理服务费输入
+function handleServiceChargeInput(val, row) {
+ row.serviceCharge = val || 0
+ calculateTotal(row)
+}
+
// 计算总金额
function calculateTotal(row) {
row.total = (row.amount || 0) + (row.serviceCharge || 0)
calculatePackagePrice()
+ calculateTotalServiceFee()
+}
+
+// 计算总服务费(合计所有明细行的服务费)
+function calculateTotalServiceFee() {
+ const totalServiceFee = detailData.value.reduce((sum, item) => sum + (item.serviceCharge || 0), 0)
+ formData.serviceFee = totalServiceFee
}
// 计算套餐金额(应用折扣)
@@ -1203,6 +1232,7 @@ async function handleSave() {
frequency: item.frequency || '',
days: item.days || '',
quantity: parseInt(item.quantity) || 1,
+ unit: item.unit || '',
unitPrice: parseFloat(item.unitPrice) || 0,
amount: parseFloat(item.amount) || 0,
serviceCharge: parseFloat(item.serviceCharge) || 0,