webpackJsonp([40],{"7FRW":function(e,a){},AdJp:function(e,a,t){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var n=t("3Xzz"),o=t("WSbm"),s=t("P9l9"),r={name:"employeeDetail",components:{navCrumb:n.a,employeeInfo:o.a},data:function(){return{navpath:[{name:"首页",path:"/index"},{name:"企业通讯录",path:"/administrativeFrame"},{name:"员工档案",path:"/fileSet"},{name:"添加员工",path:""}],managerMode:!1}},methods:{save:function(e){var a=this.$refs.emmployInfo.info;this.isNew?this.addEmployee(a,e):this.saveEmployeeInfo(a)},addEmployee:function(e,a){var t=this,n={name:e.name,isClerk:0,phoneNumber:e.phoneNumber,positionName:e.positionName,departmentId:e.departmentId,managerMode:1*e.managerMode};Object(s.a)("/haoban-manage-web/emp/add",n).then(function(e){1==e.data.errorCode?(t.$message.success({message:"操作成功"}),1==a?t.$refs.emmployInfo.info={name:"",phoneNumber:"",departmentId:"",departmentName:"",managerMode:!1}:window.history.go(-1)):t.$message.error({message:e.data.message})}).catch(function(e){})},saveEmployeeInfo:function(e){var a=this,t={name:e.name,phoneNumber:e.phoneNumber,positionName:e.positionName,departmentId:e.departmentId,employeeClerkId:a.$route.query.employeeClerkId,managerMode:1*e.managerMode};Object(s.a)("/haoban-manage-web/emp/update",t).then(function(e){1==e.data.errorCode?(a.$message.success({message:"操作成功"}),window.history.go(-1)):a.$message.error({message:e.data.message})}).catch(function(e){a.$message.error({message:e.message})})},cancel:function(){this.$confirm(" 是否确认取消，取消后当前页面信息将丢失 ？","提示",{type:"warning"}).then(function(){window.history.go(-1)}).catch(function(e){})}},computed:{isNew:function(){return 1==!!this.$route.query.addnew}}},i={render:function(){var e=this,a=e.$createElement,t=e._self._c||a;return t("div",{staticClass:"common-set-wrap"},[t("nav-crumb",{attrs:{navpath:e.navpath}}),e._v(" "),t("div",{staticClass:"right-content"},[t("div",{staticClass:"right-box"},[t("div",{staticClass:"employee-detail",style:{height:e.$store.state.bgHeight}},[t("employee-info",{ref:"emmployInfo",attrs:{isNew:e.isNew}}),e._v(" "),e.$route.query.readOnly?e._e():t("div",{staticClass:"btn-boxs"},[t("el-button",{attrs:{type:"primary"},on:{click:e.save}},[e._v("保 存")]),e._v(" "),e.isNew?t("el-button",{attrs:{type:"primary"},on:{click:function(a){e.save(1)}}},[e._v("保存并继续添加")]):e._e(),e._v(" "),t("el-button",{on:{click:e.cancel}},[e._v("取 消")])],1)],1)])])],1)},staticRenderFns:[]};var m=t("VU/8")(r,i,!1,function(e){t("7FRW")},null,null);a.default=m.exports}});