|
@@ -22,6 +22,7 @@
|
|
<div class="calendarAttendance-title-right">
|
|
<div class="calendarAttendance-title-right">
|
|
<el-button type="primary" size="small" @click="displayExamRules()">考勤规则</el-button>
|
|
<el-button type="primary" size="small" @click="displayExamRules()">考勤规则</el-button>
|
|
<el-button type="primary" size="small" @click="importAttendanceShow()">导入考勤</el-button>
|
|
<el-button type="primary" size="small" @click="importAttendanceShow()">导入考勤</el-button>
|
|
|
|
+ <el-button type="primary" size="small" @click="exportAttendance()" :loading="exportAttendanceLoading">导出考勤</el-button>
|
|
<el-button type="primary" size="small" @click="displayHighTemperatureDaySettings()">高温日设置</el-button>
|
|
<el-button type="primary" size="small" @click="displayHighTemperatureDaySettings()">高温日设置</el-button>
|
|
<el-button type="primary" size="small" @click="displaySpecialDaySettings()">特殊节假日设置</el-button>
|
|
<el-button type="primary" size="small" @click="displaySpecialDaySettings()">特殊节假日设置</el-button>
|
|
</div>
|
|
</div>
|
|
@@ -265,6 +266,7 @@ export default {
|
|
|
|
|
|
haveYouViewedAllOfThem: false,
|
|
haveYouViewedAllOfThem: false,
|
|
user: JSON.parse(sessionStorage.getItem('user')),
|
|
user: JSON.parse(sessionStorage.getItem('user')),
|
|
|
|
+ exportAttendanceLoading: false,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -294,6 +296,30 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 导出考勤
|
|
|
|
+ exportAttendance() {
|
|
|
|
+ this.exportAttendanceLoading = true
|
|
|
|
+ this.http.post('/attendance/exportAttendanceData', {month: this.currentMonth},
|
|
|
|
+ res => {
|
|
|
|
+ this.exportAttendanceLoading = false
|
|
|
|
+ if (res.code == "ok") {
|
|
|
|
+ var filePath = res.data;
|
|
|
|
+ const a = document.createElement('a'); // 创建a标签
|
|
|
|
+ a.setAttribute('download', this.currentMonth + '考勤导出' + '.xlsx');// download属性
|
|
|
|
+ a.setAttribute('href', filePath);// href链接
|
|
|
|
+ a.click(); //自执行点击事件
|
|
|
|
+ a.remove();
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ error => {
|
|
|
|
+ this.exportAttendanceLoading = false
|
|
|
|
+ this.$message({
|
|
|
|
+ message: error,
|
|
|
|
+ type: "error"
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ },
|
|
// 显示考勤规则
|
|
// 显示考勤规则
|
|
displayExamRules() {
|
|
displayExamRules() {
|
|
this.attendanceRulesVisible = true
|
|
this.attendanceRulesVisible = true
|