34.6a12efd6ed59050f3a2f.js 13 KB

1
  1. webpackJsonp([34],{"313e":function(e,t){},CECe:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a("Dd8w"),i=a.n(r),s=a("b9vf"),o=a("SQ4B"),n=a("qI5z"),l=a("vGYV"),d={name:"EnterpriseAuth",data:function(){return{loading:!1,active:0,user:{},canEdit:!1,authType:-1,authStatus:{},enterpriseForm1:{evaluationAgencyName:"",agencyPhoto:"",businessLicensePhoto:""},enterpriseForm:{roleList:[],legalPersonName:"",idCardNum:"",address:"",gender:"",idCardPositivePhoto:"",idCardBackPhoto:"",idCardDeadTime:""},failureReason:"",rules1:{agencyPhoto:[{required:!0,message:"请上传企业logo",trigger:"blur"}],businessLicensePhoto:[{required:!0,message:"请上传企业执照",trigger:"blur"}],evaluationAgencyName:[{required:!0,message:"请输入企业名称",trigger:"blur"}]},rules:{legalPersonName:[{required:!0,message:"请输入法人姓名",trigger:"blur"}],idCardNum:[{required:!0,message:"请输入身份证号码",trigger:"blur"}],address:[{required:!0,message:"请输入家庭或单位地址",trigger:"blur"}],gender:[{required:!0,message:"请选择性别",trigger:"blur"}],roleList:[{type:"array",required:!0,message:"请至少选择一个认证权限",trigger:"change"}],idCardDeadTime:[{required:!0,message:"请选择身份证过期时间",trigger:"change"}]}}},methods:{preStep:function(){this.$refs.enterpriseForm.clearValidate(),this.active--},nextStep:function(){var e=this;this.$refs.enterpriseForm1.validate(function(t){if(!t)return Object(n.a)("error","信息填写不规范"),!1;e.active++})},submitEnterpriseAuth:function(){var e=this;if(this.$refs.enterpriseForm.validate(function(e){if(!e)return Object(n.a)("error","信息填写不规范"),!1}),!this.enterpriseForm.idCardPositivePhoto)return Object(n.a)("error","身份证正面照片上传不规范"),!1;if(!this.enterpriseForm.idCardBackPhoto)return Object(n.a)("error","身份证反面照片上传不规范"),!1;var t=this.$route.query.type,a=i()({},this.enterpriseForm,this.enterpriseForm1);this.showLoading(),1==t?o.a.post("/api/user/"+this.user.id+"/agency",a).then(function(t){t&&(Object(n.a)("success","提交成功"),e.$router.push("/personal/authentication"))}).catch(function(t){e.hideLoading(),Object(n.a)("error",t.data)}):o.a.put("/api/user/"+this.user.id+"/agency",a).then(function(t){t&&(Object(n.a)("success","修改成功"),e.$router.push("/personal/authentication"))}).catch(function(t){e.hideLoading(),Object(n.a)("error",t.data)})},getAuthStatus:function(){var e=this;o.a.get("/api/user/"+this.user.id).then(function(t){t.agencyVO?(e.authType=1,e.authStatus=t.agencyVO.authStatus?t.agencyVO.authStatus:{},"success"!==e.authStatus.style&&(e.canEdit=!0),e.failureReason=t.agencyVO.explain,e.setFormInfo(t.agencyVO)):(e.authType=0,e.canEdit=!0)})},setFormInfo:function(e){this.enterpriseForm.roleList=e.roleList,this.enterpriseForm.legalPersonName=e.legalPersonName,this.enterpriseForm.gender=e.gender,this.enterpriseForm.idCardNum=e.idCardNum,this.enterpriseForm.address=e.address,this.enterpriseForm.idCardPositivePhoto=e.idCardPositivePhoto,this.enterpriseForm.idCardBackPhoto=e.idCardBackPhoto,this.enterpriseForm.idCardDeadTime=e.idCardDeadTime,this.enterpriseForm1.businessLicensePhoto=e.businessLicensePhoto,this.enterpriseForm1.evaluationAgencyName=e.evaluationAgencyName,this.enterpriseForm1.agencyPhoto=e.agencyPhoto},setUserInfo:function(){this.user=Object(l.J)("user")&&Object(l.J)("user").userVO},beforeFileUpload:function(e){if(e.size>1e7)return Object(n.a)("error","单个文件大小不能超过5M"),!1;var t=e.name,a=t.lastIndexOf(".");if(a<=0)return Object(n.a)("error","只能上传png/jpg/jpeg格式的文件"),!1;var r=t.substr(a);return".jpg"!==r&&".png"!==r&&".jpeg"!==r?(Object(n.a)("error","只能上传png/jpg/jpeg格式的文件"),!1):void 0},uploadFile:function(e){var t=this,a=new FormData;a.append("file",e.file),o.a.upload(s.a.FILE.UPLOAD_IMAGE.replace("{userId}",this.user.id),a,{headers:{"Content-Type":"multipart/form-data"}}).then(function(a){2==e.data.type?t.enterpriseForm1.businessLicensePhoto=a.data:1==e.data.type?t.enterpriseForm.idCardBackPhoto=a.data:0==e.data.type?t.enterpriseForm.idCardPositivePhoto=a.data:3==e.data.type&&(t.enterpriseForm1.agencyPhoto=a.data),Object(n.a)("success","上传成功")}).catch(function(e){Object(n.a)("error",e.data)})},showLoading:function(){this.loading=!0},hideLoading:function(){this.loading=!1}},mounted:function(){this.setUserInfo(),this.getAuthStatus()}},c={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"right-modifyPsw"},[a("div",{staticClass:"right-modifyPsw-title"},[a("span",{staticStyle:{"font-size":"18px","font-weight":"bold"}},[e._v("企业认证")]),e._v(" "),1===e.authType?a("el-tag",{attrs:{type:e.authStatus.style}},[e._v(e._s(e.authStatus.text))]):e._e(),e._v(" "),0===e.authType?a("el-tag",{attrs:{type:"danger"}},[e._v("未认证")]):e._e()],1),e._v(" "),a("el-steps",{staticStyle:{width:"400px",margin:"0 auto","margin-bottom":"20px"},attrs:{active:e.active,"process-status":"finish"}},[a("el-step",{attrs:{title:"上传企业信息"}}),e._v(" "),a("el-step",{attrs:{title:"上传法人信息"}})],1),e._v(" "),e.failureReason&&""!==e.failureReason?a("el-alert",{attrs:{title:e.failureReason,type:"error"}}):e._e(),e._v(" "),0===e.active?a("div",{staticClass:"uploader-wrapper"},[a("el-form",{ref:"enterpriseForm1",staticStyle:{width:"600px","margin-top":"10px"},attrs:{model:e.enterpriseForm1,rules:e.rules1,"label-width":"100px"}},[a("el-form-item",{attrs:{label:"企业logo:",prop:"agencyPhoto"}},[a("el-upload",{staticClass:"avatar-uploader",staticStyle:{border:"lightgrey 1px solid"},attrs:{action:"https://jsonplaceholder.typicode.com/posts/","before-upload":e.beforeFileUpload,"http-request":e.uploadFile,data:{type:3},disabled:!e.canEdit}},[e.enterpriseForm1.agencyPhoto?a("img",{staticClass:"avatar",attrs:{src:e.enterpriseForm1.agencyPhoto}}):a("i",{staticClass:"el-icon-plus avatar-uploader-icon"})])],1),e._v(" "),a("el-form-item",{attrs:{label:"企业名称:",prop:"evaluationAgencyName"}},[a("el-input",{attrs:{disabled:!e.canEdit,placeholder:"身份证前后不能有空格"},model:{value:e.enterpriseForm1.evaluationAgencyName,callback:function(t){e.$set(e.enterpriseForm1,"evaluationAgencyName",t)},expression:"enterpriseForm1.evaluationAgencyName"}})],1),e._v(" "),a("el-form-item",{staticStyle:{width:"850px"},attrs:{label:"营业执照:",prop:"businessLicensePhoto"}},[a("el-row",{staticClass:"agency-form-item"},[a("el-col",{attrs:{span:10}},[a("div",{staticClass:"uploader-businessLicensePhoto"},[a("el-upload",{staticClass:"avatar-uploader idcard-uploader",staticStyle:{border:"lightgrey 1px solid"},attrs:{action:"https://jsonplaceholder.typicode.com/posts/","before-upload":e.beforeFileUpload,"http-request":e.uploadFile,data:{type:2},disabled:!e.canEdit}},[e.enterpriseForm1.businessLicensePhoto?a("img",{staticClass:"avatar",attrs:{src:e.enterpriseForm1.businessLicensePhoto}}):a("i",{staticClass:"el-icon-plus avatar-uploader-icon card-uploader-icon"})]),e._v(" "),a("div",[a("span",{staticStyle:{color:"red"}},[e._v("*")]),e._v("营业执照:(仅支持三证合一)")])],1)]),e._v(" "),a("el-col",{attrs:{span:14}},[a("div",{staticClass:"authentication-detail"},[a("div",{staticClass:"authentication-detail-title"},[e._v("证件要求")]),e._v(" "),a("ul",{staticClass:"authentication-detail-list",staticStyle:{"padding-left":"0"}},[a("li",[e._v("必须为清晰、完整的彩色原件扫描件或数码照")]),e._v(" "),a("li",[e._v("仅支持.jpg .bmp .png .gif的图片格式,图片大小不超过4M")]),e._v(" "),a("li",[e._v("必须在有效期内且年检章齐全(当年成立的公司可无年检章)")]),e._v(" "),a("li",[e._v("必须为中国大陆工商局颁发")])])])])],1)],1)],1)],1):e._e(),e._v(" "),1===e.active?a("div",{staticClass:"legal-person-wrapper"},[a("el-form",{ref:"enterpriseForm",staticStyle:{width:"600px"},attrs:{model:e.enterpriseForm,rules:e.rules,"label-width":"130px"}},[a("el-form-item",{attrs:{label:"法人姓名",prop:"legalPersonName"}},[a("el-input",{attrs:{disabled:!e.canEdit},model:{value:e.enterpriseForm.legalPersonName,callback:function(t){e.$set(e.enterpriseForm,"legalPersonName",t)},expression:"enterpriseForm.legalPersonName"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"性别",prop:"gender"}},[a("el-radio-group",{attrs:{disabled:!e.canEdit},model:{value:e.enterpriseForm.gender,callback:function(t){e.$set(e.enterpriseForm,"gender",t)},expression:"enterpriseForm.gender"}},[a("el-radio",{attrs:{label:"男"}}),e._v(" "),a("el-radio",{attrs:{label:"女"}})],1)],1),e._v(" "),a("el-form-item",{attrs:{label:"身份证号码",prop:"idCardNum"}},[a("el-input",{attrs:{disabled:!e.canEdit},model:{value:e.enterpriseForm.idCardNum,callback:function(t){e.$set(e.enterpriseForm,"idCardNum",t)},expression:"enterpriseForm.idCardNum"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"身份证到期时间",prop:"idCardDeadTime"}},[a("el-date-picker",{staticStyle:{width:"100%"},attrs:{align:"right",type:"date",placeholder:"请按身份证背面“有效期限”如实填写",disabled:!e.canEdit},model:{value:e.enterpriseForm.idCardDeadTime,callback:function(t){e.$set(e.enterpriseForm,"idCardDeadTime",t)},expression:"enterpriseForm.idCardDeadTime"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"家庭或单位地址",prop:"address"}},[a("el-input",{attrs:{disabled:!e.canEdit},model:{value:e.enterpriseForm.address,callback:function(t){e.$set(e.enterpriseForm,"address",t)},expression:"enterpriseForm.address"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"认证权限",prop:"roleList"}},[a("el-checkbox-group",{attrs:{disabled:!e.canEdit},model:{value:e.enterpriseForm.roleList,callback:function(t){e.$set(e.enterpriseForm,"roleList",t)},expression:"enterpriseForm.roleList"}},[a("el-checkbox",{attrs:{label:1}},[e._v("发包")]),e._v(" "),a("el-checkbox",{attrs:{label:0}},[e._v("接包")])],1)],1)],1),e._v(" "),a("div",{staticClass:"uploader-wrapper"},[a("el-row",{staticStyle:{width:"100%"}},[a("el-col",{staticStyle:{"padding-left":"30px"},attrs:{span:9}},[a("div",{staticStyle:{height:"50%"}},[a("el-upload",{staticClass:"avatar-uploader idcard-uploader",staticStyle:{border:"lightgrey 1px solid"},attrs:{action:"https://jsonplaceholder.typicode.com/posts/","before-upload":e.beforeFileUpload,"http-request":e.uploadFile,data:{type:0},disabled:!e.canEdit}},[e.enterpriseForm.idCardPositivePhoto?a("img",{staticClass:"avatar",attrs:{src:e.enterpriseForm.idCardPositivePhoto}}):a("i",{staticClass:"el-icon-plus avatar-uploader-icon card-uploader-icon"})]),e._v(" "),a("div",{staticStyle:{"text-align":"center"}},[e._v("身份证正面照"),a("span",{staticStyle:{color:"red"}},[e._v("(必填)")])])],1),e._v(" "),a("div",{staticStyle:{width:"280px","margin-top":"50px"}},[a("el-upload",{staticClass:"avatar-uploader idcard-uploader",staticStyle:{border:"lightgrey 1px solid"},attrs:{action:"https://jsonplaceholder.typicode.com/posts/","before-upload":e.beforeFileUpload,"http-request":e.uploadFile,data:{type:1},disabled:!e.canEdit}},[e.enterpriseForm.idCardBackPhoto?a("img",{staticClass:"avatar",attrs:{src:e.enterpriseForm.idCardBackPhoto}}):a("i",{staticClass:"el-icon-plus avatar-uploader-icon card-uploader-icon"})]),e._v(" "),a("div",{staticStyle:{"text-align":"center"}},[e._v("身份证反面照"),a("span",{staticStyle:{color:"red"}},[e._v("(必填)")])])],1)]),e._v(" "),a("el-col",{attrs:{span:15}},[a("div",{staticClass:"authentication-detail"},[a("div",{staticClass:"authentication-detail-title"},[e._v("示例")]),e._v(" "),a("el-row",{staticStyle:{width:"100%"}},[a("div",[a("div",{staticClass:"idcard-example1"}),e._v(" "),a("div",{staticClass:"idcard-example2"})]),e._v(" "),a("div",[a("ul",{staticClass:"authentication-detail-list"},[a("li",[e._v("仅支持.jpg .png .jpeg,图 片大小不超过3M")]),e._v(" "),a("li",[e._v("核实手持证件与原件方向一致,对焦身份证 进行拍照")]),e._v(" "),a("li",[e._v("您提供的照片众测服务平台将予以保护,不 会用于其他用途")])])])])],1)])],1)],1)],1):e._e(),e._v(" "),a("div",{staticClass:"enterprise-btn-wrapper"},[e.active>0?a("button",{staticClass:"enterprise-btn previousBtn",staticStyle:{cursor:"pointer"},on:{click:e.preStep}},[e._v("上一步")]):e._e(),e._v(" "),0===e.active?a("button",{staticClass:"enterprise-btn nextBtn",staticStyle:{cursor:"pointer"},on:{click:e.nextStep}},[e._v("下一步")]):e._e(),e._v(" "),1===e.active&&0===e.authType?a("button",{staticClass:"enterprise-btn nextBtn",staticStyle:{cursor:"pointer"},on:{click:e.submitEnterpriseAuth}},[e._v("提交审核\n ")]):e._e(),e._v(" "),1!==e.active||"审核中"!=e.authStatus.text&&"认证失败"!=e.authStatus.text?e._e():a("button",{staticClass:"enterprise-btn nextBtn",staticStyle:{cursor:"pointer"},on:{click:e.submitEnterpriseAuth}},[e._v("修改审核\n ")])])],1)},staticRenderFns:[]};var p=a("VU/8")(d,c,!1,function(e){a("313e")},"data-v-3b6e146c",null);t.default=p.exports}});