1 line
13 KiB
JavaScript
1 line
13 KiB
JavaScript
|
webpackJsonp([207],{"0FwD":function(t,e){},"6mSI":function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=a("woOf"),s=a.n(i),n=a("mvHQ"),o=a.n(n),l=a("MJLE"),r=a.n(l),c=a("bzuE"),d={components:{ExcelImport:a("UoGq").a},data:function(){return{codeData:{},rulesForm:{name:[{required:!0,message:"请输入库位名称",trigger:"change"}],facilityId:[{required:!0,message:"请选择所属仓库",trigger:"change"}]},qrId:"",total:0,pageSizes:[10,20,50],search_data:{pageno:1,pagesize:10},search_data_type:{pageno:1,pagesize:1e8},checked:!1,isDisabled:!1,btnDelDisabled:!0,btnOtherDisabled:!0,btnDisAuditDisabled:!0,btnAuditDisabled:!0,rowIds:[],tableData:[],dialogVisible:!1,dialogTitle:"新增",formData:{name:"",serialNo:"",facilityId:""},dialogTypeTitle:"新增",dialogTypeVisible:!1,pictLoading:!1,qrDialogVisible:!1,dialogLoading:!1,chooseID:"",chooseTypeId:null,typeList:[],config:c.a}},mounted:function(){this.getTypeList(),this.getList()},methods:{generateQR:function(){var t=this,e=this;this.codeData={facilityLocationId:this.qrId},this.qrDialogVisible=!0,this.$nextTick(function(){document.getElementById("qrcode").innerHTML="",console.log(t.codeData);new r.a("qrcode",{width:200,height:200,text:o()(e.codeData)})},100)},deletedList:function(){this.$router.push({path:"/management/facilityLocation_deletedList",query:{t:Date.now()}})},clickRow:function(t){console.log(t),this.$refs.tb.toggleRowSelection(t)},isActive:function(t){return t.id===this.chooseTypeId},chooseType:function(t){this.chooseTypeId=t.id,this.search_data.facilityId=this.chooseTypeId,this.getList()},changeFacility:function(){this.$forceUpdate()},getTypeList:function(){var t=this;this.$api.facilityAPI.list(this.search_data_type).then(function(e){e.data?(t.typeList=e.data.datas?e.data.datas:[],t.typeList.forEach(function(e){t.$set(e,"checked",!1)})):t.typeList=[]}).catch(function(t){console.log(t)})},getList:function(){var t=this;this.pictLoading=!0,this.$api.facilityLocationAPI.list(this.search_data).then(function(e){t.pictLoading=!1,e.data?(t.total=e.data.totalRows,t.tableData=e.data.datas?e.data.datas:[]):(t.total=0,t.tableData=[])}).catch(function(e){t.pictLoading=!1,console.log(e)})},search:function(){this.search_data.pageno=1,this.getList()},handleCurrentChange:function(t){this.search_data.pageno=t,this.getList()},handleSizeChange:function(t){this.search_data.pagesize=t,this.getList()},add:function(){this.$router.push({path:"/management/facilityLocation_add",query:{facilityId:this.chooseTypeId,t:Date.now()}})},viewDetail:function(t){this.$router.push({path:"/management/facilityLocation_add",query:{id:t.id,t:Date.now()}})},getDetail:function(t){var e=this;this.$api.facilityLocationAPI.detail({id:t}).then(function(t){0===t.code?(e.formData=s()({},e.formData,t.data),0==e.formData.delFlag&&delete e.formData.delFlag,delete e.formData.updateBy,delete e.formData.updateTime):(e.dialogVisible=!1,e.$alert("获取库位明细失败","提示",{type:"warning"}))}).catch(function(t){})},save:function(t){var e=this;this.$refs[t].validate(function(t){if(!t)return!1;if(e.formData.id){if(e.isDisabled)return;e.isDisabled=!0,e.$api.facilityLocationAPI.update(e.formData).then(function(t){e.isDisabled=!1,0===t.code?(e.$message({message:t.msg,type:"success"}),e.dialogVisible=!1,e.getList()):e.$message({message:t.msg,type:"error"})}).catch(function(t){e.$message({message:res.msg,type:"success"})})}else{if(e.isDisabled)return;e.isDisabled=!0,e.$api.facilityLocationAPI.save(e.formData).then(function(t){e.isDisabled=!1,0===t.code?(e.$message({message:t.msg,type:"success"}),e.dialogVisible=!1,e.getList()):501===t.code?e.$confirm(t.msg,"提示",{type:"warning"}).then(function(){e.formData={},e.$api.facilityLocationAPI.detail({id:t.data.id}).then(function(t){0===t.code?(e.formData=s()({},e.formData,t.data),0==e.formData.delFlag&&delete e.formData.delFlag,delete e.formData.updateBy,delete e.formData.updateTime):(e.dialogVisible=!1,e.$alert("获取库位明细失败","提示",{type:"warning"}))}).catch(function(t){})}):e.$message({message:t.msg,type:"error"})}).catch(fu
|