webpackJsonp([30],{AdJp:function(e,o,n){"use strict";Object.defineProperty(o,"__esModule",{value:!0});var a=n("WSbm"),t=n("P9l9"),s={name:"employeeDetail",components:{employeeInfo:a.a},data:function(){return{managerMode:!1}},methods:{save:function(e){var o=this.$refs.emmployInfo.info;console.log(o,"ssss"),this.isNew?this.addEmployee(o,e):this.saveEmployeeInfo(o)},addEmployee:function(e,o){var n=this,a={name:e.name,isClerk:0,phoneNumber:e.phoneNumber,positionName:e.positionName,departmentId:e.departmentId,managerMode:1*e.managerMode};console.log(e,a),Object(t.a)("/haoban-manage-web/emp/add",a).then(function(e){console.log(e,"add result"),1==e.data.errorCode?(n.$message.success({message:"操作成功"}),1==o?n.$refs.emmployInfo.info={name:"",phoneNumber:"",departmentId:"",departmentName:"",managerMode:!1}:window.history.go(-1)):n.$message.error({message:e.data.message})}).catch(function(e){console.log(e,"error")})},saveEmployeeInfo:function(e){var o=this,n={name:e.name,phoneNumber:e.phoneNumber,positionName:e.positionName,employeeClerkId:o.$route.query.employeeClerkId,managerMode:1*e.managerMode};console.log(e,n),Object(t.a)("/haoban-manage-web/emp/update",n).then(function(e){console.log(e,"update result"),1==e.data.errorCode?o.$message.success({message:"操作成功"}):o.$message.error({message:e.data.message})}).catch(function(e){console.log(e,"error"),o.$message.error({message:e.message})})},cancel:function(){this.$confirm(" 是否确认取消，取消后当前页面信息将丢失 ？","提示",{type:"warning"}).then(function(){window.history.go(-1)}).catch(function(e){console.log(e)})}},computed:{isNew:function(){return 1==!!this.$route.query.addnew}}},r={render:function(){var e=this,o=e.$createElement,n=e._self._c||o;return n("div",{staticClass:"employee-detail"},[n("employee-info",{ref:"emmployInfo",attrs:{isNew:e.isNew}}),e._v(" "),n("div",{staticClass:"btn-boxs"},[n("el-button",{attrs:{type:"primary"},on:{click:e.save}},[e._v("保存")]),e._v(" "),e.isNew?n("el-button",{attrs:{type:"primary"},on:{click:function(o){e.save(1)}}},[e._v("保存并继续添加")]):e._e(),e._v(" "),n("el-button",{on:{click:e.cancel}},[e._v("取消")])],1)],1)},staticRenderFns:[]};var m=n("VU/8")(s,r,!1,function(e){n("PLur")},null,null);o.default=m.exports},PLur:function(e,o){}});
//# sourceMappingURL=30.5c3baf1b5c4e15c42acf.js.map