Fix Bug #568: AI修复
This commit is contained in:
140
openhis-ui-vue3/src/views/billing/OutpatientDailySettlement.vue
Normal file
140
openhis-ui-vue3/src/views/billing/OutpatientDailySettlement.vue
Normal file
@@ -0,0 +1,140 @@
|
||||
<template>
|
||||
<div class="outpatient-daily-settlement">
|
||||
<el-card class="summary-section" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="title">门诊日结概览</span>
|
||||
<el-date-picker v-model="settlementDate" type="date" placeholder="选择结算日期" value-format="YYYY-MM-DD" />
|
||||
</div>
|
||||
</template>
|
||||
<el-row :gutter="20">
|
||||
<el-col :xs="24" :sm="12" :md="6" v-for="item in summaryData" :key="item.label">
|
||||
<el-card shadow="hover" class="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="detail-section" shadow="never" style="margin-top: 20px;">
|
||||
<template #header>
|
||||
<span class="title">收费明细</span>
|
||||
</template>
|
||||
<el-table :data="detailList" border stripe style="width: 100%" v-loading="loading" :header-cell-style="{ textAlign: 'center' }">
|
||||
<el-table-column prop="date" label="结算日期" width="120" align="center" />
|
||||
<el-table-column prop="cashierName" label="收费员" width="100" align="center" />
|
||||
<el-table-column prop="totalAmount" label="应收总额" width="120" align="right">
|
||||
<template #default="{ row }">¥{{ row.totalAmount?.toFixed(2) || '0.00' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="actualAmount" label="实收总额" width="120" align="right">
|
||||
<template #default="{ row }">¥{{ row.actualAmount?.toFixed(2) || '0.00' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="refundAmount" label="退费总额" width="120" align="right">
|
||||
<template #default="{ row }">¥{{ row.refundAmount?.toFixed(2) || '0.00' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" label="日结状态" width="100" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="row.status === '已结' ? 'success' : 'warning'">{{ row.status }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
<div class="action-section">
|
||||
<el-button type="primary" @click="handleSettlement" :disabled="isSettled">执行日结</el-button>
|
||||
<el-button @click="handleExport">导出报表</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, watch } from 'vue'
|
||||
import request from '@/utils/request'
|
||||
|
||||
const settlementDate = ref(new Date().toISOString().split('T')[0])
|
||||
const loading = ref(false)
|
||||
const isSettled = ref(false)
|
||||
const summaryData = ref([
|
||||
{ label: '今日挂号', value: '0' },
|
||||
{ label: '今日收费', value: '¥0.00' },
|
||||
{ label: '今日退费', value: '¥0.00' },
|
||||
{ label: '今日结算', value: '¥0.00' }
|
||||
])
|
||||
const detailList = ref([])
|
||||
|
||||
const loadData = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await request.get('/billing/outpatient/daily-summary', { params: { date: settlementDate.value } })
|
||||
summaryData.value = res.data.summary || summaryData.value
|
||||
detailList.value = res.data.details || []
|
||||
} catch (error) {
|
||||
console.error('加载日结数据失败', error)
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const handleSettlement = async () => {
|
||||
try {
|
||||
await request.post('/billing/outpatient/settle', { date: settlementDate.value })
|
||||
isSettled.value = true
|
||||
loadData()
|
||||
} catch (error) {
|
||||
console.error('日结失败', error)
|
||||
}
|
||||
}
|
||||
|
||||
const handleExport = () => {
|
||||
window.open(`/api/billing/outpatient/export?date=${settlementDate.value}`)
|
||||
}
|
||||
|
||||
watch(settlementDate, () => {
|
||||
loadData()
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
loadData()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.outpatient-daily-settlement {
|
||||
padding: 20px;
|
||||
background-color: #f5f7fa;
|
||||
min-height: calc(100vh - 84px);
|
||||
}
|
||||
.card-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
}
|
||||
.summary-card {
|
||||
text-align: center;
|
||||
padding: 15px 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.summary-label {
|
||||
font-size: 14px;
|
||||
color: #606266;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.summary-value {
|
||||
font-size: 22px;
|
||||
font-weight: bold;
|
||||
color: #303133;
|
||||
}
|
||||
.action-section {
|
||||
margin-top: 20px;
|
||||
padding: 10px 0;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 12px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user