Forráskód Böngészése

修改时间格式

xiaohaizhao 1 éve
szülő
commit
ba91478c79
1 módosított fájl, 5 hozzáadás és 5 törlés
  1. 5 5
      packageA/account/index.js

+ 5 - 5
packageA/account/index.js

@@ -10,7 +10,7 @@ Page({
         dateEnd: "", //日期结束时间
     },
     onLoad(options) {
-        let ymonth = formatTime(new Date(), '-').split(" ")[0].slice(0, 7);
+        let ymonth = formatTime(new Date(), '').split(" ")[0].slice(0, 7);
         this.setData({
             ymonth,
             dateEnd: ymonth
@@ -42,7 +42,7 @@ Page({
     /* 切换查看时间 */
     changeDate(e) {
         this.setData({
-            ymonth: e.detail.value
+            ymonth: e.detail.value.replace('-', '年')
         })
         this.getList();
     },
@@ -55,8 +55,8 @@ Page({
                 "sys_enterpriseid": data.sys_enterpriseid,
                 "sa_accountclassid": data.sa_accountclassid,
                 "where": {
-                    "year": this.data.ymonth.split("-")[0],
-                    "month": this.data.ymonth.split("-")[1]
+                    "year": this.data.ymonth.split("")[0],
+                    "month": this.data.ymonth.split("")[1]
                 }
             }
         }).then(res => {
@@ -67,7 +67,7 @@ Page({
                 if (res.data.total.length) {
                     let expendObj = res.data.total.find(v => v.type == 1);
                     if (expendObj) expend = expendObj.sumamount;
-                    let earningObj = res.data.total.find(v => v.type == 1);
+                    let earningObj = res.data.total.find(v => v.type == 0);
                     if (earningObj) earning = earningObj.sumamount;
                 }
                 this.setData({