From 59cf31786d37dbc70040cfa4e4732a7f02999b91 Mon Sep 17 00:00:00 2001 From: jinna Date: Tue, 12 Sep 2023 17:57:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B9=A6=E5=86=99=E9=81=93=E8=B7=AF=E8=BF=90?= =?UTF-8?q?=E8=BE=93=E5=8D=95=E4=BD=8D=E9=80=89=E6=8B=A9=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E7=BA=A7=E8=81=94=EF=BC=8C=E4=BF=AE=E6=94=B9=E9=81=93?= =?UTF-8?q?=E8=B7=AF=E8=BF=90=E8=BE=93=E4=B8=8E=E6=B8=AF=E5=8F=A3=E7=AD=89?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 15 +- pages/bus/busDataInfo/form.vue | 30 +- pages/portShipping/pilotStation/form.vue | 13 +- pages/roadTransport/transportData/form.vue | 467 +++++++++++++++++++-- 4 files changed, 466 insertions(+), 59 deletions(-) diff --git a/pages.json b/pages.json index 4e56781..ac133cb 100644 --- a/pages.json +++ b/pages.json @@ -219,16 +219,13 @@ "style": { "navigationBarTitleText": "引航站" } + }, + { + "path": "pages/portShipping/pilotStation/form", + "style": { + "navigationBarTitleText": "引航站报送" + } } - ,{ - "path" : "pages/bus/busDataInfo/form-copy", - "style" : - { - "navigationBarTitleText": "", - "enablePullDownRefresh": false - } - - } ], "globalStyle": { "pageOrientation": "portrait", diff --git a/pages/bus/busDataInfo/form.vue b/pages/bus/busDataInfo/form.vue index 5831966..bbaaa01 100644 --- a/pages/bus/busDataInfo/form.vue +++ b/pages/bus/busDataInfo/form.vue @@ -216,21 +216,33 @@ this.form.reportDate = getDateStr(now, -1); //默认前一天 this.queryTime(); //统计时段 this.getPermiss(); //陆岛权限列表 - } else if (options.item) { + } else if (options.type == 'edit') { this.btnText = '修改并保存'; - this.form = JSON.parse(options.item); - this.form.bizBusDataDetailVOList = this.form.bizWaterwayIslandDataVOList; - this.getPermiss(); //陆岛权限列表 - this.queryTime(); - } else if (options.id) { - this.btnText = '修改并保存'; - this.queryDetailInfo(options.id); - } + this.pageType = 'edit' + let item = JSON.parse(options.item); + // this.form.bizBusDataDetailVOList = this.form.bizWaterwayIslandDataVOList; + // this.getPermiss(); //陆岛权限列表 + // this.queryTime(); + this.getDetail(item.id) + } + // else if (options.id) { + // this.btnText = '修改并保存'; + // this.queryDetailInfo(options.id); + // } }, methods: { formatDigit(data) { return (data+'').indexOf('.') > -1 && (data+'').substring((data+'').indexOf('.')).length > 2 ? data.toFixed(2) : data; }, + getDetail(id){ + this.$request(getApp().globalData.baseUrl + '/api/biz/busdata/getById/' + id,{},"GET").then(res =>{ + console.log('查询详情===>',res) + this.form = res.data; + this.form.bizBusDataDetailVOList = this.form.bizBusDataBodySaveOrUpdateDTOList; + this.queryTime(); //统计时段 + this.getPermiss(); + }) + }, //切换当前编辑陆岛索引 changeLandNameIndex(index) { if (this.form.bizBusDataDetailVOList[this.landNameIndex].vehicleInput != '' && this.form diff --git a/pages/portShipping/pilotStation/form.vue b/pages/portShipping/pilotStation/form.vue index 425b425..c9f7ad1 100644 --- a/pages/portShipping/pilotStation/form.vue +++ b/pages/portShipping/pilotStation/form.vue @@ -176,14 +176,23 @@ import { calcMom, checkNotEmpty, getDateStr } from '../../../common/util' this.getRoadTime() }else if(options.type == 'edit'){ this.pageType = 'edit' - this.form = JSON.parse(options.item); - this.getRoadTime() + let item = JSON.parse(options.item); + + this.getDetail(item.id) + } }, methods: { formatDigit(data) { return (data+'').indexOf('.') > -1 && (data+'').substring((data+'').indexOf('.')).length > 2 ? data.toFixed(2) : data; }, + getDetail(id){ + this.$request(getApp().globalData.baseUrl + '/api/biz/bizPilotData/getById/' + id,{},"GET").then(res =>{ + console.log(res) + this.form = res.data; + this.getRoadTime() + }) + }, // 获取时段 getRoadTime(){ this.$request(getApp().globalData.baseUrl + '/api/dict/dictList?dictType=airport_time&_t=1693372307694',"GET").then(res =>{ diff --git a/pages/roadTransport/transportData/form.vue b/pages/roadTransport/transportData/form.vue index fcad1f4..5d97987 100644 --- a/pages/roadTransport/transportData/form.vue +++ b/pages/roadTransport/transportData/form.vue @@ -18,7 +18,7 @@ :style="roadData.reportingUnitId?'color:#333;':''">{{roadData.reportingUnitId?roadData.reportingUnitId:'请选择'}} - {{roadData.reportingUnitId}} + {{roadData.reportingUnitId}} @@ -303,6 +303,100 @@

保存

修改并保存

+ + + + + + + 填报单位 + + + + + + + + + + + + + + {{item.deptName}} + + + + + + + + + + + {{item1.deptName}} + + + + + + + + + + + {{item2.deptName}} + + + + + + + + + + + {{item3.deptName}} + + + + + + + + + + + + + + + + + +

取消

+

确认

+
+
+
+
@@ -365,14 +459,90 @@ import { calcMom, calcYoy, checkNotEmpty, getDateStr, lastYearDate } from '../.. unitId:'', peopleList:[], peopleIndex:'', - peopleName:'' + peopleName:'', + treeData:[ + { + children: [ + { + deptId: 459, + deptName: "青岛公路管理局1", + children:[], + isExpand:false, + }, + { + deptId: 460, + deptName: "青岛公路管理局2", + children:[], + isExpand:false, + }, + ], + isExpand:true, + deptId: 458, + deptName: "青岛公路管理局", + }, + { + children: [ + { + deptId: 463, + deptName: "青岛公路管理局1", + isExpand:true, + children: [ + { + deptId:101, + deptName:'管理局1', + isExpand:false, + children:[] + }, + { + deptId:102, + deptName:'管理局2', + isExpand:true, + children:[ + { + deptId:103, + deptName:'管理局3', + isExpand:false, + children:[] + } + ] + }, + ] + }, + { + deptId: 464, + deptName: "青岛公路管理局2", + children:[] + }, + { + deptId: 465, + deptName: "青岛公路管理局3", + children:[] + }, + ], + deptId: 462, + isExpand:false, + deptName: "青岛公路局", + }, + { + deptId: 468, + deptName: "公路局", + children:[] + }, + ], + newArr:[], + treeIndex:'', + selectId:'', + selectName:'', + selectId1:'' } }, onLoad(options){ this.getUnitData() this.getPersonData(); + this.getDept() let arr = uni.getStorageSync('deptName'); this.deptNameList = checkNotEmpty(arr) ? arr : []; + this.unitId = this.deptNameList.length > 0 ? this.deptNameList[0].deptId : ''; if(options.type == 'edit'){ const item = JSON.parse(options.item); this.pageType = 'edit' @@ -381,7 +551,6 @@ import { calcMom, calcYoy, checkNotEmpty, getDateStr, lastYearDate } from '../.. this.pageType = 'add'; this.roadData.reportingUnitId = this.deptNameList.length > 0 ? this.deptNameList[0].deptName : ''; this.roadData.reportingUnitIdIndex = this.deptNameList.length > 0 ? 0 : ''; - this.unitId = this.deptNameList.length > 0 ? this.deptNameList[0].deptId : ''; this.getRoadTime() this.getPeople() let now = new Date(); @@ -390,26 +559,108 @@ import { calcMom, calcYoy, checkNotEmpty, getDateStr, lastYearDate } from '../.. }, methods: { + showPop(){ + this.selectId = this.selectId1; + + this.$refs.unitPopup.open('bottom') + this.newArr = [] + this.traversalTree(this.treeData,this.newArr); + this.treeData = this.newArr + }, + traversalTree(arrs, that) { + arrs.map((item, index) => { + that.push({ + deptId: item.deptId, + deptName: item.deptName, + isExpand:false, + isCheckd:false, + children:[] + }) + + if (item.children.length !== 0) { + this.traversalTree(item.children, that[index].children) + } + }) + }, + clickItem(item1){ + this.selectId = item1.deptId + this.selectName = item1.deptName + }, + expandItem(item){ + this.treeIndex = this.treeData.findIndex(val => val.id == item.id) + item.isExpand = !item.isExpand + }, + searchReset(){ + this.$refs.unitPopup.close() + }, + searchList(){ + this.roadData.reportingUnitId = this.selectName; + this.selectId1 = this.selectId; + this.$refs.unitPopup.close() + }, getPeople(){ this.$request(getApp().globalData.baseUrl + '/api/user/getByDeptId/' + this.unitId,{},"GET").then(res =>{ console.log('人员列表 ===>',res) res.data.map(item =>{ this.peopleList.push({id:item.id,people:item.username + ',' + item.mobile}) }) + if(this.pageType == 'edit'){ + console.log('deptNameList ===>',this.peopleList) + let tmp = this.peopleList.find(item => item.id == this.roadData.responsiblePersonId) + this.peopleIndex = this.peopleList.findIndex(item => item.id == this.roadData.responsiblePersonId) + this.peopleName = tmp.people + console.log(tmp) + } }) }, + getDept(){ + this.$request(getApp().globalData.baseUrl + '/api/dept/getCurrentAndSubordinateDept',{},"GET").then(res =>{ + console.log('单位===>',res) + }) + }, getDetail(id){ this.$request(getApp().globalData.baseUrl + '/api/biz/roadtransport/road/find/' + id,{},"GET").then(res =>{ this.roadData = res.data; - this.getRoadTime() + + this.getRoadTime(); + this.getPeople() // console.log('last==>',lastYearDate(this.roadData.statisticalDate)) }) }, getRatio(){ - this.$request(getApp().globalData.baseUrl + '/api/biz/roadtransport/road/findByStatisticalDate/' + lastYearDate(this.roadData.statisticalDate),{},"GET").then(res =>{ - this.lastData = res.data; - this.calcRatio() + let params = { + statisticalDate:this.roadData.statisticalDate, + reportPhase:this.roadData.reportPhase + } + this.$request(getApp().globalData.baseUrl + '/api/biz/roadtransport/road/findByStatisticalDate',params,"GET").then(res =>{ + // this.lastData = res.data; + // this.calcRatio() + let yesterdayData = res.data.yesterdayData; + let lastYearData = res.data.lastYearData; + this.roadData.passengerVolumeYesterday = yesterdayData.totalPassengerVolume + this.roadData.passengerVolumeLastYear = lastYearData.totalPassengerVolume + + this.roadData.totalBusYesterday = yesterdayData.capacityTotalBus + this.roadData.totalBusLastYear = yesterdayData.capacityTotalBus + + // 客运量与去年同期比率(%) + // 同比逻辑: + // 1、今日数据为0,去年今日数据为0,同比为0 + // 2、今日数据有值且不为0,去年数据无值为-,去年数据为0时为100; + // 3、今日数据无值,去年数据无论有值或为0,同比为- + // 4、今日、去年今日都有值且都不为0时,按照公式计算(今日-去年今日)/去年今日 * 100; + this.roadData.passengerVolumeRatio = + (checkNotEmpty(this.roadData.totalPassengerVolume) && this.roadData.totalPassengerVolume != 0 && checkNotEmpty(this.lastData.totalPassengerVolume) && this.lastData.totalPassengerVolume === 0) ? 100 : + (checkNotEmpty(this.roadData.totalPassengerVolume) && checkNotEmpty(this.lastData.totalPassengerVolume) && this.roadData.totalPassengerVolume != 0 && this.lastData.totalPassengerVolume != 0) ? + (this.roadData.totalPassengerVolume - this.lastData.totalPassengerVolume) / this.lastData.totalPassengerVolume * 100 : + (this.roadData.totalPassengerVolume == 0 && this.lastData.totalPassengerVolume == 0) ? 0 : '' + // // 客车总量同比上升 + this.roadData.totalBusIncreaseRatio = + (checkNotEmpty(this.roadData.capacityTotalBus) && this.roadData.capacityTotalBus != 0 && checkNotEmpty(this.lastData.capacityTotalBus) && this.lastData.capacityTotalBus === 0) ? 100 : + (checkNotEmpty(this.roadData.capacityTotalBus) && checkNotEmpty(this.lastData.capacityTotalBus) && this.roadData.capacityTotalBus != 0 && this.lastData.capacityTotalBus != 0) ? + (this.roadData.capacityTotalBus - this.lastData.capacityTotalBus) / this.lastData.capacityTotalBus * 100 : + (this.roadData.capacityTotalBus == 0 && this.lastData.capacityTotalBus == 0) ? 0 : '' }) }, //选择统计日期 @@ -447,27 +698,27 @@ import { calcMom, calcYoy, checkNotEmpty, getDateStr, lastYearDate } from '../.. success:(res) =>{ if(res.confirm){ console.log(params) - // this.$request(getApp().globalData.baseUrl + '/api/biz/roadtransport/road/saveOrUpdate',params,'POST').then(res =>{ - // if(res.code == 200){ - // uni.showToast({ - // title:"报送提交成功", - // icon:"none", - // success: () => { - // if(params.id == undefined){ - // setTimeout(() => { - // uni.redirectTo({ - // url:"/pages/roadTransport/transportData/list" - // }) - // }, 300) - // }else{ - // setTimeout(() =>{ - // uni.navigateBack() - // },300) - // } - // } - // }) - // } - // }) + this.$request(getApp().globalData.baseUrl + '/api/biz/roadtransport/road/saveOrUpdate',params,'POST').then(res =>{ + if(res.code == 200){ + uni.showToast({ + title:"报送提交成功", + icon:"none", + success: () => { + if(params.id == undefined){ + setTimeout(() => { + uni.redirectTo({ + url:"/pages/roadTransport/transportData/list" + }) + }, 300) + }else{ + setTimeout(() =>{ + uni.navigateBack() + },300) + } + } + }) + } + }) } } }) @@ -523,21 +774,17 @@ import { calcMom, calcYoy, checkNotEmpty, getDateStr, lastYearDate } from '../.. // 2、今日数据有值且不为0,去年数据无值为-,去年数据为0时为100; // 3、今日数据无值,去年数据无论有值或为0,同比为- // 4、今日、去年今日都有值且都不为0时,按照公式计算(今日-去年今日)/去年今日 * 100; - console.log() - this.roadData.passengerVolumeRatio = calcYoy(this.roadData.totalPassengerVolume,this.lastData.totalPassengerVolume) + // this.roadData.passengerVolumeRatio = // (checkNotEmpty(this.roadData.totalPassengerVolume) && this.roadData.totalPassengerVolume != 0 && checkNotEmpty(this.lastData.totalPassengerVolume) && this.lastData.totalPassengerVolume === 0) ? 100 : // (checkNotEmpty(this.roadData.totalPassengerVolume) && checkNotEmpty(this.lastData.totalPassengerVolume) && this.roadData.totalPassengerVolume != 0 && this.lastData.totalPassengerVolume != 0) ? // (this.roadData.totalPassengerVolume - this.lastData.totalPassengerVolume) / this.lastData.totalPassengerVolume * 100 : // (this.roadData.totalPassengerVolume == 0 && this.lastData.totalPassengerVolume == 0) ? 0 : '' - // 客车总量同比上升 - this.roadData.totalBusIncreaseRatio = - calcYoy(this.roadData.capacityTotalBus,this.lastData.capacityTotalBus) - // (checkNotEmpty(this.roadData.capacityTotalBus) && this.roadData.capacityTotalBus != 0 && checkNotEmpty(this.lastData.capacityTotalBus) && this.lastData.capacityTotalBus === 0) ? 100 : - // (checkNotEmpty(this.roadData.capacityTotalBus) && checkNotEmpty(this.lastData.capacityTotalBus) && this.roadData.capacityTotalBus != 0 && this.lastData.capacityTotalBus != 0) ? - // (this.roadData.capacityTotalBus - this.lastData.capacityTotalBus) / this.lastData.capacityTotalBus * 100 : - // (this.roadData.capacityTotalBus == 0 && this.lastData.capacityTotalBus == 0) ? 0 : '' - // console.log((parseInt(0.12) - parseInt(0.5156) ) /parseInt(0.5156) * 100) - // console.log('计算同环比 ===>',this.roadData.totalBusIncreaseRatio) + // // 客车总量同比上升 + // this.roadData.totalBusIncreaseRatio = + // (checkNotEmpty(this.roadData.capacityTotalBus) && this.roadData.capacityTotalBus != 0 && checkNotEmpty(this.lastData.capacityTotalBus) && this.lastData.capacityTotalBus === 0) ? 100 : + // (checkNotEmpty(this.roadData.capacityTotalBus) && checkNotEmpty(this.lastData.capacityTotalBus) && this.roadData.capacityTotalBus != 0 && this.lastData.capacityTotalBus != 0) ? + // (this.roadData.capacityTotalBus - this.lastData.capacityTotalBus) / this.lastData.capacityTotalBus * 100 : + // (this.roadData.capacityTotalBus == 0 && this.lastData.capacityTotalBus == 0) ? 0 : '' }, // 获取负责人 getPersonData(){ @@ -764,5 +1011,147 @@ import { calcMom, calcYoy, checkNotEmpty, getDateStr, lastYearDate } from '../.. } } } + + .pop_conbox{ + .pop_box { + border-radius: 30rpx 30rpx 0 0; + background-color: #fff; + padding: 30rpx; + + .pop_title { + color: #333333; + font-size: 32rpx; + font-family: PingFang SC-Bold, PingFang SC; + font-weight: bold; + line-height: 45rpx; + text-align: center; + margin: 20rpx 0; + + .pop_close { + float: right; + } + } + .popup-content{ + max-height: 500rpx; + margin: 30rpx 0; + overflow-y: auto; + .tree_item{ + width: 100%; + display: flex; + padding: 10rpx 0; + .item{ + width: 100%; + // display: flex; + .first_item{ + width: 100%; + .first_item_top{ + width: 100%; + display: flex; + padding: 10rpx 0; + &.check{ + background: rgba(45, 140, 240,0.2); + } + + .left_item{ + width: 40rpx; + height: 40rpx; + display: flex; + align-items: center; + justify-content: center; + margin-right: 10rpx; + } + } + + } + + .second_item{ + width: 100%; + .seco_top_item{ + width: 100%; + display: flex; + padding: 10rpx 0 10rpx 40rpx; + + &.check{ + background: rgba(45, 140, 240,0.2); + } + + .left_item{ + width: 40rpx; + height: 40rpx; + display: flex; + align-items: center; + justify-content: center; + margin-right: 10rpx; + } + } + .third_item{ + width: 100%; + .third_top_item{ + width: 100%; + display: flex; + padding: 10rpx 0 10rpx 80rpx; + + &.check{ + background: rgba(45, 140, 240,0.2); + } + .left_item{ + width: 40rpx; + height: 40rpx; + display: flex; + align-items: center; + justify-content: center; + margin-right: 10rpx; + } + } + + .four_item{ + .four_item_item{ + display: flex; + padding: 10rpx 0 10rpx 120rpx; + + .left_item{ + width: 40rpx; + height: 40rpx; + display: flex; + align-items: center; + justify-content: center; + margin-right: 10rpx; + } + } + } + } + } + + } + } + } + .btn_box { + width: 100%; + height: 120rpx; + display: flex; + margin-top: 20px; + align-items: center; + justify-content: space-between; + + .btn { + width: 290rpx; + height: 90rpx; + background: #FFFFFF; + border-radius: 100rpx; + border: 1rpx solid #C1C1C1; + color: #666; + font-size: 28rpx; + line-height: 88rpx; + text-align: center; + + &:last-child { + background: #2D8CF0; + color: #FFFFFF; + border-color: #2D8CF0; + } + } + } + } + } }