Commit e87874e5 authored by 王's avatar

build

parent fd7a86f4
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><meta name=referrer content=never><link rel=stylesheet href=https://at.alicdn.com/t/font_746649_7dsnjecwkpg.css><title>唱唱启蒙-后台</title><link href=/static/css/app.688b8e18d0964b5a93a68e3dac2d1eb4.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/static/js/manifest.eb36f77cd825d7d5fcdb.js></script><script type=text/javascript src=/static/js/vendor.0b35d0c5581d0a6334a7.js></script><script type=text/javascript src=/static/js/app.5ce842e920319a3aea9e.js></script></body></html>
\ No newline at end of file
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><meta name=referrer content=never><link rel=stylesheet href=https://at.alicdn.com/t/font_746649_7dsnjecwkpg.css><title>唱唱启蒙-后台</title><link href=/static/css/app.34ddabd7d5b43755680c989577a25c44.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/static/js/manifest.e689ed331985778d6947.js></script><script type=text/javascript src=/static/js/vendor.0b35d0c5581d0a6334a7.js></script><script type=text/javascript src=/static/js/app.5ce842e920319a3aea9e.js></script></body></html>
\ No newline at end of file
webpackJsonp([9],{"2Qre":function(t,e){},ayGs:function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=o("CCn6"),n=o("+TkF"),r=o("kmJW"),i={props:["dialogObj"],data:function(){return{nowPage:1,total:0,goodList:[],currentRow:null}},components:{page:r.a},filters:{isOrNot:function(t){return n.h[t]},goodsType:function(t){return n.e[t]},lessonType:function(t){return n.i[t]},goodsStatus:function(t){return n.d[t]}},methods:{initPage:function(){var t=this;Object(a._11)().then(function(e){t.goodList=e.list,t.total=e.total})},handleCurrentChange:function(t){this.currentRow=t},onConfirm:function(){this.$emit("reflash",this.currentRow)}},mounted:function(){this.initPage()}},s={render:function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[o("el-dialog",{attrs:{title:t.dialogObj.title,visible:t.dialogObj.show},on:{"update:visible":function(e){t.$set(t.dialogObj,"show",e)}}},[o("el-table",{staticStyle:{width:"100%"},attrs:{data:t.goodList,"row-key":"id","highlight-current-row":""},on:{"current-change":t.handleCurrentChange}},[o("el-table-column",{attrs:{prop:"id",label:"商品ID"}}),t._v(" "),o("el-table-column",{attrs:{prop:"name",label:"名称"}}),t._v(" "),o("el-table-column",{attrs:{label:"商品类型"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t._f("goodsType")(e.row.goods_type))+"\n ")]}}])}),t._v(" "),o("el-table-column",{attrs:{label:"现价"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.current_price/100)+"元\n ")]}}])}),t._v(" "),o("el-table-column",{attrs:{label:"课程类别"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t._f("lessonType")(e.row.course_type))+"\n ")]}}])}),t._v(" "),o("el-table-column",{attrs:{label:"是否有实物"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t._f("isOrNot")(e.row.is_real))+"\n ")]}}])}),t._v(" "),o("el-table-column",{attrs:{label:"状态"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t._f("goodsStatus")(e.row.status))+"\n ")]}}])})],1),t._v(" "),o("page",{attrs:{nowPage:t.nowPage,total:t.total}}),t._v(" "),o("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:function(e){t.dialogObj.show=!1}}},[t._v("取 消")]),t._v(" "),o("el-button",{attrs:{type:"primary"},on:{click:t.onConfirm}},[t._v("确 定")])],1)],1)],1)},staticRenderFns:[]};var l=o("VU/8")(i,s,!1,function(t){o("wA2S")},"data-v-aa878a4a",null).exports,c={props:["dialogObj"],data:function(){return{loading:!1,form:{},teacherList:[],viewTeacher:"",pickerOptions1:{disabledDate:function(t){return!(t.getTime()>Date.now())}},options:[{value:0,label:"周日"},{value:1,label:"周一"},{value:2,label:"周二"},{value:3,label:"周三"},{value:4,label:"周四"},{value:5,label:"周五"},{value:6,label:"周六"}],teacherOptions:[],goodList:[],itemOptions:[],rules:{title:[{required:!0,message:"请输入名称",trigger:"change"}],start_num:[{required:!0,message:"请输入开始主题",trigger:"change"}],start_at:[{required:!0,message:"请选择开始上课时间",trigger:"change"}],rest_week_day:[{required:!0,message:"请选择周几不上课",trigger:"change"}],teacher_ids:[{required:!0,message:"请选择老师ID",trigger:"change"}],goods_id:[{required:!0,message:"商品ID不能为空",trigger:"change"}],teacherList:[{required:!0,message:"带班老师不能为空",trigger:"change"}],viewTeacher:[{required:!0,message:"观摩老师不能为空",trigger:"change"}]}}},components:{goodDialog:l},filters:{isOrNot:function(t){return n.h[t]},goodsType:function(t){return n.e[t]},lessonType:function(t){return n.i[t]},goodsStatus:function(t){return n.d[t]},filterGoods:function(t){return t.name+"["+t.current_price/100+"元]"}},methods:{sub:function(){var t=this;this.$refs.form.validate(function(e){if(e){var o=t.form.goods_id,n={title:t.form.title,start_num:t.form.start_num,start_at:t.form.start_at,rest_week_day:t.form.rest_week_day?t.form.rest_week_day.join(","):""};t.form.id?Object(a._8)(t.form.id,n).then(function(e){t.$message({type:"success",message:"编辑成功!"}),t.$emit("reflash")}):(n.teacher_ids=t.form.teacherList.join(","),n.view_teacher_id=parseInt(t.form.viewTeacher),Object(a.T)(o,n).then(function(e){t.$message({type:"success",message:"添加成功!"}),t.$emit("reflash")}))}})},getTeachers:function(){var t=this;Object(a._26)().then(function(e){t.teacherOptions=e.list})},onOptionChange:function(t){var e=this.goodList.findIndex(function(e){return e.id=t});e>-1&&this.getLessonDetail(this.goodList[e].course_id)},getLessonDetail:function(t){var e=this;console.log("getLessonDetail",t),this.form.start_num="",Object(a._13)(t,{}).then(function(t){e.itemOptions=t.detail[t.type]})},getGoodsOption:function(){var t=this;Object(a._11)({page:1,limit:100}).then(function(e){t.goodList=e.list})}},mounted:function(){this.getTeachers(),this.getGoodsOption(),this.dialogObj.form.course_id&&this.getLessonDetail(this.dialogObj.form.course_id),this.form=this.dialogObj.form,this.teacherList=this.dialogObj.form.teacher_ids}},u={render:function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[o("el-dialog",{attrs:{title:t.dialogObj.title,center:"","append-to-body":"",visible:t.dialogObj.show,width:"800px"},on:{"update:visible":function(e){t.$set(t.dialogObj,"show",e)}}},[o("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}]},[o("el-form",{ref:"form",attrs:{model:t.form,"label-width":"120px",rules:t.rules}},[o("el-row",[o("el-col",{attrs:{span:10}},[o("el-form-item",{attrs:{label:"商品名称",prop:"goods_id"}},[o("el-select",{attrs:{placeholder:"请选择",clearable:"",disabled:!!t.form.id},on:{change:t.onOptionChange},model:{value:t.form.goods_id,callback:function(e){t.$set(t.form,"goods_id",e)},expression:"form.goods_id"}},t._l(t.goodList,function(e,a){return o("el-option",{key:a,attrs:{label:t._f("filterGoods")(e),value:e.id}})}))],1)],1)],1),t._v(" "),o("el-form-item",{attrs:{label:"期数名称",prop:"title"}},[o("el-input",{model:{value:t.form.title,callback:function(e){t.$set(t.form,"title",e)},expression:"form.title"}})],1),t._v(" "),o("el-form-item",{attrs:{label:"开始主题",prop:"start_num"}},[o("el-select",{attrs:{clearable:"",placeholder:"请选择"},model:{value:t.form.start_num,callback:function(e){t.$set(t.form,"start_num",e)},expression:"form.start_num"}},t._l(t.itemOptions,function(t){return o("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})}))],1),t._v(" "),o("el-form-item",{attrs:{label:"开始上课时间",prop:"start_at"}},[o("el-date-picker",{attrs:{format:"yyyy-MM-dd","value-format":"yyyy-MM-dd",type:"date","picker-options":t.pickerOptions1,placeholder:"选择日期"},model:{value:t.form.start_at,callback:function(e){t.$set(t.form,"start_at",e)},expression:"form.start_at"}})],1),t._v(" "),t.form.id?t._e():o("el-form-item",{attrs:{label:"带班老师",prop:"teacherList"}},[o("el-select",{attrs:{multiple:"",placeholder:"请选择"},model:{value:t.form.teacherList,callback:function(e){t.$set(t.form,"teacherList",e)},expression:"form.teacherList"}},t._l(t.teacherOptions,function(t){return o("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})}))],1),t._v(" "),t.form.id?t._e():o("el-form-item",{attrs:{label:"观摩老师",prop:"viewTeacher"}},[o("el-select",{attrs:{placeholder:"请选择"},model:{value:t.form.viewTeacher,callback:function(e){t.$set(t.form,"viewTeacher",e)},expression:"form.viewTeacher"}},t._l(t.teacherOptions,function(t){return o("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})}))],1),t._v(" "),o("el-form-item",{attrs:{label:"不上课日期"}},[o("el-select",{attrs:{multiple:"",placeholder:"请选择"},model:{value:t.form.rest_week_day,callback:function(e){t.$set(t.form,"rest_week_day",e)},expression:"form.rest_week_day"}},t._l(t.options,function(t){return o("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})}))],1)],1),t._v(" "),o("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:function(e){t.dialogObj.show=!1}}},[t._v("取 消")]),t._v(" "),o("el-button",{attrs:{type:"primary"},on:{click:t.sub}},[t._v("确 定")])],1)],1)])],1)},staticRenderFns:[]};var d=o("VU/8")(c,u,!1,function(t){o("2Qre")},"data-v-38c084d2",null).exports,f=o("sf/l"),m={name:"index",data:function(){return{nowPage:1,total:0,limit:10,title:"",goodsId:null,lessonId:null,startAt:"",periodList:[],startTime:[],newDialog:{form:{id:0,title:"",start_num:0,start_at:"",rest_week_day:[],goods_id:""},show:!1,title:""},goodList:[],lessonList:[]}},filters:{dayFilter:function(t){var e=t?t.split(","):[];return(e=e.map(function(t){return n.m[t]})).join(",")},filterGoods:function(t){return t.name+"["+t.current_price/100+"元]"}},components:{goodDialog:l,newDialog:d,page:r.a},methods:{onPageChange:function(t){this.nowPage=t,this.onSearch()},onSearch:function(){var t=this,e={limit:this.limit,page:this.nowPage};this.title&&(e.title=this.title),this.goodsId&&(e.goods_id=this.goodsId),this.lessonId&&(e.course_id=this.lessonId),this.startTime&&this.startTime.length>0&&(e.start_start_at=f.a.dateFmt(this.startTime[0],"yyyy-MM-dd"),e.start_end_at=f.a.dateFmt(this.startTime[1],"yyyy-MM-dd")),this.startAt&&(e.start_at=this.startAt),Object(a._17)(e).then(function(e){t.periodList=e.list,t.total=e.total})},onAdd:function(){this.newDialog.form.id="",this.newDialog.start_num="",this.newDialog.form.goods_id="",this.newDialog.form.title="",this.newDialog.form.start_at="",this.newDialog.form.rest_week_day=[],this.newDialog.form.teacher_ids=[],this.newDialog.title="添加期数",this.newDialog.show=!0},onEdit:function(t){this.newDialog.form.id=t.id,this.newDialog.form.start_num=t.start_num,this.newDialog.form.start_at=t.start_at,this.newDialog.form.title=t.title,this.newDialog.form.goods_id=t.goods_id;var e=[];t.rest_week_day&&t.rest_week_day.split(",").forEach(function(t){e.push(parseInt(t))}),this.newDialog.form.rest_week_day=e;var o=[];console.log("row edit",t),t.teacher_ids&&t.teacher_ids.split(",").forEach(function(t){o.push(parseInt(t))}),this.newDialog.form.teacher_ids=o,this.newDialog.title="编辑期数",this.newDialog.show=!0},onSave:function(t){this.newDialog.show=!1,this.onSearch()},del:function(t){var e=this;this.$confirm("此操作将删除该期数?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){Object(a.z)(t.id).then(function(t){e.$message({type:"success",message:"删除成功!"}),e.onSearch()})})},getGoodsOption:function(){var t=this;Object(a._11)({page:1,limit:100}).then(function(e){t.goodList=e.list})},getLessonOption:function(){var t=this;Object(a._12)({page:1,limit:100}).then(function(e){t.lessonList=e.list})}},mounted:function(){var t=this.$route.query;t&&t.goods_id&&(this.goodsId=parseInt(t.goods_id)),this.onSearch(),this.getGoodsOption(),this.getLessonOption()}},_={render:function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"periods"},[o("div",{staticClass:"form-block"},[o("el-form",{attrs:{"label-width":"90px",inline:""}},[o("el-form-item",{attrs:{label:"期数标题"}},[o("el-input",{attrs:{placeholder:"请输入内容",clearable:""},model:{value:t.title,callback:function(e){t.title=e},expression:"title"}})],1),t._v(" "),o("el-form-item",{attrs:{label:"商品名称"}},[o("el-select",{attrs:{placeholder:"请选择",clearable:""},model:{value:t.goodsId,callback:function(e){t.goodsId=e},expression:"goodsId"}},t._l(t.goodList,function(e,a){return o("el-option",{key:a,attrs:{label:t._f("filterGoods")(e),value:e.id}})}))],1),t._v(" "),o("el-form-item",{attrs:{label:"课程名称"}},[o("el-select",{attrs:{placeholder:"请选择",clearable:""},model:{value:t.lessonId,callback:function(e){t.lessonId=e},expression:"lessonId"}},t._l(t.lessonList,function(t,e){return o("el-option",{key:e,attrs:{label:t.title,value:t.id}})}))],1),t._v(" "),o("el-form-item",{attrs:{label:"开始时间"}},[o("el-date-picker",{attrs:{type:"datetimerange","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期","default-time":["00:00:00","23:59:59"]},model:{value:t.startTime,callback:function(e){t.startTime=e},expression:"startTime"}})],1),t._v(" "),o("el-form-item",[o("el-button",{attrs:{type:"primary"},on:{click:t.onSearch}},[t._v("查询")])],1),t._v(" "),t.$store.state.readonly?t._e():o("el-form-item",{staticStyle:{float:"right"}},[o("el-button",{attrs:{type:"primary"},on:{click:t.onAdd}},[t._v("添加期数")])],1)],1)],1),t._v(" "),o("el-table",{staticStyle:{width:"100%"},attrs:{data:t.periodList}},[o("el-table-column",{attrs:{label:"期数标题"},scopedSlots:t._u([{key:"default",fn:function(e){return[o("router-link",{attrs:{to:{name:"class",query:{goods_id:e.row.goods_id,periods_id:e.row.id}}}},[t._v("\n "+t._s(e.row.title)+"\n ")])]}}])}),t._v(" "),o("el-table-column",{attrs:{prop:"goods_name",label:"商品名称"}}),t._v(" "),o("el-table-column",{attrs:{label:"商品价格"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.goods_price/100)+"元\n ")]}}])}),t._v(" "),o("el-table-column",{attrs:{prop:"course_title",label:"课程名称"}}),t._v(" "),o("el-table-column",{attrs:{prop:"start_name",label:"开始主题/歌"}}),t._v(" "),o("el-table-column",{attrs:{prop:"current_category_name",label:"当前歌曲"}}),t._v(" "),o("el-table-column",{attrs:{label:"看课情况","min-width":"150"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n 可看课包数: "+t._s(e.row.watch_num)),o("br"),t._v(" 已看课包数:"+t._s(e.row.has_watch_num)+" "),o("br"),t._v("\n 续看课包数: "+t._s(e.row.duration_num)),o("br"),t._v(" 已续看课包数:"+t._s(e.row.has_duration_num)+"\n ")]}}])}),t._v(" "),o("el-table-column",{attrs:{label:"不上课日期","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t._f("dayFilter")(e.row.rest_week_day))+"\n ")]}}])}),t._v(" "),o("el-table-column",{attrs:{label:"总学员数"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.total_user_num?e.row.total_user_num:"")+"\n ")]}}])}),t._v(" "),o("el-table-column",{attrs:{prop:"start_at",label:"开始时间"}}),t._v(" "),o("el-table-column",{attrs:{label:"结束时间"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.over_at?e.row.over_at:"")+"\n ")]}}])}),t._v(" "),t.$store.state.readonly?t._e():o("el-table-column",{attrs:{label:"操作",width:"148"},scopedSlots:t._u([{key:"default",fn:function(e){return[o("el-button",{attrs:{size:"mini",plain:"",type:"primary"},on:{click:function(o){t.onEdit(e.row)}}},[t._v("\n 编辑\n ")]),t._v(" "),t.$store.state.deletePermission?o("el-button",{attrs:{size:"mini",type:"danger",plain:""},on:{click:function(o){t.del(e.row)}}},[t._v("\n 删除\n ")]):t._e()]}}])})],1),t._v(" "),o("page",{attrs:{nowPage:t.nowPage,total:t.total,limit:t.limit},on:{pageChange:t.onPageChange}}),t._v(" "),t.newDialog.show?o("new-dialog",{attrs:{dialogObj:t.newDialog},on:{reflash:t.onSave}}):t._e()],1)},staticRenderFns:[]};var g=o("VU/8")(m,_,!1,function(t){o("fZ1G")},"data-v-4362adc4",null);e.default=g.exports},fZ1G:function(t,e){},"sf/l":function(t,e,o){"use strict";e.a={dateFmt:function(t,e){var o={"M+":t.getMonth()+1,"d+":t.getDate(),"h+":t.getHours(),"m+":t.getMinutes(),"s+":t.getSeconds(),"q+":Math.floor((t.getMonth()+3)/3),S:t.getMilliseconds()};for(var a in/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(t.getFullYear()+"").substr(4-RegExp.$1.length))),o)new RegExp("("+a+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?o[a]:("00"+o[a]).substr((""+o[a]).length)));return e},emotion:function(t){var e=t.replace(/\#|\;/gi,"");return'<img src="https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/'+["微笑","撇嘴","色","发呆","得意","流泪","害羞","闭嘴","睡","大哭","尴尬","发怒","调皮","呲牙","惊讶","难过","酷","冷汗","抓狂","吐","偷笑","可爱","白眼","傲慢","饥饿","困","惊恐","流汗","憨笑","大兵","奋斗","咒骂","疑问","嘘","晕","折磨","衰","骷髅","敲打","再见","擦汗","抠鼻","鼓掌","糗大了","坏笑","左哼哼","右哼哼","哈欠","鄙视","委屈","快哭了","阴险","亲亲","吓","可怜","菜刀","西瓜","啤酒","篮球","乒乓","咖啡","饭","猪头","玫瑰","凋谢","示爱","爱心","心碎","蛋糕","闪电","炸弹","刀","足球","瓢虫","便便","月亮","太阳","礼物","拥抱","强","弱","握手","胜利","抱拳","勾引","拳头","差劲","爱你","NO","OK","爱情","飞吻","跳跳","发抖","怄火","转圈","磕头","回头","跳绳","挥手","激动","街舞","献吻","左太极","右太极"].indexOf(e)+'.gif" align="middle">'}}},wA2S:function(t,e){}});
\ No newline at end of file
webpackJsonp([9],{ayGs:function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o("CCn6"),a=o("+TkF"),r=o("kmJW"),i={props:["dialogObj"],data:function(){return{nowPage:1,total:0,goodList:[],currentRow:null}},components:{page:r.a},filters:{isOrNot:function(t){return a.h[t]},goodsType:function(t){return a.e[t]},lessonType:function(t){return a.i[t]},goodsStatus:function(t){return a.d[t]}},methods:{initPage:function(){var t=this;Object(n._11)().then(function(e){t.goodList=e.list,t.total=e.total})},handleCurrentChange:function(t){this.currentRow=t},onConfirm:function(){this.$emit("reflash",this.currentRow)}},mounted:function(){this.initPage()}},s={render:function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[o("el-dialog",{attrs:{title:t.dialogObj.title,visible:t.dialogObj.show},on:{"update:visible":function(e){t.$set(t.dialogObj,"show",e)}}},[o("el-table",{staticStyle:{width:"100%"},attrs:{data:t.goodList,"row-key":"id","highlight-current-row":""},on:{"current-change":t.handleCurrentChange}},[o("el-table-column",{attrs:{prop:"id",label:"商品ID"}}),t._v(" "),o("el-table-column",{attrs:{prop:"name",label:"名称"}}),t._v(" "),o("el-table-column",{attrs:{label:"商品类型"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t._f("goodsType")(e.row.goods_type))+"\n ")]}}])}),t._v(" "),o("el-table-column",{attrs:{label:"现价"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.current_price/100)+"元\n ")]}}])}),t._v(" "),o("el-table-column",{attrs:{label:"课程类别"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t._f("lessonType")(e.row.course_type))+"\n ")]}}])}),t._v(" "),o("el-table-column",{attrs:{label:"是否有实物"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t._f("isOrNot")(e.row.is_real))+"\n ")]}}])}),t._v(" "),o("el-table-column",{attrs:{label:"状态"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t._f("goodsStatus")(e.row.status))+"\n ")]}}])})],1),t._v(" "),o("page",{attrs:{nowPage:t.nowPage,total:t.total}}),t._v(" "),o("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:function(e){t.dialogObj.show=!1}}},[t._v("取 消")]),t._v(" "),o("el-button",{attrs:{type:"primary"},on:{click:t.onConfirm}},[t._v("确 定")])],1)],1)],1)},staticRenderFns:[]};var l=o("VU/8")(i,s,!1,function(t){o("wA2S")},"data-v-aa878a4a",null).exports,c={props:["dialogObj"],data:function(){return{loading:!1,form:{},teacherList:[],viewTeacher:"",pickerOptions1:{disabledDate:function(t){return!(t.getTime()>Date.now())}},options:[{value:0,label:"周日"},{value:1,label:"周一"},{value:2,label:"周二"},{value:3,label:"周三"},{value:4,label:"周四"},{value:5,label:"周五"},{value:6,label:"周六"}],teacherOptions:[],teacher1Options:[],teacher2Options:[],goodList:[],itemOptions:[],rules:{title:[{required:!0,message:"请输入名称",trigger:"change"}],start_num:[{required:!0,message:"请输入开始主题",trigger:"change"}],start_at:[{required:!0,message:"请选择开始上课时间",trigger:"change"}],rest_week_day:[{required:!0,message:"请选择周几不上课",trigger:"change"}],teacher_ids:[{required:!0,message:"请选择老师ID",trigger:"change"}],goods_id:[{required:!0,message:"商品ID不能为空",trigger:"change"}],teacherList:[{required:!0,message:"带班老师不能为空",trigger:"change"}],viewTeacher:[{required:!0,message:"观摩老师不能为空",trigger:"change"}]}}},components:{goodDialog:l},filters:{isOrNot:function(t){return a.h[t]},goodsType:function(t){return a.e[t]},lessonType:function(t){return a.i[t]},goodsStatus:function(t){return a.d[t]},filterGoods:function(t){return t.name+"["+t.current_price/100+"元]"}},methods:{sub:function(){var t=this;this.$refs.form.validate(function(e){if(e){var o=t.form.goods_id,a={title:t.form.title,start_num:t.form.start_num,start_at:t.form.start_at,rest_week_day:t.form.rest_week_day?t.form.rest_week_day.join(","):""};t.form.id?Object(n._8)(t.form.id,a).then(function(e){t.$message({type:"success",message:"编辑成功!"}),t.$emit("reflash")}):(a.teacher_ids=t.form.teacherList.join(","),a.view_teacher_id=parseInt(t.form.viewTeacher),Object(n.T)(o,a).then(function(e){t.$message({type:"success",message:"添加成功!"}),t.$emit("reflash")}))}})},getTeachers:function(){var t=this;Object(n._26)().then(function(e){t.teacherOptions=e.list,t.teacher1Options=e.list,t.teacher2Options=e.list})},findDifferentArray:function(t,e){var o=[];return t.forEach(function(t){-1===e.findIndex(function(e){return t.id==e})&&o.push(t)}),o},onTeacher1Change:function(t){this.teacher2Options=t?this.findDifferentArray(this.teacherOptions,t):this.teacherOptions},onTeacher2Change:function(t){this.teacher1Options=t?this.findDifferentArray(this.teacherOptions,[t]):this.teacherOptions},onOptionChange:function(t){var e=this.goodList.findIndex(function(e){return e.id=t});e>-1&&this.getLessonDetail(this.goodList[e].course_id)},getLessonDetail:function(t){var e=this;this.form.start_num="",Object(n._13)(t,{}).then(function(t){e.itemOptions=t.detail[t.type]})},getGoodsOption:function(){var t=this;Object(n._11)({page:1,limit:100}).then(function(e){t.goodList=e.list})}},mounted:function(){this.getTeachers(),this.getGoodsOption(),this.dialogObj.form.course_id&&this.getLessonDetail(this.dialogObj.form.course_id),this.form=this.dialogObj.form,this.teacherList=this.dialogObj.form.teacher_ids}},u={render:function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[o("el-dialog",{attrs:{title:t.dialogObj.title,center:"","append-to-body":"",visible:t.dialogObj.show,width:"800px"},on:{"update:visible":function(e){t.$set(t.dialogObj,"show",e)}}},[o("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}]},[o("el-form",{ref:"form",attrs:{model:t.form,"label-width":"120px",rules:t.rules}},[o("el-row",[o("el-col",{attrs:{span:10}},[o("el-form-item",{attrs:{label:"商品名称",prop:"goods_id"}},[o("el-select",{attrs:{placeholder:"请选择",clearable:"",disabled:!!t.form.id},on:{change:t.onOptionChange},model:{value:t.form.goods_id,callback:function(e){t.$set(t.form,"goods_id",e)},expression:"form.goods_id"}},t._l(t.goodList,function(e,n){return o("el-option",{key:n,attrs:{label:t._f("filterGoods")(e),value:e.id}})}))],1)],1)],1),t._v(" "),o("el-form-item",{attrs:{label:"期数名称",prop:"title"}},[o("el-input",{model:{value:t.form.title,callback:function(e){t.$set(t.form,"title",e)},expression:"form.title"}})],1),t._v(" "),o("el-form-item",{attrs:{label:"开始主题",prop:"start_num"}},[o("el-select",{attrs:{clearable:"",placeholder:"请选择"},model:{value:t.form.start_num,callback:function(e){t.$set(t.form,"start_num",e)},expression:"form.start_num"}},t._l(t.itemOptions,function(t){return o("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})}))],1),t._v(" "),o("el-form-item",{attrs:{label:"开始上课时间",prop:"start_at"}},[o("el-date-picker",{attrs:{format:"yyyy-MM-dd","value-format":"yyyy-MM-dd",type:"date","picker-options":t.pickerOptions1,placeholder:"选择日期"},model:{value:t.form.start_at,callback:function(e){t.$set(t.form,"start_at",e)},expression:"form.start_at"}})],1),t._v(" "),t.form.id?t._e():o("el-form-item",{attrs:{label:"带班老师",prop:"teacherList"}},[o("el-select",{attrs:{multiple:"",placeholder:"请选择"},on:{change:t.onTeacher1Change},model:{value:t.form.teacherList,callback:function(e){t.$set(t.form,"teacherList",e)},expression:"form.teacherList"}},t._l(t.teacher1Options,function(t){return o("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})}))],1),t._v(" "),t.form.id?t._e():o("el-form-item",{attrs:{label:"观摩老师",prop:"viewTeacher"}},[o("el-select",{attrs:{placeholder:"请选择"},on:{change:t.onTeacher2Change},model:{value:t.form.viewTeacher,callback:function(e){t.$set(t.form,"viewTeacher",e)},expression:"form.viewTeacher"}},t._l(t.teacher2Options,function(t){return o("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})}))],1),t._v(" "),o("el-form-item",{attrs:{label:"不上课日期"}},[o("el-select",{attrs:{multiple:"",placeholder:"请选择"},model:{value:t.form.rest_week_day,callback:function(e){t.$set(t.form,"rest_week_day",e)},expression:"form.rest_week_day"}},t._l(t.options,function(t){return o("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})}))],1)],1),t._v(" "),o("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:function(e){t.dialogObj.show=!1}}},[t._v("取 消")]),t._v(" "),o("el-button",{attrs:{type:"primary"},on:{click:t.sub}},[t._v("确 定")])],1)],1)])],1)},staticRenderFns:[]};var d=o("VU/8")(c,u,!1,function(t){o("nr5k")},"data-v-b8877b2c",null).exports,f=o("sf/l"),m={name:"index",data:function(){return{nowPage:1,total:0,limit:10,title:"",goodsId:null,lessonId:null,startAt:"",periodList:[],startTime:[],newDialog:{form:{id:0,title:"",start_num:0,start_at:"",rest_week_day:[],goods_id:""},show:!1,title:""},goodList:[],lessonList:[]}},filters:{dayFilter:function(t){var e=t?t.split(","):[];return(e=e.map(function(t){return a.m[t]})).join(",")},filterGoods:function(t){return t.name+"["+t.current_price/100+"元]"}},components:{goodDialog:l,newDialog:d,page:r.a},methods:{onPageChange:function(t){this.nowPage=t,this.onSearch()},onSearch:function(){var t=this,e={limit:this.limit,page:this.nowPage};this.title&&(e.title=this.title),this.goodsId&&(e.goods_id=this.goodsId),this.lessonId&&(e.course_id=this.lessonId),this.startTime&&this.startTime.length>0&&(e.start_start_at=f.a.dateFmt(this.startTime[0],"yyyy-MM-dd"),e.start_end_at=f.a.dateFmt(this.startTime[1],"yyyy-MM-dd")),this.startAt&&(e.start_at=this.startAt),Object(n._17)(e).then(function(e){t.periodList=e.list,t.total=e.total})},onAdd:function(){this.newDialog.form.id="",this.newDialog.start_num="",this.newDialog.form.goods_id="",this.newDialog.form.title="",this.newDialog.form.start_at="",this.newDialog.form.rest_week_day=[],this.newDialog.form.teacher_ids=[],this.newDialog.title="添加期数",this.newDialog.show=!0},onEdit:function(t){this.newDialog.form.id=t.id,this.newDialog.form.start_num=t.start_num,this.newDialog.form.start_at=t.start_at,this.newDialog.form.title=t.title,this.newDialog.form.goods_id=t.goods_id;var e=[];t.rest_week_day&&t.rest_week_day.split(",").forEach(function(t){e.push(parseInt(t))}),this.newDialog.form.rest_week_day=e;var o=[];console.log("row edit",t),t.teacher_ids&&t.teacher_ids.split(",").forEach(function(t){o.push(parseInt(t))}),this.newDialog.form.teacher_ids=o,this.newDialog.title="编辑期数",this.newDialog.show=!0},onSave:function(t){this.newDialog.show=!1,this.onSearch()},del:function(t){var e=this;this.$confirm("此操作将删除该期数?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){Object(n.z)(t.id).then(function(t){e.$message({type:"success",message:"删除成功!"}),e.onSearch()})})},getGoodsOption:function(){var t=this;Object(n._11)({page:1,limit:100}).then(function(e){t.goodList=e.list})},getLessonOption:function(){var t=this;Object(n._12)({page:1,limit:100}).then(function(e){t.lessonList=e.list})}},mounted:function(){var t=this.$route.query;t&&t.goods_id&&(this.goodsId=parseInt(t.goods_id)),this.onSearch(),this.getGoodsOption(),this.getLessonOption()}},_={render:function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"periods"},[o("div",{staticClass:"form-block"},[o("el-form",{attrs:{"label-width":"90px",inline:""}},[o("el-form-item",{attrs:{label:"期数标题"}},[o("el-input",{attrs:{placeholder:"请输入内容",clearable:""},model:{value:t.title,callback:function(e){t.title=e},expression:"title"}})],1),t._v(" "),o("el-form-item",{attrs:{label:"商品名称"}},[o("el-select",{attrs:{placeholder:"请选择",clearable:""},model:{value:t.goodsId,callback:function(e){t.goodsId=e},expression:"goodsId"}},t._l(t.goodList,function(e,n){return o("el-option",{key:n,attrs:{label:t._f("filterGoods")(e),value:e.id}})}))],1),t._v(" "),o("el-form-item",{attrs:{label:"课程名称"}},[o("el-select",{attrs:{placeholder:"请选择",clearable:""},model:{value:t.lessonId,callback:function(e){t.lessonId=e},expression:"lessonId"}},t._l(t.lessonList,function(t,e){return o("el-option",{key:e,attrs:{label:t.title,value:t.id}})}))],1),t._v(" "),o("el-form-item",{attrs:{label:"开始时间"}},[o("el-date-picker",{attrs:{type:"datetimerange","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期","default-time":["00:00:00","23:59:59"]},model:{value:t.startTime,callback:function(e){t.startTime=e},expression:"startTime"}})],1),t._v(" "),o("el-form-item",[o("el-button",{attrs:{type:"primary"},on:{click:t.onSearch}},[t._v("查询")])],1),t._v(" "),t.$store.state.readonly?t._e():o("el-form-item",{staticStyle:{float:"right"}},[o("el-button",{attrs:{type:"primary"},on:{click:t.onAdd}},[t._v("添加期数")])],1)],1)],1),t._v(" "),o("el-table",{staticStyle:{width:"100%"},attrs:{data:t.periodList}},[o("el-table-column",{attrs:{label:"期数标题"},scopedSlots:t._u([{key:"default",fn:function(e){return[o("router-link",{attrs:{to:{name:"class",query:{goods_id:e.row.goods_id,periods_id:e.row.id}}}},[t._v("\n "+t._s(e.row.title)+"\n ")])]}}])}),t._v(" "),o("el-table-column",{attrs:{prop:"goods_name",label:"商品名称"}}),t._v(" "),o("el-table-column",{attrs:{label:"商品价格"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.goods_price/100)+"元\n ")]}}])}),t._v(" "),o("el-table-column",{attrs:{prop:"course_title",label:"课程名称"}}),t._v(" "),o("el-table-column",{attrs:{prop:"start_name",label:"开始主题/歌"}}),t._v(" "),o("el-table-column",{attrs:{prop:"current_category_name",label:"当前歌曲"}}),t._v(" "),o("el-table-column",{attrs:{label:"看课情况","min-width":"150"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n 可看课包数: "+t._s(e.row.watch_num)),o("br"),t._v(" 已看课包数:"+t._s(e.row.has_watch_num)+" "),o("br"),t._v("\n 续看课包数: "+t._s(e.row.duration_num)),o("br"),t._v(" 已续看课包数:"+t._s(e.row.has_duration_num)+"\n ")]}}])}),t._v(" "),o("el-table-column",{attrs:{label:"不上课日期","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t._f("dayFilter")(e.row.rest_week_day))+"\n ")]}}])}),t._v(" "),o("el-table-column",{attrs:{label:"总学员数"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.total_user_num?e.row.total_user_num:"")+"\n ")]}}])}),t._v(" "),o("el-table-column",{attrs:{prop:"start_at",label:"开始时间"}}),t._v(" "),o("el-table-column",{attrs:{label:"结束时间"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.over_at?e.row.over_at:"")+"\n ")]}}])}),t._v(" "),t.$store.state.readonly?t._e():o("el-table-column",{attrs:{label:"操作",width:"148"},scopedSlots:t._u([{key:"default",fn:function(e){return[o("el-button",{attrs:{size:"mini",plain:"",type:"primary"},on:{click:function(o){t.onEdit(e.row)}}},[t._v("\n 编辑\n ")]),t._v(" "),t.$store.state.deletePermission?o("el-button",{attrs:{size:"mini",type:"danger",plain:""},on:{click:function(o){t.del(e.row)}}},[t._v("\n 删除\n ")]):t._e()]}}])})],1),t._v(" "),o("page",{attrs:{nowPage:t.nowPage,total:t.total,limit:t.limit},on:{pageChange:t.onPageChange}}),t._v(" "),t.newDialog.show?o("new-dialog",{attrs:{dialogObj:t.newDialog},on:{reflash:t.onSave}}):t._e()],1)},staticRenderFns:[]};var h=o("VU/8")(m,_,!1,function(t){o("fZ1G")},"data-v-4362adc4",null);e.default=h.exports},fZ1G:function(t,e){},nr5k:function(t,e){},"sf/l":function(t,e,o){"use strict";e.a={dateFmt:function(t,e){var o={"M+":t.getMonth()+1,"d+":t.getDate(),"h+":t.getHours(),"m+":t.getMinutes(),"s+":t.getSeconds(),"q+":Math.floor((t.getMonth()+3)/3),S:t.getMilliseconds()};for(var n in/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(t.getFullYear()+"").substr(4-RegExp.$1.length))),o)new RegExp("("+n+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?o[n]:("00"+o[n]).substr((""+o[n]).length)));return e},emotion:function(t){var e=t.replace(/\#|\;/gi,"");return'<img src="https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/'+["微笑","撇嘴","色","发呆","得意","流泪","害羞","闭嘴","睡","大哭","尴尬","发怒","调皮","呲牙","惊讶","难过","酷","冷汗","抓狂","吐","偷笑","可爱","白眼","傲慢","饥饿","困","惊恐","流汗","憨笑","大兵","奋斗","咒骂","疑问","嘘","晕","折磨","衰","骷髅","敲打","再见","擦汗","抠鼻","鼓掌","糗大了","坏笑","左哼哼","右哼哼","哈欠","鄙视","委屈","快哭了","阴险","亲亲","吓","可怜","菜刀","西瓜","啤酒","篮球","乒乓","咖啡","饭","猪头","玫瑰","凋谢","示爱","爱心","心碎","蛋糕","闪电","炸弹","刀","足球","瓢虫","便便","月亮","太阳","礼物","拥抱","强","弱","握手","胜利","抱拳","勾引","拳头","差劲","爱你","NO","OK","爱情","飞吻","跳跳","发抖","怄火","转圈","磕头","回头","跳绳","挥手","激动","街舞","献吻","左太极","右太极"].indexOf(e)+'.gif" align="middle">'}}},wA2S:function(t,e){}});
\ No newline at end of file
!function(e){var n=window.webpackJsonp;window.webpackJsonp=function(r,c,o){for(var f,b,d,i=0,u=[];i<r.length;i++)b=r[i],t[b]&&u.push(t[b][0]),t[b]=0;for(f in c)Object.prototype.hasOwnProperty.call(c,f)&&(e[f]=c[f]);for(n&&n(r,c,o);u.length;)u.shift()();if(o)for(i=0;i<o.length;i++)d=a(a.s=o[i]);return d};var r={},t={32:0};function a(n){if(r[n])return r[n].exports;var t=r[n]={i:n,l:!1,exports:{}};return e[n].call(t.exports,t,t.exports,a),t.l=!0,t.exports}a.e=function(e){var n=t[e];if(0===n)return new Promise(function(e){e()});if(n)return n[2];var r=new Promise(function(r,a){n=t[e]=[r,a]});n[2]=r;var c=document.getElementsByTagName("head")[0],o=document.createElement("script");o.type="text/javascript",o.charset="utf-8",o.async=!0,o.timeout=12e4,a.nc&&o.setAttribute("nonce",a.nc),o.src=a.p+"static/js/"+e+"."+{0:"426f3cb3ed60e86e4938",1:"b3e83f55c19363296ba6",2:"10a25ff2b953ff74556b",3:"d0a09be5802508c20889",4:"a7486f536dae8d5f0d8e",5:"fb72f00239feb2d507b1",6:"e7dbcf5af79b2384452e",7:"53941563792158472887",8:"742470ac13a83dc2c97a",9:"12a34923b13e8510338f",10:"bf5301c5878f0a943dd8",11:"200229e9488c91778d34",12:"6744ebb3f93944c9da14",13:"44bb04141d0b07cee440",14:"3599cdb833ec36097805",15:"f525b9d9c4196fa161a2",16:"d2e5739471a28c10917a",17:"855582f507fd3efb0072",18:"891a35c7f5fb765ee59d",19:"e0b0392e040014a72c27",20:"40f0b4a8a205091f5659",21:"00449760891cf6ab5f68",22:"b6b16bb7d57b8cdb7cd4",23:"d4517c639a6834597937",24:"168877af8fdb1d0ad847",25:"a992e1ace012a21f6853",26:"d2b0ecb2939e6bb15d44",27:"9d6b6a920be7efb24d8c",28:"67048a713e09743e9b41",29:"e661237a7317b47853f7"}[e]+".js";var f=setTimeout(b,12e4);function b(){o.onerror=o.onload=null,clearTimeout(f);var n=t[e];0!==n&&(n&&n[1](new Error("Loading chunk "+e+" failed.")),t[e]=void 0)}return o.onerror=o.onload=b,c.appendChild(o),r},a.m=e,a.c=r,a.d=function(e,n,r){a.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},a.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(n,"a",n),n},a.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},a.p="/",a.oe=function(e){throw console.error(e),e}}([]);
\ No newline at end of file
!function(e){var n=window.webpackJsonp;window.webpackJsonp=function(r,c,o){for(var f,b,d,i=0,u=[];i<r.length;i++)b=r[i],t[b]&&u.push(t[b][0]),t[b]=0;for(f in c)Object.prototype.hasOwnProperty.call(c,f)&&(e[f]=c[f]);for(n&&n(r,c,o);u.length;)u.shift()();if(o)for(i=0;i<o.length;i++)d=a(a.s=o[i]);return d};var r={},t={32:0};function a(n){if(r[n])return r[n].exports;var t=r[n]={i:n,l:!1,exports:{}};return e[n].call(t.exports,t,t.exports,a),t.l=!0,t.exports}a.e=function(e){var n=t[e];if(0===n)return new Promise(function(e){e()});if(n)return n[2];var r=new Promise(function(r,a){n=t[e]=[r,a]});n[2]=r;var c=document.getElementsByTagName("head")[0],o=document.createElement("script");o.type="text/javascript",o.charset="utf-8",o.async=!0,o.timeout=12e4,a.nc&&o.setAttribute("nonce",a.nc),o.src=a.p+"static/js/"+e+"."+{0:"426f3cb3ed60e86e4938",1:"b3e83f55c19363296ba6",2:"10a25ff2b953ff74556b",3:"d0a09be5802508c20889",4:"a7486f536dae8d5f0d8e",5:"fb72f00239feb2d507b1",6:"e7dbcf5af79b2384452e",7:"53941563792158472887",8:"742470ac13a83dc2c97a",9:"e230b875e1f0b0b83e53",10:"bf5301c5878f0a943dd8",11:"200229e9488c91778d34",12:"6744ebb3f93944c9da14",13:"44bb04141d0b07cee440",14:"3599cdb833ec36097805",15:"f525b9d9c4196fa161a2",16:"d2e5739471a28c10917a",17:"855582f507fd3efb0072",18:"891a35c7f5fb765ee59d",19:"e0b0392e040014a72c27",20:"40f0b4a8a205091f5659",21:"00449760891cf6ab5f68",22:"b6b16bb7d57b8cdb7cd4",23:"d4517c639a6834597937",24:"168877af8fdb1d0ad847",25:"a992e1ace012a21f6853",26:"d2b0ecb2939e6bb15d44",27:"9d6b6a920be7efb24d8c",28:"67048a713e09743e9b41",29:"e661237a7317b47853f7"}[e]+".js";var f=setTimeout(b,12e4);function b(){o.onerror=o.onload=null,clearTimeout(f);var n=t[e];0!==n&&(n&&n[1](new Error("Loading chunk "+e+" failed.")),t[e]=void 0)}return o.onerror=o.onload=b,c.appendChild(o),r},a.m=e,a.c=r,a.d=function(e,n,r){a.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},a.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(n,"a",n),n},a.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},a.p="/",a.oe=function(e){throw console.error(e),e}}([]);
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment