Browse Source

增加发票成本和费用支出的合计行

jbb 2 years ago
parent
commit
8d9af3e766
1 changed files with 63 additions and 0 deletions
  1. 63 0
      src/views/reportForms/fabric-loss-table.vue

+ 63 - 0
src/views/reportForms/fabric-loss-table.vue

@@ -202,6 +202,7 @@
           :data-source="fabricLoss.fabricCostInvoiceList"
           bordered
           :pagination="false"
+          :footer="costFooterShow"
         >
         </a-table>
       </div>
@@ -274,6 +275,7 @@
           :data-source="fabricLoss.fabricExpensesList"
           bordered
           :pagination="false"
+          :footer="costPayFooterShow"
         >
         </a-table>
       </div>
@@ -872,6 +874,21 @@ export default {
       }
     },
 
+    //成本发票 -----合计行
+    costFooterShow(data){
+       return (
+        <a-table
+          rowKey={Math.random}
+          bordered={false}
+          pagination={false}
+          columns={this.costInvoiceColumns}
+          dataSource={this.costFooterDataSource || []}
+          showHeader={false}
+        ></a-table>
+      )
+    },
+    
+
 
     // 开票成本-成衣 ----合计行
     clothesFooterShow(data) {
@@ -900,6 +917,19 @@ export default {
         ></a-table>
       )
     },
+    //费用支出 ----合计行
+    costPayFooterShow(){
+       return (
+        <a-table
+          rowKey={Math.random}
+          bordered={false}
+          pagination={false}
+          columns={this.costPayColumns}
+          dataSource={this.costPayFooterDataSource || []}
+          showHeader={false}
+        ></a-table>
+      )
+    },
     // 开票成本-面料 ----合计行
     clothFooterShow(data) {
       return (
@@ -1025,6 +1055,20 @@ export default {
   // },
   // 构建合计数据 --合计
   computed: {
+    costFooterDataSource(){
+       //成本发票 合计
+       var item = {
+        "cbusType":"合计"
+      };
+      var imoney = 0;
+      for (let row of this.fabricLoss.fabricCostInvoiceList){
+        imoney += row.imoney*1;
+      }
+      
+      item.imoney= parseFloat(imoney.toFixed(2));
+      return [item];
+    },
+   
     clothFooterDataSource() {
       // 开票成本-面料 合计
       var item = {
@@ -1077,6 +1121,25 @@ export default {
       item.iquantityIn = parseFloat(iquantityIn.toFixed(4));
       item.iquantityInvoice = parseFloat(iquantityInvoice.toFixed(4));
       return [item];
+    },
+    costPayFooterDataSource(){
+      //费用支出 合计
+       var item = {
+        "cspvcode":"合计"
+      };
+      var inatMoney = 0,imoney=0
+      for (let row of this.fabricLoss.fabricExpensesList){
+        inatMoney += row.inatMoney*1;
+        if(row.inatMoney == row.imoney ){
+          imoney += 0
+        }else{
+          imoney += row.imoney*1
+        }
+        
+      }
+      item.inatMoney = parseFloat(inatMoney.toFixed(4));
+      item.imoney = parseFloat(imoney.toFixed(4));
+      return [item];
     }
   }
 }