1 line
12 KiB
JavaScript
1 line
12 KiB
JavaScript
|
webpackJsonp([287],{gOCk:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=a("woOf"),o=a.n(i),l=a("mvHQ"),s=a.n(l),n=a("Dd8w"),r=a.n(n),c=a("bzuE"),u=a("5zN6"),d=a("tiiE"),m=a("NYxO"),f={components:{ChooseParts:u.a,dialogChooseSingleLocation:d.a},data:function(){return{formDetail:{},formData:{},id:"",hitchList:[],deviceStatusList:[],auditStatus:"",tableData:[],initFilePaths:[],dialogVisible:!1,dialogImageUrl:"",repairRecordImage:[],loading:!1,chooseMaterielsVisible:!1,ChooseLocationVisible:!1,tableList:[],parts:[],type:null,config:c.a,fac_type_list:[],warehouseRow:""}},mounted:function(){this.initialize(),this.id=this.$route.query.id,this.getDetail()},methods:r()({},Object(m.d)({removeTagNav:"tagNav/removeTagNav"}),{initialize:function(){var e=this;this.$api.gylInventoryAPI.facilityList({pageno:1,pagesize:1e3}).then(function(t){e.fac_type_list=t.data.datas?t.data.datas:""}).catch(function(e){console.log(e)})},changeWarehouse:function(e){this.$set(e,"defaultLocationName","选择仓位"),this.$set(e,"defaultLocationId","")},chooseLocation:function(e){this.warehouseRow=e,this.ChooseLocationVisible=!0},getLocation:function(e){this.$set(this.warehouseRow,"defaultLocationId",e.id),this.$set(this.warehouseRow,"defaultLocationName",e.name)},save:function(){var e=this,t=!0;if(this.tableList.forEach(function(e){(e.planFeedingCount<=0||void 0==e.planFeedingCount)&&(t=!1)}),t){var a=[];this.tableList.forEach(function(t){var i={id:t.id?t.id:"",materielId:t.materielId,planFeeding:t.planFeedingCount,facilityId:t.defaultFacilityId,locationId:t.defaultLocationId};t.batchNo&&""!=t.batchNo&&(i.batchNo=t.batchNo),a.push(i),e.formDetail.childArray=s()(a),e.formDetail.ids=e.itemIds});var i=this.formDetail;i.status="",this.$api.planManagementAPI.change(i).then(function(t){0===t.code?(e.$message({message:t.msg,type:"success"}),e.back()):e.$message({message:t.msg,type:"error"})})}else this.$message({message:"计划投料数量必填且大于0",type:"warning"})},audit:function(){var e=this,t=this.id;this.$confirm("确认审核吗?","提示",{type:"warning"}).then(function(){e.$api.planManagementAPI.productionFeedingAudit({id:t}).then(function(t){0===t.code?(e.$message({message:t.msg,type:"success"}),e.getDetail()):e.$message({message:t.msg,type:"error"})})})},disAudit:function(){var e=this,t=this.id;this.$confirm("确认反审核吗?","提示",{type:"warning"}).then(function(){e.$api.planManagementAPI.productionFeedingReverseAudit({id:t}).then(function(t){0===t.code?(e.$message({message:t.msg,type:"success"}),e.getDetail()):e.$message({message:t.msg,type:"error"})})})},getPart:function(e){var t=this;console.log(e),e&&e.forEach(function(e){t.$set(e,"materialSerialNo",e.serialNo?e.serialNo:""),t.$set(e,"materielId",e.id),delete e.id,t.$set(e,"materialName",e.name?e.name:""),t.$set(e,"specification",e.specification?e.specification:""),t.$set(e,"unitUomName",e.unitUomName?e.unitUomName:""),t.$set(e,"batchNo",e.batch?e.batch:""),t.$set(e,"planFeedingCount",0),t.$set(e,"outCount",0),t.$set(e,"scrapCount",0),t.$set(e,"defaultFacilityName",e.defaultFacilityName?e.defaultFacilityName:""),t.$set(e,"defaultLocationName",e.defaultLocationName?e.defaultLocationName:""),t.tableList.push(e)})},handlePartChange:function(e){this.parts=e},removePart:function(){var e=this;if(this.parts){var t=[];this.parts.forEach(function(a){t.push(a.id);var i=e.tableList.findIndex(function(e){if(e.id==a.id)return!0});e.tableList.splice(i,1),e.itemIds=t})}},getDetail:function(){var e=this;this.loading=!0,this.$api.planManagementAPI.productionFeedingDetail({id:this.id}).then(function(t){0===t.code&&(e.formDetail=o()({},e.formDetail,t.feedingHeadInfo),e.formDetail.createTime=e.formDetail.createTime.substr(0,10),e.tableList=t.feedingBodyInfo,e.$set(e.formDetail,"auditStatus",t.feedingHeadInfo.statusId?t.feedingHeadInfo.statusId:""),e.auditStatus=e.formDetail.auditStatus),e.loading=!1}).catch(function(t){e.loading=!1})},back:function(){this.removeTagNav({path:this.$route.path,title:this.$route.meta.name}),this.$router.push({path:"/outsourcing/outsour
|