fix: #579 (codex)

This commit is contained in:
2026-05-24 15:07:56 +08:00
parent 926c1f68e3
commit 232577caaa
2 changed files with 268 additions and 195 deletions

View File

@@ -62,142 +62,188 @@
门诊收费日结单 门诊收费日结单
</div> </div>
<div class="info-grid"> <el-row :gutter="20" class="info-row">
<div class="info-item"> <el-col :xs="24" :sm="12" :md="6">
<span class="label">经办人姓名</span> <div class="info-cell">
<span class="value">{{ userStore.nickName || '全部' }}</span> <span class="info-label">经办人姓名</span>
</div> <span class="info-value">{{ userStore.nickName || '全部' }}</span>
<div class="info-item"> </div>
<span class="label">科室</span> </el-col>
<span class="value">{{ userStore.orgName || '-' }}</span> <el-col :xs="24" :sm="12" :md="6">
</div> <div class="info-cell">
<div class="info-item"> <span class="info-label">科室</span>
<span class="label">机构</span> <span class="info-value">{{ userStore.orgName || '-' }}</span>
<span class="value">{{ userStore.hospitalName || '-' }}</span> </div>
</div> </el-col>
<div class="info-item"> <el-col :xs="24" :sm="12" :md="6">
<span class="label">时间</span> <div class="info-cell">
<span class="value">{{ queryTime && queryTime.length === 2 ? queryTime[0] + ' ~ ' + queryTime[1] : '-' }}</span> <span class="info-label">机构</span>
</div> <span class="info-value">{{ userStore.hospitalName || '-' }}</span>
</div> </div>
</el-col>
<el-col :xs="24" :sm="12" :md="6">
<div class="info-cell">
<span class="info-label">时间</span>
<span class="info-value">{{ queryTime && queryTime.length === 2 ? queryTime[0] + ' ~ ' + queryTime[1] : '-' }}</span>
</div>
</el-col>
</el-row>
<el-divider /> <el-divider />
<div class="section-title"> <div class="section-title">收入汇总</div>
收入汇总 <el-row :gutter="16" class="data-row">
</div> <el-col :xs="24" :sm="12" :md="6">
<div class="data-grid"> <div class="data-cell">
<div class="data-item"> <span class="data-label">总收入</span>
<span class="label">总收入</span> <span class="data-value">{{ formatValue(reportValue.cashSum) }}</span>
<span class="value">{{ formatValue(reportValue.cashSum) }}</span> </div>
</div> </el-col>
<div class="data-item"> <el-col :xs="24" :sm="12" :md="6">
<span class="label">现金</span> <div class="data-cell">
<span class="value">{{ formatValue(reportValue.rmbCashSum) }}</span> <span class="data-label">现金</span>
</div> <span class="data-value">{{ formatValue(reportValue.rmbCashSum) }}</span>
<div class="data-item"> </div>
<span class="label">微信</span> </el-col>
<span class="value">{{ formatValue(reportValue.vxCashSum) }}</span> <el-col :xs="24" :sm="12" :md="6">
</div> <div class="data-cell">
<div class="data-item"> <span class="data-label">微信</span>
<span class="label">支付宝</span> <span class="data-value">{{ formatValue(reportValue.vxCashSum) }}</span>
<span class="value">{{ formatValue(reportValue.aliCashSum) }}</span> </div>
</div> </el-col>
</div> <el-col :xs="24" :sm="12" :md="6">
<div class="data-cell">
<span class="data-label">支付宝</span>
<span class="data-value">{{ formatValue(reportValue.aliCashSum) }}</span>
</div>
</el-col>
</el-row>
<el-divider /> <el-divider />
<div class="section-title"> <div class="section-title">医保支付</div>
医保支付 <el-row :gutter="16" class="data-row">
</div> <el-col :xs="24" :sm="12" :md="6">
<div class="data-grid"> <div class="data-cell">
<div class="data-item"> <span class="data-label">统筹支付</span>
<span class="label">统筹支付</span> <span class="data-value">{{ formatValue(reportValue.tcSum) }}</span>
<span class="value">{{ formatValue(reportValue.tcSum) }}</span> </div>
</div> </el-col>
<div class="data-item"> <el-col :xs="24" :sm="12" :md="6">
<span class="label">账户支付</span> <div class="data-cell">
<span class="value">{{ formatValue(reportValue.zhSum) }}</span> <span class="data-label">账户支付</span>
</div> <span class="data-value">{{ formatValue(reportValue.zhSum) }}</span>
<div class="data-item"> </div>
<span class="label">基金支付总额</span> </el-col>
<span class="value">{{ formatValue(reportValue.fundSum) }}</span> <el-col :xs="24" :sm="12" :md="6">
</div> <div class="data-cell">
<div class="data-item"> <span class="data-label">基金支付总额</span>
<span class="label">医保统筹+账户</span> <span class="data-value">{{ formatValue(reportValue.fundSum) }}</span>
<span class="value">{{ formatValue(Number(reportValue.zhSum || 0) + Number(reportValue.fundSum || 0)) }}</span> </div>
</div> </el-col>
</div> <el-col :xs="24" :sm="12" :md="6">
<div class="data-cell">
<span class="data-label">医保统筹+账户</span>
<span class="data-value">{{ formatValue(Number(reportValue.zhSum || 0) + Number(reportValue.fundSum || 0)) }}</span>
</div>
</el-col>
</el-row>
<el-divider /> <el-divider />
<div class="section-title"> <div class="section-title">费用明细</div>
费用明细 <el-row :gutter="16" class="data-row">
</div> <el-col :xs="24" :sm="12" :md="6">
<div class="data-grid"> <div class="data-cell">
<div class="data-item"> <span class="data-label">诊查费</span>
<span class="label">诊查费</span> <span class="data-value">{{ formatValue(reportValue.DIAGNOSTIC_FEE) }}</span>
<span class="value">{{ formatValue(reportValue.DIAGNOSTIC_FEE) }}</span> </div>
</div> </el-col>
<div class="data-item"> <el-col :xs="24" :sm="12" :md="6">
<span class="label">检查费</span> <div class="data-cell">
<span class="value">{{ formatValue(reportValue.CHECK_FEE) }}</span> <span class="data-label">检查费</span>
</div> <span class="data-value">{{ formatValue(reportValue.CHECK_FEE) }}</span>
<div class="data-item"> </div>
<span class="label">化验费</span> </el-col>
<span class="value">{{ formatValue(reportValue.DIAGNOSTIC_TEST_FEE) }}</span> <el-col :xs="24" :sm="12" :md="6">
</div> <div class="data-cell">
<div class="data-item"> <span class="data-label">化验费</span>
<span class="label">治疗费</span> <span class="data-value">{{ formatValue(reportValue.DIAGNOSTIC_TEST_FEE) }}</span>
<span class="value">{{ formatValue(reportValue.MEDICAL_EXPENSE_FEE) }}</span> </div>
</div> </el-col>
</div> <el-col :xs="24" :sm="12" :md="6">
<div class="data-grid"> <div class="data-cell">
<div class="data-item"> <span class="data-label">治疗费</span>
<span class="label">西药费</span> <span class="data-value">{{ formatValue(reportValue.MEDICAL_EXPENSE_FEE) }}</span>
<span class="value">{{ formatValue(reportValue.WEST_MEDICINE) }}</span> </div>
</div> </el-col>
<div class="data-item"> </el-row>
<span class="label">中药饮片费</span> <el-row :gutter="16" class="data-row">
<span class="value">{{ formatValue(reportValue.CHINESE_MEDICINE_SLICES_FEE) }}</span> <el-col :xs="24" :sm="12" :md="6">
</div> <div class="data-cell">
<div class="data-item"> <span class="data-label">西药费</span>
<span class="label">中成药费</span> <span class="data-value">{{ formatValue(reportValue.WEST_MEDICINE) }}</span>
<span class="value">{{ formatValue(reportValue.CHINESE_MEDICINE_FEE) }}</span> </div>
</div> </el-col>
<div class="data-item"> <el-col :xs="24" :sm="12" :md="6">
<span class="label">卫生材料费</span> <div class="data-cell">
<span class="value">{{ formatValue(reportValue.SANITARY_MATERIALS_FEE) }}</span> <span class="data-label">中药饮片费</span>
</div> <span class="data-value">{{ formatValue(reportValue.CHINESE_MEDICINE_SLICES_FEE) }}</span>
</div> </div>
<div class="data-grid"> </el-col>
<div class="data-item"> <el-col :xs="24" :sm="12" :md="6">
<span class="label">普通挂号费</span> <div class="data-cell">
<span class="value">{{ formatValue(reportValue.GENERAL_CONSULTATION_FEE) }}</span> <span class="data-label">中成药费</span>
</div> <span class="data-value">{{ formatValue(reportValue.CHINESE_MEDICINE_FEE) }}</span>
<div class="data-item"> </div>
<span class="label">挂号费</span> </el-col>
<span class="value">{{ formatValue(reportValue.REGISTRATION_FEE) }}</span> <el-col :xs="24" :sm="12" :md="6">
</div> <div class="data-cell">
<div class="data-item"> <span class="data-label">卫生材料费</span>
<span class="label">其他费用</span> <span class="data-value">{{ formatValue(reportValue.SANITARY_MATERIALS_FEE) }}</span>
<span class="value">{{ formatValue(reportValue.OTHER_FEE) }}</span> </div>
</div> </el-col>
<div class="data-item"> </el-row>
<span class="label">退费金额</span> <el-row :gutter="16" class="data-row">
<span class="value">{{ formatValue(reportValue.returnFee) }}</span> <el-col :xs="24" :sm="12" :md="6">
</div> <div class="data-cell">
</div> <span class="data-label">普通挂号费</span>
<div class="data-grid data-grid-summary"> <span class="data-value">{{ formatValue(reportValue.GENERAL_CONSULTATION_FEE) }}</span>
<div class="data-item"> </div>
<span class="label">费用总额</span> </el-col>
<span class="value value-highlight">{{ totalFeeAmount }}</span> <el-col :xs="24" :sm="12" :md="6">
</div> <div class="data-cell">
<div class="data-item"> <span class="data-label">挂号费</span>
<span class="label">医保报销</span> <span class="data-value">{{ formatValue(reportValue.REGISTRATION_FEE) }}</span>
<span class="value value-highlight">{{ insuranceReimbursement }}</span> </div>
</div> </el-col>
</div> <el-col :xs="24" :sm="12" :md="6">
<div class="data-cell">
<span class="data-label">其他费用</span>
<span class="data-value">{{ formatValue(reportValue.OTHER_FEE) }}</span>
</div>
</el-col>
<el-col :xs="24" :sm="12" :md="6">
<div class="data-cell">
<span class="data-label">退费金额</span>
<span class="data-value">{{ formatValue(reportValue.returnFee) }}</span>
</div>
</el-col>
</el-row>
<el-row :gutter="16" class="data-row summary-row">
<el-col :xs="24" :sm="12" :md="6">
<div class="data-cell summary-cell">
<span class="data-label summary-label">费用总额</span>
<span class="data-value value-highlight">{{ totalFeeAmount }}</span>
</div>
</el-col>
<el-col :xs="24" :sm="12" :md="6">
<div class="data-cell summary-cell">
<span class="data-label summary-label">医保报销</span>
<span class="data-value value-highlight">{{ insuranceReimbursement }}</span>
</div>
</el-col>
</el-row>
</div> </div>
</div> </div>
</template> </template>
@@ -418,54 +464,60 @@ getPharmacyCabinetLists();
color: #303133; color: #303133;
} }
.info-grid { .info-row {
display: grid; padding: 12px 0;
grid-template-columns: repeat(4, 1fr);
gap: 12px 16px;
padding: 8px 0;
} }
.data-grid { .info-cell {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 10px 16px;
padding: 6px 0;
}
.data-grid-summary {
margin-top: 12px;
padding-top: 12px;
border-top: 1px dashed #e4e7ed;
}
.info-item,
.data-item {
display: flex; display: flex;
align-items: baseline; align-items: center;
line-height: 28px; padding: 6px 0;
min-height: 32px;
} }
.section-title { .info-label {
font-size: 15px;
font-weight: 600;
color: #409eff;
padding: 12px 0 8px 10px;
margin: 4px 0 0;
border-left: 3px solid #409eff;
background: linear-gradient(90deg, rgba(64, 158, 255, 0.05) 0%, transparent 100%);
}
.label {
color: #909399; color: #909399;
font-size: 13px; font-size: 13px;
white-space: nowrap; white-space: nowrap;
min-width: 95px; min-width: 80px;
} }
.value { .info-value {
color: #303133; color: #303133;
font-size: 14px; font-size: 14px;
font-weight: 500; font-weight: 500;
flex: 1;
}
.data-row {
padding: 4px 0;
}
.data-cell {
display: flex;
align-items: center;
padding: 8px 12px;
margin-bottom: 4px;
background: #fafafa;
border-radius: 4px;
min-height: 40px;
}
.data-label {
color: #606266;
font-size: 13px;
white-space: nowrap;
min-width: 100px;
text-align: right;
padding-right: 8px;
}
.data-value {
color: #303133;
font-size: 14px;
font-weight: 500;
flex: 1;
text-align: right;
} }
.value-highlight { .value-highlight {
@@ -474,6 +526,30 @@ getPharmacyCabinetLists();
font-size: 15px; font-size: 15px;
} }
.summary-row {
margin-top: 8px;
}
.summary-cell {
background: #ecf5ff;
border: 1px solid #d9ecff;
}
.summary-label {
font-weight: 600;
color: #409eff;
}
.section-title {
font-size: 15px;
font-weight: 600;
color: #409eff;
padding: 8px 0 8px 12px;
margin: 8px 0 4px;
border-left: 3px solid #409eff;
background: linear-gradient(90deg, rgba(64, 158, 255, 0.05) 0%, transparent 100%);
}
.search-buttons { .search-buttons {
margin-bottom: 0; margin-bottom: 0;
} }
@@ -483,11 +559,27 @@ getPharmacyCabinetLists();
} }
:deep(.el-divider--horizontal) { :deep(.el-divider--horizontal) {
margin: 16px 0; margin: 12px 0;
} }
.el-form--inline .el-form-item { .el-form--inline .el-form-item {
margin-bottom: 12px; margin-bottom: 12px;
margin-right: 16px; margin-right: 16px;
} }
@media (max-width: 768px) {
.data-label {
min-width: 80px;
text-align: left;
padding-right: 4px;
}
.data-value {
text-align: left;
}
.info-label {
min-width: 70px;
}
}
</style> </style>

View File

@@ -551,7 +551,7 @@ function handleTotalAmount() {
// 表格合并行方法(纯函数,不修改数据) // 表格合并行方法(纯函数,不修改数据)
const arraySpanMethod = ({ row, column, rowIndex, columnIndex }) => { const arraySpanMethod = ({ row, column, rowIndex, columnIndex }) => {
// 仅处理科室columnIndex === 1的门诊号合并 // 合并门诊号columnIndex === 1
if (columnIndex === 1) { if (columnIndex === 1) {
const spanInfo = rowSpanMap.value[rowIndex]; const spanInfo = rowSpanMap.value[rowIndex];
if (spanInfo) { if (spanInfo) {
@@ -694,8 +694,8 @@ function getList(type) {
: '0.0000' + (k.quantityUnit_dictText ? k.quantityUnit_dictText : ''); : '0.0000' + (k.quantityUnit_dictText ? k.quantityUnit_dictText : '');
}); });
// 处理搜索关键词时的合计 // 处理搜索关键词或单页数据
if (queryParams.value.searchKey) { if (queryParams.value.searchKey || (total.value && total.value <= queryParams.value.pageSize)) {
// 先处理小计行和合并信息 // 先处理小计行和合并信息
purchaseinventoryList.value = processListWithSubtotals(purchaseinventoryList.value); purchaseinventoryList.value = processListWithSubtotals(purchaseinventoryList.value);
@@ -706,42 +706,24 @@ function getList(type) {
}); });
totalPrice2 = totalPrice2 ? totalPrice2.toFixed(4) : totalPrice2; totalPrice2 = totalPrice2 ? totalPrice2.toFixed(4) : totalPrice2;
purchaseinventoryList.value.push({ departmentName: '合计', totalPrice: totalPrice2 });
loading.value = false;
return;
}
// 处理分页数据
purchaseinventoryList.value.forEach((k) => {
if (total.value && total.value <= queryParams.value.pageSize) {
totalPrice2 += Number(k.totalPrice);
}
});
if (total.value <= res.data.size) {
loading.value = false;
}
// 单页数据合计
if (total.value && total.value <= queryParams.value.pageSize) {
// 先处理小计行和合并信息
purchaseinventoryList.value = processListWithSubtotals(purchaseinventoryList.value);
totalPrice2 = totalPrice2 ? totalPrice2.toFixed(4) : totalPrice2;
let pageNoAll = total.value / queryParams.value.pageSize; let pageNoAll = total.value / queryParams.value.pageSize;
if (Math.ceil(pageNoAll) == queryParams.value.pageNo) { if (Math.ceil(pageNoAll) == queryParams.value.pageNo) {
purchaseinventoryList.value.push({ departmentName: '合计', totalPrice: totalPrice2 }); purchaseinventoryList.value.push({ departmentName: '合计', totalPrice: totalPrice2 });
rowSpanMap.value[purchaseinventoryList.value.length - 1] = { rowspan: 1, colspan: 1 };
} }
}
loading.value = false;
// 多页数据处理 } else if (total.value && total.value > queryParams.value.pageSize && !queryParams.value.searchKey) {
if (total.value && total.value > queryParams.value.pageSize && !queryParams.value.searchKey) { // 多页数据先处理当前页数据确保rowSpanMap正确初始化避免表格格式错乱
purchaseinventoryList.value = processListWithSubtotals(purchaseinventoryList.value);
loading.value = false;
// 然后获取全部数据进行完整处理
let queryParamsValue = { ...queryParams.value }; let queryParamsValue = { ...queryParams.value };
queryParamsValue.pageSize = total.value; queryParamsValue.pageSize = total.value;
queryParamsValue.pageNo = 1; queryParamsValue.pageNo = 1;
// 移除空值参数
Object.keys(queryParamsValue).forEach(key => { Object.keys(queryParamsValue).forEach(key => {
if (queryParamsValue[key] === undefined || queryParamsValue[key] === null || queryParamsValue[key] === '') { if (queryParamsValue[key] === undefined || queryParamsValue[key] === null || queryParamsValue[key] === '') {
delete queryParamsValue[key]; delete queryParamsValue[key];
@@ -762,15 +744,14 @@ function getList(type) {
totalPrice2 += Number(k.totalPrice); totalPrice2 += Number(k.totalPrice);
}); });
// 用 processListWithSubtotals 统一处理小计和合并行
purchaseinventoryList.value = processListWithSubtotals(purchaseinventoryListAll.value); purchaseinventoryList.value = processListWithSubtotals(purchaseinventoryListAll.value);
totalPrice2 = totalPrice2 ? totalPrice2.toFixed(4) : totalPrice2; totalPrice2 = totalPrice2 ? totalPrice2.toFixed(4) : totalPrice2;
loading.value = false;
let pageNoAll = total.value / queryParams.value.pageSize; let pageNoAll = total.value / queryParams.value.pageSize;
if (Math.ceil(pageNoAll) == queryParams.value.pageNo) { if (Math.ceil(pageNoAll) == queryParams.value.pageNo) {
purchaseinventoryList.value.push({ departmentName: '合计', totalPrice: totalPrice2 }); purchaseinventoryList.value.push({ departmentName: '合计', totalPrice: totalPrice2 });
rowSpanMap.value[purchaseinventoryList.value.length - 1] = { rowspan: 1, colspan: 1 };
} }
} }
}); });