瀏覽代碼

表格合计

zhongtianhaoyuan 3 年之前
父節點
當前提交
0797c91f8a
共有 1 個文件被更改,包括 78 次插入11 次删除
  1. 78 11
      src/views/statisticalReport/stockSaleOutReportList.vue

+ 78 - 11
src/views/statisticalReport/stockSaleOutReportList.vue

@@ -289,7 +289,8 @@
 
       <!-- 页数 -->
       <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
-        :page-sizes="[10, 30, 50, 100, 500, 1000, 9999]" layout="total, sizes, prev, pager, next, jumper" :total="deptBudgetTotal"></el-pagination>
+        :page-sizes="[10, 30, 50, 100, 500, 1000, 9999]" layout="total, sizes, prev, pager, next, jumper"
+        :total="deptBudgetTotal"></el-pagination>
     </div>
     <!-- 定金弹窗 -->
     <WinseaContentModal v-model="accessoryTFs" :title="$t('system.noticeCircular.information')"
@@ -315,7 +316,8 @@
           <span>{{ uncollectedAmount1 }}</span>
         </el-form-item>
         <el-form-item label="本次收款金额(元)" :label-width="formLabelWidth">
-          <el-input type='number' step="0.01" v-model="money" autocomplete="off" placeholder="请输入本次收款金额" class="deal"></el-input>
+          <el-input type='number' step="0.01" v-model="money" autocomplete="off" placeholder="请输入本次收款金额" class="deal">
+          </el-input>
         </el-form-item>
         <el-form-item label="收款日期" prop="collectionDate" :label-width="formLabelWidth" class="deal">
           <ws-date-picker v-model="collectionDate" type="date" placeholder="请选择收款日期" value-format="yyyy-MM-dd"
@@ -513,6 +515,8 @@
         accessoryTFs2: false,
         addressUrlArray: [],
         addressUrlArray1: [],
+        money: "",
+        weight: ""
       }
     },
     activated() {
@@ -673,13 +677,11 @@
                   })
                 }
               }
-              if(this.tranProcessInfo.length >0){
-              this.activeName = this.tranProcessInfo[0].name
-              this.tranType = this.tranProcessInfo[0].tranType
+              if (this.tranProcessInfo.length > 0) {
+                this.activeName = this.tranProcessInfo[0].name
+                this.tranType = this.tranProcessInfo[0].tranType
               }
             }
-
-
             if (this.contractNoList[i].depositUrl) {
               this.addressUrlArray = this.contractNoList[i].depositUrl.split(',')
             } else {
@@ -842,7 +844,8 @@
             if (index === 0) {
               sums[index] = '合计'
             } else if (
-              index === 10 ||
+              // index === 10 ||
+              index === 8 ||
               index === 11 ||
               index === 13 ||
               index === 12
@@ -857,9 +860,24 @@
                     return prev
                   }
                 }, 0)
+                if (index == 11) {
+                  this.money = sums[index]
+                }
+                if (index == 8) {
+                  this.weight = sums[index]
+                }
               } else {
                 sums[index] = '元'
               }
+            } else if (index === 10) {
+              const values = data.map((item) => Number(item[column.property]))
+              if (!values.every((value) => isNaN(value))) {
+                if (this.money == 0 || this.weight == 0) {
+                  sums[index] = 0
+                } else {
+                  sums[index] = Number(this.money / this.weight).toFixed(2)
+                }
+              }
             } else {
               sums[index] = '--'
             }
@@ -869,7 +887,7 @@
                 sums[index] = '合计'
               } else if (
                 index === 11 ||
-                index === 9 ||
+                // index === 9 ||
                 index === 10 ||
                 index === 8
               ) {
@@ -883,9 +901,25 @@
                       return prev
                     }
                   }, 0)
+                  if (index == 8) {
+                    this.weight = sums[index]
+                  }
+                  if (index == 10) {
+                    this.money = sums[index]
+                  }
                 } else {
                   sums[index] = '元'
                 }
+              } else if (index === 9) {
+                const values = data.map((item) => Number(item[column.property]))
+                if (!values.every((value) => isNaN(value))) {
+                  if (this.money == 0 || this.weight == 0) {
+                    sums[index] = 0
+                  } else {
+                    sums[index] = Number(this.money / this.weight).toFixed(2)
+                  }
+                }
+
               } else {
                 sums[index] = '--'
               }
@@ -894,7 +928,9 @@
                 sums[index] = '合计'
               } else if (
                 index === 11 ||
-                index === 10 ||
+                index === 7 ||
+                index === 8 ||
+                // index === 10 ||
                 index === 13 ||
                 index === 12
               ) {
@@ -908,9 +944,24 @@
                       return prev
                     }
                   }, 0)
+                  if (index == 8) {
+                    this.weight = sums[index]
+                  }
+                  if (index == 11) {
+                    this.money = sums[index]
+                  }
                 } else {
                   sums[index] = '元'
                 }
+              } else if (index === 10) {
+                const values = data.map((item) => Number(item[column.property]))
+                if (!values.every((value) => isNaN(value))) {
+                  if (this.money == 0 || this.weight == 0) {
+                    sums[index] = 0
+                  } else {
+                    sums[index] = Number(this.money / this.weight).toFixed(2)
+                  }
+                }
               } else {
                 sums[index] = '--'
               }
@@ -920,7 +971,7 @@
               } else if (
                 index === 11 ||
                 index === 12 ||
-                index === 10 ||
+                // index === 10 ||
                 index === 9
               ) {
                 const values = data.map((item) => Number(item[column.property]))
@@ -933,9 +984,25 @@
                       return prev
                     }
                   }, 0)
+                  if (index == 9) {
+                    this.weight = sums[index]
+                  }
+                  if (index = 11) {
+                    this.money = sums[index]
+                  }
                 } else {
                   sums[index] = '元'
                 }
+              } else if (index == 10) {
+                const values = data.map((item) => Number(item[column.property]))
+                if (!values.every((value) => isNaN(value))) {
+                  if (this.money == 0 || this.weight == 0) {
+                    sums[index] = 0
+                  } else {
+                    sums[index] = Number(this.money / this.weight).toFixed(2)
+                  }
+
+                }
               } else {
                 sums[index] = '--'
               }