14.df11341b8574065f52b3.js 10 KB

1
  1. webpackJsonp([14],{ALPt:function(t,a){},QX2f:function(t,a,i){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var e=i("b9vf"),r=i("SQ4B"),d=i("qI5z"),s=i("vGYV"),l={name:"IndividualAuth",data:function(){return{loading:!1,active:0,user:{},individualForm:{roleList:[],realName:"",gender:"",idCard:"",idCardPositivePhoto:"",idCardBackPhoto:"",idCardDeadTime:"",address:""},failureReason:"",authType:-1,authDetail:{},authStatus:"",canEdit:!1,rules:{realName:[{required:!0,message:"请输入真实姓名",trigger:"blur"}],idCard:[{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:{setUserInfo:function(){this.type=this.$route.query.type,this.user=Object(s.I)("user")&&Object(s.I)("user").userVO},submitIndividualAuth:function(){var t=this;return this.$refs.individualForm.validate(function(t){if(!t)return Object(d.a)("error","信息填写不规范"),!1}),this.individualForm.idCardPositivePhoto?this.individualForm.idCardBackPhoto?(this.showLoading(),void(1==this.$route.query.type?r.a.post("/api/user/"+this.user.id+"/personalAuth",this.individualForm).then(function(a){a&&(Object(d.a)("success","提交成功"),t.$router.push("/personal/authentication"))}).catch(function(a){t.hideLoading(),Object(d.a)("error",a.data)}):r.a.put("/api/user/"+this.user.id+"/personalAuth",this.individualForm).then(function(a){a&&(Object(d.a)("success","修改成功"),t.$router.push("/personal/authentication"))}).catch(function(a){console.log("错误信息"),console.log(a),t.hideLoading(),Object(d.a)("error",a.data)}))):(Object(d.a)("error","身份证反面照片上传不规范"),!1):(Object(d.a)("error","身份证正面照片上传不规范"),!1)},getAuthStatus:function(){var t=this;r.a.get("/api/user/"+this.user.id).then(function(a){a.personalAuthVO?(t.authType=1,t.authStatus=a.personalAuthVO.authStatus,"success"!==t.authStatus.style&&(t.canEdit=!0),t.failureReason=a.personalAuthVO.explain,t.setFormInfo(a.personalAuthVO)):(t.authType=0,t.canEdit=!0)}).catch(function(t){Object(d.a)("error",t.data)})},setFormInfo:function(t){this.individualForm.roleList=t.roleList,this.individualForm.realName=t.realName,this.individualForm.gender=t.gender,this.individualForm.idCard=t.idCard,this.individualForm.address=t.address,this.individualForm.idCardPositivePhoto=t.idCardPositivePhoto,this.individualForm.idCardBackPhoto=t.idCardBackPhoto,this.individualForm.idCardDeadTime=t.idCardDeadTime},beforeFileUpload:function(t){if(t.size>1e7)return Object(d.a)("error","单个文件大小不能超过5M"),!1;var a=t.name,i=a.lastIndexOf(".");if(i<=0)return Object(d.a)("error","只能上传png/jpg/jpeg格式的文件"),!1;var e=a.substr(i);return".jpg"!==e&&".png"!==e&&".jpeg"!==e?(Object(d.a)("error","只能上传png/jpg/jpeg格式的文件"),!1):void 0},uploadFile:function(t){var a=this,i=new FormData;i.append("file",t.file),r.a.upload(e.a.FILE.UPLOAD_IMAGE.replace("{userId}",this.user.id),i,{headers:{"Content-Type":"multipart/form-data"}}).then(function(i){0===t.data.type?a.individualForm.idCardPositivePhoto=i.data:a.individualForm.idCardBackPhoto=i.data,Object(d.a)("success","上传成功")}).catch(function(t){Object(d.a)("error",t.data)})},showLoading:function(){this.loading=!0},hideLoading:function(){this.loading=!1}},mounted:function(){this.setUserInfo(),this.getAuthStatus()}},o={render:function(){var t=this,a=t.$createElement,i=t._self._c||a;return i("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"right-modifyPsw",attrs:{id:"individualAuth"}},[i("div",{staticClass:"right-modifyPsw-title"},[i("span",{staticStyle:{"font-size":"18px","font-weight":"bold","margin-right":"10px"}},[t._v("个人认证")]),t._v(" "),1===t.authType?i("el-tag",{attrs:{type:t.authStatus.style}},[t._v(t._s(t.authStatus.text))]):t._e(),t._v(" "),0===t.authType?i("el-tag",{attrs:{type:"danger"}},[t._v("未认证")]):t._e()],1),t._v(" "),t.failureReason&&""!==t.failureReason?i("el-alert",{attrs:{title:t.failureReason,type:"error"}}):t._e(),t._v(" "),i("el-form",{ref:"individualForm",staticStyle:{width:"70%","margin-top":"10px"},attrs:{model:t.individualForm,rules:t.rules,"label-width":"140px"}},[i("el-form-item",{attrs:{label:"真实姓名",prop:"realName"}},[i("el-input",{attrs:{disabled:!t.canEdit,placeholder:"请输入您的姓名,需与身份证保持一致"},model:{value:t.individualForm.realName,callback:function(a){t.$set(t.individualForm,"realName",a)},expression:"individualForm.realName"}})],1),t._v(" "),i("el-form-item",{attrs:{label:"身份证号码",prop:"idCard"}},[i("el-input",{attrs:{disabled:!t.canEdit,placeholder:"身份证前后不能有空格"},model:{value:t.individualForm.idCard,callback:function(a){t.$set(t.individualForm,"idCard",a)},expression:"individualForm.idCard"}})],1),t._v(" "),i("el-form-item",{attrs:{label:"性别",prop:"gender"}},[i("el-radio-group",{attrs:{disabled:!t.canEdit},model:{value:t.individualForm.gender,callback:function(a){t.$set(t.individualForm,"gender",a)},expression:"individualForm.gender"}},[i("el-radio",{attrs:{label:"男"}}),t._v(" "),i("el-radio",{attrs:{label:"女"}})],1)],1),t._v(" "),i("el-form-item",{attrs:{label:"身份证到期时间",prop:"idCardDeadTime"}},[i("el-date-picker",{staticStyle:{width:"100%"},attrs:{align:"right",type:"date",placeholder:"请按身份证背面“有效期限”如实填写",disabled:!t.canEdit},model:{value:t.individualForm.idCardDeadTime,callback:function(a){t.$set(t.individualForm,"idCardDeadTime",a)},expression:"individualForm.idCardDeadTime"}})],1),t._v(" "),i("el-form-item",{attrs:{label:"家庭或单位地址",prop:"address"}},[i("el-input",{attrs:{disabled:!t.canEdit},model:{value:t.individualForm.address,callback:function(a){t.$set(t.individualForm,"address",a)},expression:"individualForm.address"}})],1),t._v(" "),i("el-form-item",{attrs:{label:"认证权限",prop:"roleList"}},[i("el-checkbox-group",{attrs:{disabled:!t.canEdit},model:{value:t.individualForm.roleList,callback:function(a){t.$set(t.individualForm,"roleList",a)},expression:"individualForm.roleList"}},[i("el-checkbox",{attrs:{label:1}},[t._v("发包")]),t._v(" "),i("el-checkbox",{attrs:{label:0}},[t._v("接包")])],1)],1)],1),t._v(" "),i("div",{staticClass:"upload-wrapper"},[i("el-row",{staticStyle:{width:"100%"}},[i("el-col",{staticStyle:{"padding-left":"30px"},attrs:{span:9}},[i("div",{staticStyle:{width:"280px"}},[i("el-upload",{staticClass:"avatar-uploader",staticStyle:{border:"lightgrey 1px solid"},attrs:{action:"https://jsonplaceholder.typicode.com/posts/","before-upload":t.beforeFileUpload,"http-request":t.uploadFile,data:{type:0},disabled:!t.canEdit}},[t.individualForm.idCardPositivePhoto?i("img",{staticClass:"avatar",attrs:{src:t.individualForm.idCardPositivePhoto}}):i("i",{staticClass:"el-icon-plus avatar-uploader-icon card-uploader-icon"})]),t._v(" "),i("div",{staticStyle:{"text-align":"center"}},[t._v("身份证正面照"),i("span",{staticStyle:{color:"red"}},[t._v("(必填)")])])],1)]),t._v(" "),i("el-col",{attrs:{span:15}},[i("div",{staticClass:"authentication-detail"},[i("div",{staticClass:"authentication-detail-title"},[t._v("证件要求")]),t._v(" "),i("el-row",[i("el-col",{attrs:{span:11}},[i("div",{staticClass:"idcard-example1"})]),t._v(" "),i("el-col",{staticStyle:{"padding-left":"10px"},attrs:{span:13}},[i("ul",{staticClass:"authentication-detail-list"},[i("li",[t._v("请上传本人"),i("span",{staticClass:"authentication-detail-list-blue"},[t._v("手持")]),t._v("身份证正面头部照片和上 半身照片")]),t._v(" "),i("li",[t._v("照片为免冠、未化妆的数码照片原始图片"),i("span",{staticClass:"authentication-detail-list-blue"},[t._v("请勿用任何软件编辑修改")])]),t._v(" "),i("li",[t._v("必须看清证件信息,且证件信息不能被遮挡, 持证人五官清晰可见")]),t._v(" "),i("li",[t._v("仅支持.jpg .png .jpeg的图片格式,图 片大小不超过3M")]),t._v(" "),i("li",[t._v("核实手持证件与原件方向一致,对焦身份证 进行拍照")]),t._v(" "),i("li",[t._v("您提供的照片众测服务平台将予以保护,不 会用于其他用途")])])])],1)],1)])],1),t._v(" "),i("el-row",{staticStyle:{width:"100%"}},[i("el-col",{staticStyle:{"padding-left":"30px"},attrs:{span:9}},[i("div",[i("el-upload",{staticClass:"avatar-uploader",staticStyle:{border:"lightgrey 1px solid"},attrs:{action:"https://jsonplaceholder.typicode.com/posts/","before-upload":t.beforeFileUpload,"http-request":t.uploadFile,data:{type:1},disabled:!t.canEdit}},[t.individualForm.idCardBackPhoto?i("img",{staticClass:"avatar",attrs:{src:t.individualForm.idCardBackPhoto}}):i("i",{staticClass:"el-icon-plus avatar-uploader-icon card-uploader-icon"})]),t._v(" "),i("div",{staticStyle:{"text-align":"center"}},[t._v("身份证反面照"),i("span",{staticStyle:{color:"red"}},[t._v("(必填)")])])],1)]),t._v(" "),i("el-col",{attrs:{span:15}},[i("div",{staticClass:"authentication-detail"},[i("div",{staticStyle:{height:"40px",width:"100%"}}),t._v(" "),i("el-row",[i("el-col",{attrs:{span:11}},[i("div",{staticClass:"idcard-example2"})]),t._v(" "),i("el-col",{staticStyle:{"padding-left":"10px"},attrs:{span:13}},[i("ul",{staticClass:"authentication-detail-list"},[i("li",[t._v("必须看清证件信息,且证件信息不能被遮挡")]),t._v(" "),i("li",[t._v("仅支持.jpg .bmp .png .gif的图片格式,图 片大小不超过3M")]),t._v(" "),i("li",[t._v("您提供的照片众测服务平台将予以保护,不 会用于其他用途")])])])],1)],1)])],1)],1),t._v(" "),i("div",{staticClass:"enterprise-brn-wrapper"},[t.canEdit&&0===t.authType?i("el-button",{staticStyle:{cursor:"pointer"},attrs:{type:"primary"},on:{click:t.submitIndividualAuth}},[t._v("提交审核")]):t._e(),t._v(" "),t.canEdit&&0!=t.authType?i("el-button",{staticStyle:{cursor:"pointer"},attrs:{type:"primary"},on:{click:t.submitIndividualAuth}},[t._v("修改审核")]):t._e()],1)],1)},staticRenderFns:[]};var n=i("VU/8")(l,o,!1,function(t){i("Y2mH"),i("ALPt")},"data-v-259b8067",null);a.default=n.exports},Y2mH:function(t,a){}});