qy-renren-qt/dist/2209301437/static/js/33.js
2022-09-30 14:43:03 +08:00

1 line
3.5 KiB
JavaScript

webpackJsonp([33],{MiRS:function(e,a,t){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r={data:function(){return{visible:!1,dataForm:{id:0,regionCode:"QY"+(new Date).getTime(),regionName:"",whId:"",remark:""},options:[{value:"1",label:"高库位"},{value:"2",label:"扩展库位"},{value:"0",label:"普通库位"}],whIdArr:[],dataRule:{regionCode:[{required:!0,message:"区域编码不能为空",trigger:"blur"}],regionName:[{required:!0,message:"区域名称不能为空",trigger:"blur"}],whId:[{required:!0,message:"仓库不能为空",trigger:"change"}]}}},methods:{init:function(e){var a=this;this.dataForm.id=e||"",this.visible=!0,this.$nextTick(function(){a.$refs.dataForm.resetFields(),a.dataForm.id&&a.$http({url:a.$http.adornUrl("/work/mtwarehousregion/info/"+a.dataForm.id),method:"get",params:a.$http.adornParams()}).then(function(e){var t=e.data;t&&0===t.code&&(a.dataForm=t.mtWarehouseRegion)}),a.$http({url:a.$http.adornUrl("/work/mtwarehousing/list"),method:"get",params:a.$http.adornParams({page:1,limit:500})}).then(function(e){var t=e.data;t&&0===t.code?a.whIdArr=t.page.list:a.whIdArr=[]})})},dataFormSubmit:function(){var e=this;this.$refs.dataForm.validate(function(a){a&&e.$http({url:e.$http.adornUrl("/work/mtwarehousregion/"+(e.dataForm.id?"update":"save")),method:"post",data:e.$http.adornData({id:e.dataForm.id||void 0,regionCode:e.dataForm.regionCode,regionName:e.dataForm.regionName,whId:e.dataForm.whId,remark:e.dataForm.remark})}).then(function(a){var t=a.data;t&&0===t.code?e.$message({message:"操作成功",type:"success",duration:1500,onClose:function(){e.visible=!1,e.$emit("refreshDataList")}}):e.$message.error(t.msg)})})}}},o={render:function(){var e=this,a=e.$createElement,t=e._self._c||a;return t("el-dialog",{attrs:{title:e.dataForm.id?"修改":"新增","close-on-click-modal":!1,visible:e.visible},on:{"update:visible":function(a){e.visible=a}}},[t("el-form",{ref:"dataForm",attrs:{model:e.dataForm,rules:e.dataRule,"label-width":"80px"},nativeOn:{keyup:function(a){if(!("button"in a)&&e._k(a.keyCode,"enter",13,a.key,"Enter"))return null;e.dataFormSubmit()}}},[t("el-form-item",{attrs:{label:"区域编码",prop:"regionCode"}},[t("el-input",{attrs:{placeholder:"区域编码",clearable:""},model:{value:e.dataForm.regionCode,callback:function(a){e.$set(e.dataForm,"regionCode",a)},expression:"dataForm.regionCode"}})],1),e._v(" "),t("el-form-item",{attrs:{label:"区域名称",prop:"regionName"}},[t("el-input",{attrs:{placeholder:"区域名称",clearable:""},model:{value:e.dataForm.regionName,callback:function(a){e.$set(e.dataForm,"regionName",a)},expression:"dataForm.regionName"}})],1),e._v(" "),t("el-form-item",{attrs:{label:"仓库",prop:"whId"}},[t("el-select",{attrs:{clearable:"",filterable:"",placeholder:"仓库"},model:{value:e.dataForm.whId,callback:function(a){e.$set(e.dataForm,"whId",a)},expression:"dataForm.whId"}},e._l(e.whIdArr,function(e){return t("el-option",{key:e.id,attrs:{label:e.whName,value:e.id}})}))],1),e._v(" "),t("el-form-item",{attrs:{label:"备注",prop:"remark"}},[t("el-input",{attrs:{placeholder:"",clearable:""},model:{value:e.dataForm.remark,callback:function(a){e.$set(e.dataForm,"remark",a)},expression:"dataForm.remark"}})],1)],1),e._v(" "),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(a){e.visible=!1}}},[e._v("取消")]),e._v(" "),t("el-button",{attrs:{type:"primary"},on:{click:function(a){e.dataFormSubmit()}}},[e._v("确定")])],1)],1)},staticRenderFns:[]},i=t("VU/8")(r,o,!1,null,null,null);a.default=i.exports}});