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

This commit is contained in:
wangjian963
2026-04-24 16:54:02 +08:00
12 changed files with 1514 additions and 43 deletions

View File

@@ -136,9 +136,11 @@ public class SurgicalScheduleAppServiceImpl implements ISurgicalScheduleAppServi
}
}
LoginUser loginUser = new LoginUser();
//获取当前登录用户信息
loginUser = SecurityUtils.getLoginUser();
// Bug #432 修复获取当前登录用户信息增加null校验防止NPE
LoginUser loginUser = SecurityUtils.getLoginUser();
if (loginUser == null) {
return R.fail("用户未登录或登录已过期");
}
// 当前登录用户ID
Long userId = loginUser.getUserId();

View File

@@ -1144,7 +1144,12 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
chargeItem.setQuantityValue(adviceSaveDto.getQuantity()); // 数量
chargeItem.setQuantityUnit(adviceSaveDto.getUnitCode()); // 单位
chargeItem.setUnitPrice(adviceSaveDto.getUnitPrice()); // 单价
// #415 价格非负验证
BigDecimal unitPrice = adviceSaveDto.getUnitPrice();
if (unitPrice != null && unitPrice.compareTo(BigDecimal.ZERO) < 0) {
unitPrice = unitPrice.abs(); // 负数取绝对值
}
chargeItem.setUnitPrice(unitPrice); // 单价
chargeItem.setTotalPrice(adviceSaveDto.getTotalPrice()); // 总价
// 显式设置tenantId、createBy和createTime字段防止自动填充机制失效
@@ -1616,7 +1621,12 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
chargeItem.setQuantityValue(adviceSaveDto.getQuantity()); // 数量
chargeItem.setQuantityUnit(adviceSaveDto.getUnitCode()); // 单位
chargeItem.setUnitPrice(adviceSaveDto.getUnitPrice()); // 单价
// #415 价格非负验证
BigDecimal unitPrice = adviceSaveDto.getUnitPrice();
if (unitPrice != null && unitPrice.compareTo(BigDecimal.ZERO) < 0) {
unitPrice = unitPrice.abs(); // 负数取绝对值
}
chargeItem.setUnitPrice(unitPrice); // 单价
chargeItem.setTotalPrice(adviceSaveDto.getTotalPrice()); // 总价
// 显式设置审计字段,防止自动填充机制失效
@@ -1842,7 +1852,12 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
chargeItem.setEncounterDiagnosisId(adviceSaveDto.getEncounterDiagnosisId()); // 就诊诊断id
chargeItem.setQuantityValue(adviceSaveDto.getQuantity()); // 数量
chargeItem.setQuantityUnit(adviceSaveDto.getUnitCode()); // 单位
chargeItem.setUnitPrice(adviceSaveDto.getUnitPrice()); // 单价
// #415 价格非负验证
BigDecimal unitPrice = adviceSaveDto.getUnitPrice();
if (unitPrice != null && unitPrice.compareTo(BigDecimal.ZERO) < 0) {
unitPrice = unitPrice.abs(); // 负数取绝对值
}
chargeItem.setUnitPrice(unitPrice); // 单价
chargeItem.setTotalPrice(adviceSaveDto.getTotalPrice()); // 总价
iChargeItemService.saveOrUpdate(chargeItem);

View File

@@ -34,13 +34,13 @@
AND T2.delete_flag = '0'
WHERE
T1.delete_flag = '0'
<if test="chargeItemContext == 1 ">
<if test="chargeItemContext == 1">
AND T1.instance_table = #{MED_MEDICATION_DEFINITION}
</if>
<if test="chargeItemContext == 2 ">
<if test="chargeItemContext == 2">
AND T1.instance_table = #{ADM_DEVICE_DEFINITION}
</if>
<if test="chargeItemContext == 3 ">
<if test="chargeItemContext == 3">
AND (T1.instance_table = #{WOR_ACTIVITY_DEFINITION} OR T1.instance_table = #{ADM_HEALTHCARE_SERVICE})
</if>
GROUP BY T1.tenant_id,

View File

@@ -20,6 +20,15 @@ export function advicePrint(data) {
}
// 获取全部科室列表
// 获取科室列表(树形结构)
export function getDepartmentList(data) {
return request({
url: '/app-common/department-list',
method: 'get',
params: data,
});
}
export function getOrgList(data) {
return request({
url: '/app-common/department-list',

View File

@@ -26,7 +26,7 @@ const convertIdsToString = (obj) => {
} else {
const newObj = {}
for (const key in obj) {
if (obj.hasOwnProperty(key)) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
const value = obj[key]
// 如果key以Id结尾或者是id且值是数字转为字符串
if ((key === 'id' || key.endsWith('Id') || key.endsWith('ID')) && typeof value === 'number') {

View File

@@ -306,6 +306,7 @@
v-for="cat in filteredCategoryList"
:key="cat.typeId"
:name="cat.typeId"
@click="handleCategoryExpand(cat)"
>
<template #title>
<span class="cat-title">{{ cat.categoryName }}</span>
@@ -596,6 +597,33 @@ const availableMethods = computed(() => {
});
// 当可选方法列表改变时,如果当前选中的方法不在新列表中,则清空
// #428: 分类展开时联动加载检查方法
async function handleCategoryExpand(cat) {
if (!cat || !cat.typeName) return;
try {
const res = await searchCheckMethod({ checkType: cat.typeName });
let data = res?.data?.data || res?.data || res?.rows || res;
if (!Array.isArray(data) && res?.data && Array.isArray(res.data.data)) {
data = res.data.data;
}
if (Array.isArray(data) && data.length > 0) {
cat.methods = data.map(m => ({
id: m.id,
name: m.name,
code: m.code,
price: m.price || 0,
packageName: m.packageName || '',
packagePrice: m.packagePrice || null,
serviceFee: m.serviceFee || null
}));
}
} catch (err) {
console.error('加载分类检查方法失败', err);
}
}
watch(availableMethods, (newMethods) => {
if (form.inspectionMethod && !newMethods.find(m => m.name === form.inspectionMethod)) {
form.inspectionMethod = '';
@@ -832,11 +860,6 @@ function handleSave() {
const firstCheckType = selectedItems.value[0]?.checkType || 'unknown';
form.examTypeCode = firstCheckType;
// 如果有选中的检查方法,更新表单中的检查方法字段(取第一个选中项目的检查方法)
const firstItemWithMethod = selectedItems.value.find(item => item.selectedMethod);
if (firstItemWithMethod?.selectedMethod) {
form.inspectionMethod = firstItemWithMethod.selectedMethod.name;
}
const payload = {
...form,
@@ -1050,6 +1073,11 @@ function selectMethodCheckbox(checked, item, method) {
}
// 联动更新表单检查方法显示字段
updateMethodDisplay();
// #430: 套餐金额实时同步到申请单
nextTick(() => {
form.totalAmount = totalAmountCalc.value;
});
}
// Bug #384修复: 更新检查方法显示字段(联动)

View File

@@ -80,11 +80,23 @@
<script setup name="BloodTransfusion">
import {getCurrentInstance, onBeforeMount, onMounted, reactive, ref} from 'vue';
import {patientInfo} from '../../../store/patient.js';
import {getOrgList} from '../../../../../basicmanage/ward/components/api.js';
import {getDepartmentList} from '@/api/public.js';
import {getEncounterDiagnosis} from '../../api.js';
import {getApplicationList, saveBloodTransfusio} from './api';
const { proxy } = getCurrentInstance();
// 递归查找树形科室节点
const findTreeItem = (list, id) => {
if (!list || list.length === 0) return null;
for (const item of list) {
if (item.id == id) return item;
if (item.children && item.children.length > 0) {
const found = findTreeItem(item.children, id);
if (found) return found;
}
}
return null;
};
const emits = defineEmits(['submitOk']);
const props = defineProps({});
const state = reactive({});
@@ -175,9 +187,7 @@ const projectWithDepartment = (selectProjectIds, type) => {
isRelease = false;
}
// 选中项目中的执行科室id与全部科室数据做匹配
const findItem = orgOptions.value.find((item) => {
return item.id == obj.orgId;
});
const findItem = findTreeItem(orgOptions.value, obj.orgId);
if (!findItem) {
isRelease = false;
@@ -249,8 +259,8 @@ const submit = () => {
};
/** 查询科室 */
const getLocationInfo = () => {
getOrgList().then((res) => {
orgOptions.value = res.data?.records[0]?.children;
getDepartmentList().then((res) => {
orgOptions.value = res.data || [];
});
};
// 获取诊断目录

View File

@@ -81,11 +81,23 @@
import {getCurrentInstance, onBeforeMount, onMounted, reactive, watch} from 'vue';
import {patientInfo} from '../../../store/patient.js';
import {getApplicationList, saveInspection} from './api';
import {getOrgList} from '../../../../../basicmanage/ward/components/api.js';
import {getDepartmentList} from '@/api/public.js';
import {getEncounterDiagnosis} from '../../api.js';
import {ElMessage} from 'element-plus';
const { proxy } = getCurrentInstance();
// 递归查找树形科室节点
const findTreeItem = (list, id) => {
if (!list || list.length === 0) return null;
for (const item of list) {
if (item.id == id) return item;
if (item.children && item.children.length > 0) {
const found = findTreeItem(item.children, id);
if (found) return found;
}
}
return null;
};
const emits = defineEmits(['submitOk']);
const props = defineProps({});
const state = reactive({});
@@ -100,7 +112,7 @@ const getList = () => {
}
loading.value = true;
getApplicationList({
pageSize: 10000,
pageSize: 500,
pageNum: 1,
categoryCode: '22',
organizationId: patientInfo.value.inHospitalOrgId,
@@ -177,9 +189,7 @@ const projectWithDepartment = (selectProjectIds, type) => {
isRelease = false;
}
// 选中项目中的执行科室id与全部科室数据做匹配
const findItem = orgOptions.value.find((item) => {
return item.id == obj.orgId;
});
const findItem = findTreeItem(orgOptions.value, obj.orgId);
if (!findItem) {
isRelease = false;
ElMessage({
@@ -251,8 +261,8 @@ const submit = () => {
};
/** 查询科室 */
const getLocationInfo = () => {
getOrgList().then((res) => {
orgOptions.value = res.data?.records[0]?.children;
getDepartmentList().then((res) => {
orgOptions.value = res.data || [];
console.log('科室========>', JSON.stringify(orgOptions.value));
});
};

View File

@@ -80,12 +80,24 @@
<script setup name="MedicalExaminations">
import {getCurrentInstance, onBeforeMount, onMounted, reactive, watch} from 'vue';
import {patientInfo} from '../../../store/patient.js';
import {getOrgList} from '../../../../../basicmanage/ward/components/api.js';
import {getDepartmentList} from '@/api/public.js';
import {getEncounterDiagnosis} from '../../api.js';
import {getApplicationList, saveCheckd} from './api';
import {ElMessage} from 'element-plus';
const { proxy } = getCurrentInstance();
// 递归查找树形科室节点
const findTreeItem = (list, id) => {
if (!list || list.length === 0) return null;
for (const item of list) {
if (item.id == id) return item;
if (item.children && item.children.length > 0) {
const found = findTreeItem(item.children, id);
if (found) return found;
}
}
return null;
};
const emits = defineEmits(['submitOk']);
const props = defineProps({});
const orgOptions = ref([]); // 科室选项
@@ -100,7 +112,7 @@ const getList = () => {
}
loading.value = true;
getApplicationList({
pageSize: 10000,
pageSize: 500,
pageNum: 1,
categoryCode: '23',
organizationId: patientInfo.value.inHospitalOrgId,
@@ -176,9 +188,7 @@ const projectWithDepartment = (selectProjectIds, type) => {
isRelease = false;
}
// 选中项目中的执行科室id与全部科室数据做匹配
const findItem = orgOptions.value.find((item) => {
return item.id == obj.orgId;
});
const findItem = findTreeItem(orgOptions.value, obj.orgId);
if (!findItem) {
isRelease = false;
@@ -250,8 +260,8 @@ const submit = () => {
};
/** 查询科室 */
const getLocationInfo = () => {
getOrgList().then((res) => {
orgOptions.value = res.data?.records[0]?.children;
getDepartmentList().then((res) => {
orgOptions.value = res.data || [];
});
};
// 获取诊断目录

View File

@@ -80,12 +80,24 @@
<script setup name="Surgery">
import {getCurrentInstance, onBeforeMount, onMounted, reactive} from 'vue';
import {patientInfo} from '../../../store/patient.js';
import {getOrgList} from '../../../../../basicmanage/ward/components/api.js';
import {getDepartmentList} from '@/api/public.js';
import {getEncounterDiagnosis} from '../../api.js';
import {getApplicationList, saveSurgery} from './api';
import {ElMessage} from 'element-plus';
const { proxy } = getCurrentInstance();
// 递归查找树形科室节点
const findTreeItem = (list, id) => {
if (!list || list.length === 0) return null;
for (const item of list) {
if (item.id == id) return item;
if (item.children && item.children.length > 0) {
const found = findTreeItem(item.children, id);
if (found) return found;
}
}
return null;
};
const emits = defineEmits(['submitOk']);
const props = defineProps({});
const state = reactive({});
@@ -176,9 +188,7 @@ const projectWithDepartment = (selectProjectIds, type) => {
isRelease = false;
}
// 选中项目中的执行科室id与全部科室数据做匹配
const findItem = orgOptions.value.find((item) => {
return item.id == obj.orgId;
});
const findItem = findTreeItem(orgOptions.value, obj.orgId);
if (!findItem) {
isRelease = false;
@@ -251,8 +261,8 @@ const submit = () => {
};
/** 查询科室 */
const getLocationInfo = () => {
getOrgList().then((res) => {
orgOptions.value = res.data?.records[0]?.children;
getDepartmentList().then((res) => {
orgOptions.value = res.data || [];
});
};
// 获取诊断目录

View File

@@ -988,10 +988,13 @@ function selectRow(rowValue, index) {
form.purchaseinventoryList[index].unitList = rowValue.unitList[0];
form.purchaseinventoryList[index].lotNumber = rowValue.lotNumber;
form.purchaseinventoryList[index].ybNo = rowValue.ybNo;
// #439 fix: 不清空sourceLocationId保留handleAddRow设置的仓库ID
if (!form.purchaseinventoryList[index].sourceLocationId) {
form.purchaseinventoryList[index].sourceLocationId = '';
}
getPharmacyCabinetList().then((res) => {
purposeTypeListOptions.value = res.data;
// handleLocationClick(1, row, index)
handleLocationClick(1, rowValue, index)
});
form.purchaseinventoryList[index].itemQuantity = 0;
form.purchaseinventoryList[index].totalPrice = 0;