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,