Parcourir la source

历史付款记录页面增加合计,取付款总合

l1069030731 il y a 2 ans
Parent
commit
162d27aa9d
1 fichiers modifiés avec 18 ajouts et 2 suppressions
  1. 18 2
      src/view/material-manege/pay/pay-history.vue

+ 18 - 2
src/view/material-manege/pay/pay-history.vue

@@ -15,8 +15,7 @@
       </Form>
         <date-select v-model="params" @change="selectTime"></date-select>
     </div>
-    <div style="background:#fff;padding:10px;margin-bottom:10px">
-        
+    <div style="background:#fff;padding:10px;margin-bottom:10px; position: relative">
         <Tabs v-model="salesVolumeCompanyTotalType" @on-click="tabsChange">
             <TabPane  label="全部" name="1"></TabPane>
             <TabPane :label="(h) => {
@@ -50,6 +49,10 @@
                     h('span', ')')])
             }" name="6"></TabPane>
         </Tabs>
+        <span style="position: absolute; top: 10px; line-height: 37px; right: 20px;">
+          合计: 
+          <span style="color: red">{{ getACombined() }}</span>
+        </span>
         <div>
             <Button style="margin:0 10px 5px 0" :type="params.supplierId == null || params.supplierId =='' ? 'primary' : 'default'" @click="changeCompany(null,0,'')" >全部</Button>
             <Button 
@@ -473,6 +476,19 @@ export default {
             })
         
       
+    },
+    getACombined() {
+      let total = 0
+      if (this.statisticsData && this.statisticsData.length > 0) {
+        for (let i = 0; i < this.statisticsData.length; i++) {
+          if (this.salesVolumeCompanyTotalType == '1' && this.statisticsData[i].total) {
+            total = parseFloat(Number(total) + Number(this.statisticsData[i].total)).toFixed(2)
+          } else if (this.statisticsData[i].type == this.salesVolumeCompanyTotalType && this.statisticsData[i].total) {
+            total = parseFloat(Number(total) + Number(this.statisticsData[i].total)).toFixed(2)
+          }
+        }
+      }
+      return total
     }
   },
   mounted () {