webpackJsonp([29],{F14N:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=a("SQ4B"),n=a("b9vf"),o=a("qI5z"),s=a("vGYV"),r={name:"AgencyAuthenticationCreate",data:function(){var e=this;return{userId:0,user:{},loading:!1,isModifyMode:!0,resourceTypes:[],serviceTypes:[],authentication:{mobile:"",evaluationAgencyName:"",bankAccount:"",address:"",evaluationAgencyAbilityList:[],evaluationAgencyResourceList:[],photo:[],agencyPhoto:""},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,a,i){e.checkNumber(a)?i():i(new Error("银行卡账户输入有误"))},trigger:"blur"}],address:[{required:!0,message:"请输入地址",trigger:"blur"}],evaluationAgencyAbilityList:[{type:"array",required:!0,message:"请至少选择一种测试类型",trigger:"change"}],evaluationAgencyResourceList:[{validator:function(e,t,a){var i=!1;if(null==t||0==t.length)a(new Error("机构资源不可为空"));else for(var n=0;n1e7)return Object(o.a)("error","单个文件大小不能超过10M"),!1;var t=e.name,a=t.lastIndexOf(".");if(a<=0)return Object(o.a)("error","只能上传png/jpg格式的文件"),!1;var i=t.substr(a);return".jpg"!==i&&".png"!==i?(Object(o.a)("error","只能上传png/jpg格式的文件"),!1):void 0},uploadFile:function(e){var t=this;this.showLoading();var a=new FormData;a.append("file",e.file),i.a.upload(n.a.FILE.UPLOAD_IMAGE.replace("{userId}",this.user.userVO.id),a,{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