From b8d39386b22953e4d6c572cc801fd6afea0e2e47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=BE=A4?= Date: Mon, 18 Sep 2023 15:40:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E6=9C=9F=E6=A0=BC=E5=BC=8F=E5=85=BC?= =?UTF-8?q?=E5=AE=B9=EF=BC=9B=E5=9C=B0=E9=93=81=E6=8E=A5=E5=8F=A3=E8=81=94?= =?UTF-8?q?=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 10 +- pages/airport/airport-runData/form.vue | 2 +- pages/airport/airport-runData/list.vue | 2 +- pages/airport/airport-runStatus/form.vue | 2 +- pages/airport/airport-runStatus/list.vue | 2 +- pages/highWay/runData/form.vue | 2 +- pages/highWay/runData/list.vue | 2 +- pages/highWay/runStatusData/form.vue | 2 +- pages/highWay/runStatusData/list.vue | 2 +- pages/metro/subwayPage/form.vue | 105 +++++++++++++----- pages/metro/subwayPage/list.vue | 6 +- .../portShipping/waterInternational/form.vue | 43 ++++--- .../portShipping/waterInternational/list.vue | 2 +- pages/railway/railwayRunData/form.vue | 2 +- pages/railway/railwayRunData/list.vue | 2 +- pages/railway/runStatus/form.vue | 2 +- pages/railway/runStatus/list.vue | 2 +- pages/water/transportation/form.vue | 2 +- pages/water/transportation/list.vue | 2 +- pages/water/waterWay/list.vue | 2 +- 20 files changed, 126 insertions(+), 70 deletions(-) diff --git a/pages.json b/pages.json index 31b3644..7edacfb 100644 --- a/pages.json +++ b/pages.json @@ -2,7 +2,7 @@ "pages": [{ "path": "pages/home/home", "style": { - "navigationBarTitleText": "首页" + "navigationBarTitleText": "交通运输报送系统" } }, { @@ -14,7 +14,7 @@ { "path": "pages/login/login", "style": { - "navigationBarTitleText": "", + "navigationBarTitleText": "交通运输报送系统", "navigationBarBackgroundColor": "#2D8CF0" } }, @@ -144,7 +144,8 @@ { "path": "pages/portShipping/waterInternational/list", "style": { - "navigationBarTitleText": "水路国际客运" + "navigationBarTitleText": "水路国际客运", + "enablePullDownRefresh": true } }, { @@ -156,7 +157,8 @@ { "path": "pages/metro/subwayPage/list", "style": { - "navigationBarTitleText": "地铁客流量" + "navigationBarTitleText": "地铁客流量", + "enablePullDownRefresh": true } }, { diff --git a/pages/airport/airport-runData/form.vue b/pages/airport/airport-runData/form.vue index 10e342e..210ccaa 100644 --- a/pages/airport/airport-runData/form.vue +++ b/pages/airport/airport-runData/form.vue @@ -529,7 +529,7 @@ if (this.pageType == 'add') { let now = new Date(); //11:00-13:30 默认选择0-12 - let dateStr = getDateStr(now, 0); + let dateStr = getDateStr(now, 0).replaceAll('-','/'); if (new Date(dateStr + ' 11:00').getTime() < new Date().getTime() && new Date().getTime() < new Date(dateStr + ' 13:30').getTime()) { diff --git a/pages/airport/airport-runData/list.vue b/pages/airport/airport-runData/list.vue index 0c7cf9e..daac5be 100644 --- a/pages/airport/airport-runData/list.vue +++ b/pages/airport/airport-runData/list.vue @@ -312,7 +312,7 @@ display: flex; // justify-content: space-around; background-color: #F8F8F8; - padding: 20rpx 30rpx 40px; + padding: 40rpx 30rpx; .act_btn { width: 690rpx; diff --git a/pages/airport/airport-runStatus/form.vue b/pages/airport/airport-runStatus/form.vue index f971139..1ef837c 100644 --- a/pages/airport/airport-runStatus/form.vue +++ b/pages/airport/airport-runStatus/form.vue @@ -139,7 +139,7 @@ if(this.pageType == 'add') { let now = new Date(); //11:00-13:30 默认选择0-12 - let dateStr = getDateStr(now, 0); + let dateStr = getDateStr(now, 0).replaceAll('-','/'); if(new Date(dateStr + ' 11:00').getTime() < new Date().getTime() && new Date().getTime() < new Date(dateStr + ' 13:30').getTime()) { this.form.statPeriod = '0012'; let idx = this.array.findIndex(item => item.dictValue == '0012'); diff --git a/pages/airport/airport-runStatus/list.vue b/pages/airport/airport-runStatus/list.vue index 1d0d4de..7cd0fb9 100644 --- a/pages/airport/airport-runStatus/list.vue +++ b/pages/airport/airport-runStatus/list.vue @@ -312,7 +312,7 @@ display: flex; // justify-content: space-around; background-color: #F8F8F8; - padding: 20rpx 30rpx 40px; + padding: 40rpx 30rpx; .act_btn { width: 690rpx; diff --git a/pages/highWay/runData/form.vue b/pages/highWay/runData/form.vue index 4a2222b..3415b7e 100644 --- a/pages/highWay/runData/form.vue +++ b/pages/highWay/runData/form.vue @@ -529,7 +529,7 @@ if (this.pageType == 'add') { let now = new Date(); //11:00-13:30 默认选择0-12 - let dateStr = getDateStr(now, 0); + let dateStr = getDateStr(now, 0).replaceAll('-','/'); if (new Date(dateStr + ' 11:00').getTime() < new Date().getTime() && new Date().getTime() < new Date(dateStr + ' 13:30').getTime()) { this.form.statPeriod = '0012'; diff --git a/pages/highWay/runData/list.vue b/pages/highWay/runData/list.vue index 88f11f1..e265a71 100644 --- a/pages/highWay/runData/list.vue +++ b/pages/highWay/runData/list.vue @@ -320,7 +320,7 @@ right: 0; bottom: 0; background-color: #F8F8F8; - padding: 20px 30rpx 40px; + padding: 40rpx 30rpx; .act_btn { width: 690rpx; diff --git a/pages/highWay/runStatusData/form.vue b/pages/highWay/runStatusData/form.vue index 57d9413..91f626b 100644 --- a/pages/highWay/runStatusData/form.vue +++ b/pages/highWay/runStatusData/form.vue @@ -506,7 +506,7 @@ if (this.pageType == 'add') { let now = new Date(); //11:00-13:30 默认选择0-12 - let dateStr = getDateStr(now, 0); + let dateStr = getDateStr(now, 0).replaceAll('-','/'); if (new Date(dateStr + ' 11:00').getTime() < new Date().getTime() && new Date().getTime() < new Date(dateStr + ' 13:30').getTime()) { this.form.statPeriod = '0012'; diff --git a/pages/highWay/runStatusData/list.vue b/pages/highWay/runStatusData/list.vue index 2743686..57475f0 100644 --- a/pages/highWay/runStatusData/list.vue +++ b/pages/highWay/runStatusData/list.vue @@ -312,7 +312,7 @@ right: 0; bottom: 0; background-color: #F8F8F8; - padding: 20px 30rpx 40px; + padding: 40rpx 30rpx; .act_btn { width: 690rpx; diff --git a/pages/metro/subwayPage/form.vue b/pages/metro/subwayPage/form.vue index 42e03e8..d799d2b 100644 --- a/pages/metro/subwayPage/form.vue +++ b/pages/metro/subwayPage/form.vue @@ -47,52 +47,52 @@ 车次: - - + - + 总车次环比 - - {{formatDigit(form.inRailwayYomDo)}}% + + {{formatDigit(form.trainNumberDod)}}% 总车次同比 - {{formatDigit(form.inRailwayMomDo)}}% + {{formatDigit(form.trainNumberYoy)}}% 总客流量(人): - - + - + 总客流量人数环比 - - {{formatDigit(form.inRailwayYomDo)}}% + + {{formatDigit(form.passengerFlowDod)}}% - 总客流量人数 + 总客流量人数同比 - {{formatDigit(form.inRailwayMomDo)}}% + {{formatDigit(form.passengerFlowYoy)}}% @@ -122,12 +122,15 @@ data() { return { form: { - "children": [{ - "dataDetails": "" - }], - "carName": "", - "statDate": "", - "statPeriod": "" + "organizationName" : "", + "passengerFlow" : "", + "passengerFlowDod" : "", + "passengerFlowYoy" : "", + "statDate" : "", + "statPeriod" : "", + "trainNumber" : "", + "trainNumberDod" : "", + "trainNumberYoy" : "" }, //登录form array: [], //时段选择列表 index: 2, //时段选择,默认0-24 @@ -135,7 +138,8 @@ pageType: '', btnText: '保存', mobile: getApp().globalData.mobile, - deptNameList: [] + deptNameList: [], + momYoy: {} } }, onLoad(options) { @@ -148,27 +152,52 @@ this.pageType = 'add'; let now = new Date(); this.form.statDate = getDateStr(now, -1); //默认前一天 - this.queryTime(); //统计时段 + this.queryTime(); //统计时段 + this.queryMom(); } - if (options.item) { + else if (options.item) { this.btnText = '修改并保存'; this.form = JSON.parse(options.item); - this.queryTime(); //统计时段 + this.queryTime(); //统计时段 + this.queryMom(); } if (options.id) { this.btnText = '修改并保存'; - this.$request(getApp().globalData.baseUrl + '/api/biz/railwayRunSituation/find//' + options.id, {}, "GET") + this.$request(getApp().globalData.baseUrl + '/api/biz/subwayInfo/selectById/' + options.id, {}, "GET") .then(res => { this.form = res.data; if (checkNotEmpty(this.deptNameList)) { let idx = this.deptNameList.findIndex(item => item.deptName = this.form.organizationName); this.form.organizationNameIndex = idx > -1 ? idx : ''; } - this.queryTime(); //统计时段 + this.queryTime(); //统计时段 + this.queryMom(); }); } }, - methods: { + methods: { + //获取同环比 + queryMom(type) { + if(!checkNotEmpty(this.form.statDate) || !checkNotEmpty(this.form.statPeriod)){ + return; + } + this.$request(getApp().globalData.baseUrl + '/api/biz/subwayInfo/getYoYMoM?statDate=' + this.form.statDate + '&statPeriod=' + this.form.statPeriod + '&_t=' + Date.parse(new Date()), {}, "GET") + .then(res => { + this.momYoy = res.data; + if(type == 1) { + this.calcMomYoy(); + } + }); + }, + //计算环比同比 + calcMomYoy() { + let yesterdayData = this.momYoy.yesterdayData; + let lastYearData = this.momYoy.lastYearData; + this.form.trainNumberDod = this.$calcMom(this.form.trainNumber, yesterdayData.trainNumber); + this.form.trainNumberYoy = this.$calcYoy(this.form.trainNumber, lastYearData.trainNumber); + this.form.passengerFlowDod = this.$calcMom(this.form.passengerFlow, yesterdayData.passengerFlow); + this.form.passengerFlowYoy = this.$calcYoy(this.form.passengerFlow, lastYearData.passengerFlow); + }, //切换管理单位 bindDeptChange(e) { this.form.organizationNameIndex = e.detail.value; @@ -191,7 +220,8 @@ changeStatPeriod(e) { this.index = e.detail.value; this.form.statPeriod = this.array[e.detail.value].dictValue; - console.log('change 时段', this.form); + console.log('change 时段', this.form); + this.queryMom(1); }, //取消 doCancel() { @@ -199,7 +229,8 @@ }, //选择统计日期 bindDateChange(e) { - this.form.statDate = e.detail.value; + this.form.statDate = e.detail.value; + this.queryMom(1); }, //时段 queryTime() { @@ -210,7 +241,7 @@ if (this.pageType == 'add') { let now = new Date(); //11:00-13:30 默认选择0-12 - let dateStr = getDateStr(now, 0); + let dateStr = getDateStr(now, 0).replaceAll('-','/'); if (new Date(dateStr + ' 11:00').getTime() < new Date().getTime() && new Date().getTime() < new Date(dateStr + ' 13:30').getTime()) { this.form.statPeriod = '0012'; @@ -236,6 +267,20 @@ }) return; } + if (!checkNotEmpty(this.form.trainNumber)) { + uni.showToast({ + title: '车次不能为空', + icon: 'none' + }) + return; + } + if (!checkNotEmpty(this.form.passengerFlow)) { + uni.showToast({ + title: '客流量不能为空', + icon: 'none' + }) + return; + } uni.showModal({ title: '提示', content: this.form.id == undefined ? '您确认提交该条报送数据?' : '您确认将该条数据进行修改?', @@ -251,7 +296,7 @@ title: '提交中...', mask: true }) - this.$request(getApp().globalData.baseUrl + '/api/biz/airportRunSituation/saveOrUpdate', this.form, + this.$request(getApp().globalData.baseUrl + '/api/biz/subwayInfo/saveOrUpdate', this.form, 'POST').then(res => { uni.hideLoading(); if (res.code == 200) { diff --git a/pages/metro/subwayPage/list.vue b/pages/metro/subwayPage/list.vue index ccd5e14..5d44840 100644 --- a/pages/metro/subwayPage/list.vue +++ b/pages/metro/subwayPage/list.vue @@ -1,6 +1,6 @@