|
@@ -1,18 +1,37 @@
|
|
|
<template>
|
|
|
<view class="uni-container uni-container-bg">
|
|
|
+ <view class="example container" :style="'height: ' + (screenHeight - wheight - 75) + 'px'">
|
|
|
<view class="event">
|
|
|
<view class="event-title">事件时间</view>
|
|
|
- <uni-datetime-picker class="time-item-check" type="date" :clear-icon="false" v-model="eventTime"
|
|
|
+ <uni-datetime-picker class="time-item-check" type="date" :clear-icon="false":disabled="isview" v-model="eventTime"
|
|
|
@maskClick="startMaskClick" placeholder="请选择事件时间" />
|
|
|
<view class="content">
|
|
|
+ <view class="event-title">出动人数</view>
|
|
|
+ <u-input v-model="eventPeples" placeholder="请输入出动人数" :maxlength="1000" :disabled="isview" count height="150">
|
|
|
+ </u-input>
|
|
|
+ </view>
|
|
|
+ <view class="content">
|
|
|
+ <view class="event-title">燃烧面积</view>
|
|
|
+ <u-input v-model="burnArea" placeholder="请输入燃烧面积" :maxlength="1000" :disabled="isview" count height="150">
|
|
|
+ </u-input>
|
|
|
+ </view>
|
|
|
+ <view class="content">
|
|
|
+ <view class="event-title">过火面积</view>
|
|
|
+ <u-input v-model="fireArea" placeholder="请输入过火面积" :maxlength="1000" :disabled="isview" count height="150">
|
|
|
+ </u-input>
|
|
|
+ </view>
|
|
|
+ <view class="content" style="margin-bottom: 60rpx;">
|
|
|
<view class="event-title">事件内容</view>
|
|
|
- <u--textarea v-model="eventContent" placeholder="请输入内容" :maxlength="1000" count height="150">
|
|
|
- </u--textarea>
|
|
|
+ <u--textarea v-model="eventContent" placeholder="请输入内容" :disabled="isview" :maxlength="1000" count height="150">
|
|
|
+ </u--textarea >
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="bottons">
|
|
|
+ </view>
|
|
|
+ <view class="bottons heigthButton" v-if="!isview">
|
|
|
<view class="buttons-item">
|
|
|
- <u-button shape="circle" type="primary" text="取消" :custom-style="{color:'#4CB2B6',backgroundColor: '#fff',border:'1px solid #fff',marginRight:'10px'}" @click="cancel">
|
|
|
+ <u-button shape="circle" type="primary" text="取消"
|
|
|
+ :custom-style="{color:'#4CB2B6',backgroundColor: '#fff',border:'1px solid #fff',marginRight:'10px'}"
|
|
|
+ @click="cancel">
|
|
|
</u-button>
|
|
|
<u-button shape="circle" type="primary" color="#4CB2B6" text="保存" @click="submit">
|
|
|
</u-button>
|
|
@@ -26,62 +45,92 @@
|
|
|
import riliicon from '@/static/images/riliicon.png'
|
|
|
import {
|
|
|
createStationEvent,
|
|
|
- getOneMicrostation,//编辑获取
|
|
|
+ getOneMicrostation, //编辑获取
|
|
|
updateOrgReport
|
|
|
} from '@/api/fire_station/index';
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ screenHeight: this.$screenHeight,
|
|
|
+ wheight: '',
|
|
|
eventContent: '',
|
|
|
eventTime: '',
|
|
|
riliicon: riliicon,
|
|
|
- isEditId:false
|
|
|
+ isEditId: false,
|
|
|
+ eventPeples:'',//出动人数
|
|
|
+ burnArea:"",//燃烧面积
|
|
|
+ fireArea:'',//过火面积
|
|
|
+ runId:'',
|
|
|
+ isview:false
|
|
|
}
|
|
|
},
|
|
|
onLoad: function(option) {
|
|
|
- if(option.id){
|
|
|
- this.isEditId=option.id
|
|
|
+ if(option.isview=="isview"){
|
|
|
+ this.isview=true
|
|
|
+ }
|
|
|
+ this.runId=option.runId
|
|
|
+ if (option.id) {
|
|
|
+ this.isEditId = option.id
|
|
|
getOneMicrostation({
|
|
|
- id:option.id
|
|
|
+ id: option.id
|
|
|
}).then(reponse => {
|
|
|
- this.eventTime=reponse.data.eventTime
|
|
|
- this.eventContent=reponse.data.eventContent
|
|
|
- console.log(reponse,'opt');
|
|
|
+ this.eventTime = reponse.data.eventTime
|
|
|
+ this.eventContent = reponse.data.eventContent
|
|
|
+ this.eventPeples=reponse.data.eventPeples,//出动人数
|
|
|
+ this.burnArea=reponse.data.burnArea,//燃烧面积
|
|
|
+ this.fireArea=reponse.data.fireArea,//过火面积
|
|
|
+ console.log(reponse, 'opt');
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
+ mounted() {
|
|
|
+ uni.createSelectorQuery().in(this).select('.heigthButton').boundingClientRect(data => {
|
|
|
+ this.wheight = data.height
|
|
|
+ }).exec()
|
|
|
+ },
|
|
|
methods: {
|
|
|
submit() {
|
|
|
- const that=this
|
|
|
- if(!this.eventContent){return this.$modal.msgError('请填写事件内容')}
|
|
|
- if(!this.eventTime){return this.$modal.msgError('请选择事件时间')}
|
|
|
- if(!this.isEditId){
|
|
|
+ console.log(this.runId,'this.runIdthis.runId');
|
|
|
+ const that = this
|
|
|
+ if (!this.eventContent) {
|
|
|
+ return this.$modal.msgError('请填写事件内容')
|
|
|
+ }
|
|
|
+ if (!this.eventTime) {
|
|
|
+ return this.$modal.msgError('请选择事件时间')
|
|
|
+ }
|
|
|
+ if (!this.isEditId) {
|
|
|
createStationEvent({
|
|
|
eventContent: this.eventContent,
|
|
|
- eventTime:this.eventTime+''
|
|
|
+ eventTime: this.eventTime + '',
|
|
|
+ eventPeples:this.eventPeples,//出动人数
|
|
|
+ burnArea:this.burnArea,//燃烧面积
|
|
|
+ fireArea:this.fireArea,//过火面积
|
|
|
+ microstationid:this.runId
|
|
|
}).then(reponse => {
|
|
|
- that.$modal.msg('保存成功')
|
|
|
- setTimeout(() => {
|
|
|
- uni.navigateBack()
|
|
|
- }, 400)
|
|
|
-
|
|
|
- }).catch(err=>{
|
|
|
- })
|
|
|
- }else{
|
|
|
+ that.$modal.msg('保存成功')
|
|
|
+ setTimeout(() => {
|
|
|
+ uni.navigateBack()
|
|
|
+ }, 400)
|
|
|
+
|
|
|
+ }).catch(err => {})
|
|
|
+ } else {
|
|
|
updateOrgReport({
|
|
|
eventContent: this.eventContent,
|
|
|
- eventTime:this.eventTime+'',
|
|
|
- id:this.isEditId
|
|
|
+ eventTime: this.eventTime + '',
|
|
|
+ id: this.isEditId,
|
|
|
+ eventPeples:this.eventPeples,//出动人数
|
|
|
+ burnArea:this.burnArea,//燃烧面积
|
|
|
+ fireArea:this.fireArea,//过火面积
|
|
|
+ microstationid:this.runId
|
|
|
}).then(reponse => {
|
|
|
- that.$modal.msg('编辑成功')
|
|
|
- setTimeout(() => {
|
|
|
- uni.navigateBack()
|
|
|
- }, 400)
|
|
|
-
|
|
|
- }).catch(err=>{
|
|
|
- })
|
|
|
+ that.$modal.msg('编辑成功')
|
|
|
+ setTimeout(() => {
|
|
|
+ uni.navigateBack()
|
|
|
+ }, 400)
|
|
|
+
|
|
|
+ }).catch(err => {})
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
cancel() {
|
|
|
uni.navigateBack()
|
|
@@ -106,8 +155,8 @@
|
|
|
.event {
|
|
|
margin-top: 40rpx;
|
|
|
background-color: #F5F7F9;
|
|
|
-
|
|
|
- .content {
|
|
|
+
|
|
|
+ .content {
|
|
|
margin-top: 40rpx
|
|
|
}
|
|
|
|
|
@@ -127,14 +176,17 @@
|
|
|
left: 14rpx;
|
|
|
top: 16rpx
|
|
|
}
|
|
|
- /deep/ .uni-input-placeholder{
|
|
|
+
|
|
|
+ /deep/ .uni-input-placeholder {
|
|
|
left: 44rpx !important;
|
|
|
}
|
|
|
- /deep/.uni-input-input{
|
|
|
+
|
|
|
+ /deep/.uni-input-input {
|
|
|
margin-left: 40rpx;
|
|
|
}
|
|
|
|
|
|
- /deep/ .uni-date-x[data-v-6e13d7e2],/deep/ .uni-date-x {
|
|
|
+ /deep/ .uni-date-x[data-v-6e13d7e2],
|
|
|
+ /deep/ .uni-date-x {
|
|
|
height: 72rpx
|
|
|
}
|
|
|
|
|
@@ -152,7 +204,13 @@
|
|
|
|
|
|
position: fixed;
|
|
|
left: 0;
|
|
|
- bottom: 100rpx;
|
|
|
+ bottom: 30rpx;
|
|
|
right: 0;
|
|
|
}
|
|
|
-</style>
|
|
|
+ /deep/ .u-input{
|
|
|
+ background: #fff;
|
|
|
+ }
|
|
|
+ .example {
|
|
|
+ overflow-y: auto;
|
|
|
+ }
|
|
|
+</style>
|