|
|
|
|
@ -34,7 +34,7 @@ |
|
|
|
|
</view> |
|
|
|
|
<view class="form_item"> |
|
|
|
|
<view class="form_item_label">高速开闭情况:</view> |
|
|
|
|
<view class="form_item_input form_input"> |
|
|
|
|
<view class="form_item_input picker"> |
|
|
|
|
<picker :value="isOpenIndex" :range="isOpenArry" range-key="label" @change="changeIsOpen"> |
|
|
|
|
<text class="picker_select" |
|
|
|
|
:style="isOpenIndex > -1?'color:#333;':''">{{form.isOpen == 1 ? '开放' : form.isOpen === 0 ? '关闭' : '请选择'}}</text> |
|
|
|
|
@ -111,9 +111,9 @@ |
|
|
|
|
<view class="form_item"> |
|
|
|
|
<view class="form_item_label">拥堵发生时间:</view> |
|
|
|
|
<view class="form_item_input picker"> |
|
|
|
|
<uni-datetime-picker v-model="item.congestionStartTime" :border="false"> |
|
|
|
|
<uni-datetime-picker type="datetime" v-model="item.congestionStartTime" :border="false"> |
|
|
|
|
<text class="picker_select" |
|
|
|
|
:style="item.congestionStartTime?'color:#333;':''">{{item.congestionStartTime?item.congestionStartTime:'请选择'}}</text> |
|
|
|
|
:style="item.congestionStartTime?'color:#333;':''">{{item.congestionStartTime?formatdate(item.congestionStartTime):'请选择'}}</text> |
|
|
|
|
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons> |
|
|
|
|
</uni-datetime-picker> |
|
|
|
|
</view> |
|
|
|
|
@ -121,9 +121,9 @@ |
|
|
|
|
<view class="form_item"> |
|
|
|
|
<view class="form_item_label">拥堵处理结束时间:</view> |
|
|
|
|
<view class="form_item_input picker"> |
|
|
|
|
<uni-datetime-picker v-model="item.congestionEndTime" :border="false"> |
|
|
|
|
<uni-datetime-picker type="datetime" v-model="item.congestionEndTime" :border="false"> |
|
|
|
|
<text class="picker_select" |
|
|
|
|
:style="item.congestionEndTime?'color:#333;':''">{{item.congestionEndTime?item.congestionEndTime:'请选择'}}</text> |
|
|
|
|
:style="item.congestionEndTime?'color:#333;':''">{{item.congestionEndTime?formatdate(item.congestionEndTime):'请选择'}}</text> |
|
|
|
|
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons> |
|
|
|
|
</uni-datetime-picker> |
|
|
|
|
</view> |
|
|
|
|
@ -196,9 +196,9 @@ |
|
|
|
|
<view class="form_item"> |
|
|
|
|
<view class="form_item_label">事故发生时间:</view> |
|
|
|
|
<view class="form_item_input picker"> |
|
|
|
|
<uni-datetime-picker v-model="item.accidentStartTime" :border="false"> |
|
|
|
|
<uni-datetime-picker type="datetime" v-model="item.accidentStartTime" :border="false"> |
|
|
|
|
<text class="picker_select" |
|
|
|
|
:style="item.accidentStartTime?'color:#333;':''">{{item.accidentStartTime?item.accidentStartTime:'请选择'}}</text> |
|
|
|
|
:style="item.accidentStartTime?'color:#333;':''">{{item.accidentStartTime?formatdate(item.accidentStartTime):'请选择'}}</text> |
|
|
|
|
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons> |
|
|
|
|
</uni-datetime-picker> |
|
|
|
|
</view> |
|
|
|
|
@ -206,9 +206,9 @@ |
|
|
|
|
<view class="form_item"> |
|
|
|
|
<view class="form_item_label">事故处理结束时间:</view> |
|
|
|
|
<view class="form_item_input picker"> |
|
|
|
|
<uni-datetime-picker v-model="item.accidentEndTime" :border="false"> |
|
|
|
|
<uni-datetime-picker type="datetime" v-model="item.accidentEndTime" :border="false"> |
|
|
|
|
<text class="picker_select" |
|
|
|
|
:style="item.accidentEndTime?'color:#333;':''">{{item.accidentEndTime?item.accidentEndTime:'请选择'}}</text> |
|
|
|
|
:style="item.accidentEndTime?'color:#333;':''">{{item.accidentEndTime?formatdate(item.accidentEndTime):'请选择'}}</text> |
|
|
|
|
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons> |
|
|
|
|
</uni-datetime-picker> |
|
|
|
|
</view> |
|
|
|
|
@ -232,7 +232,7 @@ |
|
|
|
|
<view class="form_item_label">事故等级:</view> |
|
|
|
|
<view class="form_item_input picker"> |
|
|
|
|
<picker :value="item.accidentLevelIndex" :range="accidentLevel" range-key="dictLabel" |
|
|
|
|
@change="e => changeAccidentLevel(e, 'highwayCongestionDetailDTOS', index)"> |
|
|
|
|
@change="e => changeAccidentLevel(e, 'highwayAccidentDetailDTOS', index)"> |
|
|
|
|
<text class="picker_select" |
|
|
|
|
:style="item.accidentLevelIndex?'color:#333;':''">{{item.accidentLevelIndex ? accidentLevel[item.accidentLevelIndex].dictLabel : '请选择'}}</text> |
|
|
|
|
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons> |
|
|
|
|
@ -343,26 +343,21 @@ |
|
|
|
|
onLoad(options) { |
|
|
|
|
this.userInfo = uni.getStorageSync('userInfo'); |
|
|
|
|
if (options.type == 'add') { |
|
|
|
|
this.pageType = 'add'; |
|
|
|
|
this.pageType = 'add'; |
|
|
|
|
this.form.organizationName = this.userInfo.organizationName ? this.userInfo.organizationName : ''; |
|
|
|
|
let now = new Date(); |
|
|
|
|
this.form.statDate = getDateStr(now, -1); //默认前一天 |
|
|
|
|
this.queryHighway(); //高速公路列表 |
|
|
|
|
this.queryAccidentLevel(); //事故等级 |
|
|
|
|
} else if (options.item) { |
|
|
|
|
this.form = JSON.parse(options.item); |
|
|
|
|
this.form.highwayCongestionDetailDTOS = this.form.highwayCongestionDetailVOS; |
|
|
|
|
this.form.highwayAccidentDetailDTOS = this.form.highwayAccidentDetailVOS; |
|
|
|
|
console.log(this.form) |
|
|
|
|
this.queryAccidentLevel(); //事故等级 |
|
|
|
|
this.queryHighway(); //高速公路列表 |
|
|
|
|
this.queryAccidentLevel(); //事故等级 |
|
|
|
|
this.queryTime(); //统计时段 |
|
|
|
|
} else if (options.id) { |
|
|
|
|
this.queryDetailInfo(options.id); |
|
|
|
|
this.queryAccidentLevel(); //事故等级 |
|
|
|
|
this.queryHighway(); //高速公路列表 |
|
|
|
|
} |
|
|
|
|
this.queryTime(); //统计时段 |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
methods: { |
|
|
|
|
formatdate(date) { |
|
|
|
|
return date.length < 12 ? date + '00:00:00' : date; |
|
|
|
|
}, |
|
|
|
|
//id查询详情 |
|
|
|
|
queryDetailInfo(id) { |
|
|
|
|
this.$request(getApp().globalData.baseUrl + '/api/biz/highSpeedOperationController/selectById/' + id, {}, |
|
|
|
|
@ -371,6 +366,8 @@ |
|
|
|
|
this.form.highwayCongestionDetailDTOS = this.form.highwayCongestionDetailVOS; |
|
|
|
|
this.form.highwayAccidentDetailDTOS = this.form.highwayAccidentDetailVOS; |
|
|
|
|
this.queryAccidentLevel(); //事故等级 |
|
|
|
|
this.queryHighway(); //高速公路列表 |
|
|
|
|
this.queryTime(); //统计时段 |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
//高速公路权限列表 |
|
|
|
|
@ -393,7 +390,8 @@ |
|
|
|
|
console.log(this.form) |
|
|
|
|
}, |
|
|
|
|
//事故等级切换选择 |
|
|
|
|
changeAccidentLevel(e, key, index) { |
|
|
|
|
changeAccidentLevel(e, key, index) { |
|
|
|
|
console.log(key,e.detail.value); |
|
|
|
|
this.form[key][index].accidentLevelIndex = e.detail.value; |
|
|
|
|
this.form[key][index].accidentLevel = this.accidentLevel[e.detail.value].dictValue; |
|
|
|
|
}, |
|
|
|
|
@ -507,23 +505,29 @@ |
|
|
|
|
icon: 'none' |
|
|
|
|
}) |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
let checkCongestion = this.form.highwayCongestionDetailDTOS.every(item => { |
|
|
|
|
return !item.highwayName || !item.congestionStartTime || !item.congestionEndTime || !item |
|
|
|
|
.duration || !item.location |
|
|
|
|
}) |
|
|
|
|
let checkAccident = this.form.highwayAccidentDetailDTOS.every(item => { |
|
|
|
|
return !item.highwayName || !item.accidentStartTime || !item.accidentEndTime || !item |
|
|
|
|
.duration || !item.location |
|
|
|
|
}) |
|
|
|
|
if (this.form.highwayCongestionDetailDTOS.length > 0 && checkCongestion) { |
|
|
|
|
} |
|
|
|
|
let checkCongestion = true; |
|
|
|
|
if(this.form.highwayCongestionDetailDTOS.length > 0){ |
|
|
|
|
checkCongestion = this.form.highwayCongestionDetailDTOS.every(item => { |
|
|
|
|
return item.highwayName && item.congestionStartTime && item.congestionEndTime && item |
|
|
|
|
.duration && item.location |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
let checkAccident = true; |
|
|
|
|
if(this.form.highwayAccidentDetailDTOS.length > 0) { |
|
|
|
|
checkAccident = this.form.highwayAccidentDetailDTOS.every(item => { |
|
|
|
|
return item.highwayName && item.accidentStartTime && item.accidentEndTime && item |
|
|
|
|
.duration && item.location && item.accidentLevel |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
if (!checkCongestion) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '拥堵信息详情不能为空', |
|
|
|
|
icon: 'none' |
|
|
|
|
}) |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (this.form.highwayAccidentDetailDTOS.length > 0 && checkAccident) { |
|
|
|
|
if (!checkAccident) { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '事故信息详情不能为空', |
|
|
|
|
icon: 'none' |
|
|
|
|
@ -540,7 +544,15 @@ |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
submitForm() { |
|
|
|
|
submitForm() { |
|
|
|
|
this.form.highwayAccidentDetailDTOS.map(item => { |
|
|
|
|
item.accidentStartTime = this.formatdate(item.accidentStartTime); |
|
|
|
|
item.accidentEndTime = this.formatdate(item.accidentEndTime); |
|
|
|
|
}) |
|
|
|
|
this.form.highwayCongestionDetailDTOS.map(item => { |
|
|
|
|
item.congestionStartTime = this.formatdate(item.congestionStartTime); |
|
|
|
|
item.congestionEndTime = this.formatdate(item.congestionEndTime); |
|
|
|
|
}) |
|
|
|
|
uni.showLoading({ |
|
|
|
|
title: '提交中...', |
|
|
|
|
mask: true |
|
|
|
|
@ -672,12 +684,12 @@ |
|
|
|
|
|
|
|
|
|
&.picker { |
|
|
|
|
flex: 1; |
|
|
|
|
display: flex; |
|
|
|
|
justify-content: space-between; |
|
|
|
|
// display: flex; |
|
|
|
|
// justify-content: space-between; |
|
|
|
|
|
|
|
|
|
/deep/ picker { |
|
|
|
|
flex: 1; |
|
|
|
|
} |
|
|
|
|
// /deep/ picker { |
|
|
|
|
// flex: 1; |
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
.picker_select { |
|
|
|
|
color: #D4D4D4; |
|
|
|
|
|