|
|
|
|
@ -9,11 +9,12 @@ |
|
|
|
|
<view class="form_item"> |
|
|
|
|
<view class="form_item_label">管理单位名称:</view> |
|
|
|
|
<view class="form_item_input picker"> |
|
|
|
|
<picker v-if="pageType == 'add'" :value="form.organizationNameIndex" @change="bindDeptChange"> |
|
|
|
|
<picker v-if="pageType == 'add'" :value="form.organizationNameIndex" :range="deptNameList" |
|
|
|
|
range-key="deptName" @change="bindDeptChange"> |
|
|
|
|
<text class="picker_select" |
|
|
|
|
:style="form.organizationName?'color:#333;':''">{{form.organizationName?form.organizationName:'请选择'}}</text> |
|
|
|
|
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons> |
|
|
|
|
</picker> |
|
|
|
|
</picker> |
|
|
|
|
<text v-else>{{form.organizationName}}</text> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
@ -38,54 +39,54 @@ |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="form_item"> |
|
|
|
|
<view class="form_item_label">收费站入口车辆数汇总:</view> |
|
|
|
|
<view class="form_item_label">收费站驶入车辆数统计:</view> |
|
|
|
|
<view class="form_item_input"> |
|
|
|
|
{{form.entranceVehicleCount === 0 ? form.entranceVehicleCount : form.entranceVehicleCount || ''}} |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<!-- 同比环比 --> |
|
|
|
|
<view class="form_item_rate" |
|
|
|
|
:class="form.entranceVehicleCount && form.entranceVehicleCount == yoyMom.minusDaysEntranceVehicleSum ? 'danger' : ''"> |
|
|
|
|
:class="checkNotEmpty(form.entranceVehicleCount) && form.entranceVehicleCount === yoyMom.minusDaysEntranceVehicleSum ? 'danger' : ''"> |
|
|
|
|
<view class="rate_item"> |
|
|
|
|
<view class="rate_item_label" |
|
|
|
|
:style="form.entranceVehicleCount && form.entranceVehicleCount == yoyMom.minusDaysEntranceVehicleSum ?'color: #EB4747':''"> |
|
|
|
|
收费站入口车辆数汇总环比(%)</view> |
|
|
|
|
:style="checkNotEmpty(form.entranceVehicleCount) && form.entranceVehicleCount === yoyMom.minusDaysEntranceVehicleSum ?'color: #EB4747':''"> |
|
|
|
|
驶入车辆数统计环比</view> |
|
|
|
|
<view class="rate_item_input" |
|
|
|
|
:style="form.entranceVehicleCount && form.entranceVehicleCount == yoyMom.minusDaysEntranceVehicleSum ?'color: #EB4747':''"> |
|
|
|
|
{{form.entranceVehicleCountMom === 0 ? form.entranceVehicleCountMom : form.entranceVehicleCountMom ? form.entranceVehicleCountMom.toFixed(2) : ''}} |
|
|
|
|
:style="checkNotEmpty(form.entranceVehicleCount) && form.entranceVehicleCount === yoyMom.minusDaysEntranceVehicleSum ?'color: #EB4747':''"> |
|
|
|
|
{{form.entranceVehicleCountMom === 0 ? form.entranceVehicleCountMom : checkNotEmpty(form.entranceVehicleCountMom) ? formatDigit(form.entranceVehicleCountMom) : '--'}}% |
|
|
|
|
</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.entranceVehicleCountYoy === 0 ? form.entranceVehicleCountYoy : form.entranceVehicleCountYoy ? form.entranceVehicleCountYoy.toFixed(2) : ''}} |
|
|
|
|
{{form.entranceVehicleCountYoy === 0 ? form.entranceVehicleCountYoy : checkNotEmpty(form.entranceVehicleCountYoy) ? formatDigit(form.entranceVehicleCountYoy) : '--'}}% |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="form_item"> |
|
|
|
|
<view class="form_item_label">收费站出口车辆数汇总:</view> |
|
|
|
|
<view class="form_item_label">收费站驶出车辆数统计:</view> |
|
|
|
|
<view class="form_item_input"> |
|
|
|
|
{{form.exitVehicleCount === 0 ? form.exitVehicleCount : form.exitVehicleCount || ''}} |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<!-- 同比环比 --> |
|
|
|
|
<view class="form_item_rate" |
|
|
|
|
:class="form.exitVehicleCount === yoyMom.minusDaysExitVehicleSum ? 'danger' : ''"> |
|
|
|
|
:class="checkNotEmpty(form.exitVehicleCount) && form.exitVehicleCount === yoyMom.minusDaysExitVehicleSum ? 'danger' : ''"> |
|
|
|
|
<view class="rate_item"> |
|
|
|
|
<view class="rate_item_label" |
|
|
|
|
:style="form.exitVehicleCount == yoyMom.minusDaysExitVehicleSum ?'color: #EB4747':''"> |
|
|
|
|
收费站入口车辆数汇总环比(%)</view> |
|
|
|
|
:style="checkNotEmpty(form.exitVehicleCount) && 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) : ''}} |
|
|
|
|
:style="checkNotEmpty(form.exitVehicleCount) && form.exitVehicleCount === yoyMom.minusDaysExitVehicleSum ?'color: #EB4747':''"> |
|
|
|
|
{{form.exitVehicleCountMom === 0 ? form.exitVehicleCountMom : checkNotEmpty(form.exitVehicleCountMom) ? formatDigit(form.exitVehicleCountMom) : '--'}}% |
|
|
|
|
</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 === 0 ? form.exitVehicleCountYoy : form.exitVehicleCountYoy ? form.exitVehicleCountYoy.toFixed(2) : ''}} |
|
|
|
|
{{form.exitVehicleCountYoy === 0 ? form.exitVehicleCountYoy : checkNotEmpty(form.exitVehicleCountYoy) ? formatDigit(form.exitVehicleCountYoy) : '--'}}% |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
@ -126,7 +127,7 @@ |
|
|
|
|
<view class="form_item_input text">{{form.highwaySubDataList[stationIndex].highwayName}}</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="form_item"> |
|
|
|
|
<view class="form_item_label">收费站入口车辆数:</view> |
|
|
|
|
<view class="form_item_label">收费站驶入车辆数:</view> |
|
|
|
|
<view class="form_item_input form_input"> |
|
|
|
|
<uni-easyinput @blur="checkStationInfo(stationIndex)" |
|
|
|
|
v-model="form.highwaySubDataList[stationIndex].entranceVehicleCount" |
|
|
|
|
@ -136,26 +137,26 @@ |
|
|
|
|
</view> |
|
|
|
|
<!-- 同比环比 --> |
|
|
|
|
<view class="form_item_rate" |
|
|
|
|
:class="form.highwaySubDataList[stationIndex].entranceVehicleCountMom === 0 ? 'danger' : '' "> |
|
|
|
|
:class="form.highwaySubDataList.length == 0 ? '' : checkNotEmpty(form.highwaySubDataList[stationIndex].entranceVehicleCount) && (form.highwaySubDataList[stationIndex].entranceVehicleCountMom === 0 || (form.highwaySubDataList[stationIndex].entranceVehicleCount === form.highwaySubDataList[stationIndex].exitVehicleCount)) ? 'danger' : '' "> |
|
|
|
|
<view class="rate_item"> |
|
|
|
|
<view class="rate_item_label" |
|
|
|
|
:style="form.highwaySubDataList[stationIndex].entranceVehicleCountMom === 0 ? 'color: #EB4747' : ''"> |
|
|
|
|
收费站入口车辆数环比(%)</view> |
|
|
|
|
:style="form.highwaySubDataList.length == 0 ? '' : checkNotEmpty(form.highwaySubDataList[stationIndex].entranceVehicleCount) && (form.highwaySubDataList[stationIndex].entranceVehicleCountMom === 0 || (form.highwaySubDataList[stationIndex].entranceVehicleCount === form.highwaySubDataList[stationIndex].exitVehicleCount)) ? 'color: #EB4747' : ''"> |
|
|
|
|
驶入车辆数环比</view> |
|
|
|
|
<view class="rate_item_input" |
|
|
|
|
:style="form.highwaySubDataList[stationIndex].entranceVehicleCountMom === 0 ? 'color: #EB4747' : ''"> |
|
|
|
|
{{form.highwaySubDataList.length == 0 ? '' : form.highwaySubDataList[stationIndex].entranceVehicleCountMom === 0 ? form.highwaySubDataList[stationIndex].entranceVehicleCountMom : form.highwaySubDataList[stationIndex].entranceVehicleCountMom ? form.highwaySubDataList[stationIndex].entranceVehicleCountMom.toFixed(2) : ''}} |
|
|
|
|
:style="form.highwaySubDataList.length == 0 ? '' : checkNotEmpty(form.highwaySubDataList[stationIndex].entranceVehicleCount) && (form.highwaySubDataList[stationIndex].entranceVehicleCountMom === 0 || (form.highwaySubDataList[stationIndex].entranceVehicleCount === form.highwaySubDataList[stationIndex].exitVehicleCount)) ? 'color: #EB4747' : ''"> |
|
|
|
|
{{form.highwaySubDataList.length == 0 ? '--' : form.highwaySubDataList[stationIndex].entranceVehicleCountMom === 0 ? form.highwaySubDataList[stationIndex].entranceVehicleCountMom : form.highwaySubDataList[stationIndex].entranceVehicleCountMom ? formatDigit(form.highwaySubDataList[stationIndex].entranceVehicleCountMom) : '--'}}% |
|
|
|
|
</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.highwaySubDataList.length == 0 ? '' : form.highwaySubDataList[stationIndex].entranceVehicleCountYoy === 0 ? form.highwaySubDataList[stationIndex].entranceVehicleCountYoy : form.highwaySubDataList[stationIndex].entranceVehicleCountYoy ? form.highwaySubDataList[stationIndex].entranceVehicleCountYoy.toFixed(2) : ''}} |
|
|
|
|
{{form.highwaySubDataList.length == 0 ? '--' : form.highwaySubDataList[stationIndex].entranceVehicleCountYoy === 0 ? form.highwaySubDataList[stationIndex].entranceVehicleCountYoy : form.highwaySubDataList[stationIndex].entranceVehicleCountYoy ? formatDigit(form.highwaySubDataList[stationIndex].entranceVehicleCountYoy) : '--'}}% |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="form_item"> |
|
|
|
|
<view class="form_item_label">收费站出口车辆数:</view> |
|
|
|
|
<view class="form_item_label">收费站驶出车辆数:</view> |
|
|
|
|
<view class="form_item_input form_input"> |
|
|
|
|
<uni-easyinput @blur="checkStationInfo(stationIndex)" |
|
|
|
|
v-model="form.highwaySubDataList[stationIndex].exitVehicleCount" |
|
|
|
|
@ -165,21 +166,21 @@ |
|
|
|
|
</view> |
|
|
|
|
<!-- 同比环比 --> |
|
|
|
|
<view class="form_item_rate" |
|
|
|
|
:class="form.highwaySubDataList[stationIndex].exitVehicleCountMom === 0 ? 'danger' : '' "> |
|
|
|
|
:class="form.highwaySubDataList.length == 0 ? '' : checkNotEmpty(form.highwaySubDataList[stationIndex].exitVehicleCount) && (form.highwaySubDataList[stationIndex].exitVehicleCountMom === 0 || (form.highwaySubDataList[stationIndex].entranceVehicleCount === form.highwaySubDataList[stationIndex].exitVehicleCount)) ? 'danger' : '' "> |
|
|
|
|
<view class="rate_item"> |
|
|
|
|
<view class="rate_item_label" |
|
|
|
|
:style="form.highwaySubDataList[stationIndex].exitVehicleCountMom === 0 ? 'color: #EB4747' : ''"> |
|
|
|
|
收费站出口车辆数环比(%)</view> |
|
|
|
|
:style="form.highwaySubDataList.length == 0 ? '' : checkNotEmpty(form.highwaySubDataList[stationIndex].exitVehicleCount) && (form.highwaySubDataList[stationIndex].exitVehicleCountMom === 0 || (form.highwaySubDataList[stationIndex].entranceVehicleCount === form.highwaySubDataList[stationIndex].exitVehicleCount)) ? 'color: #EB4747' : ''"> |
|
|
|
|
驶出车辆数环比</view> |
|
|
|
|
<view class="rate_item_input" |
|
|
|
|
:style="form.highwaySubDataList[stationIndex].exitVehicleCountMom === 0 ? 'color: #EB4747' : ''"> |
|
|
|
|
{{form.highwaySubDataList.length == 0 ? '' : form.highwaySubDataList[stationIndex].exitVehicleCountMom === 0 ? form.highwaySubDataList[stationIndex].exitVehicleCountMom : form.highwaySubDataList[stationIndex].exitVehicleCountMom ? form.highwaySubDataList[stationIndex].exitVehicleCountMom.toFixed(2) : ''}} |
|
|
|
|
:style="form.highwaySubDataList.length == 0 ? '' : checkNotEmpty(form.highwaySubDataList[stationIndex].exitVehicleCount) && (form.highwaySubDataList[stationIndex].exitVehicleCountMom === 0 || (form.highwaySubDataList[stationIndex].entranceVehicleCount === form.highwaySubDataList[stationIndex].exitVehicleCount)) ? 'color: #EB4747' : ''"> |
|
|
|
|
{{form.highwaySubDataList.length == 0 ? '--' : form.highwaySubDataList[stationIndex].exitVehicleCountMom === 0 ? formatDigit(form.highwaySubDataList[stationIndex].exitVehicleCountMom) : form.highwaySubDataList[stationIndex].exitVehicleCountMom ? formatDigit(form.highwaySubDataList[stationIndex].exitVehicleCountMom) : '--'}}% |
|
|
|
|
</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.highwaySubDataList.length == 0 ? '' : form.highwaySubDataList[stationIndex].exitVehicleCountYoy === 0 ? form.highwaySubDataList[stationIndex].exitVehicleCountYoy : form.highwaySubDataList[stationIndex].exitVehicleCountYoy ? form.highwaySubDataList[stationIndex].exitVehicleCountYoy.toFixed(2) : ''}} |
|
|
|
|
{{form.highwaySubDataList.length == 0 ? '--' : form.highwaySubDataList[stationIndex].exitVehicleCountYoy === 0 ? form.highwaySubDataList[stationIndex].exitVehicleCountYoy : form.highwaySubDataList[stationIndex].exitVehicleCountYoy ? formatDigit(form.highwaySubDataList[stationIndex].exitVehicleCountYoy) : '--'}}% |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
@ -214,15 +215,15 @@ |
|
|
|
|
<view class="form_item_label">备注:</view> |
|
|
|
|
<view class="form_item_input"> |
|
|
|
|
<uni-easyinput v-model="form.highwaySubDataList[stationIndex].mark" |
|
|
|
|
placeholderStyle="color: #D4D4D4;font-size:28rpx;" placeholder="请输入备注信息" type="textarea" |
|
|
|
|
maxlength="200" autoHeight></uni-easyinput> |
|
|
|
|
placeholderStyle="color: #D4D4D4;font-size:28rpx;" placeholder="请输入备注信息" type="textarea" maxlength="200" |
|
|
|
|
autoHeight></uni-easyinput> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<!-- 底部按钮 --> |
|
|
|
|
<view class="foot_btn"> |
|
|
|
|
<view class="act_btn" @click="doCancel">取消</view> |
|
|
|
|
<view class="act_btn blue" @click="doSubmit">确认</view> |
|
|
|
|
<!-- <view class="act_btn" @click="doCancel">取消</view> --> |
|
|
|
|
<view class="act_btn blue" @click="doSubmit">{{btnText}}</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
|
@ -254,16 +255,17 @@ |
|
|
|
|
userInfo: {}, |
|
|
|
|
yoyMom: {}, //同比环比 |
|
|
|
|
showStaion: false, //展开收起 |
|
|
|
|
pageType: '', |
|
|
|
|
deptNameList: [],//当前登录人所在单位 |
|
|
|
|
pageType: '', |
|
|
|
|
deptNameList: [], //当前登录人所在单位 |
|
|
|
|
btnText: '保存' |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onLoad(options) { |
|
|
|
|
this.userInfo = uni.getStorageSync('userInfo'); |
|
|
|
|
let arr = uni.getStorageSync('deptName'); |
|
|
|
|
this.userInfo = uni.getStorageSync('userInfo'); |
|
|
|
|
let arr = uni.getStorageSync('deptName'); |
|
|
|
|
this.deptNameList = checkNotEmpty(arr) ? arr : []; |
|
|
|
|
if (options.type == 'add') { |
|
|
|
|
this.form.organizationName = this.deptNameList.length > 0 ? this.deptNameList[0] : ''; |
|
|
|
|
this.form.organizationName = this.deptNameList.length > 0 ? this.deptNameList[0].deptName : ''; |
|
|
|
|
this.form.organizationNameIndex = this.deptNameList.length > 0 ? 0 : ''; |
|
|
|
|
this.pageType = 'add'; |
|
|
|
|
let now = new Date(); |
|
|
|
|
@ -272,21 +274,29 @@ |
|
|
|
|
this.queryTime(); //统计时段 |
|
|
|
|
} |
|
|
|
|
if (options.id) { |
|
|
|
|
this.btnText = '修改并保存'; |
|
|
|
|
this.queryDetailInfo(options.id); |
|
|
|
|
} |
|
|
|
|
this.queryPerson(); |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
checkNotEmpty(data) { |
|
|
|
|
return checkNotEmpty(data); |
|
|
|
|
}, |
|
|
|
|
//只保留两位小数 |
|
|
|
|
formatDigit(data) { |
|
|
|
|
return (data+'').indexOf('.') > -1 && (data+'').substring((data+'').indexOf('.')).length > 2 ? data.toFixed(2) : data; |
|
|
|
|
}, |
|
|
|
|
//id查询详情 |
|
|
|
|
queryDetailInfo(id) { |
|
|
|
|
this.$request(getApp().globalData.baseUrl + '/api/biz/highwayParentDataController/selectById/' + id, {}, |
|
|
|
|
'GET').then(res => { |
|
|
|
|
this.form = res.data; |
|
|
|
|
this.queryTime(); |
|
|
|
|
this.queryStation(); |
|
|
|
|
if(checkNotEmpty(this.deptNameList)) { |
|
|
|
|
let idx = this.deptNameList.findIndex(item => item = this.form.organizationName); |
|
|
|
|
this.form.organizationNameIndex = idx > -1 ? idx : ''; |
|
|
|
|
this.queryStation(); |
|
|
|
|
if (checkNotEmpty(this.deptNameList)) { |
|
|
|
|
let idx = this.deptNameList.findIndex(item => item.deptName = this.form.organizationName); |
|
|
|
|
this.form.organizationNameIndex = idx > -1 ? idx : ''; |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
@ -296,15 +306,15 @@ |
|
|
|
|
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); |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
res => { |
|
|
|
|
this.yoyMom = res.data; |
|
|
|
|
//如果重新更改填报日期,重新计算同比环比 |
|
|
|
|
if (this.highwaySubDataList.length > 0 && this.form.highwaySubDataList.length > 0) { |
|
|
|
|
this.highwaySubDataList.map((item, index) => { |
|
|
|
|
this.checkStationInfo(index); |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
//报送人 |
|
|
|
|
@ -335,31 +345,49 @@ |
|
|
|
|
checkStationInfo(index) { |
|
|
|
|
this.highwaySubDataList[index].isFinish = this.form.highwaySubDataList[index].entranceVehicleCount != '' && |
|
|
|
|
this.form.highwaySubDataList[index].exitVehicleCount != ''; |
|
|
|
|
//汇总计算 |
|
|
|
|
//统计计算 |
|
|
|
|
let entranceVehicleCount = 0, |
|
|
|
|
exitVehicleCount = 0; |
|
|
|
|
this.form.highwaySubDataList.map(item => { |
|
|
|
|
entranceVehicleCount = entranceVehicleCount + (item.entranceVehicleCount ? parseInt(item |
|
|
|
|
entranceVehicleCount = entranceVehicleCount + (checkNotEmpty(item.entranceVehicleCount) ? parseInt(item |
|
|
|
|
.entranceVehicleCount) : 0); |
|
|
|
|
exitVehicleCount = exitVehicleCount + (item.exitVehicleCount ? parseInt(item |
|
|
|
|
exitVehicleCount = exitVehicleCount + (checkNotEmpty(item.exitVehicleCount) ? parseInt(item |
|
|
|
|
.exitVehicleCount) : 0); |
|
|
|
|
}) |
|
|
|
|
this.form.entranceVehicleCount = entranceVehicleCount; |
|
|
|
|
this.form.exitVehicleCount = exitVehicleCount; |
|
|
|
|
//收费站入口车辆数汇总 |
|
|
|
|
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今天没有值不计算,elseif昨天没有值不计算,elseif昨天===0并且今天===0百分比0,esleif昨天0今天大于0百分比100,else(今天-昨天)/昨天*100 |
|
|
|
|
//收费站驶入车辆数统计 |
|
|
|
|
this.form.entranceVehicleCountMom = !checkNotEmpty(this.form.entranceVehicleCount) ? '' : !checkNotEmpty(this |
|
|
|
|
.form.minusDaysEntranceVehicleSum) ? '' : this.form.minusDaysEntranceVehicleSum === 0 && parseInt(this |
|
|
|
|
.form.entranceVehicleCount) === 0 ? 0 : this.form.minusDaysEntranceVehicleSum === 0 && parseInt(this |
|
|
|
|
.form.entranceVehicleCount) > 0 ? 100 : (parseInt(this |
|
|
|
|
.form.entranceVehicleCount) - this.yoyMom.minusDaysEntranceVehicleSum) / this.yoyMom |
|
|
|
|
.minusDaysEntranceVehicleSum * 100; |
|
|
|
|
this.form.entranceVehicleCountYoy = !checkNotEmpty(this.form |
|
|
|
|
.entranceVehicleCount) ? '' : !checkNotEmpty(this |
|
|
|
|
.form.minusYearsEntranceVehicleSum) ? '' : this.form.minusYearsEntranceVehicleSum === 0 && parseInt( |
|
|
|
|
this.form.entranceVehicleCount) === 0 ? 0 : this.form.minusYearsEntranceVehicleSum === 0 && parseInt( |
|
|
|
|
this.form.entranceVehicleCount) > 0 ? 100 : (parseInt( |
|
|
|
|
this.form.entranceVehicleCount) - this.yoyMom.minusYearsEntranceVehicleSum) / this.yoyMom |
|
|
|
|
.minusYearsEntranceVehicleSum * 100; |
|
|
|
|
|
|
|
|
|
//收费站驶出车辆数统计 |
|
|
|
|
this.form.exitVehicleCountMom = !checkNotEmpty(this.form.exitVehicleCount) ? '' : !checkNotEmpty(this |
|
|
|
|
.form |
|
|
|
|
.minusDaysExitVehicleSum) ? '' : this.form.minusDaysExitVehicleSum === 0 && parseInt(this.form |
|
|
|
|
.exitVehicleCount) === 0 ? 0 : this.form.minusDaysExitVehicleSum === 0 && parseInt(this.form |
|
|
|
|
.exitVehicleCount) > 0 ? 100 : (parseInt(this.form |
|
|
|
|
.exitVehicleCount) - this.yoyMom.minusDaysExitVehicleSum) / this.yoyMom.minusDaysExitVehicleSum * |
|
|
|
|
100; |
|
|
|
|
this.form.exitVehicleCountYoy = !checkNotEmpty(this.form.exitVehicleCount) ? '' : !checkNotEmpty( |
|
|
|
|
this.form |
|
|
|
|
.minusYearsExitVehicleSum) ? '' : this.form.minusYearsExitVehicleSum === 0 && parseInt(this.form |
|
|
|
|
.exitVehicleCount) === 0 ? 0 : this.form.minusYearsExitVehicleSum === 0 && parseInt(this.form |
|
|
|
|
.exitVehicleCount) > 0 ? 100 : (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 => { |
|
|
|
|
@ -375,11 +403,12 @@ |
|
|
|
|
console.log(obj) |
|
|
|
|
this.form.highwaySubDataList[index].entranceVehicleCountMom = !checkNotEmpty(this.form |
|
|
|
|
.highwaySubDataList[index].entranceVehicleCount) ? '' : !checkNotEmpty(obj |
|
|
|
|
.entranceVehicleCount) || obj.entranceVehicleCount === 0 ? 100 : (parseInt(this.form |
|
|
|
|
.entranceVehicleCount) ? '' : obj.entranceVehicleCount === 0 ? 100 : (parseInt(this.form |
|
|
|
|
.highwaySubDataList[index].entranceVehicleCount) - obj.entranceVehicleCount) / obj |
|
|
|
|
.entranceVehicleCount * 100; |
|
|
|
|
this.form.highwaySubDataList[index].exitVehicleCountMom = !checkNotEmpty(this.form.highwaySubDataList[ |
|
|
|
|
index].exitVehicleCount) ? '' : !checkNotEmpty(obj.exitVehicleCount) || obj |
|
|
|
|
this.form.highwaySubDataList[index].exitVehicleCountMom = !checkNotEmpty(this.form |
|
|
|
|
.highwaySubDataList[ |
|
|
|
|
index].exitVehicleCount) ? '' : !checkNotEmpty(obj.exitVehicleCount) ? '' : obj |
|
|
|
|
.exitVehicleCount === 0 ? 100 : (parseInt(this.form.highwaySubDataList[index].exitVehicleCount) - |
|
|
|
|
obj.exitVehicleCount) / obj.exitVehicleCount * 100; |
|
|
|
|
} else { |
|
|
|
|
@ -392,12 +421,13 @@ |
|
|
|
|
console.log(obj) |
|
|
|
|
this.form.highwaySubDataList[index].entranceVehicleCountYoy = !checkNotEmpty(this.form |
|
|
|
|
.highwaySubDataList[index].entranceVehicleCount) ? '' : !checkNotEmpty(obj |
|
|
|
|
.entranceVehicleCount) || obj.entranceVehicleCount === 0 ? 100 : (parseInt(this.form |
|
|
|
|
.entranceVehicleCount) ? '' : obj.entranceVehicleCount === 0 ? 100 : (parseInt(this.form |
|
|
|
|
.highwaySubDataList[index].entranceVehicleCount) - obj.entranceVehicleCount) / obj |
|
|
|
|
.entranceVehicleCount * 100; |
|
|
|
|
this.form.highwaySubDataList[index].exitVehicleCountYoy = !checkNotEmpty(this.form.highwaySubDataList[ |
|
|
|
|
index].exitVehicleCount) ? this.form.highwaySubDataList[index].exitVehicleCount : ! |
|
|
|
|
checkNotEmpty(obj.exitVehicleCount) || obj.exitVehicleCount === 0 ? 100 : (parseInt(this.form |
|
|
|
|
this.form.highwaySubDataList[index].exitVehicleCountYoy = !checkNotEmpty(this.form |
|
|
|
|
.highwaySubDataList[ |
|
|
|
|
index].exitVehicleCount) ? '' : ! |
|
|
|
|
checkNotEmpty(obj.exitVehicleCount) ? '' : obj.exitVehicleCount === 0 ? 100 : (parseInt(this.form |
|
|
|
|
.highwaySubDataList[index].exitVehicleCount) - obj.exitVehicleCount) / obj.exitVehicleCount * |
|
|
|
|
100; |
|
|
|
|
} else { |
|
|
|
|
@ -408,8 +438,9 @@ |
|
|
|
|
}, |
|
|
|
|
//收费站列表 |
|
|
|
|
queryStation(type) { |
|
|
|
|
this.$request(getApp().globalData.baseUrl + '/api/biz/HighSpeedPermissionsInfo/findList?_t=' + Date.parse( |
|
|
|
|
new Date()), {}, 'GET').then(res => { |
|
|
|
|
this.$request(getApp().globalData.baseUrl + '/api/biz/HighSpeedPermissionsInfo/findList?_t=' + Date |
|
|
|
|
.parse( |
|
|
|
|
new Date()), {}, 'GET').then(res => { |
|
|
|
|
this.highwaySubDataList = res.data; |
|
|
|
|
if (type == 'add') { |
|
|
|
|
this.highwaySubDataList.map(item => { |
|
|
|
|
@ -530,20 +561,6 @@ |
|
|
|
|
}) |
|
|
|
|
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: this.form.id == undefined ? '您确认提交该条报送数据?' : '您确认将该条数据进行修改?', |
|
|
|
|
@ -559,7 +576,8 @@ |
|
|
|
|
title: '提交中...', |
|
|
|
|
mask: true |
|
|
|
|
}) |
|
|
|
|
this.$request(getApp().globalData.baseUrl + '/api/biz/highwayParentDataController/saveOrUpdate', this.form, |
|
|
|
|
this.$request(getApp().globalData.baseUrl + '/api/biz/highwayParentDataController/saveOrUpdate', this |
|
|
|
|
.form, |
|
|
|
|
'POST').then(res => { |
|
|
|
|
uni.hideLoading(); |
|
|
|
|
if (res.code == 200) { |
|
|
|
|
@ -804,7 +822,7 @@ |
|
|
|
|
z-index: 99; |
|
|
|
|
|
|
|
|
|
.act_btn { |
|
|
|
|
width: 329rpx; |
|
|
|
|
width: 690rpx; |
|
|
|
|
height: 90rpx; |
|
|
|
|
color: #666666; |
|
|
|
|
font-size: 28rpx; |
|
|
|
|
@ -828,4 +846,4 @@ |
|
|
|
|
background-color: #007aff; |
|
|
|
|
color: #ffffff; |
|
|
|
|
} |
|
|
|
|
</style> |
|
|
|
|
</style> |