1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d22c4e0"],{f352:function(e,t,n){"use strict";n.r(t);var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"app-container"},[n("div",{directives:[{name:"loading",rawName:"v-loading.fullscreen.lock",value:e.loadingFull,expression:"loadingFull",modifiers:{fullscreen:!0,lock:!0}}]}),e._v(" "),n("el-input",{staticStyle:{width:"300px"},attrs:{type:"text",placeholder:"代理昵称 / 手机号"},model:{value:e.searchParams.search_name,callback:function(t){e.$set(e.searchParams,"search_name",t)},expression:"searchParams.search_name"}}),e._v(" "),n("el-button",{attrs:{type:"primary"},on:{click:function(t){e.searchParams.page_index=1,e.getMadalList()}}},[e._v("搜索")]),e._v(" "),n("el-table",{staticStyle:{margin:"20px 0"},attrs:{border:"",stripe:"",data:e.medalList}},[n("el-table-column",{attrs:{label:"用户昵称",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row;return[e._v("\n "+e._s(n.nickname)+"\n ")]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"手机号",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row;return[e._v("\n "+e._s(n.phone)+"\n ")]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"奖牌数",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row.glory;return[n("el-button",{attrs:{type:"text"},on:{click:function(t){return e.getMedalInfo(a,0)}}},[e._v(e._s(a?a.length:0))])]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"已发数量",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row.glory;return[n("span",{staticStyle:{color:"#67C23A",cursor:"pointer"},on:{click:function(t){return e.getMedalInfo(a,4)}}},[e._v("\n "+e._s(a?0===a.length?0:a.filter((function(e){return e.activity_id})).length:0)+"\n ")])]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"未发数量",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row.glory;return[n("span",{staticStyle:{color:"#F56C6C",cursor:"pointer"},on:{click:function(t){return e.getMedalInfo(a,5)}}},[e._v("\n "+e._s(a?0===a.length?0:a.filter((function(e){return!e.activity_id})).length:0)+"\n ")])]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"奖牌详情",align:"center",width:"300"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row.glory;return[n("el-row",{attrs:{gutter:20}},[n("el-col",{attrs:{span:8}},[e._v("\n 金牌: "),n("el-button",{attrs:{type:"text"},on:{click:function(t){return e.getMedalInfo(a,1)}}},[e._v("\n "+e._s(a?0===a.length?0:a.filter((function(e){return 5===+e.glory||6===+e.glory})).length:0)+"\n ")])],1),e._v(" "),n("el-col",{attrs:{span:8}},[e._v("\n 银牌: "),n("el-button",{attrs:{type:"text"},on:{click:function(t){return e.getMedalInfo(a,2)}}},[e._v("\n "+e._s(a?0===a.length?0:a.filter((function(e){return 4===+e.glory})).length:0)+"\n ")])],1),e._v(" "),n("el-col",{attrs:{span:8}},[e._v("\n 铜牌: "),n("el-button",{attrs:{type:"text"},on:{click:function(t){return e.getMedalInfo(a,3)}}},[e._v("\n "+e._s(a?0===a.length?0:a.filter((function(e){return 3===+e.glory})).length:0)+"\n ")])],1)],1)]}}])})],1),e._v(" "),n("el-pagination",{attrs:{background:"",total:e.medalTotal,"page-size":20,"current-page":e.searchParams.page_index,layout:"pager"},on:{"current-change":e.changePagination}}),e._v(" "),n("el-dialog",{attrs:{title:"奖牌详情",visible:e.medalVis,"before-close":e.resetMedalInfo},on:{"update:visible":function(t){e.medalVis=t}}},[n("el-table",{attrs:{border:"",stripe:"",data:e.medalInfoList}},[n("el-table-column",{attrs:{label:"活动时间",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row;return[e._v("\n "+e._s("第"+n.season+"届争霸赛")+"\n ")]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"状态",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[n("el-tag",{attrs:{type:a.activity_id?"success":"danger"}},[e._v(e._s(a.activity_id?"已发放":"未发放"))])]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"发放时间",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row;return[e._v("\n "+e._s(n.act_season?"第"+n.act_season+"届"+(1===n.act_type?"密训营":"实战营"):"暂未发放")+"\n ")]}}])})],1)],1),e._v(" "),n("el-dialog",{attrs:{title:"发放奖牌",visible:e.sendMedalVis,width:"350px","before-close":e.resetSendMedalForm},on:{"update:visible":function(t){e.sendMedalVis=t}}},[n("el-form",{attrs:{"label-width":"80px"}},[n("el-form-item",{attrs:{label:"发放时间:"}},[n("el-select",{attrs:{placeholder:"请选择"},model:{value:e.sendMedalForm.activity_id,callback:function(t){e.$set(e.sendMedalForm,"activity_id",t)},expression:"sendMedalForm.activity_id"}},e._l(e.season_list,(function(e){return n("el-option",{key:e.id,attrs:{label:""+e.name,value:e.id}})})),1)],1),e._v(" "),n("el-form-item",[n("el-button",{attrs:{type:"primary",size:"mini"},on:{click:e.submitSendMedal}},[e._v("确认发放")]),e._v(" "),n("el-button",{attrs:{size:"mini"},on:{click:e.resetSendMedalForm}},[e._v("取消")])],1)],1)],1)],1)},l=[],r=(n("55dd"),n("b775"));function i(e){return Object(r["a"])({method:"get",url:"/glory/get_user_medals_info",params:e})}var s={data:function(){return{loadingFull:!1,searchParams:{search_name:"",page_index:1,page_size:20},medalList:[],medalTotal:0,medalVis:!1,medalInfoList:[],sendMedalVis:!1,sendMedalForm:{id:"",activity_id:""}}},computed:{season_list:function(){return this.$store.state.user.season_list}},created:function(){this.getMadalList()},methods:{resetMedalInfo:function(){this.medalInfoList=[],this.medalVis=!1},showSendMedal:function(e){this.sendMedalForm.id=e,this.sendMedalVis=!0},resetSendMedalForm:function(){this.sendMedalForm.id="",this.sendMedalForm.activity_id="",this.sendMedalVis=!1},submitSendMedal:function(){var e=this;if(!this.sendMedalForm.activity_id)return this.$message.error("请选择发放时间"),!1;this.$confirm("确认发放奖牌吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){(void 0)(e.sendMedalForm).then((function(t){200===t.code?(e.$message.success("发放奖牌成功"),e.resetSendMedalForm(),e.resetMedalInfo(),e.getMadalList()):e.$message.error(t.message||"发放奖牌失败")})).catch((function(){e.$message.error("发放奖牌失败")}))})).catch((function(){}))},changePagination:function(e){this.searchParams.page_index=e,this.getMadalList()},getMedalInfo:function(e,t){if(!e||0===e.length)return this.$message.error("该用户暂未获得任何奖牌"),!1;switch(t){case 1:this.medalInfoList=e.filter((function(e){return 5===+e.glory||6===+e.glory}));break;case 2:this.medalInfoList=e.filter((function(e){return 4===+e.glory}));break;case 3:this.medalInfoList=e.filter((function(e){return 3===+e.glory}));break;case 4:this.medalInfoList=e.filter((function(e){return e.activity_id}));break;case 5:this.medalInfoList=e.filter((function(e){return!e.activity_id}));break;default:this.medalInfoList=e;break}if(0===this.medalInfoList.length)return this.$message.error("暂无该类型的奖牌"),!1;this.medalVis=!0},getMadalList:function(){var e=this;this.loadingFull=!0,i(this.searchParams).then((function(t){e.loadingFull=!1,200===t.code?(e.medalList=t.data.list,e.medalList.sort((function(e,t){return(t.glory&&t.glory.length>0?t.glory.length:0)-(e.glory&&e.glory.length>0?e.glory.length:0)})),e.medalTotal=t.data.total):e.$message.error(t.message||"获取列表失败")})).catch((function(t){e.loadingFull=!1,console.log(t),e.$message.error("获取列表失败")}))}}},o=s,c=n("2877"),d=Object(c["a"])(o,a,l,!1,null,null,null);t["default"]=d.exports}}]);
|