Merge remote-tracking branch 'origin/developer' into developer
This commit is contained in:
@@ -47,3 +47,15 @@ export const delObj = (ids: string[]) => {
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 活动报名
|
||||
* @param data 报名信息 { activityInfoId, id (子项目ID), remarks }
|
||||
*/
|
||||
export const signUp = (data: any) => {
|
||||
return request({
|
||||
url: '/stuwork/activityinfosub/signUp',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -60,3 +60,16 @@ export const delObj = (ids: string[]) => {
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 按学年学期统计各班级举办活动次数
|
||||
* @param schoolYear 学年
|
||||
* @param schoolTerm 学期
|
||||
*/
|
||||
export const statisticsByYearTerm = (schoolYear?: string, schoolTerm?: string) => {
|
||||
return request({
|
||||
url: '/stuwork/classactivity/statistics',
|
||||
method: 'get',
|
||||
params: { schoolYear, schoolTerm }
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -73,3 +73,16 @@ export const exportExcel = (query?: any) => {
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 班费使用汇总
|
||||
* @param schoolYear 学年
|
||||
* @param schoolTerm 学期
|
||||
*/
|
||||
export const getSummary = (schoolYear: string, schoolTerm: string) => {
|
||||
return request({
|
||||
url: '/stuwork/classfeelog/summary',
|
||||
method: 'get',
|
||||
params: { schoolYear, schoolTerm }
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -72,3 +72,38 @@ export const addScore = (data: any) => {
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 生成班级论文上传统计
|
||||
* @param data
|
||||
*/
|
||||
export const generateSummary = (data: any) => {
|
||||
return request({
|
||||
url: '/stuwork/classpaper/generateSummary',
|
||||
method: 'get',
|
||||
params: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 初始化班级论文数据
|
||||
* @param data
|
||||
*/
|
||||
export const initClassPaper = (data: any) => {
|
||||
return request({
|
||||
url: '/stuwork/classpaper/init',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询班级论文统计列表
|
||||
* @param data
|
||||
*/
|
||||
export const getSummaryList = (data: any) => {
|
||||
return request({
|
||||
url: '/stuwork/classpaper/summaryList',
|
||||
method: 'get',
|
||||
params: data
|
||||
});
|
||||
};
|
||||
|
||||
@@ -73,3 +73,16 @@ export const exportExcel = (query?: any) => {
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 按学年学期统计各班级安全教育次数
|
||||
* @param schoolYear 学年
|
||||
* @param schoolTerm 学期
|
||||
*/
|
||||
export const statisticsByYearTerm = (schoolYear?: string, schoolTerm?: string) => {
|
||||
return request({
|
||||
url: '/stuwork/classsafeedu/statistics',
|
||||
method: 'get',
|
||||
params: { schoolYear, schoolTerm }
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -60,3 +60,26 @@ export const delObj = (ids: string[]) => {
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 初始化班级总结数据
|
||||
* @param data
|
||||
*/
|
||||
export const initClassSummary = (data: any) => {
|
||||
return request({
|
||||
url: '/stuwork/classsummary/init',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询班级总结统计列表
|
||||
* @param data
|
||||
*/
|
||||
export const getStatisticsList = (data: any) => {
|
||||
return request({
|
||||
url: '/stuwork/classsummary/statisticsList',
|
||||
method: 'get',
|
||||
params: data
|
||||
});
|
||||
};
|
||||
|
||||
@@ -25,3 +25,39 @@ export const exportExcel = (query?: any) => {
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 更新学生评优奖项
|
||||
* @param data
|
||||
*/
|
||||
export const updateStuAward = (data: any) => {
|
||||
return request({
|
||||
url: '/stuwork/rewardstudent/updateStuAward',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询学生评优记录
|
||||
* @param stuNo 学号
|
||||
* @param schoolYear 学年
|
||||
* @param schoolTerm 学期
|
||||
*/
|
||||
export const getStuRewardList = (stuNo: string, schoolYear: string, schoolTerm: string) => {
|
||||
return request({
|
||||
url: '/stuwork/rewardstudent/getStuRewardList',
|
||||
method: 'get',
|
||||
params: { stuNo, schoolYear, schoolTerm }
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取奖项规则列表
|
||||
*/
|
||||
export const getRewardRuleList = () => {
|
||||
return request({
|
||||
url: '/stuwork/rewardrule/getRewardRule',
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -59,3 +59,13 @@ export const delObj = (ids: string[]) => {
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 社团统计 - 根据学院统计社团数量
|
||||
*/
|
||||
export const getAssociationStats = () => {
|
||||
return request({
|
||||
url: '/stuwork/stuassociation/stats',
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -72,3 +72,31 @@ export const updateResult = (data: any) => {
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 导入心理健康数据
|
||||
* @param file
|
||||
*/
|
||||
export const importExcel = (file: File) => {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
return request({
|
||||
url: '/stuwork/stucare/import',
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 下载导入模板
|
||||
*/
|
||||
export const downloadTemplate = () => {
|
||||
return request({
|
||||
url: '/stuwork/stucare/importTemplate',
|
||||
method: 'get',
|
||||
responseType: 'blob'
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -113,3 +113,16 @@ export const getStuConductYear = (query?: any) => {
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 发送学期操行考核预警
|
||||
* @param schoolYear 学年
|
||||
* @param schoolTerm 学期
|
||||
*/
|
||||
export const sendConductWarning = (schoolYear: string, schoolTerm: string) => {
|
||||
return request({
|
||||
url: '/stuwork/stuconduct/sendWarning',
|
||||
method: 'post',
|
||||
params: { schoolYear, schoolTerm }
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -23,3 +23,51 @@ export const fetchList = (query?: any) => {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 学分确认
|
||||
* @param graduYear 毕业年份
|
||||
*/
|
||||
export const confirmScore = (graduYear: string) => {
|
||||
return request({
|
||||
url: '/stuwork/stugraducheck/confirmScore',
|
||||
method: 'get',
|
||||
params: { graduYear }
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 操行考核确认
|
||||
* @param graduYear 毕业年份
|
||||
*/
|
||||
export const confirmConduct = (graduYear: string) => {
|
||||
return request({
|
||||
url: '/stuwork/stugraducheck/confirmConduct',
|
||||
method: 'get',
|
||||
params: { graduYear }
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 违纪确认
|
||||
* @param graduYear 毕业年份
|
||||
*/
|
||||
export const confirmPunish = (graduYear: string) => {
|
||||
return request({
|
||||
url: '/stuwork/stugraducheck/confirmPunish',
|
||||
method: 'get',
|
||||
params: { graduYear }
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 等级工确认
|
||||
* @param graduYear 毕业年份
|
||||
*/
|
||||
export const confirmSkill = (graduYear: string) => {
|
||||
return request({
|
||||
url: '/stuwork/stugraducheck/confirmSkill',
|
||||
method: 'get',
|
||||
params: { graduYear }
|
||||
})
|
||||
}
|
||||
|
||||
@@ -89,3 +89,13 @@ export const exportExcel = (query?: any) => {
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取团员统计信息(全校总数+各学院统计)
|
||||
*/
|
||||
export const getStatistics = () => {
|
||||
return request({
|
||||
url: '/stuwork/stuunionleague/statistics',
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -126,12 +126,19 @@
|
||||
<span style="margin-left: 4px">活动说明</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100" align="center" fixed="right">
|
||||
<el-table-column label="操作" width="150" align="center" fixed="right">
|
||||
<template #header>
|
||||
<el-icon><Setting /></el-icon>
|
||||
<span style="margin-left: 4px">操作</span>
|
||||
</template>
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
icon="Edit"
|
||||
link
|
||||
type="primary"
|
||||
@click="handleSignUp(scope.row)">
|
||||
报名
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Delete"
|
||||
link
|
||||
@@ -162,7 +169,7 @@
|
||||
<script setup lang="ts" name="ActivityInfoSub">
|
||||
import { reactive, ref, onMounted } from 'vue'
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { fetchList, delObj, getActivityInfoList } from "/@/api/stuwork/activityinfosub";
|
||||
import { fetchList, delObj, getActivityInfoList, signUp } from "/@/api/stuwork/activityinfosub";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import { parseTime } from "/@/utils/formatTime";
|
||||
import TableColumnControl from '/@/components/TableColumnControl/index.vue'
|
||||
@@ -243,6 +250,28 @@ const handleDelete = async (row: any) => {
|
||||
}
|
||||
}
|
||||
|
||||
// 活动报名
|
||||
const handleSignUp = async (row: any) => {
|
||||
const { confirm } = useMessageBox()
|
||||
try {
|
||||
await confirm(`确定要报名参加【${row.subTitle || '该活动'}】吗?`)
|
||||
state.loading = true
|
||||
await signUp({
|
||||
activityInfoId: row.activityInfoId,
|
||||
id: row.id,
|
||||
remarks: ''
|
||||
})
|
||||
useMessage().success('报名成功')
|
||||
getDataList()
|
||||
} catch (err: any) {
|
||||
if (err !== 'cancel') {
|
||||
useMessage().error(err.msg || '报名失败')
|
||||
}
|
||||
} finally {
|
||||
state.loading = false
|
||||
}
|
||||
}
|
||||
|
||||
// 获取活动主题列表
|
||||
const getActivityInfoListData = async () => {
|
||||
try {
|
||||
|
||||
@@ -77,6 +77,12 @@
|
||||
班级活动列表
|
||||
</span>
|
||||
<div class="header-actions">
|
||||
<el-button
|
||||
icon="DataAnalysis"
|
||||
type="success"
|
||||
@click="handleStatistics">
|
||||
活动统计
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Plus"
|
||||
type="primary"
|
||||
@@ -225,20 +231,94 @@
|
||||
|
||||
<!-- 新增/编辑表单弹窗 -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList" />
|
||||
|
||||
<!-- 统计对话框 -->
|
||||
<el-dialog
|
||||
v-model="statisticsDialogVisible"
|
||||
title="班级活动统计"
|
||||
width="800px"
|
||||
destroy-on-close>
|
||||
<!-- 搜索条件 -->
|
||||
<el-form :inline="true" class="statistics-form">
|
||||
<el-form-item label="学年">
|
||||
<el-select
|
||||
v-model="statisticsQuery.schoolYear"
|
||||
placeholder="请选择学年"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 180px">
|
||||
<el-option
|
||||
v-for="item in schoolYearList"
|
||||
:key="item.year"
|
||||
:label="item.year"
|
||||
:value="item.year">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="学期">
|
||||
<el-select
|
||||
v-model="statisticsQuery.schoolTerm"
|
||||
placeholder="请选择学期"
|
||||
clearable
|
||||
style="width: 180px">
|
||||
<el-option
|
||||
v-for="item in schoolTermList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="getStatisticsData">查询</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!-- 统计表格 -->
|
||||
<el-table
|
||||
:data="statisticsData"
|
||||
v-loading="statisticsLoading"
|
||||
stripe
|
||||
max-height="400px"
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle">
|
||||
<el-table-column type="index" label="序号" width="70" align="center" />
|
||||
<el-table-column prop="classNo" label="班号" align="center" />
|
||||
<el-table-column prop="schoolYear" label="学年" align="center" />
|
||||
<el-table-column prop="schoolTerm" label="学期" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag size="small" type="primary" effect="plain" round>
|
||||
{{ formatSchoolTerm(row.schoolTerm) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="activityCount" label="活动次数" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag size="small" type="success" effect="plain" round>
|
||||
{{ row.activityCount }} 次
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<template #footer>
|
||||
<el-button @click="statisticsDialogVisible = false">关闭</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="ClassActivity">
|
||||
import { reactive, ref, onMounted } from 'vue'
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { fetchList, delObj } from "/@/api/stuwork/classactivity";
|
||||
import { fetchList, delObj, statisticsByYearTerm } from "/@/api/stuwork/classactivity";
|
||||
import { getClassListByRole } from "/@/api/basic/basicclass";
|
||||
import { queryAllSchoolYear } from "/@/api/basic/basicyear";
|
||||
import { getDicts } from "/@/api/admin/dict";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import TableColumnControl from '/@/components/TableColumnControl/index.vue'
|
||||
import FormDialog from './form.vue'
|
||||
import { List, Calendar, Clock, Grid, Trophy, User, Location, UserFilled, Setting, Menu, Search, Document, EditPen, Picture } from '@element-plus/icons-vue'
|
||||
import { List, Calendar, Clock, Grid, Trophy, User, Location, UserFilled, Setting, Menu, Search, Document, EditPen, Picture, DataAnalysis } from '@element-plus/icons-vue'
|
||||
import { useTableColumnControl } from '/@/hooks/tableColumn'
|
||||
|
||||
// 定义变量内容
|
||||
@@ -250,6 +330,15 @@ const schoolYearList = ref<any[]>([])
|
||||
const schoolTermList = ref<any[]>([])
|
||||
const classList = ref<any[]>([])
|
||||
|
||||
// 统计相关变量
|
||||
const statisticsDialogVisible = ref(false)
|
||||
const statisticsLoading = ref(false)
|
||||
const statisticsData = ref<any[]>([])
|
||||
const statisticsQuery = reactive({
|
||||
schoolYear: '',
|
||||
schoolTerm: ''
|
||||
})
|
||||
|
||||
// 表格列配置
|
||||
const tableColumns = [
|
||||
{ prop: 'schoolYear', label: '学年', icon: Calendar },
|
||||
@@ -397,6 +486,40 @@ const getClassListData = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 打开统计对话框
|
||||
const handleStatistics = () => {
|
||||
// 使用当前搜索条件的学年和学期
|
||||
statisticsQuery.schoolYear = state.queryForm.schoolYear || ''
|
||||
statisticsQuery.schoolTerm = state.queryForm.schoolTerm || ''
|
||||
statisticsData.value = []
|
||||
statisticsDialogVisible.value = true
|
||||
}
|
||||
|
||||
// 获取统计数据
|
||||
const getStatisticsData = async () => {
|
||||
// 必须选择学年或学期才能查询
|
||||
if (!statisticsQuery.schoolYear && !statisticsQuery.schoolTerm) {
|
||||
useMessage().warning('请选择学年或学期进行查询')
|
||||
return
|
||||
}
|
||||
statisticsLoading.value = true
|
||||
try {
|
||||
const res = await statisticsByYearTerm(
|
||||
statisticsQuery.schoolYear || undefined,
|
||||
statisticsQuery.schoolTerm || undefined
|
||||
)
|
||||
if (res.data && Array.isArray(res.data)) {
|
||||
statisticsData.value = res.data
|
||||
} else {
|
||||
statisticsData.value = []
|
||||
}
|
||||
} catch (err) {
|
||||
statisticsData.value = []
|
||||
} finally {
|
||||
statisticsLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化
|
||||
onMounted(() => {
|
||||
getSchoolYearList()
|
||||
|
||||
@@ -113,6 +113,13 @@
|
||||
@click="formDialogRef.openDialog()">
|
||||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="DataAnalysis"
|
||||
type="warning"
|
||||
class="ml10"
|
||||
@click="handleSummary">
|
||||
班费汇总
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Download"
|
||||
type="success"
|
||||
@@ -254,13 +261,133 @@
|
||||
|
||||
<!-- 新增/编辑表单弹窗 -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList" />
|
||||
|
||||
<!-- 班费汇总弹窗 -->
|
||||
<el-dialog
|
||||
title="班费使用汇总"
|
||||
v-model="summaryDialogVisible"
|
||||
:width="900"
|
||||
:close-on-click-modal="false"
|
||||
draggable>
|
||||
<!-- 查询条件 -->
|
||||
<el-form :inline="true" class="summary-form">
|
||||
<el-form-item label="学年">
|
||||
<el-select
|
||||
v-model="summaryQuery.schoolYear"
|
||||
placeholder="请选择学年"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 180px">
|
||||
<el-option
|
||||
v-for="item in schoolYearList"
|
||||
:key="item.year"
|
||||
:label="item.year"
|
||||
:value="item.year">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="学期">
|
||||
<el-select
|
||||
v-model="summaryQuery.schoolTerm"
|
||||
placeholder="请选择学期"
|
||||
clearable
|
||||
style="width: 150px">
|
||||
<el-option
|
||||
v-for="item in schoolTermList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleSummaryQuery">查询</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!-- 汇总表格 -->
|
||||
<el-table
|
||||
:data="summaryData"
|
||||
v-loading="summaryLoading"
|
||||
stripe
|
||||
border
|
||||
max-height="400"
|
||||
style="width: 100%">
|
||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||
<el-table-column prop="deptName" label="学院" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="classNo" label="班级" width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="totalIncome" label="总收入" width="100" align="right">
|
||||
<template #default="scope">
|
||||
<span style="color: #67c23a; font-weight: bold;">
|
||||
{{ scope.row.totalIncome ? '¥' + scope.row.totalIncome.toFixed(2) : '¥0.00' }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="totalExpense" label="总支出" width="100" align="right">
|
||||
<template #default="scope">
|
||||
<span style="color: #f56c6c; font-weight: bold;">
|
||||
{{ scope.row.totalExpense ? '¥' + scope.row.totalExpense.toFixed(2) : '¥0.00' }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="openingBalance" label="期初结余" width="100" align="right">
|
||||
<template #default="scope">
|
||||
<span style="color: #409eff; font-weight: bold;">
|
||||
{{ scope.row.openingBalance ? '¥' + scope.row.openingBalance.toFixed(2) : '¥0.00' }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="totalBalance" label="总结余" width="100" align="right">
|
||||
<template #default="scope">
|
||||
<span :style="{ color: scope.row.totalBalance >= 0 ? '#67c23a' : '#f56c6c', fontWeight: 'bold' }">
|
||||
{{ scope.row.totalBalance ? '¥' + scope.row.totalBalance.toFixed(2) : '¥0.00' }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="recordCount" label="记录数" width="80" align="center" />
|
||||
</el-table>
|
||||
|
||||
<!-- 汇总统计 -->
|
||||
<div v-if="summaryData.length > 0" class="summary-total">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<div class="total-item">
|
||||
<span class="label">班级总数:</span>
|
||||
<span class="value">{{ summaryData.length }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div class="total-item">
|
||||
<span class="label">总收入合计:</span>
|
||||
<span class="value income">¥{{ totalSummary.totalIncome.toFixed(2) }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div class="total-item">
|
||||
<span class="label">总支出合计:</span>
|
||||
<span class="value expense">¥{{ totalSummary.totalExpense.toFixed(2) }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div class="total-item">
|
||||
<span class="label">总结余合计:</span>
|
||||
<span class="value balance">¥{{ totalSummary.totalBalance.toFixed(2) }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<el-button @click="summaryDialogVisible = false">关 闭</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="ClassFeeLog">
|
||||
import { reactive, ref, onMounted } from 'vue'
|
||||
import { reactive, ref, onMounted, computed } from 'vue'
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { fetchList, delObj, exportExcel } from "/@/api/stuwork/classfeelog";
|
||||
import { fetchList, delObj, exportExcel, getSummary } from "/@/api/stuwork/classfeelog";
|
||||
import { getDeptList } from "/@/api/basic/basicclass";
|
||||
import { queryAllSchoolYear } from "/@/api/basic/basicyear";
|
||||
import { getClassListByRole } from "/@/api/basic/basicclass";
|
||||
@@ -268,7 +395,7 @@ import { getDicts } from "/@/api/admin/dict";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import TableColumnControl from '/@/components/TableColumnControl/index.vue'
|
||||
import FormDialog from './form.vue'
|
||||
import { List, Calendar, Clock, OfficeBuilding, Grid, Collection, Money, User, Document, Setting, Menu, Search, FolderAdd, EditPen } from '@element-plus/icons-vue'
|
||||
import { List, Calendar, Clock, OfficeBuilding, Grid, Collection, Money, User, Document, Setting, Menu, Search, FolderAdd, EditPen, DataAnalysis } from '@element-plus/icons-vue'
|
||||
import { useTableColumnControl } from '/@/hooks/tableColumn'
|
||||
|
||||
// 定义变量内容
|
||||
@@ -282,6 +409,15 @@ const deptList = ref<any[]>([])
|
||||
const classList = ref<any[]>([])
|
||||
const typeList = ref<any[]>([])
|
||||
|
||||
// 班费汇总相关
|
||||
const summaryDialogVisible = ref(false)
|
||||
const summaryLoading = ref(false)
|
||||
const summaryData = ref<any[]>([])
|
||||
const summaryQuery = reactive({
|
||||
schoolYear: '',
|
||||
schoolTerm: ''
|
||||
})
|
||||
|
||||
// 表格列配置
|
||||
const tableColumns = [
|
||||
{ prop: 'schoolYear', label: '学年', icon: Calendar },
|
||||
@@ -492,6 +628,73 @@ const getTypeDict = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 打开班费汇总弹窗
|
||||
const handleSummary = () => {
|
||||
// 默认选择当前学年学期
|
||||
const now = new Date()
|
||||
const year = now.getFullYear()
|
||||
const month = now.getMonth() + 1
|
||||
|
||||
// 计算当前学年
|
||||
let currentYear: string
|
||||
if (month >= 9) {
|
||||
currentYear = `${year}-${year + 1}`
|
||||
} else {
|
||||
currentYear = `${year - 1}-${year}`
|
||||
}
|
||||
|
||||
// 计算当前学期
|
||||
const currentTerm = (month >= 9 || month <= 1) ? '1' : '2'
|
||||
|
||||
summaryQuery.schoolYear = currentYear
|
||||
summaryQuery.schoolTerm = currentTerm
|
||||
|
||||
summaryDialogVisible.value = true
|
||||
handleSummaryQuery()
|
||||
}
|
||||
|
||||
// 查询班费汇总数据
|
||||
const handleSummaryQuery = async () => {
|
||||
if (!summaryQuery.schoolYear || !summaryQuery.schoolTerm) {
|
||||
useMessage().warning('请选择学年 and 学期')
|
||||
return
|
||||
}
|
||||
|
||||
summaryLoading.value = true
|
||||
try {
|
||||
const res = await getSummary(summaryQuery.schoolYear, summaryQuery.schoolTerm)
|
||||
if (res.data && Array.isArray(res.data)) {
|
||||
summaryData.value = res.data
|
||||
} else {
|
||||
summaryData.value = []
|
||||
}
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg || '获取汇总数据失败')
|
||||
summaryData.value = []
|
||||
} finally {
|
||||
summaryLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 汇总统计数据
|
||||
const totalSummary = computed(() => {
|
||||
let totalIncome = 0
|
||||
let totalExpense = 0
|
||||
let totalBalance = 0
|
||||
|
||||
summaryData.value.forEach(item => {
|
||||
totalIncome += item.totalIncome || 0
|
||||
totalExpense += item.totalExpense || 0
|
||||
totalBalance += item.totalBalance || 0
|
||||
})
|
||||
|
||||
return {
|
||||
totalIncome,
|
||||
totalExpense,
|
||||
totalBalance
|
||||
}
|
||||
})
|
||||
|
||||
// 初始化
|
||||
onMounted(() => {
|
||||
getSchoolYearList()
|
||||
@@ -504,4 +707,42 @@ onMounted(() => {
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import '/@/assets/styles/modern-page.scss';
|
||||
|
||||
.summary-form {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.summary-total {
|
||||
margin-top: 15px;
|
||||
padding: 15px;
|
||||
background: #f5f7fa;
|
||||
border-radius: 4px;
|
||||
|
||||
.total-item {
|
||||
text-align: center;
|
||||
|
||||
.label {
|
||||
color: #909399;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.value {
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
margin-left: 5px;
|
||||
|
||||
&.income {
|
||||
color: #67c23a;
|
||||
}
|
||||
|
||||
&.expense {
|
||||
color: #f56c6c;
|
||||
}
|
||||
|
||||
&.balance {
|
||||
color: #409eff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -114,6 +114,20 @@
|
||||
@click="formDialogRef.openDialog()">
|
||||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Plus"
|
||||
type="warning"
|
||||
class="ml10"
|
||||
@click="handleInitClassPaper">
|
||||
初始化
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="DataAnalysis"
|
||||
type="success"
|
||||
class="ml10"
|
||||
@click="handleShowSummary">
|
||||
统计查看
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
class="ml10"
|
||||
@@ -257,13 +271,154 @@
|
||||
|
||||
<!-- 查看详情弹窗 -->
|
||||
<detail-dialog ref="detailDialogRef" />
|
||||
|
||||
<!-- 初始化班级论文弹窗 -->
|
||||
<el-dialog
|
||||
v-model="initDialogVisible"
|
||||
title="初始化班级论文数据"
|
||||
width="600px"
|
||||
:close-on-click-modal="false"
|
||||
draggable>
|
||||
<el-form label-width="120px">
|
||||
<el-form-item label="学年">
|
||||
<el-select
|
||||
v-model="initForm.schoolYear"
|
||||
placeholder="请选择学年"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in schoolYearList"
|
||||
:key="item.year"
|
||||
:label="item.year"
|
||||
:value="item.year">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="学期">
|
||||
<el-select
|
||||
v-model="initForm.schoolTerm"
|
||||
placeholder="请选择学期"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in schoolTermList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="学院">
|
||||
<el-select
|
||||
v-model="initForm.deptCode"
|
||||
placeholder="请选择学院(不选则全部)"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in deptList"
|
||||
:key="item.deptCode"
|
||||
:label="item.deptName"
|
||||
:value="item.deptCode">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-alert
|
||||
title="说明:"
|
||||
type="info"
|
||||
:closable="false"
|
||||
class="mb20">
|
||||
<template #default>
|
||||
<p class="mb10">初始化将为所有非离校班级生成本学年学期的论文数据:</p>
|
||||
<ul class="mb0 pl20">
|
||||
<li>自动获取当前学年学期配置</li>
|
||||
<li>为每个班级生成一条空论文记录</li>
|
||||
<li>班主任信息自动填充</li>
|
||||
<li>已存在记录不会重复生成</li>
|
||||
</ul>
|
||||
</template>
|
||||
</el-alert>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="initDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="handleConfirmInit" :loading="initLoading">
|
||||
确 定
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 统计结果弹窗 -->
|
||||
<el-dialog
|
||||
v-model="summaryDialogVisible"
|
||||
title="班级论文上传统计"
|
||||
width="900px"
|
||||
:close-on-click-modal="false"
|
||||
draggable>
|
||||
<el-form :model="summarySearchForm" :inline="true" class="mb20">
|
||||
<el-form-item label="学年">
|
||||
<el-select
|
||||
v-model="summarySearchForm.schoolYear"
|
||||
placeholder="请选择学年"
|
||||
style="width: 180px">
|
||||
<el-option
|
||||
v-for="item in schoolYearList"
|
||||
:key="item.year"
|
||||
:label="item.year"
|
||||
:value="item.year">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="学期">
|
||||
<el-select
|
||||
v-model="summarySearchForm.schoolTerm"
|
||||
placeholder="请选择学期"
|
||||
style="width: 180px">
|
||||
<el-option
|
||||
v-for="item in schoolTermList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleSearchSummary">查询</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="summaryData"
|
||||
stripe
|
||||
v-loading="summaryLoading">
|
||||
<el-table-column prop="virtualClassNo" label="班号" width="100" />
|
||||
<el-table-column prop="deptName" label="学院" width="150" />
|
||||
<el-table-column prop="classMasterName" label="班主任" width="100" />
|
||||
<el-table-column prop="paperCount" label="论文总数" width="100" />
|
||||
<el-table-column prop="uploadCount" label="已上传" width="100">
|
||||
<template #default="{ row }">
|
||||
<span style="color: #67c23a">{{ row.uploadCount }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="unuploadCount" label="未上传" width="100">
|
||||
<template #default="{ row }">
|
||||
<span style="color: #f56c6c">{{ row.unuploadCount }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="addScoreCount" label="加分次数" width="100" />
|
||||
<el-table-column prop="totalPage" label="总页码" width="100" />
|
||||
</el-table>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="summaryDialogVisible = false">关 闭</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="ClassPaper">
|
||||
import { reactive, ref, onMounted } from 'vue'
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { fetchList, delObj, addScore } from "/@/api/stuwork/classpaper";
|
||||
import { fetchList, delObj, addScore, generateSummary, initClassPaper, getSummaryList } from "/@/api/stuwork/classpaper";
|
||||
import { getDeptList } from "/@/api/basic/basicclass";
|
||||
import { queryAllSchoolYear } from "/@/api/basic/basicyear";
|
||||
import { getClassListByRole } from "/@/api/basic/basicclass";
|
||||
@@ -272,7 +427,7 @@ import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import TableColumnControl from '/@/components/TableColumnControl/index.vue'
|
||||
import FormDialog from './form.vue'
|
||||
import DetailDialog from './detail.vue'
|
||||
import { List, Document, Calendar, Clock, OfficeBuilding, Grid, UserFilled, Collection, Setting, Menu, Search } from '@element-plus/icons-vue'
|
||||
import { List, Document, Calendar, Clock, OfficeBuilding, Grid, UserFilled, Collection, Setting, Menu, Search, DataAnalysis, Plus } from '@element-plus/icons-vue'
|
||||
import { useTableColumnControl } from '/@/hooks/tableColumn'
|
||||
|
||||
// 定义变量内容
|
||||
@@ -290,6 +445,24 @@ const typeList = ref<any[]>([
|
||||
{ label: '教案', value: '1' }
|
||||
])
|
||||
|
||||
// 初始化对话框
|
||||
const initDialogVisible = ref(false)
|
||||
const initLoading = ref(false)
|
||||
const initForm = ref({
|
||||
schoolYear: '',
|
||||
schoolTerm: '',
|
||||
deptCode: ''
|
||||
})
|
||||
|
||||
// 统计对话框
|
||||
const summaryDialogVisible = ref(false)
|
||||
const summaryLoading = ref(false)
|
||||
const summarySearchForm = ref({
|
||||
schoolYear: '',
|
||||
schoolTerm: ''
|
||||
})
|
||||
const summaryData = ref<any[]>([])
|
||||
|
||||
// 表格列配置
|
||||
const tableColumns = [
|
||||
{ prop: 'title', label: '标题', icon: Document, minWidth: 200 },
|
||||
@@ -489,6 +662,85 @@ onMounted(() => {
|
||||
getDeptListData()
|
||||
getClassListData()
|
||||
})
|
||||
|
||||
// 生成统计
|
||||
const handleGenerateSummary = async () => {
|
||||
const year = state.queryForm.schoolYear
|
||||
const term = state.queryForm.schoolTerm
|
||||
if (!year || !term) {
|
||||
useMessage().warning('请先选择学年和学期')
|
||||
return
|
||||
}
|
||||
try {
|
||||
const res = await generateSummary({ schoolYear: year, schoolTerm: term })
|
||||
useMessage().success(res.msg || '统计生成成功')
|
||||
// 可以在这里打开一个对话框显示详细统计结果
|
||||
console.log('统计结果:', res.data)
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg || '统计生成失败')
|
||||
}
|
||||
}
|
||||
|
||||
// 显示初始化对话框
|
||||
const handleInitClassPaper = () => {
|
||||
// 设置默认学年学期
|
||||
if (schoolYearList.value.length > 0) {
|
||||
initForm.value.schoolYear = schoolYearList.value[0].year
|
||||
}
|
||||
if (schoolTermList.value.length > 0) {
|
||||
initForm.value.schoolTerm = schoolTermList.value[0].value
|
||||
}
|
||||
initDialogVisible.value = true
|
||||
}
|
||||
|
||||
// 确认初始化
|
||||
const handleConfirmInit = async () => {
|
||||
if (!initForm.value.schoolYear || !initForm.value.schoolTerm) {
|
||||
useMessage().warning('请选择学年和学期')
|
||||
return
|
||||
}
|
||||
initLoading.value = true
|
||||
try {
|
||||
const res = await initClassPaper(initForm.value)
|
||||
useMessage().success(res.msg || '初始化成功')
|
||||
initDialogVisible.value = false
|
||||
initLoading.value = false
|
||||
getDataList()
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg || '初始化失败')
|
||||
initLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 显示统计对话框
|
||||
const handleShowSummary = () => {
|
||||
// 设置默认学年学期
|
||||
if (state.queryForm.schoolYear) {
|
||||
summarySearchForm.value.schoolYear = state.queryForm.schoolYear
|
||||
}
|
||||
if (state.queryForm.schoolTerm) {
|
||||
summarySearchForm.value.schoolTerm = state.queryForm.schoolTerm
|
||||
}
|
||||
summaryDialogVisible.value = true
|
||||
handleSearchSummary()
|
||||
}
|
||||
|
||||
// 查询统计
|
||||
const handleSearchSummary = async () => {
|
||||
if (!summarySearchForm.value.schoolYear || !summarySearchForm.value.schoolTerm) {
|
||||
useMessage().warning('请选择学年和学期')
|
||||
return
|
||||
}
|
||||
summaryLoading.value = true
|
||||
try {
|
||||
const res = await getSummaryList(summarySearchForm.value)
|
||||
summaryData.value = res.data || []
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg || '查询失败')
|
||||
} finally {
|
||||
summaryLoading.value = false
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
492
src/views/stuwork/classpaper/summary.vue
Normal file
492
src/views/stuwork/classpaper/summary.vue
Normal file
@@ -0,0 +1,492 @@
|
||||
<template>
|
||||
<div class="modern-page-container">
|
||||
<div class="page-wrapper">
|
||||
<!-- 搜索表单卡片 -->
|
||||
<el-card v-show="showSearch" class="search-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon class="title-icon"><Search /></el-icon>
|
||||
筛选条件
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
<el-form :model="searchForm" ref="searchFormRef" :inline="true" class="search-form">
|
||||
<el-form-item label="学年" prop="schoolYear">
|
||||
<el-select
|
||||
v-model="searchForm.schoolYear"
|
||||
placeholder="请选择学年"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 200px">
|
||||
<el-option
|
||||
v-for="item in schoolYearList"
|
||||
:key="item.year"
|
||||
:label="item.year"
|
||||
:value="item.year">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="学期" prop="schoolTerm">
|
||||
<el-select
|
||||
v-model="searchForm.schoolTerm"
|
||||
placeholder="请选择学期"
|
||||
clearable
|
||||
style="width: 200px">
|
||||
<el-option
|
||||
v-for="item in schoolTermList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="学院" prop="deptName">
|
||||
<el-select
|
||||
v-model="searchForm.deptName"
|
||||
placeholder="请选择学院"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 200px">
|
||||
<el-option
|
||||
v-for="item in deptList"
|
||||
:key="item.deptCode"
|
||||
:label="item.deptName"
|
||||
:value="item.deptName">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="班号" prop="classNo">
|
||||
<el-select
|
||||
v-model="searchForm.classNo"
|
||||
placeholder="请选择班号"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 200px">
|
||||
<el-option
|
||||
v-for="item in classList"
|
||||
:key="item.classCode"
|
||||
:label="item.classNo"
|
||||
:value="item.classNo">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleSearch">查询</el-button>
|
||||
<el-button icon="Refresh" @click="handleReset">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<!-- 内容卡片 -->
|
||||
<el-card class="content-card" shadow="never">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="card-title">
|
||||
<el-icon class="title-icon"><Document /></el-icon>
|
||||
班级论文上传统计
|
||||
</span>
|
||||
<div class="header-actions">
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
class="ml10"
|
||||
@queryTable="getDataList">
|
||||
<TableColumnControl
|
||||
ref="columnControlRef"
|
||||
:columns="tableColumns"
|
||||
v-model="visibleColumns"
|
||||
trigger-type="default"
|
||||
trigger-circle
|
||||
@change="handleColumnChange"
|
||||
@order-change="handleColumnOrderChange"
|
||||
>
|
||||
<template #trigger>
|
||||
<el-tooltip class="item" effect="dark" content="列设置" placement="top">
|
||||
<el-button circle style="margin-left: 0;">
|
||||
<el-icon><Menu /></el-icon>
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</TableColumnControl>
|
||||
</right-toolbar>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 统计数据卡片 -->
|
||||
<el-row :gutter="20" class="mb20">
|
||||
<el-col :span="6">
|
||||
<el-card shadow="never" class="stat-card">
|
||||
<div class="stat-item">
|
||||
<span class="stat-label">总班级数</span>
|
||||
<span class="stat-value">{{ totalStats.totalClasses }}</span>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-card shadow="never" class="stat-card">
|
||||
<div class="stat-item">
|
||||
<span class="stat-label">论文总数</span>
|
||||
<span class="stat-value">{{ totalStats.totalPapers }}</span>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-card shadow="never" class="stat-card">
|
||||
<div class="stat-item">
|
||||
<span class="stat-label">已上传</span>
|
||||
<span class="stat-value" style="color: #67c23a">{{ totalStats.totalUpload }}</span>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-card shadow="never" class="stat-card">
|
||||
<div class="stat-item">
|
||||
<span class="stat-label">未上传</span>
|
||||
<span class="stat-value" style="color: #f56c6c">{{ totalStats.totalUnupload }}</span>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 表格 -->
|
||||
<el-table
|
||||
:data="state.dataList"
|
||||
v-loading="state.loading"
|
||||
stripe
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle"
|
||||
class="modern-table">
|
||||
<el-table-column type="index" label="序号" width="70" align="center">
|
||||
<template #header>
|
||||
<el-icon><List /></el-icon>
|
||||
</template>
|
||||
<template #default="{ $index }">
|
||||
{{ $index + 1 + ((state.pagination?.current || 1) - 1) * (state.pagination?.size || 10) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template v-for="col in visibleColumnsSorted" :key="col.prop || col.label">
|
||||
<el-table-column
|
||||
v-if="checkColumnVisible(col.prop || '') && col.prop !== '操作'"
|
||||
:prop="col.prop"
|
||||
:label="col.label"
|
||||
:width="col.width"
|
||||
:min-width="col.minWidth"
|
||||
:show-overflow-tooltip="col.showOverflowTooltip !== false"
|
||||
:align="col.align || 'center'>
|
||||
<template #header>
|
||||
<el-icon v-if="col.icon"><component :is="col.icon" /></el-icon>
|
||||
<span :style="{ marginLeft: col.icon ? '4px' : '0' }">{{ col.label }}</span>
|
||||
</template>
|
||||
<!-- 上传状态列特殊模板 -->
|
||||
<template v-else-if="col.prop === 'uploadStatus'" #default="scope">
|
||||
<el-tag
|
||||
v-if="scope.row.unuploadCount === 0"
|
||||
size="small"
|
||||
type="success"
|
||||
effect="plain"
|
||||
round>
|
||||
已完成
|
||||
</el-tag>
|
||||
<el-tag
|
||||
v-else-if="scope.row.unuploadCount < scope.row.paperCount"
|
||||
size="small"
|
||||
type="warning"
|
||||
effect="plain"
|
||||
round>
|
||||
部分未交
|
||||
</el-tag>
|
||||
<el-tag
|
||||
v-else
|
||||
size="small"
|
||||
type="danger"
|
||||
effect="plain"
|
||||
round>
|
||||
全未交
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" width="150" align="center" fixed="right">
|
||||
<template #header>
|
||||
<el-icon><Setting /></el-icon>
|
||||
<span style="margin-left: 4px">操作</span>
|
||||
</template>
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
icon="View"
|
||||
link
|
||||
type="primary"
|
||||
@click="handleViewDetail(scope.row)">
|
||||
查看
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template #empty>
|
||||
<el-empty description="暂无数据" :image-size="120" />
|
||||
</template>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<div class="pagination-wrapper">
|
||||
<pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
v-bind="state.pagination" />
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
<!-- 详细信息弹窗 -->
|
||||
<el-dialog
|
||||
v-model="detailDialogVisible"
|
||||
title="论文详细信息"
|
||||
width="800px"
|
||||
:close-on-click-modal="false"
|
||||
draggable>
|
||||
<el-form label-width="100px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="班号">{{ detailInfo.virtualClassNo || '-' }}</el-form-item>
|
||||
<el-form-item label="学院">{{ detailInfo.deptName || '-' }}</el-form-item>
|
||||
<el-form-item label="班主任">{{ detailInfo.classMasterName || '-' }}</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="论文总数">{{ detailInfo.paperCount || 0 }}</el-form-item>
|
||||
<el-form-item label="已上传">{{ detailInfo.uploadCount || 0 }}</el-form-item>
|
||||
<el-form-item label="未上传">{{ detailInfo.unuploadCount || 0 }}</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="未交学生名单">
|
||||
<el-input
|
||||
v-model="unuploadStudents"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
readonly
|
||||
placeholder="无未交学生" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="detailDialogVisible = false">关 闭</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="ClassPaperSummary">
|
||||
import { reactive, ref, onMounted } from 'vue'
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { getSummaryList } from "/@/api/stuwork/classpaper";
|
||||
import { getDeptList } from '/@/api/basic/basicclass'
|
||||
import { queryAllSchoolYear } from '/@/api/basic/basicyear';
|
||||
import { getClassListByRole } from '/@/api/basic/basicclass';
|
||||
import { getDicts } from '/@/api/admin/dict';
|
||||
import { useMessage } from "/@/hooks/message";
|
||||
import TableColumnControl from '/@/components/TableColumnControl/index.vue'
|
||||
import { List, Document, Calendar, Clock, OfficeBuilding, Grid, Setting, Menu, Search, UserFilled, Tickets } from '@element-plus/icons-vue'
|
||||
import { useTableColumnControl } from '/@/hooks/tableColumn'
|
||||
|
||||
// 定义变量内容
|
||||
const columnControlRef = ref<any>()
|
||||
const searchFormRef = ref()
|
||||
const showSearch = ref(true)
|
||||
const schoolYearList = ref<any[]>([])
|
||||
const schoolTermList = ref<any[]>([])
|
||||
const deptList = ref<any[]>([])
|
||||
const classList = ref<any[]>([])
|
||||
const detailDialogVisible = ref(false)
|
||||
const detailInfo = ref<any>({})
|
||||
const unuploadStudents = ref('')
|
||||
|
||||
// 统计数据
|
||||
const totalStats = ref({
|
||||
totalClasses: 0,
|
||||
totalPapers: 0,
|
||||
totalUpload: 0,
|
||||
totalUnupload: 0
|
||||
})
|
||||
|
||||
// 表格列配置
|
||||
const tableColumns = [
|
||||
{ prop: 'virtualClassNo', label: '班号', icon: Grid, minWidth: 100 },
|
||||
{ prop: 'deptName', label: '学院', icon: OfficeBuilding, minWidth: 150 },
|
||||
{ prop: 'classMasterName', label: '班主任', icon: UserFilled, minWidth: 100 },
|
||||
{ prop: 'paperCount', label: '论文总数', icon: Document, minWidth: 100 },
|
||||
{ prop: 'uploadCount', label: '已上传', icon: Document, minWidth: 100 },
|
||||
{ prop: 'unuploadCount', label: '未上传', icon: Document, minWidth: 100, type: 'warning' },
|
||||
{ prop: 'addScoreCount', label: '加分次数', icon: Document, minWidth: 100 },
|
||||
{ prop: 'totalPage', label: '总页码', icon: Document, minWidth: 100 },
|
||||
{ prop: 'uploadStatus', label: '上传状态', icon: Tickets, minWidth: 100 }
|
||||
]
|
||||
|
||||
// 使用表格列控制 Hook
|
||||
const {
|
||||
visibleColumns,
|
||||
visibleColumnsSorted,
|
||||
checkColumnVisible,
|
||||
handleColumnChange,
|
||||
handleColumnOrderChange
|
||||
} = useTableColumnControl(tableColumns)
|
||||
|
||||
// 配置 useTable
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {},
|
||||
pageList: getSummaryList,
|
||||
props: {
|
||||
item: 'records',
|
||||
totalCount: 'total'
|
||||
}
|
||||
})
|
||||
|
||||
// table hook
|
||||
const {
|
||||
getDataList,
|
||||
currentChangeHandle,
|
||||
sizeChangeHandle,
|
||||
tableStyle
|
||||
} = useTable(state)
|
||||
|
||||
// 搜索表单
|
||||
const searchForm = reactive({
|
||||
schoolYear: '',
|
||||
schoolTerm: '',
|
||||
deptName: '',
|
||||
classNo: ''
|
||||
})
|
||||
|
||||
// 查询
|
||||
const handleSearch = async () => {
|
||||
// 将searchForm转换为DTO格式
|
||||
const dto = {
|
||||
schoolYear: searchForm.schoolYear,
|
||||
schoolTerm: searchForm.schoolTerm,
|
||||
deptName: searchForm.deptName,
|
||||
classNo: searchForm.classNo
|
||||
}
|
||||
const res = await getSummaryList(dto)
|
||||
if (res.data) {
|
||||
state.dataList = Array.isArray(res.data) ? res.data : []
|
||||
// 计算统计数据
|
||||
calculateStats(state.dataList)
|
||||
}
|
||||
}
|
||||
|
||||
// 重置
|
||||
const handleReset = () => {
|
||||
searchFormRef.value?.resetFields()
|
||||
searchForm.schoolYear = ''
|
||||
searchForm.schoolTerm = ''
|
||||
searchForm.deptName = ''
|
||||
searchForm.classNo = ''
|
||||
handleSearch()
|
||||
}
|
||||
|
||||
// 计算统计数据
|
||||
const calculateStats = (data: any[]) => {
|
||||
totalStats.value = {
|
||||
totalClasses: data.length,
|
||||
totalPapers: data.reduce((sum, item) => sum + (item.paperCount || 0), 0),
|
||||
totalUpload: data.reduce((sum, item) => sum + (item.uploadCount || 0), 0),
|
||||
totalUnupload: data.reduce((sum, item) => sum + (item.unuploadCount || 0), 0)
|
||||
}
|
||||
}
|
||||
|
||||
// 查看详情
|
||||
const handleViewDetail = (row: any) => {
|
||||
detailInfo.value = { ...row }
|
||||
// TODO: 获取未交学生名单
|
||||
unuploadStudents.value = '暂无详细信息'
|
||||
detailDialogVisible.value = true
|
||||
}
|
||||
|
||||
// 获取学年列表
|
||||
const getSchoolYearList = async () => {
|
||||
try {
|
||||
const res = await queryAllSchoolYear()
|
||||
if (res.data && Array.isArray(res.data)) {
|
||||
schoolYearList.value = res.data
|
||||
} else {
|
||||
schoolYearList.value = []
|
||||
}
|
||||
} catch (err) {
|
||||
schoolYearList.value = []
|
||||
}
|
||||
}
|
||||
|
||||
// 获取学期字典
|
||||
const getSchoolTermDict = async () => {
|
||||
try {
|
||||
const res = await getDicts('school_term')
|
||||
if (res.data && Array.isArray(res.data)) {
|
||||
schoolTermList.value = res.data.map((item: any) => ({
|
||||
label: item.label || item.dictLabel || item.name,
|
||||
value: item.value || item.dictValue || item.code
|
||||
}))
|
||||
} else {
|
||||
schoolTermList.value = []
|
||||
}
|
||||
} catch (err) {
|
||||
schoolTermList.value = []
|
||||
}
|
||||
}
|
||||
|
||||
// 获取学院列表
|
||||
const getDeptListData = async () => {
|
||||
try {
|
||||
const res = await getDeptList()
|
||||
if (res.data && Array.isArray(res.data)) {
|
||||
deptList.value = res.data
|
||||
} else {
|
||||
deptList.value = []
|
||||
}
|
||||
} catch (err) {
|
||||
deptList.value = []
|
||||
}
|
||||
}
|
||||
|
||||
// 获取班号列表
|
||||
const getClassListData = async () => {
|
||||
try {
|
||||
const res = await getClassListByRole()
|
||||
if (res.data && Array.isArray(res.data)) {
|
||||
classList.value = res.data
|
||||
} else {
|
||||
classList.value = []
|
||||
}
|
||||
} catch (err) {
|
||||
classList.value = []
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化
|
||||
onMounted(() => {
|
||||
getSchoolYearList()
|
||||
getSchoolTermDict()
|
||||
getDeptListData()
|
||||
getClassListData()
|
||||
// 默认查询当前学期数据
|
||||
handleSearch()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import '/@/assets/styles/modern-page.scss';
|
||||
|
||||
.stat-card {
|
||||
.stat-item {
|
||||
.stat-label {
|
||||
font-size: 14px;
|
||||
color: #909399;
|
||||
display: block;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.stat-value {
|
||||
font-size: 28px;
|
||||
font-weight: bold;
|
||||
color: #303133;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -81,6 +81,12 @@
|
||||
安全教育列表
|
||||
</span>
|
||||
<div class="header-actions">
|
||||
<el-button
|
||||
icon="DataAnalysis"
|
||||
type="success"
|
||||
@click="handleStatistics">
|
||||
统计汇总
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Plus"
|
||||
type="primary"
|
||||
@@ -235,13 +241,87 @@
|
||||
|
||||
<!-- 查看详情弹窗 -->
|
||||
<detail-dialog ref="detailDialogRef" />
|
||||
|
||||
<!-- 统计对话框 -->
|
||||
<el-dialog
|
||||
v-model="statisticsDialogVisible"
|
||||
title="安全教育统计汇总"
|
||||
width="800px"
|
||||
destroy-on-close>
|
||||
<!-- 搜索条件 -->
|
||||
<el-form :inline="true" class="statistics-form">
|
||||
<el-form-item label="学年">
|
||||
<el-select
|
||||
v-model="statisticsQuery.schoolYear"
|
||||
placeholder="请选择学年"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 180px">
|
||||
<el-option
|
||||
v-for="item in schoolYearList"
|
||||
:key="item.year"
|
||||
:label="item.year"
|
||||
:value="item.year">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="学期">
|
||||
<el-select
|
||||
v-model="statisticsQuery.schoolTerm"
|
||||
placeholder="请选择学期"
|
||||
clearable
|
||||
style="width: 180px">
|
||||
<el-option
|
||||
v-for="item in schoolTermList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="getStatisticsData">查询</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!-- 统计表格 -->
|
||||
<el-table
|
||||
:data="statisticsData"
|
||||
v-loading="statisticsLoading"
|
||||
stripe
|
||||
max-height="400px"
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle">
|
||||
<el-table-column type="index" label="序号" width="70" align="center" />
|
||||
<el-table-column prop="classNo" label="班号" align="center" />
|
||||
<el-table-column prop="schoolYear" label="学年" align="center" />
|
||||
<el-table-column prop="schoolTerm" label="学期" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag size="small" type="primary" effect="plain" round>
|
||||
{{ formatSchoolTerm(row.schoolTerm) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="eduCount" label="安全教育次数" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag size="small" type="success" effect="plain" round>
|
||||
{{ row.eduCount }} 次
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<template #footer>
|
||||
<el-button @click="statisticsDialogVisible = false">关闭</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="ClassSafeEdu">
|
||||
import { reactive, ref, onMounted } from 'vue'
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { fetchList, delObj, exportExcel } from "/@/api/stuwork/classsafeedu";
|
||||
import { fetchList, delObj, exportExcel, statisticsByYearTerm } from "/@/api/stuwork/classsafeedu";
|
||||
import { getClassListByRole } from "/@/api/basic/basicclass";
|
||||
import { queryAllSchoolYear } from "/@/api/basic/basicyear";
|
||||
import { getDicts } from "/@/api/admin/dict";
|
||||
@@ -249,7 +329,7 @@ import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import TableColumnControl from '/@/components/TableColumnControl/index.vue'
|
||||
import FormDialog from './form.vue'
|
||||
import DetailDialog from './detail.vue'
|
||||
import { List, Calendar, Clock, Grid, Trophy, User, Location, UserFilled, Setting, Menu, Search, Document } from '@element-plus/icons-vue'
|
||||
import { List, Calendar, Clock, Grid, Trophy, User, Location, UserFilled, Setting, Menu, Search, Document, DataAnalysis } from '@element-plus/icons-vue'
|
||||
import { useTableColumnControl } from '/@/hooks/tableColumn'
|
||||
|
||||
// 定义变量内容
|
||||
@@ -262,6 +342,15 @@ const schoolYearList = ref<any[]>([])
|
||||
const schoolTermList = ref<any[]>([])
|
||||
const classList = ref<any[]>([])
|
||||
|
||||
// 统计相关变量
|
||||
const statisticsDialogVisible = ref(false)
|
||||
const statisticsLoading = ref(false)
|
||||
const statisticsData = ref<any[]>([])
|
||||
const statisticsQuery = reactive({
|
||||
schoolYear: '',
|
||||
schoolTerm: ''
|
||||
})
|
||||
|
||||
// 表格列配置
|
||||
const tableColumns = [
|
||||
{ prop: 'schoolYear', label: '学年', icon: Calendar },
|
||||
@@ -449,6 +538,40 @@ const getClassListData = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 打开统计对话框
|
||||
const handleStatistics = () => {
|
||||
// 使用当前搜索条件的学年和学期
|
||||
statisticsQuery.schoolYear = state.queryForm.schoolYear || ''
|
||||
statisticsQuery.schoolTerm = state.queryForm.schoolTerm || ''
|
||||
statisticsData.value = []
|
||||
statisticsDialogVisible.value = true
|
||||
}
|
||||
|
||||
// 获取统计数据
|
||||
const getStatisticsData = async () => {
|
||||
// 必须选择学年或学期才能查询
|
||||
if (!statisticsQuery.schoolYear && !statisticsQuery.schoolTerm) {
|
||||
useMessage().warning('请选择学年或学期进行查询')
|
||||
return
|
||||
}
|
||||
statisticsLoading.value = true
|
||||
try {
|
||||
const res = await statisticsByYearTerm(
|
||||
statisticsQuery.schoolYear || undefined,
|
||||
statisticsQuery.schoolTerm || undefined
|
||||
)
|
||||
if (res.data && Array.isArray(res.data)) {
|
||||
statisticsData.value = res.data
|
||||
} else {
|
||||
statisticsData.value = []
|
||||
}
|
||||
} catch (err) {
|
||||
statisticsData.value = []
|
||||
} finally {
|
||||
statisticsLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化
|
||||
onMounted(() => {
|
||||
getSchoolYearList()
|
||||
|
||||
@@ -107,6 +107,20 @@
|
||||
@click="formDialogRef.openDialog()">
|
||||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Plus"
|
||||
type="warning"
|
||||
class="ml10"
|
||||
@click="handleInitClassSummary">
|
||||
初始化
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="DataAnalysis"
|
||||
type="success"
|
||||
class="ml10"
|
||||
@click="handleShowStatistics">
|
||||
统计查看
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
class="ml10"
|
||||
@@ -289,13 +303,189 @@
|
||||
|
||||
<!-- 查看详情弹窗 -->
|
||||
<detail-dialog ref="detailDialogRef" />
|
||||
|
||||
<!-- 初始化班级总结弹窗 -->
|
||||
<el-dialog
|
||||
v-model="initDialogVisible"
|
||||
title="初始化班级总结数据"
|
||||
width="600px"
|
||||
:close-on-click-modal="false"
|
||||
draggable>
|
||||
<el-form label-width="120px">
|
||||
<el-form-item label="学年">
|
||||
<el-select
|
||||
v-model="initForm.schoolYear"
|
||||
placeholder="请选择学年"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in schoolYearList"
|
||||
:key="item.year"
|
||||
:label="item.year"
|
||||
:value="item.year">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="学期">
|
||||
<el-select
|
||||
v-model="initForm.schoolTerm"
|
||||
placeholder="请选择学期"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in schoolTermList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="学院">
|
||||
<el-select
|
||||
v-model="initForm.deptCode"
|
||||
placeholder="请选择学院(不选则全部)"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in deptList"
|
||||
:key="item.deptCode"
|
||||
:label="item.deptName"
|
||||
:value="item.deptCode">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-alert
|
||||
title="说明:"
|
||||
type="info"
|
||||
:closable="false"
|
||||
class="mb20">
|
||||
<template #default>
|
||||
<p class="mb10">初始化将为所有非离校班级生成本学年学期的总结数据:</p>
|
||||
<ul class="mb0 pl20">
|
||||
<li>自动获取当前学年学期配置</li>
|
||||
<li>为每个班级生成一条空总结记录</li>
|
||||
<li>基础人数数据初始化为0</li>
|
||||
<li>已存在记录不会重复生成</li>
|
||||
</ul>
|
||||
</template>
|
||||
</el-alert>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="initDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="handleConfirmInit" :loading="initLoading">
|
||||
确 定
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 统计结果弹窗 -->
|
||||
<el-dialog
|
||||
v-model="statisticsDialogVisible"
|
||||
title="班级总结统计"
|
||||
width="900px"
|
||||
:close-on-click-modal="false"
|
||||
draggable>
|
||||
<el-form :model="statisticsSearchForm" :inline="true" class="mb20">
|
||||
<el-form-item label="学年">
|
||||
<el-select
|
||||
v-model="statisticsSearchForm.schoolYear"
|
||||
placeholder="请选择学年"
|
||||
style="width: 180px">
|
||||
<el-option
|
||||
v-for="item in schoolYearList"
|
||||
:key="item.year"
|
||||
:label="item.year"
|
||||
:value="item.year">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="学期">
|
||||
<el-select
|
||||
v-model="statisticsSearchForm.schoolTerm"
|
||||
placeholder="请选择学期"
|
||||
style="width: 180px">
|
||||
<el-option
|
||||
v-for="item in schoolTermList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="学院">
|
||||
<el-select
|
||||
v-model="statisticsSearchForm.deptCode"
|
||||
placeholder="请选择学院"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 180px">
|
||||
<el-option
|
||||
v-for="item in deptList"
|
||||
:key="item.deptCode"
|
||||
:label="item.deptName"
|
||||
:value="item.deptCode">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="班号">
|
||||
<el-select
|
||||
v-model="statisticsSearchForm.classNo"
|
||||
placeholder="请选择班号"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 180px">
|
||||
<el-option
|
||||
v-for="item in classList"
|
||||
:key="item.classCode"
|
||||
:label="item.classNo"
|
||||
:value="item.classNo">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleSearchStatistics">查询</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="statisticsData"
|
||||
stripe
|
||||
v-loading="statisticsLoading">
|
||||
<el-table-column prop="classNo" label="班号" width="100" />
|
||||
<el-table-column prop="deptName" label="学院" width="150" />
|
||||
<el-table-column prop="teacherRealName" label="班主任" width="100" />
|
||||
<el-table-column prop="hasRecord" label="是否有记录" width="100">
|
||||
<template #default="{ row }">
|
||||
<el-tag
|
||||
v-if="row.hasRecord === 1"
|
||||
size="small"
|
||||
type="success"
|
||||
effect="plain">
|
||||
有
|
||||
</el-tag>
|
||||
<el-tag
|
||||
v-else
|
||||
size="small"
|
||||
type="danger"
|
||||
effect="plain">
|
||||
无
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="statisticsDialogVisible = false">关 闭</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="ClassSummary">
|
||||
import { reactive, ref, onMounted } from 'vue'
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { fetchList, delObj } from "/@/api/stuwork/classsummary";
|
||||
import { fetchList, delObj, initClassSummary, getStatisticsList } from "/@/api/stuwork/classsummary";
|
||||
import { getTeachDept } from "/@/api/basic/basicdept";
|
||||
import { queryAllSchoolYear } from "/@/api/basic/basicyear";
|
||||
import { getClassListByRole } from "/@/api/basic/basicclass";
|
||||
@@ -304,7 +494,7 @@ import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import TableColumnControl from '/@/components/TableColumnControl/index.vue'
|
||||
import FormDialog from './form.vue'
|
||||
import DetailDialog from './detail.vue'
|
||||
import { List, Calendar, Clock, Grid, UserFilled, Male, Female, House, Warning, CircleCheck, Setting, Menu, Search, Document } from '@element-plus/icons-vue'
|
||||
import { List, Calendar, Clock, Grid, UserFilled, Male, Female, House, Warning, CircleCheck, Setting, Menu, Search, Document, Plus, DataAnalysis } from '@element-plus/icons-vue'
|
||||
import { useTableColumnControl } from '/@/hooks/tableColumn'
|
||||
|
||||
// 定义变量内容
|
||||
@@ -319,6 +509,26 @@ const deptList = ref<any[]>([])
|
||||
const classList = ref<any[]>([])
|
||||
const statusList = ref<any[]>([])
|
||||
|
||||
// 初始化对话框
|
||||
const initDialogVisible = ref(false)
|
||||
const initLoading = ref(false)
|
||||
const initForm = ref({
|
||||
schoolYear: '',
|
||||
schoolTerm: '',
|
||||
deptCode: ''
|
||||
})
|
||||
|
||||
// 统计对话框
|
||||
const statisticsDialogVisible = ref(false)
|
||||
const statisticsLoading = ref(false)
|
||||
const statisticsSearchForm = ref({
|
||||
schoolYear: '',
|
||||
schoolTerm: '',
|
||||
deptCode: '',
|
||||
classNo: ''
|
||||
})
|
||||
const statisticsData = ref<any[]>([])
|
||||
|
||||
// 表格列配置
|
||||
const tableColumns = [
|
||||
{ prop: 'schoolYear', label: '学年', icon: Calendar },
|
||||
@@ -508,6 +718,67 @@ onMounted(() => {
|
||||
getClassListData()
|
||||
getStatusDict()
|
||||
})
|
||||
|
||||
// 初始化班级总结
|
||||
const handleInitClassSummary = () => {
|
||||
// 设置默认学年学期
|
||||
if (schoolYearList.value.length > 0) {
|
||||
initForm.value.schoolYear = schoolYearList.value[0].year
|
||||
}
|
||||
if (schoolTermList.value.length > 0) {
|
||||
initForm.value.schoolTerm = schoolTermList.value[0].value
|
||||
}
|
||||
initDialogVisible.value = true
|
||||
}
|
||||
|
||||
// 确认初始化
|
||||
const handleConfirmInit = async () => {
|
||||
if (!initForm.value.schoolYear || !initForm.value.schoolTerm) {
|
||||
useMessage().warning('请选择学年和学期')
|
||||
return
|
||||
}
|
||||
initLoading.value = true
|
||||
try {
|
||||
const res = await initClassSummary(initForm.value)
|
||||
useMessage().success(res.msg || '初始化成功')
|
||||
initDialogVisible.value = false
|
||||
initLoading.value = false
|
||||
getDataList()
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg || '初始化失败')
|
||||
initLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 显示统计对话框
|
||||
const handleShowStatistics = () => {
|
||||
// 设置默认学年学期
|
||||
if (state.queryForm.schoolYear) {
|
||||
statisticsSearchForm.value.schoolYear = state.queryForm.schoolYear
|
||||
}
|
||||
if (state.queryForm.schoolTerm) {
|
||||
statisticsSearchForm.value.schoolTerm = state.queryForm.schoolTerm
|
||||
}
|
||||
statisticsDialogVisible.value = true
|
||||
handleSearchStatistics()
|
||||
}
|
||||
|
||||
// 查询统计
|
||||
const handleSearchStatistics = async () => {
|
||||
if (!statisticsSearchForm.value.schoolYear || !statisticsSearchForm.value.schoolTerm) {
|
||||
useMessage().warning('请选择学年和学期')
|
||||
return
|
||||
}
|
||||
statisticsLoading.value = true
|
||||
try {
|
||||
const res = await getStatisticsList(statisticsSearchForm.value)
|
||||
statisticsData.value = res.data || []
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg || '查询失败')
|
||||
} finally {
|
||||
statisticsLoading.value = false
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
@@ -176,16 +176,105 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<!-- 操作列 -->
|
||||
<el-table-column label="操作" width="180" align="center" fixed="right">
|
||||
<template #header>
|
||||
<el-icon><Setting /></el-icon>
|
||||
<span style="margin-left: 4px">操作</span>
|
||||
</template>
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Trophy" @click="handleAward(scope.row)">评优</el-button>
|
||||
<el-button link type="success" icon="View" @click="handleViewRecord(scope.row)">记录</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
<!-- 评优对话框 -->
|
||||
<el-dialog
|
||||
title="学生评优"
|
||||
v-model="awardDialogVisible"
|
||||
:width="500"
|
||||
:close-on-click-modal="false"
|
||||
draggable>
|
||||
<el-form :model="awardForm" label-width="80px">
|
||||
<el-form-item label="学号">
|
||||
<el-input v-model="awardForm.stuNo" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="姓名">
|
||||
<el-input v-model="awardForm.realName" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="奖项">
|
||||
<el-select
|
||||
v-model="awardForm.ruleName"
|
||||
multiple
|
||||
placeholder="请选择奖项"
|
||||
filterable
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in rewardRuleList"
|
||||
:key="item.id"
|
||||
:label="item.ruleName"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="awardDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="handleAwardSubmit" :loading="awardLoading">确 定</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 评优记录对话框 -->
|
||||
<el-dialog
|
||||
title="评优记录"
|
||||
v-model="recordDialogVisible"
|
||||
:width="600"
|
||||
:close-on-click-modal="false"
|
||||
draggable>
|
||||
<div v-if="currentRow" class="record-header">
|
||||
<el-descriptions :column="2" border size="small">
|
||||
<el-descriptions-item label="学号">{{ currentRow.stuNo }}</el-descriptions-item>
|
||||
<el-descriptions-item label="姓名">{{ currentRow.realName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="学年">{{ queryForm.schoolYear || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="学期">{{ formatSchoolTerm(queryForm.schoolTerm) }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
<el-table
|
||||
:data="rewardRecordList"
|
||||
v-loading="recordLoading"
|
||||
stripe
|
||||
border
|
||||
style="margin-top: 15px;">
|
||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||
<el-table-column prop="ruleId" label="奖项ID" align="center" />
|
||||
<el-table-column prop="ruleName" label="奖项名称" align="center">
|
||||
<template #default="scope">
|
||||
{{ getRuleNameById(scope.row.ruleId) || scope.row.ruleId || '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" label="评选时间" align="center" width="180">
|
||||
<template #default="scope">
|
||||
{{ parseTime(scope.row.createTime, dateTimeFormat) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<template #empty>
|
||||
<el-empty description="暂无评优记录" :image-size="80" />
|
||||
</template>
|
||||
<template #footer>
|
||||
<el-button @click="recordDialogVisible = false">关 闭</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="RewardStudent">
|
||||
import { reactive, ref, onMounted, computed, nextTick } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { fetchList, exportExcel } from "/@/api/stuwork/rewardstudent";
|
||||
import { fetchList, exportExcel, updateStuAward, getStuRewardList, getRewardRuleList } from "/@/api/stuwork/rewardstudent";
|
||||
import { getDeptList } from "/@/api/basic/basicclass";
|
||||
import { queryAllSchoolYear } from "/@/api/basic/basicyear";
|
||||
import { getClassListByRole } from "/@/api/basic/basicclass";
|
||||
@@ -193,7 +282,7 @@ import { getDicts } from "/@/api/admin/dict";
|
||||
import { useMessage } from "/@/hooks/message";
|
||||
import { parseTime } from "/@/utils/formatTime";
|
||||
import TableColumnControl from '/@/components/TableColumnControl/index.vue'
|
||||
import { List, OfficeBuilding, Grid, CreditCard, Avatar, DataAnalysis, Warning, Trophy, Clock, Menu, Search, Document } from '@element-plus/icons-vue'
|
||||
import { List, OfficeBuilding, Grid, CreditCard, Avatar, DataAnalysis, Warning, Trophy, Clock, Menu, Search, Document, Setting, View } from '@element-plus/icons-vue'
|
||||
import { useTableColumnControl } from '/@/hooks/tableColumn'
|
||||
|
||||
const dateTimeFormat = '{y}-{m}-{d} {h}:{i}:{s}'
|
||||
@@ -210,6 +299,24 @@ const schoolTermList = ref<any[]>([])
|
||||
const deptList = ref<any[]>([])
|
||||
const classList = ref<any[]>([])
|
||||
|
||||
// 评优相关
|
||||
const awardDialogVisible = ref(false)
|
||||
const awardLoading = ref(false)
|
||||
const awardForm = reactive({
|
||||
stuNo: '',
|
||||
realName: '',
|
||||
schoolYear: '',
|
||||
schoolTerm: '',
|
||||
ruleName: [] as string[]
|
||||
})
|
||||
const rewardRuleList = ref<any[]>([])
|
||||
|
||||
// 评优记录相关
|
||||
const recordDialogVisible = ref(false)
|
||||
const recordLoading = ref(false)
|
||||
const currentRow = ref<any>(null)
|
||||
const rewardRecordList = ref<any[]>([])
|
||||
|
||||
// 表格列配置
|
||||
const tableColumns = [
|
||||
{ prop: 'departName', label: '学院名称' },
|
||||
@@ -391,12 +498,88 @@ const getClassListData = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取奖项规则列表
|
||||
const getRewardRuleListData = async () => {
|
||||
try {
|
||||
const res = await getRewardRuleList()
|
||||
if (res.data && Array.isArray(res.data)) {
|
||||
rewardRuleList.value = res.data
|
||||
} else {
|
||||
rewardRuleList.value = []
|
||||
}
|
||||
} catch (err) {
|
||||
rewardRuleList.value = []
|
||||
}
|
||||
}
|
||||
|
||||
// 根据ruleId获取奖项名称
|
||||
const getRuleNameById = (ruleId: string) => {
|
||||
const rule = rewardRuleList.value.find(item => item.id === ruleId)
|
||||
return rule ? rule.ruleName : null
|
||||
}
|
||||
|
||||
// 打开评优对话框
|
||||
const handleAward = (row: any) => {
|
||||
if (!queryForm.schoolYear || !queryForm.schoolTerm) {
|
||||
useMessage().warning('请先选择学年 and 学期')
|
||||
return
|
||||
}
|
||||
awardForm.stuNo = row.stuNo
|
||||
awardForm.realName = row.realName
|
||||
awardForm.schoolYear = queryForm.schoolYear
|
||||
awardForm.schoolTerm = queryForm.schoolTerm
|
||||
// 如果已有奖项,设置默认值
|
||||
awardForm.ruleName = row.ruleName && Array.isArray(row.ruleName) ? [...row.ruleName] : []
|
||||
awardDialogVisible.value = true
|
||||
}
|
||||
|
||||
// 提交评优
|
||||
const handleAwardSubmit = async () => {
|
||||
awardLoading.value = true
|
||||
try {
|
||||
await updateStuAward(awardForm)
|
||||
useMessage().success('评优成功')
|
||||
awardDialogVisible.value = false
|
||||
getDataList()
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg || '评优失败')
|
||||
} finally {
|
||||
awardLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 查看评优记录
|
||||
const handleViewRecord = async (row: any) => {
|
||||
if (!queryForm.schoolYear || !queryForm.schoolTerm) {
|
||||
useMessage().warning('请先选择学年 and 学期')
|
||||
return
|
||||
}
|
||||
currentRow.value = row
|
||||
recordDialogVisible.value = true
|
||||
recordLoading.value = true
|
||||
rewardRecordList.value = []
|
||||
try {
|
||||
const res = await getStuRewardList(row.stuNo, queryForm.schoolYear, queryForm.schoolTerm)
|
||||
if (res.data && Array.isArray(res.data)) {
|
||||
rewardRecordList.value = res.data
|
||||
} else {
|
||||
rewardRecordList.value = []
|
||||
}
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg || '获取记录失败')
|
||||
rewardRecordList.value = []
|
||||
} finally {
|
||||
recordLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化
|
||||
onMounted(() => {
|
||||
getSchoolYearList()
|
||||
getSchoolTermDict()
|
||||
getDeptListData()
|
||||
getClassListData()
|
||||
getRewardRuleListData()
|
||||
getDataList()
|
||||
nextTick(() => {
|
||||
if (visibleColumns.value.length === 0) {
|
||||
@@ -407,5 +590,9 @@ onMounted(() => {
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import '/@/assets/styles/modern-page.scss';
|
||||
|
||||
.record-header {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@@ -70,6 +70,13 @@
|
||||
@click="formDialogRef.openDialog()">
|
||||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="DataAnalysis"
|
||||
type="warning"
|
||||
class="ml10"
|
||||
@click="handleStats">
|
||||
社团统计
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
class="ml10"
|
||||
@@ -190,6 +197,51 @@
|
||||
|
||||
<!-- 查看成员弹窗 -->
|
||||
<member-dialog ref="memberDialogRef" />
|
||||
|
||||
<!-- 社团统计弹窗 -->
|
||||
<el-dialog
|
||||
title="社团统计"
|
||||
v-model="statsDialogVisible"
|
||||
:width="700"
|
||||
:close-on-click-modal="false"
|
||||
draggable>
|
||||
<el-table
|
||||
:data="statsData"
|
||||
v-loading="statsLoading"
|
||||
stripe
|
||||
border
|
||||
max-height="400">
|
||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||
<el-table-column prop="deptName" label="学院名称" align="center" min-width="150" />
|
||||
<el-table-column prop="associationCount" label="社团数量" align="center" width="120">
|
||||
<template #default="scope">
|
||||
<el-tag :type="scope.row.associationCount > 0 ? 'success' : 'info'" effect="plain">
|
||||
{{ scope.row.associationCount }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 统计汇总 -->
|
||||
<div v-if="statsData.length > 0" class="stats-summary">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<div class="summary-item">
|
||||
<span class="label">学院总数:</span>
|
||||
<span class="value">{{ statsData.length }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="summary-item">
|
||||
<span class="label">社团总数:</span>
|
||||
<span class="value highlight">{{ totalAssociationCount }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<template #footer>
|
||||
<el-button @click="statsDialogVisible = false">关 闭</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -197,7 +249,7 @@
|
||||
import { reactive, ref, onMounted, computed, nextTick } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { fetchList, delObj } from "/@/api/stuwork/stuassociation";
|
||||
import { fetchList, delObj, getAssociationStats } from "/@/api/stuwork/stuassociation";
|
||||
import { getDeptList } from "/@/api/basic/basicclass";
|
||||
import { getDicts } from "/@/api/admin/dict";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
@@ -207,7 +259,7 @@ import FormDialog from './form.vue'
|
||||
import MemberDialog from './member.vue'
|
||||
import {
|
||||
List, Trophy, OfficeBuilding, User, UserFilled, Calendar,
|
||||
Phone, Collection, Document, Files, Setting, Menu, Search
|
||||
Phone, Collection, Document, Files, Setting, Menu, Search, DataAnalysis
|
||||
} from '@element-plus/icons-vue'
|
||||
import { useTableColumnControl } from '/@/hooks/tableColumn'
|
||||
|
||||
@@ -222,6 +274,11 @@ const showSearch = ref(true)
|
||||
const deptList = ref<any[]>([])
|
||||
const typeList = ref<any[]>([])
|
||||
|
||||
// 社团统计相关
|
||||
const statsDialogVisible = ref(false)
|
||||
const statsLoading = ref(false)
|
||||
const statsData = ref<any[]>([])
|
||||
|
||||
// 表格列配置
|
||||
const tableColumns = [
|
||||
{ prop: 'associationName', label: '社团名称', minWidth: 200 },
|
||||
@@ -362,6 +419,31 @@ const getTypeDict = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 社团统计
|
||||
const handleStats = async () => {
|
||||
statsDialogVisible.value = true
|
||||
statsLoading.value = true
|
||||
statsData.value = []
|
||||
try {
|
||||
const res = await getAssociationStats()
|
||||
if (res.data && Array.isArray(res.data)) {
|
||||
statsData.value = res.data
|
||||
} else {
|
||||
statsData.value = []
|
||||
}
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg || '获取统计数据失败')
|
||||
statsData.value = []
|
||||
} finally {
|
||||
statsLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 社团总数计算
|
||||
const totalAssociationCount = computed(() => {
|
||||
return statsData.value.reduce((sum, item) => sum + (item.associationCount || 0), 0)
|
||||
})
|
||||
|
||||
// 初始化
|
||||
onMounted(() => {
|
||||
getDeptListData()
|
||||
@@ -375,5 +457,32 @@ onMounted(() => {
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import '/@/assets/styles/modern-page.scss';
|
||||
|
||||
.stats-summary {
|
||||
margin-top: 15px;
|
||||
padding: 15px;
|
||||
background: #f5f7fa;
|
||||
border-radius: 4px;
|
||||
|
||||
.summary-item {
|
||||
text-align: center;
|
||||
|
||||
.label {
|
||||
color: #909399;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.value {
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
margin-left: 5px;
|
||||
color: #409eff;
|
||||
|
||||
&.highlight {
|
||||
color: #67c23a;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@@ -107,6 +107,13 @@
|
||||
@click="formDialogRef.openDialog()">
|
||||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Upload"
|
||||
type="success"
|
||||
class="ml10"
|
||||
@click="handleImport">
|
||||
导入
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
class="ml10"
|
||||
@@ -230,6 +237,46 @@
|
||||
|
||||
<!-- 处理结果对话框 -->
|
||||
<result-dialog ref="resultDialogRef" @refresh="getDataList" />
|
||||
|
||||
<!-- 导入对话框 -->
|
||||
<el-dialog
|
||||
title="导入心理健康数据"
|
||||
v-model="importDialogVisible"
|
||||
:width="500"
|
||||
:close-on-click-modal="false"
|
||||
draggable>
|
||||
<div style="margin-bottom: 15px;">
|
||||
<el-button
|
||||
icon="Download"
|
||||
type="success"
|
||||
@click="handleDownloadTemplate">
|
||||
下载模板
|
||||
</el-button>
|
||||
</div>
|
||||
<el-upload
|
||||
ref="uploadRef"
|
||||
:auto-upload="false"
|
||||
:on-change="handleFileChange"
|
||||
:limit="1"
|
||||
accept=".xlsx,.xls"
|
||||
drag>
|
||||
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
||||
<div class="el-upload__text">
|
||||
将文件拖到此处,或<em>点击上传</em>
|
||||
</div>
|
||||
<template #tip>
|
||||
<div class="el-upload__tip">
|
||||
只能上传 xlsx/xls 文件
|
||||
</div>
|
||||
</template>
|
||||
</el-upload>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="importDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="handleImportSubmit" :disabled="!importFile || importLoading">确 认</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -237,7 +284,7 @@
|
||||
import { reactive, ref, onMounted, computed, nextTick } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { fetchList, delObj } from "/@/api/stuwork/stucare";
|
||||
import { fetchList, delObj, importExcel, downloadTemplate } from "/@/api/stuwork/stucare";
|
||||
import { getDeptList } from "/@/api/basic/basicclass";
|
||||
import { queryAllSchoolYear } from "/@/api/basic/basicyear";
|
||||
import { getClassListByRole } from "/@/api/basic/basicclass";
|
||||
@@ -246,7 +293,7 @@ import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import TableColumnControl from '/@/components/TableColumnControl/index.vue'
|
||||
import FormDialog from './form.vue'
|
||||
import ResultDialog from './result.vue'
|
||||
import { List, Calendar, Clock, OfficeBuilding, Grid, Avatar, UserFilled, Phone, Star, Warning, CircleCheck, Setting, Menu, Search, Document } from '@element-plus/icons-vue'
|
||||
import { List, Calendar, Clock, OfficeBuilding, Grid, Avatar, UserFilled, Phone, Star, Warning, CircleCheck, Setting, Menu, Search, Document, UploadFilled } from '@element-plus/icons-vue'
|
||||
import { useTableColumnControl } from '/@/hooks/tableColumn'
|
||||
|
||||
|
||||
@@ -256,12 +303,16 @@ const formDialogRef = ref()
|
||||
const resultDialogRef = ref()
|
||||
const searchFormRef = ref()
|
||||
const columnControlRef = ref<any>()
|
||||
const uploadRef = ref()
|
||||
const showSearch = ref(true)
|
||||
const schoolYearList = ref<any[]>([])
|
||||
const schoolTermList = ref<any[]>([])
|
||||
const deptList = ref<any[]>([])
|
||||
const classList = ref<any[]>([])
|
||||
const careTypeList = ref<any[]>([])
|
||||
const importDialogVisible = ref(false)
|
||||
const importFile = ref<File | null>(null)
|
||||
const importLoading = ref(false)
|
||||
|
||||
// 表格列配置
|
||||
const tableColumns = [
|
||||
@@ -457,6 +508,57 @@ const getCareTypeDict = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 导入
|
||||
const handleImport = () => {
|
||||
importDialogVisible.value = true
|
||||
importFile.value = null
|
||||
uploadRef.value?.clearFiles()
|
||||
}
|
||||
|
||||
// 下载模板
|
||||
const handleDownloadTemplate = async () => {
|
||||
try {
|
||||
const res = await downloadTemplate()
|
||||
const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' })
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a')
|
||||
link.href = url
|
||||
link.download = '心理健康导入模板.xlsx'
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
window.URL.revokeObjectURL(url)
|
||||
document.body.removeChild(link)
|
||||
useMessage().success('模板下载成功')
|
||||
} catch (error) {
|
||||
useMessage().error('模板下载失败')
|
||||
}
|
||||
}
|
||||
|
||||
// 文件变化
|
||||
const handleFileChange = (file: any) => {
|
||||
importFile.value = file.raw
|
||||
}
|
||||
|
||||
// 提交导入
|
||||
const handleImportSubmit = async () => {
|
||||
if (!importFile.value) {
|
||||
useMessage().warning('请选择要导入的文件')
|
||||
return
|
||||
}
|
||||
|
||||
importLoading.value = true
|
||||
try {
|
||||
await importExcel(importFile.value)
|
||||
useMessage().success('导入成功')
|
||||
importDialogVisible.value = false
|
||||
getDataList()
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg || '导入失败')
|
||||
} finally {
|
||||
importLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化
|
||||
onMounted(() => {
|
||||
getSchoolYearList()
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
<el-form-item>
|
||||
<el-button type="primary" plain icon="Search" @click="getDataList">查询</el-button>
|
||||
<el-button icon="Refresh" @click="handleReset">重置</el-button>
|
||||
<el-button type="warning" icon="Bell" @click="handleSendWarning" :loading="warningLoading">发送预警</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
@@ -159,11 +160,11 @@
|
||||
|
||||
<script setup lang="ts" name="StuConductTerm">
|
||||
import { reactive, ref, onMounted, computed } from 'vue'
|
||||
import { getStuConductTerm, queryDataByStuNo } from "/@/api/stuwork/stuconduct";
|
||||
import { getStuConductTerm, queryDataByStuNo, sendConductWarning } from "/@/api/stuwork/stuconduct";
|
||||
import { getClassListByRole } from "/@/api/basic/basicclass";
|
||||
import { queryAllSchoolYear } from "/@/api/basic/basicyear";
|
||||
import { getDicts } from "/@/api/admin/dict";
|
||||
import { useMessage } from "/@/hooks/message";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
|
||||
// 表格样式 - 在组件内部定义,不从外部导入
|
||||
const tableStyle = {
|
||||
@@ -175,6 +176,7 @@ const tableStyle = {
|
||||
const searchFormRef = ref()
|
||||
const showSearch = ref(true)
|
||||
const loading = ref(false)
|
||||
const warningLoading = ref(false)
|
||||
const schoolYearList = ref<any[]>([])
|
||||
const schoolTermList = ref<any[]>([])
|
||||
const classList = ref<any[]>([])
|
||||
@@ -365,6 +367,29 @@ const handleView = async (row: any) => {
|
||||
}
|
||||
}
|
||||
|
||||
// 发送学期操行考核预警
|
||||
const handleSendWarning = async () => {
|
||||
if (!queryForm.schoolYear || !queryForm.schoolTerm) {
|
||||
useMessage().warning('请先选择学年 and 学期')
|
||||
return
|
||||
}
|
||||
|
||||
const { confirm } = useMessageBox()
|
||||
try {
|
||||
await confirm(`确定要发送${queryForm.schoolYear}学年第${queryForm.schoolTerm === '1' ? '一' : '二'}学期操行考核预警吗?将向班主任推送不及格学生(低于60分)的预警通知。`)
|
||||
|
||||
warningLoading.value = true
|
||||
const res = await sendConductWarning(queryForm.schoolYear, queryForm.schoolTerm)
|
||||
useMessage().success(res.msg || '预警通知发送成功')
|
||||
} catch (err: any) {
|
||||
if (err !== 'cancel') {
|
||||
useMessage().error(err.msg || '预警通知发送失败')
|
||||
}
|
||||
} finally {
|
||||
warningLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 获取学年列表
|
||||
const getSchoolYearList = async () => {
|
||||
try {
|
||||
|
||||
@@ -103,6 +103,10 @@
|
||||
毕业学生名单
|
||||
</span>
|
||||
<div class="header-actions">
|
||||
<el-button type="primary" icon="DataAnalysis" @click="handleConfirmScore">学分确认</el-button>
|
||||
<el-button type="success" icon="DataAnalysis" @click="handleConfirmConduct">操行确认</el-button>
|
||||
<el-button type="warning" icon="DataAnalysis" @click="handleConfirmPunish">违纪确认</el-button>
|
||||
<el-button type="info" icon="DataAnalysis" @click="handleConfirmSkill">等级工确认</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
class="ml10"
|
||||
@@ -181,6 +185,61 @@
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
<!-- 确认结果对话框 -->
|
||||
<el-dialog
|
||||
v-model="confirmDialogVisible"
|
||||
:title="confirmTypeLabel"
|
||||
width="800px"
|
||||
destroy-on-close>
|
||||
<div v-loading="confirmLoading">
|
||||
<!-- 统计信息 -->
|
||||
<el-row :gutter="20" class="confirm-stats">
|
||||
<el-col :span="6">
|
||||
<el-statistic title="总人数" :value="confirmResult.totalCount || 0">
|
||||
<template #suffix>
|
||||
<span style="font-size: 12px; color: #909399;">人</span>
|
||||
</template>
|
||||
</el-statistic>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-statistic title="合格人数" :value="confirmResult.qualifiedCount || 0">
|
||||
<template #suffix>
|
||||
<span style="font-size: 12px; color: #67c23a;">人</span>
|
||||
</template>
|
||||
</el-statistic>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-statistic title="不合格人数" :value="confirmResult.unqualifiedCount || 0">
|
||||
<template #suffix>
|
||||
<span style="font-size: 12px; color: #f56c6c;">人</span>
|
||||
</template>
|
||||
</el-statistic>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-divider content-position="left">不合格学生列表</el-divider>
|
||||
|
||||
<!-- 不合格学生表格 -->
|
||||
<el-table
|
||||
:data="confirmResult.unqualifiedList || []"
|
||||
stripe
|
||||
max-height="350px"
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle">
|
||||
<el-table-column type="index" label="序号" width="70" align="center" />
|
||||
<el-table-column prop="stuNo" label="学号" align="center" width="120" />
|
||||
<el-table-column prop="realName" label="姓名" align="center" width="100" />
|
||||
<el-table-column prop="classNo" label="班号" align="center" width="120" />
|
||||
<el-table-column prop="reason" label="不合格原因" align="center" min-width="150" />
|
||||
<el-table-column prop="detail" label="详情" align="center" min-width="150" show-overflow-tooltip />
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<el-button @click="confirmDialogVisible = false">关闭</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -188,7 +247,7 @@
|
||||
import { reactive, ref, computed, onMounted } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { BasicTableProps, useTable } from '/@/hooks/table'
|
||||
import { fetchList } from '/@/api/stuwork/stugraducheck'
|
||||
import { fetchList, confirmScore, confirmConduct, confirmPunish, confirmSkill } from '/@/api/stuwork/stugraducheck'
|
||||
import { getDeptList } from '/@/api/basic/basicclass'
|
||||
import TableColumnControl from '/@/components/TableColumnControl/index.vue'
|
||||
import {
|
||||
@@ -198,9 +257,11 @@ import {
|
||||
Document,
|
||||
Menu,
|
||||
Search,
|
||||
Grid
|
||||
Grid,
|
||||
DataAnalysis
|
||||
} from '@element-plus/icons-vue'
|
||||
import { useTableColumnControl } from '/@/hooks/tableColumn'
|
||||
import { useMessage } from '/@/hooks/message'
|
||||
|
||||
const route = useRoute()
|
||||
const searchFormRef = ref()
|
||||
@@ -208,6 +269,26 @@ const columnControlRef = ref<any>()
|
||||
const showSearch = ref(true)
|
||||
const deptList = ref<any[]>([])
|
||||
|
||||
// 确认对话框相关变量
|
||||
const confirmDialogVisible = ref(false)
|
||||
const confirmLoading = ref(false)
|
||||
const confirmResult = ref<any>({
|
||||
confirmType: '',
|
||||
totalCount: 0,
|
||||
qualifiedCount: 0,
|
||||
unqualifiedCount: 0,
|
||||
unqualifiedList: []
|
||||
})
|
||||
const confirmTypeLabel = computed(() => {
|
||||
const map: Record<string, string> = {
|
||||
score: '学分确认',
|
||||
conduct: '操行确认',
|
||||
punish: '违纪确认',
|
||||
skill: '等级工确认'
|
||||
}
|
||||
return map[confirmResult.value.confirmType] || '确认结果'
|
||||
})
|
||||
|
||||
// 毕业年份:当前年前后各 5 年
|
||||
const graduYearOptions = computed(() => {
|
||||
const y = new Date().getFullYear()
|
||||
@@ -299,6 +380,86 @@ const loadDeptList = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 学分确认
|
||||
const handleConfirmScore = async () => {
|
||||
if (!searchForm.graduYear) {
|
||||
useMessage().warning('请先选择毕业年份')
|
||||
return
|
||||
}
|
||||
confirmLoading.value = true
|
||||
confirmDialogVisible.value = true
|
||||
try {
|
||||
const res = await confirmScore(searchForm.graduYear)
|
||||
if (res.data) {
|
||||
confirmResult.value = res.data
|
||||
}
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg || '学分确认失败')
|
||||
} finally {
|
||||
confirmLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 操行确认
|
||||
const handleConfirmConduct = async () => {
|
||||
if (!searchForm.graduYear) {
|
||||
useMessage().warning('请先选择毕业年份')
|
||||
return
|
||||
}
|
||||
confirmLoading.value = true
|
||||
confirmDialogVisible.value = true
|
||||
try {
|
||||
const res = await confirmConduct(searchForm.graduYear)
|
||||
if (res.data) {
|
||||
confirmResult.value = res.data
|
||||
}
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg || '操行确认失败')
|
||||
} finally {
|
||||
confirmLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 违纪确认
|
||||
const handleConfirmPunish = async () => {
|
||||
if (!searchForm.graduYear) {
|
||||
useMessage().warning('请先选择毕业年份')
|
||||
return
|
||||
}
|
||||
confirmLoading.value = true
|
||||
confirmDialogVisible.value = true
|
||||
try {
|
||||
const res = await confirmPunish(searchForm.graduYear)
|
||||
if (res.data) {
|
||||
confirmResult.value = res.data
|
||||
}
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg || '违纪确认失败')
|
||||
} finally {
|
||||
confirmLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 等级工确认
|
||||
const handleConfirmSkill = async () => {
|
||||
if (!searchForm.graduYear) {
|
||||
useMessage().warning('请先选择毕业年份')
|
||||
return
|
||||
}
|
||||
confirmLoading.value = true
|
||||
confirmDialogVisible.value = true
|
||||
try {
|
||||
const res = await confirmSkill(searchForm.graduYear)
|
||||
if (res.data) {
|
||||
confirmResult.value = res.data
|
||||
}
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg || '等级工确认失败')
|
||||
} finally {
|
||||
confirmLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
loadDeptList()
|
||||
})
|
||||
|
||||
@@ -78,6 +78,12 @@
|
||||
学生团组织列表
|
||||
</span>
|
||||
<div class="header-actions">
|
||||
<el-button
|
||||
icon="DataAnalysis"
|
||||
type="info"
|
||||
@click="handleStatistics">
|
||||
团员统计
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="Plus"
|
||||
type="primary"
|
||||
@@ -235,6 +241,47 @@
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 统计对话框 -->
|
||||
<el-dialog
|
||||
v-model="statisticsDialogVisible"
|
||||
title="团员统计"
|
||||
width="700px"
|
||||
destroy-on-close>
|
||||
<!-- 全校总数 -->
|
||||
<div class="statistics-total">
|
||||
<el-statistic title="全校团员总数" :value="statisticsData.totalCount || 0">
|
||||
<template #suffix>
|
||||
<span style="font-size: 14px; color: #909399;">人</span>
|
||||
</template>
|
||||
</el-statistic>
|
||||
</div>
|
||||
|
||||
<el-divider content-position="left">各学院团员统计</el-divider>
|
||||
|
||||
<!-- 各学院统计表格 -->
|
||||
<el-table
|
||||
:data="statisticsData.deptList || []"
|
||||
v-loading="statisticsLoading"
|
||||
stripe
|
||||
max-height="400px"
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle">
|
||||
<el-table-column type="index" label="序号" width="70" align="center" />
|
||||
<el-table-column prop="deptName" label="学院名称" align="center" min-width="150" />
|
||||
<el-table-column prop="count" label="团员人数" align="center" width="120">
|
||||
<template #default="{ row }">
|
||||
<el-tag size="small" type="success" effect="plain" round>
|
||||
{{ row.count }} 人
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<template #footer>
|
||||
<el-button @click="statisticsDialogVisible = false">关闭</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -242,13 +289,13 @@
|
||||
import { reactive, ref, onMounted, computed, nextTick } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { fetchList, delObj, importExcel, exportExcel } from "/@/api/stuwork/stuunionleague";
|
||||
import { fetchList, delObj, importExcel, exportExcel, getStatistics } from "/@/api/stuwork/stuunionleague";
|
||||
import { getClassListByRole } from "/@/api/basic/basicclass";
|
||||
import { getGradeList } from "/@/api/basic/basicclass";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import { parseTime } from "/@/utils/formatTime";
|
||||
import TableColumnControl from '/@/components/TableColumnControl/index.vue'
|
||||
import { UploadFilled, List, OfficeBuilding, Grid, CreditCard, Avatar, Phone, Calendar, Postcard, Briefcase, Setting, Menu, Search, Document } from '@element-plus/icons-vue'
|
||||
import { UploadFilled, List, OfficeBuilding, Grid, CreditCard, Avatar, Phone, Calendar, Postcard, Briefcase, Setting, Menu, Search, Document, DataAnalysis } from '@element-plus/icons-vue'
|
||||
import { useTableColumnControl } from '/@/hooks/tableColumn'
|
||||
|
||||
import type { UploadFile, UploadFiles } from 'element-plus';
|
||||
@@ -267,6 +314,14 @@ const importDialogVisible = ref(false)
|
||||
const importLoading = ref(false)
|
||||
const fileList = ref<UploadFile[]>([])
|
||||
|
||||
// 统计相关变量
|
||||
const statisticsDialogVisible = ref(false)
|
||||
const statisticsLoading = ref(false)
|
||||
const statisticsData = ref<any>({
|
||||
totalCount: 0,
|
||||
deptList: []
|
||||
})
|
||||
|
||||
// 表格列配置
|
||||
const tableColumns = [
|
||||
{ prop: 'deptName', label: '学院名称', minWidth: 150 },
|
||||
@@ -452,6 +507,22 @@ const getGradeListData = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// 打开统计对话框
|
||||
const handleStatistics = async () => {
|
||||
statisticsDialogVisible.value = true
|
||||
statisticsLoading.value = true
|
||||
try {
|
||||
const res = await getStatistics()
|
||||
if (res.data) {
|
||||
statisticsData.value = res.data
|
||||
}
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg || '获取统计数据失败')
|
||||
} finally {
|
||||
statisticsLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// ???
|
||||
onMounted(() => {
|
||||
getClassListData()
|
||||
|
||||
Reference in New Issue
Block a user