接口联调

main
张群 2 years ago
parent a566dcaad5
commit 4ecf346e93
  1. 3
      pages/highWay/runData/form.vue
  2. 12
      pages/railway/runStatus/form.vue
  3. 24
      pages/water/TransportData/form.vue

@ -216,11 +216,9 @@
this.pageType = 'add'; this.pageType = 'add';
let now = new Date(); let now = new Date();
this.form.statDate = getDateStr(now, -1);// this.form.statDate = getDateStr(now, -1);//
this.queryYoYMom();
this.queryStation('add'); this.queryStation('add');
this.queryTime();// this.queryTime();//
} if(options.id) { } if(options.id) {
this.queryYoYMom();
this.queryDetailInfo(options.id); this.queryDetailInfo(options.id);
} }
this.queryPerson(); this.queryPerson();
@ -409,6 +407,7 @@
let idx = 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 : ''; this.index = idx > -1 ? idx : '';
} }
this.queryYoYMom();
}) })
}, },
// //

@ -101,8 +101,7 @@
this.queryStation(); // this.queryStation(); //
} if (options.id) { } if (options.id) {
this.$request(getApp().globalData.baseUrl+'/api/biz/railwayRunSituation/find//'+options.id,{},"GET").then(res => { this.$request(getApp().globalData.baseUrl+'/api/biz/railwayRunSituation/find//'+options.id,{},"GET").then(res => {
this.form = res.data; this.form = res.data;
this.queryYoyMom();
this.queryTime(); // this.queryTime(); //
this.queryStation(); // this.queryStation(); //
}); });
@ -161,13 +160,16 @@
let dateStr = getDateStr(now, 0); let dateStr = getDateStr(now, 0);
if(new Date(dateStr + ' 11:00').getTime() < new Date().getTime() && new Date().getTime() < new Date(dateStr + ' 13:30').getTime()) { if(new Date(dateStr + ' 11:00').getTime() < new Date().getTime() && new Date().getTime() < new Date(dateStr + ' 13:30').getTime()) {
this.form.statPeriod = '0012'; 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{ }else{
this.form.statPeriod = '03'; //0-24 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{ }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;
} }
}) })
}, },

@ -145,13 +145,11 @@
let now = new Date(); let now = new Date();
this.form.affiliatedUnit = this.userInfo.organizationName ? this.userInfo.organizationName : ''; this.form.affiliatedUnit = this.userInfo.organizationName ? this.userInfo.organizationName : '';
this.form.statDate = getDateStr(now, -1); // this.form.statDate = getDateStr(now, -1); //
this.queryYoyMom(); //
this.queryTime(); // this.queryTime(); //
} else if (options.id) { } else if (options.id) {
this.$request(getApp().globalData.baseUrl + '/api/biz/watertransportRunData/find/' + options.id, {}, "GET").then( this.$request(getApp().globalData.baseUrl + '/api/biz/watertransportRunData/find/' + options.id, {}, "GET").then(
res => { res => {
this.form = res.data; this.form = res.data;
this.queryYoyMom();
this.queryTime(); // this.queryTime(); //
}); });
} }
@ -162,8 +160,7 @@
if (this.form.statDate == '' || this.form.statPeriod == '') { if (this.form.statDate == '' || this.form.statPeriod == '') {
return; return;
} }
// let _date = getDateStr(new Date(this.form.statDate), -1); this.$request(getApp().globalData.baseUrl + '/api/biz/watertransportRunData/getYoYMoM?statDate=' + this.form
this.$request(getApp().globalData.baseUrl + '/api/biz/bizPilotData/getYoyMom?statDate=' + this.form
.statDate + '&statPeriod=' + this.form.statPeriod + '&_t=' + Date.parse(new Date()), {}, 'GET') .statDate + '&statPeriod=' + this.form.statPeriod + '&_t=' + Date.parse(new Date()), {}, 'GET')
.then(res => { .then(res => {
this.yoyMom = res.data; this.yoyMom = res.data;
@ -182,22 +179,6 @@
.voyageWatertransportMomDo) - this.yoyMom.lastYearData.voyageWatertransportMomDo) / this.yoyMom.lastYearData.voyageWatertransportMomDo * 100 : ''; .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) { changeStatPeriod(e) {
this.index = e.detail.value; this.index = e.detail.value;
@ -234,7 +215,8 @@
} }
}else{ }else{
this.index = this.array.findIndex(item => item.dictValue == this.form.statPeriod); this.index = this.array.findIndex(item => item.dictValue == this.form.statPeriod);
} }
this.queryYoyMom();
}) })
}, },
// //

Loading…
Cancel
Save