Browse Source

面损表-成本发票-增加无税金额列

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

+ 25 - 8
src/views/reportForms/fabric-loss-table.vue

@@ -233,7 +233,7 @@
            <span slot="imoney" slot-scope="text,record">
               <a v-if="(record.cbusType == '转出成本') || (record.cbusType == '转入成本')&& !record.bmanual" @click="imoneyCell(record)">{{text}}</a>
               <span v-if="(record.cbusType !== '转出成本') && (record.cbusType !== '转入成本') && !record.bmanual" >{{text}}</span>
-              <a-input placeholder="请输入" v-model="record.imoney" v-if="record.bmanual && showSelect==0" @blur="judageNumber(record)"/>
+              <a-input placeholder="请输入" v-model="record.imoney" v-if="record.bmanual && showSelect==0" @blur="judageNumber(record,'imoney')"/>
               <span v-if="record.bmanual && showSelect==1" >{{text}}</span>
           </span>
         <!-- 工厂 -->
@@ -241,6 +241,11 @@
               <a-input placeholder="请输入工厂" v-model="record.cvenAbbName" v-if="(record.cbusType == '转出成本' && showSelect==0) ||(record.bmanual&& showSelect==0)"/>
               <span v-else>{{text}}</span>
           </span>
+          <!-- 无税金额-->
+        <span slot="iNoTaxMoney" slot-scope="text,record">
+              <a-input placeholder="请输入" v-model="record.iNoTaxMoney" v-if="record.bmanual && showSelect==0" @blur="judageNumber(record,'iNoTaxMoney')"/>
+              <span v-else>{{text}}</span>
+          </span>
         </a-table>
       </div>
 
@@ -591,7 +596,8 @@ export default {
         { title: '类型', width: 120, dataIndex: 'cvcname', className: 'replacecolor' },
         { title: '采购类型', width: 120, dataIndex: 'cbusType', className: 'replacecolor' , scopedSlots: { customRender: 'cbusType' }},
         { title: '工厂', width: 120, dataIndex: 'cvenAbbName', className: 'replacecolor', scopedSlots: { customRender: 'cvenAbbName' } },
-        { title: '成本金额', dataIndex: 'imoney', width: 120, className: 'replacecolor',scopedSlots: { customRender: 'imoney' } }
+        { title: '成本金额', dataIndex: 'imoney', width: 120, className: 'replacecolor',scopedSlots: { customRender: 'imoney' } },
+        { title: '无税金额', dataIndex: 'iNoTaxMoney', width: 120, className: 'replacecolor',scopedSlots: { customRender: 'iNoTaxMoney' } }
       ],
       costInvoiceData: [
         { costInvoiceType: '纱款', factory: '17TW-C-17B', costAmount: '5081.72' },
@@ -846,7 +852,7 @@ export default {
               if (this.fabricLoss.fabricAccidentList == null){
                 this.fabricLoss.fabricAccidentList = [];
               }
-              this.calculateTotal()
+              this.calculateTotal('frist')
             }else{
               this.fabricLoss = {fabricPoOrderList:[],fabricOMOrderList1:[],fabricOMOrderList2:[],fabricCostAssistList:[],fabricCostClothList:[],fabricCostClothesList:[],fabricCostInvoiceList:[],fabricExpensesList:[],fabricAccidentList:[]};
               this.$message.info(res.message);
@@ -857,18 +863,24 @@ export default {
       }
     },
     //计算合计行
-    calculateTotal(){
+    calculateTotal(data){
+      if(data =='notFrist'){
+        this.fabricLoss.fabricCostInvoiceList.pop()
+      }
        //计算成本发票合计
-         var imoney = 0;
+         var imoney = 0,
+         iNoTaxMoney = 0
          for (let row of this.fabricLoss.fabricCostInvoiceList){
             imoney += row.imoney*1;
+            iNoTaxMoney +=(row.iNoTaxMoney?row.iNoTaxMoney:0)*1
           }
           if(this.fabricLoss.fabricCostInvoiceList.length !==0){
             this.fabricLoss.fabricCostInvoiceList.push({
                 cvcname:'',
                 cbusType:'合计',
                 cvenAbbName:'',
-                imoney:parseFloat(imoney.toFixed(2))
+                imoney:parseFloat(imoney.toFixed(2)),
+                iNoTaxMoney:parseFloat(iNoTaxMoney.toFixed(2)),
               })
           }
         //计算开票成本-面料合计
@@ -960,11 +972,16 @@ export default {
         }
       })
     },
-    judageNumber(record){
-       if(isNaN(Number(record.imoney))){
+    judageNumber(record,data){
+       if(isNaN(Number(record.imoney)) && data=='imoney'){
            this.$message.error('必须输入数字,请重新输入!');
            record.imoney = ''
         }
+        if(isNaN(Number(record.iNoTaxMoney)) && data=='iNoTaxMoney'){
+          this.$message.error('必须输入数字,请重新输入!');
+           record.iNoTaxMoney = ''
+        }
+        this.calculateTotal('notFrist')
     },
     
     //行样式