浏览代码

成本分配表/成本分配列表-辅料成本计算

jingbb 2 月之前
父节点
当前提交
d5e1cbe880

+ 19 - 1
src/views/cost-allocation-total/costDetailDrawer.vue

@@ -260,7 +260,7 @@
 
     <!--tabs 组件引入  -->
     <a-card :bordered="true" style=" marginTop:10px;">
-      <div><tabs ref="unitTabs" :showSelect='showSelect'  @number="number" :showAll="showAll" @FabInQua="FabInQua"/></div>
+      <div><tabs ref="unitTabs" :showSelect='showSelect'  @number="number" :showAll="showAll" @FabInQua="FabInQua"  @IngInQua="IngInQua"/></div>
     </a-card>
 
     <!-- 事故单 -->
@@ -590,6 +590,7 @@ export default {
             this.$refs.unitTabs.sumInfo.ingAmount =((v/2)+(t/2)).toFixed(2)//辅料金额合计
             this.$refs.unitTabs.sumInfo.ingExcludAmount = (((s/2)+(t/2)/(1+(Number(this.detailsPlanNum.taxrate)/100)))).toFixed(2)//合计sheet辅料不含税金额合计
             this.detailsPlanNum.excipiencostNotincludestax =  ( this.$refs.unitTabs.sumInfo.ingExcludAmount==''|| !this.$refs.unitTabs.sumInfo.ingExcludAmount)?0:Number(this.$refs.unitTabs.sumInfo.ingExcludAmount).toFixed(2)//表头辅料料不含税成本   
+            this.detailsPlanNum.excipiencostIncludestaxUsd = (this.detailsPlanNum.excipiencostNotincludestax/Number(this.detailsPlanNum.exchangeRate)).toFixed(2)
             this.detailsPlanNum.excipiencostIncludestax =   (  this.$refs.unitTabs.sumInfo.ingAmount ==''|| ! this.$refs.unitTabs.sumInfo.ingAmount )?0:Number( this.$refs.unitTabs.sumInfo.ingAmount ).toFixed(2)//表头辅料成本(¥)
             //合计中出运明细相关金额
             var s =0,
@@ -1026,6 +1027,23 @@ export default {
       this.$refs.unitTabs.sumInfo.amountTotal = (Number(this.$refs.unitTabs.sumInfo.fabricAmount)+Number(this.$refs.unitTabs.sumInfo.ingAmount)+Number( this.$refs.unitTabs.sumInfo.shipProcesFees)).toFixed(2)//合计金额
      
     },
+    IngInQua(dataArr){
+      var s = 0,
+          v =0,
+          t=0
+      dataArr.map(item=>{
+          s+=item.priceExcludingtax?Number(item.priceExcludingtax):0,
+          v+=item.rmbAmount?Number(item.rmbAmount):0
+          t+=item.transferCost?Number(item.transferCost):0
+      })
+      this.$refs.unitTabs.sumInfo.ingAmount =((v/2)+(t/2)).toFixed(2)//辅料金额合计
+      this.$refs.unitTabs.sumInfo.ingExcludAmount = (((s/2)+(t/2)/(1+(Number(this.detailsPlanNum.taxrate)/100)))).toFixed(2)//合计sheet辅料不含税金额合计
+      this.detailsPlanNum.excipiencostNotincludestax =  ( this.$refs.unitTabs.sumInfo.ingExcludAmount==''|| !this.$refs.unitTabs.sumInfo.ingExcludAmount)?0:Number(this.$refs.unitTabs.sumInfo.ingExcludAmount).toFixed(2)//表头辅料料不含税成本   
+      this.detailsPlanNum.excipiencostIncludestaxUsd = (this.detailsPlanNum.excipiencostNotincludestax/Number(this.detailsPlanNum.exchangeRate)).toFixed(2)
+      this.detailsPlanNum.excipiencostIncludestax =   (  this.$refs.unitTabs.sumInfo.ingAmount ==''|| ! this.$refs.unitTabs.sumInfo.ingAmount )?0:Number( this.$refs.unitTabs.sumInfo.ingAmount ).toFixed(2)//表头辅料成本(¥)
+      this.$refs.unitTabs.sumInfo.amountTotal = (Number(this.$refs.unitTabs.sumInfo.fabricAmount)+Number(this.$refs.unitTabs.sumInfo.ingAmount)+Number( this.$refs.unitTabs.sumInfo.shipProcesFees)).toFixed(2)//合计金额
+    },
+
 
     // father 方法
     handlecLose() {

+ 1 - 7
src/views/cost-allocation-total/modal/ingInQuaModal.vue

@@ -79,12 +79,6 @@ export default {
           dataIndex: 'cost',
           width: 120,
           className: 'replacecolor',
-          customRender: (text, record, index) => {
-            if(text!==''&&text!==undefined&&text!==null){
-              var re =  Number(text).toFixed(2)
-               return re
-            }
-         }
         }
       ],
       data: [],
@@ -143,7 +137,7 @@ export default {
     print() {},
     changeUnitCost(record){
       record.unitCost = Number(record.unitCost).toFixed(4)
-      record.cost = record.unitCost*record.number
+      this.$set(record,'cost',(Number(record.unitCost)* Number(record.number)).toFixed(4))
     },
 
     cancel() {

+ 25 - 7
src/views/reportForms/cost-allocation-table.vue

@@ -248,7 +248,7 @@
 
     <!--tabs 组件引入  -->
     <a-card :bordered="false" style=" marginTop:10px;">
-      <div><tabs ref="unitTabs" :showSelect='showSelect'  @number="number" :planNum="this.detailsPlanNum.planNum" @FabInQua="FabInQua"/></div>
+      <div><tabs ref="unitTabs" :showSelect='showSelect'  @number="number" :planNum="this.detailsPlanNum.planNum" @FabInQua="FabInQua" @IngInQua="IngInQua"/></div>
     </a-card>
 
     <!-- 事故单 -->
@@ -567,6 +567,7 @@ export default {
             this.$refs.unitTabs.sumInfo.ingAmount =((v/2)+(t/2)).toFixed(2)//辅料金额合计
             this.$refs.unitTabs.sumInfo.ingExcludAmount = (((s/2)+(t/2)/(1+(Number(this.detailsPlanNum.taxrate)/100)))).toFixed(2)//合计sheet辅料不含税金额合计
             this.detailsPlanNum.excipiencostNotincludestax =  ( this.$refs.unitTabs.sumInfo.ingExcludAmount==''|| !this.$refs.unitTabs.sumInfo.ingExcludAmount)?0:Number(this.$refs.unitTabs.sumInfo.ingExcludAmount).toFixed(2)//表头辅料料不含税成本   
+            this.detailsPlanNum.excipiencostIncludestaxUsd = (this.detailsPlanNum.excipiencostNotincludestax/Number(this.detailsPlanNum.exchangeRate)).toFixed(2)
             this.detailsPlanNum.excipiencostIncludestax =   (  this.$refs.unitTabs.sumInfo.ingAmount ==''|| ! this.$refs.unitTabs.sumInfo.ingAmount )?0:Number( this.$refs.unitTabs.sumInfo.ingAmount ).toFixed(2)//表头辅料成本(¥)
             //合计中出运明细相关金额
             var s =0,
@@ -603,6 +604,7 @@ export default {
              this.detailsPlanNum.usdProcesscost =e==0?(Number(this.detailsPlanNum.rmbProcesscost)/Number(this.detailsPlanNum.exchangeRate)).toFixed(2):e.toFixed(2)//表头-加工费美元
             f=Number(this.$refs.unitTabs.sumInfo.ingAmount)+Number(this.$refs.unitTabs.sumInfo.shipProcesFees)
             this.$refs.unitTabs.sumInfo.amountTotal = (Number(this.$refs.unitTabs.sumInfo.fabricAmount)+Number(this.$refs.unitTabs.sumInfo.ingAmount)+Number( this.$refs.unitTabs.sumInfo.shipProcesFees)).toFixed(2)//合计金额
+            // this.$set( this.$refs.unitTabs.sumInfo,'amountTotal',(Number(this.$refs.unitTabs.sumInfo.fabricAmount)+Number(this.$refs.unitTabs.sumInfo.ingAmount)+Number( this.$refs.unitTabs.sumInfo.shipProcesFees)).toFixed(2))
             this.pagination = {
               total: res.result.total,
               current: res.result.current,
@@ -655,6 +657,7 @@ export default {
             })
             this.$refs.unitTabs.sumInfo.ingExcludAmount = (((s/2)+(t/2)/(1+(Number(this.detailsPlanNum.taxrate)/100)))).toFixed(2)//合计sheet辅料不含税金额合计
             this.detailsPlanNum.excipiencostNotincludestax =  ( this.$refs.unitTabs.sumInfo.ingExcludAmount==''|| !this.$refs.unitTabs.sumInfo.ingExcludAmount)?0:Number(this.$refs.unitTabs.sumInfo.ingExcludAmount).toFixed(2)//表头辅料料不含税成本   
+            this.detailsPlanNum.excipiencostIncludestaxUsd = (this.detailsPlanNum.excipiencostNotincludestax/Number(this.detailsPlanNum.exchangeRate)).toFixed(2)
             this.$refs.unitTabs.sumInfo.ingAmount =((v/2)+(t/2)).toFixed(2)//辅料金额合计  
             this.detailsPlanNum.excipiencostIncludestax =   (  this.$refs.unitTabs.sumInfo.ingAmount ==''|| ! this.$refs.unitTabs.sumInfo.ingAmount )?0:Number( this.$refs.unitTabs.sumInfo.ingAmount ).toFixed(2)//表头辅料成本(¥)
           }
@@ -807,11 +810,11 @@ export default {
           if(this.$refs.unitTabs.ingData[this.$refs.unitTabs.ingData.length-1].goodsName=='合计'){this.$refs.unitTabs.ingData.pop()}
             this.$refs.unitTabs.ingData.push(allObj)
           }
-          if(rmbAmountAll == usdAmountAll){
-            this.detailsPlanNum.excipiencostIncludestaxUsd = 0
-          }else{
-            this.detailsPlanNum.excipiencostIncludestaxUsd = usdAmountAll.toFixed(2)
-          }
+          // if(rmbAmountAll == usdAmountAll){
+          //   this.detailsPlanNum.excipiencostIncludestaxUsd = 0
+          // }else{
+          //   this.detailsPlanNum.excipiencostIncludestaxUsd = usdAmountAll.toFixed(2)
+          // }
     },
     //事故单合计行
     addAccident(val){
@@ -1022,7 +1025,22 @@ export default {
       this.$refs.unitTabs.sumInfo.fabricAmount=this.detailsPlanNum.fabriccostIncludestax
       this.$refs.unitTabs.sumInfo.fabricExcludTax =(this.detailsPlanNum.fabriccostNotincludestax!==''&&this.detailsPlanNum.fabriccostNotincludestax)?(Number(this.detailsPlanNum.fabriccostNotincludestax)).toFixed(2):''//合计中的不含税面料总额
       this.$refs.unitTabs.sumInfo.amountTotal = (Number(this.$refs.unitTabs.sumInfo.fabricAmount)+Number(this.$refs.unitTabs.sumInfo.ingAmount)+Number( this.$refs.unitTabs.sumInfo.shipProcesFees)).toFixed(2)//合计金额
-     
+    },
+    IngInQua(dataArr){
+      var s = 0,
+          v =0,
+          t=0
+      dataArr.map(item=>{
+          s+=item.priceExcludingtax?Number(item.priceExcludingtax):0,
+          v+=item.rmbAmount?Number(item.rmbAmount):0
+          t+=item.transferCost?Number(item.transferCost):0
+      })
+      this.$refs.unitTabs.sumInfo.ingAmount =((v/2)+(t/2)).toFixed(2)//辅料金额合计
+      this.$refs.unitTabs.sumInfo.ingExcludAmount = (((s/2)+(t/2)/(1+(Number(this.detailsPlanNum.taxrate)/100)))).toFixed(2)//合计sheet辅料不含税金额合计
+      this.detailsPlanNum.excipiencostNotincludestax =  ( this.$refs.unitTabs.sumInfo.ingExcludAmount==''|| !this.$refs.unitTabs.sumInfo.ingExcludAmount)?0:Number(this.$refs.unitTabs.sumInfo.ingExcludAmount).toFixed(2)//表头辅料料不含税成本   
+      this.detailsPlanNum.excipiencostIncludestaxUsd = (this.detailsPlanNum.excipiencostNotincludestax/Number(this.detailsPlanNum.exchangeRate)).toFixed(2)
+      this.detailsPlanNum.excipiencostIncludestax =   (  this.$refs.unitTabs.sumInfo.ingAmount ==''|| ! this.$refs.unitTabs.sumInfo.ingAmount )?0:Number( this.$refs.unitTabs.sumInfo.ingAmount ).toFixed(2)//表头辅料成本(¥)
+      this.$refs.unitTabs.sumInfo.amountTotal = (Number(this.$refs.unitTabs.sumInfo.fabricAmount)+Number(this.$refs.unitTabs.sumInfo.ingAmount)+Number( this.$refs.unitTabs.sumInfo.shipProcesFees)).toFixed(2)//合计金额
     },
 
     // father 方法

+ 3 - 2
src/views/reportForms/cost-allocation-table/tabs.vue

@@ -752,8 +752,9 @@ export default {
       this.ingData.map(item=>{
         if(item.goodsName == record.goodsName){
           item.transferCost = data
-             }
+        }
       })
+      this.$emit('IngInQua',this.ingData)
     },
     // 面料 -余下数量 弹框
     fabRemQuaCustomCell(record) {
@@ -805,7 +806,7 @@ export default {
             this.$refs.ingInQuaModal.record = record
             record.syTransfers.map(item=>{
               if(item.unitCost){
-               item.unitCost =  (item.unitCost).toFixed(4)
+               item.unitCost =  Number(item.unitCost).toFixed(4)
               }
             })
             this.$refs.ingInQuaModal.data = record.syTransfers