webpackJsonp([44],{"4lsv":function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=a("mvHQ"),r=a.n(s),i=a("Xxa5"),n=a.n(i),o=a("exGp"),l=a.n(o),u=a("PJh5"),c=a.n(u),m={data:function(){var t=this;return{loading:!1,statusText:{1:{type:"info",text:"申请中"},2:{type:"",text:"已授权"},3:{type:"danger",text:"取消授权"},4:{type:"danger",text:"已驳回"}},pickerOptions:{disabledDate:function(t){return t.getTime()>1e3*(c()(c()(Date.now()).format("YYYY-MM-DD")).unix()+86400-1)}},searchForm:{page:1,limit:10,status:0,start_time:"",end_time:"",name:""},tableData:[],total:0,count:{},showApply:!1,applyForm:{title:"",status:"",sh_text:""},subForm:{id:0,status:0,sh_text:""},subFormRules:{status:{required:!0,validator:function(e,a,s){t.subForm.status?s():s(new Error("请选择审核结果"))},trigger:"blur"}}}},created:function(){this.getTableDataList(1)},methods:{resetForm:function(t){this.$refs[t].resetFields(),this.getTableDataList(1)},handleSizeChange:function(t){this.searchForm.limit=t,this.handleCurrentChange(1)},handleCurrentChange:function(t){this.searchForm.page=t,this.getTableDataList()},toChange:function(t){var e=this;return l()(n.a.mark(function a(){return n.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:e.searchForm.status=t,e.getTableDataList(1);case 2:case"end":return a.stop()}},a,e)}))()},getTableDataList:function(t){var e=this;return l()(n.a.mark(function a(){var s,i,o,l,u,c,m,p,h,d;return n.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return t&&(e.searchForm.page=1),e.tableData=[],e.loading=!0,s=JSON.parse(r()(e.searchForm)),(i=s.start_time)&&i.length>0?(s.start_time=i[0]/1e3,s.end_time=i[1]/1e3):(s.start_time="",s.end_time=""),a.next=8,e.$api.distribution.resellerList(s);case 8:if(o=a.sent,l=o.code,u=o.data,e.loading=!1,200===l){a.next=14;break}return a.abrupt("return");case 14:u.data.map(function(t){var e=t.text||"该用户没有填写备注";t.text=e.replace(/\n/g,"
")}),c=u.all,m=u.nopass,p=u.ing,h=u.pass,d=u.total,e.tableData=u.data,e.total=d,e.count={all:c,nopass:m,ing:p,pass:h};case 19:case"end":return a.stop()}},a,e)}))()},toShowApply:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return l()(n.a.mark(function a(){var s,r,i,o;return n.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,t.$api.distribution.resellerInfo({id:e});case 2:if(s=a.sent,r=s.code,i=s.data,200===r){a.next=7;break}return a.abrupt("return");case 7:o=i.text||"该用户没有填写备注",i.text=o.replace(/\n/g,"
"),t.applyForm=i,t.subForm={id:e,status:2,sh_text:""},t.showApply=!t.showApply;case 12:case"end":return a.stop()}},a,t)}))()},confirmDel:function(t,e){var a=this;this.$confirm(this.$t(3===e?"tips.confirmNoPass":"tips.confirmDelete"),this.$t("tips.reminder"),{confirmButtonText:this.$t("action.comfirm"),cancelButtonText:this.$t("action.cancel"),type:"warning"}).then(function(){a.updateItem(t,e)}).catch(function(){})},updateItem:function(t,e){var a=this;return l()(n.a.mark(function s(){return n.a.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:a.$api.distribution.resellerUpdate({id:t,status:e}).then(function(t){if(200===t.code)a.$message.success(a.$t(-1===e?"tips.successDel":"tips.successOper")),-1===e&&(a.searchForm.page=a.searchForm.page