webpackJsonp([44],{DF1c:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={data:function(){return{visible:!1,dataForm:{id:0,productName:"",productCode:"",length:"",heigth:"",width:"",remark:""},dataRule:{productName:[{required:!0,message:"板材名称不能为空",trigger:"blur"}],productCode:[{required:!0,message:"编码不能为空",trigger:"blur"}],length:[{required:!0,message:"长不能为空",trigger:"blur"}],heigth:[{required:!0,message:"高不能为空",trigger:"blur"}],width:[{required:!0,message:"宽不能为空",trigger:"blur"}]}}},methods:{init:function(t){var e=this;this.dataForm.id=t||"",this.visible=!0,this.$nextTick(function(){e.$refs.dataForm.resetFields(),e.dataForm.id&&e.$http({url:e.$http.adornUrl("/work/mtproduct/info/"+e.dataForm.id),method:"get",params:e.$http.adornParams()}).then(function(t){var a=t.data;a&&0===a.code&&(e.dataForm=a.mtProduct)})})},dataFormSubmit:function(){var t=this;this.$refs.dataForm.validate(function(e){e&&t.$http({url:t.$http.adornUrl("/work/mtproduct/"+(t.dataForm.id?"update":"save")),method:"post",data:t.$http.adornData({id:t.dataForm.id||void 0,productName:t.dataForm.productName,productCode:t.dataForm.productCode,length:t.dataForm.length,heigth:t.dataForm.heigth,width:t.dataForm.width,remark:t.dataForm.remark})}).then(function(e){var a=e.data;a&&0===a.code?t.$message({message:"操作成功",type:"success",duration:1500,onClose:function(){t.visible=!1,t.$emit("refreshDataList")}}):t.$message.error(a.msg)})})}}},o={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-dialog",{attrs:{title:t.dataForm.id?"修改":"新增","close-on-click-modal":!1,visible:t.visible},on:{"update:visible":function(e){t.visible=e}}},[a("el-form",{ref:"dataForm",attrs:{model:t.dataForm,rules:t.dataRule,"label-width":"80px"},nativeOn:{keyup:function(e){if(!("button"in e)&&t._k(e.keyCode,"enter",13,e.key,"Enter"))return null;t.dataFormSubmit()}}},[a("el-form-item",{attrs:{label:"板材名称",prop:"productName"}},[a("el-input",{attrs:{placeholder:"板材名称",clearable:""},model:{value:t.dataForm.productName,callback:function(e){t.$set(t.dataForm,"productName",e)},expression:"dataForm.productName"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"编码",prop:"productCode"}},[a("el-input",{attrs:{placeholder:"产品编码",clearable:""},model:{value:t.dataForm.productCode,callback:function(e){t.$set(t.dataForm,"productCode",e)},expression:"dataForm.productCode"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"长",prop:"length"}},[a("el-input",{attrs:{placeholder:"长",clearable:""},model:{value:t.dataForm.length,callback:function(e){t.$set(t.dataForm,"length",e)},expression:"dataForm.length"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"宽",prop:"width"}},[a("el-input",{attrs:{placeholder:"宽",clearable:""},model:{value:t.dataForm.width,callback:function(e){t.$set(t.dataForm,"width",e)},expression:"dataForm.width"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"高",prop:"heigth"}},[a("el-input",{attrs:{placeholder:"高",clearable:""},model:{value:t.dataForm.heigth,callback:function(e){t.$set(t.dataForm,"heigth",e)},expression:"dataForm.heigth"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"备注",prop:"remark"}},[a("el-input",{attrs:{placeholder:"",clearable:""},model:{value:t.dataForm.remark,callback:function(e){t.$set(t.dataForm,"remark",e)},expression:"dataForm.remark"}})],1)],1),t._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(e){t.visible=!1}}},[t._v("取消")]),t._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(e){t.dataFormSubmit()}}},[t._v("确定")])],1)],1)},staticRenderFns:[]},l=a("VU/8")(r,o,!1,null,null,null);e.default=l.exports}});