|
@@ -14,14 +14,13 @@ Page({
|
|
|
data: {
|
|
|
accountList: [],
|
|
|
active: 0,
|
|
|
- ymonth: "", //年月
|
|
|
dateEnd: "", //日期结束时间
|
|
|
+ begindate: "",
|
|
|
+ enddate: "",
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
- let ymonth = formatTime(new Date(), '年').split(" ")[0].slice(0, 7);
|
|
|
this.setData({
|
|
|
- ymonth,
|
|
|
- dateEnd: ymonth
|
|
|
+ dateEnd: formatTime(new Date(), '-').split(" ")[0]
|
|
|
});
|
|
|
_Http.basic({
|
|
|
id: 20221008145903,
|
|
@@ -33,7 +32,6 @@ Page({
|
|
|
}
|
|
|
}
|
|
|
}).then(res => {
|
|
|
- console.log(res)
|
|
|
this.setData({
|
|
|
accountList: res.data.map(v => {
|
|
|
v.creditquota = CNY(v.creditquota);
|
|
@@ -55,9 +53,9 @@ Page({
|
|
|
/* 切换查看时间 */
|
|
|
changeDate(e) {
|
|
|
this.setData({
|
|
|
- ymonth: e.detail.value.replace('-', '年')
|
|
|
+ [`${e.currentTarget.dataset.name}`]: e.detail.value
|
|
|
})
|
|
|
- this.getList();
|
|
|
+ this.getList(true);
|
|
|
},
|
|
|
getList(init = false) {
|
|
|
if (init) {
|
|
@@ -74,8 +72,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]
|
|
|
+ begindate: this.data.begindate,
|
|
|
+ enddate: this.data.enddate
|
|
|
}
|
|
|
}
|
|
|
}).then(res => {
|
|
@@ -89,7 +87,7 @@ Page({
|
|
|
let earningObj = res.data[0].total.find(v => v.type == 0);
|
|
|
if (earningObj) earning = CNY(earningObj.sumamount);
|
|
|
}
|
|
|
- res.data = res.data.map(v=>{
|
|
|
+ res.data = res.data.map(v => {
|
|
|
v.amount = CNY(v.amount)
|
|
|
v.showBalance = CNY(v.balance)
|
|
|
return v
|