yxk_pc_mdh/gyhl/static/js/222.7cceeade9154ce8bbc59.js

1 line
14 KiB
JavaScript
Raw Normal View History

2025-08-28 15:26:35 +08:00
webpackJsonp([222],{"+l/a":function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=a("mvHQ"),i=a.n(o),s=a("Dd8w"),n=a.n(s),l=a("NYxO"),r=a("Dod7"),c=a("bzuE"),u=a("tiiE"),h=a("CdUU"),d=a("Xnfr"),p=a("Sd19"),f={inject:["reload"],components:{dialogChooseParts:h.a,dialogChooseSingleLocation:u.a,unitSelect:p.a},data:function(){return{formData:{},itemIds:[],startStatus:"",fac_type_list:[],fac_location_list:[],warehouseRow:{},auditStatus:"",btnDelDisabled:!1,isDisabled:!1,childList:[],config:c.a,uploadAttachment:[],fileDocList:[],uploadUrl:r.a.uploadUrl,ftpPrefix:r.a.ftpPrefix,fullscreenLoading:!1,auto_upload:!1,chooseMaterielVisible:!1,ChooseLocationVisible:!1,total:0,pageSizes:[10,20,50,100],search_data:{pageno:1,pagesize:10},dataLoading:!1}},created:function(){this.startList(!1),this.initialize();var t=this;document.onkeydown=function(e){"Enter"===e.key&&t.startList(!0)}},watch:{childList:{handler:function(t,e){t.forEach(function(t){void 0!=t.warehouse&&""!=t.warehouse||(t.warehLocationName="",t.warehLocation="")})},deep:!0}},methods:n()({},Object(l.d)({removeTagNav:"tagNav/removeTagNav"}),{getSummaries:function(t){var e=t.columns,a=t.data,o=[];return e.forEach(function(t,e){if(0!==e){var i=a.map(function(e){return Number(e[t.property])});"count"!==t.property&&"qcCount"!==t.property&&"amount"!==t.property||(i.every(function(t){return isNaN(t)})?o[e]="":o[e]=i.reduce(function(t,e){var a=Number(e);return isNaN(a)?t:t+e},0))}else o[e]="合计"}),o},close:function(){this.removeTagNav({path:this.$route.path,title:this.$route.meta.name}),this.$router.push({path:"/home",query:{t:Date.now()}})},endInitial:function(){var t=this;this.$confirm("确认结束初始化选中的项吗?","提示",{}).then(function(){t.$api.stockAPI.endInitial().then(function(e){0==e.code?(t.$message({message:e.msg,type:"success"}),t.startList(!1)):t.$message({message:e.msg,type:"error"})})})},startList:function(t){var e=this;this.dataLoading=!0,t&&(this.search_data.pageno=1),this.$api.stockAPI.startList(this.search_data).then(function(t){e.dataLoading=!1,0==t.code?(e.childList=t.data,e.total=t.total.totalSize,e.childList.forEach(function(t){e.$set(t,"onlyId",Math.random()),isNaN(t.qcCount)||0===t.qcCount||isNaN(t.convCoefficient)||0===t.convCoefficient?t.count=0:t.count=Math.ceil(t.qcCount*t.convCoefficient*1e3)/1e3}),e.startStatus=t.startStatus,window.console.log(t.total),e.totalAmount=t.total.totalAmount):e.childList=[]}).catch(function(t){e.dataLoading=!1})},saveHandle:function(){},save:function(){var t=this;this.dataLoading=!0;if(0==this.childList.length)return this.$message({message:"请选择物料",type:"warning"}),void!1;var e=!0;if(this.childList.forEach(function(a){0!=a.count&&a.amount&&a.count&&a.warehouse||(t.$message({message:"初期数量,初期金额和仓库都必填",type:"warning"}),e=!1)}),e){var a=[];if(this.childList.forEach(function(e){console.log(e);var o={id:e.id?e.id:"",materielId:e.materielId,batch:e.batch?e.batch:"",warehouse:e.warehouse?e.warehouse:"",warehLocation:e.warehLocation?e.warehLocation:"",count:e.count.toFixed(c.a.countFixedTo),supportUom:e.supportUom,convCoefficient:e.convCoefficient.toFixed(3),qcCount:e.qcCount.toFixed(c.a.countFixedTo),amount:e.amount.toFixed(c.a.amountFixedTo)};a.push(o),t.formData.item=i()(a)}),this.isDisabled)return;this.isDisabled=!0,this.$api.stockAPI.save({item:this.formData.item,itemIds:this.itemIds?this.itemIds:[]}).then(function(e){t.dataLoading=!1,t.isDisabled=!1,0===e.code?(t.$message({message:e.msg,type:"success"}),t.startList(!1)):t.$message({message:e.msg,type:"error"})})}else this.dataLoading=!1},changeWarehouse:function(t){this.$set(t,"warehLocationName","选择仓位"),this.$set(t,"warehLocation","")},chooseLocation:function(t){this.warehouseRow=t,this.ChooseLocationVisible=!0},getLocation:function(t){this.$set(this.warehouseRow,"warehLocation",t.id),this.$set(this.warehouseRow,"warehLocationName",t.name)},initialize:function(){var t=this;this.$api.gylInventoryAPI.facilityList({pageno:1,pagesize:1e3}).then(function(e){t.fac_type_list=e.data.datas?e.da