|
@@ -85,6 +85,10 @@
|
|
|
<el-form-item>
|
|
|
<el-button @click="search" type="danger">搜索</el-button>
|
|
|
<el-button @click="onReSet" type="primary">重置</el-button>
|
|
|
+ <el-button type="primary"
|
|
|
+ v-if="tableData.length > 0"
|
|
|
+ v-permission="'export/courseReviews'"
|
|
|
+ @click="netWorkExport">导出</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div class="tableWrap">
|
|
@@ -254,6 +258,9 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { getToken } from '@/utils/auth'
|
|
|
+import qs from 'qs'
|
|
|
+import axios from 'axios'
|
|
|
import pagination from "@/components/Pagination/index";
|
|
|
import {
|
|
|
getTeacher,
|
|
@@ -443,6 +450,54 @@ export default {
|
|
|
this.searchForm.month.push(startDate);
|
|
|
this.searchForm.month.push(endDate);
|
|
|
this.getList();
|
|
|
+ },
|
|
|
+ netWorkExport(){
|
|
|
+ let url = '/api-web/export/courseReviews '
|
|
|
+ let obj = {};
|
|
|
+ obj.organId = this.searchForm.organId || null;
|
|
|
+ obj.teacherId = this.searchForm.teacherId || null;
|
|
|
+ obj.eduTeacherId = this.searchForm.eduTeacherId || null;
|
|
|
+ obj.isFree = this.searchForm.isFree || null;
|
|
|
+ obj.studentReview = this.searchForm.studentReview || null;
|
|
|
+ obj.hasHandHomework = this.searchForm.hasHandHomework || null;
|
|
|
+ obj.hasReview = this.searchForm.hasReview || null;
|
|
|
+ obj.courseReview = this.searchForm.courseReview || null;
|
|
|
+ obj.search = this.searchForm.search;
|
|
|
+ if(this.searchForm.month.length > 0){
|
|
|
+ obj.startTime = this.searchForm.month[0];
|
|
|
+ obj.endTime = this.searchForm.month[1];
|
|
|
+ }
|
|
|
+ const options = {
|
|
|
+ method: 'get',
|
|
|
+ headers: {
|
|
|
+ 'Authorization': getToken()
|
|
|
+ },
|
|
|
+ data: qs.stringify(obj),
|
|
|
+ url,
|
|
|
+ responseType: 'blob'
|
|
|
+ }
|
|
|
+ this.$confirm('您确定导出评价列表', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ 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 objectUrl = URL.createObjectURL(blob)
|
|
|
+ let link = document.createElement("a")
|
|
|
+ let nowTime = new Date()
|
|
|
+ let ymd = nowTime.getFullYear() + '' + (nowTime.getMonth() + 1) + '' + nowTime.getDate() + '' + nowTime.getHours() + '' + nowTime.getMinutes()
|
|
|
+ let fname = + ymd + '网管评价' //下载文件的名字
|
|
|
+ link.href = objectUrl
|
|
|
+ link.setAttribute("download", fname)
|
|
|
+ document.body.appendChild(link)
|
|
|
+ link.click()
|
|
|
+ })
|
|
|
+ }).catch(() => { })
|
|
|
}
|
|
|
},
|
|
|
filters: {
|