webpackJsonp([47],{"V/TD":function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=a("mvHQ"),r=a.n(s),n=a("Xxa5"),i=a.n(n),o=a("exGp"),l=a.n(o),c=a("PJh5"),m=a.n(c),u={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*(m()(m()(Date.now()).format("YYYY-MM-DD")).unix()+86400-1)}},base_agent:[],searchForm:{page:1,limit:10,status:0,admin_id:"",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(){var t=this;return l()(i.a.mark(function e(){return i.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getBaseInfo();case 2:t.getTableDataList(1);case 3:case"end":return e.stop()}},e,t)}))()},methods:{getBaseInfo:function(){var t=this;return l()(i.a.mark(function e(){var a,s,r;return i.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.$api.agent.adminSelect();case 2:if(a=e.sent,s=a.code,r=a.data,200===s){e.next=7;break}return e.abrupt("return");case 7:t.base_agent=r;case 8:case"end":return e.stop()}},e,t)}))()},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()(i.a.mark(function a(){return i.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()(i.a.mark(function a(){var s,n,o,l,c,m,u,p,h,d;return i.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)),(n=s.start_time)&&n.length>0?(s.start_time=n[0]/1e3,s.end_time=n[1]/1e3):(s.start_time="",s.end_time=""),a.next=8,e.$api.salesman.salesmanList(s);case 8:if(o=a.sent,l=o.code,c=o.data,e.loading=!1,200===l){a.next=14;break}return a.abrupt("return");case 14:c.data.map(function(t){var e=t.text||"该用户没有填写备注";t.text=e.replace(/\n/g,"
")}),m=c.all,u=c.nopass,p=c.ing,h=c.pass,d=c.total,e.tableData=c.data,e.total=d,e.count={all:m,nopass:u,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()(i.a.mark(function a(){var s,r,n;return i.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,t.$api.salesman.salesmanInfo({id:e});case 2:if(s=a.sent,r=s.code,n=s.data,200===r){a.next=7;break}return a.abrupt("return");case 7:t.applyForm=n,t.subForm={id:e,status:2,sh_text:""},t.showApply=!t.showApply;case 10: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()(i.a.mark(function s(){return i.a.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:a.$api.salesman.checkSalesman({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