webpackJsonp([45],{AdJp:function(e,a,t){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var n=t("Xxa5"),o=t.n(n),r=t("exGp"),s=t.n(r),m=t("3Xzz"),i=t("WSbm"),c=t("P9l9"),d={name:"employeeDetail",components:{navCrumb:m.a,employeeInfo:i.a},data:function(){return{navpath:[{name:"首页",path:"/index"},{name:"企业通讯录",path:"/administrativeFrame"},{name:"行政架构",path:"/administrativeFrame"},{name:"添加员工",path:""}],navpathEdit:[{name:"首页",path:"/index"},{name:"企业通讯录",path:"/administrativeFrame"},{name:"行政架构",path:"/administrativeFrame"},{name:"编辑员工",path:""}],managerMode:!1}},methods:{save:function(e){var a=this;return s()(o.a.mark(function t(){var n;return o.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,a.$refs.emmployInfo.submitForm("employeeForm");case 2:t.sent&&(n=a.$refs.emmployInfo.info,a.isNew?a.addEmployee(n,e):a.saveEmployeeInfo(n));case 4:case"end":return t.stop()}},t,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,nationcode:e.nationcode};Object(c.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,nationcode:"86"},t.$refs.emmployInfo.defaultSelection=[],t.$refs.emmployInfo.resetForm("employeeForm")):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,nationcode:e.nationcode};Object(c.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}},mounted:function(){this.$route.query.addnew||(this.navpath=this.navpathEdit)}},p={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 u=t("VU/8")(d,p,!1,function(e){t("XqOc")},null,null);a.default=u.exports},XqOc:function(e,a){}});