|
|
|
|
@ -39,18 +39,18 @@ |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<!-- 同比环比 --> |
|
|
|
|
<view class="form_item_rate" v-if="form.entranceVehicleCountMom || form.entranceVehicleCountYoy" :class="form.entranceVehicleCountMom === 0 ? 'danger' : ''"> |
|
|
|
|
<view class="form_item_rate" v-if="form.entranceVehicleCountMom || form.entranceVehicleCountYoy" :class="form.entranceVehicleCount == yoyMom.minusDaysEntranceVehicleSum ? 'danger' : ''"> |
|
|
|
|
<view class="rate_item"> |
|
|
|
|
<view class="rate_item_label" :style="form.entranceVehicleCountMom === 0 ?'color: #EB4747':''">收费站入口车辆数汇总环比(%)</view> |
|
|
|
|
<view class="rate_item_input" :style="form.entranceVehicleCountMom === 0 ?'color: #EB4747':''"> |
|
|
|
|
{{form.entranceVehicleCountMom}} |
|
|
|
|
<view class="rate_item_label" :style="form.entranceVehicleCount == yoyMom.minusDaysEntranceVehicleSum ?'color: #EB4747':''">收费站入口车辆数汇总环比(%)</view> |
|
|
|
|
<view class="rate_item_input" :style="form.entranceVehicleCount == yoyMom.minusDaysEntranceVehicleSum ?'color: #EB4747':''"> |
|
|
|
|
{{form.entranceVehicleCountMom === 0 ? form.entranceVehicleCountMom : form.entranceVehicleCountMom ? form.entranceVehicleCountMom.toFixed(2) : ''}} |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="line"></view> |
|
|
|
|
<view class="rate_item"> |
|
|
|
|
<view class="rate_item_label">收费站入口车辆数汇总同比(%)</view> |
|
|
|
|
<view class="rate_item_input"> |
|
|
|
|
{{form.entranceVehicleCountYoy}} |
|
|
|
|
{{form.entranceVehicleCountYoy === 0 ? form.entranceVehicleCountYoy : form.entranceVehicleCountYoy ? form.entranceVehicleCountYoy.toFixed(2) : ''}} |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
@ -61,18 +61,18 @@ |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<!-- 同比环比 --> |
|
|
|
|
<view class="form_item_rate" v-if="form.exitVehicleCountMom || form.exitVehicleCountYoy" :class="form.exitVehicleCountMom === 0 ? 'danger' : ''"> |
|
|
|
|
<view class="form_item_rate" v-if="form.exitVehicleCountMom || form.exitVehicleCountYoy" :class="form.exitVehicleCount === yoyMom.minusDaysExitVehicleSum ? 'danger' : ''"> |
|
|
|
|
<view class="rate_item"> |
|
|
|
|
<view class="rate_item_label" :style="form.exitVehicleCountMom === 0 ?'color: #EB4747':''">收费站入口车辆数汇总环比(%)</view> |
|
|
|
|
<view class="rate_item_input" :style="form.exitVehicleCountMom === 0 ?'color: #EB4747':''"> |
|
|
|
|
{{form.exitVehicleCountMom}} |
|
|
|
|
<view class="rate_item_label" :style="form.exitVehicleCount == yoyMom.minusDaysExitVehicleSum ?'color: #EB4747':''">收费站入口车辆数汇总环比(%)</view> |
|
|
|
|
<view class="rate_item_input" :style="form.exitVehicleCount == yoyMom.minusDaysExitVehicleSum ?'color: #EB4747':''"> |
|
|
|
|
{{form.exitVehicleCountMom === 0 ? form.exitVehicleCountMom : form.exitVehicleCountMom ? form.exitVehicleCountMom.toFixed(2) : ''}} |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="line"></view> |
|
|
|
|
<view class="rate_item"> |
|
|
|
|
<view class="rate_item_label">收费站入口车辆数汇总同比(%)</view> |
|
|
|
|
<view class="rate_item_label">收费站出口车辆数汇总同比(%)</view> |
|
|
|
|
<view class="rate_item_input"> |
|
|
|
|
{{form.exitVehicleCountYoy}} |
|
|
|
|
{{form.exitVehicleCountYoy === 0 ? form.exitVehicleCountYoy : form.exitVehicleCountYoy ? form.exitVehicleCountYoy.toFixed(2) : ''}} |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
@ -108,18 +108,18 @@ |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<!-- 同比环比 --> |
|
|
|
|
<view class="form_item_rate" v-if="form.highwaySubDataList[stationIndex].entranceVehicleCountMom || form.highwaySubDataList[stationIndex].entranceVehicleCountYoy" :class="form.highwaySubDataList[stationIndex].entranceVehicleCountMom === 0 ? 'danger' : '' "> |
|
|
|
|
<view class="form_item_rate" v-if="form.highwaySubDataList[stationIndex].entranceVehicleCountMom || form.highwaySubDataList[stationIndex].entranceVehicleCountYoy" :class="form.highwaySubDataList[stationIndex].entranceVehicleCountMom == 0 ? 'danger' : '' "> |
|
|
|
|
<view class="rate_item"> |
|
|
|
|
<view class="rate_item_label" :style="form.highwaySubDataList[stationIndex].entranceVehicleCountMom == 0 ? 'color: #EB4747' : ''">收费站入口车辆数环比(%)</view> |
|
|
|
|
<view class="rate_item_input" :style="form.highwaySubDataList[stationIndex].entranceVehicleCountMom == 0 ? 'color: #EB4747' : ''"> |
|
|
|
|
{{form.highwaySubDataList[stationIndex].entranceVehicleCountMom}} |
|
|
|
|
{{form.highwaySubDataList[stationIndex].entranceVehicleCountMom === 0 ? form.highwaySubDataList[stationIndex].entranceVehicleCountMom : form.highwaySubDataList[stationIndex].entranceVehicleCountMom ? form.highwaySubDataList[stationIndex].entranceVehicleCountMom.toFixed(2) : ''}} |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="line"></view> |
|
|
|
|
<view class="rate_item"> |
|
|
|
|
<view class="rate_item_label">收费站入口车辆数同比(%)</view> |
|
|
|
|
<view class="rate_item_input"> |
|
|
|
|
{{form.highwaySubDataList[stationIndex].entranceVehicleCountYoy}} |
|
|
|
|
{{form.highwaySubDataList[stationIndex].entranceVehicleCountYoy === 0 ? form.highwaySubDataList[stationIndex].entranceVehicleCountYoy : form.highwaySubDataList[stationIndex].entranceVehicleCountYoy ? form.highwaySubDataList[stationIndex].entranceVehicleCountYoy.toFixed(2) : ''}} |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
@ -130,18 +130,18 @@ |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<!-- 同比环比 --> |
|
|
|
|
<view class="form_item_rate" v-if="form.highwaySubDataList[stationIndex].exitVehicleCountMom || form.highwaySubDataList[stationIndex].exitVehicleCountYoy" :class="form.highwaySubDataList[stationIndex].exitVehicleCountMom === 0 ? 'danger' : '' "> |
|
|
|
|
<view class="form_item_rate" v-if="form.highwaySubDataList[stationIndex].exitVehicleCountMom || form.highwaySubDataList[stationIndex].exitVehicleCountYoy" :class="form.highwaySubDataList[stationIndex].exitVehicleCountMom == 0 ? 'danger' : '' "> |
|
|
|
|
<view class="rate_item"> |
|
|
|
|
<view class="rate_item_label" :style="form.highwaySubDataList[stationIndex].exitVehicleCountMom == 0 ? 'color: #EB4747' : ''">收费站出口车辆数环比(%)</view> |
|
|
|
|
<view class="rate_item_input" :style="form.highwaySubDataList[stationIndex].exitVehicleCountMom == 0 ? 'color: #EB4747' : ''"> |
|
|
|
|
{{form.highwaySubDataList[stationIndex].exitVehicleCountMom}} |
|
|
|
|
{{form.highwaySubDataList[stationIndex].exitVehicleCountMom === 0 ? form.highwaySubDataList[stationIndex].exitVehicleCountMom : form.highwaySubDataList[stationIndex].exitVehicleCountMom ? form.highwaySubDataList[stationIndex].exitVehicleCountMom.toFixed(2) : ''}} |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="line"></view> |
|
|
|
|
<view class="rate_item"> |
|
|
|
|
<view class="rate_item_label">收费站出口车辆数同比(%)</view> |
|
|
|
|
<view class="rate_item_input"> |
|
|
|
|
{{form.highwaySubDataList[stationIndex].exitVehicleCountYoy}} |
|
|
|
|
{{form.highwaySubDataList[stationIndex].exitVehicleCountYoy === 0 ? form.highwaySubDataList[stationIndex].exitVehicleCountYoy : form.highwaySubDataList[stationIndex].exitVehicleCountYoy ? form.highwaySubDataList[stationIndex].exitVehicleCountYoy.toFixed(2) : ''}} |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
@ -182,7 +182,7 @@ |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
|
<script> |
|
|
|
|
import { getDateStr } from "../../../common/util.js" |
|
|
|
|
import { checkNotEmpty, getDateStr } from "../../../common/util.js" |
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
@ -221,16 +221,32 @@ |
|
|
|
|
console.log('edit', this.form) |
|
|
|
|
this.queryYoYMom(); |
|
|
|
|
this.queryStation(); |
|
|
|
|
} else if(options.id) { |
|
|
|
|
this.queryYoYMom(); |
|
|
|
|
this.queryStation(); |
|
|
|
|
this.queryDetailInfo(options.id); |
|
|
|
|
} |
|
|
|
|
this.queryTime();//统计时段 |
|
|
|
|
this.queryPerson(); |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
//id查询详情 |
|
|
|
|
queryDetailInfo(id) { |
|
|
|
|
this.$request(getApp().globalData.baseUrl + '/api/biz/highwayParentDataController/selectById/' + id, {}, 'GET').then(res => { |
|
|
|
|
this.form = res.data; |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
//同比环比查询 |
|
|
|
|
queryYoYMom() { |
|
|
|
|
if(this.form.statDate && this.form.statPeriod) { |
|
|
|
|
this.$request(getApp().globalData.baseUrl + '/api/biz/highwayParentDataController/getYoYAndMoM?statDate='+this.form.statDate+'&statPeriod='+this.form.statPeriod+'&_t=' + Date.parse(new Date()),{},"GET").then(res => { |
|
|
|
|
this.yoyMom = res.data; |
|
|
|
|
//如果重新更改填报日期,重新计算同比环比 |
|
|
|
|
if(this.highwaySubDataList.length > 0 && this.form.highwaySubDataList.length > 0){ |
|
|
|
|
this.highwaySubDataList.map((item, index) => { |
|
|
|
|
this.checkStationInfo(index); |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
@ -267,27 +283,40 @@ |
|
|
|
|
}) |
|
|
|
|
this.form.entranceVehicleCount = entranceVehicleCount; |
|
|
|
|
this.form.exitVehicleCount = exitVehicleCount; |
|
|
|
|
// this.form.entranceVehicleCountMom = this.form.entranceVehicleCount && this.yoyMom.queryData.entranceVehicleCount ? (this.form.entranceVehicleCount - this.yoyMom.queryData.entranceVehicleCount) / this.yoyMom.queryData.entranceVehicleCount * 100 : ''; |
|
|
|
|
// this.form.entranceVehicleCountYoy = this.form.entranceVehicleCount && this.yoyMom.lastYearData.entranceVehicleCount ? (this.form.entranceVehicleCount - this.yoyMom.lastYearData.entranceVehicleCount) / this.yoyMom.lastYearData.entranceVehicleCount * 100 : '';//同比 |
|
|
|
|
// this.form.exitVehicleCountMom = this.form.exitVehicleCount && this.yoyMom.queryData.exitVehicleCount ? (this.form.exitVehicleCount - this.yoyMom.queryData.exitVehicleCount) / this.yoyMom.queryData.exitVehicleCount * 100 : ''; |
|
|
|
|
// this.form.exitVehicleCountYoy = this.form.exitVehicleCount && this.yoyMom.lastYearData.exitVehicleCount ? (this.form.exitVehicleCount - this.yoyMom.lastYearData.exitVehicleCount) / this.yoyMom.lastYearData.exitVehicleCount * 100 : '';//同比 |
|
|
|
|
// //计算同比环比 |
|
|
|
|
// if(this.form.highwaySubDataList[index].entranceVehicleCount != ''){ |
|
|
|
|
// let idx = this.yoyMom.lastYearData.highwaySubDataList.findIndex(item => item.stationName == this.form.highwaySubDataList[index].stationName); |
|
|
|
|
// let idx2 = this.yoyMom.queryData.highwaySubDataList.findIndex(item => item.stationName == this.form.highwaySubDataList[index].stationName); |
|
|
|
|
// if(idx > -1){ |
|
|
|
|
// //环比 |
|
|
|
|
// let obj = this.yoyMom.queryData.highwaySubDataList[idx]; |
|
|
|
|
// this.form.highwaySubDataList[index].entranceVehicleCountMom = obj.entranceVehicleCount ? (this.form.highwaySubDataList[index].entranceVehicleCount - obj.entranceVehicleCount) / obj.entranceVehicleCount * 100 : ''; |
|
|
|
|
// this.form.highwaySubDataList[index].exitVehicleCountMom = obj.exitVehicleCount ? (this.form.highwaySubDataList[index].exitVehicleCount - obj.exitVehicleCount) / obj.exitVehicleCount * 100 : ''; |
|
|
|
|
// } |
|
|
|
|
// if(idx2 > -1){ |
|
|
|
|
// //同比 |
|
|
|
|
// let obj = this.yoyMom.lastYearData.highwaySubDataList[idx]; |
|
|
|
|
// this.form.highwaySubDataList[index].entranceVehicleCountYoy = obj.entranceVehicleCount ? (this.form.highwaySubDataList[index].entranceVehicleCount - obj.entranceVehicleCount) / obj.entranceVehicleCount * 100 : ''; |
|
|
|
|
// this.form.highwaySubDataList[index].exitVehicleCountYoy = obj.exitVehicleCount ? (this.form.highwaySubDataList[index].exitVehicleCount - obj.exitVehicleCount) / obj.exitVehicleCount * 100 : ''; |
|
|
|
|
// } |
|
|
|
|
// } |
|
|
|
|
//收费站入口车辆数汇总 |
|
|
|
|
this.form.entranceVehicleCountMom = this.form.entranceVehicleCount && this.yoyMom.minusDaysEntranceVehicleSum ? (parseInt(this.form.entranceVehicleCount) - this.yoyMom.minusDaysEntranceVehicleSum ) / this.yoyMom.minusDaysEntranceVehicleSum * 100 : ''; |
|
|
|
|
this.form.entranceVehicleCountYoy = this.form.entranceVehicleCount && this.yoyMom.minusYearsEntranceVehicleSum ? (parseInt(this.form.entranceVehicleCount) - this.yoyMom.minusYearsEntranceVehicleSum ) / this.yoyMom.minusYearsEntranceVehicleSum * 100 : '';//同比 |
|
|
|
|
//收费站出口车辆数汇总 |
|
|
|
|
this.form.exitVehicleCountMom = this.form.exitVehicleCount && this.yoyMom.minusDaysExitVehicleSum ? (parseInt(this.form.exitVehicleCount) - this.yoyMom.minusDaysExitVehicleSum) / this.yoyMom.minusDaysExitVehicleSum * 100 : ''; |
|
|
|
|
this.form.exitVehicleCountYoy = this.form.exitVehicleCount && this.yoyMom.minusYearsExitVehicleSum ? (parseInt(this.form.exitVehicleCount) - this.yoyMom.minusYearsExitVehicleSum) / this.yoyMom.minusYearsExitVehicleSum * 100 : '';//同比 |
|
|
|
|
//收费站子表计算同比环比 |
|
|
|
|
if(this.form.highwaySubDataList[index].entranceVehicleCount != '' || this.form.highwaySubDataList[index].exitVehicleCount != ''){ |
|
|
|
|
let idx = this.yoyMom.minusDaysList.findIndex(item => {return item.tollStationName == this.form.highwaySubDataList[index].tollStationName;}); |
|
|
|
|
let idx2 = this.yoyMom.minusYearsList.findIndex(item => {return item.tollStationName == this.form.highwaySubDataList[index].tollStationName;}); |
|
|
|
|
console.log('收费站同比环比',idx,idx2,this.form.highwaySubDataList[index].tollStationName); |
|
|
|
|
if(idx > -1){ |
|
|
|
|
//环比 |
|
|
|
|
let obj = this.yoyMom.minusDaysList[idx]; |
|
|
|
|
console.log(obj) |
|
|
|
|
this.form.highwaySubDataList[index].entranceVehicleCountMom = obj.entranceVehicleCount ? (parseInt(this.form.highwaySubDataList[index].entranceVehicleCount) - obj.entranceVehicleCount) / obj.entranceVehicleCount * 100 : ''; |
|
|
|
|
this.form.highwaySubDataList[index].exitVehicleCountMom = obj.exitVehicleCount ? (parseInt(this.form.highwaySubDataList[index].exitVehicleCount) - obj.exitVehicleCount) / obj.exitVehicleCount * 100 : ''; |
|
|
|
|
} |
|
|
|
|
else{ |
|
|
|
|
this.form.highwaySubDataList[index].entranceVehicleCountMom = ''; |
|
|
|
|
this.form.highwaySubDataList[index].exitVehicleCountMom = ''; |
|
|
|
|
} |
|
|
|
|
if(idx2 > -1){ |
|
|
|
|
//同比 |
|
|
|
|
let obj = this.yoyMom.minusYearsList[idx2]; |
|
|
|
|
console.log(obj) |
|
|
|
|
this.form.highwaySubDataList[index].entranceVehicleCountYoy = obj.entranceVehicleCount ? (parseInt(this.form.highwaySubDataList[index].entranceVehicleCount) - obj.entranceVehicleCount) / obj.entranceVehicleCount * 100 : ''; |
|
|
|
|
this.form.highwaySubDataList[index].exitVehicleCountYoy = obj.exitVehicleCount ? (parseInt(this.form.highwaySubDataList[index].exitVehicleCount) - obj.exitVehicleCount) / obj.exitVehicleCount * 100 : ''; |
|
|
|
|
} |
|
|
|
|
else{ |
|
|
|
|
this.form.highwaySubDataList[index].entranceVehicleCountYoy = ''; |
|
|
|
|
this.form.highwaySubDataList[index].exitVehicleCountYoy = ''; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
//收费站列表 |
|
|
|
|
queryStation(type) { |
|
|
|
|
@ -299,12 +328,12 @@ |
|
|
|
|
item.isFinish = false; |
|
|
|
|
this.form.highwaySubDataList.push({ |
|
|
|
|
"entranceVehicleCount": '', |
|
|
|
|
"entranceVehicleCountMom": 0.0, |
|
|
|
|
"entranceVehicleCountYoy": 0.0, |
|
|
|
|
"entranceVehicleCountMom": '', |
|
|
|
|
"entranceVehicleCountYoy": '', |
|
|
|
|
"exitToll": 0.0, |
|
|
|
|
"exitVehicleCount": '', |
|
|
|
|
"exitVehicleCountMom": 0.0, |
|
|
|
|
"exitVehicleCountYoy": 0.0, |
|
|
|
|
"exitVehicleCountMom": '', |
|
|
|
|
"exitVehicleCountYoy": '', |
|
|
|
|
"highwayId": item.highWayLineCode, |
|
|
|
|
"highwayName": item.highWayLineName, |
|
|
|
|
"submitPersonnelContact": this.userInfo.realName+','+this.userInfo.mobile, |
|
|
|
|
@ -330,12 +359,12 @@ |
|
|
|
|
item.isFinish = false; |
|
|
|
|
this.form.highwaySubDataList.push({ |
|
|
|
|
"entranceVehicleCount": '', |
|
|
|
|
"entranceVehicleCountMom": 0.0, |
|
|
|
|
"entranceVehicleCountYoy": 0.0, |
|
|
|
|
"entranceVehicleCountMom": '', |
|
|
|
|
"entranceVehicleCountYoy": '', |
|
|
|
|
"exitToll": 0.0, |
|
|
|
|
"exitVehicleCount": '', |
|
|
|
|
"exitVehicleCountMom": 0.0, |
|
|
|
|
"exitVehicleCountYoy": 0.0, |
|
|
|
|
"exitVehicleCountMom": '', |
|
|
|
|
"exitVehicleCountYoy": '', |
|
|
|
|
"highwayId": item.highWayLineCode, |
|
|
|
|
"highwayName": item.highWayLineName, |
|
|
|
|
"submitPersonnelContact": this.userInfo.realName+','+this.userInfo.mobile, |
|
|
|
|
@ -358,6 +387,7 @@ |
|
|
|
|
//选择统计日期 |
|
|
|
|
bindDateChange(e) { |
|
|
|
|
this.form.statDate = e.detail.value; |
|
|
|
|
this.queryYoYMom(); |
|
|
|
|
}, |
|
|
|
|
//时段 |
|
|
|
|
queryTime() { |
|
|
|
|
@ -375,16 +405,33 @@ |
|
|
|
|
}) |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
let check = this.form.highwaySubDataList.every(item => { |
|
|
|
|
return !item.entranceVehicleCount || !item.exitVehicleCount |
|
|
|
|
}) |
|
|
|
|
if (check) { |
|
|
|
|
let checkList = true; |
|
|
|
|
if (this.form.highwaySubDataList.length > 0) { |
|
|
|
|
checkList = this.form.highwaySubDataList.every(item => { |
|
|
|
|
return checkNotEmpty(item.entranceVehicleCount) && checkNotEmpty(item.exitVehicleCount) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
if (!checkList) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '收费站信息请填写完整', |
|
|
|
|
icon: 'none' |
|
|
|
|
}) |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
//环比0持平的备注不能为空 |
|
|
|
|
let checkRemark = true; |
|
|
|
|
if (this.form.highwaySubDataList.length > 0) { |
|
|
|
|
checkRemark = this.form.highwaySubDataList.every(item => { |
|
|
|
|
return item.entranceVehicleCountMom !== 0 && item.exitVehicleCountMom !== 0; |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
if (!checkRemark) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '环比持平预警请填写备注原因', |
|
|
|
|
icon: 'none' |
|
|
|
|
}) |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
uni.showModal({ |
|
|
|
|
title: '提示', |
|
|
|
|
content: '确认保存当前报送数据吗?', |
|
|
|
|
|