yxk_pc_mdh/gyhl/static/js/449.94be3e444dd830ca5619.js

1 line
11 KiB
JavaScript
Raw Normal View History

2025-08-28 15:26:35 +08:00
webpackJsonp([449],{PPaE:function(t,e){},YSFb:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=a("bzuE"),n={data:function(){return{search_data:{pageno:1,pagesize:10,auditSign:179,startTime:"",endTime:""},summary:{},time:"",config:i.a,btnOtherDisabled:!0,formData:{},typeList:[],purchaseInStockIds:[],inOutTime:"",tableData:[],pictLoading:!1,isEdit:!0,total:0,pageSizes:[10,20,50,100]}},created:function(){var t=this;document.onkeydown=function(e){"Enter"===e.key&&t.startList(!0)}},watch:{time:function(t){t?(this.search_data.startTime=t[0],this.search_data.endTime=t[1]):(this.search_data.startTime="",this.search_data.endTime="")}},mounted:function(){this.initDate(),this.getList()},methods:{save:function(){var t=this,e=[];this.tableData.forEach(function(t){var a={id:t.stockInItemId,unitPrice:t.unitPrice,amount:t.amount};e.push(a)}),this.$api.advertiseInfoAPI.edit(e).then(function(e){0==e.code?(t.$message({message:e.msg,type:"success"}),t.isEdit=!0,t.getList()):t.$message({message:e.msg,type:"error"})})},changeAmount:function(t,e){t.unitPrice=t.unitPrice.toFixed(t.priceAccuracy),t.amount=(t.unitPrice*t.inCount).toFixed(i.a.amountFixedTo)},changeUnitPrice:function(t){t.amount=t.amount.toFixed(i.a.amountFixedTo),t.unitPrice=(t.amount/t.inCount).toFixed(t.priceAccuracy)},edit:function(){this.isEdit=!1},initDate:function(){var t=this;this.$api.salesAPI.listContractType({type:"cost_allocation_criteria"}).then(function(e){t.typeList=e.datas})},check:function(){var t=this,e=[];this.tableData.forEach(function(t){e.push(t.id)}),this.$api.stockInAccountingAPI.purchaseBusinessAccounting({stockInIds:e}).then(function(e){0==e.code?(t.$message({message:e.msg,type:"success"}),t.getList()):t.$message({message:e.msg,type:"error"})})},allocation:function(){var t=this;if(this.formData.distributionType){var e=[];this.tableData.forEach(function(t){e.push(t.id)}),this.$api.stockInAccountingAPI.purchaseInStockAllocation({distributionType:this.formData.distributionType,detailAccounting:e}).then(function(e){0==e.code?(t.$message({message:e.msg,type:"success"}),t.getList()):t.$message({message:e.msg,type:"error"})})}else this.$message({message:"请先选择采购费用分配标准再进行分配",type:"error"})},search:function(){this.search_data.pageno=1,this.getList()},getList:function(){var t=this;this.pictLoading=!0,this.$api.gylPurchaseAPI.purchaseInStockList(this.search_data).then(function(e){t.pictLoading=!1,e.data?(t.summary=e.data,t.total=e.data.totalRows,t.tableData=e.data.datas?e.data.datas:[],t.tableData.forEach(function(t){t.inOutTime=/\d{4}-\d{1,2}-\d{1,2}/g.exec(t.inOutTime)}),e.data.datas&&e.data.datas.forEach(function(t){0==t.purchaseType?t.purchaseType="现购":1==t.purchaseType&&(t.purchaseType="赊购")})):(t.total=0,t.tableData=[])}).catch(function(t){console.log(t)})},handleSelectionChange:function(t){console.log(t),this.purchaseInStockIds=t,this.setBtn(t)},setBtn:function(t){var e=!0,a=!0;t.length>0?(a=!1,1==t.length&&(e=!1)):(e=!0,a=!0),this.btnOtherDisabled=a,this.btnDelDisabled=e},getSummaries:function(t){var e=this,a=t.columns,i=t.data,n=[];return a.forEach(function(t,a){if(0!==a)if("count"==t.property||"amount"==t.property||"expense"==t.property||"inCount"==t.property){var s=i.map(function(e){return Number(e[t.property])});s.every(function(t){return isNaN(t)})?n[a]="":n[a]=s.reduce(function(t,e){var a=Number(e);return isNaN(a)?t:t+e},0),"count"!=t.property?"amount"!=t.property?"expense"!=t.property?"inCount"!=t.property||n[a]&&(n[a]=e.summary.totalInCount):n[a]&&(n[a]=e.summary.totalExpense):n[a]&&(n[a]=e.summary.toatalAmount):n[a]&&(n[a]=e.summary.toatalCount)}else n[a]="";else n[a]="合计"}),n},handleCurrentChange:function(t){this.search_data.pageno=t,this.getList()},handleSizeChange:function(t){this.search_data.pagesize=t,this.getList()}}},s={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"sys-box"},[a("div",{staticClass:"sys-form"},[a("el-form",{ref:"form",attrs:{"label-width":"120px","inline-message":!0,model:t.formData}},[a("el-form-item",