Compare commits

...

4 Commits

Author SHA1 Message Date
荀彧
23b993600d Fix Bug #428: 门诊医生站-检查申请:未实现分类联动检查方法及套餐明细展示与勾选逻辑
- 分类对象初始化时增加 methods: [],确保 Vue 响应式追踪分类下检查方法的加载
- handleMethodSelect 创建新项目时复制 cat.methods 全部方法数组(原只放单个方法),允许用户在右侧面板切换其他方法
- handleMethodSelect 新增/更新项目时同步 packageName 字段,确保 toggleItemExpand 能通过名称查找并加载套餐明细

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 10:13:47 +08:00
赵云
13025d8adb Fix Bug #426: 门诊医生站-检查开立:已选择列表应支持树形展开,显示套餐明细(项目/数量/单价)
- 已选择面板的套餐项增加"套餐"标签,便于用户识别
- 展开/收起图标改为 ArrowRight 旋转样式,符合标准交互习惯
- toggleItemExpand 函数增加 packageName 兜底判断,不强制依赖 isPackage 标记
- loadPackageDetailsForItem 添加 loading 状态和更健壮的 packageId 解析逻辑
- 新增 expanded-content 和 package-loading-hint CSS 样式

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 10:13:47 +08:00
关羽
ae9450b85f Fix Bug #452: 领用出库模块选择药品时提示"仓库数量为0,无法调用",与实际库存数据不符
根因:药品目录列表中返回的lotNumber是任意仓库中的批号,但getCount查询时用该lotNumber过滤用户选择的仓库库存。若该批号在目标仓库不存在(但其他批号存在),则返回0条记录导致误报"仓库数量为0"。
修复:在领用出库的handleLocationClick中移除getCount的lotNumber参数,改为查询该药品在所选仓库的所有批号库存。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 10:13:47 +08:00
荀彧
0d32364ce4 feat: 手术管理列表点击行高亮 (highlight-current-row) 2026-05-14 10:13:47 +08:00
3 changed files with 55 additions and 22 deletions

View File

@@ -413,29 +413,33 @@
:key="idx"
class="selected-item-card"
>
<!-- Bug #384修复: 项目卡片头部可展开/收起 -->
<!-- Bug #384修复 + #426修复: 项目卡片头部可展开/收起 -->
<div class="card-header" @click="toggleItemExpand(item)">
<el-tag v-if="item.isPackage || item.packageName" size="small" type="warning" style="margin-right: 4px; flex-shrink: 0;">套餐</el-tag>
<span class="card-name">{{ item.name }}</span>
<span class="card-price">¥{{ item.price }}</span>
<!-- 展开图标 -->
<el-icon :class="['expand-icon', { expanded: item.expanded }]">
<ArrowDown v-if="!item.expanded" />
<ArrowUp v-if="item.expanded" />
<!-- 展开/收起图标 -->
<el-icon class="expand-icon" :class="{ expanded: item.expanded }">
<ArrowRight />
</el-icon>
<!-- 删除按钮 -->
<el-button link type="danger" size="small" @click.stop="handleRemoveItem(idx, item)">
<el-icon><Close /></el-icon>
</el-button>
</div>
<!-- Bug #428修复: 展开后显示套餐明细或检查方法 -->
<div v-if="item.expanded">
<!-- Bug #428修复 + #426修复: 展开后显示套餐明细或检查方法 -->
<div v-show="item.expanded" class="expanded-content">
<!-- 显示套餐明细 -->
<div v-if="item.packageDetails && item.packageDetails.length > 0" class="package-details-list">
<div v-if="(item.isPackage || item.packageName) && item.packageDetails && item.packageDetails.length > 0" class="package-details-list">
<div class="detail-row" v-for="detail in item.packageDetails" :key="detail.id">
<span class="detail-name">{{ detail.name }}</span>
<span class="detail-info">数量: {{ detail.quantity }} 单价: ¥{{ detail.price }}</span>
</div>
</div>
<!-- 套餐明细加载中 -->
<div v-else-if="(item.isPackage || item.packageName) && item.packageDetailsLoading" class="package-loading-hint">
加载中...
</div>
<!-- 显示检查方法 -->
<div v-else-if="item.methods && item.methods.length > 0" class="method-list">
<div v-for="method in item.methods" :key="method.id" class="method-option">
@@ -473,7 +477,7 @@
<script setup>
import { ref, reactive, computed, watch, onMounted, nextTick } from 'vue';
import { ElMessage, ElMessageBox } from 'element-plus';
import { Printer, Delete, ArrowDown, ArrowUp, Close } from '@element-plus/icons-vue';
import { Printer, Delete, ArrowDown, ArrowUp, Close, ArrowRight } from '@element-plus/icons-vue';
import useUserStore from '@/store/modules/user';
import request from '@/utils/request';
import { listCheckMethod, searchCheckMethod, listCheckPackage } from '@/api/system/checkType';
@@ -592,11 +596,13 @@ async function loadPackageDetails(row, treeNode, resolve) {
}
}
// #428修复: 为已选择项目加载套餐明细通过packageId或packageName查询
// #428修复 + #426修复: 为已选择项目加载套餐明细通过packageId或packageName查询
async function loadPackageDetailsForItem(item) {
if (!item.isPackage || (!item.packageId && !item.packageName)) {
// 只要有 packageName 就认为是套餐,不强制要求 isPackage 或 packageId
if (!item.packageName && !item.packageId) {
return;
}
item.packageDetailsLoading = true;
try {
let packageId = item.packageId;
if (!packageId && item.packageName) {
@@ -612,6 +618,10 @@ async function loadPackageDetailsForItem(item) {
}
packageId = packages[0].id;
}
if (!packageId) {
item.packageDetails = [];
return;
}
const res = await request({
url: `/system/package/${packageId}/details`,
method: 'get'
@@ -630,6 +640,8 @@ async function loadPackageDetailsForItem(item) {
} catch (err) {
console.error('加载套餐明细失败:', err);
item.packageDetails = [];
} finally {
item.packageDetailsLoading = false;
}
}
const detailTableRef = ref(null);
@@ -912,7 +924,8 @@ async function loadCategoryList() {
categoryName: t.name,
// “检查类型管理”里配置的执行科室(图三)
performDeptName: t.department || '',
items: []
items: [],
methods: [] // #428修复: 初始化 methods 数组,确保 Vue 响应式追踪
});
}
const unclassified = [];
@@ -1255,6 +1268,7 @@ async function handleMethodSelect(checked, method, cat) {
if (method.packageId) {
existingItem.isPackage = true;
existingItem.packageId = method.packageId;
existingItem.packageName = method.packageName || existingItem.packageName; // #428修复: 确保 packageName 同步
// 预加载套餐明细
loadPackageDetailsForItem(existingItem);
}
@@ -1282,12 +1296,13 @@ async function handleMethodSelect(checked, method, cat) {
checkType: cat.typeName,
nationalCode: targetItem.nationalCode || '',
checked: true,
methods: [method],
methods: cat.methods || [method], // #428修复: 复制分类下全部方法,允许用户切换
selectedMethod: method,
expanded: false,
// 从方法中获取套餐信息(优先级高于项目本身的 packageName
// 从方法或项目中获取套餐信息
isPackage: !!method.packageId || !!targetItem.packageName,
packageId: method.packageId || targetItem.packageId || null
packageId: method.packageId || targetItem.packageId || null,
packageName: method.packageName || targetItem.packageName || null // #428修复: 复制 packageName确保套餐明细可加载
};
selectedItems.value.push(newItem);
@@ -1396,11 +1411,11 @@ async function handleItemSelect(checked, item, cat) {
// Bug #382 修复:移除自动切换页签逻辑,保持当前页签状态
}
// Bug #384修复: 展开/收起项目卡片
// Bug #384修复 + #426修复: 展开/收起项目卡片
async function toggleItemExpand(item) {
item.expanded = !item.expanded;
// 如果是展开且该项目是套餐,加载套餐明细
if (item.expanded && item.isPackage && (!item.packageDetails || item.packageDetails.length === 0)) {
// 如果是展开且该项目是套餐(通过 isPackage 或 packageName 判断),加载套餐明细
if (item.expanded && (item.isPackage || item.packageName) && (!item.packageDetails || item.packageDetails.length === 0) && !item.packageDetailsLoading) {
await loadPackageDetailsForItem(item);
}
}
@@ -1812,10 +1827,24 @@ defineExpose({ getList });
font-size: 12px;
color: #909399;
transition: transform 0.2s;
transform: rotate(0deg);
}
.expand-icon.expanded {
transform: rotate(180deg);
transform: rotate(90deg);
}
/* Bug #426修复: 展开内容容器 */
.expanded-content {
overflow: hidden;
}
/* Bug #426修复: 套餐明细加载提示 */
.package-loading-hint {
padding: 8px 10px;
font-size: 11px;
color: #c0c4cc;
text-align: center;
}
/* Bug #428修复: 套餐明细列表样式 */

View File

@@ -1009,8 +1009,6 @@ function handleLocationClick(item, row, index) {
getCount({
itemId: form.purchaseinventoryList[index].itemId,
orgLocationId: form.purchaseinventoryList[index].sourceLocationId,
// objLocationId:purposeLocationId,
lotNumber: form.purchaseinventoryList[index].lotNumber,
}).then((res) => {
if (res.data && res.data.length > 0) {
form.purchaseinventoryList[index].itemTable = res.data[0].itemTable || '';

View File

@@ -76,7 +76,7 @@
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="surgeryList" row-key="id" :row-class-name="getRowClassName">
<el-table v-loading="loading" :data="surgeryList" row-key="id" :row-class-name="getRowClassName" highlight-current-row @current-change="handleCurrentChange">
<!-- 申请日期datetime - 2025-09-19 14:15:00 - 不可操作 -->
<el-table-column label="申请日期" align="center" prop="createTime" width="160">
<template #default="scope">
@@ -1405,6 +1405,12 @@ function getRowClassName({ row }) {
return ''
}
// 当前选中行(高亮)
const currentRow = ref(null)
function handleCurrentChange(row) {
currentRow.value = row
}
// 时间格式化函数
function parseTime(time, pattern) {
if (!time) return ''