webpackJsonp([35],{Bdfa:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={components:{Upload:r("EAPc").default},data:function(){return{uploadVisible:!1,visible:!1,url:"",fileList:[],dataForm:{id:0,prdTypeName:"",prdTypeCode:"",createTime:"",updateTime:"",createUser:this.$store.state.user.name,prdTypeIcon:""},dataRule:{prdTypeName:[{required:!0,message:"产品分类名称不能为空",trigger:"blur"}],prdTypeCode:[{required:!0,message:"产品分类编号不能为空",trigger:"blur"}],createTime:[{required:!0,message:"创建时间不能为空",trigger:"blur"}],createUser:[{required:!0,message:"创建人不能为空",trigger:"blur"}]}}},methods:{init:function(e){var t=this;this.dataForm.id=e||0,this.visible=!0,this.$nextTick(function(){t.$refs.dataForm.resetFields(),t.dataForm.id&&t.$http({url:t.$http.adornUrl("//prdtype/info/"+t.dataForm.id),method:"get",params:t.$http.adornParams()}).then(function(e){var r=e.data;r&&0===r.code&&(t.dataForm.prdTypeName=r.prdType.prdTypeName,t.dataForm.prdTypeCode=r.prdType.prdTypeCode,t.dataForm.createTime=r.prdType.createTime,t.dataForm.updateTime=r.prdType.updateTime,t.dataForm.createUser=r.prdType.createUser,t.dataForm.updateUser=r.prdType.updateUser,t.dataForm.prdTypeIcon=r.prdType.prdTypeIcon)})})},dataFormSubmit:function(){var e=this;this.dataForm.prdTypeIcon=this.$refs.upload.fileList[0].response.url,this.$refs.dataForm.validate(function(t){t&&e.$http({url:e.$http.adornUrl("//prdtype/"+(e.dataForm.id?"update":"save")),method:"post",data:e.$http.adornData({id:e.dataForm.id||void 0,prdTypeName:e.dataForm.prdTypeName,prdTypeCode:e.dataForm.prdTypeCode,createTime:e.dataForm.createTime,createUser:e.dataForm.createUser,prdTypeIcon:e.dataForm.prdTypeIcon})}).then(function(t){var r=t.data;r&&0===r.code?e.$message({message:"操作成功",type:"success",duration:1500,onClose:function(){e.visible=!1,e.$emit("refreshDataList"),e.$refs.upload.fileList=[]}}):e.$message.error(r.msg)})})}}},d={render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("el-dialog",{attrs:{title:e.dataForm.id?"修改":"新增","close-on-click-modal":!1,visible:e.visible},on:{"update:visible":function(t){e.visible=t}}},[r("el-form",{ref:"dataForm",attrs:{model:e.dataForm,rules:e.dataRule,"label-width":"80px"},nativeOn:{keyup:function(t){if(!("button"in t)&&e._k(t.keyCode,"enter",13,t.key,"Enter"))return null;e.dataFormSubmit()}}},[r("el-form-item",{attrs:{label:"产品分类名称",prop:"prdTypeName"}},[r("el-input",{attrs:{placeholder:"产品分类名称"},model:{value:e.dataForm.prdTypeName,callback:function(t){e.$set(e.dataForm,"prdTypeName",t)},expression:"dataForm.prdTypeName"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"产品分类编号",prop:"prdTypeCode"}},[r("el-input",{attrs:{placeholder:"产品分类编号"},model:{value:e.dataForm.prdTypeCode,callback:function(t){e.$set(e.dataForm,"prdTypeCode",t)},expression:"dataForm.prdTypeCode"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"创建时间",prop:"createTime"}},[r("el-date-picker",{attrs:{placeholder:"创建时间"},model:{value:e.dataForm.createTime,callback:function(t){e.$set(e.dataForm,"createTime",t)},expression:"dataForm.createTime"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"创建人",prop:"createUser"}},[r("el-input",{attrs:{placeholder:"创建人"},model:{value:e.dataForm.createUser,callback:function(t){e.$set(e.dataForm,"createUser",t)},expression:"dataForm.createUser"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"产品分类图标",prop:"prdTypeIcon"}},[r("Upload",{ref:"upload"})],1)],1),e._v(" "),r("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{on:{click:function(t){e.visible=!1}}},[e._v("取消")]),e._v(" "),r("el-button",{attrs:{type:"primary"},on:{click:function(t){e.dataFormSubmit()}}},[e._v("确定")])],1)],1)},staticRenderFns:[]},o=r("VU/8")(a,d,!1,null,null,null);t.default=o.exports}});