|
@@ -76,6 +76,13 @@
|
|
|
<el-button @click="onReSet"
|
|
|
type="primary">重置</el-button>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <!-- <div class="newBand" @click="onExport">导出</div> -->
|
|
|
+ <el-button @click="onExport"
|
|
|
+ type="primary"
|
|
|
+ v-permission="'export/queryTeacherAttendances'"
|
|
|
+ style="background-color: #14928a; border: 1px solid #14928a;">导出</el-button>
|
|
|
+ </el-form-item>
|
|
|
</el-form>
|
|
|
<div class="tableWrap">
|
|
|
<el-table style="width: 100%"
|
|
@@ -141,7 +148,7 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column align="center"
|
|
|
- label="签到状态">
|
|
|
+ label="签退状态">
|
|
|
<template slot-scope="scope">
|
|
|
<div>
|
|
|
{{scope.row.signOutStatus | attendanceOutType}}
|
|
@@ -167,6 +174,7 @@ import axios from "axios";
|
|
|
import { getToken } from "@/utils/auth";
|
|
|
import pagination from "@/components/Pagination/index";
|
|
|
import load from "@/utils/loading";
|
|
|
+import qs from 'qs'
|
|
|
import { getTeacher, getEmployeeOrgan } from "@/api/buildTeam";
|
|
|
import { queryTeacherAttendances } from "@/api/recodeManager";
|
|
|
import { courseType } from '@/utils/searchArray'
|
|
@@ -258,6 +266,63 @@ export default {
|
|
|
this.courseTime = [nowTime, nowTime];
|
|
|
this.$refs['searchForm'].resetFields();
|
|
|
this.search()
|
|
|
+ },
|
|
|
+ onExport () {
|
|
|
+ let obj = { page: this.rules.page, rows: this.rules.limit }
|
|
|
+ Object.assign(obj, this.searchForm)
|
|
|
+ if (this.courseTime && this.courseTime.length > 0) {
|
|
|
+ obj.courseStartDate = this.courseTime[0]
|
|
|
+ obj.courseEndDate = this.courseTime[1]
|
|
|
+ } else {
|
|
|
+ this.$message.error('请选择搜索时间')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let url = "/api-web/export/queryTeacherAttendances";
|
|
|
+ const options = {
|
|
|
+ method: "POST",
|
|
|
+ headers: {
|
|
|
+ Authorization: getToken()
|
|
|
+ },
|
|
|
+ params: obj,
|
|
|
+ url,
|
|
|
+ responseType: "blob"
|
|
|
+ };
|
|
|
+ this.$confirm("您确定导出课酬列表", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ load.startLoading()
|
|
|
+ axios(options).then(res => {
|
|
|
+ let blob = new Blob([res.data], {
|
|
|
+ // type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
|
|
|
+ type: "application/vnd.ms-excel;charset=utf-8"
|
|
|
+ //word文档为application/msword,pdf文档为application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
|
|
|
+ });
|
|
|
+
|
|
|
+ let text = (new Response(blob)).text()
|
|
|
+ text.then(res => {
|
|
|
+ // 判断是否报错
|
|
|
+ if (res.indexOf('code') != -1) {
|
|
|
+ let json = JSON.parse(res)
|
|
|
+ this.$message.error(json.msg)
|
|
|
+ } else {
|
|
|
+ let objectUrl = URL.createObjectURL(blob);
|
|
|
+ let link = document.createElement("a");
|
|
|
+ let fname = "课酬列表" + new Date().getTime(); //下载文件的名字
|
|
|
+ link.href = objectUrl;
|
|
|
+ link.setAttribute("download", fname);
|
|
|
+ document.body.appendChild(link);
|
|
|
+ link.click();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ load.endLoading();
|
|
|
+ }).catch(error => {
|
|
|
+ this.$message.error('导出数据失败,请联系管理员');
|
|
|
+ load.endLoading();
|
|
|
+ });
|
|
|
+ }).catch(() => { });
|
|
|
}
|
|
|
}
|
|
|
};
|