fix()
parent
0fd92a2733
commit
8428ca90ae
|
|
@ -187,7 +187,10 @@
|
|||
|
||||
<th style="width: 50%; color: #59a7ff">降雨量(mm)</th>
|
||||
</tr>
|
||||
<div style="max-height: 260px; overflow-y: auto">
|
||||
<div
|
||||
style="max-height: 260px; overflow-y: auto"
|
||||
v-if="tableData.data"
|
||||
>
|
||||
<tr
|
||||
v-for="(item, index) in tableData.data.data"
|
||||
:key="index"
|
||||
|
|
|
|||
|
|
@ -315,16 +315,6 @@
|
|||
@select="severitySelect"
|
||||
>
|
||||
</u-action-sheet>
|
||||
|
||||
<!-- 是否已管控 -->
|
||||
<u-action-sheet
|
||||
:show="isControlled"
|
||||
:actions="actions"
|
||||
title="请选择"
|
||||
@close="isControlled = false"
|
||||
@select="controlledSelect"
|
||||
>
|
||||
</u-action-sheet>
|
||||
</view> </view
|
||||
></view>
|
||||
<view v-if="isMap">
|
||||
|
|
@ -419,23 +409,15 @@ export default {
|
|||
message: '请选择时间',
|
||||
trigger: ['blur', 'change']
|
||||
}
|
||||
],
|
||||
severity: [
|
||||
{
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '请选择严重程度',
|
||||
trigger: ['blur', 'change']
|
||||
}
|
||||
],
|
||||
address: [
|
||||
{
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '请选择',
|
||||
trigger: ['blur', 'change']
|
||||
}
|
||||
]
|
||||
// severity: [
|
||||
// {
|
||||
// type: 'string',
|
||||
// required: true,
|
||||
// message: '请选择严重程度',
|
||||
// trigger: ['blur', 'change']
|
||||
// }
|
||||
// ]
|
||||
},
|
||||
projectType: 1
|
||||
}
|
||||
|
|
@ -451,6 +433,7 @@ export default {
|
|||
console.log('搜索框22key', this.key)
|
||||
// 如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则
|
||||
this.$refs.form3.setRules(this.rules2)
|
||||
this.$refs.form3.setRules(this.rules2)
|
||||
},
|
||||
methods: {
|
||||
back (lnglat, address) {
|
||||
|
|
@ -459,7 +442,9 @@ export default {
|
|||
this.formList.lgtd = lnglat[0]
|
||||
this.formList.lttd = lnglat[1]
|
||||
this.formList.address = address
|
||||
this.$refs.form3.validateField('address')
|
||||
// this.$refs.form3.validateField('address')
|
||||
|
||||
console.log('搜索框22key', lnglat, this.formList.address)
|
||||
},
|
||||
toMap () {
|
||||
this.isMap = true
|
||||
|
|
@ -591,56 +576,63 @@ export default {
|
|||
this.formList.severity = e.name
|
||||
this.$refs.form3.validateField('severity')
|
||||
},
|
||||
controlledSelect (e) {
|
||||
this.formList.isControlled = e.name
|
||||
this.$refs.form3.validateField('isControlled')
|
||||
},
|
||||
|
||||
submit () {
|
||||
this.$refs.form3
|
||||
.validate()
|
||||
if (this.formList.address == '') {
|
||||
uni.$u.toast('请选择灾害发生地点')
|
||||
return
|
||||
}
|
||||
if (this.formList.severity == '') {
|
||||
uni.$u.toast('请选择严重程度')
|
||||
return
|
||||
}
|
||||
if (this.formList.otime == '') {
|
||||
uni.$u.toast('请选择灾害发生时间')
|
||||
return
|
||||
}
|
||||
// this.$refs.form3
|
||||
// .validate()
|
||||
// .then(res => {
|
||||
let params = Object.assign(this.formList)
|
||||
// 严重程度(1一般险情 2较大险情 3重大险情 4特别重大险情
|
||||
if (this.formList.severity == '一般险情') {
|
||||
params.severity = 1
|
||||
} else if (this.formList.severity == '较大险情') {
|
||||
params.severity = 2
|
||||
} else if (this.formList.severity == '重大险情') {
|
||||
params.severity = 3
|
||||
} else if (this.formList.severity == '特别重大险情') {
|
||||
params.severity = 4
|
||||
}
|
||||
// params.adcd = ''
|
||||
|
||||
if (this.fileList1.length > 0) {
|
||||
params.fileId = this.fileList1.map(item => {
|
||||
return JSON.parse(item.url).data.fileId
|
||||
})
|
||||
}
|
||||
|
||||
uni.$http
|
||||
.post('/gunshiApp/xfflood/iaCHsfwater/insert', params)
|
||||
.then(res => {
|
||||
uni.$u.toast('校验通过', res)
|
||||
let params = Object.assign(this.formList)
|
||||
// 严重程度(1一般险情 2较大险情 3重大险情 4特别重大险情
|
||||
if (this.formList.severity == '一般险情') {
|
||||
params.severity = 1
|
||||
} else if (this.formList.severity == '较大险情') {
|
||||
params.severity = 2
|
||||
} else if (this.formList.severity == '重大险情') {
|
||||
params.severity = 3
|
||||
} else if (this.formList.severity == '特别重大险情') {
|
||||
params.severity = 4
|
||||
}
|
||||
// params.adcd = ''
|
||||
|
||||
if (this.fileList1.length > 0) {
|
||||
params.fileId = this.fileList1.map(item => {
|
||||
return JSON.parse(item.url).data.fileId
|
||||
console.log('this.---', res)
|
||||
if (res.data.code == 200) {
|
||||
console.log('this.model122', res.data)
|
||||
uni.reLaunch({
|
||||
url: '/pages/xxsb/index'
|
||||
})
|
||||
}
|
||||
|
||||
uni.$http
|
||||
.post('/gunshiApp/xfflood/iaCHsfwater/insert', params)
|
||||
.then(res => {
|
||||
console.log('this.---', res)
|
||||
if (res.data.code == 200) {
|
||||
console.log('this.model122', res.data)
|
||||
uni.reLaunch({
|
||||
url: '/pages/xxsb/index'
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
.catch(errors => {
|
||||
uni.$u.toast('校验失败', errors)
|
||||
console.log('校验失败')
|
||||
})
|
||||
// })
|
||||
// .catch(errors => {
|
||||
// uni.$u.toast('校验失败', errors)
|
||||
// console.log('校验失败')
|
||||
// })
|
||||
|
||||
// 如果有错误,会在catch中返回报错信息数组,校验通过则在then中返回true
|
||||
},
|
||||
reset () {
|
||||
const validateList = ['otime', 'severity', 'address']
|
||||
const validateList = ['otime', 'severity']
|
||||
this.$refs.form3.resetFields()
|
||||
this.$refs.form3.clearValidate()
|
||||
setTimeout(() => {
|
||||
|
|
@ -661,6 +653,7 @@ export default {
|
|||
this.valueTime2 = Number(val)
|
||||
this.formList.otime = moment(val.value).format('YYYY-MM-DD HH:mm:ss')
|
||||
this.isTime2 = false
|
||||
this.$refs.form3.validateField('otime')
|
||||
},
|
||||
cancel2 () {
|
||||
console.log('取消')
|
||||
|
|
|
|||
|
|
@ -32,7 +32,9 @@ export default {
|
|||
onLoad () {},
|
||||
methods: {
|
||||
navigateBack () {
|
||||
uni.navigateBack()
|
||||
uni.reLaunch({
|
||||
url: '/pages/homeIndex/index'
|
||||
})
|
||||
},
|
||||
todetail (val) {
|
||||
console.log('val', val)
|
||||
|
|
|
|||
Loading…
Reference in New Issue