feat(doctorstation): 新增传染病报告卡功能并优化患者登记组件
- 新增传染病报告卡完整实现,包含甲乙丙类传染病选择和报告信息录入 - 在患者登记组件中修复性别字典数据去重问题 - 添加编辑模式支持和原始数据存储功能 - 实现姓名和身份证唯一性校验的编辑模式跳过逻辑 - 添加年龄自动计算功能基于出生日期 - 确保性别值为字符串类型以便与下拉框选项匹配 - 更新患者登记组件的标题和状态管理逻辑
This commit is contained in:
@@ -191,11 +191,18 @@ const filteredAdviceBaseList = computed(() => {
|
||||
}
|
||||
|
||||
// 过滤无库存的药品(只针对药品类型 adviceType === 1)
|
||||
// Bug #129 修复:确保库存为0的药品不被检索出来
|
||||
result = result.filter(item => {
|
||||
if (item.adviceType === 1) {
|
||||
// 检查是否有库存
|
||||
if (item.inventoryList && item.inventoryList.length > 0) {
|
||||
const totalQuantity = item.inventoryList.reduce((sum, inv) => sum + (inv.quantity || 0), 0);
|
||||
// 计算总库存数量,确保转换为数字进行正确计算
|
||||
const totalQuantity = item.inventoryList.reduce((sum, inv) => {
|
||||
const qty = inv.quantity !== undefined && inv.quantity !== null
|
||||
? (typeof inv.quantity === 'number' ? inv.quantity : Number(inv.quantity) || 0)
|
||||
: 0;
|
||||
return sum + qty;
|
||||
}, 0);
|
||||
return totalQuantity > 0;
|
||||
}
|
||||
return false; // 无库存列表或库存为空,视为无库存
|
||||
|
||||
Reference in New Issue
Block a user