webpackJsonp([60],{"6qOo":function(e,t){},sypd:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=a("mvHQ"),r=a.n(o),n=(a("ftAF"),{created:function(){var e=this;this.$route.query.id&&this.$http.get({url:"/houseKeeper/getOne",data:{id:this.$route.query.id}}).then(function(t){t.success&&(e.formData=t.data)})},data:function(){return{saving:!1,formData:{},rules:{keepName:[{required:!0,message:"请输入名称",trigger:"blur"}],position:[{required:!0,message:"请输入职位",trigger:"blur"}],telephone:[{required:!0,message:"请输入电话",trigger:"blur"}]}}},methods:{onSave:function(){var e=this;this.$refs.form.validate(function(t){if(!t)return!1;e.submit()})},submit:function(){var e=this,t=JSON.parse(r()(this.formData));this.$http.post({url:this.formData.id?"/houseKeeper/update":"/houseKeeper/save",data:t}).then(function(t){t.success?(e.$message.success("成功"),e.$router.go(-1)):e.$message.warning("失败")})},onDelete:function(){var e=this;this.$alert("删除将无法恢复，确认要删除么？","警告",{type:"error"}).then(function(){return e.$http.post({url:"/houseKeeper/del",data:{id:e.formData.id}})}).then(function(){e.$message.success("删除成功"),e.$router.go(-1)}).catch(function(t){"cancel"===t?e.$message.info("删除取消"):e.$message.error("删除失败")})}}}),i={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("el-form",{ref:"form",staticStyle:{"max-width":"500px"},attrs:{model:e.formData,rules:e.rules,"label-width":"80px","label-position":"right",size:"small"}},[a("el-form-item",{attrs:{prop:"keepName",label:"名称"}},[a("el-input",{model:{value:e.formData.keepName,callback:function(t){e.$set(e.formData,"keepName",t)},expression:"formData.keepName"}})],1),e._v(" "),a("el-form-item",{attrs:{prop:"position",label:"职位"}},[a("el-input",{model:{value:e.formData.position,callback:function(t){e.$set(e.formData,"position",t)},expression:"formData.position"}})],1),e._v(" "),a("el-form-item",{attrs:{prop:"icon",label:"头像"}},[a("single-upload",{model:{value:e.formData.icon,callback:function(t){e.$set(e.formData,"icon",t)},expression:"formData.icon"}})],1),e._v(" "),a("el-form-item",{attrs:{prop:"telephone",label:"电话"}},[a("el-input",{model:{value:e.formData.telephone,callback:function(t){e.$set(e.formData,"telephone",t)},expression:"formData.telephone"}})],1),e._v(" "),a("el-form-item",{attrs:{prop:"sex",label:"性别"}},[a("el-input",{model:{value:e.formData.sex,callback:function(t){e.$set(e.formData,"sex",t)},expression:"formData.sex"}})],1),e._v(" "),a("el-form-item",{attrs:{prop:"introduce",label:"介绍"}},[a("el-input",{model:{value:e.formData.introduce,callback:function(t){e.$set(e.formData,"introduce",t)},expression:"formData.introduce"}})],1),e._v(" "),a("el-form-item",[a("el-button",{attrs:{loading:e.$store.state.fetchingData,type:"primary"},on:{click:e.onSave}},[e._v("保存")]),e._v(" "),e.formData.id?a("el-button",{attrs:{type:"danger"},on:{click:e.onDelete}},[e._v("删除")]):e._e(),e._v(" "),a("el-button",{on:{click:function(t){e.$router.go(-1)}}},[e._v("取消")])],1)],1)],1)},staticRenderFns:[]};var s=a("VU/8")(n,i,!1,function(e){a("6qOo")},"data-v-0d59e0fd",null);t.default=s.exports}});
//# sourceMappingURL=60.0e95ef104b438ff3215a.js.map