1 |
- webpackJsonp([33],{u1Yf:function(e,t,n){(t=n("yGwj")(!0)).push([e.i,"\n.el-radio[data-v-54be919b] {\n margin: 10px 20px 10px 0;\n}\n.el-form-item[data-v-54be919b] .el-tabs__content {\n /*max-height: 120px !important;*/\n overflow: auto;\n}\n.el-row[data-v-54be919b] {\n margin-bottom: 10px;\n}\n.el-input[data-v-54be919b] {\n width: 400px;\n}\n.avatar-uploader .el-upload[data-v-54be919b] {\n border: 1px dashed #d9d9d9;\n border-radius: 6px;\n cursor: pointer;\n position: relative;\n overflow: hidden;\n}\n.avatar-uploader .el-upload[data-v-54be919b]:hover {\n border-color: #409EFF;\n}\n.avatar-uploader-icon[data-v-54be919b] {\n border: 1px dashed #d9d9d9;\n border-radius: 6px;\n font-size: 28px;\n color: #8c939d;\n width: 176px;\n height: 178px;\n line-height: 178px;\n text-align: center;\n}\n.avatar-uploader-icon[data-v-54be919b]:hover {\n border-color: #409EFF;\n}\n.avatar[data-v-54be919b] {\n width: 178px;\n height: 178px;\n display: block;\n}\n","",{version:3,sources:["AgencyAuthentication.vue"],names:[],mappings:";AACA;EACE,wBAAwB;AAC1B;AACA;EACE,gCAAgC;EAChC,cAAc;AAChB;AACA;EACE,mBAAmB;AACrB;AACA;EACE,YAAY;AACd;AACA;EACE,0BAA0B;EAC1B,kBAAkB;EAClB,eAAe;EACf,kBAAkB;EAClB,gBAAgB;AAClB;AACA;EACE,qBAAqB;AACvB;AACA;EACE,0BAA0B;EAC1B,kBAAkB;EAClB,eAAe;EACf,cAAc;EACd,YAAY;EACZ,aAAa;EACb,kBAAkB;EAClB,kBAAkB;AACpB;AACA;EACE,qBAAqB;AACvB;AACA;EACE,YAAY;EACZ,aAAa;EACb,cAAc;AAChB",file:"AgencyAuthentication.vue",sourcesContent:["\n.el-radio[data-v-54be919b] {\n margin: 10px 20px 10px 0;\n}\n.el-form-item[data-v-54be919b] .el-tabs__content {\n /*max-height: 120px !important;*/\n overflow: auto;\n}\n.el-row[data-v-54be919b] {\n margin-bottom: 10px;\n}\n.el-input[data-v-54be919b] {\n width: 400px;\n}\n.avatar-uploader .el-upload[data-v-54be919b] {\n border: 1px dashed #d9d9d9;\n border-radius: 6px;\n cursor: pointer;\n position: relative;\n overflow: hidden;\n}\n.avatar-uploader .el-upload[data-v-54be919b]:hover {\n border-color: #409EFF;\n}\n.avatar-uploader-icon[data-v-54be919b] {\n border: 1px dashed #d9d9d9;\n border-radius: 6px;\n font-size: 28px;\n color: #8c939d;\n width: 176px;\n height: 178px;\n line-height: 178px;\n text-align: center;\n}\n.avatar-uploader-icon[data-v-54be919b]:hover {\n border-color: #409EFF;\n}\n.avatar[data-v-54be919b] {\n width: 178px;\n height: 178px;\n display: block;\n}\n"]}]),e.exports=t},yWUp:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n("SQ4B"),i=n("b9vf"),o=n("qI5z"),r=n("vGYV"),s={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:r.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,n,a){e.checkNumber(n)?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,n){var a=!1;if(null==t||0==t.length)n(new Error("机构资源不可为空"));else for(var i=0;i<t.length;i++)if(""==t[i].name){a=!0;break}a?n(new Error("资源名称不可为空")):n()},trigger:"blur"}],agencyPhoto:[{validator:function(e,t,n){null==t||""==t?n(new Error("机构logo不可为空")):n()},trigger:"blur"}]}}},mounted:function(){var e=this;this.$nextTick(function(){e.init()})},methods:{init:function(){this.setServiceTypes(),this.setResourceTypes(),this.setUserInfo(),this.getAuthInfo()},getAuthInfo:function(){this.showLoading(),Object(r.t)(this.user.userVO.id,this.getAuthInfoSuccess,this.getAuthInfoFail)},getAuthInfoSuccess:function(e){this.hideLoading(),this.authentication.agencyPhoto=null==e.agencyPhoto?r.c.image:e.agencyPhoto,this.authentication.evaluationAgencyName=null==e.evaluationAgencyName?"暂未填写":e.evaluationAgencyName,this.authentication.evaluationAgencyAbilityList=null==e.evaluationAgencyAbilityList?[]:e.evaluationAgencyAbilityList,this.authentication.evaluationAgencyResourceList=null==e.evaluationAgencyResourceList?[]:e.evaluationAgencyResourceList,this.authentication.bankAccount=null==e.bankAccount?"暂未填写":e.bankAccount,this.authentication.address=null==e.address?"暂未填写":e.address,this.authentication.authStatus=e.authStatus,this.authentication.explain=e.explain,console.log(this.authentication)},getAuthInfoFail:function(e){this.hideLoading(),Object(o.a)("error","加载认证信息失败:"+e.data)},modifyInfo:function(){this.isModifyMode=!0},updateAuthInfo:function(){var e=this;this.$refs.authentication.validate(function(t){if(!t)return Object(o.a)("error","表单填写错误!"),!1;e.showLoading();var n={userId:e.user.userVO.id,evaluationAgencyName:e.authentication.evaluationAgencyName,bankAccount:e.authentication.bankAccount,address:e.authentication.address,evaluationAgencyAbilityList:e.authentication.evaluationAgencyAbilityList,evaluationAgencyResourceList:e.authentication.evaluationAgencyResourceList,agencyPhoto:e.authentication.agencyPhoto};Object(r.R)(e.user.userVO.id,n,e.updateAuthInfoSuccess,e.updateAuthInfoFail)})},updateAuthInfoSuccess:function(e){var t=this;console.log(e),this.hideLoading(),this.cancelModify(),Object(o.a)("success","认证信息修改成功,正在为您刷新用户信息"),Object(r.w)().then(function(e){Object(r.O)("user",e),t.user=e,t.sendBusMessage(),Object(r.O)("rolesPermissions",Object(r.C)(e.roleList)),t.hideLoading(),Object(o.a)("success","用户信息刷新成功")}).catch(function(e){t.hideLoading(),Object(o.a)("error","重新获取用户信息失败:"+e.data)})},updateAuthInfoFail:function(e){this.hideLoading(),Object(o.a)("error",e.data)},cancelModify:function(){this.isModifyMode=!1,this.getAuthInfo()},handleRemove:function(e,t){console.log(e,t)},handleExceed:function(e,t){this.$message.warning("当前限制选择 1 个文件,本次选择了 "+e.length+" 个文件,共选择了 "+(e.length+t.length)+" 个文件")},beforeRemove:function(e,t){},beforeFileUpload:function(e){if(e.size>1e7)return Object(o.a)("error","单个文件大小不能超过10M"),!1;var t=e.name,n=t.lastIndexOf(".");if(n<=0)return Object(o.a)("error","只能上传png/jpg格式的文件"),!1;var a=t.substr(n);return".jpg"!==a&&".png"!==a?(Object(o.a)("error","只能上传png/jpg格式的文件"),!1):void 0},uploadFile:function(e){var t=this,n=new FormData;n.append("file",e.file),a.a.upload(i.a.FILE.UPLOAD_IMAGE.replace("{userId}",this.user.userVO.id),n,{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(r.s)().then(function(t){e.serviceTypes=t}).catch(function(e){Object(o.a)("error","机构能力加载失败")})},setResourceTypes:function(){this.resourceTypes=Object(r.l)()},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<this.authentication.evaluationAgencyResourceList.length;t++)this.authentication.evaluationAgencyResourceList[t].id=t},checkAgencyResourceVaild:function(){if(0===this.authentication.evaluationAgencyResourceList.length)return!0;for(var e=0;e<this.authentication.evaluationAgencyResourceList.length;e++){var t=this.authentication.evaluationAgencyResourceList[e];if(""===t.type)return Object(o.a)("error","资源类型不能为空"),!1;if(""===t.name)return Object(o.a)("error","资源名称不能为空"),!1;if(t.totalNum<t.availableNum)return Object(o.a)("error","资源总数量不能低于可用数量"),!1}return!0},setUserInfo:function(){this.user=Object(r.M)("user")},showLoading:function(){this.loading=!0},hideLoading:function(){this.loading=!1},submitSuccess:function(){},sendBusMessage:function(){this.$root.$emit("user",this.user)},checkNumber:function(e){return/^\d+$/.test(e)}},created:function(){}},c=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"create-container"},[n("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"create-body",staticStyle:{width:"100%"}},[n("div",{staticClass:"title"},[e._v("测评机构认证")]),e._v(" "),n("el-form",{ref:"authentication",staticClass:"demo-report",attrs:{model:e.authentication,rules:e.rules,"label-width":"12%"}},[n("el-form-item",{attrs:{prop:"agencyPhoto",label:"机构logo"}},[e.isModifyMode?n("el-upload",{staticClass:"avatar-uploader",attrs:{action:"","show-file-list":!1,"http-request":e.uploadFile,"before-upload":e.beforeFileUpload}},[e.authentication.agencyPhoto?n("img",{staticClass:"avatar",attrs:{src:e.authentication.agencyPhoto}}):n("i",{staticClass:"el-icon-plus avatar-uploader-icon"})]):e._e(),e._v(" "),e.isModifyMode?e._e():n("span",[n("el-image",{staticStyle:{width:"100px"},attrs:{src:e.authentication.agencyPhoto,fit:"scale-down"}})],1)],1),e._v(" "),n("el-form-item",{attrs:{label:"机构名称",prop:"evaluationAgencyName"}},[e.isModifyMode?n("el-input",{model:{value:e.authentication.evaluationAgencyName,callback:function(t){e.$set(e.authentication,"evaluationAgencyName",t)},expression:"authentication.evaluationAgencyName"}}):e._e(),e._v(" "),e.isModifyMode?e._e():n("span",[e._v(e._s(e.authentication.evaluationAgencyName))])],1),e._v(" "),e.isModifyMode?e._e():n("el-form-item",{attrs:{label:"认证状态",prop:"name"}},[n("el-tag",{attrs:{type:e.authentication.authStatus.style}},[e._v(e._s(e.authentication.authStatus.text))])],1),e._v(" "),e.isModifyMode||"认证失败"!=e.authentication.authStatus.text?e._e():n("el-form-item",{attrs:{label:"失败原因",prop:"name"}},[null!=e.authentication.explain&&""!=e.authentication.explain?n("el-link",{attrs:{type:"danger",disabled:""}},[e._v("\n "+e._s(e.authentication.explain)+"\n ")]):e._e(),e._v(" "),null==e.authentication.explain||""==e.authentication.explain?n("el-link",{attrs:{type:"danger",disabled:""}},[e._v("管理员未填写\n ")]):e._e()],1),e._v(" "),n("el-form-item",{attrs:{label:"地址",prop:"address"}},[e.isModifyMode?n("el-input",{model:{value:e.authentication.address,callback:function(t){e.$set(e.authentication,"address",t)},expression:"authentication.address"}}):e._e(),e._v(" "),e.isModifyMode?e._e():n("span",[e._v(e._s(e.authentication.address))])],1),e._v(" "),n("el-form-item",{attrs:{label:"测评机构能力",prop:"evaluationAgencyAbilityList"}},[e.isModifyMode?n("el-checkbox-group",{model:{value:e.authentication.evaluationAgencyAbilityList,callback:function(t){e.$set(e.authentication,"evaluationAgencyAbilityList",t)},expression:"authentication.evaluationAgencyAbilityList"}},e._l(e.serviceTypes,function(t,a){return n("span",{key:a},[n("el-checkbox",{attrs:{label:t,name:"type"}},[e._v(e._s(t)+" ")])],1)}),0):e._e(),e._v(" "),e._l(e.authentication.evaluationAgencyAbilityList,function(t,a){return e.isModifyMode?e._e():n("span",{key:a},[n("span",{staticClass:"badge"},[e._v(e._s(t))])])})],2),e._v(" "),n("el-form-item",{attrs:{label:"测评机构资源",prop:"evaluationAgencyResourceList"}},[e._l(e.authentication.evaluationAgencyResourceList,function(t){return e.isModifyMode?n("span",{key:t.id,staticStyle:{width:"2000px"}},[e._v("\n 资源类型: "),n("el-select",{staticStyle:{width:"15%","margin-bottom":"10px"},attrs:{placeholder:"请选择",value:t.type},model:{value:t.type,callback:function(n){e.$set(t,"type",n)},expression:"item.type"}},e._l(e.resourceTypes,function(e){return n("el-option",{key:e,attrs:{label:e,value:e}})}),1),e._v("\n 资源名称: "),n("el-input",{staticStyle:{width:"15%"},model:{value:t.name,callback:function(n){e.$set(t,"name",n)},expression:"item.name"}}),e._v("\n 总量: "),n("el-input-number",{staticStyle:{width:"15%"},attrs:{min:0},model:{value:t.totalNum,callback:function(n){e.$set(t,"totalNum",n)},expression:"item.totalNum"}}),e._v("\n 可用数量: "),n("el-input-number",{staticStyle:{width:"15%"},attrs:{min:0,max:t.totalNum},model:{value:t.availableNum,callback:function(n){e.$set(t,"availableNum",n)},expression:"item.availableNum"}}),e._v(" "),n("el-button",{attrs:{type:"danger",icon:"el-icon-delete"},on:{click:function(n){return e.removeAgencyResource(t.id)}}}),e._v(" "),n("br")],1):e._e()}),e._v(" "),e.isModifyMode?n("el-button",{attrs:{type:"primary",icon:"el-icon-circle-plus",plain:"",size:"small"},on:{click:e.addAgencyResource}},[e._v("添加资源\n ")]):e._e(),e._v(" "),e._l(e.authentication.evaluationAgencyResourceList,function(t){return e.isModifyMode?e._e():n("span",{key:t.id},[e._v("\n 资源类型:"+e._s(t.type)+"; 资源名称:"+e._s(t.name)+"; 资源总量:"+e._s(t.totalNum)+"; 可用资源:"+e._s(t.availableNum)),n("br")])})],2),e._v(" "),e.isModifyMode?e._e():n("el-form-item",[n("div",{staticClass:"btn btn-medium btn-info",on:{click:function(t){return e.modifyInfo()}}},[e._v("修改")])]),e._v(" "),e.isModifyMode?n("el-form-item",[n("div",{staticClass:"btn btn-primary btn-info",on:{click:function(t){return e.updateAuthInfo()}}},[e._v("提交")]),e._v(" "),n("div",{staticClass:"btn btn-primary",on:{click:function(t){return e.cancelModify()}}},[e._v("取消")])]):e._e()],1)],1)])};c._withStripped=!0;var u={render:c,staticRenderFns:[]},l=u;var d=!1;var h=n("VU/8")(s,l,!1,function(e){d||n("z0yf")},"data-v-54be919b",null);h.options.__file="src/components/authen/AgencyAuthentication.vue";t.default=h.exports},z0yf:function(e,t,n){var a=n("u1Yf");"string"==typeof a&&(a=[[e.i,a,""]]),a.locals&&(e.exports=a.locals);n("rjj0")("03ca2377",a,!1,{})}});
|