22.bdb9527a3012c91a8113.js 9.59 KB
webpackJsonp([22],{Fmgy:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=a("CCn6"),r={props:["dialogObj"],data:function(){return{nowPage:1,total:0,limit:10,classList:[]}},components:{page:a("kmJW").a},methods:{onPageChange:function(t){this.nowPage=t,this.classListOption()},onSizeChange:function(t){this.limit=t,this.nowPage=1,this.classListOption()},classListOption:function(){var t=this;void 0==this.dialogObj.timeValue[0]&&(this.dialogObj.timeValue[0]=""),void 0==this.dialogObj.timeValue[1]&&(this.dialogObj.timeValue[1]="");var e={page:this.nowPage,limit:this.limit,start_at:this.dialogObj.timeValue[0],end_at:this.dialogObj.timeValue[1]};Object(o._136)(e,this.dialogObj.teacher_id).then(function(e){t.classList=e.list,t.total=e.total})}},watch:{"dialogObj.show":function(t){t&&this.classListOption()}}},n={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-dialog",{attrs:{title:t.dialogObj.title,visible:t.dialogObj.show},on:{"update:visible":function(e){t.$set(t.dialogObj,"show",e)}}},[a("el-table",{staticStyle:{width:"100%"},attrs:{data:t.classList}},[a("el-table-column",{attrs:{label:"购买人",className:"f-c",width:"150"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("img",{staticClass:"avatar",attrs:{src:e.row.avatar}}),t._v(" "+t._s(e.row.nickname)),a("br"),t._v("(ID:"+t._s(e.row.user_id)+")\n      ")]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"out_trade_no",label:"交易订单号"}}),t._v(" "),a("el-table-column",{attrs:{prop:"goods_name",label:"商品名字"}}),t._v(" "),a("el-table-column",{attrs:{prop:"money",label:"金额(元)"}}),t._v(" "),a("el-table-column",{attrs:{prop:"pay_at",label:"支付时间"}})],1),t._v(" "),a("page",{attrs:{nowPage:t.nowPage,total:t.total,limit:t.limit},on:{pageChange:t.onPageChange,sizeChange:t.onSizeChange}})],1)},staticRenderFns:[]};var l={name:"index",data:function(){var t=this;return{activeName:"first",firstList:[],secondList:[],searchFirstFrom:{dateValue:[],squad:"11"},today:{text:"今天",onClick:function(){t.searchFirstFrom.dateValue=[t.formatTime(new Date),t.formatTime(new Date)],t.searchSecondFrom.dateValue=[t.formatTime(new Date),t.formatTime(new Date)]}},yesterday:{text:"昨天",onClick:function(){var e=t.formatTime(new Date((new Date).getTime()-864e5));t.searchFirstFrom.dateValue=[e,e],t.searchSecondFrom.dateValue=[e,e]}},last7Day:{text:"过去7天",onClick:function(){var e=t.formatTime(new Date((new Date).getTime()-6048e5));t.searchFirstFrom.dateValue=[e,t.formatTime(new Date)],t.searchSecondFrom.dateValue=[e,t.formatTime(new Date)]}},last30Day:{text:"过去30天",onClick:function(){var e=t.formatTime(new Date((new Date).getTime()-2592e6));t.searchFirstFrom.dateValue=[e,t.formatTime(new Date)],t.searchSecondFrom.dateValue=[e,t.formatTime(new Date)]}},searchSecondFrom:{dateValue:[],squad:"11"},dialogObj:{show:!1,title:"售卖课程",teacher_id:"",timeValue:[]}}},components:{classDialog:a("VU/8")(r,n,!1,function(t){a("Tl5r"),a("RUgJ")},"data-v-519487dc",null).exports},mounted:function(){this.defaultTime(),this.searchFirstPage()},methods:{sortMoney:function(t,e){return Number(t.total_money)-Number(e.total_money)},handleClick:function(t){"first"===t.name?this.searchFirstPage():this.searchSecondPage()},searchFirstPage:function(){var t=this;console.log(216);var e={};this.searchFirstFrom.dateValue&&(e={start_at:this.searchFirstFrom.dateValue[0],end_at:this.searchFirstFrom.dateValue[1]},11!=this.searchFirstFrom.squad&&(e.squad=this.searchFirstFrom.squad)),Object(o._142)(e).then(function(e){var a={teacher_name:"总计",total_money:0,one_to_two:0,one_year:0,three_month:0,two_year:0,tid:0};e.forEach(function(t){a.total_money+=Number(t.total_money),a.one_to_two+=t.one_to_two,a.one_year+=t.one_year,a.three_month+=t.three_month,a.two_year+=t.two_year,a.tid+=t.tid}),a.total_money=a.total_money+".00",e.length>0&&e.unshift(a),t.firstList=e})},searchSecondPage:function(){var t=this,e={};this.searchSecondFrom.dateValue&&(e={start_at:this.searchSecondFrom.dateValue[0],end_at:this.searchSecondFrom.dateValue[1]},11!=this.searchSecondFrom.squad&&(e.squad=this.searchSecondFrom.squad)),Object(o._138)(e).then(function(e){var a={cur_date:"总计",total_money:0,one_to_two:0,one_year:0,three_month:0,two_year:0,tid:0};e.forEach(function(t){a.total_money+=Number(t.total_money),a.one_to_two+=t.one_to_two,a.one_year+=t.one_year,a.three_month+=t.three_month,a.two_year+=t.two_year,a.tid+=t.tid}),a.total_money=a.total_money+".00",e.length>0&&e.unshift(a),t.secondList=e})},formatTime:function(t){var e=t.getFullYear(),a=t.getMonth()+1;a<10&&(a="0"+a);var o=t.getDate();return o<10&&(o="0"+o),e+"-"+a+"-"+o},defaultTime:function(){var t=new Date,e=t.getFullYear(),a=t.getMonth()+1;a<10&&(a="0"+a);var o=t.getDate();o<10&&(o="0"+o);var r=e+"-"+a+"-01",n=e+"-"+a+"-"+o;this.searchFirstFrom.dateValue=[r,n],this.searchSecondFrom.dateValue=[r,n]},nameClick:function(t,e){this.dialogObj.teacher_id=t.tid,this.dialogObj.timeValue=void 0!=e?e:[t.cur_date,t.cur_date],this.dialogObj.show=!0}}},s={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("h2",{staticClass:"title"},[t._v("班主任业绩排行")]),t._v(" "),a("el-tabs",{attrs:{type:"card"},on:{"tab-click":t.handleClick},model:{value:t.activeName,callback:function(e){t.activeName=e},expression:"activeName"}},[a("el-tab-pane",{attrs:{label:"业绩总排行",name:"first"}},[a("el-tabs",{staticStyle:{background:"white","padding-top":"10px"},attrs:{type:"card"},on:{"tab-click":t.searchFirstPage},model:{value:t.searchFirstFrom.squad,callback:function(e){t.$set(t.searchFirstFrom,"squad",e)},expression:"searchFirstFrom.squad"}},[a("el-tab-pane",{key:"",attrs:{label:"总排行",name:"11"}}),t._v(" "),t._l(10,function(t){return a("el-tab-pane",{key:t,attrs:{label:"T"+t,name:t.toString()}})})],2),t._v(" "),a("el-form",{ref:"searchFirstFrom",attrs:{inline:"",model:t.searchFirstFrom,"label-width":"100px"}},[a("el-form-item",{attrs:{label:"起止日期"}},[a("el-date-picker",{attrs:{"unlink-panels":"",type:"daterange","picker-options":{shortcuts:[t.today,t.yesterday,t.last7Day,t.last30Day]},"value-format":"yyyy-MM-dd","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期"},on:{change:t.searchFirstPage},model:{value:t.searchFirstFrom.dateValue,callback:function(e){t.$set(t.searchFirstFrom,"dateValue",e)},expression:"searchFirstFrom.dateValue"}})],1),t._v(" "),a("el-form-item",{attrs:{label:""}},[a("el-button",{attrs:{type:"primary"},on:{click:function(e){t.searchFirstPage()}}},[t._v("\n            搜索\n          ")])],1)],1),t._v(" "),a("el-table",{staticStyle:{width:"100%"},attrs:{data:t.firstList}},[a("el-table-column",{attrs:{label:"班主任姓名"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button",{attrs:{type:"text"},on:{click:function(a){t.nameClick(e.row,t.searchFirstFrom.dateValue)}}},[t._v("\n            "+t._s(e.row.teacher_name)+"\n          ")])]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"total_money",label:"销售额","sort-method":t.sortMoney,sortable:!0}}),t._v(" "),a("el-table-column",{attrs:{prop:"three_month",label:"季课",sortable:""}}),t._v(" "),a("el-table-column",{attrs:{prop:"one_year",label:"年课",sortable:""}}),t._v(" "),a("el-table-column",{attrs:{prop:"two_year",label:"2年课",sortable:""}}),t._v(" "),a("el-table-column",{attrs:{prop:"one_to_two",label:"续课",sortable:""}})],1)],1),t._v(" "),a("el-tab-pane",{attrs:{label:"业绩按天排行",name:"second"}},[a("el-tabs",{staticStyle:{background:"white","padding-top":"10px"},attrs:{type:"card"},on:{"tab-click":t.searchSecondPage},model:{value:t.searchSecondFrom.squad,callback:function(e){t.$set(t.searchSecondFrom,"squad",e)},expression:"searchSecondFrom.squad"}},[a("el-tab-pane",{key:"",attrs:{label:"总排行",name:"11"}}),t._v(" "),t._l(10,function(t){return a("el-tab-pane",{key:t,attrs:{label:"T"+t,name:t.toString()}})})],2),t._v(" "),a("el-form",{ref:"searchSecondFrom",attrs:{inline:"",model:t.searchSecondFrom,"label-width":"100px"}},[a("el-form-item",{attrs:{label:"起止日期"}},[a("el-date-picker",{attrs:{"unlink-panels":"",type:"daterange","value-format":"yyyy-MM-dd","picker-options":{shortcuts:[t.today,t.yesterday,t.last7Day,t.last30Day]},"range-separator":"至",shortcuts:[],"start-placeholder":"开始日期","end-placeholder":"结束日期"},on:{change:t.searchSecondPage},model:{value:t.searchSecondFrom.dateValue,callback:function(e){t.$set(t.searchSecondFrom,"dateValue",e)},expression:"searchSecondFrom.dateValue"}})],1),t._v(" "),a("el-form-item",{attrs:{label:""}},[a("el-button",{attrs:{type:"primary"},on:{click:function(e){t.searchSecondPage()}}},[t._v("\n            搜索\n          ")])],1)],1),t._v(" "),a("el-table",{staticStyle:{width:"100%"},attrs:{data:t.secondList}},[a("el-table-column",{attrs:{prop:"cur_date",label:"时间",sortable:""}}),t._v(" "),a("el-table-column",{attrs:{label:"班主任姓名"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button",{attrs:{type:"text"},on:{click:function(a){t.nameClick(e.row)}}},[t._v("\n            "+t._s(e.row.teacher_name)+"\n            ")])]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"total_money",label:"销售额","sort-method":t.sortMoney,sortable:!0}}),t._v(" "),a("el-table-column",{attrs:{prop:"three_month",label:"季课",sortable:""}}),t._v(" "),a("el-table-column",{attrs:{prop:"one_year",label:"年课",sortable:""}}),t._v(" "),a("el-table-column",{attrs:{prop:"two_year",label:"2年课",sortable:""}})],1)],1)],1),t._v(" "),a("class-dialog",{attrs:{dialogObj:t.dialogObj}})],1)},staticRenderFns:[]};var i=a("VU/8")(l,s,!1,function(t){a("QcI/")},"data-v-47976b50",null);e.default=i.exports},"QcI/":function(t,e){},RUgJ:function(t,e){},Tl5r:function(t,e){}});