diff --git a/pages/highWay/runData/form.vue b/pages/highWay/runData/form.vue index ae14fc5..db2a931 100644 --- a/pages/highWay/runData/form.vue +++ b/pages/highWay/runData/form.vue @@ -216,11 +216,9 @@ this.pageType = 'add'; let now = new Date(); this.form.statDate = getDateStr(now, -1);//默认前一天 - this.queryYoYMom(); this.queryStation('add'); this.queryTime();//统计时段 } if(options.id) { - this.queryYoYMom(); this.queryDetailInfo(options.id); } this.queryPerson(); @@ -409,6 +407,7 @@ let idx = this.array.findIndex(item => item.dictValue == this.form.statPeriod); this.index = idx > -1 ? idx : ''; } + this.queryYoYMom(); }) }, //确认提交 diff --git a/pages/railway/runStatus/form.vue b/pages/railway/runStatus/form.vue index c77db57..e495c0e 100644 --- a/pages/railway/runStatus/form.vue +++ b/pages/railway/runStatus/form.vue @@ -101,8 +101,7 @@ this.queryStation(); //车展名称列表 } if (options.id) { this.$request(getApp().globalData.baseUrl+'/api/biz/railwayRunSituation/find//'+options.id,{},"GET").then(res => { - this.form = res.data; - this.queryYoyMom(); + this.form = res.data; this.queryTime(); //统计时段 this.queryStation(); //车展名称列表 }); @@ -161,13 +160,16 @@ let dateStr = getDateStr(now, 0); if(new Date(dateStr + ' 11:00').getTime() < new Date().getTime() && new Date().getTime() < new Date(dateStr + ' 13:30').getTime()) { this.form.statPeriod = '0012'; - this.index = this.array.findIndex(item => item.dictValue == '0012'); + let idx = this.array.findIndex(item => item.dictValue == '0012'); + this.index = idx > -1 ? idx : idx; }else{ this.form.statPeriod = '03'; //默认0-24 - this.index = this.array.findIndex(item => item.dictValue == '03'); + let idx = this.array.findIndex(item => item.dictValue == '03'); + this.index = idx > -1 ? idx : idx; } }else{ - this.index = this.array.findIndex(item => item.dictValue == this.form.statPeriod); + let idx = this.array.findIndex(item => item.dictValue == this.form.statPeriod); + this.index = idx > -1 ? idx : idx; } }) }, diff --git a/pages/water/TransportData/form.vue b/pages/water/TransportData/form.vue index 54cf7f0..f4b1b8b 100644 --- a/pages/water/TransportData/form.vue +++ b/pages/water/TransportData/form.vue @@ -145,13 +145,11 @@ let now = new Date(); this.form.affiliatedUnit = this.userInfo.organizationName ? this.userInfo.organizationName : ''; this.form.statDate = getDateStr(now, -1); //默认前一天 - this.queryYoyMom(); //同比环比 this.queryTime(); //统计时段 } else if (options.id) { this.$request(getApp().globalData.baseUrl + '/api/biz/watertransportRunData/find/' + options.id, {}, "GET").then( res => { this.form = res.data; - this.queryYoyMom(); this.queryTime(); //统计时段 }); } @@ -162,8 +160,7 @@ if (this.form.statDate == '' || this.form.statPeriod == '') { return; } - // let _date = getDateStr(new Date(this.form.statDate), -1); - this.$request(getApp().globalData.baseUrl + '/api/biz/bizPilotData/getYoyMom?statDate=' + this.form + this.$request(getApp().globalData.baseUrl + '/api/biz/watertransportRunData/getYoYMoM?statDate=' + this.form .statDate + '&statPeriod=' + this.form.statPeriod + '&_t=' + Date.parse(new Date()), {}, 'GET') .then(res => { this.yoyMom = res.data; @@ -182,22 +179,6 @@ .voyageWatertransportMomDo) - this.yoyMom.lastYearData.voyageWatertransportMomDo) / this.yoyMom.lastYearData.voyageWatertransportMomDo * 100 : ''; } }, - //车站权限列表 - queryStation() { - this.$request(getApp().globalData.baseUrl + '/api/biz/railwayRunData/getCurrentSite?_t=' + Date.parse( - new Date()), {}, 'GET').then(res => { - this.stationList = res.data; - if (this.pageType == 'add') { - this.form.railwayName = res.data[0]; - this.railwayNameIndex = 0; - } - }) - }, - //车站选择 - changeRailway(e) { - this.railwayNameIndex = e.detail.value; - this.form.railwayName = this.stationList[e.detail.value]; - }, //统计时段切换选择 changeStatPeriod(e) { this.index = e.detail.value; @@ -234,7 +215,8 @@ } }else{ this.index = this.array.findIndex(item => item.dictValue == this.form.statPeriod); - } + } + this.queryYoyMom(); }) }, //确认提交