1 line
6.8 KiB
JavaScript
1 line
6.8 KiB
JavaScript
|
webpackJsonp([372],{DF1X:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=a("mvHQ"),s=a.n(i),r=a("woOf"),o=a.n(r),n=a("Dd8w"),l=a.n(n),c=a("NYxO"),m=a("bzuE"),d=(a("lbHh"),{data:function(){return{rules:{name:[{required:!0,message:"请输入库位名称",trigger:"change"}],facilityId:[{required:!0,message:"请选择所属仓库",trigger:"change"}]},formData:{name:"",serialNo:"",facilityId:""},loading:!1,isDisabled:!1,from:"",report_url:"",config:m.a,options:[],typeList:[],sendForm:{}}},mounted:function(){this.$route.query.report_url&&(this.report_url=this.$route.query.report_url),this.$route.query.id&&(this.chooseID=this.$route.query.id,this.getDetail()),this.$route.query.form&&(this.sendForm=JSON.parse(this.$route.query.form),this.childList=JSON.parse(this.$route.query.childList),this.childListIndex=this.$route.query.childListIndex),this.$route.query.chooseTypeId&&(this.formData.facilityId=this.$route.query.chooseTypeId,this.getDetail()),this.getTypeList()},watch:{},methods:l()({},Object(c.d)({removeTagNav:"tagNav/removeTagNav"}),{getDetail:function(){var t=this;this.$api.facilityLocationAPI.detail({id:this.chooseID}).then(function(e){0===e.code?(t.formData=o()({},t.formData,e.data),0==t.formData.delFlag&&delete t.formData.delFlag,delete t.formData.updateBy,delete t.formData.updateTime):t.$alert("获取库位明细失败","提示",{type:"warning"})}).catch(function(t){})},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)})},changeFacility:function(){this.$forceUpdate()},back:function(){this.removeTagNav({path:this.$route.path,title:this.$route.meta.name}),this.report_url?this.$router.push({path:this.report_url,query:{t:Date.now(),dataForm:s()(this.sendForm),childList:s()(this.childList)}}):this.from?this.$router.push({path:"/management/facilityLocation_deletedList",query:{t:Date.now()}}):this.$router.push({path:"/management/facilityLocation",query:{t:Date.now()}})},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.$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.sendForm&&(e.childList[e.childListIndex].warehLocation=t.id,e.childList[e.childListIndex].warehLocationName=e.formData.name,e.back())):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=o()({},e.formData,t.data),0==e.formData.delFlag&&delete e.formData.delFlag,delete e.formData.updateBy,delete e.formData.updateTime):e.$alert("获取库位明细失败","提示",{type:"warning"})}).catch(function(t){})}):e.$message({message:t.msg,type:"error"})}).catch(function(t){e.$message({message:res.msg,type:"success"})})}})},audit:function(){var t=this,e=[];this.rowIds.forEach(function(t){e.push(t.id)}),this.$api.facilityLocationAPI.batchAudit(e).then(function(e){0===e.code?t.$message({message:e.msg,type:"success"}):t.$message({message:e.msg,type:"error"})})},disAudit:function(){var t=this,e=this.formData.id?this.formData.id:this.rowIds[0].id;this.$api.facilityLocationAPI.reverseAudit({id:e}).then(function(e){0===e.code?t.$message({message:e.msg,type:"success"}):t.$message({message:e.msg,type:"error"})})}})}),u={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"sys-box"},[a("div",{staticClass:"sys-operate"},[a("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.back()}}},[t._v(t._s(t.config.cancelText))]),t._v("
|