Browse Source

增加1月判断

zjz 2 years ago
parent
commit
e5c2e79bd7
1 changed files with 6 additions and 3 deletions
  1. 6 3
      src/views/dashboard/components/misdata/yearmoney.vue

+ 6 - 3
src/views/dashboard/components/misdata/yearmoney.vue

@@ -40,11 +40,14 @@ export default {
   },
   created(){
     getThisYearPay({token:config.token}).then(res=>{
-      if(res.Code == 200){
+        if(res.Code == 200){
+        var currentMonth = new Date().getMonth() + 1
         this.curYearPay = parseFloat(res.Result.ThisYearPay)
         this.curMonthPay = parseFloat(res.Result.ThismonthPay === '' ? 0 : res.Result.ThismonthPay)
-        this.nextMonthPay = parseFloat(res.Result.lastmonthPay)
-        this.beforeNextMonthPay = (this.curYearPay - this.curMonthPay - this.nextMonthPay).toFixed(2)
+        if (currentMonth != 1) {
+          this.nextMonthPay = parseFloat(res.Result.lastmonthPay || 0)   //上月收费
+          this.beforeNextMonthPay = (this.curYearPay - this.curMonthPay - this.nextMonthPay).toFixed(2)
+          }
       }
     })
   },