(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-026cbb1a"],{"09f4":function(e,t,a){"use strict";a.d(t,"a",(function(){return i})),Math.easeInOutQuad=function(e,t,a,n){return e/=n/2,e<1?a/2*e*e+t:(e--,-a/2*(e*(e-2)-1)+t)};var n=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}();function r(e){document.documentElement.scrollTop=e,document.body.parentNode.scrollTop=e,document.body.scrollTop=e}function o(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function i(e,t,a){var i=o(),s=e-i,l=20,c=0;t="undefined"===typeof t?500:t;var u=function e(){c+=l;var o=Math.easeInOutQuad(c,i,s,t);r(o),c1&&3!=t.row.status&&e.permission("/vipReset")?a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.resetVip(t.row)}}},[e._v("修改")]):e._e(),e._v(" "),t.row.vipGroupActivityId<=0&&e.permission("vipGroupManage/update")&&1==t.row.status?a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.isStartCourse(t.row)}}},[e._v("确认成课")]):e._e()],1)]}}])})],1),e._v(" "),a("pagination",{attrs:{sync:"",total:e.rules.total,page:e.rules.page,limit:e.rules.limit,"page-sizes":e.rules.page_size},on:{"update:total":function(t){return e.$set(e.rules,"total",t)},"update:page":function(t){return e.$set(e.rules,"page",t)},"update:limit":function(t){return e.$set(e.rules,"limit",t)},pagination:e.getList}})],1)],1)])},r=[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("h2",[a("div",{staticClass:"squrt"}),e._v("\n VIP/乐理课管理\n ")])}],o=(a("28a5"),a("7f7f"),a("386d"),a("333d")),i=a("7e78"),s=a("1cc7"),l=(a("4360"),a("bc3a")),c=a.n(l),u=a("5f87"),p=a("3908"),d=a("ec8a"),m={components:{pagination:o["a"]},name:"vipList",data:function(){return{organId:null,searchForm:{teacherId:null,activityId:null,search:null,orgin:null,status:null,hasEducationalTeacherId:null},teacherList:[],activeList:[],tableData:[],organList:[],rules:{limit:10,page:1,total:0,page_size:[10,20,40,50]},statusList:[{lable:"未开始",value:"0"},{lable:"报名中",value:"1"},{lable:"报名结束",value:"5"},{lable:"进行中",value:"2"},{lable:"已结束",value:"4"},{lable:"取消",value:"3"},{lable:"暂停",value:"6"}],stopReason:null}},created:function(){},mounted:function(){var e=this.$route.query;e.search&&(this.searchForm.search=e.search),this.init()},activated:function(){this.init()},methods:{init:function(){var e=this;Object(s["eb"])().then((function(t){200==t.code&&(e.organList=t.data)})),Object(i["L"])({organId:this.organId,rows:9999}).then((function(t){200==t.code&&(e.activeList=t.data.rows)})),this.getList()},search:function(){this.rules.page=1,this.getList()},onReSet:function(){this.searchForm={teacherId:null,activityId:null,search:null,orgin:null,status:null},this.getList()},getList:function(){var e=this,t=this.searchForm;t.page=this.rules.page,t.rows=this.rules.limit,t.hasEducationalTeacherId=this.searchForm.hasEducationalTeacherId||null,t.organId=this.searchForm.orgin||null,t.status=this.searchForm.status||null,Object(i["z"])(t).then((function(t){200==t.code&&(setTimeout((function(){e.tableData=t.data.rows}),50),e.rules.total=t.data.total)}))},gotoVipDetail:function(e){JSON.stringify(this.rules),JSON.stringify(this.searchForm);var t=e.id,a=e.name;this.$router.push({path:"/business/vipDetail",query:{id:t,name:a}})},closeVip:function(e){var t=this,a=e.row.id;Object(i["h"])({vipGroupId:a,stopReason:this.stopReason}).then((function(a){200==a.code&&(t.$message.success("停止课程成功"),e._self.$refs[e.$index].doClose(),t.getList())}))},onCancelVip:function(e){this.stopReason=null,e._self.$refs[e.$index].doClose()},gotoBuildVip:function(){JSON.stringify(this.rules),JSON.stringify(this.searchForm);this.$router.push({path:"/business/buildVip"})},onVIPCourseExport:function(){var e=this,t=this.searchForm,a={teacherId:t.teacherId||null,activityId:t.activityId||null,organId:t.orgin||null,status:t.status||null,search:t.search||null},n="/api-web/export/vipGroupList",r={method:"get",headers:{Authorization:Object(u["a"])()},params:a,url:n,responseType:"blob"};this.$confirm("您确定导出VIP课吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){p["a"].startLoading(),c()(r).then((function(t){var a=new Blob([t.data],{type:"application/vnd.ms-excel;charset=utf-8"}),n=new Response(a).text();n.then((function(t){if(-1!=t.indexOf("code")){var n=JSON.parse(t);e.$message.error(n.msg)}else{var r=URL.createObjectURL(a),o=document.createElement("a"),i="VIP列表"+(new Date).getTime()+".xls";o.href=r,o.setAttribute("download",i),document.body.appendChild(o),o.click()}})),p["a"].endLoading()})).catch((function(t){e.$message.error("导出数据失败,请联系管理员"),p["a"].endLoading()}))})).catch((function(){}))},onStudentExport:function(){var e=this,t={},a="/api-web/export/vipGroup",n={method:"get",headers:{Authorization:Object(u["a"])()},params:t,url:a,responseType:"blob"};this.$confirm("VIP课程续费提醒导出?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){p["a"].startLoading(),c()(n).then((function(t){var a=new Blob([t.data],{type:"application/vnd.ms-excel;charset=utf-8"}),n=new Response(a).text();n.then((function(t){if(-1!=t.indexOf("code")){var n=JSON.parse(t);e.$message.error(n.msg)}else{var r=URL.createObjectURL(a),o=document.createElement("a"),i="VIP课程续费提醒"+(new Date).getTime()+".xls";o.href=r,o.setAttribute("download",i),document.body.appendChild(o),o.click()}})),p["a"].endLoading()})).catch((function(t){e.$message.error("导出数据失败,请联系管理员"),p["a"].endLoading()}))})).catch((function(){}))},resetVip:function(e){var t=e.id,a=e.organId,n=e.educationalTeacherId,r=e.userId,o=(JSON.stringify(this.rules),JSON.stringify(this.searchForm),e.name),i=e.coursesExpireDate,s=e.courseStartDate;this.$router.push({path:"/business/vipReset",query:{id:t,educationalTeacherId:n,organId:a,userId:r,name:o,endTimeStr:i,startTimeStr:s}})},onVipDelete:function(e){var t=this;this.$confirm("您确定删除该VIP课吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){Object(i["k"])({vipGroupId:e.id}).then((function(e){200==e.code&&(t.$message.success("删除成功"),t.getList())}))})).catch((function(){}))},permission:function(e){return Object(d["a"])(e)},isStartCourse:function(e){var t=this;this.$confirm("确定开启乐理课","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){Object(i["O"])({id:e.id,status:"PROGRESS"}).then((function(e){200==e.code&&(t.$message.success("提交成功"),t.getList())}))})).catch((function(){}))}},filters:{formatterTime:function(e){var t;return t=e?e.split(" ")[0]:"",t},formatterStatus:function(e){var t=["未开始","报名中","进行中","取消","已结束","报名结束","暂停"];return t[e]}}},f=m,h=(a("1bf7"),a("2877")),v=Object(h["a"])(f,n,r,!1,null,"64fa97af",null);t["default"]=v.exports}}]);