默认统计时段规则修改

main
张群 2 years ago
parent 730eacab66
commit 0d16b31c9a
  1. 23
      pages/highWay/runData/form.vue
  2. 92
      pages/highWay/runStatusData/form.vue
  3. 154
      pages/railway/railwayRunData/form.vue
  4. 21
      pages/railway/runStatus/form.vue

@ -206,20 +206,15 @@
userInfo: {}, userInfo: {},
yoyMom: {},// yoyMom: {},//
showStaion: false,// showStaion: false,//
pageType: '',
} }
}, },
onLoad(options) { onLoad(options) {
this.userInfo = uni.getStorageSync('userInfo'); this.userInfo = uni.getStorageSync('userInfo');
if (options.type == 'add') { if (options.type == 'add') {
this.pageType = 'add';
let now = new Date(); let now = new Date();
this.form.statDate = getDateStr(now, -1);// this.form.statDate = getDateStr(now, -1);//
//11:00-13:30 0-12
let dateStr = getDateStr(now, 0);
if(new Date(dateStr + ' 11:00').getTime() < new Date().getTime() < new Date(dateStr + ' 13:30').getTime()) {
this.form.statPeriod = '0012';
}else{
this.form.statPeriod = '03'; //0-24
}
this.queryYoYMom(); this.queryYoYMom();
this.queryStation('add'); this.queryStation('add');
} else if (options.item) { } else if (options.item) {
@ -400,6 +395,20 @@
this.$request(getApp().globalData.baseUrl + '/api/dict/dictList?dictType=airport_time' + '&_t=' + Date.parse( this.$request(getApp().globalData.baseUrl + '/api/dict/dictList?dictType=airport_time' + '&_t=' + Date.parse(
new Date()), {}, 'GET').then(res => { new Date()), {}, 'GET').then(res => {
this.array = res.data; this.array = res.data;
if(this.pageType == 'add') {
let now = new Date();
//11:00-13:30 0-12
let dateStr = getDateStr(now, 0);
if(new Date(dateStr + ' 11:00').getTime() < new Date().getTime() < new Date(dateStr + ' 13:30').getTime()) {
this.form.statPeriod = '0012';
this.index = this.array.findIndex(item => item.dictValue == '0012');
}else{
this.form.statPeriod = '03'; //0-24
this.index = this.array.findIndex(item => item.dictValue == '03');
}
}else{
this.index = this.array.findIndex(item => item.dictValue == this.form.statPeriod);
}
}) })
}, },
// //

@ -45,15 +45,15 @@
<view class="form_item"> <view class="form_item">
<view class="form_item_label">已处理事故数量</view> <view class="form_item_label">已处理事故数量</view>
<view class="form_item_input form_input"> <view class="form_item_input form_input">
<uni-easyinput v-model="form.count1" placeholderStyle="color: #D4D4D4;font-size:28rpx;" placeholder="请输入" <uni-easyinput v-model="form.count1" placeholderStyle="color: #D4D4D4;font-size:28rpx;"
type="number" maxlength="30"></uni-easyinput> placeholder="请输入" type="number" maxlength="30"></uni-easyinput>
</view> </view>
</view> </view>
<view class="form_item"> <view class="form_item">
<view class="form_item_label">正在处理事故数量</view> <view class="form_item_label">正在处理事故数量</view>
<view class="form_item_input form_input"> <view class="form_item_input form_input">
<uni-easyinput v-model="form.count2" placeholderStyle="color: #D4D4D4;font-size:28rpx;" placeholder="请输入" <uni-easyinput v-model="form.count2" placeholderStyle="color: #D4D4D4;font-size:28rpx;"
type="number" maxlength="30"></uni-easyinput> placeholder="请输入" type="number" maxlength="30"></uni-easyinput>
</view> </view>
</view> </view>
<view class="form_item"> <view class="form_item">
@ -92,14 +92,16 @@
<!-- 拥堵 --> <!-- 拥堵 -->
<view class="form_item_li" v-if="tabType == 1" v-for="(item,index) in form.highwayCongestionDetailDTOS" <view class="form_item_li" v-if="tabType == 1" v-for="(item,index) in form.highwayCongestionDetailDTOS"
:key="index"> :key="index">
<view class="form_item" style="display:flex; justify-content: space-between; font-size: 30rpx;color:#333;font-weight: bold;margin-top: 30rpx;"> <view class="form_item"
style="display:flex; justify-content: space-between; font-size: 30rpx;color:#333;font-weight: bold;margin-top: 30rpx;">
拥堵信息-{{index+1}} 拥堵信息-{{index+1}}
<uni-icons type="trash" color="red" @click="delRow(index)" size="18"></uni-icons> <uni-icons type="trash" color="red" @click="delRow(index)" size="18"></uni-icons>
</view> </view>
<view class="form_item"> <view class="form_item">
<view class="form_item_label">高速公路名称</view> <view class="form_item_label">高速公路名称</view>
<view class="form_item_input picker"> <view class="form_item_input picker">
<picker :value="item.highwayNameIndex" :range="highwayDataList" range-key="stdName" @change="e => changeHighway(e, 'highwayCongestionDetailDTOS', index)"> <picker :value="item.highwayNameIndex" :range="highwayDataList" range-key="stdName"
@change="e => changeHighway(e, 'highwayCongestionDetailDTOS', index)">
<text class="picker_select" <text class="picker_select"
:style="item.highwayName?'color:#333;':''">{{item.highwayName ? item.highwayName : '请选择'}}</text> :style="item.highwayName?'color:#333;':''">{{item.highwayName ? item.highwayName : '请选择'}}</text>
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons> <uni-icons type="right" size="16" color="#D4D4D4"></uni-icons>
@ -136,8 +138,9 @@
<view class="form_item"> <view class="form_item">
<view class="form_item_label">拥堵内容</view> <view class="form_item_label">拥堵内容</view>
<view class="form_item_input form_input"> <view class="form_item_input form_input">
<uni-easyinput v-model="item.congestionContent" placeholderStyle="color: #D4D4D4;font-size:28rpx;" <uni-easyinput v-model="item.congestionContent"
placeholder="请输入" maxlength="200"></uni-easyinput> placeholderStyle="color: #D4D4D4;font-size:28rpx;" placeholder="请输入" maxlength="200">
</uni-easyinput>
</view> </view>
</view> </view>
<view class="form_item"> <view class="form_item">
@ -172,15 +175,18 @@
</view> </view>
<!-- 事故 --> <!-- 事故 -->
<view class="form_item_li" v-if="tabType == 2" v-for="(item,index) in form.highwayAccidentDetailDTOS" :key="index"> <view class="form_item_li" v-if="tabType == 2" v-for="(item,index) in form.highwayAccidentDetailDTOS"
<view class="form_item" style="display:flex; justify-content: space-between;font-size: 30rpx;color:#333;font-weight: bold;margin-top: 30rpx;"> :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}} 事故信息-{{index+1}}
<uni-icons type="trash" color="red" @click="delRow(index)" size="18"></uni-icons> <uni-icons type="trash" color="red" @click="delRow(index)" size="18"></uni-icons>
</view> </view>
<view class="form_item"> <view class="form_item">
<view class="form_item_label">高速公路名称</view> <view class="form_item_label">高速公路名称</view>
<view class="form_item_input picker"> <view class="form_item_input picker">
<picker :value="item.highwayNameIndex" :range="highwayDataList" range-key="stdName" @change="e => changeHighway(e, 'highwayCongestionDetailDTOS', index)"> <picker :value="item.highwayNameIndex" :range="highwayDataList" range-key="stdName"
@change="e => changeHighway(e, 'highwayCongestionDetailDTOS', index)">
<text class="picker_select" <text class="picker_select"
:style="item.highwayName?'color:#333;':''">{{item.highwayName ? item.highwayName : '请选择'}}</text> :style="item.highwayName?'color:#333;':''">{{item.highwayName ? item.highwayName : '请选择'}}</text>
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons> <uni-icons type="right" size="16" color="#D4D4D4"></uni-icons>
@ -217,14 +223,16 @@
<view class="form_item"> <view class="form_item">
<view class="form_item_label">事故内容</view> <view class="form_item_label">事故内容</view>
<view class="form_item_input form_input"> <view class="form_item_input form_input">
<uni-easyinput v-model="item.congestionContent" placeholderStyle="color: #D4D4D4;font-size:28rpx;" <uni-easyinput v-model="item.congestionContent"
placeholder="请输入" maxlength="200"></uni-easyinput> placeholderStyle="color: #D4D4D4;font-size:28rpx;" placeholder="请输入" maxlength="200">
</uni-easyinput>
</view> </view>
</view> </view>
<view class="form_item"> <view class="form_item">
<view class="form_item_label">事故等级</view> <view class="form_item_label">事故等级</view>
<view class="form_item_input picker"> <view class="form_item_input picker">
<picker :value="item.accidentLevelIndex" :range="accidentLevel" range-key="stdName" @change="e => changeAccidentLevel(e, 'highwayCongestionDetailDTOS', index)"> <picker :value="item.accidentLevelIndex" :range="accidentLevel" range-key="stdName"
@change="e => changeAccidentLevel(e, 'highwayCongestionDetailDTOS', index)">
<text class="picker_select" <text class="picker_select"
:style="item.accidentLevel?'color:#333;':''">{{item.accidentLevel ? item.accidentLevel : '请选择'}}</text> :style="item.accidentLevel?'color:#333;':''">{{item.accidentLevel ? item.accidentLevel : '请选择'}}</text>
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons> <uni-icons type="right" size="16" color="#D4D4D4"></uni-icons>
@ -318,26 +326,27 @@
submitPersonIndex: -1, // submitPersonIndex: -1, //
array: [], // array: [], //
index: 2, //,0-24 index: 2, //,0-24
isOpenArry: [{value:1,label:'开放'},{value:0,label:'关闭'}],// isOpenArry: [{
value: 1,
label: '开放'
}, {
value: 0,
label: '关闭'
}], //
isOpenIndex: 0, isOpenIndex: 0,
userInfo: {}, userInfo: {},
tabType: 1, // tabType: 1, //
accidentLevel: [], // accidentLevel: [], //
pageType: ''
} }
}, },
onLoad(options) { onLoad(options) {
this.userInfo = uni.getStorageSync('userInfo'); this.userInfo = uni.getStorageSync('userInfo');
this.queryHighway(); // this.queryHighway(); //
if (options.type == 'add') { if (options.type == 'add') {
this.pageType = 'add';
let now = new Date(); let now = new Date();
this.form.statDate = getDateStr(now, -1); // this.form.statDate = getDateStr(now, -1); //
//11:00-13:30 0-12
let dateStr = getDateStr(now, 0);
if(new Date(dateStr + ' 11:00').getTime() < new Date().getTime() < new Date(dateStr + ' 13:30').getTime()) {
this.form.statPeriod = '0012';
}else{
this.form.statPeriod = '03'; //0-24
}
} else if (options.item) { } else if (options.item) {
this.form = JSON.parse(options.item); this.form = JSON.parse(options.item);
this.form.highwayCongestionDetailDTOS = this.form.highwayCongestionDetailVOS; this.form.highwayCongestionDetailDTOS = this.form.highwayCongestionDetailVOS;
@ -352,7 +361,8 @@
methods: { methods: {
//id //id
queryDetailInfo(id) { queryDetailInfo(id) {
this.$request(getApp().globalData.baseUrl + '/api/biz/highSpeedOperationController/selectById/' + id, {}, 'GET').then(res => { this.$request(getApp().globalData.baseUrl + '/api/biz/highSpeedOperationController/selectById/' + id, {},
'GET').then(res => {
this.form = res.data; this.form = res.data;
this.form.highwayCongestionDetailDTOS = this.form.highwayCongestionDetailVOS; this.form.highwayCongestionDetailDTOS = this.form.highwayCongestionDetailVOS;
this.form.highwayAccidentDetailDTOS = this.form.highwayAccidentDetailVOS; this.form.highwayAccidentDetailDTOS = this.form.highwayAccidentDetailVOS;
@ -360,7 +370,8 @@
}, },
// //
queryHighway() { queryHighway() {
this.$request(getApp().globalData.baseUrl + '/api/biz/roadInfo/all?page=0&pageSize=0&_t=' + Date.parse(new Date()), {}, 'GET').then(res => { this.$request(getApp().globalData.baseUrl + '/api/biz/roadInfo/all?page=0&pageSize=0&_t=' + Date.parse(
new Date()), {}, 'GET').then(res => {
this.highwayDataList = res.data; this.highwayDataList = res.data;
}) })
}, },
@ -396,14 +407,31 @@
}, },
// //
queryTime() { queryTime() {
this.$request(getApp().globalData.baseUrl + '/api/dict/dictList?dictType=airport_time' + '&_t=' + Date.parse( this.$request(getApp().globalData.baseUrl + '/api/dict/dictList?dictType=airport_time' + '&_t=' + Date
.parse(
new Date()), {}, 'GET').then(res => { new Date()), {}, 'GET').then(res => {
this.array = res.data; this.array = res.data;
if (this.pageType == 'add') {
let now = new Date();
//11:00-13:30 0-12
let dateStr = getDateStr(now, 0);
if (new Date(dateStr + ' 11:00').getTime() < new Date().getTime() < new Date(dateStr +
' 13:30').getTime()) {
this.form.statPeriod = '0012';
this.index = this.array.findIndex(item => item.dictValue == '0012');
} else {
this.form.statPeriod = '03'; //0-24
this.index = this.array.findIndex(item => item.dictValue == '03');
}
}else{
this.index = this.array.findIndex(item => item.dictValue == this.form.statPeriod);
}
}) })
}, },
// //
queryAccidentLevel() { queryAccidentLevel() {
this.$request(getApp().globalData.baseUrl + '/api/dict/listDictData?dictType=accident_level' + '&_t=' + Date.parse( this.$request(getApp().globalData.baseUrl + '/api/dict/listDictData?dictType=accident_level' + '&_t=' +
Date.parse(
new Date()), {}, 'GET').then(res => { new Date()), {}, 'GET').then(res => {
this.accidentLevel = res.data; this.accidentLevel = res.data;
}) })
@ -467,10 +495,12 @@
return; return;
} }
let checkCongestion = this.form.highwayCongestionDetailDTOS.every(item => { let checkCongestion = this.form.highwayCongestionDetailDTOS.every(item => {
return !item.highwayName || !item.congestionStartTime || !item.congestionEndTime || !item.duration || !item.location return !item.highwayName || !item.congestionStartTime || !item.congestionEndTime || !item
.duration || !item.location
}) })
let checkAccident = this.form.highwayAccidentDetailDTOS.every(item => { let checkAccident = this.form.highwayAccidentDetailDTOS.every(item => {
return !item.highwayName || !item.accidentStartTime || !item.accidentEndTime || !item.duration || !item.location return !item.highwayName || !item.accidentStartTime || !item.accidentEndTime || !item
.duration || !item.location
}) })
if (this.form.highwayCongestionDetailDTOS.length > 0 && checkCongestion) { if (this.form.highwayCongestionDetailDTOS.length > 0 && checkCongestion) {
uni.showToast({ uni.showToast({
@ -501,7 +531,8 @@
title: '提交中...', title: '提交中...',
mask: true mask: true
}) })
this.$request(getApp().globalData.baseUrl + '/api/biz/highSpeedOperationController/saveOrUpdate', this.form, this.$request(getApp().globalData.baseUrl + '/api/biz/highSpeedOperationController/saveOrUpdate', this
.form,
'POST').then(res => { 'POST').then(res => {
uni.hideLoading(); uni.hideLoading();
if (res.code == 200) { if (res.code == 200) {
@ -629,6 +660,7 @@
flex: 1; flex: 1;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
/deep/ picker { /deep/ picker {
flex: 1; flex: 1;
} }
@ -661,8 +693,10 @@
text-align: right; text-align: right;
} }
} }
/deep/ .uni-date-x--border { /deep/ .uni-date-x--border {
border: 0 !important; border: 0 !important;
.uni-date__x-input { .uni-date__x-input {
// height: 35rpx !important; // height: 35rpx !important;
text-align: right; text-align: right;

@ -40,28 +40,35 @@
<view class="form_item_box" style="margin-top: 30rpx;"> <view class="form_item_box" style="margin-top: 30rpx;">
<!-- 入青 --> <!-- 入青 -->
<view class="form_item_li"> <view class="form_item_li">
<view class="form_item" style="display:flex; justify-content: space-between; font-size: 30rpx;color:#333;font-weight: bold;margin-top: 30rpx;"> <view class="form_item"
style="display:flex; justify-content: space-between; font-size: 30rpx;color:#333;font-weight: bold;margin-top: 30rpx;">
进青岛车次信息 进青岛车次信息
</view> </view>
<view class="form_item"> <view class="form_item">
<view class="form_item_label">终到车次()</view> <view class="form_item_label">终到车次()</view>
<view class="form_item_input form_input"> <view class="form_item_input form_input">
<uni-easyinput @blur="calcYoyMom" v-model="form.inboundRailwayDo" type="number" placeholderStyle="color: #D4D4D4;font-size:28rpx;" <uni-easyinput @blur="calcYoyMom" v-model="form.inboundRailwayDo" type="number"
placeholder="请输入" maxlength="20"></uni-easyinput> placeholderStyle="color: #D4D4D4;font-size:28rpx;" placeholder="请输入" maxlength="20">
</uni-easyinput>
</view> </view>
</view> </view>
<view class="form_item"> <view class="form_item">
<view class="form_item_label">过路车次</view> <view class="form_item_label">过路车次</view>
<view class="form_item_input form_input"> <view class="form_item_input form_input">
<uni-easyinput @blur="calcYoyMom" v-model="form.inboundPassengersDo" type="number" placeholderStyle="color: #D4D4D4;font-size:28rpx;" <uni-easyinput @blur="calcYoyMom" v-model="form.inboundPassengersDo" type="number"
placeholder="请输入" maxlength="20"></uni-easyinput> placeholderStyle="color: #D4D4D4;font-size:28rpx;" placeholder="请输入" maxlength="20">
</uni-easyinput>
</view> </view>
</view> </view>
<!-- 同比环比 --> <!-- 同比环比 -->
<view class="form_item_rate" v-if="form.inRailwayYomDo || form.inRailwayMomDo" :class="form.inboundRailwayDo == yoyMom.yesterdayData.inboundRailwayDo ? 'danger' : '' "> <view class="form_item_rate" v-if="form.inRailwayYomDo || form.inRailwayMomDo"
:class="form.inboundRailwayDo == yoyMom.yesterdayData.inboundRailwayDo ? 'danger' : '' ">
<view class="rate_item"> <view class="rate_item">
<view class="rate_item_label" :style="form.inboundRailwayDo == yoyMom.yesterdayData.inboundRailwayDo ? 'color: #EB4747' : ''">终到车次环比(%)</view> <view class="rate_item_label"
<view class="rate_item_input" :style="form.inboundRailwayDo == yoyMom.yesterdayData.inboundRailwayDo ? 'color: #EB4747' : ''"> :style="form.inboundRailwayDo == yoyMom.yesterdayData.inboundRailwayDo ? 'color: #EB4747' : ''">
终到车次环比(%)</view>
<view class="rate_item_input"
:style="form.inboundRailwayDo == yoyMom.yesterdayData.inboundRailwayDo ? 'color: #EB4747' : ''">
{{form.inRailwayYomDo ? form.inRailwayYomDo.toFixed(2) : ''}} {{form.inRailwayYomDo ? form.inRailwayYomDo.toFixed(2) : ''}}
</view> </view>
</view> </view>
@ -76,15 +83,20 @@
<view class="form_item"> <view class="form_item">
<view class="form_item_label">人数()</view> <view class="form_item_label">人数()</view>
<view class="form_item_input form_input"> <view class="form_item_input form_input">
<uni-easyinput @blur="calcYoyMom" v-model="form.inPepole" type="number" placeholderStyle="color: #D4D4D4;font-size:28rpx;" <uni-easyinput @blur="calcYoyMom" v-model="form.inPepole" type="number"
placeholder="请输入" maxlength="20"></uni-easyinput> placeholderStyle="color: #D4D4D4;font-size:28rpx;" placeholder="请输入" maxlength="20">
</uni-easyinput>
</view> </view>
</view> </view>
<!-- 同比环比 --> <!-- 同比环比 -->
<view class="form_item_rate" v-if="form.inPepoleYoyDo || form.inPepoleMomDo" :class="form.inPepole == yoyMom.yesterdayData.inPepole ? 'danger' : '' "> <view class="form_item_rate" v-if="form.inPepoleYoyDo || form.inPepoleMomDo"
:class="form.inPepole == yoyMom.yesterdayData.inPepole ? 'danger' : '' ">
<view class="rate_item"> <view class="rate_item">
<view class="rate_item_label" :style="form.inPepole == yoyMom.yesterdayData.inPepole ? 'color: #EB4747' : ''">人数环比(%)</view> <view class="rate_item_label"
<view class="rate_item_input" :style="form.inPepole == yoyMom.yesterdayData.inPepole ? 'color: #EB4747' : ''"> :style="form.inPepole == yoyMom.yesterdayData.inPepole ? 'color: #EB4747' : ''">人数环比(%)
</view>
<view class="rate_item_input"
:style="form.inPepole == yoyMom.yesterdayData.inPepole ? 'color: #EB4747' : ''">
{{form.inPepoleYoyDo ? form.inPepoleYoyDo.toFixed(2) : ''}} {{form.inPepoleYoyDo ? form.inPepoleYoyDo.toFixed(2) : ''}}
</view> </view>
</view> </view>
@ -107,28 +119,35 @@
<!-- 出青 --> <!-- 出青 -->
<view class="form_item_li"> <view class="form_item_li">
<view class="form_item" style="display:flex; justify-content: space-between; font-size: 30rpx;color:#333;font-weight: bold;margin-top: 30rpx;"> <view class="form_item"
style="display:flex; justify-content: space-between; font-size: 30rpx;color:#333;font-weight: bold;margin-top: 30rpx;">
出青岛车次信息 出青岛车次信息
</view> </view>
<view class="form_item"> <view class="form_item">
<view class="form_item_label">始发车次()</view> <view class="form_item_label">始发车次()</view>
<view class="form_item_input form_input"> <view class="form_item_input form_input">
<uni-easyinput @blur="calcYoyMom" v-model="form.outboundRailwayDo" type="number" placeholderStyle="color: #D4D4D4;font-size:28rpx;" <uni-easyinput @blur="calcYoyMom" v-model="form.outboundRailwayDo" type="number"
placeholder="请输入" maxlength="20"></uni-easyinput> placeholderStyle="color: #D4D4D4;font-size:28rpx;" placeholder="请输入" maxlength="20">
</uni-easyinput>
</view> </view>
</view> </view>
<view class="form_item"> <view class="form_item">
<view class="form_item_label">过路车次</view> <view class="form_item_label">过路车次</view>
<view class="form_item_input form_input"> <view class="form_item_input form_input">
<uni-easyinput @blur="calcYoyMom" v-model="form.outboundPassengersDo" type="number" placeholderStyle="color: #D4D4D4;font-size:28rpx;" <uni-easyinput @blur="calcYoyMom" v-model="form.outboundPassengersDo" type="number"
placeholder="请输入" maxlength="20"></uni-easyinput> placeholderStyle="color: #D4D4D4;font-size:28rpx;" placeholder="请输入" maxlength="20">
</uni-easyinput>
</view> </view>
</view> </view>
<!-- 同比环比 --> <!-- 同比环比 -->
<view class="form_item_rate" v-if="form.outRailwayYomDo || form.outRailwayMomDo" :class="form.outboundRailwayDo == yoyMom.yesterdayData.outboundRailwayDo ? 'danger' : '' "> <view class="form_item_rate" v-if="form.outRailwayYomDo || form.outRailwayMomDo"
:class="form.outboundRailwayDo == yoyMom.yesterdayData.outboundRailwayDo ? 'danger' : '' ">
<view class="rate_item"> <view class="rate_item">
<view class="rate_item_label" :style="form.outboundRailwayDo == yoyMom.yesterdayData.outboundRailwayDo ? 'color: #EB4747' : ''">始发车次环比(%)</view> <view class="rate_item_label"
<view class="rate_item_input" :style="form.outboundRailwayDo == yoyMom.yesterdayData.outboundRailwayDo ? 'color: #EB4747' : ''"> :style="form.outboundRailwayDo == yoyMom.yesterdayData.outboundRailwayDo ? 'color: #EB4747' : ''">
始发车次环比(%)</view>
<view class="rate_item_input"
:style="form.outboundRailwayDo == yoyMom.yesterdayData.outboundRailwayDo ? 'color: #EB4747' : ''">
{{form.outRailwayYomDo ? form.outRailwayYomDo.toFixed(2) : ''}} {{form.outRailwayYomDo ? form.outRailwayYomDo.toFixed(2) : ''}}
</view> </view>
</view> </view>
@ -143,15 +162,20 @@
<view class="form_item"> <view class="form_item">
<view class="form_item_label">人数()</view> <view class="form_item_label">人数()</view>
<view class="form_item_input form_input"> <view class="form_item_input form_input">
<uni-easyinput @blur="calcYoyMom" v-model="form.outPepole" type="number" placeholderStyle="color: #D4D4D4;font-size:28rpx;" <uni-easyinput @blur="calcYoyMom" v-model="form.outPepole" type="number"
placeholder="请输入" maxlength="20"></uni-easyinput> placeholderStyle="color: #D4D4D4;font-size:28rpx;" placeholder="请输入" maxlength="20">
</uni-easyinput>
</view> </view>
</view> </view>
<!-- 同比环比 --> <!-- 同比环比 -->
<view class="form_item_rate" v-if="form.outPepoleYoyDo || form.outPepoleMomDo" :class="form.outPepole == yoyMom.yesterdayData.outPeople ? 'danger' : '' "> <view class="form_item_rate" v-if="form.outPepoleYoyDo || form.outPepoleMomDo"
:class="form.outPepole == yoyMom.yesterdayData.outPeople ? 'danger' : '' ">
<view class="rate_item"> <view class="rate_item">
<view class="rate_item_label" :style="form.outPepole == yoyMom.yesterdayData.outPeople ? 'color: #EB4747' : ''">人数环比(%)</view> <view class="rate_item_label"
<view class="rate_item_input" :style="form.outPepole == yoyMom.yesterdayData.outPeople ? 'color: #EB4747' : ''"> :style="form.outPepole == yoyMom.yesterdayData.outPeople ? 'color: #EB4747' : ''">人数环比(%)
</view>
<view class="rate_item_input"
:style="form.outPepole == yoyMom.yesterdayData.outPeople ? 'color: #EB4747' : ''">
{{form.outPepoleYoyDo ? form.outPepoleYoyDo.toFixed(2) : ''}} {{form.outPepoleYoyDo ? form.outPepoleYoyDo.toFixed(2) : ''}}
</view> </view>
</view> </view>
@ -182,7 +206,8 @@
</template> </template>
<script> <script>
import { import {
getDateStr, checkNotEmpty getDateStr,
checkNotEmpty
} from "../../../common/util.js" } from "../../../common/util.js"
export default { export default {
data() { data() {
@ -226,16 +251,10 @@
this.pageType = 'add'; this.pageType = 'add';
let now = new Date(); let now = new Date();
this.form.statDate = getDateStr(now, -1); // this.form.statDate = getDateStr(now, -1); //
//11:00-13:30 0-12
let dateStr = getDateStr(now, 0);
if(new Date(dateStr + ' 11:00').getTime() < new Date().getTime() < new Date(dateStr + ' 13:30').getTime()) {
this.form.statPeriod = '0012';
}else{
this.form.statPeriod = '03'; //0-24
}
this.queryYoyMom(); // this.queryYoyMom(); //
} else if (options.id) { } else if (options.id) {
this.$request(getApp().globalData.baseUrl+'/api/biz/railwayRunData/find/'+options.id,{},"GET").then(res => { this.$request(getApp().globalData.baseUrl + '/api/biz/railwayRunData/find/' + options.id, {}, "GET").then(
res => {
this.form = res.data; this.form = res.data;
this.queryYoyMom(); this.queryYoyMom();
}); });
@ -249,7 +268,9 @@
return; return;
} }
// let _date = getDateStr(new Date(this.form.statDate), -1); // 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+'&_t=' + Date.parse(new Date()), {} , 'GET').then(res => { this.$request(getApp().globalData.baseUrl + '/api/biz/railwayRunData/getYoYMoM?statDate=' + this.form
.statDate + '&statPeriod=' + this.form.statPeriod + '&_t=' + Date.parse(new Date()), {}, 'GET')
.then(res => {
this.yoyMom = res.data; this.yoyMom = res.data;
this.calcYoyMom(); // this.calcYoyMom(); //
}) })
@ -259,22 +280,38 @@
console.log('同比环比计算') console.log('同比环比计算')
if (this.yoyMom.yesterdayData) { if (this.yoyMom.yesterdayData) {
// //
this.form.inRailwayYomDo = this.yoyMom.yesterdayData.inboundRailwayDo && this.form.inboundRailwayDo ? (parseInt(this.form.inboundRailwayDo) - this.yoyMom.yesterdayData.inboundRailwayDo) / this.yoyMom.yesterdayData.inboundRailwayDo * 100 : ''; this.form.inRailwayYomDo = this.yoyMom.yesterdayData.inboundRailwayDo && this.form.inboundRailwayDo ? (
this.form.inPepoleYoyDo = this.yoyMom.yesterdayData.inPepole && this.form.inPepole ? (parseInt(this.form.inPepole) - this.yoyMom.yesterdayData.inPepole) / this.yoyMom.yesterdayData.inPepole * 100 : ''; parseInt(this.form.inboundRailwayDo) - this.yoyMom.yesterdayData.inboundRailwayDo) / this
this.form.outRailwayYomDo = this.yoyMom.yesterdayData.outboundRailwayDo && this.form.outboundRailwayDo ? (parseInt(this.form.outboundRailwayDo) - this.yoyMom.yesterdayData.outboundRailwayDo) / this.yoyMom.yesterdayData.outboundRailwayDo * 100 : ''; .yoyMom.yesterdayData.inboundRailwayDo * 100 : '';
this.form.outPepoleYoyDo = this.yoyMom.yesterdayData.outPepole && this.form.outPepole ? (parseInt(this.form.outPepole) - this.yoyMom.yesterdayData.outPepole) / this.yoyMom.yesterdayData.outPepole * 100 : ''; this.form.inPepoleYoyDo = this.yoyMom.yesterdayData.inPepole && this.form.inPepole ? (parseInt(this
.form.inPepole) - this.yoyMom.yesterdayData.inPepole) / this.yoyMom.yesterdayData.inPepole *
100 : '';
this.form.outRailwayYomDo = this.yoyMom.yesterdayData.outboundRailwayDo && this.form
.outboundRailwayDo ? (parseInt(this.form.outboundRailwayDo) - this.yoyMom.yesterdayData
.outboundRailwayDo) / this.yoyMom.yesterdayData.outboundRailwayDo * 100 : '';
this.form.outPepoleYoyDo = this.yoyMom.yesterdayData.outPepole && this.form.outPepole ? (parseInt(this
.form.outPepole) - this.yoyMom.yesterdayData.outPepole) / this.yoyMom.yesterdayData.outPepole *
100 : '';
} }
if (this.yoyMom.lastYearData) { if (this.yoyMom.lastYearData) {
// //
this.form.inRailwayMomDo = this.yoyMom.lastYearData.inboundRailwayDo && this.form.inboundRailwayDo ? (parseInt(this.form.inboundRailwayDo) - this.yoyMom.lastYearData.inboundRailwayDo) / this.yoyMom.lastYearData.inboundRailwayDo * 100 : ''; this.form.inRailwayMomDo = this.yoyMom.lastYearData.inboundRailwayDo && this.form.inboundRailwayDo ? (
this.form.inPepoleMomDo = this.yoyMom.lastYearData.inPepole && this.form.inPepole ? (parseInt(this.form.inPepole) - this.yoyMom.lastYearData.inPepole) / this.yoyMom.lastYearData.inPepole * 100 : ''; parseInt(this.form.inboundRailwayDo) - this.yoyMom.lastYearData.inboundRailwayDo) / this.yoyMom
this.form.outRailwayMomDo = this.yoyMom.lastYearData.outboundRailwayDo && this.form.outboundRailwayDo ? (parseInt(this.form.outboundRailwayDo) - this.yoyMom.lastYearData.outboundRailwayDo) / this.yoyMom.lastYearData.outboundRailwayDo * 100 : ''; .lastYearData.inboundRailwayDo * 100 : '';
this.form.outPepoleMomDo = this.yoyMom.lastYearData.outPepole && this.form.outPepole ? (parseInt(this.form.outPepole) - this.yoyMom.lastYearData.outPepole) / this.yoyMom.lastYearData.outPepole * 100 : ''; this.form.inPepoleMomDo = this.yoyMom.lastYearData.inPepole && this.form.inPepole ? (parseInt(this.form
.inPepole) - this.yoyMom.lastYearData.inPepole) / this.yoyMom.lastYearData.inPepole * 100 : '';
this.form.outRailwayMomDo = this.yoyMom.lastYearData.outboundRailwayDo && this.form.outboundRailwayDo ?
(parseInt(this.form.outboundRailwayDo) - this.yoyMom.lastYearData.outboundRailwayDo) / this.yoyMom
.lastYearData.outboundRailwayDo * 100 : '';
this.form.outPepoleMomDo = this.yoyMom.lastYearData.outPepole && this.form.outPepole ? (parseInt(this
.form.outPepole) - this.yoyMom.lastYearData.outPepole) / this.yoyMom.lastYearData.outPepole *
100 : '';
} }
}, },
// //
queryStation() { queryStation() {
this.$request(getApp().globalData.baseUrl + '/api/biz/railwayRunData/getCurrentSite?_t=' + Date.parse(new Date()), {}, 'GET').then(res => { this.$request(getApp().globalData.baseUrl + '/api/biz/railwayRunData/getCurrentSite?_t=' + Date.parse(
new Date()), {}, 'GET').then(res => {
this.stationList = res.data; this.stationList = res.data;
if (this.pageType == 'add') { if (this.pageType == 'add') {
this.form.railwayName = res.data[0]; this.form.railwayName = res.data[0];
@ -305,9 +342,25 @@
}, },
// //
queryTime() { queryTime() {
this.$request(getApp().globalData.baseUrl + '/api/dict/dictList?dictType=airport_time' + '&_t=' + Date.parse( this.$request(getApp().globalData.baseUrl + '/api/dict/dictList?dictType=airport_time' + '&_t=' + Date
.parse(
new Date()), {}, 'GET').then(res => { new Date()), {}, 'GET').then(res => {
this.array = res.data; this.array = res.data;
if (this.pageType == 'add') {
let now = new Date();
//11:00-13:30 0-12
let dateStr = getDateStr(now, 0);
if (new Date(dateStr + ' 11:00').getTime() < new Date().getTime() < new Date(dateStr +
' 13:30').getTime()) {
this.form.statPeriod = '0012';
this.index = this.array.findIndex(item => item.dictValue == '0012');
} else {
this.form.statPeriod = '03'; //0-24
this.index = this.array.findIndex(item => item.dictValue == '03');
}
}else{
this.index = this.array.findIndex(item => item.dictValue == this.form.statPeriod);
}
}) })
}, },
// //
@ -326,14 +379,16 @@
}) })
return; return;
} }
if (!checkNotEmpty(this.form.inboundRailwayDo) || !checkNotEmpty(this.form.inboundPassengersDo) || !checkNotEmpty(this.form.inPepole)) { if (!checkNotEmpty(this.form.inboundRailwayDo) || !checkNotEmpty(this.form.inboundPassengersDo) || !
checkNotEmpty(this.form.inPepole)) {
uni.showToast({ uni.showToast({
title: '入青终到车次、过站车次、人数不能为空', title: '入青终到车次、过站车次、人数不能为空',
icon: 'none' icon: 'none'
}) })
return; return;
} }
if (!checkNotEmpty(this.form.outboundRailwayDo) || !checkNotEmpty(this.form.outboundPassengersDo) || !checkNotEmpty(this.form.outPepole)) { if (!checkNotEmpty(this.form.outboundRailwayDo) || !checkNotEmpty(this.form.outboundPassengersDo) || !
checkNotEmpty(this.form.outPepole)) {
uni.showToast({ uni.showToast({
title: '出青终到车次、过站车次、人数不能为空', title: '出青终到车次、过站车次、人数不能为空',
icon: 'none' icon: 'none'
@ -497,6 +552,7 @@
flex: 1; flex: 1;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
/deep/ picker { /deep/ picker {
flex: 1; flex: 1;
} }
@ -529,8 +585,10 @@
text-align: right; text-align: right;
} }
} }
/deep/ .uni-date-x--border { /deep/ .uni-date-x--border {
border: 0 !important; border: 0 !important;
.uni-date__x-input { .uni-date__x-input {
// height: 35rpx !important; // height: 35rpx !important;
text-align: right; text-align: right;

@ -98,13 +98,6 @@
this.pageType = 'add'; this.pageType = 'add';
let now = new Date(); let now = new Date();
this.form.statDate = getDateStr(now, -1); // this.form.statDate = getDateStr(now, -1); //
//11:00-13:30 0-12
let dateStr = getDateStr(now, 0);
if(new Date(dateStr + ' 11:00').getTime() < new Date().getTime() < new Date(dateStr + ' 13:30').getTime()) {
this.form.statPeriod = '0012';
}else{
this.form.statPeriod = '03'; //0-24
}
} else if (options.item) { } else if (options.item) {
this.form = JSON.parse(options.item); this.form = JSON.parse(options.item);
console.log(this.form); console.log(this.form);
@ -163,6 +156,20 @@
.parse( .parse(
new Date()), {}, 'GET').then(res => { new Date()), {}, 'GET').then(res => {
this.array = res.data; this.array = res.data;
if(this.pageType == 'add') {
let now = new Date();
//11:00-13:30 0-12
let dateStr = getDateStr(now, 0);
if(new Date(dateStr + ' 11:00').getTime() < new Date().getTime() < new Date(dateStr + ' 13:30').getTime()) {
this.form.statPeriod = '0012';
this.index = this.array.findIndex(item => item.dictValue == '0012');
}else{
this.form.statPeriod = '03'; //0-24
this.index = this.array.findIndex(item => item.dictValue == '03');
}
}else{
this.index = this.array.findIndex(item => item.dictValue == this.form.statPeriod);
}
}) })
}, },
// //

Loading…
Cancel
Save