12.84ceb10adfcf6e67c29f.js 7.7 KB

1
  1. webpackJsonp([12],{"0ooM":function(i,t){},"4Cda":function(i,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=a("rySA"),l=a("vGYV"),n=a("SQ4B"),o=a("qI5z"),s={name:"MyQualification",components:{QualificationCard:e.a},data:function(){return{deleteQualification:!1,addQualification:!1,form:{name:"",number:"",licensingAuthority:"",time:"",isPublic:""},user:{},qualificationVOList:[],modalTitle:"新增资质",pickerOptions:{disabledDate:function(i){return i.getTime()>Date.now()},shortcuts:[{text:"今天",onClick:function(i){i.$emit("pick",new Date)}},{text:"昨天",onClick:function(i){var t=new Date;t.setTime(t.getTime()-864e5),i.$emit("pick",t)}},{text:"一周前",onClick:function(i){var t=new Date;t.setTime(t.getTime()-6048e5),i.$emit("pick",t)}}]},value2:"",rules:{name:[{required:!0,message:"证书名称不可为空",trigger:"blur"},{min:2,max:50,message:"报告名称长度在 2 到 50 个字符",trigger:"blur"}],number:[{required:!0,message:"证书编号不可为空",trigger:"blur"}],licensingAuthority:[{required:!0,message:"发证机构不可为空",trigger:"blur"}],time:[{required:!0,message:"发证时间不可为空",trigger:"blur"}],isPublic:[{required:!0,message:"公开类型不可为空",trigger:"blur"}]}}},methods:{loadData:function(){var i=this;n.a.get("/api/personal/displayqualification/"+this.user.id).then(function(t){i.qualificationVOList=t.qualificationVOList})},setUserInfo:function(){this.user=Object(l.K)("user")&&Object(l.K)("user").userVO},handleAddQualification:function(){var i=this;this.$refs.form.validate(function(t){if(t)if(i.form.id){var a={name:i.form.name,number:i.form.number,licensingAuthority:i.form.licensingAuthority,time:i.form.time,isPublic:i.form.isPublic};n.a.put("/api/personal/updatequalification/"+i.form.id+"/"+i.user.id,a).then(function(t){i.form=a,i.addQualification=!1,Object(o.a)("success","修改成功"),i.loadData()}).catch(function(i){Object(o.a)("error",i.data)})}else n.a.post("/api/personal/addqualification/"+i.user.id,i.form).then(function(t){i.addQualification=!1,Object(o.a)("success","添加成功"),i.loadData()}).catch(function(i){Object(o.a)("error",i.data)})})},requireDeleteQualification:function(i){this.deleteQualification=!0},handleDeleteQualification:function(i){var t=this;n.a.delete("/api/personal/deletequalification/"+this.form.id+"/"+this.user.id,{}).then(function(i){t.deleteQualification=!1,t.addQualification=!1,Object(o.a)("success","删除成功"),t.loadData()}).catch(function(i){Object(o.a)("error",i.data)})},handleEditQualification:function(i){var t=this;i.id?(n.a.get("/api/personal/displayone/"+i.id).then(function(i){t.form=i.qualificationVO}),this.modalTitle="编辑资质",this.addQualification=!0):(this.form={name:"",number:"",licensingAuthority:"",time:"",isPublic:""},this.modalTitle="新增资质",this.addQualification=!0)}},mounted:function(){this.setUserInfo(),this.loadData()}},r={render:function(){var i=this,t=i.$createElement,a=i._self._c||t;return a("div",[a("div",{staticClass:"right-qualification"},[a("div",{staticClass:"right-qualification-title"},[a("span",{staticStyle:{"font-size":"18px","font-weight":"bold"}},[i._v("我的资质")]),i._v(" "),a("el-button",{staticClass:"pull-right",attrs:{type:"primary",size:"mini"},on:{click:i.handleEditQualification}},[i._v("添加")])],1),i._v(" "),a("div",{staticStyle:{"margin-bottom":"15px"}},[a("QualificationCard",{attrs:{qualificationVOList:i.qualificationVOList},on:{handleEditQualification:i.handleEditQualification}})],1)]),i._v(" "),a("el-dialog",{attrs:{title:i.modalTitle,visible:i.addQualification,width:"30%"},on:{"update:visible":function(t){i.addQualification=t}}},[a("el-form",{ref:"form",attrs:{rules:i.rules,model:i.form,"label-width":"80px"}},[a("el-form-item",{attrs:{label:"证书名称",prop:"name"}},[a("el-input",{model:{value:i.form.name,callback:function(t){i.$set(i.form,"name",t)},expression:"form.name"}})],1),i._v(" "),a("el-form-item",{attrs:{label:"证书编号",prop:"number"}},[a("el-input",{model:{value:i.form.number,callback:function(t){i.$set(i.form,"number",t)},expression:"form.number"}})],1),i._v(" "),a("el-form-item",{attrs:{label:"发证机构",prop:"licensingAuthority"}},[a("el-input",{model:{value:i.form.licensingAuthority,callback:function(t){i.$set(i.form,"licensingAuthority",t)},expression:"form.licensingAuthority"}})],1),i._v(" "),a("el-form-item",{attrs:{label:"发证时间",prop:"time"}},[a("div",{staticClass:"block"},[a("el-date-picker",{staticStyle:{width:"100%"},attrs:{align:"right",type:"date",placeholder:"选择日期","picker-options":i.pickerOptions},model:{value:i.form.time,callback:function(t){i.$set(i.form,"time",t)},expression:"form.time"}})],1)]),i._v(" "),a("el-form-item",{attrs:{label:"是否公开",prop:"isPublic"}},[a("el-radio-group",{model:{value:i.form.isPublic,callback:function(t){i.$set(i.form,"isPublic",t)},expression:"form.isPublic"}},[a("el-radio",{attrs:{label:1}},[i._v("公开")]),i._v(" "),a("el-radio",{attrs:{label:0}},[i._v("不公开")])],1)],1)],1),i._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){i.addQualification=!1}}},[i._v("取 消")]),i._v(" "),i.form.id?a("el-button",{attrs:{type:"danger"},on:{click:i.requireDeleteQualification}},[i._v("删 除")]):i._e(),i._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:i.handleAddQualification}},[i._v("确 定")])],1)],1),i._v(" "),a("el-dialog",{attrs:{title:"删除资质提示",visible:i.deleteQualification,width:"30%"},on:{"update:visible":function(t){i.deleteQualification=t}}},[a("span",[i._v("确定删除资质 "),a("span",{staticStyle:{"font-weight":"bold","font-size":"18px"}},[i._v(i._s(i.form.name))]),i._v(" 吗?")]),i._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){i.deleteQualification=!1}}},[i._v("取 消")]),i._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:i.handleDeleteQualification}},[i._v("确 定")])],1)])],1)},staticRenderFns:[]};var c=a("VU/8")(s,r,!1,function(i){a("0ooM")},"data-v-5365684b",null);t.default=c.exports},HlqX:function(i,t){},rySA:function(i,t,a){"use strict";var e={name:"QualifucationCard",props:["qualificationVOList"],methods:{showQualificationDetail:function(i){console.log("item"),this.$emit("handleEditQualification",i)}}},l={render:function(){var i=this,t=i.$createElement,a=i._self._c||t;return a("div",[a("el-row",{attrs:{gutter:15}},i._l(i.qualificationVOList,function(t){return a("el-col",{key:t.id,attrs:{span:8}},[a("div",{staticClass:"qualification-card",on:{click:function(a){return i.showQualificationDetail(t)}}},[a("div",{staticClass:"qualification-card-title",staticStyle:{padding:"10px",height:"24px",overflow:"hidden"}},[a("span",{staticClass:"qualification-card-name pull-left"},[i._v(i._s(t.name))]),i._v(" "),a("el-button",{staticClass:"pull-right",attrs:{type:"primary",plain:"",size:"mini"}},[i._v("编辑")])],1),i._v(" "),a("div",{staticClass:"qualification-card-detail-wrapper"},[a("div",{staticClass:"qualification-card-detail"},[a("div",{staticClass:"qualification-card-detail-title"},[i._v("证书编号:")]),i._v(" "),a("div",{staticClass:"qualification-card-detail-info"},[i._v(i._s(t.number))])]),i._v(" "),a("div",{staticClass:"qualification-card-detail"},[a("div",{staticClass:"qualification-card-detail-title"},[i._v("发证机关:")]),i._v(" "),a("div",{staticClass:"qualification-card-detail-info"},[i._v(i._s(t.licensingAuthority))])]),i._v(" "),a("div",{staticClass:"qualification-card-detail"},[a("div",{staticClass:"qualification-card-detail-title"},[i._v("发证时间:")]),i._v(" "),a("div",{staticClass:"qualification-card-detail-info"},[i._v(i._s(t.time))])])])])])}),1)],1)},staticRenderFns:[]};var n=a("VU/8")(e,l,!1,function(i){a("HlqX")},"data-v-8e6fa292",null);t.a=n.exports}});