386 lines
14 KiB
HTML
386 lines
14 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="zh-CN">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<title>产值汇总表 - OA系统</title>
|
||
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
|
||
<!-- 统一布局样式 -->
|
||
<link rel="stylesheet" href="unified-layout.css">
|
||
<style>
|
||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||
body {
|
||
font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
|
||
background: #f0f2f5;
|
||
overflow: hidden;
|
||
}
|
||
.layout-container {
|
||
height: 100vh;
|
||
display: flex;
|
||
flex-direction: column;
|
||
}
|
||
background: #409EFF; }
|
||
.main-container {
|
||
flex: 1;
|
||
display: flex;
|
||
overflow: hidden;
|
||
}
|
||
.app-main {
|
||
flex: 1;
|
||
overflow: hidden;
|
||
display: flex;
|
||
flex-direction: column;
|
||
background: #f0f2f5;
|
||
}
|
||
.sidebar {
|
||
width: 210px;
|
||
background: #fff;
|
||
border-right: 1px solid #e6e6e6;
|
||
overflow-y: auto;
|
||
}
|
||
.el-menu {
|
||
border-right: none;
|
||
}
|
||
.menu-item { padding: 12px 24px; cursor: pointer; }
|
||
.menu-item.active {
|
||
background: #409EFF;
|
||
color: #fff;
|
||
}
|
||
.content {
|
||
flex: 1;
|
||
padding: 20px;
|
||
overflow-y: auto;
|
||
background: #fff;
|
||
margin: 10px;
|
||
border-radius: 4px;
|
||
}
|
||
.page-header { margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid #f0f0f0; }
|
||
.page-title { font-size: 20px; font-weight: 500; }
|
||
.search-form { background: #fafafa; padding: 16px; border-radius: 4px; margin-bottom: 16px; }
|
||
.form-row { display: flex; gap: 16px; margin-bottom: 12px; }
|
||
.form-item { flex: 1; }
|
||
.form-input { width: 100%; padding: 6px 12px; border: 1px solid #d9d9d9; border-radius: 4px; }
|
||
.btn { padding: 6px 16px; border: none; border-radius: 4px; cursor: pointer; }
|
||
.btn-primary { background: #409EFF; color: white; }
|
||
.btn-default { background: white; color: #333; border: 1px solid #d9d9d9; }
|
||
table { width: 100%; border-collapse: collapse; }
|
||
th, td { padding: 12px; text-align: left; border-bottom: 1px solid #f0f0f0; }
|
||
th { background: #fafafa; font-weight: 500; }
|
||
.summary-row { background: #f0f5ff; font-weight: 500; }
|
||
.chart-container {
|
||
background: white;
|
||
border-radius: 4px;
|
||
padding: 20px;
|
||
margin-bottom: 20px;
|
||
box-shadow: 0 1px 3px rgba(0,0,0,0.04);
|
||
}
|
||
.chart-title {
|
||
font-size: 16px;
|
||
font-weight: 500;
|
||
margin-bottom: 16px;
|
||
padding-bottom: 12px;
|
||
border-bottom: 1px solid #f0f0f0;
|
||
}
|
||
.chart-wrapper {
|
||
height: 300px;
|
||
width: 100%;
|
||
}
|
||
.chart-tabs {
|
||
display: flex;
|
||
gap: 8px;
|
||
margin-bottom: 16px;
|
||
}
|
||
.chart-tab {
|
||
padding: 6px 16px;
|
||
border: 1px solid #dcdfe6;
|
||
border-radius: 4px;
|
||
background: white;
|
||
color: #606266;
|
||
cursor: pointer;
|
||
font-size: 14px;
|
||
}
|
||
.chart-tab.active {
|
||
background: #409EFF;
|
||
color: white;
|
||
border-color: #409EFF;
|
||
}
|
||
</style>
|
||
<!-- ECharts -->
|
||
<script src="https://cdn.jsdelivr.net/npm/echarts@5.4.0/dist/echarts.min.js"></script>
|
||
<!-- Vue.js -->
|
||
<script src="https://unpkg.com/vue@2/dist/vue.js"></script>
|
||
<!-- Element UI JS -->
|
||
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
|
||
</head>
|
||
<body>
|
||
<div id="app">
|
||
|
||
<div class="layout-container">
|
||
<div class="main-container">
|
||
<div class="sidebar">
|
||
<div class="menu-item" onclick="window.location.href='report-project-detail.html'">项目明细表</div>
|
||
<div class="menu-item" onclick="window.location.href='report-project-summary.html'">项目汇总表</div>
|
||
<div class="menu-item" onclick="window.location.href='report-output-detail.html'">产值明细表</div>
|
||
<div class="menu-item active">产值汇总表</div>
|
||
<div class="menu-item" onclick="window.location.href='report-receivable-detail.html'">应收账款明细表</div>
|
||
<div class="menu-item" onclick="window.location.href='report-receivable-summary.html'">应收账款汇总表</div>
|
||
<div class="menu-item" onclick="window.location.href='report-payable-detail.html'">应付账款明细表</div>
|
||
<div class="menu-item" onclick="window.location.href='report-payable-summary.html'">应付账款汇总表</div>
|
||
</div>
|
||
<div class="content">
|
||
<div class="page-header">
|
||
<div class="page-title">产值汇总表</div>
|
||
</div>
|
||
<div class="search-form">
|
||
<div class="form-row">
|
||
<div class="form-item">
|
||
<input type="month" class="form-input" value="2025-01" id="monthInput">
|
||
</div>
|
||
<div class="form-item" style="display: flex; gap: 8px;">
|
||
<button class="btn btn-primary" onclick="queryData()">查询</button>
|
||
<button class="btn btn-default" onclick="exportExcel()">导出Excel</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 图表展示 -->
|
||
<div class="chart-container">
|
||
<div class="chart-title">产值统计图表</div>
|
||
<div class="chart-tabs">
|
||
<div class="chart-tab active" onclick="switchChart('bar')">柱状图</div>
|
||
<div class="chart-tab" onclick="switchChart('line')">折线图</div>
|
||
<div class="chart-tab" onclick="switchChart('pie')">饼图</div>
|
||
</div>
|
||
<div id="outputChart" class="chart-wrapper"></div>
|
||
</div>
|
||
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>执业者</th>
|
||
<th>时间段</th>
|
||
<th>完成项目数</th>
|
||
<th>总产值</th>
|
||
<th>平均项目产值</th>
|
||
<th>最高项目产值</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>张三</td>
|
||
<td>2025年1月</td>
|
||
<td>5</td>
|
||
<td>¥120,000</td>
|
||
<td>¥24,000</td>
|
||
<td>¥30,000</td>
|
||
</tr>
|
||
<tr>
|
||
<td>李四</td>
|
||
<td>2025年1月</td>
|
||
<td>3</td>
|
||
<td>¥80,000</td>
|
||
<td>¥26,667</td>
|
||
<td>¥35,000</td>
|
||
</tr>
|
||
<tr class="summary-row">
|
||
<td>合计</td>
|
||
<td>2025年1月</td>
|
||
<td>8</td>
|
||
<td>¥200,000</td>
|
||
<td>¥25,000</td>
|
||
<td>-</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<script src="common.js"></script>
|
||
<script>
|
||
let outputChart = null;
|
||
let currentChartType = 'bar';
|
||
|
||
// 初始化图表
|
||
function initChart() {
|
||
const chartDom = document.getElementById('outputChart');
|
||
outputChart = echarts.init(chartDom);
|
||
renderChart(currentChartType);
|
||
window.addEventListener('resize', () => outputChart.resize());
|
||
}
|
||
|
||
// 切换图表类型
|
||
function switchChart(type) {
|
||
document.querySelectorAll('.chart-tab').forEach(tab => tab.classList.remove('active'));
|
||
event.target.classList.add('active');
|
||
currentChartType = type;
|
||
renderChart(type);
|
||
}
|
||
|
||
// 渲染图表
|
||
function renderChart(type) {
|
||
// 模拟数据(实际应从后端获取)
|
||
const data = [
|
||
{ name: '张三', value: 120000, count: 5 },
|
||
{ name: '李四', value: 80000, count: 3 },
|
||
{ name: '王五', value: 100000, count: 4 },
|
||
{ name: '赵六', value: 90000, count: 3 }
|
||
];
|
||
|
||
let option = {};
|
||
|
||
if (type === 'bar') {
|
||
option = {
|
||
tooltip: {
|
||
trigger: 'axis',
|
||
axisPointer: { type: 'shadow' }
|
||
},
|
||
legend: {
|
||
data: ['总产值', '项目数量']
|
||
},
|
||
grid: {
|
||
left: '3%',
|
||
right: '4%',
|
||
bottom: '3%',
|
||
containLabel: true
|
||
},
|
||
xAxis: {
|
||
type: 'category',
|
||
data: data.map(item => item.name)
|
||
},
|
||
yAxis: [
|
||
{
|
||
type: 'value',
|
||
name: '产值(元)',
|
||
position: 'left'
|
||
},
|
||
{
|
||
type: 'value',
|
||
name: '项目数',
|
||
position: 'right'
|
||
}
|
||
],
|
||
series: [
|
||
{
|
||
name: '总产值',
|
||
type: 'bar',
|
||
data: data.map(item => item.value),
|
||
itemStyle: { color: '#409EFF' }
|
||
},
|
||
{
|
||
name: '项目数量',
|
||
type: 'bar',
|
||
yAxisIndex: 1,
|
||
data: data.map(item => item.count),
|
||
itemStyle: { color: '#67c23a' }
|
||
}
|
||
]
|
||
};
|
||
} else if (type === 'line') {
|
||
option = {
|
||
tooltip: {
|
||
trigger: 'axis'
|
||
},
|
||
legend: {
|
||
data: ['总产值', '项目数量']
|
||
},
|
||
grid: {
|
||
left: '3%',
|
||
right: '4%',
|
||
bottom: '3%',
|
||
containLabel: true
|
||
},
|
||
xAxis: {
|
||
type: 'category',
|
||
data: data.map(item => item.name)
|
||
},
|
||
yAxis: [
|
||
{
|
||
type: 'value',
|
||
name: '产值(元)',
|
||
position: 'left'
|
||
},
|
||
{
|
||
type: 'value',
|
||
name: '项目数',
|
||
position: 'right'
|
||
}
|
||
],
|
||
series: [
|
||
{
|
||
name: '总产值',
|
||
type: 'line',
|
||
data: data.map(item => item.value),
|
||
itemStyle: { color: '#409EFF' }
|
||
},
|
||
{
|
||
name: '项目数量',
|
||
type: 'line',
|
||
yAxisIndex: 1,
|
||
data: data.map(item => item.count),
|
||
itemStyle: { color: '#67c23a' }
|
||
}
|
||
]
|
||
};
|
||
} else if (type === 'pie') {
|
||
option = {
|
||
tooltip: {
|
||
trigger: 'item',
|
||
formatter: '{a} <br/>{b}: ¥{c} ({d}%)'
|
||
},
|
||
legend: {
|
||
orient: 'vertical',
|
||
left: 'left'
|
||
},
|
||
series: [
|
||
{
|
||
name: '产值',
|
||
type: 'pie',
|
||
radius: ['40%', '70%'],
|
||
avoidLabelOverlap: false,
|
||
itemStyle: {
|
||
borderRadius: 10,
|
||
borderColor: '#fff',
|
||
borderWidth: 2
|
||
},
|
||
label: {
|
||
show: true,
|
||
formatter: '{b}\n¥{c}\n({d}%)'
|
||
},
|
||
data: data.map(item => ({
|
||
value: item.value,
|
||
name: item.name
|
||
}))
|
||
}
|
||
]
|
||
};
|
||
}
|
||
|
||
outputChart.setOption(option);
|
||
}
|
||
|
||
// 查询数据
|
||
function queryData() {
|
||
const month = document.getElementById('monthInput').value;
|
||
CommonUtils.showMessage('查询' + month + '的数据');
|
||
renderChart(currentChartType);
|
||
}
|
||
|
||
// 导出Excel
|
||
function exportExcel() {
|
||
CommonUtils.exportExcel('产值汇总表.xlsx');
|
||
}
|
||
|
||
// 页面加载时初始化
|
||
window.onload = function() {
|
||
initChart();
|
||
};
|
||
</script>
|
||
<script src="unified-layout.js"></script>
|
||
<script>
|
||
initUnifiedLayout('report');
|
||
</script>
|
||
</body>
|
||
</html>
|
||
|