Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
2026-06-24 14:23:50 +08:00
13 changed files with 81 additions and 42 deletions

View File

@@ -0,0 +1,9 @@
-- 修复 电子健康卡 & 电子发票 的 parent_id 为 基础数据 (211)
UPDATE sys_menu
SET parent_id = (SELECT menu_id FROM sys_menu WHERE menu_name = '基础数据' AND menu_type = 'M' LIMIT 1)
WHERE menu_name IN ('电子健康卡', '电子发票') AND (parent_id IS NULL OR parent_id NOT IN (SELECT menu_id FROM sys_menu));
-- 修复 传染病报卡 的 parent_id 为 院感管理 (10001)
UPDATE sys_menu
SET parent_id = (SELECT menu_id FROM sys_menu WHERE menu_name = '院感管理' AND menu_type = 'M' LIMIT 1)
WHERE menu_name = '传染病报卡' AND (parent_id IS NULL OR parent_id NOT IN (SELECT menu_id FROM sys_menu));

View File

@@ -748,7 +748,7 @@
T1.unit_code AS unit_code,
T1.status_enum AS status_enum,
'' AS method_code,
'' AS rate_code,
T1.rate_code AS rate_code,
NULL AS dose,
'' AS dose_unit_code,
T3.id AS charge_item_id,

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.healthlink.his.web.pharmacymanage.mapper.MedicalDeviceDispenseMapper">
<mapper namespace="com.healthlink.his.web.pharmacy.dispense.mapper.MedicalDeviceDispenseMapper">
<select id="selectEncounterInfoListPage" resultType="com.healthlink.his.web.pharmacy.dispense.dto.EncounterInfoDto">
SELECT ii.encounter_id,
ii.encounter_no,

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.healthlink.his.web.pharmacymanage.mapper.MedicationDetailsMapper">
<mapper namespace="com.healthlink.his.web.pharmacy.dispense.mapper.MedicationDetailsMapper">
<select id="selectAmbPractitionerDetailPage"
resultType="com.healthlink.his.web.pharmacy.dispense.dto.MedDetailedAccountPageDto">
select A.outpatient_no,

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.healthlink.his.web.pharmacymanage.mapper.PendingMedicationDetailsMapper">
<mapper namespace="com.healthlink.his.web.pharmacy.dispense.mapper.PendingMedicationDetailsMapper">
<select id="selectPendingMedicationDetailsPage"
resultType="com.healthlink.his.web.pharmacy.dispense.dto.PendingMedicationPageDto">
SELECT T7.medicine_no, --药品编码

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.healthlink.his.web.pharmacymanage.mapper.ReturnMedicineMapper">
<mapper namespace="com.healthlink.his.web.pharmacy.dispense.mapper.ReturnMedicineMapper">
<select id="selectEncounterInfoListPage" resultType="com.healthlink.his.web.pharmacy.dispense.dto.EncounterInfoDto">
SELECT ii.reception_time,
ii.start_time,

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.healthlink.his.web.pharmacymanage.mapper.SummaryDispenseMedicineMapper">
<mapper namespace="com.healthlink.his.web.pharmacy.dispense.mapper.SummaryDispenseMedicineMapper">
</mapper>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.healthlink.his.web.pharmacymanage.mapper.WesternMedicineDispenseMapper">
<mapper namespace="com.healthlink.his.web.pharmacy.dispense.mapper.WesternMedicineDispenseMapper">
<resultMap id="medicineDispenseOrderMap" type="com.healthlink.his.web.pharmacy.dispense.dto.ItemDispenseOrderDto">
<result property="lotNumber" column="lot_number"/>
<result property="departmentName" column="department_name"/>

View File

@@ -315,7 +315,7 @@
T1.unit_code AS unit_code,
T1.status_enum AS status_enum,
'' AS method_code,
'' AS rate_code,
T1.rate_code AS rate_code,
NULL AS dose,
'' AS dose_unit_code,
T3.id AS charge_item_id,

View File

@@ -1020,6 +1020,10 @@ const statusFlagOptions = ref(undefined);
const domainEnumOptions = ref(undefined);
const deptOptions = ref(undefined); // 部门树选项
const locationOptions = ref(undefined); // 地点树选项
const supplierListOptions = ref(undefined);
const statusRestrictedOptions = ref(undefined);
const partAttributeEnumOptions = ref(undefined);
const tempOrderSplitPropertyOptions = ref(undefined);
const activeName = ref('basic');
const data = reactive({
form: {},

View File

@@ -4877,8 +4877,8 @@ function convertValues(row, index) {
row.dose = row.doseQuantity / row.partPercent;
break;
}
calculateTotalAmount(row, index);
});
// calculateTotalAmount(row, index);
}
// 单次剂量数量改变时自动计算总量
@@ -4904,8 +4904,8 @@ function convertDoseValues(row, index) {
row.doseQuantity = row.dose * row.partPercent;
break;
}
calculateTotalAmount(row, index);
});
// calculateTotalAmount(row, index);
}
// 总量计算,仅适用只有两种单位的情况
@@ -4921,11 +4921,6 @@ function calculateTotalAmount(row, index) {
return;
}
if (row.adviceType == 2) {
calculateTotalPrice(row, index);
return;
}
if (row.adviceType != 1 && row.adviceType != 2) {
return;
}
@@ -4937,7 +4932,7 @@ function calculateTotalAmount(row, index) {
let quantity;
if (row.unitCode == row.minUnitCode) {
quantity = calculateQuantityBySplitType(row.partAttributeEnum, row.doseQuantity, count);
quantity = calculateQuantityBySplitType(row.partAttributeEnum, row.doseQuantity, count, row.partPercent);
row.quantity = quantity;
row.totalPrice = (quantity * row.minUnitPrice).toFixed(2);
} else {
@@ -4972,7 +4967,7 @@ function calculateTotalAmount(row, index) {
if (count) {
let quantity;
if (row.unitCode == row.minUnitCode) {
quantity = calculateQuantityBySplitType(row.partAttributeEnum, row.doseQuantity, count);
quantity = calculateQuantityBySplitType(row.partAttributeEnum, row.doseQuantity, count, row.partPercent);
prescriptionList.value[index].quantity = quantity;
prescriptionList.value[index].totalPrice = (quantity * row.minUnitPrice).toFixed(6);
} else {
@@ -5015,17 +5010,22 @@ function calculateTotalAmount(row, index) {
* @param type 门诊拆分类型
* @param dose 单次剂量 最小单位
* @param count 用药频次和用药天数计算出的总数
* @param partPercent 拆零比
*/
function calculateQuantityBySplitType(type, dose, count) {
switch (type) {
function calculateQuantityBySplitType(type, dose, count, partPercent) {
const percent = Number(partPercent) || 1;
const numType = Number(type);
switch (numType) {
case 1: // 门诊按最小单位每次量向上取整
return Math.ceil(dose) * count;
case 2: // 门诊按包装单位不可拆分
return Math.ceil(dose * count);
return Math.ceil((dose * count) / percent) * percent;
case 3: // 门诊按最小单位总量向上取整
return Math.ceil(dose * count);
case 4: // 门诊按包装单位每次量向上取整
return Math.ceil(dose) * count;
return Math.ceil(dose / percent) * count * percent;
default:
return Math.ceil(dose * count);
}
}
@@ -5035,17 +5035,22 @@ function calculateQuantityBySplitType(type, dose, count) {
* @param type 门诊拆分类型
* @param dose 单次剂量 最小单位
* @param count 用药频次和用药天数计算出的总数
* @param partPercent 拆零比
*/
function calculateQuantity(type, dose, count, partPercent) {
switch (type) {
const percent = Number(partPercent) || 1;
const numType = Number(type);
switch (numType) {
case 1: // 门诊按最小单位每次量向上取整
return Math.ceil(dose / partPercent) * count;
return Math.ceil((Math.ceil(dose) * count) / percent);
case 2: // 门诊按包装单位不可拆分
return Math.ceil(dose * count);
return Math.ceil((dose * count) / percent);
case 3: // 门诊按最小单位总量向上取整
return Math.ceil((dose / partPercent) * count);
return Math.ceil(Math.ceil(dose * count) / percent);
case 4: // 门诊按包装单位每次量向上取整
return Math.ceil(dose) * count;
return Math.ceil(dose / percent) * count;
default:
return Math.ceil((dose * count) / percent);
}
}

View File

@@ -1,6 +1,7 @@
<template>
<!-- eslint-disable vue/no-mutating-props -->
<el-form
:ref="(el) => (formRef = el)"
:ref="setFormRef"
:model="row"
:rules="rules"
:label-width="100"
@@ -75,7 +76,7 @@
data-prop="executeNum"
>
<el-input-number
:ref="(el) => setInputRef('executeNum', el)"
:ref="refFor('executeNum')"
v-model="row.executeNum"
:min="1"
controls-position="right"
@@ -102,7 +103,10 @@
/>
</el-select>
</span>
<span class="medicine-info"> 注射药品{{ row.injectFlag_enumText }} </span>
<span
class="medicine-info"
style="min-width: 140px"
> 注射药品{{ row.injectFlag_enumText }} </span>
<span class="total-amount">
总金额{{ row.totalPrice ? Number(row.totalPrice).toFixed(2) + ' 元' : '0.00 元' }}
</span>
@@ -117,7 +121,7 @@
data-prop="doseQuantity"
>
<el-input-number
:ref="(el) => setInputRef('doseQuantity', el)"
:ref="refFor('doseQuantity')"
v-model="row.doseQuantity"
:min="0"
controls-position="right"
@@ -153,7 +157,7 @@
data-prop="methodCode"
>
<el-select
:ref="(el) => setInputRef('methodCode', el)"
:ref="refFor('methodCode')"
v-model="row.methodCode"
placeholder="给药途径"
clearable
@@ -184,7 +188,7 @@
data-prop="rateCode"
>
<el-select
:ref="(el) => setInputRef('rateCode', el)"
:ref="refFor('rateCode')"
v-model="row.rateCode"
placeholder="频次"
style="width: 120px"
@@ -231,7 +235,7 @@
data-prop="dispensePerDuration"
>
<el-input-number
:ref="(el) => setInputRef('dispensePerDuration', el)"
:ref="refFor('dispensePerDuration')"
v-model="row.dispensePerDuration"
style="width: 148px"
:min="1"
@@ -252,7 +256,7 @@
label-width="80"
>
<el-input-number
:ref="(el) => setInputRef('quantity', el)"
:ref="refFor('quantity')"
v-model="row.quantity"
style="width: 70px"
controls-position="right"
@@ -297,7 +301,7 @@
data-prop="firstDose"
>
<el-input-number
:ref="(el) => setInputRef('firstDose', el)"
:ref="refFor('firstDose')"
v-model="row.firstDose"
style="width: 70px"
controls-position="right"
@@ -399,7 +403,7 @@
data-prop="doseQuantity"
>
<el-input-number
:ref="(el) => setInputRef('doseQuantity', el)"
:ref="refFor('doseQuantity')"
v-model="row.doseQuantity"
:min="0"
controls-position="right"
@@ -481,7 +485,7 @@
data-prop="dispensePerDuration"
>
<el-input-number
:ref="(el) => setInputRef('dispensePerDuration', el)"
:ref="refFor('dispensePerDuration')"
v-model="row.dispensePerDuration"
style="width: 148px"
:min="1"
@@ -504,7 +508,7 @@
label-width="80"
>
<el-input-number
:ref="(el) => setInputRef('quantity', el)"
:ref="refFor('quantity')"
v-model="row.quantity"
style="width: 70px"
controls-position="right"
@@ -548,7 +552,10 @@
<!-- 🔧 文字医嘱面板 (adviceType=8) -->
<template v-else-if="row.adviceType == 8">
<div style="display: flex; align-items: center; margin-bottom: 16px; gap: 16px">
<span class="medicine-title">文字医嘱</span>
<span
class="medicine-title"
style="min-width: auto"
>文字医嘱</span>
<el-form-item
label="开始时间:"
prop="startTime"
@@ -854,6 +861,7 @@
</template>
<script setup lang="ts">
/* eslint-disable vue/no-mutating-props */
import {computed, getCurrentInstance, nextTick, onErrorCaptured, onMounted, ref, watch} from 'vue';
import Decimal from 'decimal.js';
@@ -898,6 +906,9 @@ const { proxy } = getCurrentInstance() as any;
// 创建表单 ref
const formRef = ref();
const setFormRef = (el: any) => {
formRef.value = el;
};
// 将表单 ref 注册到父组件的 $refs 上,以便父组件可以通过 proxy.$refs['formRef' + index] 访问
const registerFormRef = () => {
@@ -1128,6 +1139,7 @@ const calculateTotalAmount = () => {
});
};
const setInputRef = props.handlers.setInputRef;
const refFor = (prop: string) => (el: any) => setInputRef(prop, el);
defineExpose({
stockFormat,

View File

@@ -1529,13 +1529,17 @@ function getAdviceTableRef() {
function handleBlur(row) {
// 延迟关闭弹窗,等待 click 事件在弹出层内容上正常触发
// 原因:浏览器 blur 事件先于 click 触发;同步关闭会移除 DOM导致 click 丢失
// 如果用户在弹出层内点击药品行selectAdviceBase 会在 150ms 内设 showPopover=false
// 如果用户在弹出层内点击药品行selectAdviceBase 会在 200ms 内设 showPopover=false
// 此处的赋值变为 no-opfalse→false弹窗正常关闭且数据正确填充
setTimeout(() => {
row.showPopover = false;
// 通过uniqueKey找到当前行确保popover关闭
const currentRow = prescriptionList.value.find(r => r.uniqueKey === row.uniqueKey);
if (currentRow) {
currentRow.showPopover = false;
}
// Bug #587: 标记弹窗刚关闭,防止点击空白处时触发行展开
popoverJustClosedByKey.value = row.uniqueKey;
}, 150);
}, 200);
}
function handleChange(value, row, index) {
@@ -1596,6 +1600,10 @@ function selectAdviceBase(key, row) {
} catch (e) {
console.warn('setValue error:', e);
}
// 确保在 setValue 之后再次设置 showPopover 为 false防止被覆盖
if (prescriptionList.value[rowIndex.value]) {
prescriptionList.value[rowIndex.value].showPopover = false;
}
// Bug #589: 出院带药选择药品后恢复类型标志
if (prescriptionList.value[rowIndex.value]?.dischargeFlag) {
prescriptionList.value[rowIndex.value].adviceType = 7;
@@ -2341,6 +2349,7 @@ function setValue(row) {
const updatedRow = {
...prevRow,
...baseRow,
showPopover: false, // 确保选择药品后关闭弹窗
uniqueKey: currentUniqueKey, // 确保 uniqueKey 不被覆盖
// Bug #589: 出院带药在 baseRow 中被药品的 adviceType=1 覆盖,此处恢复
dischargeFlag: prevRow.dischargeFlag, // 显式保留,防止被 baseRow 中的 undefined/null/0 覆盖