(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-51599994"],{"3b9a":function(e,t,a){},5901:function(e,t,a){"use strict";a.r(t);var l,s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"zbsscoremanage"},[a("div",{staticClass:"header"},[a("el-input",{attrs:{clearable:"",maxlength:"11",placeholder:"输入手机号 / 昵称搜索","prefix-icon":"el-icon-search"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleSearch()}},model:{value:e.search,callback:function(t){e.search=t},expression:"search"}}),e._v(" "),a("el-button",{attrs:{type:"primary",icon:"el-icon-search",loading:e.loading},on:{click:function(t){return e.handleSearch()}}},[e._v("搜索/刷新")]),e._v(" "),a("el-button",{attrs:{type:"primary",icon:"el-icon-edit"},on:{click:e.handleEdit}},[e._v("调整学分")]),e._v(" "),a("switchseason",{staticClass:"switchseason",on:{switchseason:e.switchseason}})],1),e._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{border:"",stripe:"",data:e.list}},[a("el-table-column",{attrs:{label:"序号",type:"index",width:"60",index:function(t){return 15*(e.page-1)+t+1}}}),e._v(" "),a("el-table-column",{staticStyle:{padding:"0"},attrs:{label:"头像",prop:"avatar",width:"50","label-class-name":"label"},scopedSlots:e._u([{key:"default",fn:function(e){return[a("img",{attrs:{width:"36",height:"36",src:e.row.avatar}})]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"用户昵称",prop:"nickname","label-class-name":"label"}}),e._v(" "),a("el-table-column",{attrs:{label:"销售级别",prop:"level_name","label-class-name":"label"}}),e._v(" "),a("el-table-column",{attrs:{label:"学分类型",prop:"type","label-class-name":"label"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",[e._v(e._s(e._f("scoreType")(t.row.type)))])]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"学分数",prop:"score","label-class-name":"label"},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.score>0?a("div",{staticStyle:{color:"green"}},[e._v("+  "+e._s(t.row.score))]):a("div",{staticStyle:{color:"#f40"}},[e._v("-  "+e._s((t.row.score+"").replace("-","")))])]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"手机号",prop:"phone","label-class-name":"label"}}),e._v(" "),a("el-table-column",{attrs:{label:"生成时间",prop:"time","label-class-name":"label"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",[e._v(e._s(e._f("getTimeString")(t.row.time)))])]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"操作人",prop:"remark",width:"80","label-class-name":"label"},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.remark?a("div",{staticStyle:{color:"#f40"}},[e._v(e._s(t.row.remark))]):a("div",[e._v("用户本人")])]}}])})],1),e._v(" "),a("el-pagination",{attrs:{background:"",total:e.total,"page-size":15,"current-page":e.page,layout:"total, prev, pager, next, jumper"},on:{"current-change":e.handleCurrentChange}}),e._v(" "),a("el-dialog",{attrs:{title:"调整学分",visible:e.dialogFormVisible,"close-on-click-modal":!1},on:{"update:visible":function(t){e.dialogFormVisible=t}}},[a("el-form",{attrs:{model:e.form}},[a("el-form-item",{attrs:{label:"用户手机号","max-l":"","label-width":"99px"}},[a("el-input",{attrs:{maxlength:"11"},model:{value:e.form.phone,callback:function(t){e.$set(e.form,"phone",t)},expression:"form.phone"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"选择日期","label-width":"99px"}},[a("el-date-picker",{attrs:{type:"date",placeholder:"选择日期",clearable:!1},model:{value:e.form.time,callback:function(t){e.$set(e.form,"time",t)},expression:"form.time"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"调整学分","label-width":"99px"}},[a("el-input-number",{attrs:{size:"","step-strictly":"",min:0,step:10},model:{value:e.form.score,callback:function(t){e.$set(e.form,"score",t)},expression:"form.score"}})],1)],1),e._v(" "),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.dialogFormVisible=!1}}},[e._v("取 消")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:e.submitChange}},[e._v("调整学分")])],1)],1)],1)},o=[],n=(a("386d"),a("bc3a")),r=a.n(n),i=a("61f7"),c=a("b775");function h(e,t){return Object(c["a"])({method:"get",url:"/score/all",params:e,cancelToken:t})}function d(e){return Object(c["a"])({method:"get",url:"/score/search",params:e})}function u(e){return Object(c["a"])({method:"get",url:"/score/change",params:e})}var m={name:"ZbsScoreManage",data:function(){return{season_list_index:0,total:0,page:1,list:[],search:"",loading:!1,dialogFormVisible:!1,form:{phone:"",score:"",time:new Date((new Date).toLocaleDateString())}}},computed:{season:function(){return this.$store.state.user.season_list[this.season_list_index].season}},watch:{season:{handler:function(){this.page=1,this.search.trim().length?this.handleSearch():(this.search="",this.created())},immediate:!0}},beforeRouteEnter:function(e,t,a){console.log("entered"),a((function(t){e.params.phone&&(l.cancel("路由更新开始搜索"),t.search=e.params.phone+"",t.handleSearch())}))},created:function(){console.log("created")},methods:{switchseason:function(e){this.season_list_index=e},created:function(){var e=this;console.log("requesting"),this.loading=!0,l=r.a.CancelToken.source(),h({page:this.page,season:this.season},l.token).then((function(t){e.loading=!1,e.total=t.data.total,e.list=t.data.list})).catch((function(t){e.loading=!1}))},handleSearch:function(e){var t=this;this.search.trim().length?(this.loading=!0,!e&&(this.page=1),d({phone:this.search.trim(),season:this.season,page:this.page}).then((function(e){t.loading=!1,t.total=e.data.total,t.list=e.data.list}))):(this.page=1,this.created())},handleEdit:function(){this.dialogFormVisible=!0,this.form.time=new Date((new Date).toLocaleDateString()),this.form.phone="",this.form.score=0},submitChange:function(){var e=this;Object(i["b"])(this.form.phone.trim())?this.form.time?this.form.score?(this.form.season=this.season,this.form.time=+new Date(this.form.time)/1e3,u(this.form).then((function(t){200===t.code?(e.$message.success("调整成功"),e.dialogFormVisible=!1,e.page=1,e.created()):300===t.code&&e.$message.error("此用户不存在")}))):this.$message.error("学分不能为空"):this.$message.error("日期不能为空"):this.$message.error("手机号格式错误")},handleCurrentChange:function(e){var t=this;this.loading=!0,this.page=e,this.search.trim().length?this.handleSearch(e):h({page:e,season:this.season}).then((function(e){t.loading=!1,t.total=e.data.total,t.list=e.data.list}))}}},p=m,f=(a("c84f"),a("2877")),b=Object(f["a"])(p,s,o,!1,null,null,null);t["default"]=b.exports},c84f:function(e,t,a){"use strict";a("3b9a")}}]);