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(" "),178==this.formData.status||void 0==this.formData.status?a("el-button",{attrs:{type:"primary",disabled:t.isDisabled},on:{click:function(e){return t.save("form")}}},[t._v("保存")]):t._e(),t._v(" "),178==this.formData.status?a("el-button",{directives:[{name:"has",rawName:"v-has",value:"management:facilityLocation:audit",expression:"'management:facilityLocation:audit'"}],attrs:{type:"primary",size:"small"},on:{click:t.audit}},[t._v("审核")]):t._e(),t._v(" "),179==this.formData.status?a("el-button",{directives:[{name:"has",rawName:"v-has",value:"management:facilityLocation:disAudit",expression:"'management:facilityLocation:disAudit'"}],attrs:{type:"primary",size:"small"},on:{click:t.disAudit}},[t._v("反审核")]):t._e()],1),t._v(" "),a("div",{staticClass:"sys-form"},[a("el-form",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],ref:"form",staticClass:"company-form",attrs:{"label-width":"125px",rules:t.rules,model:t.formData}},[a("el-form-item",{attrs:{prop:"serialNo",label:"库位代码"}},[a("el-input",{attrs:{placeholder:"自动生成",readonly:""},model:{value:t.formData.serialNo,callback:function(e){t.$set(t.formData,"serialNo",e)},expression:"formData.serialNo"}})],1),t._v(" "),a("el-form-item",{attrs:{prop:"name",label:"库位名称"}},[a("el-input",{attrs:{placeholder:"请输入库位名称"},model:{value:t.formData.name,callback:function(e){t.$set(t.formData,"name",e)},expression:"formData.name"}})],1),t._v(" "),a("el-form-item",{attrs:{prop:"facilityId",label:"所属仓库"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{clearable:"",placeholder:"请选择仓库"},on:{change:t.changeFacility},model:{value:t.formData.facilityId,callback:function(e){t.$set(t.formData,"facilityId",e)},expression:"formData.facilityId"}},t._l(t.typeList,function(t){return a("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})}),1)],1),t._v(" "),a("el-form-item",{attrs:{label:"备注",prop:"remarks"}},[178==this.formData.auditSign||void 0==this.formData.auditSign?a("el-input",{attrs:{type:"textarea",autosize:{minRows:4},placeholder:"请简要填写备注内容"},model:{value:t.formData.remarks,callback:function(e){t.$set(t.formData,"remarks",e)},expression:"formData.remarks"}}):179==this.formData.auditSign?a("el-input",{attrs:{type:"textarea",autosize:{minRows:4},placeholder:"",readonly:""},model:{value:t.formData.remarks,callback:function(e){t.$set(t.formData,"remarks",e)},expression:"formData.remarks"}}):t._e()],1),t._v(" "),179==this.formData.auditSign?a("el-form-item",{staticClass:"form-inline",attrs:{label:"审核人:"}},[a("div",{staticClass:"form-p"},[t._v(" "+t._s(t.formData.auditorName))])]):t._e()],1)],1)])},staticRenderFns:[]};var f=a("VU/8")(d,u,!1,function(t){a("Ik5f")},"data-v-599cbb3c",null);e.default=f.exports},Ik5f:function(t,e){}}); |