gjy 3 gadi atpakaļ
vecāks
revīzija
bdbebf440c
1 mainītis faili ar 27 papildinājumiem un 6 dzēšanām
  1. 27 6
      src/views/statisticalReport/stockSaleOutReportList.vue

+ 27 - 6
src/views/statisticalReport/stockSaleOutReportList.vue

@@ -192,7 +192,7 @@
     <el-dialog width="25%" title="收款" :visible.sync="dialogFormVisible1" :append-to-body="true">
       <el-form :model="form">
         <el-form-item label="未收金额(元)" :label-width="formLabelWidth" prop="amountNotReceivable">
-          <span>{{ uncollectedAmount }}</span>
+          <span>{{ uncollectedAmount1 }}</span>
         </el-form-item>
         <el-form-item label="本次收款金额(元)" :label-width="formLabelWidth">
           <el-input v-model="money" autocomplete="off" placeholder="请输入本次收款金额" class="deal"></el-input>
@@ -292,6 +292,7 @@
         allmoney1: 0,
         deptCircularPage: {},
         deptBudgetTotal: 0,
+        uncollectedAmount1:0,
         stockSaleReceiptReportList: [],
         stockSaleReceiptReport: {
           stockSaleReceiptReportList: [],
@@ -650,7 +651,14 @@
           }
 
         })
-        console.log(sums[sums.length - 1],sums[sums.length - 2])
+        for (let i = 0; i < sums.length; i++) {
+          console.log(typeof sums[i])
+          if(typeof sums[i]=='number'){
+            sums[i]=sums[i].toFixed(3)
+          }
+          
+        }
+        console.log(sums)
           // sums[sums.length - 1] = sums[sums.length - 1].toFixed(2)
           // sums[sums.length - 2] = sums[sums.length - 2].toFixed(2)
         return sums
@@ -732,10 +740,23 @@
       },
       //收款
       handlecollect() {
-        this.amountEdReceivable = this.saleList.records[0].amountEdReceivable
-        this.amountNotReceivable = this.saleList.records[0].amountNotReceivable
-        this.stockSaleReceiptReportList = this.saleList.records
-        this.dialogFormVisible1 = true
+        if(this.modification.length>0){
+          this.uncollectedAmount1=0
+          for (let i = 0; i < this.modification.length; i++) {
+            this.uncollectedAmount1+=Number(this.modification[i].amountNotReceivable)
+          }
+          this.uncollectedAmount1=this.uncollectedAmount1.toFixed(3)
+          this.amountEdReceivable = this.saleList.records[0].amountEdReceivable
+          this.amountNotReceivable = this.saleList.records[0].amountNotReceivable
+          this.stockSaleReceiptReportList = this.saleList.records
+          this.dialogFormVisible1 = true
+        }else{
+          this.$message({
+            message: '请至少选择一个条目',
+            type: 'warning',
+          })
+        }
+        
       },
       collectment() {
         this.stockSaleReceiptReport.money = this.money