|
|
|
|
@ -21,9 +21,9 @@ |
|
|
|
|
<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 mode="date" :value="form.reportDate" @change="bindDateChange"> |
|
|
|
|
<text class="picker_select" |
|
|
|
|
:style="form.statDate?'color:#333;':''">{{form.statDate?form.statDate:'请选择'}}</text> |
|
|
|
|
:style="form.reportDate?'color:#333;':''">{{form.reportDate?form.reportDate:'请选择'}}</text> |
|
|
|
|
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons> |
|
|
|
|
</picker> |
|
|
|
|
</view> |
|
|
|
|
@ -47,59 +47,59 @@ |
|
|
|
|
<view class="form_item"> |
|
|
|
|
<view class="form_item_label">车次:</view> |
|
|
|
|
<view class="form_item_input form_input"> |
|
|
|
|
<uni-easyinput @blur="calcMomYoy" @clear="calcMomYoy" type="number" v-model="form.trainNumber" placeholderStyle="color: #D4D4D4;font-size:28rpx;" |
|
|
|
|
<uni-easyinput @blur="calcMomYoy" @clear="calcMomYoy" type="number" v-model="form.carTimes" placeholderStyle="color: #D4D4D4;font-size:28rpx;" |
|
|
|
|
placeholder="请输入" maxlength="30"> |
|
|
|
|
</uni-easyinput> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
<!-- 同比环比 --> |
|
|
|
|
<view class="form_item_rate" :class="form.trainNumberDod === 0 ? 'danger' : '' "> |
|
|
|
|
<view class="form_item_rate" :class="form.carTimesMom === 0 ? 'danger' : '' "> |
|
|
|
|
<view class="rate_item"> |
|
|
|
|
<view class="rate_item_label" :style="form.trainNumberDod === 0 ? 'color: #EB4747' : ''"> |
|
|
|
|
<view class="rate_item_label" :style="form.carTimesMom === 0 ? 'color: #EB4747' : ''"> |
|
|
|
|
总车次环比</view> |
|
|
|
|
<view class="rate_item_input" :style="form.trainNumberDod === 0 ? 'color: #EB4747' : ''"> |
|
|
|
|
{{formatDigit(form.trainNumberDod)}}% |
|
|
|
|
<view class="rate_item_input" :style="form.carTimesMom === 0 ? 'color: #EB4747' : ''"> |
|
|
|
|
{{formatDigit(form.carTimesMom )}}% |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="line"></view> |
|
|
|
|
<view class="rate_item"> |
|
|
|
|
<view class="rate_item_label">总车次同比</view> |
|
|
|
|
<view class="rate_item_input"> |
|
|
|
|
{{formatDigit(form.trainNumberYoy)}}% |
|
|
|
|
{{formatDigit(form.carTimesYoy)}}% |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="form_item"> |
|
|
|
|
<view class="form_item_label">总客流量(人):</view> |
|
|
|
|
<view class="form_item_input form_input"> |
|
|
|
|
<uni-easyinput @blur="calcMomYoy" @clear="calcMomYoy" type="number" v-model="form.passengerFlow" placeholderStyle="color: #D4D4D4;font-size:28rpx;" |
|
|
|
|
<uni-easyinput @blur="calcMomYoy" @clear="calcMomYoy" type="number" v-model="form.operatingPassengerTimes" placeholderStyle="color: #D4D4D4;font-size:28rpx;" |
|
|
|
|
placeholder="请输入" maxlength="30"> |
|
|
|
|
</uni-easyinput> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
<!-- 同比环比 --> |
|
|
|
|
<view class="form_item_rate" :class="form.passengerFlowDod === 0 ? 'danger' : '' "> |
|
|
|
|
<view class="form_item_rate" :class="form.operatingPassengerTimesMom === 0 ? 'danger' : '' "> |
|
|
|
|
<view class="rate_item"> |
|
|
|
|
<view class="rate_item_label" :style="form.passengerFlowDod === 0 ? 'color: #EB4747' : ''"> |
|
|
|
|
<view class="rate_item_label" :style="form.operatingPassengerTimesMom === 0 ? 'color: #EB4747' : ''"> |
|
|
|
|
总客流量人数环比</view> |
|
|
|
|
<view class="rate_item_input" :style="form.passengerFlowDod === 0 ? 'color: #EB4747' : ''"> |
|
|
|
|
{{formatDigit(form.passengerFlowDod)}}% |
|
|
|
|
<view class="rate_item_input" :style="form.operatingPassengerTimesMom === 0 ? 'color: #EB4747' : ''"> |
|
|
|
|
{{formatDigit(form.operatingPassengerTimesMom)}}% |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="line"></view> |
|
|
|
|
<view class="rate_item"> |
|
|
|
|
<view class="rate_item_label">总客流量人数同比</view> |
|
|
|
|
<view class="rate_item_input"> |
|
|
|
|
{{formatDigit(form.passengerFlowYoy)}}% |
|
|
|
|
{{formatDigit(form.operatingPassengerTimesYoy)}}% |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="form_item_remark"> |
|
|
|
|
<view class="form_item_label">备注:</view> |
|
|
|
|
<view class="form_item_input form_input"> |
|
|
|
|
<uni-easyinput type="textarea" v-model="form.dataDetails" |
|
|
|
|
<uni-easyinput type="textarea" v-model="form.remarks" |
|
|
|
|
placeholderStyle="color: #D4D4D4;font-size:28rpx;" |
|
|
|
|
placeholder="请输入备注信息" maxlength="200"> |
|
|
|
|
</uni-easyinput> |
|
|
|
|
@ -123,14 +123,15 @@ |
|
|
|
|
return { |
|
|
|
|
form: { |
|
|
|
|
"organizationName" : "", |
|
|
|
|
"passengerFlow" : "", |
|
|
|
|
"passengerFlowDod" : "", |
|
|
|
|
"passengerFlowYoy" : "", |
|
|
|
|
"statDate" : "", |
|
|
|
|
"operatingPassengerTimes" : "", |
|
|
|
|
"operatingPassengerTimesMom" : "", |
|
|
|
|
"operatingPassengerTimesYoy" : "", |
|
|
|
|
"reportDate" : "", |
|
|
|
|
"statPeriod" : "", |
|
|
|
|
"trainNumber" : "", |
|
|
|
|
"trainNumberDod" : "", |
|
|
|
|
"trainNumberYoy" : "" |
|
|
|
|
"carTimes" : "", |
|
|
|
|
"carTimesMom " : "", |
|
|
|
|
"carTimesYoy" : "", |
|
|
|
|
"remarks":"" |
|
|
|
|
}, //登录form |
|
|
|
|
array: [], //时段选择列表 |
|
|
|
|
index: 2, //时段选择,默认0-24 |
|
|
|
|
@ -151,7 +152,7 @@ |
|
|
|
|
this.form.organizationNameIndex = this.deptNameList.length > 0 ? 0 : ''; |
|
|
|
|
this.pageType = 'add'; |
|
|
|
|
let now = new Date(); |
|
|
|
|
this.form.statDate = getDateStr(now, -1); //默认前一天 |
|
|
|
|
this.form.reportDate = getDateStr(now, -1); //默认前一天 |
|
|
|
|
this.queryTime(); //统计时段 |
|
|
|
|
this.queryMom(); |
|
|
|
|
} |
|
|
|
|
@ -178,10 +179,10 @@ |
|
|
|
|
methods: { |
|
|
|
|
//获取同环比 |
|
|
|
|
queryMom(type) { |
|
|
|
|
if(!checkNotEmpty(this.form.statDate) || !checkNotEmpty(this.form.statPeriod)){ |
|
|
|
|
if(!checkNotEmpty(this.form.reportDate) || !checkNotEmpty(this.form.statPeriod)){ |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this.$request(getApp().globalData.baseUrl + '/api/biz/subwayInfo/getYoYMoM?statDate=' + this.form.statDate + '&statPeriod=' + this.form.statPeriod + '&_t=' + Date.parse(new Date()), {}, "GET") |
|
|
|
|
this.$request(getApp().globalData.baseUrl + '/api/biz/subwayInfo/getYoYMoM?reportDate=' + this.form.reportDate + '&statPeriod=' + this.form.statPeriod + '&_t=' + Date.parse(new Date()), {}, "GET") |
|
|
|
|
.then(res => { |
|
|
|
|
this.momYoy = res.data; |
|
|
|
|
if(type == 1) { |
|
|
|
|
@ -193,10 +194,11 @@ |
|
|
|
|
calcMomYoy() { |
|
|
|
|
let yesterdayData = this.momYoy.yesterdayData; |
|
|
|
|
let lastYearData = this.momYoy.lastYearData; |
|
|
|
|
this.form.trainNumberDod = this.$calcMom(this.form.trainNumber, yesterdayData.trainNumber); |
|
|
|
|
this.form.trainNumberYoy = this.$calcYoy(this.form.trainNumber, lastYearData.trainNumber); |
|
|
|
|
this.form.passengerFlowDod = this.$calcMom(this.form.passengerFlow, yesterdayData.passengerFlow); |
|
|
|
|
this.form.passengerFlowYoy = this.$calcYoy(this.form.passengerFlow, lastYearData.passengerFlow); |
|
|
|
|
this.form.carTimesMom = this.$calcMom(this.form.carTimes, yesterdayData.carTimes); |
|
|
|
|
this.form.carTimesYoy = this.$calcYoy(this.form.carTimes, lastYearData.carTimes); |
|
|
|
|
this.form.operatingPassengerTimesMom = this.$calcMom(this.form.operatingPassengerTimes, yesterdayData.operatingPassengerTimes); |
|
|
|
|
this.form.operatingPassengerTimesYoy = this.$calcYoy(this.form.operatingPassengerTimes, lastYearData.operatingPassengerTimes); |
|
|
|
|
this.$forceUpdate(); |
|
|
|
|
}, |
|
|
|
|
//切换管理单位 |
|
|
|
|
bindDeptChange(e) { |
|
|
|
|
@ -229,7 +231,7 @@ |
|
|
|
|
}, |
|
|
|
|
//选择统计日期 |
|
|
|
|
bindDateChange(e) { |
|
|
|
|
this.form.statDate = e.detail.value; |
|
|
|
|
this.form.reportDate = e.detail.value; |
|
|
|
|
this.queryMom(1); |
|
|
|
|
}, |
|
|
|
|
//时段 |
|
|
|
|
@ -260,21 +262,21 @@ |
|
|
|
|
}, |
|
|
|
|
//确认提交 |
|
|
|
|
doSubmit() { |
|
|
|
|
if (!checkNotEmpty(this.form.statDate) || !checkNotEmpty(this.form.statPeriod)) { |
|
|
|
|
if (!checkNotEmpty(this.form.reportDate) || !checkNotEmpty(this.form.statPeriod)) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '报送日期和时段不能为空', |
|
|
|
|
icon: 'none' |
|
|
|
|
}) |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (!checkNotEmpty(this.form.trainNumber)) { |
|
|
|
|
if (!checkNotEmpty(this.form.carTimes)) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '车次不能为空', |
|
|
|
|
icon: 'none' |
|
|
|
|
}) |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (!checkNotEmpty(this.form.passengerFlow)) { |
|
|
|
|
if (!checkNotEmpty(this.form.operatingPassengerTimes)) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '客流量不能为空', |
|
|
|
|
icon: 'none' |
|
|
|
|
|