diff --git a/pages.json b/pages.json index 58b0d58..5dac4dd 100644 --- a/pages.json +++ b/pages.json @@ -54,6 +54,24 @@ "navigationBarTitleText": "高速运行情况详情" } }, + { + "path": "pages/railway/railwayRunData/list", + "style": { + "navigationBarTitleText": "铁路运行数据" + } + }, + { + "path": "pages/railway/railwayRunData/form", + "style": { + "navigationBarTitleText": "铁路运行数据报送" + } + }, + { + "path": "pages/railway/railwayRunData/detail", + "style": { + "navigationBarTitleText": "铁路运行数据详情" + } + }, { "path": "pages/roadTransport/transportData/list", "style": { diff --git a/pages/highWay/runData/detail.vue b/pages/highWay/runData/detail.vue index 3e7aa77..d248d3f 100644 --- a/pages/highWay/runData/detail.vue +++ b/pages/highWay/runData/detail.vue @@ -129,7 +129,7 @@ let item = JSON.parse(options.item) console.log(item) let item1 = JSON.parse(JSON.stringify(item)) - if(item1.highwaySubDataList){ + if(item1.highwaySubDataList.length > 0){ item1.highwaySubDataList[0].isSpread = true; //显示展开收起按钮,false时为收起,true为展开 } this.roadData = item1 diff --git a/pages/highWay/runData/form.vue b/pages/highWay/runData/form.vue index 7b5e6c9..0f0c780 100644 --- a/pages/highWay/runData/form.vue +++ b/pages/highWay/runData/form.vue @@ -16,7 +16,7 @@ 统计日期: - {{form.statDate?form.statDate:'请选择时段'}} @@ -25,18 +25,62 @@ 统计时段: - - + {{index>-1?array[index].dictLabel:'请选择时段'}} + + 收费站入口车辆数汇总: + + {{form.entranceVehicleCount === 0 ? form.entranceVehicleCount : form.entranceVehicleCount || ''}} + + + + + + 收费站入口车辆数汇总环比(%) + + {{form.entranceVehicleCountMom}} + + + + + 收费站入口车辆数汇总同比(%) + + {{form.entranceVehicleCountYoy}} + + + + + 收费站出口车辆数汇总: + + {{form.exitVehicleCount === 0 ? form.exitVehicleCount : form.exitVehicleCount || ''}} + + + + + + 收费站入口车辆数汇总环比(%) + + {{form.exitVehicleCountMom}} + + + + + 收费站入口车辆数汇总同比(%) + + {{form.exitVehicleCountYoy}} + + + - + {{item.stationName}} @@ -52,42 +96,42 @@ 收费站入口车辆数: - + - + - 收费站入口车辆数环比(%) - - {{form.highwaySubDataList[stationIndex].tollExemptVehicleCountMom}} + 收费站入口车辆数环比(%) + + {{form.highwaySubDataList[stationIndex].entranceVehicleCountMom}} 收费站入口车辆数同比(%) - {{form.highwaySubDataList[stationIndex].tollExemptVehicleCountYoy}} + {{form.highwaySubDataList[stationIndex].entranceVehicleCountYoy}} 收费站出口车辆数: - + - + - 收费站出口车辆数环比(%) - + 收费站出口车辆数环比(%) + {{form.highwaySubDataList[stationIndex].exitVehicleCountMom}} - 收费站入口车辆数同比(%) + 收费站出口车辆数同比(%) {{form.highwaySubDataList[stationIndex].exitVehicleCountYoy}} @@ -108,9 +152,9 @@ 报送人员及联系方式: - - {{submitPersonIndex>-1?submitPerson[submitPersonIndex].dictLabel:'请选择报送人'}} + + {{form.highwaySubDataList[stationIndex].submitPersonnelContact?form.highwaySubDataList[stationIndex].submitPersonnelContact:'请选择报送人'}} @@ -138,12 +182,17 @@ organizationName: '', statDate: '', statPeriod: '', - highwaySubDataList: [] + entranceVehicleCount: '', + entranceVehicleCountMom: '', + entranceVehicleCountYoy: '', + exitVehicleCount: '', + exitVehicleCountMom: '', + exitVehicleCountYoy: '', + highwaySubDataList: [], }, //登录form highwaySubDataList: [],//收费站列表 stationIndex: 0,//收费站选中索引 submitPerson: [],//报送人 - submitPersonIndex: -1, //报送人选择索引 array: [], //时段选择列表 index: 2, //时段选择,默认0-24 userInfo: {}, @@ -152,17 +201,43 @@ }, onLoad(options) { this.userInfo = uni.getStorageSync('userInfo'); - if (!options.type || options.type == 'add') { + if (options.type == 'add') { let now = new Date(); this.form.statDate = getDateStr(now, -1);//默认前一天 + this.form.statPeriod = '03'; //默认0-24 + this.queryYoYMom(); this.queryStation('add'); } else if (options.item) { this.form = JSON.parse(options.item); + console.log('edit', this.form) + this.queryYoYMom(); this.queryStation(); } this.queryTime();//统计时段 + this.queryPerson(); }, methods: { + //同比环比查询 + queryYoYMom() { + // if(this.form.statDate && this.form.statPeriod) { + // this.$request(getApp().globalData.baseUrl + '/api/biz/highwayParentDataController/getYoYMoM?statDate='+this.form.statDate+'&statPeriod='+this.form.statPeriod+'&_t=' + Date.parse(new Date()),{},"GET").then(res => { + // this.yoyMom = res.data; + // }) + // } + }, + //报送人 + queryPerson() { + this.$request(getApp().globalData.baseUrl + '/api/biz/personnelContactInfoController/all?query=&_t=' + Date.parse(new Date()),{},"GET").then(res => { + let arr = []; + res.data.list.map(item => { + arr.push(item.name); + }) + this.submitPerson = arr; + }) + }, + changeSubmitPerson(e, index) { + this.form.highwaySubDataList[index].submitPersonnelContact = this.submitPerson[e.detail.value]; + }, //切换当前编辑收费站索引 changeStationIndex(index) { if(this.form.highwaySubDataList[this.stationIndex].entranceVehicleCount != '' && this.form.highwaySubDataList[this.stationIndex].exitVehicleCount != '') { @@ -172,6 +247,39 @@ } this.stationIndex = index; }, + //计算收费站信息是否填写完整 + checkStationInfo(index) { + this.highwaySubDataList[index].isFinish = this.form.highwaySubDataList[index].entranceVehicleCount != '' && this.form.highwaySubDataList[index].exitVehicleCount != ''; + //汇总计算 + let entranceVehicleCount = 0,exitVehicleCount = 0; + this.form.highwaySubDataList.map(item => { + entranceVehicleCount = entranceVehicleCount + (item.entranceVehicleCount ? parseInt(item.entranceVehicleCount) : 0); + exitVehicleCount = exitVehicleCount + (item.exitVehicleCount ? parseInt(item.exitVehicleCount) : 0); + }) + this.form.entranceVehicleCount = entranceVehicleCount; + this.form.exitVehicleCount = exitVehicleCount; + // this.form.entranceVehicleCountMom = this.form.entranceVehicleCount && this.yoyMom.queryData.entranceVehicleCount ? (this.form.entranceVehicleCount - this.yoyMom.queryData.entranceVehicleCount) / this.yoyMom.queryData.entranceVehicleCount * 100 : ''; + // this.form.entranceVehicleCountYoy = this.form.entranceVehicleCount && this.yoyMom.lastYearData.entranceVehicleCount ? (this.form.entranceVehicleCount - this.yoyMom.lastYearData.entranceVehicleCount) / this.yoyMom.lastYearData.entranceVehicleCount * 100 : '';//同比 + // this.form.exitVehicleCountMom = this.form.exitVehicleCount && this.yoyMom.queryData.exitVehicleCount ? (this.form.exitVehicleCount - this.yoyMom.queryData.exitVehicleCount) / this.yoyMom.queryData.exitVehicleCount * 100 : ''; + // this.form.exitVehicleCountYoy = this.form.exitVehicleCount && this.yoyMom.lastYearData.exitVehicleCount ? (this.form.exitVehicleCount - this.yoyMom.lastYearData.exitVehicleCount) / this.yoyMom.lastYearData.exitVehicleCount * 100 : '';//同比 + // //计算同比环比 + // if(this.form.highwaySubDataList[index].entranceVehicleCount != ''){ + // let idx = this.yoyMom.lastYearData.highwaySubDataList.findIndex(item => item.stationName == this.form.highwaySubDataList[index].stationName); + // let idx2 = this.yoyMom.queryData.highwaySubDataList.findIndex(item => item.stationName == this.form.highwaySubDataList[index].stationName); + // if(idx > -1){ + // //环比 + // let obj = this.yoyMom.queryData.highwaySubDataList[idx]; + // this.form.highwaySubDataList[index].entranceVehicleCountMom = obj.entranceVehicleCount ? (this.form.highwaySubDataList[index].entranceVehicleCount - obj.entranceVehicleCount) / obj.entranceVehicleCount * 100 : ''; + // this.form.highwaySubDataList[index].exitVehicleCountMom = obj.exitVehicleCount ? (this.form.highwaySubDataList[index].exitVehicleCount - obj.exitVehicleCount) / obj.exitVehicleCount * 100 : ''; + // } + // if(idx2 > -1){ + // //同比 + // let obj = this.yoyMom.lastYearData.highwaySubDataList[idx]; + // this.form.highwaySubDataList[index].entranceVehicleCountYoy = obj.entranceVehicleCount ? (this.form.highwaySubDataList[index].entranceVehicleCount - obj.entranceVehicleCount) / obj.entranceVehicleCount * 100 : ''; + // this.form.highwaySubDataList[index].exitVehicleCountYoy = obj.exitVehicleCount ? (this.form.highwaySubDataList[index].exitVehicleCount - obj.exitVehicleCount) / obj.exitVehicleCount * 100 : ''; + // } + // } + }, //收费站列表 queryStation(type) { this.$request(getApp().globalData.baseUrl + '/api/biz/HighSpeedPermissionsInfo/findList?_t=' + Date.parse( @@ -179,6 +287,7 @@ this.highwaySubDataList = res.data; if(type == 'add') { this.highwaySubDataList.map(item => { + item.isFinish = false; this.form.highwaySubDataList.push({ "entranceVehicleCount": '', "entranceVehicleCountMom": 0.0, @@ -189,23 +298,27 @@ "exitVehicleCountYoy": 0.0, "highwayId": item.highWayLineCode, "highwayName": item.highWayLineName, - "submitPersonnelContact": this.userInfo.realName+','+this.userInfo.tel, + "submitPersonnelContact": this.userInfo.realName+','+this.userInfo.mobile, "tollExemptAmount": 0.0, "tollExemptVehicleCount": 0, "tollExemptVehicleCountMom": 0.0, "tollExemptVehicleCountYoy": 0.0, "tollStationName": item.stationName, - "remark": '' + "remark": '', }) }) }else{ + let arr = JSON.parse(JSON.stringify(this.form.highwaySubDataList)); + this.form.highwaySubDataList = []; this.highwaySubDataList.map(item => { - let idx = this.form.highwaySubDataList.findIndex(item2 => { - return item2.highwayId == item.highWayLineCode && item2.tollStationName == item.stationName; - }) + let idx = arr.findIndex(item2 => { + return item.highWayLineCode && item2.tollStationName == item.stationName; + }); if(idx > -1){ - this.form.highwaySubDataList.push(this.form.highwaySubDataList[idx]); + item.isFinish = arr[idx].entranceVehicleCount != '' && arr[idx].exitVehicleCount != '' ? true : false; + this.form.highwaySubDataList.push(arr[idx]); }else{ + item.isFinish = false; this.form.highwaySubDataList.push({ "entranceVehicleCount": '', "entranceVehicleCountMom": 0.0, @@ -216,13 +329,13 @@ "exitVehicleCountYoy": 0.0, "highwayId": item.highWayLineCode, "highwayName": item.highWayLineName, - "submitPersonnelContact": this.userInfo.realName+','+this.userInfo.tel, + "submitPersonnelContact": this.userInfo.realName+','+this.userInfo.mobile, "tollExemptAmount": 0.0, "tollExemptVehicleCount": 0, "tollExemptVehicleCountMom": 0.0, "tollExemptVehicleCountYoy": 0.0, "tollStationName": item.stationName, - "remark": '' + "remark": '', }) } }) @@ -246,6 +359,23 @@ }, //确认提交 doSubmit() { + if (this.form.statDate == '' || this.form.statPeriod == '') { + uni.showToast({ + title: '报送日期和时段不能为空', + icon: 'none' + }) + return; + } + let check = this.form.highwaySubDataList.every(item => { + return !item.entranceVehicleCount || !item.exitVehicleCount + }) + if (check) { + uni.showToast({ + title: '收费站信息请填写完整', + icon: 'none' + }) + return; + } uni.showModal({ title: '提示', content: '确认保存当前报送数据吗?', @@ -257,24 +387,11 @@ }) }, submitForm() { - // if (this.form.username == '' || this.form.password == '') { - // uni.showToast({ - // title: '用户名密码不能为空', - // icon: 'none' - // }) - // return; - // } else if (this.form.verCode == '') { - // uni.showToast({ - // title: '验证码不能为空', - // icon: 'none' - // }) - // return; - // } uni.showLoading({ title: '提交中...', mask: true }) - this.$request(getApp().globalData.baseUrl + '/api/biz/highSpeedOperationController/saveOrUpdate', this.form, 'POST').then(res => { + this.$request(getApp().globalData.baseUrl + '/api/biz/highwayParentDataController/saveOrUpdate', this.form, 'POST').then(res => { uni.hideLoading(); if (res.code == 200) { uni.showToast({ @@ -378,7 +495,7 @@ margin-bottom: 30rpx; .form_item_label { - width: 260rpx; + width: 280rpx; color: #666666; font-size: 26rpx; word-break: break-all; @@ -390,8 +507,13 @@ word-break: break-all; &.picker { + flex: 1; display: flex; justify-content: space-between; + + /deep/ picker { + flex: 1; + } .picker_select { color: #D4D4D4; @@ -428,7 +550,7 @@ .station_box { display: flex; flex-wrap: wrap; - margin-top: 40rpx; + margin-top: 30rpx; .station_item { height: 60rpx; @@ -440,7 +562,7 @@ border-radius: 20rpx; border: 1rpx solid #C1C1C1; padding: 0 20rpx; - margin-bottom: 40rpx; + margin-bottom: 30rpx; margin-right: 20rpx; &.active { @@ -455,6 +577,8 @@ right: 0; width: 34rpx; height: 23rpx; + color: #fff; + line-height: 23rpx; background: #1ECE5F; border-radius: 0rpx 20rpx 0rpx 5rpx; text-align: center; diff --git a/pages/highWay/runData/list.vue b/pages/highWay/runData/list.vue index 315e1a8..d5a1e16 100644 --- a/pages/highWay/runData/list.vue +++ b/pages/highWay/runData/list.vue @@ -5,7 +5,7 @@ 管理单位 {{item.organizationName}} - {{item.statDate || ''}}{{item.statPeriod || ''}} + {{item.statDate || ''}}{{item.statPeriodValue || ''}} diff --git a/pages/highWay/runStatusData/form.vue b/pages/highWay/runStatusData/form.vue index 25247de..9f5e586 100644 --- a/pages/highWay/runStatusData/form.vue +++ b/pages/highWay/runStatusData/form.vue @@ -482,17 +482,6 @@ }, //确认提交 doSubmit() { - uni.showModal({ - title: '提示', - content: '确认保存当前报送数据吗?', - success: (res) => { - if (res.confirm) { - this.submitForm(); - } - } - }) - }, - submitForm() { console.log(this.form) if (this.form.statDate == '' || this.form.statPeriod == '') { uni.showToast({ @@ -521,6 +510,17 @@ }) return; } + uni.showModal({ + title: '提示', + content: '确认保存当前报送数据吗?', + success: (res) => { + if (res.confirm) { + this.submitForm(); + } + } + }) + }, + submitForm() { uni.showLoading({ title: '提交中...', mask: true @@ -650,8 +650,12 @@ word-break: break-all; &.picker { + flex: 1; display: flex; justify-content: space-between; + /deep/ picker{ + flex: 1; + } .picker_select { color: #D4D4D4; diff --git a/pages/home/index.vue b/pages/home/index.vue index f43acf7..758d292 100644 --- a/pages/home/index.vue +++ b/pages/home/index.vue @@ -12,7 +12,7 @@ - + 报送 diff --git a/pages/railway/railwayRunData/detail.vue b/pages/railway/railwayRunData/detail.vue new file mode 100644 index 0000000..a04d183 --- /dev/null +++ b/pages/railway/railwayRunData/detail.vue @@ -0,0 +1,437 @@ + + + + + \ No newline at end of file diff --git a/pages/railway/railwayRunData/form.vue b/pages/railway/railwayRunData/form.vue new file mode 100644 index 0000000..12b4869 --- /dev/null +++ b/pages/railway/railwayRunData/form.vue @@ -0,0 +1,830 @@ + + + + \ No newline at end of file diff --git a/pages/railway/railwayRunData/list.vue b/pages/railway/railwayRunData/list.vue new file mode 100644 index 0000000..46f26ec --- /dev/null +++ b/pages/railway/railwayRunData/list.vue @@ -0,0 +1,481 @@ + + + + \ No newline at end of file