|
|
|
|
@ -254,18 +254,19 @@ |
|
|
|
|
}, |
|
|
|
|
onLoad(options) { |
|
|
|
|
this.userInfo = uni.getStorageSync('userInfo'); |
|
|
|
|
this.queryStation(); //车展名称列表 |
|
|
|
|
if (options.type == 'add') { |
|
|
|
|
this.pageType = 'add'; |
|
|
|
|
let now = new Date(); |
|
|
|
|
this.form.statDate = getDateStr(now, -1); //默认前一天 |
|
|
|
|
this.queryTime(); //统计时段 |
|
|
|
|
this.queryStation(); |
|
|
|
|
} else if (options.id) { |
|
|
|
|
this.btnText = '修改并保存'; |
|
|
|
|
this.$request(getApp().globalData.baseUrl + '/api/biz/railwayRunData/find/' + options.id, {}, "GET").then( |
|
|
|
|
res => { |
|
|
|
|
this.form = res.data; |
|
|
|
|
this.queryTime(); //统计时段 |
|
|
|
|
this.queryStation(); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
@ -281,12 +282,12 @@ |
|
|
|
|
}, |
|
|
|
|
//环比同比 |
|
|
|
|
queryYoyMom() { |
|
|
|
|
if (this.form.statDate == '' || this.form.statPeriod == '') { |
|
|
|
|
if (this.form.statDate == '' || this.form.statPeriod == '' || this.form.railwayName == '') { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
// let _date = getDateStr(new Date(this.form.statDate), -1); |
|
|
|
|
this.$request(getApp().globalData.baseUrl + '/api/biz/railwayRunData/getYoYMoM?statDate=' + this.form |
|
|
|
|
.statDate + '&statPeriod=' + this.form.statPeriod + '&_t=' + Date.parse(new Date()), {}, 'GET') |
|
|
|
|
.statDate + '&statPeriod=' + this.form.statPeriod + '&railwayName=' + this.form.railwayName + '&_t=' + Date.parse(new Date()), {}, 'GET') |
|
|
|
|
.then(res => { |
|
|
|
|
this.yoyMom = res.data; |
|
|
|
|
this.calcYoyMom(); //同步更新环比同比 |
|
|
|
|
@ -394,12 +395,15 @@ |
|
|
|
|
this.form.railwayName = res.data[0]; |
|
|
|
|
this.railwayNameIndex = 0; |
|
|
|
|
} |
|
|
|
|
this.queryYoyMom(); |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
//车站选择 |
|
|
|
|
changeRailway(e) { |
|
|
|
|
this.railwayNameIndex = e.detail.value; |
|
|
|
|
this.form.railwayName = this.stationList[e.detail.value]; |
|
|
|
|
this.queryYoyMom(); |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
//统计时段切换选择 |
|
|
|
|
changeStatPeriod(e) { |
|
|
|
|
|