|
|
|
|
@ -1,9 +1,9 @@ |
|
|
|
|
<template> |
|
|
|
|
<view class="edit_box"> |
|
|
|
|
<view class="top_box"> |
|
|
|
|
<view class="top_title" v-if="isShowTitle"> |
|
|
|
|
<view class="top_title"> |
|
|
|
|
<view class="top_txt">如有填报问题,请咨询公共服务中心</view> |
|
|
|
|
<view class="bot_txt">中心值班电话:<span style="color: #2D8CF0;">66007587</span></view> |
|
|
|
|
<view class="bot_txt">中心值班电话:<text @click="call(mobile)" class="tel">{{mobile}}</text></view> |
|
|
|
|
</view> |
|
|
|
|
<view class="content_box"> |
|
|
|
|
<view class="basic_box"> |
|
|
|
|
@ -11,14 +11,18 @@ |
|
|
|
|
<view class="edit_item"> |
|
|
|
|
<p class="left unit">填报单位</p> |
|
|
|
|
<view class="right"> |
|
|
|
|
<!-- <p v-if="pageType == 'add'">{{roadData.reportingUnitId ? roadData.reportingUnitId : ''}}</p> --> |
|
|
|
|
<picker v-if="pageType == 'add' && deptNameList.length > 1" :value="roadData.reportingUnitIdIndex" :range="deptNameList" |
|
|
|
|
<!-- <picker v-if="pageType == 'add' && deptNameList.length > 1" :value="roadData.reportingUnitIdIndex" :range="deptNameList" |
|
|
|
|
range-key="deptName" @change="bindDeptChange"> |
|
|
|
|
<text class="picker_select" |
|
|
|
|
:style="roadData.reportingUnitId?'color:#333;':''">{{roadData.reportingUnitId?roadData.reportingUnitId:'请选择'}}</text> |
|
|
|
|
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons> |
|
|
|
|
</picker> |
|
|
|
|
<text v-else @click="showPop">{{roadData.reportingUnitId}}</text> |
|
|
|
|
</picker> --> |
|
|
|
|
<!-- --> |
|
|
|
|
<view class="pick_pop" @click="showPop" v-if="pageType == 'add' && deptNameList.length > 1"> |
|
|
|
|
<text>{{roadData.reportingUnitId}}</text> |
|
|
|
|
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons> |
|
|
|
|
</view> |
|
|
|
|
<text v-else>{{roadData.reportingUnitId}}</text> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="edit_item"> |
|
|
|
|
@ -292,7 +296,7 @@ |
|
|
|
|
<p class="left">备注</p> |
|
|
|
|
<view class="right"> |
|
|
|
|
<!-- <uni-easyinput v-model="roadData.remarks" placeholder="请输入备注" placeholderStyle="color:#d4d4d4;"></uni-easyinput> --> |
|
|
|
|
<uni-easyinput type="textarea" autoHeight v-model="roadData.remarks" placeholder="请备注信息"></uni-easyinput> |
|
|
|
|
<uni-easyinput type="textarea" maxlength="200" autoHeight v-model="roadData.remarks" placeholder="请备注信息"></uni-easyinput> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
@ -373,7 +377,7 @@ |
|
|
|
|
<uni-icons @click="expandItem(item3)" v-if="item3.children.length != 0 && item3.isExpand" type="bottom" size="15"></uni-icons> |
|
|
|
|
</view> |
|
|
|
|
<view class="right_item" @click="clickItem(item3)"> |
|
|
|
|
{{item3.deptName}} |
|
|
|
|
{{item3.deptName}} 123 |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
@ -533,35 +537,36 @@ import { calcMom, calcYoy, checkNotEmpty, getDateStr, lastYearDate } from '../.. |
|
|
|
|
treeIndex:'', |
|
|
|
|
selectId:'', |
|
|
|
|
selectName:'', |
|
|
|
|
selectId1:'' |
|
|
|
|
selectId1:'', |
|
|
|
|
mobile: getApp().globalData.mobile |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
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' |
|
|
|
|
this.getDetail(item.id); |
|
|
|
|
}else if(options.type == 'add'){ |
|
|
|
|
this.pageType = 'add'; |
|
|
|
|
this.roadData.reportingUnitId = this.deptNameList.length > 0 ? this.deptNameList[0].deptName : ''; |
|
|
|
|
this.roadData.reportingUnitIdIndex = this.deptNameList.length > 0 ? 0 : ''; |
|
|
|
|
this.getDept() |
|
|
|
|
this.getRoadTime() |
|
|
|
|
this.getPeople() |
|
|
|
|
let now = new Date(); |
|
|
|
|
this.roadData.statisticalDate = getDateStr(now, -1);//默认前一天 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
call(tel) { |
|
|
|
|
uni.makePhoneCall({ |
|
|
|
|
phoneNumber: tel |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
showPop(){ |
|
|
|
|
this.selectId = this.selectId1; |
|
|
|
|
|
|
|
|
|
this.$refs.unitPopup.open('bottom') |
|
|
|
|
this.newArr = [] |
|
|
|
|
this.traversalTree(this.treeData,this.newArr); |
|
|
|
|
@ -608,8 +613,8 @@ import { calcMom, calcYoy, checkNotEmpty, getDateStr, lastYearDate } from '../.. |
|
|
|
|
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) |
|
|
|
|
this.peopleName = tmp ? tmp.people : '' + this.roadData.contactNumber |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
@ -617,14 +622,21 @@ import { calcMom, calcYoy, checkNotEmpty, getDateStr, lastYearDate } from '../.. |
|
|
|
|
getDept(){ |
|
|
|
|
this.$request(getApp().globalData.baseUrl + '/api/dept/getCurrentAndSubordinateDept',{},"GET").then(res =>{ |
|
|
|
|
console.log('单位===>',res) |
|
|
|
|
this.treeData = res.data; |
|
|
|
|
this.unitId = this.deptNameList.length > 0 ? this.deptNameList[0].deptId : res.data[0].deptId; |
|
|
|
|
this.getPeople() |
|
|
|
|
if(this.pageType == 'add'){ |
|
|
|
|
this.roadData.reportingUnitId = this.deptNameList.length > 0 ? this.deptNameList[0].deptName : ''; |
|
|
|
|
this.roadData.reportingUnitIdIndex = this.deptNameList.length > 0 ? 0 : ''; |
|
|
|
|
this.selectId1 = this.unitId |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
getDetail(id){ |
|
|
|
|
this.$request(getApp().globalData.baseUrl + '/api/biz/roadtransport/road/find/' + id,{},"GET").then(res =>{ |
|
|
|
|
this.roadData = res.data; |
|
|
|
|
|
|
|
|
|
this.getRoadTime(); |
|
|
|
|
this.getPeople() |
|
|
|
|
this.getDept() |
|
|
|
|
// console.log('last==>',lastYearDate(this.roadData.statisticalDate)) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
@ -634,15 +646,15 @@ import { calcMom, calcYoy, checkNotEmpty, getDateStr, lastYearDate } from '../.. |
|
|
|
|
reportPhase:this.roadData.reportPhase |
|
|
|
|
} |
|
|
|
|
this.$request(getApp().globalData.baseUrl + '/api/biz/roadtransport/road/findByStatisticalDate',params,"GET").then(res =>{ |
|
|
|
|
// this.lastData = res.data; |
|
|
|
|
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 |
|
|
|
|
// 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 |
|
|
|
|
// this.roadData.totalBusYesterday = yesterdayData.capacityTotalBus |
|
|
|
|
// this.roadData.totalBusLastYear = yesterdayData.capacityTotalBus |
|
|
|
|
|
|
|
|
|
// 客运量与去年同期比率(%) |
|
|
|
|
// 同比逻辑: |
|
|
|
|
@ -650,17 +662,21 @@ import { calcMom, calcYoy, checkNotEmpty, getDateStr, lastYearDate } from '../.. |
|
|
|
|
// 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.passengerVolumeRatio = calcMom(checkNotEmpty(this.roadData.totalPassengerVolume) ? this.roadData.totalPassengerVolume * 10000 : this.roadData.totalPassengerVolume,checkNotEmpty(this.lastData.passengerVolumeYesterday) ? this.lastData.passengerVolumeYesterday * 10000 : this.lastData.passengerVolumeYesterday) |
|
|
|
|
this.roadData.passengerVolumeRatio = calcMom(checkNotEmpty(this.roadData.totalPassengerVolume) ? this.roadData.totalPassengerVolume * 10000 : this.roadData.totalPassengerVolume,checkNotEmpty(this.lastData.passengerVolumeLastYear) ? this.lastData.passengerVolumeLastYear * 10000 : this.lastData.passengerVolumeLastYear) |
|
|
|
|
|
|
|
|
|
// (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 : '' |
|
|
|
|
this.roadData.totalBusIncreaseRatio = calcMom(this.roadData.capacityTotalBus,this.lastData.totalBusYesterday) |
|
|
|
|
this.roadData.totalBusIncreaseRatio = calcMom(this.roadData.capacityTotalBus,this.lastData.totalBusLastYear) |
|
|
|
|
|
|
|
|
|
// (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 : '' |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
//选择统计日期 |
|
|
|
|
@ -828,6 +844,13 @@ import { calcMom, calcYoy, checkNotEmpty, getDateStr, lastYearDate } from '../.. |
|
|
|
|
font-size: 26rpx; |
|
|
|
|
line-height: 40rpx; |
|
|
|
|
margin-bottom: 20rpx; |
|
|
|
|
|
|
|
|
|
.bot_txt{ |
|
|
|
|
.tel { |
|
|
|
|
color: #2D8CF0; |
|
|
|
|
font-weight: bold; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.content_box{ |
|
|
|
|
@ -847,7 +870,7 @@ import { calcMom, calcYoy, checkNotEmpty, getDateStr, lastYearDate } from '../.. |
|
|
|
|
.con_tit{ |
|
|
|
|
width: 100%; |
|
|
|
|
margin-top: 10rpx; |
|
|
|
|
font-size: 40rpx; |
|
|
|
|
font-size: 30rpx; |
|
|
|
|
color: #333; |
|
|
|
|
font-weight: bold; |
|
|
|
|
margin-bottom: 9rpx; |
|
|
|
|
@ -874,13 +897,17 @@ import { calcMom, calcYoy, checkNotEmpty, getDateStr, lastYearDate } from '../.. |
|
|
|
|
width: 100%; |
|
|
|
|
display: flex; |
|
|
|
|
justify-content: space-between; |
|
|
|
|
margin-top: 32rpx; |
|
|
|
|
margin-top: 30rpx; |
|
|
|
|
align-items: center; |
|
|
|
|
|
|
|
|
|
&.input{ |
|
|
|
|
margin-top: 5rpx; |
|
|
|
|
.pick_pop{ |
|
|
|
|
display: flex; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// &.input{ |
|
|
|
|
// margin-top: 5rpx; |
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
.left{ |
|
|
|
|
// margin-left: 30rpx; |
|
|
|
|
min-width: 320rpx; |
|
|
|
|
@ -909,6 +936,17 @@ import { calcMom, calcYoy, checkNotEmpty, getDateStr, lastYearDate } from '../.. |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.picker_select { |
|
|
|
|
flex: 1; |
|
|
|
|
color: #D4D4D4; |
|
|
|
|
font-size: 28rpx; |
|
|
|
|
font-family: PingFang SC-Regular, PingFang SC; |
|
|
|
|
font-weight: 400; |
|
|
|
|
text-align: right; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/deep/ .uni-date-editor{ |
|
|
|
|
display: flex; |
|
|
|
|
align-items: center; |
|
|
|
|
@ -1105,10 +1143,16 @@ import { calcMom, calcYoy, checkNotEmpty, getDateStr, lastYearDate } from '../.. |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.four_item{ |
|
|
|
|
width: 100%; |
|
|
|
|
.four_item_item{ |
|
|
|
|
width: 100%; |
|
|
|
|
display: flex; |
|
|
|
|
padding: 10rpx 0 10rpx 120rpx; |
|
|
|
|
|
|
|
|
|
&.check{ |
|
|
|
|
background: rgba(45, 140, 240,0.2); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.left_item{ |
|
|
|
|
width: 40rpx; |
|
|
|
|
height: 40rpx; |
|
|
|
|
|