This commit is contained in:
yaojian
2026-03-09 10:38:05 +08:00
parent b352145e4f
commit f7dee0da5e
13 changed files with 164 additions and 157 deletions

View File

@@ -171,7 +171,8 @@
<script setup lang="ts" name="ActivityInfoSubSignup">
import { reactive, ref, onMounted, computed } from 'vue'
import { BasicTableProps, useTable } from "/@/hooks/table";
import { fetchList, delObj, exportExcel, getActivityInfoList, getActivityInfoSubList } from "/@/api/stuwork/activityinfosubsignup";
import { fetchList, delObj, getActivityInfoList, getActivityInfoSubList } from "/@/api/stuwork/activityinfosubsignup";
import { makeExportActivitySignUpDetailTask } from "/@/api/stuwork/file";
import { useMessage, useMessageBox } from "/@/hooks/message";
import TableColumnControl from '/@/components/TableColumnControl/index.vue'
import { List, Trophy, Document, Files, CreditCard, Avatar, OfficeBuilding, Grid, UserFilled, Phone, Setting, Menu, Search, Document as DocIcon } from '@element-plus/icons-vue'
@@ -282,19 +283,8 @@ const handleDelete = async (row: any) => {
const handleExport = async () => {
exportLoading.value = true
try {
const res = await exportExcel(state.queryForm)
const blob = new Blob([res.data as BlobPart], {
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = url
link.download = `活动报名表_${new Date().getTime()}.xlsx`
document.body.appendChild(link)
link.click()
window.URL.revokeObjectURL(url)
document.body.removeChild(link)
useMessage().success('导出成功')
await makeExportActivitySignUpDetailTask(state.queryForm)
useMessage().success('导出任务已创建,请在文件管理中下载')
} catch (err: any) {
useMessage().error(err.msg || '导出失败')
} finally {

View File

@@ -387,7 +387,8 @@
<script setup lang="ts" name="ClassFeeLog">
import { reactive, ref, onMounted, computed } from 'vue'
import { BasicTableProps, useTable } from "/@/hooks/table";
import { fetchList, delObj, exportExcel, getSummary } from "/@/api/stuwork/classfeelog";
import { fetchList, delObj, getSummary } from "/@/api/stuwork/classfeelog";
import { makeExportClassFundTask } from "/@/api/stuwork/file";
import { getDeptList } from "/@/api/basic/basicclass";
import { queryAllSchoolYear } from "/@/api/basic/basicyear";
import { getClassListByRole } from "/@/api/basic/basicclass";
@@ -513,20 +514,8 @@ const handleViewAttachment = (row: any) => {
// 导出
const handleExport = async () => {
try {
const res = await exportExcel(state.queryForm)
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
const fileName = `班费记录_${new Date().getTime()}.xlsx`
link.setAttribute('download', fileName)
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
window.URL.revokeObjectURL(url)
useMessage().success('导出成功')
await makeExportClassFundTask(state.queryForm)
useMessage().success('导出任务已创建,请在文件管理中下载')
} catch (err: any) {
useMessage().error(err.msg || '导出失败')
}

View File

@@ -321,7 +321,8 @@
<script setup lang="ts" name="ClassSafeEdu">
import { reactive, ref, onMounted } from 'vue'
import { BasicTableProps, useTable } from "/@/hooks/table";
import { fetchList, delObj, exportExcel, statisticsByYearTerm } from "/@/api/stuwork/classsafeedu";
import { fetchList, delObj, statisticsByYearTerm } from "/@/api/stuwork/classsafeedu";
import { makeExportSafetyEducationTask } from "/@/api/stuwork/file";
import { getClassListByRole } from "/@/api/basic/basicclass";
import { queryAllSchoolYear } from "/@/api/basic/basicyear";
import { getDicts } from "/@/api/admin/dict";
@@ -438,31 +439,8 @@ const handleViewImage = (url: string) => {
// 导出
const handleExport = async () => {
try {
const res = await exportExcel(state.queryForm)
// 创建blob对象
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
// 设置文件名
const fileName = `安全教育_${new Date().getTime()}.xlsx`
link.setAttribute('download', fileName)
// 触发下载
document.body.appendChild(link)
link.click()
// 清理
document.body.removeChild(link)
window.URL.revokeObjectURL(url)
useMessage().success('导出成功')
await makeExportSafetyEducationTask(state.queryForm)
useMessage().success('导出任务已创建,请在文件管理中下载')
} catch (err: any) {
useMessage().error(err.msg || '导出失败')
}

View File

@@ -215,11 +215,11 @@ import { ref, reactive, defineAsyncComponent, computed, onMounted, nextTick } fr
import { useRoute } from 'vue-router'
import { BasicTableProps, useTable } from "/@/hooks/table";
import { fetchList, putObj, delObjs } from "/@/api/stuwork/dormreform";
import { makeExportDormReformTask } from "/@/api/stuwork/file";
import { getBuildingList } from "/@/api/stuwork/dormbuilding";
import { getDormRoomDataByBuildingNo } from "/@/api/stuwork/dormroom";
import { useMessage, useMessageBox } from "/@/hooks/message";
import { getDicts } from "/@/api/admin/dict";
import { downBlobFile, adaptationUrl } from "/@/utils/other";
import TableColumnControl from '/@/components/TableColumnControl/index.vue'
// 引入组件
@@ -385,8 +385,13 @@ const handleDelete = async (row: any) => {
}
// 导出
const handleExport = () => {
downBlobFile(adaptationUrl('/stuwork/dormreform/export'), searchForm, '月卫生检查整改.xlsx')
const handleExport = async () => {
try {
await makeExportDormReformTask(searchForm)
useMessage().success('导出任务已创建,请在文件管理中下载')
} catch (err: any) {
useMessage().error(err.msg || '导出失败')
}
}
// 格式化整改结果

View File

@@ -252,10 +252,10 @@ import { ref, reactive, defineAsyncComponent, onMounted, computed, nextTick } fr
import { useRoute } from 'vue-router'
import { BasicTableProps, useTable } from "/@/hooks/table";
import { fetchList, delObj, editDept } from "/@/api/stuwork/dormroom";
import { makeExportDormRoomTask } from "/@/api/stuwork/file";
import { getDeptList } from "/@/api/basic/basicclass";
import { getBuildingList } from "/@/api/stuwork/dormbuilding";
import { useMessage, useMessageBox } from "/@/hooks/message";
import { downBlobFile, adaptationUrl } from "/@/utils/other";
import { getDicts } from "/@/api/admin/dict";
import TableColumnControl from '/@/components/TableColumnControl/index.vue'
@@ -419,12 +419,8 @@ const confirmDeptAssign = async () => {
// 导出
const handleExport = async () => {
try {
await downBlobFile(
adaptationUrl('/stuwork/dormroom/export'),
searchForm,
'宿舍房间.xlsx'
)
useMessage().success('导出成功')
await makeExportDormRoomTask(searchForm)
useMessage().success('导出任务已创建,请在文件管理中下载')
} catch (err: any) {
useMessage().error(err.msg || '导出失败')
}

View File

@@ -1,6 +1,16 @@
<template>
<div class="layout-padding">
<div class="layout-padding-auto layout-padding-view">
<!-- 顶部工具栏 -->
<div class="mb10">
<el-button
icon="Download"
type="primary"
plain
@click="handleExport">
导出
</el-button>
</div>
<!-- 表格 -->
<el-table
:data="state.dataList"
@@ -37,6 +47,7 @@
import { reactive, onMounted } from 'vue'
import { BasicTableProps, useTable } from "/@/hooks/table";
import { queryStudentAbnormal } from "/@/api/stuwork/dormroomstudent";
import { makeExportDormStudentAbnormalTask } from "/@/api/stuwork/file";
import { useMessage } from "/@/hooks/message";
// 配置 useTable
@@ -83,6 +94,16 @@ const handleView = (row: any) => {
// TODO: 实现查看详情功能
}
// 导出
const handleExport = async () => {
try {
await makeExportDormStudentAbnormalTask()
useMessage().success('导出任务已创建,请在文件管理中下载')
} catch (err: any) {
useMessage().error(err?.msg || '导出失败')
}
}
// 初始化
onMounted(() => {
getDataList()

View File

@@ -291,7 +291,12 @@
import { reactive, ref, onMounted, computed, nextTick } from 'vue'
import { useRoute } from 'vue-router'
import { BasicTableProps, useTable } from "/@/hooks/table";
import { fetchList, delObjs, exportEmptyPeopleRoomExcel } from "/@/api/stuwork/dormroomstudent";
import { fetchList, delObjs } from "/@/api/stuwork/dormroomstudent";
import {
makeExportDormStudentTask,
makeExportDormStudentAbnormalTask,
makeExportDormStatisticsTask
} from "/@/api/stuwork/file";
import { getDeptList } from "/@/api/basic/basicclass";
import { getBuildingList } from "/@/api/stuwork/dormbuilding";
import { fetchDormRoomTreeList } from "/@/api/stuwork/dormroom";
@@ -471,23 +476,14 @@ const handleExport = async () => {
stuNo: searchForm.stuNo,
realName: searchForm.realName
}
const res = await exportEmptyPeopleRoomExcel(params)
const blob = res instanceof Blob ? res : new Blob([res as BlobPart], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' })
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = url
link.download = `空宿舍导出_${Date.now()}.xlsx`
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
window.URL.revokeObjectURL(url)
useMessage().success('导出成功')
await makeExportDormStatisticsTask(params)
useMessage().success('导出任务已创建,请在文件管理中下载')
} catch (err: any) {
useMessage().error(err?.msg || '导出失败')
}
}
// 名单导出:与导出共用空 n 人宿舍导出接口,文件名区分
// 名单导出:住宿学生名单导出
const handleExportList = async () => {
try {
const params = {
@@ -500,17 +496,8 @@ const handleExportList = async () => {
stuNo: searchForm.stuNo,
realName: searchForm.realName
}
const res = await exportEmptyPeopleRoomExcel(params)
const blob = res instanceof Blob ? res : new Blob([res as BlobPart], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' })
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = url
link.download = `住宿学生名单_${Date.now()}.xlsx`
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
window.URL.revokeObjectURL(url)
useMessage().success('导出成功')
await makeExportDormStudentTask(params)
useMessage().success('导出任务已创建,请在文件管理中下载')
} catch (err: any) {
useMessage().error(err?.msg || '导出失败')
}

View File

@@ -274,7 +274,8 @@
<script setup lang="ts" name="RewardStudent">
import { reactive, ref, onMounted, computed, nextTick } from 'vue'
import { useRoute } from 'vue-router'
import { fetchList, exportExcel, updateStuAward, getStuRewardList, getRewardRuleList } from "/@/api/stuwork/rewardstudent";
import { fetchList, updateStuAward, getStuRewardList, getRewardRuleList } from "/@/api/stuwork/rewardstudent";
import { makeExportStudentPraiseTask } from "/@/api/stuwork/file";
import { getDeptList } from "/@/api/basic/basicclass";
import { queryAllSchoolYear } from "/@/api/basic/basicyear";
import { getClassListByRole } from "/@/api/basic/basicclass";
@@ -407,31 +408,8 @@ const handleReset = () => {
const handleExport = async () => {
try {
loading.value = true
const res = await exportExcel(queryForm)
// 创建 blob
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
// 设置文件名
const fileName = `奖励学生_${new Date().getTime()}.xlsx`
link.setAttribute('download', fileName)
// 触发下载
document.body.appendChild(link)
link.click()
// 清理
document.body.removeChild(link)
window.URL.revokeObjectURL(url)
useMessage().success('导出成功')
await makeExportStudentPraiseTask(queryForm)
useMessage().success('导出任务已创建,请在文件管理中下载')
} catch (err: any) {
useMessage().error(err.msg || '导出失败')
} finally {

View File

@@ -52,6 +52,8 @@
<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-button type="success" icon="Download" @click="handleDownloadTemplate">导入模板</el-button>
<el-button type="primary" icon="Upload" @click="handleImport">导入考核</el-button>
</el-form-item>
</el-form>
</el-row>
@@ -155,16 +157,50 @@
<el-empty description="暂无考核记录" :image-size="80" />
</template>
</el-dialog>
<!-- 导入操行考核弹窗 -->
<el-dialog
title="导入操行考核数据"
v-model="importDialogVisible"
:width="500"
:close-on-click-modal="false"
draggable>
<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>
<script setup lang="ts" name="StuConductTerm">
import { reactive, ref, onMounted, computed } from 'vue'
import { getStuConductTerm, queryDataByStuNo, sendConductWarning } from "/@/api/stuwork/stuconduct";
import { exportConductAssessmentTemplate, importConductAssessment, downloadBlobFile } from "/@/api/stuwork/file";
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 { UploadFilled } from '@element-plus/icons-vue'
// 表格样式 - 在组件内部定义,不从外部导入
const tableStyle = {
@@ -174,6 +210,7 @@ const tableStyle = {
// 定义变量内容
const searchFormRef = ref()
const uploadRef = ref()
const showSearch = ref(true)
const loading = ref(false)
const warningLoading = ref(false)
@@ -185,6 +222,9 @@ const viewDialogVisible = ref(false)
const viewLoading = ref(false)
const viewRow = ref<any>(null)
const viewDetailList = ref<any[]>([])
const importDialogVisible = ref(false)
const importFile = ref<File | null>(null)
const importLoading = ref(false)
// 查询表单
const queryForm = reactive({
@@ -390,6 +430,51 @@ const handleSendWarning = async () => {
}
}
// 下载导入模板
const handleDownloadTemplate = async () => {
try {
await downloadBlobFile(exportConductAssessmentTemplate(), `操行考核导入模板_${Date.now()}.xlsx`)
} catch (err: any) {
useMessage().error(err?.msg || '下载模板失败')
}
}
// 打开导入弹窗
const handleImport = () => {
importDialogVisible.value = true
importFile.value = null
uploadRef.value?.clearFiles()
}
// 文件选择变化
const handleFileChange = (file: any) => {
importFile.value = file.raw
}
// 提交导入
const handleImportSubmit = async () => {
if (!importFile.value) {
useMessage().warning('请先选择要上传的文件')
return
}
importLoading.value = true
try {
const formData = new FormData()
formData.append('file', importFile.value)
await importConductAssessment(formData)
useMessage().success('导入成功')
importDialogVisible.value = false
importFile.value = null
uploadRef.value?.clearFiles()
getDataList()
} catch (err: any) {
useMessage().error(err.msg || '导入失败')
} finally {
importLoading.value = false
}
}
// 获取学年列表
const getSchoolYearList = async () => {
try {

View File

@@ -340,7 +340,8 @@
import { reactive, ref, onMounted, computed, nextTick } from 'vue'
import { useRoute } from 'vue-router'
import { BasicTableProps, useTable } from "/@/hooks/table";
import { fetchList, exportData, cancelObj } from "/@/api/stuwork/stuleaveapply";
import { fetchList, cancelObj } from "/@/api/stuwork/stuleaveapply";
import { makeExportStudentLeaveTask } from "/@/api/stuwork/file";
import { queryAllSchoolYear } from "/@/api/basic/basicyear";
import { getDicts } from "/@/api/admin/dict";
import { getDeptListByLevelTwo } from "/@/api/basic/basicdept";
@@ -528,18 +529,8 @@ const handleCancel = async (row: any) => {
// 导出
const handleExport = async () => {
try {
const res = await exportData(searchForm)
// 处理返回的文件流
const blob = new Blob([res.data])
const elink = document.createElement('a')
elink.download = '学生请假.xlsx'
elink.style.display = 'none'
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href)
document.body.removeChild(elink)
useMessage().success('导出成功')
await makeExportStudentLeaveTask(searchForm)
useMessage().success('导出任务已创建,请在文件管理中下载')
} catch (err: any) {
useMessage().error(err.msg || '导出失败')
}

View File

@@ -280,7 +280,8 @@
import { reactive, ref, onMounted, computed, nextTick } from 'vue'
import { useRoute } from 'vue-router'
import { BasicTableProps, useTable } from "/@/hooks/table";
import { fetchList, delObj, exportData, revokePunishment, getDetail } from "/@/api/stuwork/stupunlish";
import { fetchList, delObj, revokePunishment, getDetail } from "/@/api/stuwork/stupunlish";
import { makeExportStudentDisciplineTask } from "/@/api/stuwork/file";
import { queryAllSchoolYear } from "/@/api/basic/basicyear";
import { getDicts } from "/@/api/admin/dict";
import { getDeptListByLevelTwo } from "/@/api/basic/basicdept";
@@ -505,18 +506,8 @@ const handleExport = async () => {
delete params.punlishMonth
}
delete params.punlishMonthArray
const res = await exportData(params)
// 下载文件
const blob = new Blob([res.data])
const elink = document.createElement('a')
elink.download = '学生处分.xlsx'
elink.style.display = 'none'
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href)
document.body.removeChild(elink)
useMessage().success('导出成功')
await makeExportStudentDisciplineTask(params)
useMessage().success('导出任务已创建,请在文件管理中下载')
} catch (err: any) {
useMessage().error(err.msg || '导出失败')
}

View File

@@ -257,7 +257,8 @@
import { reactive, ref, onMounted, computed, nextTick } from 'vue'
import { useRoute } from 'vue-router'
import { BasicTableProps, useTable } from "/@/hooks/table";
import { fetchList, delObj, exportData, cancelObj } from "/@/api/stuwork/stuturnover";
import { fetchList, delObj, cancelObj } from "/@/api/stuwork/stuturnover";
import { makeExportStudentChangeTask } from "/@/api/stuwork/file";
import { queryAllSchoolYear } from "/@/api/basic/basicyear";
import { getDicts } from "/@/api/admin/dict";
import { getDeptListByLevelTwo } from "/@/api/basic/basicdept";
@@ -438,18 +439,8 @@ const handleDelete = async (row: any) => {
// 导出
const handleExport = async () => {
try {
const res = await exportData(searchForm)
// 处理返回的文件流
const blob = new Blob([res.data])
const elink = document.createElement('a')
elink.download = '学籍异动.xlsx'
elink.style.display = 'none'
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href)
document.body.removeChild(elink)
useMessage().success('导出成功')
await makeExportStudentChangeTask(searchForm)
useMessage().success('导出任务已创建,请在文件管理中下载')
} catch (err: any) {
useMessage().error(err.msg || '导出失败')
}

View File

@@ -272,6 +272,7 @@ import { reactive, ref, onMounted, computed, nextTick } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { BasicTableProps, useTable } from "/@/hooks/table";
import { fetchList, delObjs, initWaterOrder } from "/@/api/stuwork/waterdetail";
import { makeExportDormWaterElectricityTask } from "/@/api/stuwork/file";
import { getBuildingList } from "/@/api/stuwork/dormbuilding";
import { useMessage, useMessageBox } from "/@/hooks/message";
import TableColumnControl from '/@/components/TableColumnControl/index.vue'
@@ -410,9 +411,13 @@ const handleDelete = async (row: any) => {
}
// 导出
const handleExport = () => {
// TODO: 实现导出
useMessage().warning('功能开发中')
const handleExport = async () => {
try {
await makeExportDormWaterElectricityTask(searchForm)
useMessage().success('导出任务已创建,请在文件管理中下载')
} catch (err: any) {
useMessage().error(err.msg || '导出失败')
}
}
// 统计分析