|
@@ -6,6 +6,9 @@
|
|
|
<div class="newBand"
|
|
|
v-permission="'/buildVip'"
|
|
|
@click='gotoBuildVip'>新建VIP课</div>
|
|
|
+
|
|
|
+ <div class="newBand" v-permission="'export/vipGroupList'"
|
|
|
+ @click='onVIPCourseExport'>导出VIP课</div>
|
|
|
<div class='m-core'>
|
|
|
<!-- 搜索类型 -->
|
|
|
<el-form :inline="true"
|
|
@@ -215,6 +218,8 @@ import pagination from '@/components/Pagination/index'
|
|
|
import { getVipList, vipGroupActivity, closeVip, getVipGroupDetail } from '@/api/vipSeting'
|
|
|
import { getTeacher, getEmployeeOrgan } from '@/api/buildTeam'
|
|
|
import store from '@/store'
|
|
|
+import axios from 'axios'
|
|
|
+import { getToken } from '@/utils/auth'
|
|
|
export default {
|
|
|
components: { pagination },
|
|
|
name: 'vipList',
|
|
@@ -327,6 +332,46 @@ export default {
|
|
|
let searchForm = JSON.stringify(this.searchForm)
|
|
|
this.$router.push({ path: '/business/buildVip', query: { rules, searchForm } })
|
|
|
},
|
|
|
+ onVIPCourseExport() { // 导出VIP课
|
|
|
+ let searchForm = this.searchForm
|
|
|
+ let data = {
|
|
|
+ teacherId: searchForm.teacherId || null,
|
|
|
+ activityId: searchForm.activityId || null,
|
|
|
+ organId: searchForm.orgin || null,
|
|
|
+ status: searchForm.status || null,
|
|
|
+ search: searchForm.search || null
|
|
|
+ }
|
|
|
+ let url = '/api-web/export/vipGroupList'
|
|
|
+ const options = {
|
|
|
+ method: 'get',
|
|
|
+ headers: {
|
|
|
+ 'Authorization': getToken()
|
|
|
+ },
|
|
|
+ params: data,
|
|
|
+ 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 fname = 'VIP列表' + new Date().getTime() //下载文件的名字
|
|
|
+ link.href = objectUrl
|
|
|
+ link.setAttribute("download", fname)
|
|
|
+ document.body.appendChild(link)
|
|
|
+ link.click()
|
|
|
+ })
|
|
|
+ }).catch(() => {})
|
|
|
+ },
|
|
|
// 修改vip
|
|
|
resetVip (id) {
|
|
|
let rules = JSON.stringify(this.rules)
|
|
@@ -352,10 +397,13 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
-<style lang="scss" scope>
|
|
|
+<style lang="scss" scoped>
|
|
|
.m-container {
|
|
|
box-sizing: border-box;
|
|
|
background-color: #fff;
|
|
|
// padding: 18px 95px 55px 60px;
|
|
|
}
|
|
|
+.newBand {
|
|
|
+ display: inline-block;
|
|
|
+}
|
|
|
</style>
|