This commit is contained in:
BianLzhaoMin 2026-01-30 16:53:43 +08:00
parent 242c5eef65
commit fe4f93d2a6
2 changed files with 59 additions and 8 deletions

View File

@ -37,3 +37,23 @@ export function getAttAbnormalDetailsList(query) {
}) })
} }
// 导出考勤率报表
export function exportAttRateTypeList(query) {
return request({
url: '/system/attRate/exportAttRateTypeList',
method: 'get',
responseType: 'blob',
params: query
})
}
// 导出异常考勤统计
export function exportAbnormalList(query) {
return request({
url: '/system/attRate/exportAttAbnormalList',
method: 'get',
responseType: 'blob',
params: query
})
}

View File

@ -169,7 +169,16 @@
v-show="showSearch" v-show="showSearch"
label-width="auto" label-width="auto"
> >
<el-form-item label="选择月份"> <el-form-item label="年份">
<el-date-picker
clearable
type="year"
value-format="yyyy"
placeholder="请选择年份"
v-model="queryParamsAbnormal.year"
/>
</el-form-item>
<el-form-item label="月份">
<el-date-picker <el-date-picker
clearable clearable
type="month" type="month"
@ -178,7 +187,6 @@
v-model="queryParamsAbnormal.attCurrentMonth" v-model="queryParamsAbnormal.attCurrentMonth"
/> />
</el-form-item> </el-form-item>
<el-form-item label="部门" prop="orgIdList"> <el-form-item label="部门" prop="orgIdList">
<treeselect <treeselect
v-model="queryParamsAbnormal.orgIdList" v-model="queryParamsAbnormal.orgIdList"
@ -204,17 +212,26 @@
icon="el-icon-search" icon="el-icon-search"
size="mini" size="mini"
@click="handleQueryAbnormal" @click="handleQueryAbnormal"
>查询</el-button
> >
</el-form-item> 查询
<el-form-item> </el-button>
<el-button <el-button
type="primary" type="primary"
icon="el-icon-search" icon="el-icon-search"
size="mini" size="mini"
@click="resetQueryAbnormal" @click="resetQueryAbnormal"
>重置</el-button
> >
重置
</el-button>
<el-button
type="warning"
icon="el-icon-download"
size="mini"
@click="handleExportAbnormal"
>
导出
</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table v-loading="loading" :data="abnormalList"> <el-table v-loading="loading" :data="abnormalList">
@ -791,6 +808,8 @@ import {
getLateEarlyAbsentList, getLateEarlyAbsentList,
getAttendanceRateDetail, getAttendanceRateDetail,
getAttAbnormalDetailsList, getAttAbnormalDetailsList,
exportAttRateTypeList,
exportAbnormalList,
} from '@/api/report/attendanceRate' } from '@/api/report/attendanceRate'
import { listDeptTree } from '@/api/system/userInfo' import { listDeptTree } from '@/api/system/userInfo'
@ -1008,6 +1027,7 @@ export default {
queryParamsAbnormal: { queryParamsAbnormal: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
year: '',
attCurrentMonth: new Date() attCurrentMonth: new Date()
.toISOString() .toISOString()
.split('T')[0] .split('T')[0]
@ -1257,15 +1277,25 @@ export default {
delete query['orgIdList'] delete query['orgIdList']
console.log(query) console.log(query)
exportMonthReport(query).then((res) => { exportAttRateTypeList(query).then((res) => {
this.downloadFile({ this.downloadFile({
fileName: `月报表记录_${new Date().getTime()}.xlsx`, fileName: `考勤率报表_${new Date().getTime()}.xlsx`,
fileData: res, fileData: res,
fileType: 'application/vnd.ms-excel;charset=utf-8', fileType: 'application/vnd.ms-excel;charset=utf-8',
}) })
}) })
}, },
handleExportAbnormal() {
let query = _.cloneDeep(this.queryParamsAbnormal)
exportAbnormalList(query).then((res) => {
this.downloadFile({
fileName: `异常考勤统计_${new Date().getTime()}.xlsx`,
fileData: res,
fileType: 'application/vnd.ms-excel;charset=utf-8',
})
})
},
/** 更新应该出勤天数按钮操作 */ /** 更新应该出勤天数按钮操作 */
handleDays() { handleDays() {
// //
@ -1434,6 +1464,7 @@ export default {
orgName: undefined, orgName: undefined,
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
year: '',
} }
this.getAbnormalList() this.getAbnormalList()
}, },