铁路、公交联调

dev201310
张群 2 years ago
parent 23c0176f39
commit aa71522191
  1. 3
      App.vue
  2. 4
      common/util.js
  3. 617
      pages/bus/busDataInfo/form-copy.vue
  4. 167
      pages/bus/busDataInfo/form.vue
  5. 17
      pages/bus/busDataInfo/list.vue
  6. 223
      pages/railway/railwayRunData/form.vue
  7. 13
      pages/railway/railwayRunData/list.vue

@ -55,7 +55,8 @@
},
globalData: {
// baseUrl: 'http://27.223.104.50:8001',//
baseUrl: 'http://jtxx.qdjtcx.cn:8001',//
baseUrl: 'https://jtxx.qdjtcx.cn:8001',//
// baseUrl: 'http://10.50.3.103:8086',//
mobile: '66007587'
},
methods: {

@ -102,12 +102,12 @@ function getDay(d, num) {
// 计算环比
function calcMom(cur, data) {
console.log(cur,"环比==========",data);
// console.log(cur,"环比==========",data);
return !checkNotEmpty(cur) || !checkNotEmpty(data) ? '' : data === 0 && parseInt(cur) === 0 ? 0 : data === 0 && parseInt(cur) > 0 ? 100 : (parseInt(cur) - data) / data * 100;
}
// 计算同比
function calcYoy(cur, data) {
// console.log(cur,"同比==========",data);
console.log(cur,"同比==========",data);
return !checkNotEmpty(cur) || !checkNotEmpty(data) ? '' : data === 0 && parseInt(cur) === 0 ? 0 : data === 0 && parseInt(cur) > 0 ? 100 : (parseInt(cur) - data) / data * 100;
}

@ -1,617 +0,0 @@
<template>
<!-- 公交投入数据表单 -->
<view class="form_warp">
<view class="form_item_box">
<view class="form_item_title">基本信息</view>
<view class="form_item">
<view class="form_item_label">统计日期</view>
<view class="form_item_input picker">
<picker mode="date" :value="form.reportDate" @change="bindDateChange">
<text class="picker_select"
:style="form.reportDate?'color:#333;':''">{{form.reportDate?form.reportDate:'请选择统计日期'}}</text>
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons>
</picker>
</view>
</view>
<view class="form_item">
<view class="form_item_label">统计时段</view>
<view class="form_item_input picker">
<picker :value="index" :range="timeArray" range-key="dictLabel" @change="bindtimeChange">
<text class="picker_select"
:style="index>-1?'color:#333;':''">{{timeName ? timeName :'请选择统计时段'}}</text>
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons>
</picker>
</view>
</view>
</view>
<view class="form_item_box bottom">
<view class="form_item_li" v-for="(item,index) in form.bizBusDataDetailVOList" :key="index">
<view class="form_item"
style="display:flex; justify-content: space-between; font-size: 30rpx;color:#333;font-weight: bold;margin-top: 30rpx;">
运行数据-{{index+1}}
<uni-icons type="trash" color="red" @click="delRow(index)" size="18"></uni-icons>
</view>
<view class="form_item">
<view class="form_item_label">名称</view>
<view class="form_item_input picker">
<picker :value="item.busIndex" :range="busArray" range-key="stationId"
@change="e => changeBusway(e, 'bizBusDataDetailVOList', index)">
<text class="picker_select"
:style="item.busUnit?'color:#333;':''">{{item.busUnit ? item.busUnit : '请选择'}}</text>
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons>
</picker>
</view>
</view>
<view class="form_item">
<view class="form_item_label">投入车辆</view>
<view class="form_item_input form_input"><!-- digit -->
<uni-easyinput type="digit" v-model="item.vehicleInput" placeholderStyle="color: #D4D4D4;font-size:28rpx;"
placeholder="请输入" @blur="checkNumber('vehicleInput','bizBusDataDetailVOList',index)"></uni-easyinput>
</view>
</view>
<view class="form_item_rate" v-if="item.vehicleInputMom || item.vehicleInputYoy" :class="item.vehicleInputMom == 0 ? 'danger' : '' ">
<view class="rate_item">
<view class="rate_item_label" :style="item.vehicleInputMom == 0 ? 'color: #EB4747' : ''">投入车辆环比(%)</view>
<view class="rate_item_input" :style="item.vehicleInputMom == 0 ? 'color: #EB4747' : ''">
{{item.vehicleInputMom === 0 ? item.vehicleInputMom : item.vehicleInputMom ? item.vehicleInputMom.toFixed(2) : ''}}
</view>
</view>
<view class="line"></view>
<view class="rate_item">
<view class="rate_item_label">投入车辆同比(%)</view>
<view class="rate_item_input">
{{item.vehicleInputYoy === 0 ? item.vehicleInputYoy : item.vehicleInputYoy ? item.vehicleInputYoy.toFixed(2) : ''}}
</view>
</view>
</view>
<view class="form_item">
<view class="form_item_label">运行班次</view>
<view class="form_item_input form_input"><!-- digit -->
<uni-easyinput type="number" v-model="item.operatingShifts" placeholderStyle="color: #D4D4D4;font-size:28rpx;"
placeholder="请输入" @blur="checkNumber('operatingShifts','bizBusDataDetailVOList',index)"></uni-easyinput>
</view>
</view>
<view class="form_item_rate" v-if="item.operatingShiftsMom || item.operatingShiftsYoy" :class="item.operatingShiftsMom == 0 ? 'danger' : '' ">
<view class="rate_item">
<view class="rate_item_label" :style="item.operatingShiftsMom == 0 ? 'color: #EB4747' : ''">运行班次环比(%)</view>
<view class="rate_item_input" :style="item.operatingShiftsMom == 0 ? 'color: #EB4747' : ''">
{{item.operatingShiftsMom === 0 ? item.operatingShiftsMom : item.operatingShiftsMom ? item.operatingShiftsMom.toFixed(2) : ''}}
</view>
</view>
<view class="line"></view>
<view class="rate_item">
<view class="rate_item_label">运行班次同比(%)</view>
<view class="rate_item_input">
{{item.operatingShiftsYoy === 0 ? item.operatingShiftsYoy : item.operatingShiftsYoy ? item.operatingShiftsYoy.toFixed(2) : ''}}
</view>
</view>
</view>
<view class="form_item">
<view class="form_item_label">人数(万人)</view>
<view class="form_item_input form_input">
<uni-easyinput type="digit" v-model="item.passengerCount" placeholderStyle="color: #D4D4D4;font-size:28rpx;"
placeholder="请输入" @blur="checkNumber('passengerCount','bizBusDataDetailVOList',index)"></uni-easyinput>
</view>
</view>
<view class="form_item_rate" v-if="item.passengerCountMom || item.passengerCountYoy" :class="item.passengerCountMom == 0 ? 'danger' : '' ">
<view class="rate_item">
<view class="rate_item_label" :style="item.passengerCountMom == 0 ? 'color: #EB4747' : ''">人数环比(%)</view>
<view class="rate_item_input" :style="item.passengerCountMom == 0 ? 'color: #EB4747' : ''">
{{item.passengerCountMom === 0 ? item.passengerCountMom : item.passengerCountMom ? item.passengerCountMom.toFixed(2) : ''}}
</view>
</view>
<view class="line"></view>
<view class="rate_item">
<view class="rate_item_label">人数同比(%)</view>
<view class="rate_item_input">
{{item.passengerCountYoy === 0 ? item.passengerCountYoy : item.passengerCountYoy ? item.passengerCountYoy.toFixed(2) : ''}}
</view>
</view>
</view>
<view class="form_item">
<view class="form_item_label">昨日投入车辆</view>
<view class="form_item_input form_input">
<uni-easyinput type="digit" v-model="item.yestVehicleInput" placeholderStyle="color: #D4D4D4;font-size:28rpx;"
placeholder="请输入" @blur="checkNumber('yestVehicleInput','bizBusDataDetailVOList',index)"></uni-easyinput>
</view>
</view>
<view class="form_item">
<view class="form_item_label">昨日运行班次</view>
<view class="form_item_input form_input">
<uni-easyinput type="digit" v-model="item.yestOperatingShifts" placeholderStyle="color: #D4D4D4;font-size:28rpx;"
placeholder="请输入" @blur="checkNumber('yestOperatingShifts','bizBusDataDetailVOList',index)"></uni-easyinput>
</view>
</view>
<view class="form_item">
<view class="form_item_label">昨日人数</view>
<view class="form_item_input form_input">
<uni-easyinput type="digit" v-model="item.yestPassengerCount" placeholderStyle="color: #D4D4D4;font-size:28rpx;"
placeholder="请输入" @blur="checkNumber('yestPassengerCount','bizBusDataDetailVOList',index)"></uni-easyinput>
</view>
</view>
<view class="form_item">
<view class="form_item_label">去年投入车辆</view>
<view class="form_item_input form_input">
<uni-easyinput type="digit" v-model="item.lyVehicleInput" placeholderStyle="color: #D4D4D4;font-size:28rpx;"
placeholder="请输入" @blur="checkNumber('lyVehicleInput','bizBusDataDetailVOList',index)"></uni-easyinput>
</view>
</view>
<view class="form_item">
<view class="form_item_label">去年运行班次</view>
<view class="form_item_input form_input">
<uni-easyinput type="digit" v-model="item.lyOperatingShifts" placeholderStyle="color: #D4D4D4;font-size:28rpx;"
placeholder="请输入" @blur="checkNumber('lyOperatingShifts','bizBusDataDetailVOList',index)"></uni-easyinput>
</view>
</view>
<view class="form_item">
<view class="form_item_label">去年人数</view>
<view class="form_item_input form_input">
<uni-easyinput type="digit" v-model="item.lyPassengerCount" placeholderStyle="color: #D4D4D4;font-size:28rpx;"
placeholder="请输入" @blur="checkNumber('lyPassengerCount','bizBusDataDetailVOList',index)"></uni-easyinput>
</view>
</view>
<view class="line"></view>
</view>
<view class="add_btn" @click="addRow()">增行</view>
</view>
<view class="foot_btn">
<view class="act_btn" @click="doCancel">取消</view>
<view class="act_btn blue" @click="doSubmit">确认</view>
</view>
</view>
</template>
<script>
import { getDateStr } from '../../../common/util'
export default {
data() {
return {
timeArray:[],
pageType:'',
form:{
reportDate:'',
bizBusDataDetailVOList:[
{
busUnit:'',
busIndex:'',
vehicleInput:'',
vehicleInputMom:0,
vehicleInputYoy:0,
operatingShiftsMom:0,
operatingShiftsYoy:0,
passengerCount:'',
passengerCountMom:0,
passengerCountYoy:0,
yestVehicleInput:'',
yestOperatingShifts:'',
yestPassengerCount:'',
lyVehicleInput:'',
lyOperatingShifts:'',
lyPassengerCount:''
}
],
bizBusDataBodySaveOrUpdateDTOList:[]
},
index:'',
timeName:'',
busArray:[],
yoyMom:{},
}
},
onLoad(options) {
console.log(options)
this.getRoadTime();
// this.getBusData();
this.getPermiss()
if(options.type == 'add'){
this.pageType = 'add';
let now = new Date();
this.form.reportDate = getDateStr(now,0)
}else if(options.type == 'edit'){
this.pageType == 'edit';
this.form = JSON.parse(options.item)
}
},
methods: {
//
getPermiss(){
this.$request(getApp().globalData.baseUrl + '/api/biz/bizBusAuthority/findList',{},"GET").then(res =>{
console.log('数据权限==>',res)
this.busArray = res.data
})
},
//
getRoadTime(){
this.$request(getApp().globalData.baseUrl + '/api/dict/dictList?dictType=airport_time&_t=' + Date.parse(new Date()),"GET").then(res =>{
this.timeArray = res.data;
if(this.pageType == 'edit'){
this.index = this.timeArray.findIndex(item => item.dictValue == this.form.statPeriod)
this.timeName = this.timeArray.find(item => item.dictValue == this.form.statPeriod).dictLabel
}else if(this.pageType == 'add'){
let now = new Date();
let dateStr = getDateStr(now,0);
if(new Date(dateStr + ' 11:00').getTime() < new Date().getTime() && new Date().getTime() < new Date(dateStr + ' 13:30').getTime()) {
this.form.statPeriod = "0012";
this.index = this.timeArray.findIndex(item => item.dictValue == "0012")
this.timeName = this.timeArray.find(item => item.dictValue == "0012").dictLabel
}else{
this.form.statPeriod = "03";
this.index = this.timeArray.findIndex(item => item.dictValue == "03")
this.timeName = this.timeArray.find(item => item.dictValue == "03").dictLabel
}
}
})
},
//
getYoyMom(item,index){
let params = {
busUnit:item.busUnit,
statDate:this.form.reportDate
}
// console.log(params)
this.$request(getApp().globalData.baseUrl + '/api/biz/busdata/getYoyMom', params,"GET").then(res =>{
console.log('同比环比数据===>',res)
this.yoyMom = res.data;
this.checkYoyMom(index)
})
},
//
doSubmit(){
this.form.bizBusDataBodySaveOrUpdateDTOList = this.form.bizBusDataDetailVOList
console.log(this.form)
let params = this.form;
if(!this.form.reportDate){
uni.showToast({
title:"请选择统计日期",
icon:"none"
})
}else if(!this.form.statPeriod){
uni.showToast({
title:"请选择统计时段",
icon:"none"
})
}else{
uni.showModal({
title:'提示',
content:"确认保存当前报送数据吗?",
success: (res) => {
if(res.confirm){
uni.showLoading({
title: '提交中...',
mask: true
})
this.$request(getApp().globalData.baseUrl + '/api/biz/busdata/saveOrUpdate',params,"POST").then(res =>{
console.log(res)
if(res.code == 200){
uni.hideLoading();
uni.showToast({
title: '报送提交成功',
icon: 'none',
success: () => {
if(!this.form.id) {
uni.redirectTo({
url:"/pages/bus/busDataInfo/list"
})
}
else {
uni.navigateBack();
}
}
})
}
})
}
}
})
}
},
//
checkYoyMom(index){
//
if(this.yoyMom.yesterdayData){
// this.form.bizBusDataDetailVOList[index].operatingShiftsMom = this.form.bizBusDataDetailVOList[index].operatingShifts && this.yoyMom.yesterdayData.operatingShifts ?
// (this.form.bizBusDataDetailVOList[index].operatingShifts - this.yoyMom.yesterdayData.operatingShifts) / this.yoyMom.yesterdayData.operatingShifts * 100 : '';
this.form.bizBusDataDetailVOList[index].operatingShiftsMom = !checkNotEmpty(this.yoyMom.yesterdayData.operatingShifts) || this.yoyMom.yesterdayData.operatingShifts === 0 ? 100 : this.form.bizBusDataDetailVOList[index].operatingShifts ? (parseInt(this
.form.bizBusDataDetailVOList[index].operatingShifts) - this.yoyMom.yesterdayData.operatingShifts) / this.yoyMom.yesterdayData.operatingShifts *
100 : '';
// this.form.bizBusDataDetailVOList[index].passengerCountMom = this.form.bizBusDataDetailVOList[index].passengerCount && this.yoyMom.yesterdayData.passengerCount ?
// (this.form.bizBusDataDetailVOList[index].passengerCount - this.yoyMom.yesterdayData.passengerCount) / this.yoyMom.yesterdayData.passengerCount * 100 : '';
this.form.bizBusDataDetailVOList[index].passengerCountMom = !checkNotEmpty(this.yoyMom.yesterdayData.passengerCount) || this.yoyMom.yesterdayData.passengerCount === 0 ? 100 : this.form.bizBusDataDetailVOList[index].passengerCount ? (parseInt(this
.form.bizBusDataDetailVOList[index].passengerCount) - this.yoyMom.yesterdayData.passengerCount) / this.yoyMom.yesterdayData.passengerCount *
100 : '';
// this.form.bizBusDataDetailVOList[index].vehicleInputMom = this.form.bizBusDataDetailVOList[index].vehicleInput && this.yoyMom.yesterdayData.vehicleInput ?
// (this.form.bizBusDataDetailVOList[index].vehicleInput - this.yoyMom.yesterdayData.vehicleInput) / this.yoyMom.yesterdayData.vehicleInput * 100 : '';
this.form.bizBusDataDetailVOList[index].vehicleInputMom = !checkNotEmpty(this.yoyMom.yesterdayData.vehicleInput) || this.yoyMom.yesterdayData.vehicleInput === 0 ? 100 : this.form.bizBusDataDetailVOList[index].vehicleInput ? (parseInt(this
.form.bizBusDataDetailVOList[index].vehicleInput) - this.yoyMom.yesterdayData.vehicleInput) / this.yoyMom.yesterdayData.vehicleInput *
100 : '';
}
//
if(this.yoyMom.lastYearData){
// this.form.bizBusDataDetailVOList[index].operatingShiftsYoy = this.form.bizBusDataDetailVOList[index].operatingShifts && this.yoyMom.lastYearData.operatingShifts ?
// (this.form.bizBusDataDetailVOList[index].operatingShifts - this.yoyMom.lastYearData.operatingShifts) / this.yoyMom.lastYearData.operatingShifts * 100 : '';
this.form.bizBusDataDetailVOList[index].operatingShiftsYoy = !checkNotEmpty(this.yoyMom.lastYearData.operatingShifts) || this.yoyMom.lastYearData.operatingShifts === 0 ? 100 : this.form.bizBusDataDetailVOList[index].operatingShifts ? (parseInt(this
.form.bizBusDataDetailVOList[index].operatingShifts) - this.yoyMom.lastYearData.operatingShifts) / this.yoyMom.lastYearData.operatingShifts *
100 : '';
// this.form.bizBusDataDetailVOList[index].passengerCountYoy = this.form.bizBusDataDetailVOList[index].passengerCount && this.yoyMom.lastYearData.passengerCount ?
// (this.form.bizBusDataDetailVOList[index].passengerCount - this.yoyMom.lastYearData.passengerCount) / this.yoyMom.lastYearData.passengerCount * 100 : '';
this.form.bizBusDataDetailVOList[index].passengerCountYoy = !checkNotEmpty(this.yoyMom.lastYearData.passengerCount) || this.yoyMom.lastYearData.passengerCount === 0 ? 100 : this.form.bizBusDataDetailVOList[index].passengerCount ? (parseInt(this
.form.bizBusDataDetailVOList[index].passengerCount) - this.yoyMom.lastYearData.passengerCount) / this.yoyMom.lastYearData.passengerCount *
100 : '';
// this.form.bizBusDataDetailVOList[index].vehicleInputYoy = this.form.bizBusDataDetailVOList[index].vehicleInput && this.yoyMom.lastYearData.vehicleInput ?
// (this.form.bizBusDataDetailVOList[index].vehicleInput - this.yoyMom.lastYearData.vehicleInput) / this.yoyMom.lastYearData.vehicleInput * 100 : '';
this.form.bizBusDataDetailVOList[index].vehicleInputYoy = !checkNotEmpty(this.yoyMom.lastYearData.vehicleInput) || this.yoyMom.lastYearData.vehicleInput === 0 ? 100 : this.form.bizBusDataDetailVOList[index].vehicleInput ? (parseInt(this
.form.bizBusDataDetailVOList[index].vehicleInput) - this.yoyMom.lastYearData.vehicleInput) / this.yoyMom.lastYearData.vehicleInput *
100 : '';
}
},
//
// getBusData(){
// this.$request(getApp().globalData.baseUrl + '/api/dict/dictList?dictType=bus_unit&_t=' + Date.parse(new Date()),{},"GET").then(res =>{
// this.busArray = res.data
// })
// },
//
bindDateChange(e) {
this.form.reportDate = e.detail.value;
},
//
bindtimeChange(e){
let index = e.target.value;
var selected = this.timeArray[index];
this.form.statPeriod = selected.dictValue;
this.timeName = selected.dictLabel
},
//
changeBusway(e,key,index){
this.form[key][index].busIndex = e.detail.value;
this.form[key][index].busUnit = this.busArray[e.detail.value].stationId;
this.getYoyMom(this.form[key][index],index)
},
//
checkNumber(val,key,index){ //
if(this.form[key][index][val]){
if(val == 'operatingShifts' || val == 'passengerCount' || val == 'vehicleInput'){
console.log(this.form[key][index])
this.getYoyMom(this.form[key][index])
}
this.form[key][index][val] = this.form[key][index][val].replace(/[^\d.]/g,""); //.
this.form[key][index][val] = this.form[key][index][val].replace(/^\./g,""); //.
this.form[key][index][val] = this.form[key][index][val].replace(/\.{2,}/g,"."); //..
this.form[key][index][val] = this.form[key][index][val].replace(".","$#$").replace(/\./g,"").replace("$#$","."); //.
}
},
//
addRow(){
this.form.bizBusDataDetailVOList.push(
{
busUnit:'',
busIndex:'',
vehicleInput:'',
vehicleInputMom:0,
vehicleInputYoy:0,
operatingShiftsMom:0,
operatingShiftsYoy:0,
passengerCount:'',
passengerCountMom:0,
passengerCountYoy:0,
yestVehicleInput:'',
yestOperatingShifts:'',
yestPassengerCount:'',
lyVehicleInput:'',
lyOperatingShifts:'',
lyPassengerCount:''
}
)
},
//
delRow(index){
this.form.bizBusDataDetailVOList.splice(index, 1);
},
}
}
</script>
<style lang="scss" scoped>
.form_warp {
padding: 30rpx 30rpx 195rpx;
.form_intro {
color: #666;
font-size: 26rpx;
font-family: PingFang SC-Bold, PingFang SC;
line-height: 48rpx;
text-align: center;
margin-bottom: 20rpx;
.tel {
color: #2D8CF0;
font-weight: bold;
}
}
.form_item_box {
padding: 30rpx 20rpx 30rpx 30rpx;
background-color: #fff;
border-radius: 30rpx;
&.bottom{
margin-top: 30rpx;
}
//
.form_item_rate{
background: #F6F6F6;
border: 1px solid #F6F6F6;
padding: 30rpx;
margin-bottom: 30rpx;
border-radius: 30rpx;
.line{
height: 1px;
background-color: #dfdfdf;
margin: 30rpx 0;
}
.rate_item{
display: flex;
justify-content: space-between;
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
.rate_item_label{
color: #666;
font-size: 24rpx;
}
.rate_item_input{
color: #333;
font-size: 28rpx;
}
}
&.danger{
background-color: #FEF6F3;
border-color: #F0622D;
}
}
.form_item_title {
color: #333;
line-height: 42rpx;
font-size: 30rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
margin-bottom: 30rpx;
}
.form_item_remark{
margin-bottom: 30rpx;
.form_item_label{
color: #333333;
line-height: 42rpx;
font-size: 30rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
margin-bottom: 30rpx;
}
}
.form_item {
display: flex;
align-items: center;
justify-content: space-between;
line-height: 37rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
margin-bottom: 30rpx;
.form_item_label {
width: 300rpx;
color: #666666;
font-size: 26rpx;
word-break: break-all;
}
.form_item_input {
color: #333;
text-align: right;
word-break: break-all;
&.picker {
flex: 1;
display: flex;
justify-content: space-between;
/deep/ picker {
flex: 1;
}
.picker_select {
color: #D4D4D4;
font-size: 28rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
text-align: right;
}
}
//
&.text{
color: #333333;
line-height: 40rpx;
font-size: 28rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
}
//
&.form_input{
/deep/ .is-input-border{
border: 0 !important;
.uni-easyinput__content-input{
text-align: right;
}
}
}
}
}
}
}
//
.line {
height: 1px;
background-color: #E1E1E1;
}
.add_btn {
height: 90rpx;
line-height: 90rpx;
color: #2D8CF0;
font-size: 28rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
text-align: center;
background: #ECF5FF;
border-radius: 30rpx;
border: 2rpx solid #2D8CF0;
margin-top: 30rpx;
}
.foot_btn {
position: fixed;
left: 0;
right: 0;
bottom: 0;
display: flex;
justify-content: space-between;
padding: 40rpx 30rpx;
background-color: #f5f5f5;
z-index: 11;
.act_btn {
width: 329rpx;
height: 90rpx;
color: #666666;
font-size: 28rpx;
line-height: 90rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
text-align: center;
background: #F6F6F6;
border-radius: 100rpx;
border: 1rpx solid #C1C1C1;
&.blue {
color: #fff;
background: #2D8CF0;
border-color: #2D8CF0;
}
}
}
</style>

@ -12,113 +12,115 @@
{{form.affiliatedUnit}}
</view>
</view> -->
<view class="form_item" v-if="form.bizBusDataDetailVOList.length == 1">
<!-- <view class="form_item" v-if="form.bizBusDataDetailVOList.length == 1">
<view class="form_item_label">名称</view>
<view class="form_item_input select">
{{form.bizBusDataDetailVOList.length > 0 ? form.bizBusDataDetailVOList[busIndex].busUnit : ''}}
</view>
</view>
</view> -->
<view class="form_item">
<view class="form_item_label">统计日期</view>
<view class="form_item_input picker">
<picker mode="date" :value="form.reportDate" @change="bindDateChange">
<picker v-if="pageType == 'add'" mode="date" :value="form.statDate" @change="bindDateChange">
<text class="picker_select"
:style="form.reportDate?'color:#333;':''">{{form.reportDate?form.reportDate:'请选择时段'}}</text>
:style="form.statDate?'color:#333;':''">{{form.statDate?form.statDate:'请选择时段'}}</text>
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons>
</picker>
<text v-else>{{form.statDate?form.statDate:''}}</text>
</view>
</view>
<view class="form_item">
<view class="form_item_label">统计时段</view>
<view class="form_item_input picker">
<picker :value="index" :range="array" range-key="dictLabel" @change="changeStatPeriod">
<picker v-if="pageType == 'add'" :value="index" :range="array" range-key="dictLabel" @change="changeStatPeriod">
<text class="picker_select"
:style="index>-1?'color:#333;':''">{{index>-1?array[index].dictLabel:'请选择时段'}}</text>
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons>
</picker>
<text v-else>{{index>-1?array[index].dictLabel:''}}</text>
</view>
</view>
<!-- 汇总统计 -->
<view class="form_item">
<view class="form_item_label">投入车辆统计</view>
<view class="form_item_input">
{{form.entranceVehicleCount === 0 ? form.entranceVehicleCount : form.entranceVehicleCount || ''}}
{{form.vehicleCount === 0 ? form.vehicleCount : form.vehicleCount || ''}}
</view>
</view>
<!-- 同比环比 -->
<view class="form_item_rate"
:class="checkNotEmpty(form.entranceVehicleCount) && form.entranceVehicleCount === yoyMom.minusDaysEntranceVehicleSum ? 'danger' : ''">
:class="checkNotEmpty(form.vehicleCount) && form.vehicleCount === yoySum.minusDaySummaryData.vehicleCount ? 'danger' : ''">
<view class="rate_item">
<view class="rate_item_label"
:style="checkNotEmpty(form.entranceVehicleCount) && form.entranceVehicleCount === yoyMom.minusDaysEntranceVehicleSum ?'color: #EB4747':''">
:style="checkNotEmpty(form.vehicleCount) && form.vehicleCount === yoySum.minusDaySummaryData.vehicleCount ?'color: #EB4747':''">
投入车辆统计环比</view>
<view class="rate_item_input"
:style="checkNotEmpty(form.entranceVehicleCount) && form.entranceVehicleCount === yoyMom.minusDaysEntranceVehicleSum ?'color: #EB4747':''">
{{formatDigit(form.entranceVehicleCountMom)}}%
:style="checkNotEmpty(form.vehicleCount) && form.vehicleCount === yoySum.minusDaySummaryData.vehicleCount ?'color: #EB4747':''">
{{formatDigit(form.vehicleCountMom)}}%
</view>
</view>
<view class="line"></view>
<view class="rate_item">
<view class="rate_item_label">投入车辆统计同比</view>
<view class="rate_item_input">
{{formatDigit(form.entranceVehicleCountYoy)}}%
{{formatDigit(form.vehicleCountYoy)}}%
</view>
</view>
</view>
<view class="form_item">
<view class="form_item_label">人数统计</view>
<view class="form_item_input">
{{form.exitVehicleCount === 0 ? form.exitVehicleCount : form.exitVehicleCount || ''}}
{{form.passengerCount === 0 ? form.passengerCount : form.passengerCount || ''}}
</view>
</view>
<!-- 同比环比 -->
<view class="form_item_rate"
:class="checkNotEmpty(form.exitVehicleCount) && form.exitVehicleCount === yoyMom.minusDaysExitVehicleSum ? 'danger' : ''">
:class="checkNotEmpty(form.passengerCount) && form.passengerCount === yoySum.minusDaySummaryData.passengerCount ? 'danger' : ''">
<view class="rate_item">
<view class="rate_item_label"
:style="checkNotEmpty(form.exitVehicleCount) && form.exitVehicleCount === yoyMom.minusDaysExitVehicleSum ?'color: #EB4747':''">
:style="checkNotEmpty(form.passengerCount) && form.passengerCount === yoySum.minusDaySummaryData.passengerCount ?'color: #EB4747':''">
人数统计环比</view>
<view class="rate_item_input"
:style="checkNotEmpty(form.exitVehicleCount) && form.exitVehicleCount === yoyMom.minusDaysExitVehicleSum ?'color: #EB4747':''">
{{formatDigit(form.exitVehicleCountMom)}}%
:style="checkNotEmpty(form.passengerCount) && form.passengerCount === yoySum.minusDaySummaryData.passengerCount ?'color: #EB4747':''">
{{formatDigit(form.passengerCountMom)}}%
</view>
</view>
<view class="line"></view>
<view class="rate_item">
<view class="rate_item_label">人数统计同比</view>
<view class="rate_item_input">
{{formatDigit(form.exitVehicleCountYoy)}}%
{{formatDigit(form.passengerCountYoy)}}%
</view>
</view>
</view>
<view class="form_item">
<view class="form_item_label">班次统计</view>
<view class="form_item_input">
{{form.exitVehicleCount === 0 ? form.exitVehicleCount : form.exitVehicleCount || ''}}
{{form.operatingCount === 0 ? form.operatingCount : form.operatingCount || ''}}
</view>
</view>
<!-- 同比环比 -->
<view class="form_item_rate"
:class="checkNotEmpty(form.exitVehicleCount) && form.exitVehicleCount === yoyMom.minusDaysExitVehicleSum ? 'danger' : ''">
:class="checkNotEmpty(form.operatingCount) && form.operatingCount === yoySum.minusDaySummaryData.operatingCount ? 'danger' : ''">
<view class="rate_item">
<view class="rate_item_label"
:style="checkNotEmpty(form.exitVehicleCount) && form.exitVehicleCount === yoyMom.minusDaysExitVehicleSum ?'color: #EB4747':''">
:style="checkNotEmpty(form.operatingCount) && form.operatingCount === yoySum.minusDaySummaryData.operatingCount ?'color: #EB4747':''">
班次统计环比</view>
<view class="rate_item_input"
:style="checkNotEmpty(form.exitVehicleCount) && form.exitVehicleCount === yoyMom.minusDaysExitVehicleSum ?'color: #EB4747':''">
{{formatDigit(form.exitVehicleCountMom)}}%
:style="checkNotEmpty(form.operatingCount) && form.operatingCount === yoySum.minusDaySummaryData.operatingCount ?'color: #EB4747':''">
{{formatDigit(form.operatingCountMom)}}%
</view>
</view>
<view class="line"></view>
<view class="rate_item">
<view class="rate_item_label">班次统计同比</view>
<view class="rate_item_input">
{{formatDigit(form.exitVehicleCountYoy)}}%
{{formatDigit(form.operatingCountYoy)}}%
</view>
</view>
</view>
</view>
<!-- 陆岛权限 -->
<!-- 公交交通局权限 -->
<view class="station_box">
<view v-if="index < 9" :style="(index+1)%3 == 0 ? 'margin-right:0;':''" @click="changeLandNameIndex(index)"
class="station_item" :class="[item.isFinish ? 'active' : '',index == landNameIndex ? 'choosed' : '']"
@ -283,18 +285,22 @@
return {
form: {
"bizBusDataDetailVOList": [],
"reportDate": "",
"statDate": "",
"statPeriod": ""
}, //form
array: [], //
index: 2, //,0-24
userInfo: {},
landList: ['灵山岛', '斋堂岛', '青黄线', '竹岔', '田横'],
landList: [],
landNameIndex: 0,
showLand: false,
pageType: '',
btnText: '保存',
mobile: getApp().globalData.mobile
mobile: getApp().globalData.mobile,
yoySum: {
minusDaySummaryData: {},
minusYearSummaryData: {}
},//
}
},
onLoad(options) {
@ -302,9 +308,9 @@
if (options.type == 'add') {
this.pageType = 'add';
let now = new Date();
this.form.reportDate = getDateStr(now, -1); //
this.form.statDate = getDateStr(now, -1); //
this.queryTime(); //
this.getPermiss(); //
// this.getPermiss(); //
} else if (options.type == 'edit') {
this.btnText = '修改并保存';
this.pageType = 'edit'
@ -312,7 +318,7 @@
// this.form.bizBusDataDetailVOList = this.form.bizWaterwayIslandDataVOList;
// this.getPermiss(); //
// this.queryTime();
this.getDetail(item.id)
this.getDetail2(item.statDate, item.statPeriod);
}
// else if (options.id) {
// this.btnText = '';
@ -329,7 +335,7 @@
return checkNotEmpty(data);
},
formatDigit(data) {
return (data+'').indexOf('.') > -1 && (data+'').substring((data+'').indexOf('.')).length > 2 ? data.toFixed(2) : data;
return !checkNotEmpty(data) ? '--' : (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 =>{
@ -340,6 +346,26 @@
this.getPermiss();
})
},
getDetail2(statDate,statPeriod){
this.$request(getApp().globalData.baseUrl + '/api/biz/busdata/getDataByTime?statDate=' + statDate + '&statPeriod=' + statPeriod,{},"GET").then(res =>{
console.log('查询详情===>',res)
res.data.statDate = statDate;
res.data.statPeriod = statPeriod;
this.form = res.data;
//
this.$request(getApp().globalData.baseUrl + '/api/biz/busdata/getSummaryDataYoYAndMoM?statDate=' + statDate + '&statPeriod=' + statPeriod + '&_t=' + Date.parse(new Date()), {},
'GET')
.then(res2 => {
res2.data.minusDaySummaryData = res2.data.minusDaySummaryData ? res2.data.minusDaySummaryData : {};
res2.data.minusYearSummaryData = res2.data.minusYearSummaryData ? res2.data.minusYearSummaryData : {};
this.yoySum = res2.data;
})
if(this.pageType != 'add') {
this.queryTime(); //
}
this.getPermiss();
})
},
//
changeLandNameIndex(index) {
if (this.form.bizBusDataDetailVOList[this.landNameIndex].vehicleInput != '' && this.form
@ -360,22 +386,12 @@
this.landList.map(item => {
item.isFinish = false;
this.form.bizBusDataDetailVOList.push({
// "landName": item.stationName,
// "lastYearpassengerCount": '',
// "lastYearvehicleInput": '',
// "passengerCount": '',
// "passengerCountMom": '',
// "passengerCountYoy": '',
// "vehicleInput": '',
// "vehicleInputRingRatio": '',
// "vehicleInputYearOnYear": '',
// "yestPassengerCount": '',
// "yesterdayvehicleInput": '',
busUnit:item.stationName,
// busIndex:'',
vehicleInput:'',
vehicleInputMom:'',
vehicleInputYoy:'',
operatingShifts: '',
operatingShiftsMom:'',
operatingShiftsYoy:'',
passengerCount:'',
@ -391,11 +407,6 @@
})
})
} else {
// this.landList = [
// {stationName: ""},
// {stationName: ""},
// {stationName: ""},
// ]
let arr = JSON.parse(JSON.stringify(this.form.bizBusDataDetailVOList));
this.form.bizBusDataDetailVOList = [];
this.landList.map(item => {
@ -415,8 +426,11 @@
"passengerCountMom": '',
"passengerCountYoy": '',
"vehicleInput": '',
"vehicleInputRingRatio": '',
"vehicleInputYearOnYear": '',
"vehicleInputMom": '',
"vehicleInputYoy": '',
"operatingShifts": '',
"operatingShiftsMom" : '',
"operatingShiftsYoy" : '',
"yestPassengerCount": '',
"yesterdayvehicleInput": '',
"yestOperatingShifts":'',
@ -425,6 +439,9 @@
}
})
}
this.form.bizBusDataDetailVOList.map((item,index) => {
this.calcYoyMom(index);
});
})
},
//
@ -446,7 +463,7 @@
//
calcYoyMom(landNameIndex) {
console.log('landNameIndex ===>',landNameIndex)
if (this.form.reportDate == '' || this.form.statPeriod == '' || this.form
if (this.form.statDate == '' || this.form.statPeriod == '' || this.form
.bizBusDataDetailVOList[landNameIndex].landName == '') {
return;
}
@ -459,8 +476,24 @@
.bizBusDataDetailVOList[landNameIndex].vehicleInput) && checkNotEmpty(this.form
.bizBusDataDetailVOList[landNameIndex].passengerCount) && checkNotEmpty(this.form
.bizBusDataDetailVOList[landNameIndex].operatingShifts) ? true : false;
//
let _vehicleInputTotal = 0, _peopleTotal = 0, _operationTotal = 0;
this.form.bizBusDataDetailVOList.map(item => {
_vehicleInputTotal = _vehicleInputTotal + (checkNotEmpty(item.vehicleInput) ? parseInt(item.vehicleInput) : 0);
_peopleTotal = _peopleTotal + (checkNotEmpty(item.passengerCount) ? parseInt(item.passengerCount) : 0);
_operationTotal = _operationTotal + (checkNotEmpty(item.operatingShifts) ? parseInt(item.operatingShifts) : 0);
})
this.form.vehicleCount = _vehicleInputTotal;
this.form.vehicleCountMom = this.$calcMom(this.form.vehicleCount,this.yoySum.minusDaySummaryData.vehicleCount);
this.form.vehicleCountYoy = this.$calcYoy(this.form.vehicleCount,this.yoySum.minusYearSummaryData.vehicleCount);
this.form.passengerCount = _peopleTotal;
this.form.passengerCountMom = this.$calcMom(this.form.passengerCount,this.yoySum.minusDaySummaryData.passengerCount);
this.form.passengerCountYoy = this.$calcYoy(this.form.passengerCount,this.yoySum.minusYearSummaryData.passengerCount);
this.form.operatingCount = _operationTotal;
this.form.operatingCountMom = this.$calcMom(this.form.operatingCount,this.yoySum.minusDaySummaryData.operatingCount);
this.form.operatingCountYoy = this.$calcYoy(this.form.operatingCount,this.yoySum.minusYearSummaryData.operatingCount);
this.$request(getApp().globalData.baseUrl + '/api/biz/busdata/getYoyMom?statDate=' + this.form
.reportDate + '&statPeriod=' + this.form.statPeriod + '&busUnit=' + this.form
.statDate + '&statPeriod=' + this.form.statPeriod + '&busUnit=' + this.form
.bizBusDataDetailVOList[landNameIndex].busUnit + '&_t=' + Date.parse(new Date()), {},
'GET')
.then(res => {
@ -533,10 +566,14 @@
this.index = e.detail.value;
this.form.statPeriod = this.array[e.detail.value].dictValue;
console.log('change 时段', this.form)
//
this.form.bizBusDataDetailVOList.map((item, index) => {
this.calcYoyMom(index);
})
if(this.pageType == 'add') {
this.getDetail2(this.form.statDate, this.form.statPeriod);
}else{
this.form.bizBusDataDetailVOList.map((item,index) => {
this.calcYoyMom(index);
})
}
},
//
doCancel() {
@ -544,15 +581,18 @@
},
//
bindDateChange(e) {
this.form.reportDate = e.detail.value;
//
this.form.bizBusDataDetailVOList.map((item, index) => {
this.calcYoyMom(index);
})
this.form.statDate = e.detail.value;
if(this.pageType == 'add') {
this.getDetail2(this.form.statDate, this.form.statPeriod);
}else{
this.form.bizBusDataDetailVOList.map((item,index) => {
this.calcYoyMom(index);
})
}
},
//
queryTime() {
this.$request(getApp().globalData.baseUrl + '/api/dict/dictList?dictType=airport_time' + '&_t=' + Date
this.$request(getApp().globalData.baseUrl + '/api/dict/dictList?dictType=bus_time' + '&_t=' + Date
.parse(
new Date()), {}, 'GET').then(res => {
this.array = res.data;
@ -572,6 +612,7 @@
let idx = this.array.findIndex(item => item.dictValue == '03');
this.index = idx > -1 ? idx : '';
}
this.getDetail2(this.form.statDate, this.form.statPeriod);
} else {
let idx = this.array.findIndex(item => item.dictValue == this.form.statPeriod);
this.index = idx > -1 ? idx : '';
@ -602,7 +643,7 @@
//
doSubmit() {
console.log(this.form)
if (this.form.reportDate == '' || this.form.statPeriod == '') {
if (this.form.statDate == '' || this.form.statPeriod == '') {
uni.showToast({
title: '报送日期和时段不能为空',
icon: 'none'
@ -630,7 +671,7 @@
console.log(this.form)
uni.showModal({
title: '提示',
content: this.form.id == undefined ? '您确认提交该条报送数据?' : '您确认将该条数据进行修改?',
content: this.pageType == 'add' ? '您确认提交该条报送数据?' : '您确认将该条数据进行修改?',
success: (res) => {
if (res.confirm) {
this.submitForm();

@ -6,7 +6,7 @@
<view class="list_item" v-for="(item,index) in listData" :key="index" @click="editItem(item)">
<view class="list_top">
<view class="unit_tags">报送时间</view>
<view class="unit_name">{{item.reportDate || ''}}<text style="margin-left:16rpx;">{{item.statPeriodValue || ''}}</text></view>
<view class="unit_name">{{item.statDate || ''}}<text style="margin-left:16rpx;">{{renderTime(item.statPeriod)}}</text></view>
</view>
</view>
</view>
@ -110,12 +110,12 @@
_t:Date.parse(new Date()),
...this.query
}
this.$request(getApp().globalData.baseUrl + '/api/biz/busdata/list',params,"GET").then(res =>{
this.$request(getApp().globalData.baseUrl + '/api/biz/highwayParentDataController/getTimeList',params,"GET").then(res =>{
console.log(res)
if(res.code == 200){
res.data.list.map(item =>{
item.show = false;
})
// res.data.list.map(item =>{
// item.show = false;
// })
this.listData = this.listData.concat(res.data.list);
if(res.data.list.length == 0 || res.data.list.length < this.pageSize){
this.hasMore = false;
@ -138,9 +138,14 @@
handleSearch(){
this.$refs.popup.open('bottom')
},
//
renderTime(reportPhase) {
let idx = this.timeArray.findIndex(item => item.dictValue == reportPhase);
return idx > -1 ? this.timeArray[idx].dictLabel : '';
},
//
queryTime() {
this.$request(getApp().globalData.baseUrl + '/api/dict/dictList?dictType=airport_time' + '&_t=' + Date.parse(
this.$request(getApp().globalData.baseUrl + '/api/dict/dictList?dictType=bus_time' + '&_t=' + Date.parse(
new Date()), {}, 'GET').then(res => {
this.timeArray = res.data;
})

@ -21,79 +21,81 @@
<view class="form_item">
<view class="form_item_label">统计日期</view>
<view class="form_item_input picker">
<picker mode="date" :value="form.statDate" @change="bindDateChange">
<picker v-if="pageType == 'add'" mode="date" :value="form.statDate" @change="bindDateChange">
<text class="picker_select"
:style="form.statDate?'color:#333;':''">{{form.statDate?form.statDate:'请选择'}}</text>
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons>
</picker>
</picker>
<text v-else>{{form.statDate?form.statDate:''}}</text>
</view>
</view>
<view class="form_item">
<view class="form_item_label">统计时段</view>
<view class="form_item_input picker">
<picker :value="index" :range="array" range-key="dictLabel" @change="changeStatPeriod">
<picker v-if="pageType == 'add'" :value="index" :range="array" range-key="dictLabel" @change="changeStatPeriod">
<text class="picker_select"
:style="index>-1?'color:#333;':''">{{index>-1?array[index].dictLabel:'请选择'}}</text>
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons>
</picker>
</picker>
<text v-else>{{index>-1?array[index].dictLabel:''}}</text>
</view>
</view>
<!-- 汇总统计 进青 -->
<view class="form_item">
<view class="form_item_label">进青终到车次统计</view>
<view class="form_item_input">
{{form.entranceVehicleCount === 0 ? form.entranceVehicleCount : form.entranceVehicleCount || ''}}
{{form.inboundRailwayDo === 0 ? form.inboundRailwayDo : form.inboundRailwayDo || ''}}
</view>
</view>
<!-- 同比环比 -->
<view class="form_item_rate"
:class="checkNotEmpty(form.entranceVehicleCount) && form.entranceVehicleCount === yoyMom.minusDaysEntranceVehicleSum ? 'danger' : ''">
:class="checkNotEmpty(form.inboundRailwayDo) && form.inboundRailwayDo === yoySum.minusDaySummaryData.inboundRailwayDo ? 'danger' : ''">
<view class="rate_item">
<view class="rate_item_label"
:style="checkNotEmpty(form.entranceVehicleCount) && form.entranceVehicleCount === yoyMom.minusDaysEntranceVehicleSum ?'color: #EB4747':''">
:style="checkNotEmpty(form.inboundRailwayDo) && form.inboundRailwayDo === yoySum.minusDaySummaryData.inboundRailwayDo ?'color: #EB4747':''">
终到车次统计环比</view>
<view class="rate_item_input"
:style="checkNotEmpty(form.entranceVehicleCount) && form.entranceVehicleCount === yoyMom.minusDaysEntranceVehicleSum ?'color: #EB4747':''">
{{formatDigit(form.entranceVehicleCountMom)}}%
:style="checkNotEmpty(form.inboundRailwayDo) && form.inboundRailwayDo === yoySum.minusDaySummaryData.inboundRailwayDo ?'color: #EB4747':''">
{{formatDigit(form.inRailwayYomDo)}}%
</view>
</view>
<view class="line"></view>
<view class="rate_item">
<view class="rate_item_label">终到车次统计同比</view>
<view class="rate_item_input">
{{formatDigit(form.entranceVehicleCountYoy)}}%
{{formatDigit(form.inRailwayMomDo)}}%
</view>
</view>
</view>
<view class="form_item">
<view class="form_item_label">进青过路车次统计</view>
<view class="form_item_input">
{{form.entranceVehicleCount === 0 ? form.entranceVehicleCount : form.entranceVehicleCount || ''}}
{{form.inboundPassengersDo === 0 ? form.inboundPassengersDo : form.inboundPassengersDo || ''}}
</view>
</view>
<view class="form_item">
<view class="form_item_label">进青人数统计</view>
<view class="form_item_input">
{{form.exitVehicleCount === 0 ? form.exitVehicleCount : form.exitVehicleCount || ''}}
{{form.inPepole === 0 ? form.inPepole : form.inPepole || ''}}
</view>
</view>
<!-- 同比环比 -->
<view class="form_item_rate"
:class="checkNotEmpty(form.exitVehicleCount) && form.exitVehicleCount === yoyMom.minusDaysExitVehicleSum ? 'danger' : ''">
:class="checkNotEmpty(form.inPepole) && form.inPepole === yoySum.minusDaySummaryData.inPepole ? 'danger' : ''">
<view class="rate_item">
<view class="rate_item_label"
:style="checkNotEmpty(form.exitVehicleCount) && form.exitVehicleCount === yoyMom.minusDaysExitVehicleSum ?'color: #EB4747':''">
:style="checkNotEmpty(form.inPepole) && form.inPepole === yoySum.minusDaySummaryData.inPepole ?'color: #EB4747':''">
人数统计环比</view>
<view class="rate_item_input"
:style="checkNotEmpty(form.exitVehicleCount) && form.exitVehicleCount === yoyMom.minusDaysExitVehicleSum ?'color: #EB4747':''">
{{formatDigit(form.exitVehicleCountMom)}}%
:style="checkNotEmpty(form.inPepole) && form.inPepole === yoySum.minusDaySummaryData.inPepole ?'color: #EB4747':''">
{{formatDigit(form.inPepoleYoyDo)}}%
</view>
</view>
<view class="line"></view>
<view class="rate_item">
<view class="rate_item_label">人数统计同比</view>
<view class="rate_item_input">
{{formatDigit(form.exitVehicleCountYoy)}}%
{{formatDigit(form.inPepoleMomDo)}}%
</view>
</view>
</view>
@ -101,58 +103,58 @@
<view class="form_item">
<view class="form_item_label">出青始发车次统计</view>
<view class="form_item_input">
{{form.entranceVehicleCount === 0 ? form.entranceVehicleCount : form.entranceVehicleCount || ''}}
{{form.outboundRailwayDo === 0 ? form.outboundRailwayDo : form.outboundRailwayDo || ''}}
</view>
</view>
<!-- 同比环比 -->
<view class="form_item_rate"
:class="checkNotEmpty(form.entranceVehicleCount) && form.entranceVehicleCount === yoyMom.minusDaysEntranceVehicleSum ? 'danger' : ''">
:class="checkNotEmpty(form.outboundRailwayDo) && form.outboundRailwayDo === yoySum.minusDaySummaryData.outboundRailwayDo ? 'danger' : ''">
<view class="rate_item">
<view class="rate_item_label"
:style="checkNotEmpty(form.entranceVehicleCount) && form.entranceVehicleCount === yoyMom.minusDaysEntranceVehicleSum ?'color: #EB4747':''">
:style="checkNotEmpty(form.outboundRailwayDo) && form.outboundRailwayDo === yoySum.minusDaySummaryData.outboundRailwayDo ?'color: #EB4747':''">
始发车次统计环比</view>
<view class="rate_item_input"
:style="checkNotEmpty(form.entranceVehicleCount) && form.entranceVehicleCount === yoyMom.minusDaysEntranceVehicleSum ?'color: #EB4747':''">
{{formatDigit(form.entranceVehicleCountMom)}}%
:style="checkNotEmpty(form.outboundRailwayDo) && form.outboundRailwayDo === yoySum.minusDaySummaryData.outboundRailwayDo ?'color: #EB4747':''">
{{formatDigit(form.outRailwayYomDo)}}%
</view>
</view>
<view class="line"></view>
<view class="rate_item">
<view class="rate_item_label">始发车次统计同比</view>
<view class="rate_item_input">
{{formatDigit(form.entranceVehicleCountYoy)}}%
{{formatDigit(form.outRailwayMomDo)}}%
</view>
</view>
</view>
<view class="form_item">
<view class="form_item_label">出青过路车次统计</view>
<view class="form_item_input">
{{form.entranceVehicleCount === 0 ? form.entranceVehicleCount : form.entranceVehicleCount || ''}}
{{form.outboundPassengersDo === 0 ? form.outboundPassengersDo : form.outboundPassengersDo || ''}}
</view>
</view>
<view class="form_item">
<view class="form_item_label">出青人数统计</view>
<view class="form_item_input">
{{form.exitVehicleCount === 0 ? form.exitVehicleCount : form.exitVehicleCount || ''}}
{{form.outPepole === 0 ? form.outPepole : form.outPepole || ''}}
</view>
</view>
<!-- 同比环比 -->
<view class="form_item_rate"
:class="checkNotEmpty(form.exitVehicleCount) && form.exitVehicleCount === yoyMom.minusDaysExitVehicleSum ? 'danger' : ''">
:class="checkNotEmpty(form.outPepole) && form.outPepole === yoySum.minusDaySummaryData.outPepole ? 'danger' : ''">
<view class="rate_item">
<view class="rate_item_label"
:style="checkNotEmpty(form.exitVehicleCount) && form.exitVehicleCount === yoyMom.minusDaysExitVehicleSum ?'color: #EB4747':''">
:style="checkNotEmpty(form.outPepole) && form.outPepole === yoySum.minusDaySummaryData.outPepole ?'color: #EB4747':''">
人数统计环比</view>
<view class="rate_item_input"
:style="checkNotEmpty(form.exitVehicleCount) && form.exitVehicleCount === yoyMom.minusDaysExitVehicleSum ?'color: #EB4747':''">
{{formatDigit(form.exitVehicleCountMom)}}%
:style="checkNotEmpty(form.outPepole) && form.outPepole === yoySum.minusDaySummaryData.outPepole ?'color: #EB4747':''">
{{formatDigit(form.outPepoleYoyDo)}}%
</view>
</view>
<view class="line"></view>
<view class="rate_item">
<view class="rate_item_label">人数统计同比</view>
<view class="rate_item_input">
{{formatDigit(form.exitVehicleCountYoy)}}%
{{formatDigit(form.outPepoleMomDo)}}%
</view>
</view>
</view>
@ -198,7 +200,7 @@
<view class="form_item">
<view class="form_item_label">终到车次()</view>
<view class="form_item_input form_input">
<uni-easyinput @blur="calcYoyMom" @clear="calcYoyMom" v-model="form.bizRailwayDataSaveOrUpdateDTOList[railwayNameIndex].inboundRailwayDo" type="number"
<uni-easyinput @blur="calcYoyMom(railwayNameIndex)" @clear="calcYoyMom(railwayNameIndex)" v-model="form.bizRailwayDataSaveOrUpdateDTOList[railwayNameIndex].inboundRailwayDo" type="number"
placeholderStyle="color: #D4D4D4;font-size:28rpx;" placeholder="请输入" maxlength="20">
</uni-easyinput>
</view>
@ -226,7 +228,7 @@
<view class="form_item">
<view class="form_item_label">过路车次</view>
<view class="form_item_input form_input">
<uni-easyinput @blur="calcYoyMom" @clear="calcYoyMom" v-model="form.bizRailwayDataSaveOrUpdateDTOList[railwayNameIndex].inboundPassengersDo" type="number"
<uni-easyinput @blur="calcYoyMom(railwayNameIndex)" @clear="calcYoyMom(railwayNameIndex)" v-model="form.bizRailwayDataSaveOrUpdateDTOList[railwayNameIndex].inboundPassengersDo" type="number"
placeholderStyle="color: #D4D4D4;font-size:28rpx;" placeholder="请输入" maxlength="20">
</uni-easyinput>
</view>
@ -234,7 +236,7 @@
<view class="form_item">
<view class="form_item_label">人数()</view>
<view class="form_item_input form_input">
<uni-easyinput @blur="calcYoyMom" @clear="calcYoyMom" v-model="form.bizRailwayDataSaveOrUpdateDTOList[railwayNameIndex].inPepole" type="number"
<uni-easyinput @blur="calcYoyMom(railwayNameIndex)" @clear="calcYoyMom(railwayNameIndex)" v-model="form.bizRailwayDataSaveOrUpdateDTOList[railwayNameIndex].inPepole" type="number"
placeholderStyle="color: #D4D4D4;font-size:28rpx;" placeholder="请输入" maxlength="20">
</uni-easyinput>
</view>
@ -284,7 +286,7 @@
<view class="form_item">
<view class="form_item_label">始发车次()</view>
<view class="form_item_input form_input">
<uni-easyinput @blur="calcYoyMom" @clear="calcYoyMom" v-model="form.bizRailwayDataSaveOrUpdateDTOList[railwayNameIndex].outboundRailwayDo" type="number"
<uni-easyinput @blur="calcYoyMom(railwayNameIndex)" @clear="calcYoyMom(railwayNameIndex)" v-model="form.bizRailwayDataSaveOrUpdateDTOList[railwayNameIndex].outboundRailwayDo" type="number"
placeholderStyle="color: #D4D4D4;font-size:28rpx;" placeholder="请输入" maxlength="20">
</uni-easyinput>
</view>
@ -311,7 +313,7 @@
<view class="form_item">
<view class="form_item_label">过路车次</view>
<view class="form_item_input form_input">
<uni-easyinput @blur="calcYoyMom" @clear="calcYoyMom" v-model="form.bizRailwayDataSaveOrUpdateDTOList[railwayNameIndex].outboundPassengersDo" type="number"
<uni-easyinput @blur="calcYoyMom(railwayNameIndex)" @clear="calcYoyMom(railwayNameIndex)" v-model="form.bizRailwayDataSaveOrUpdateDTOList[railwayNameIndex].outboundPassengersDo" type="number"
placeholderStyle="color: #D4D4D4;font-size:28rpx;" placeholder="请输入" maxlength="20">
</uni-easyinput>
</view>
@ -319,7 +321,7 @@
<view class="form_item">
<view class="form_item_label">人数()</view>
<view class="form_item_input form_input">
<uni-easyinput @blur="calcYoyMom" @clear="calcYoyMom" v-model="form.bizRailwayDataSaveOrUpdateDTOList[railwayNameIndex].outPepole" type="number"
<uni-easyinput @blur="calcYoyMom(railwayNameIndex)" @clear="calcYoyMom(railwayNameIndex)" v-model="form.bizRailwayDataSaveOrUpdateDTOList[railwayNameIndex].outPepole" type="number"
placeholderStyle="color: #D4D4D4;font-size:28rpx;" placeholder="请输入" maxlength="20">
</uni-easyinput>
</view>
@ -378,7 +380,6 @@
"inRailwayYomDo": '',
"inboundPassengersDo": '',
"inboundRailwayDo": '',
"isHoliday": "",
"outMark": "",
"outPepole": '',
"outPepoleMomDo": '',
@ -387,8 +388,7 @@
"outRailwayYomDo": '',
"outboundPassengersDo": '',
"outboundRailwayDo": '',
"railwayName": "",
"bizRailwayDataSaveOrUpdateDTOList": [{
"bizRailwayRunDataSaveOrUpdateDTOList": [{
"inMark": "",
"inPepole": '',
"inPepoleMomDo": '',
@ -422,7 +422,11 @@
pageType: '',
btnText: '保存',
tabType: 1,
mobile: getApp().globalData.mobile
mobile: getApp().globalData.mobile,
yoySum: {
minusDaySummaryData: {},
minusYearSummaryData: {}
},//
}
},
onLoad(options) {
@ -432,7 +436,11 @@
let now = new Date();
this.form.statDate = getDateStr(now, -1); //
this.queryTime(); //
this.queryStation();
// this.queryStation();
} else if (options.item) {
this.btnText = '修改并保存';
let obj = JSON.parse(options.item);
this.queryDetail(obj.statDate, obj.statPeriod);
} else if (options.id) {
this.btnText = '修改并保存';
this.$request(getApp().globalData.baseUrl + '/api/biz/railwayRunData/find/' + options.id, {}, "GET").then(
@ -455,23 +463,85 @@
//
formatDigit(data) {
return !checkNotEmpty(data) ? '--' : (data+'').indexOf('.') > -1 && (data+'').substring((data+'').indexOf('.')).length > 2 ? data.toFixed(2) : data;
},
//
queryDetail(statDate,statPeriod) {
this.$request(getApp().globalData.baseUrl + '/api/biz/railwayRunData/getDataByTime?statDate=' + statDate + '&statPeriod=' + statPeriod, {}, "GET").then(
res => {
res.data.statDate = statDate;
res.data.statPeriod = statPeriod;
this.form = res.data;
this.form.bizRailwayRunDataSaveOrUpdateDTOList = this.form.bizRailwayRunDataVOList;
//
this.$request(getApp().globalData.baseUrl + '/api/biz/railwayRunData/getSummaryDataYoYAndMoM?statDate=' + statDate + '&statPeriod=' + statPeriod + '&_t=' + Date.parse(new Date()), {},
'GET')
.then(res2 => {
res2.data.minusDaySummaryData = res2.data.minusDaySummaryData ? res2.data.minusDaySummaryData : {};
res2.data.minusYearSummaryData = res2.data.minusYearSummaryData ? res2.data.minusYearSummaryData : {};
this.yoySum = res2.data;
})
if(this.pageType != 'add') {
this.queryTime(); //
}
this.queryStation();
});
},
//
queryYoyMom(index, railwayName) {
if (this.form.statDate == '' || this.form.statPeriod == '') {
return;
}
// let _date = getDateStr(new Date(this.form.statDate), -1);
this.$request(getApp().globalData.baseUrl + '/api/biz/railwayRunData/getYoYMoM?statDate=' + this.form
.statDate + '&statPeriod=' + this.form.statPeriod + '&railwayName=' + railwayName + '&_t=' + Date.parse(new Date()), {}, 'GET')
.then(res => {
this.yoyMom = res.data;
this.calcYoyMom(index); //
})
},
// queryYoyMom(index, railwayName) {
// if (this.form.statDate == '' || this.form.statPeriod == '') {
// return;
// }
// // let _date = getDateStr(new Date(this.form.statDate), -1);
// this.$request(getApp().globalData.baseUrl + '/api/biz/railwayRunData/getYoYMoM?statDate=' + this.form
// .statDate + '&statPeriod=' + this.form.statPeriod + '&railwayName=' + railwayName + '&_t=' + Date.parse(new Date()), {}, 'GET')
// .then(res => {
// this.yoyMom = res.data;
// this.calcYoyMom(index); //
// })
// },
//
calcYoyMom(index) {
console.log('同比环比计算')
console.log('同比环比计算');
//
let _inPeole = 0,_inboundPassengersDo = 0,_inboundRailwayDo = 0;
let _outPepole = 0,_outboundPassengersDo = 0,_outboundRailwayDo = 0;
this.form.bizRailwayRunDataVOList.map((item,index) => {
_inPeole = _inPeole + (checkNotEmpty(item.inPepole) ? parseInt(item.inPepole) : 0);
_inboundPassengersDo = _inboundPassengersDo + (checkNotEmpty(item.inboundPassengersDo) ? parseInt(item.inboundPassengersDo) : 0);
_inboundRailwayDo = _inboundRailwayDo + (checkNotEmpty(item.inboundRailwayDo) ? parseInt(item.inboundRailwayDo) : 0);
_outPepole = _outPepole + (checkNotEmpty(item.outPepole) ? parseInt(item.outPepole) : 0);
_outboundPassengersDo = _outboundPassengersDo + (checkNotEmpty(item.outboundPassengersDo) ? parseInt(item.outboundPassengersDo) : 0);
_outboundRailwayDo = _outboundRailwayDo + (checkNotEmpty(item.outboundRailwayDo) ? parseInt(item.outboundRailwayDo) : 0);
})
this.form.inPepole = _inPeole;
this.form.inPepoleYoyDo = this.$calcMom(this.form.inPepole, this.yoySum.minusDaySummaryData.inPepole);
this.form.inPepoleMomDo = this.$calcYoy(this.form.inPepole, this.yoySum.minusYearSummaryData.inPepole);
this.form.inboundPassengersDo = _inboundPassengersDo;
this.form.inboundRailwayDo = _inboundRailwayDo;
this.form.inRailwayYomDo = this.$calcMom(this.form.inboundRailwayDo, this.yoySum.minusDaySummaryData.inboundRailwayDo);
this.form.inRailwayMomDo = this.$calcYoy(this.form.inboundRailwayDo, this.yoySum.minusYearSummaryData.inboundRailwayDo);
this.form.outPepole = _outPepole;
this.form.outPepoleYoyDo = this.$calcMom(this.form.outPepole, this.yoySum.minusDaySummaryData.outPepole);
this.form.outPepoleMomDo = this.$calcYoy(this.form.outPepole, this.yoySum.minusYearSummaryData.outPepole);
this.form.outboundPassengersDo = _outboundPassengersDo;
this.form.outboundRailwayDo = _outboundRailwayDo;
this.form.outRailwayYomDo = this.$calcMom(this.form.outboundRailwayDo, this.yoySum.minusDaySummaryData.outboundRailwayDo);
this.form.outRailwayMomDo = this.$calcYoy(this.form.outboundRailwayDo, this.yoySum.minusYearSummaryData.outboundRailwayDo);
let railwayName = this.form.bizRailwayDataSaveOrUpdateDTOList[index].railwayName;
this.$request(getApp().globalData.baseUrl + '/api/biz/railwayRunData/getYoYMoM?statDate=' + this.form
.statDate + '&statPeriod=' + this.form.statPeriod + '&railwayName=' + railwayName + '&_t=' + Date.parse(new Date()), {}, 'GET')
.then(res => {
let yoyMom = res.data;
let obj = this.form.bizRailwayDataSaveOrUpdateDTOList[index];
this.form.bizRailwayDataSaveOrUpdateDTOList[index].inRailwayYomDo = this.$calcMom(obj.inboundRailwayDo,yoyMom.yesterdayData.inboundRailwayDo);
this.form.bizRailwayDataSaveOrUpdateDTOList[index].inPepoleYoyDo = this.$calcMom(obj.inPepole,yoyMom.yesterdayData.inPepole);
this.form.bizRailwayDataSaveOrUpdateDTOList[index].outRailwayYomDo = this.$calcMom(obj.outboundRailwayDo,yoyMom.yesterdayData.outboundRailwayDo);
this.form.bizRailwayDataSaveOrUpdateDTOList[index].outPepoleYoyDo = this.$calcMom(obj.outPepole,yoyMom.yesterdayData.outPepole);
this.form.bizRailwayDataSaveOrUpdateDTOList[index].inRailwayMomDo = this.$calcYoy(obj.inboundRailwayDo,yoyMom.lastYearData.inboundRailwayDo);
this.form.bizRailwayDataSaveOrUpdateDTOList[index].inPepoleMomDo = this.$calcYoy(obj.inPepole,yoyMom.lastYearData.inPepole);
this.form.bizRailwayDataSaveOrUpdateDTOList[index].outRailwayMomDo = this.$calcYoy(obj.outboundRailwayDo,yoyMom.lastYearData.outboundRailwayDo);
this.form.bizRailwayDataSaveOrUpdateDTOList[index].outPepoleMomDo = this.$calcYoy(obj.outPepole,yoyMom.lastYearData.outPepole);
})
// this.form.inRailwayYomDo = this.$calcMom(this.form.inboundRailwayDo,this.yoyMom.yesterdayData.inboundRailwayDo);
// this.form.inPepoleYoyDo = this.$calcMom(this.form.inPepole,this.yoyMom.yesterdayData.inPepole);
// this.form.outRailwayYomDo = this.$calcMom(this.form.outboundRailwayDo,this.yoyMom.yesterdayData.outboundRailwayDo);
@ -489,7 +559,7 @@
// this.queryYoyMom();
},
//
queryStation() {
queryStation(type) {
this.$request(getApp().globalData.baseUrl + '/api/biz/railwayRunData/getCurrentSite?_t=' + Date.parse(
new Date()), {}, 'GET').then(res => {
let arr = [];
@ -497,7 +567,7 @@
arr.push({railwayName: item, isFinish: false})
})
this.stationList = arr;
if (this.pageType == 'add') {
if (type == 'add') {
this.form.railwayName = arr[0].railwayName;
this.railwayNameIndex = 0;
this.form.bizRailwayDataSaveOrUpdateDTOList = [];
@ -558,24 +628,30 @@
}
})
}
// this.queryYoyMom();
this.form.bizRailwayDataSaveOrUpdateDTOList.map((item,index) => {
this.calcYoyMom(index);
});
})
},
//
changeRailway(e) {
this.railwayNameIndex = e.detail.value;
this.form.railwayName = this.stationList[e.detail.value].railwayName;
this.queryYoyMom();
// changeRailway(e) {
// this.railwayNameIndex = e.detail.value;
// this.form.railwayName = this.stationList[e.detail.value].railwayName;
// this.queryYoyMom();
},
// },
//
changeStatPeriod(e) {
this.index = e.detail.value;
this.form.statPeriod = this.array[e.detail.value].dictValue;
console.log('change 时段', this.form);
this.form.bizRailwayDataSaveOrUpdateDTOList.map((item,index) => {
this.queryYoyMom(index,item.railwayName);
})
console.log('change 时段', this.form);
if(this.pageType == 'add') {
this.queryDetail(this.form.statDate, this.form.statPeriod);
}else{
this.form.bizRailwayDataSaveOrUpdateDTOList.map((item,index) => {
this.calcYoyMom(index);
})
}
},
//
doCancel() {
@ -584,11 +660,17 @@
//
bindDateChange(e) {
this.form.statDate = e.detail.value;
this.queryYoyMom();
if(this.pageType == 'add') {
this.queryDetail(this.form.statDate, this.form.statPeriod);
}else{
this.form.bizRailwayDataSaveOrUpdateDTOList.map((item,index) => {
this.calcYoyMom(index);
})
}
},
//
queryTime() {
this.$request(getApp().globalData.baseUrl + '/api/dict/dictList?dictType=airport_time' + '&_t=' + Date
this.$request(getApp().globalData.baseUrl + '/api/dict/dictList?dictType=railway_time' + '&_t=' + Date
.parse(
new Date()), {}, 'GET').then(res => {
this.array = res.data;
@ -606,7 +688,8 @@
this.form.statPeriod = '03'; //0-24
let idx = this.array.findIndex(item => item.dictValue == '03');
this.index = idx > -1 ? idx : '';
}
}
this.queryDetail(this.form.statDate, this.form.statPeriod);
} else {
let idx = this.array.findIndex(item => item.dictValue == this.form.statPeriod);
this.index = idx > -1 ? idx : '';
@ -661,7 +744,7 @@
}
uni.showModal({
title: '提示',
content: this.form.id == undefined ? '您确认提交该条报送数据?' : '您确认将该条数据进行修改?',
content: this.pageType == 'add' ? '您确认提交该条报送数据?' : '您确认将该条数据进行修改?',
success: (res) => {
if (res.confirm) {
this.submitForm();

@ -1,10 +1,10 @@
<template>
<view class="page">
<view class="list_box" v-for="(item,index) in data" :key="index" @click="goPage('/pages/railway/railwayRunData/form?id='+item.id)">
<view class="list_box" v-for="(item,index) in data" :key="index" @click="goPage('/pages/railway/railwayRunData/form', item)">
<view class="list_top">
<view class="unit_tags">报送时间</view>
<view class="unit_name">{{item.statDate || ''}}<text
style="margin-left:16rpx;">{{item.statPeriodValue || ''}}</text>
style="margin-left:16rpx;">{{renderTime(item.statPeriod)}}</text>
</view>
</view>
<!-- <view class="unit_station">{{item.railwayName || ''}}</view> -->
@ -141,9 +141,14 @@
closeSearch() {
this.$refs.popup.close();
},
//
renderTime(reportPhase) {
let idx = this.array.findIndex(item => item.dictValue == reportPhase);
return idx > -1 ? this.array[idx].dictLabel : '';
},
//
queryTime() {
this.$request(getApp().globalData.baseUrl + '/api/dict/dictList?dictType=airport_time' + '&_t=' + Date.parse(
this.$request(getApp().globalData.baseUrl + '/api/dict/dictList?dictType=railway_time' + '&_t=' + Date.parse(
new Date()), {}, 'GET').then(res => {
this.array = res.data;
})
@ -156,7 +161,7 @@
Object.keys(this.query).map(key => {
params = params + '&' + key + '=' + this.query[key]
})
this.$request(getApp().globalData.baseUrl + '/api/biz/railwayRunData/list?page=' + this.current +
this.$request(getApp().globalData.baseUrl + '/api/biz/railwayRunData/getTimeList?page=' + this.current +
'&pageSize=' + this.size + '&_t=' + Date.parse(new Date()) + params, {}, 'GET').then(res => {
if (res.code == 200) {
this.data = this.data.concat(res.data.list);

Loading…
Cancel
Save