webpackJsonp([30],{j6ia:function(e,t){},yWUp:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=i("SQ4B"),n=i("b9vf"),o=i("qI5z"),s=i("vGYV"),c={name:"AgencyAuthentication",data:function(){var e=this;return{userId:0,user:{},loading:!1,isModifyMode:!1,resourceTypes:[],serviceTypes:[],authentication:{mobile:"",evaluationAgencyName:"",bankAccount:"",address:"",evaluationAgencyAbilityList:[],evaluationAgencyResourceList:[],photo:[],authStatus:{},agencyPhoto:s.c.image,explain:""},rules:{evaluationAgencyName:[{required:!0,message:"请输入机构名称",trigger:"blur"},{min:3,max:50,message:"机构名称长度在 3 到 50 个字符",trigger:"blur"}],bankAccount:[{required:!0,message:"请输入银行卡账户",trigger:"blur"},{min:16,max:19,message:"银行卡账户输入有误",trigger:"blur"},{validator:function(t,i,a){e.checkNumber(i)?a():a(new Error("银行卡账户输入有误"))},trigger:"blur"}],address:[{required:!0,message:"请输入地址",trigger:"blur"}],evaluationAgencyAbilityList:[{type:"array",required:!0,message:"请至少选择一种测试类型",trigger:"change"}],evaluationAgencyResourceList:[{validator:function(e,t,i){var a=!1;if(null==t||0==t.length)i(new Error("机构资源不可为空"));else for(var n=0;n1e7)return Object(o.a)("error","单个文件大小不能超过10M"),!1;var t=e.name,i=t.lastIndexOf(".");if(i<=0)return Object(o.a)("error","只能上传png/jpg格式的文件"),!1;var a=t.substr(i);return".jpg"!==a&&".png"!==a?(Object(o.a)("error","只能上传png/jpg格式的文件"),!1):void 0},uploadFile:function(e){var t=this,i=new FormData;i.append("file",e.file),a.a.upload(n.a.FILE.UPLOAD_IMAGE.replace("{userId}",this.user.userVO.id),i,{headers:{"Content-Type":"multipart/form-data"}}).then(function(e){t.hideLoading(),t.authentication.agencyPhoto=e.data,console.log(e.data),Object(o.a)("success","上传成功"),t.$refs.authentication.validateField("agencyPhoto")}).catch(function(e){t.hideLoading();try{413===e.response.status?Object(o.a)("error","文件过大,请选择小于20M的图片"):500===e.response.status&&Object(o.a)("error","上传文件发生错误,请稍后重试")}catch(t){Object(o.a)("error",e.data)}})},setServiceTypes:function(){var e=this;Object(s.r)().then(function(t){e.serviceTypes=t}).catch(function(e){Object(o.a)("error","机构能力加载失败")})},setResourceTypes:function(){this.resourceTypes=Object(s.k)()},addAgencyResource:function(){var e={id:this.authentication.evaluationAgencyResourceList.length,type:this.resourceTypes[0],name:"",totalNum:0,availableNum:0};this.authentication.evaluationAgencyResourceList.push(e)},removeAgencyResource:function(e){this.authentication.evaluationAgencyResourceList.splice(e,1);for(var t=0;t