日期控件样式冲突修正,bug修改

main
张群 2 years ago
parent 48ed9f160a
commit 24e6c485e9
  1. 33
      pages/highWay/runData/form.vue
  2. 94
      pages/highWay/runStatusData/form.vue
  3. 13
      pages/railway/railwayRunData/form.vue
  4. 20
      pages/railway/runStatus/form.vue
  5. 30
      pages/water/TransportData/form.vue

@ -212,22 +212,17 @@
onLoad(options) { onLoad(options) {
this.userInfo = uni.getStorageSync('userInfo'); this.userInfo = uni.getStorageSync('userInfo');
if (options.type == 'add') { if (options.type == 'add') {
this.form.organizationName = this.userInfo.organizationName ? this.userInfo.organizationName : '';
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);//
this.queryYoYMom(); this.queryYoYMom();
this.queryStation('add'); this.queryStation('add');
} else if (options.item) { this.queryTime();//
this.form = JSON.parse(options.item); } if(options.id) {
console.log('edit', this.form)
this.queryYoYMom(); this.queryYoYMom();
this.queryStation();
} else if(options.id) {
this.queryYoYMom();
this.queryStation();
this.queryDetailInfo(options.id); this.queryDetailInfo(options.id);
} }
this.queryTime();//
this.queryPerson(); this.queryPerson();
}, },
methods: { methods: {
@ -235,6 +230,8 @@
queryDetailInfo(id) { queryDetailInfo(id) {
this.$request(getApp().globalData.baseUrl + '/api/biz/highwayParentDataController/selectById/' + id, {}, 'GET').then(res => { this.$request(getApp().globalData.baseUrl + '/api/biz/highwayParentDataController/selectById/' + id, {}, 'GET').then(res => {
this.form = res.data; this.form = res.data;
this.queryTime();
this.queryStation();
}) })
}, },
// //
@ -401,13 +398,16 @@
let dateStr = getDateStr(now, 0); let dateStr = getDateStr(now, 0);
if(new Date(dateStr + ' 11:00').getTime() < new Date().getTime() && new Date().getTime() < new Date(dateStr + ' 13:30').getTime()) { if(new Date(dateStr + ' 11:00').getTime() < new Date().getTime() && new Date().getTime() < new Date(dateStr + ' 13:30').getTime()) {
this.form.statPeriod = '0012'; this.form.statPeriod = '0012';
this.index = this.array.findIndex(item => item.dictValue == '0012'); let idx = this.array.findIndex(item => item.dictValue == '0012');
this.index = idx > -1 ? idx : '';
}else{ }else{
this.form.statPeriod = '03'; //0-24 this.form.statPeriod = '03'; //0-24
this.index = this.array.findIndex(item => item.dictValue == '03'); let idx = this.array.findIndex(item => item.dictValue == '03');
this.index = idx > -1 ? idx : '';
} }
}else{ }else{
this.index = this.array.findIndex(item => item.dictValue == this.form.statPeriod); let idx = this.array.findIndex(item => item.dictValue == this.form.statPeriod);
this.index = idx > -1 ? idx : '';
} }
}) })
}, },
@ -579,14 +579,15 @@
&.picker { &.picker {
flex: 1; flex: 1;
display: flex; // display: flex;
justify-content: space-between; // justify-content: space-between;
/deep/ picker { // /deep/ picker {
flex: 1; // flex: 1;
} // }
.picker_select { .picker_select {
flex: 1;
color: #D4D4D4; color: #D4D4D4;
font-size: 28rpx; font-size: 28rpx;
font-family: PingFang SC-Regular, PingFang SC; font-family: PingFang SC-Regular, PingFang SC;

@ -34,7 +34,7 @@
</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 picker">
<picker :value="isOpenIndex" :range="isOpenArry" range-key="label" @change="changeIsOpen"> <picker :value="isOpenIndex" :range="isOpenArry" range-key="label" @change="changeIsOpen">
<text class="picker_select" <text class="picker_select"
:style="isOpenIndex > -1?'color:#333;':''">{{form.isOpen == 1 ? '开放' : form.isOpen === 0 ? '关闭' : '请选择'}}</text> :style="isOpenIndex > -1?'color:#333;':''">{{form.isOpen == 1 ? '开放' : form.isOpen === 0 ? '关闭' : '请选择'}}</text>
@ -111,9 +111,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 picker"> <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" <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-icons type="right" size="16" color="#D4D4D4"></uni-icons>
</uni-datetime-picker> </uni-datetime-picker>
</view> </view>
@ -121,9 +121,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 picker"> <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" <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-icons type="right" size="16" color="#D4D4D4"></uni-icons>
</uni-datetime-picker> </uni-datetime-picker>
</view> </view>
@ -196,9 +196,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 picker"> <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" <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-icons type="right" size="16" color="#D4D4D4"></uni-icons>
</uni-datetime-picker> </uni-datetime-picker>
</view> </view>
@ -206,9 +206,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 picker"> <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" <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-icons type="right" size="16" color="#D4D4D4"></uni-icons>
</uni-datetime-picker> </uni-datetime-picker>
</view> </view>
@ -232,7 +232,7 @@
<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="dictLabel" <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" <text class="picker_select"
:style="item.accidentLevelIndex?'color:#333;':''">{{item.accidentLevelIndex ? accidentLevel[item.accidentLevelIndex].dictLabel : '请选择'}}</text> :style="item.accidentLevelIndex?'color:#333;':''">{{item.accidentLevelIndex ? accidentLevel[item.accidentLevelIndex].dictLabel : '请选择'}}</text>
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons> <uni-icons type="right" size="16" color="#D4D4D4"></uni-icons>
@ -343,26 +343,21 @@
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'; this.pageType = 'add';
this.form.organizationName = this.userInfo.organizationName ? this.userInfo.organizationName : '';
let now = new Date(); let now = new Date();
this.form.statDate = getDateStr(now, -1); // this.form.statDate = getDateStr(now, -1); //
this.queryHighway(); // this.queryHighway(); //
this.queryAccidentLevel(); // this.queryAccidentLevel(); //
} else if (options.item) { this.queryTime(); //
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(); //
} else if (options.id) { } else if (options.id) {
this.queryDetailInfo(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 //id
queryDetailInfo(id) { queryDetailInfo(id) {
this.$request(getApp().globalData.baseUrl + '/api/biz/highSpeedOperationController/selectById/' + id, {}, this.$request(getApp().globalData.baseUrl + '/api/biz/highSpeedOperationController/selectById/' + id, {},
@ -371,6 +366,8 @@
this.form.highwayCongestionDetailDTOS = this.form.highwayCongestionDetailVOS; this.form.highwayCongestionDetailDTOS = this.form.highwayCongestionDetailVOS;
this.form.highwayAccidentDetailDTOS = this.form.highwayAccidentDetailVOS; this.form.highwayAccidentDetailDTOS = this.form.highwayAccidentDetailVOS;
this.queryAccidentLevel(); // this.queryAccidentLevel(); //
this.queryHighway(); //
this.queryTime(); //
}) })
}, },
// //
@ -393,7 +390,8 @@
console.log(this.form) 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].accidentLevelIndex = e.detail.value;
this.form[key][index].accidentLevel = this.accidentLevel[e.detail.value].dictValue; this.form[key][index].accidentLevel = this.accidentLevel[e.detail.value].dictValue;
}, },
@ -507,23 +505,29 @@
icon: 'none' icon: 'none'
}) })
return; return;
} }
let checkCongestion = this.form.highwayCongestionDetailDTOS.every(item => { let checkCongestion = true;
return !item.highwayName || !item.congestionStartTime || !item.congestionEndTime || !item if(this.form.highwayCongestionDetailDTOS.length > 0){
.duration || !item.location checkCongestion = this.form.highwayCongestionDetailDTOS.every(item => {
}) return item.highwayName && item.congestionStartTime && item.congestionEndTime && item
let checkAccident = this.form.highwayAccidentDetailDTOS.every(item => { .duration && item.location
return !item.highwayName || !item.accidentStartTime || !item.accidentEndTime || !item })
.duration || !item.location }
}) let checkAccident = true;
if (this.form.highwayCongestionDetailDTOS.length > 0 && checkCongestion) { 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({ uni.showToast({
title: '拥堵信息详情不能为空', title: '拥堵信息详情不能为空',
icon: 'none' icon: 'none'
}) })
return; return;
} }
if (this.form.highwayAccidentDetailDTOS.length > 0 && checkAccident) { if (!checkAccident) {
uni.showToast({ uni.showToast({
title: '事故信息详情不能为空', title: '事故信息详情不能为空',
icon: 'none' 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({ uni.showLoading({
title: '提交中...', title: '提交中...',
mask: true mask: true
@ -672,12 +684,12 @@
&.picker { &.picker {
flex: 1; flex: 1;
display: flex; // display: flex;
justify-content: space-between; // justify-content: space-between;
/deep/ picker { // /deep/ picker {
flex: 1; // flex: 1;
} // }
.picker_select { .picker_select {
color: #D4D4D4; color: #D4D4D4;

@ -252,14 +252,15 @@
let now = new Date(); let now = new Date();
this.form.statDate = getDateStr(now, -1); // this.form.statDate = getDateStr(now, -1); //
this.queryYoyMom(); // this.queryYoyMom(); //
this.queryTime(); //
} else if (options.id) { } else if (options.id) {
this.$request(getApp().globalData.baseUrl + '/api/biz/railwayRunData/find/' + options.id, {}, "GET").then( this.$request(getApp().globalData.baseUrl + '/api/biz/railwayRunData/find/' + options.id, {}, "GET").then(
res => { res => {
this.form = res.data; this.form = res.data;
this.queryYoyMom(); this.queryYoyMom();
this.queryTime(); //
}); });
} }
this.queryTime(); //
}, },
methods: { methods: {
// //
@ -550,12 +551,12 @@
&.picker { &.picker {
flex: 1; flex: 1;
display: flex; // display: flex;
justify-content: space-between; // justify-content: space-between;
/deep/ picker { // /deep/ picker {
flex: 1; // flex: 1;
} // }
.picker_select { .picker_select {
color: #D4D4D4; color: #D4D4D4;

@ -98,16 +98,14 @@
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); //
} else if (options.item) { this.queryTime(); //
this.form = JSON.parse(options.item); } if (options.id) {
console.log(this.form);
}else if (options.id) {
this.$request(getApp().globalData.baseUrl+'/api/biz/railwayRunSituation/find//'+options.id,{},"GET").then(res => { this.$request(getApp().globalData.baseUrl+'/api/biz/railwayRunSituation/find//'+options.id,{},"GET").then(res => {
this.form = res.data; this.form = res.data;
this.queryYoyMom(); this.queryYoyMom();
this.queryTime(); //
}); });
} }
this.queryTime(); //
}, },
methods: { methods: {
// //
@ -346,12 +344,12 @@
&.picker { &.picker {
flex: 1; flex: 1;
display: flex; // display: flex;
justify-content: space-between; // justify-content: space-between;
/deep/ picker { // /deep/ picker {
flex: 1; // flex: 1;
} // }
.picker_select { .picker_select {
color: #D4D4D4; color: #D4D4D4;

@ -6,15 +6,11 @@
</view> </view>
<view class="form_item_box"> <view class="form_item_box">
<view class="form_item_title">基本信息</view> <view class="form_item_title">基本信息</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 select">
<picker :value="railwayNameIndex" :range="stationList" @change="changeRailway"> {{form.affiliatedUnit}}
<text class="picker_select" </view>
:style="form.railwayName?'color:#333;':''">{{form.railwayName?form.railwayName:'请选择'}}</text>
<uni-icons type="right" size="16" color="#D4D4D4"></uni-icons>
</picker>
</view>
</view> </view>
<view class="form_item"> <view class="form_item">
<view class="form_item_label">统计日期</view> <view class="form_item_label">统计日期</view>
@ -146,17 +142,19 @@
this.userInfo = uni.getStorageSync('userInfo'); this.userInfo = uni.getStorageSync('userInfo');
if (options.type == 'add') { if (options.type == 'add') {
this.pageType = 'add'; this.pageType = 'add';
let now = new Date(); let now = new Date();
this.form.affiliatedUnit = this.userInfo.organizationName ? this.userInfo.organizationName : '';
this.form.statDate = getDateStr(now, -1); // this.form.statDate = getDateStr(now, -1); //
this.queryYoyMom(); // this.queryYoyMom(); //
this.queryTime(); //
} else if (options.id) { } else if (options.id) {
this.$request(getApp().globalData.baseUrl + '/api/biz/watertransportRunData/find/' + options.id, {}, "GET").then( this.$request(getApp().globalData.baseUrl + '/api/biz/watertransportRunData/find/' + options.id, {}, "GET").then(
res => { res => {
this.form = res.data; this.form = res.data;
this.queryYoyMom(); this.queryYoyMom();
this.queryTime(); //
}); });
} }
this.queryTime(); //
}, },
methods: { methods: {
// //
@ -426,12 +424,12 @@
&.picker { &.picker {
flex: 1; flex: 1;
display: flex; // display: flex;
justify-content: space-between; // justify-content: space-between;
/deep/ picker { // /deep/ picker {
flex: 1; // flex: 1;
} // }
.picker_select { .picker_select {
color: #D4D4D4; color: #D4D4D4;

Loading…
Cancel
Save