webpackJsonp([56],{"H+hg":function(a,t,e){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={data:function(){return{visible:!1,dataForm:{unitId:0,plantName:"",name:"",orderNum:"",delFlag:"",cname:"",remarks:""},dataRule:{plantName:[{required:!0,message:this.$t("plantName")+this.$t("notEmpty"),trigger:"blur"}],name:[{required:!0,message:this.$t("name")+this.$t("notEmpty"),trigger:"blur"}]}}},methods:{init:function(a){var t=this;this.dataForm.unitId=a||0,this.visible=!0,this.$nextTick(function(){t.$refs.dataForm.resetFields(),t.dataForm.unitId&&t.$http({url:t.$http.adornUrl("/sys/sysunit/info/"+t.dataForm.unitId),method:"get",params:t.$http.adornParams()}).then(function(a){var e=a.data;e&&0===e.code&&(t.dataForm.plantName=e.sysUnit.plantName,t.dataForm.name=e.sysUnit.name,t.dataForm.orderNum=e.sysUnit.orderNum,t.dataForm.delFlag=e.sysUnit.delFlag,t.dataForm.cname=e.sysUnit.cname,t.dataForm.remarks=e.sysUnit.remarks)})})},dataFormSubmit:function(){var a=this;this.$refs.dataForm.validate(function(t){t&&a.$http({url:a.$http.adornUrl("/sys/sysunit/"+(a.dataForm.unitId?"update":"save")),method:"post",data:a.$http.adornData({unitId:a.dataForm.unitId||void 0,plantName:a.dataForm.plantName,name:a.dataForm.name,orderNum:a.dataForm.orderNum,delFlag:a.dataForm.delFlag,cname:a.dataForm.cname,remarks:a.dataForm.remarks})}).then(function(t){var e=t.data;e&&0===e.code?a.$message({message:a.$t("message.success"),type:"success",duration:1500,onClose:function(){a.visible=!1,a.$emit("refreshDataList")}}):a.$message.error(e.msg)})})}}},n={render:function(){var a=this,t=a.$createElement,e=a._self._c||t;return e("el-dialog",{attrs:{title:a.dataForm.id?a.$t("edit"):a.$t("add"),"close-on-click-modal":!1,visible:a.visible},on:{"update:visible":function(t){a.visible=t}}},[e("el-form",{ref:"dataForm",attrs:{model:a.dataForm,rules:a.dataRule,"label-width":"80px"},nativeOn:{keyup:function(t){if(!("button"in t)&&a._k(t.keyCode,"enter",13,t.key,"Enter"))return null;a.dataFormSubmit()}}},[e("el-form-item",{attrs:{label:a.$t("plantName"),prop:"plantName"}},[e("el-input",{attrs:{placeholder:a.$t("plantName")},model:{value:a.dataForm.plantName,callback:function(t){a.$set(a.dataForm,"plantName",t)},expression:"dataForm.plantName"}})],1),a._v(" "),e("el-form-item",{attrs:{label:a.$t("name"),prop:"name"}},[e("el-input",{attrs:{placeholder:a.$t("name")},model:{value:a.dataForm.name,callback:function(t){a.$set(a.dataForm,"name",t)},expression:"dataForm.name"}})],1),a._v(" "),e("el-form-item",{attrs:{label:a.$t("nameCN"),prop:"cname"}},[e("el-input",{attrs:{placeholder:a.$t("nameCN")},model:{value:a.dataForm.cname,callback:function(t){a.$set(a.dataForm,"cname",t)},expression:"dataForm.cname"}})],1),a._v(" "),e("el-form-item",{attrs:{label:a.$t("remark"),prop:"remarks"}},[e("el-input",{attrs:{placeholder:a.$t("remark")},model:{value:a.dataForm.remarks,callback:function(t){a.$set(a.dataForm,"remarks",t)},expression:"dataForm.remarks"}})],1)],1),a._v(" "),e("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:function(t){a.visible=!1}}},[a._v(a._s(a.$t("message.cancel")))]),a._v(" "),e("el-button",{attrs:{type:"primary"},on:{click:function(t){a.dataFormSubmit()}}},[a._v(a._s(a.$t("message.confirm")))])],1)],1)},staticRenderFns:[]},m=e("VU/8")(r,n,!1,null,null,null);t.default=m.exports}});