1 line
7.5 KiB
JavaScript
1 line
7.5 KiB
JavaScript
webpackJsonp([13,33],{MiRS:function(e,t,a){"use strict";Object.defineProperty(t,"__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 t=this;this.dataForm.id=e||"",this.visible=!0,this.$nextTick(function(){t.$refs.dataForm.resetFields(),t.dataForm.id&&t.$http({url:t.$http.adornUrl("/work/mtwarehousregion/info/"+t.dataForm.id),method:"get",params:t.$http.adornParams()}).then(function(e){var a=e.data;a&&0===a.code&&(t.dataForm=a.mtWarehouseRegion)}),t.$http({url:t.$http.adornUrl("/work/mtwarehousing/list"),method:"get",params:t.$http.adornParams({page:1,limit:500})}).then(function(e){var a=e.data;a&&0===a.code?t.whIdArr=a.page.list:t.whIdArr=[]})})},dataFormSubmit:function(){var e=this;this.$refs.dataForm.validate(function(t){t&&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(t){var a=t.data;a&&0===a.code?e.$message({message:"操作成功",type:"success",duration:1500,onClose:function(){e.visible=!1,e.$emit("refreshDataList")}}):e.$message.error(a.msg)})})}}},n={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{attrs:{title:e.dataForm.id?"修改":"新增","close-on-click-modal":!1,visible:e.visible},on:{"update:visible":function(t){e.visible=t}}},[a("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()}}},[a("el-form-item",{attrs:{label:"区域编码",prop:"regionCode"}},[a("el-input",{attrs:{placeholder:"区域编码",clearable:""},model:{value:e.dataForm.regionCode,callback:function(t){e.$set(e.dataForm,"regionCode",t)},expression:"dataForm.regionCode"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"区域名称",prop:"regionName"}},[a("el-input",{attrs:{placeholder:"区域名称",clearable:""},model:{value:e.dataForm.regionName,callback:function(t){e.$set(e.dataForm,"regionName",t)},expression:"dataForm.regionName"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"仓库",prop:"whId"}},[a("el-select",{attrs:{clearable:"",filterable:"",placeholder:"仓库"},model:{value:e.dataForm.whId,callback:function(t){e.$set(e.dataForm,"whId",t)},expression:"dataForm.whId"}},e._l(e.whIdArr,function(e){return a("el-option",{key:e.id,attrs:{label:e.whName,value:e.id}})}))],1),e._v(" "),a("el-form-item",{attrs:{label:"备注",prop:"remark"}},[a("el-input",{attrs:{placeholder:"",clearable:""},model:{value:e.dataForm.remark,callback:function(t){e.$set(e.dataForm,"remark",t)},expression:"dataForm.remark"}})],1)],1),e._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.visible=!1}}},[e._v("取消")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(t){e.dataFormSubmit()}}},[e._v("确定")])],1)],1)},staticRenderFns:[]},i=a("VU/8")(r,n,!1,null,null,null);t.default=i.exports},XKu4:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={data:function(){return{dataForm:{key:""},dataList:[],pageIndex:1,pageSize:10,totalPage:0,dataListLoading:!1,addOrUpdateVisible:!1}},components:{AddOrUpdate:a("MiRS").default},activated:function(){this.getDataList()},methods:{getDataList:function(){var e=this;this.dataListLoading=!0,this.$http({url:this.$http.adornUrl("/work/mtwarehousregion/list"),method:"get",params:this.$http.adornParams({page:this.pageIndex,limit:this.pageSize,key:this.dataForm.key})}).then(function(t){var a=t.data;a&&0===a.code?(e.dataList=a.page.list,e.totalPage=a.page.totalCount):(e.dataList=[],e.totalPage=0),e.dataListLoading=!1})},sizeChangeHandle:function(e){this.pageSize=e,this.pageIndex=1,this.getDataList()},currentChangeHandle:function(e){this.pageIndex=e,this.getDataList()},addOrUpdateHandle:function(e){var t=this;this.addOrUpdateVisible=!0,this.$nextTick(function(){t.$refs.addOrUpdate.init(e)})},deleteHandle:function(e){var t=this;this.$confirm("确定对[id="+e+"]进行删除操作?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){t.$http({url:t.$http.adornUrl("/work/mtwarehousregion/delete"),method:"post",data:t.$http.adornData(e,!1)}).then(function(e){var a=e.data;a&&0===a.code?t.$message({message:"操作成功",type:"success",duration:1500,onClose:function(){t.getDataList()}}):t.$message.error(a.msg)})})}}},n={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"mod-config"},[a("el-form",{attrs:{inline:!0,model:e.dataForm},nativeOn:{keyup:function(t){if(!("button"in t)&&e._k(t.keyCode,"enter",13,t.key,"Enter"))return null;e.getDataList()}}},[a("el-form-item",[a("el-input",{attrs:{placeholder:"参数名",clearable:""},model:{value:e.dataForm.key,callback:function(t){e.$set(e.dataForm,"key",t)},expression:"dataForm.key"}})],1),e._v(" "),a("el-form-item",[a("el-button",{on:{click:function(t){e.getDataList()}}},[e._v("查询")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(t){e.addOrUpdateHandle()}}},[e._v("新增")])],1)],1),e._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.dataListLoading,expression:"dataListLoading"}],staticStyle:{width:"100%"},attrs:{data:e.dataList,stripe:!0,"header-cell-style":{background:"#eef1f6",color:"#606266",height:"56px"},border:""}},[a("el-table-column",{attrs:{type:"index",label:"序号","header-align":"center",align:"center",width:"50"}}),e._v(" "),a("el-table-column",{attrs:{prop:"createTime","header-align":"center",align:"center",label:"添加时间"}}),e._v(" "),a("el-table-column",{attrs:{prop:"regionCode","header-align":"center",align:"center",label:"区域编码"}}),e._v(" "),a("el-table-column",{attrs:{prop:"regionName","header-align":"center",align:"center",label:"区域名称"}}),e._v(" "),a("el-table-column",{attrs:{prop:"whId","header-align":"center",align:"center",label:"仓库"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[e._v(e._s(1===t.row.whId?"A库":"B库"))])]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"remark","header-align":"center",align:"center",label:"备注"}}),e._v(" "),a("el-table-column",{attrs:{fixed:"right","header-align":"center",align:"center",width:"150",label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){e.addOrUpdateHandle(t.row.id)}}},[e._v("修改")]),e._v(" "),a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){e.deleteHandle(t.row.id)}}},[e._v("删除")])]}}])})],1),e._v(" "),a("el-pagination",{attrs:{"current-page":e.pageIndex,"page-sizes":[10,20,50,100],"page-size":e.pageSize,total:e.totalPage,layout:"total, sizes, prev, pager, next, jumper"},on:{"size-change":e.sizeChangeHandle,"current-change":e.currentChangeHandle}}),e._v(" "),e.addOrUpdateVisible?a("add-or-update",{ref:"addOrUpdate",on:{refreshDataList:e.getDataList}}):e._e()],1)},staticRenderFns:[]},i=a("VU/8")(r,n,!1,null,null,null);t.default=i.exports}}); |