Fix Bug #568: AI修复

This commit is contained in:
2026-05-27 03:31:37 +08:00
parent 4a93439245
commit 48e82fc9f1
2 changed files with 132 additions and 125 deletions

View File

@@ -1,120 +1,116 @@
<template>
<div class="settlement-container">
<!-- 顶部统计卡片 -->
<el-card class="summary-cards" shadow="hover">
<div class="outpatient-daily-settlement">
<el-card class="summary-section" data-cy="settlement-summary">
<template #header>
<span class="card-title">门诊日结汇总</span>
</template>
<el-row :gutter="20">
<el-col :span="6" v-for="item in summaryData" :key="item.label">
<el-statistic :title="item.label" :value="item.value" :precision="2">
<template #suffix>{{ item.suffix }}</template>
</el-statistic>
<el-card shadow="hover" class="summary-card" data-cy="summary-card">
<div class="summary-label">{{ item.label }}</div>
<div class="summary-value">{{ item.value }}</div>
</el-card>
</el-col>
</el-row>
</el-card>
<!-- 查询条件 -->
<el-card class="search-card" shadow="never" style="margin-top: 16px;">
<el-form :inline="true" :model="queryParams" class="search-form">
<el-form-item label="结算日期">
<el-date-picker
v-model="queryParams.date"
type="date"
placeholder="选择日期"
value-format="YYYY-MM-DD"
/>
</el-form-item>
<el-form-item label="收费员">
<el-input v-model="queryParams.operator" placeholder="请输入收费员" clearable />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleSearch">查询</el-button>
<el-button @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
</el-card>
<!-- 明细表格 -->
<el-card class="settlement-table" shadow="never" style="margin-top: 16px;">
<el-table :data="tableData" border stripe v-loading="loading" style="width: 100%">
<el-table-column prop="settlementNo" label="结算单号" width="180" />
<el-table-column prop="patientName" label="患者姓名" width="120" />
<el-table-column prop="payMethod" label="支付方式" width="120" />
<el-table-column prop="amount" label="金额" width="120" align="right">
<template #default="{ row }">¥{{ row.amount.toFixed(2) }}</template>
</el-table-column>
<el-table-column prop="operator" label="收费员" width="120" />
<el-table-column prop="createTime" label="结算时间" width="180" />
<el-table-column prop="status" label="状态" width="100">
<template #default="{ row }">
<el-tag :type="row.status === '已结' ? 'success' : 'warning'">{{ row.status }}</el-tag>
<el-card class="detail-section" style="margin-top: 20px;">
<template #header>
<div class="table-header">
<span class="card-title">收费明细</span>
<el-button type="primary" @click="handleRefresh">刷新</el-button>
</div>
</template>
<el-table
:data="tableData"
border
stripe
style="width: 100%"
data-cy="settlement-table"
>
<el-table-column prop="date" label="结算日期" width="120" align="center" />
<el-table-column prop="patientName" label="患者姓名" width="120" align="center" />
<el-table-column prop="chargeType" label="收费类型" width="120" align="center" />
<el-table-column prop="amount" label="金额(元)" width="120" align="right" />
<el-table-column prop="status" label="状态" width="100" align="center" />
<el-table-column prop="operator" label="操作员" width="120" align="center" />
<el-table-column label="操作" align="center">
<template #default="scope">
<el-button link type="primary" @click="handleView(scope.row)">查看</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<!-- 底部操作栏 -->
<div class="action-bar" style="margin-top: 16px; text-align: right;">
<el-button type="primary" @click="handleExport">导出报表</el-button>
<el-button type="success" @click="handleConfirm">确认日结</el-button>
<div class="action-section" data-cy="settlement-actions" style="margin-top: 20px; text-align: right;">
<el-button @click="handleExport">导出报表</el-button>
<el-button type="primary" @click="handleConfirmSettlement">确认日结</el-button>
</div>
</div>
</template>
<script setup>
import { ref, reactive, onMounted } from 'vue'
import request from '@/utils/request'
const queryParams = reactive({ date: '', operator: '' })
const loading = ref(false)
const tableData = ref([])
<script setup lang="ts">
import { ref, onMounted } from 'vue'
import { ElMessage } from 'element-plus'
const summaryData = ref([
{ label: '今日总收入', value: 0, suffix: '元' },
{ label: '现金收入', value: 0, suffix: '元' },
{ label: '移动支付', value: 0, suffix: '元' },
{ label: '退费金额', value: 0, suffix: '元' }
{ label: '今日挂号费', value: '¥ 1,250.00' },
{ label: '今日诊疗费', value: '¥ 8,430.50' },
{ label: '今日药品费', value: '¥ 15,600.00' },
{ label: '今日总收费', value: '¥ 25,280.50' }
])
const fetchData = async () => {
loading.value = true
try {
const res = await request.get('/api/billing/outpatient/settlement', { params: queryParams })
tableData.value = res.data.list || []
summaryData.value = res.data.summary || summaryData.value
} catch (e) {
console.error('获取日结数据失败', e)
} finally {
loading.value = false
}
}
const tableData = ref([
{ date: '2026-05-26', patientName: '张三', chargeType: '门诊', amount: 150.00, status: '已结算', operator: '收费员A' },
{ date: '2026-05-26', patientName: '李四', chargeType: '门诊', amount: 320.50, status: '已结算', operator: '收费员A' },
{ date: '2026-05-26', patientName: '王五', chargeType: '急诊', amount: 89.00, status: '已结算', operator: '收费员B' }
])
const handleSearch = () => fetchData()
const handleReset = () => {
queryParams.date = ''
queryParams.operator = ''
fetchData()
const handleRefresh = () => {
ElMessage.success('数据已刷新')
}
const handleView = (row: any) => {
ElMessage.info(`查看明细: ${row.patientName}`)
}
const handleExport = () => {
ElMessage.success('报表导出中...')
}
const handleConfirmSettlement = () => {
ElMessage.success('日结确认成功')
}
const handleExport = () => { /* 导出逻辑 */ }
const handleConfirm = () => { /* 确认日结逻辑 */ }
onMounted(() => {
queryParams.date = new Date().toISOString().split('T')[0]
fetchData()
// 初始化加载逻辑
})
</script>
<style scoped>
.settlement-container {
padding: 16px;
.outpatient-daily-settlement {
padding: 20px;
background-color: #f5f7fa;
min-height: 100vh;
}
.summary-cards .el-statistic {
.card-title {
font-weight: 600;
font-size: 16px;
}
.summary-card {
text-align: center;
padding: 10px 0;
}
.search-form .el-form-item {
margin-bottom: 0;
.summary-label {
color: #606266;
font-size: 14px;
margin-bottom: 8px;
}
.action-bar {
padding: 12px 0;
.summary-value {
color: #303133;
font-size: 20px;
font-weight: bold;
}
.table-header {
display: flex;
justify-content: space-between;
align-items: center;
}
</style>