feat: 实时工情上报
parent
62e0a66a3e
commit
6faebcfcc6
|
|
@ -362,14 +362,6 @@ export default {
|
|||
chcount: '',
|
||||
spcount: '',
|
||||
elose: '',
|
||||
|
||||
projectName: '', //工程名称
|
||||
projectType: '', //工程类型
|
||||
|
||||
isControlled: '', // 是否已管控(0 否 1 是)
|
||||
incidentDescription: '',
|
||||
controlResponsiblePerson: '', // 管控责任人
|
||||
responsiblePersonPhone: '', //责任人电话
|
||||
remark: ''
|
||||
},
|
||||
|
||||
|
|
@ -404,11 +396,11 @@ export default {
|
|||
}
|
||||
],
|
||||
rules: {
|
||||
projectName: [
|
||||
otime: [
|
||||
{
|
||||
type: 'string',
|
||||
required: true,
|
||||
message: '请选择工程名称',
|
||||
message: '请选择时间',
|
||||
trigger: ['blur', 'change']
|
||||
}
|
||||
]
|
||||
|
|
@ -425,11 +417,7 @@ export default {
|
|||
onReady () {
|
||||
console.log('搜索框22key', this.key)
|
||||
// 如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则
|
||||
if (this.key == 1) {
|
||||
this.$refs.form1.setRules(this.rules)
|
||||
} else if (this.key == 1) {
|
||||
this.$refs.form2.setRules(this.rules)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getresList () {
|
||||
|
|
@ -482,8 +470,6 @@ export default {
|
|||
item.isShow = true
|
||||
this.gclabel = item.resName
|
||||
this.formList.projectName = item.resName
|
||||
|
||||
this.$refs.form1.validateField('isPowerGeneration')
|
||||
} else {
|
||||
item.isShow = false
|
||||
}
|
||||
|
|
@ -536,15 +522,12 @@ export default {
|
|||
uploadFilePromise (url) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let a = uni.uploadFile({
|
||||
url: uni.$http.baseUrl + '/xfProjectRun/file/upload/singleSimple', // 仅为示例,非真实的接口地址
|
||||
url: `${uni.$http.baseUrl}/gunshiApp/xfflood/iaCHsfwater/file/upload/singleSimple`,
|
||||
filePath: url,
|
||||
name: 'file',
|
||||
formData: {
|
||||
user: 'test'
|
||||
},
|
||||
success: res => {
|
||||
setTimeout(() => {
|
||||
resolve(res.data.data)
|
||||
resolve(res.data)
|
||||
}, 1000)
|
||||
}
|
||||
})
|
||||
|
|
@ -552,12 +535,7 @@ export default {
|
|||
},
|
||||
|
||||
open () {},
|
||||
groupChange (n) {
|
||||
// console.log('groupChange', n);
|
||||
},
|
||||
radioChange (n) {
|
||||
// console.log('radioChange', n);
|
||||
},
|
||||
|
||||
navigateBack () {
|
||||
uni.navigateBack()
|
||||
},
|
||||
|
|
@ -573,25 +551,29 @@ export default {
|
|||
},
|
||||
|
||||
submit () {
|
||||
if (key == 2) {
|
||||
this.$refs.form2
|
||||
.validate()
|
||||
.then(res => {
|
||||
uni.$u.toast('校验通过', res)
|
||||
|
||||
debugger
|
||||
let params = Object.assign(this.formList)
|
||||
if (this.fileId !== '') {
|
||||
params = Object.assign(this.formList, this.fileId)
|
||||
}
|
||||
// 严重程度(1一般险情 2较大险情 3重大险情 4特别重大险情
|
||||
let type = {
|
||||
一般险情: 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
|
||||
})
|
||||
}
|
||||
params.severity = this.formLis.severity[type]
|
||||
params.projectType = this.params.projectType
|
||||
|
||||
uni.$http
|
||||
.post('/gunshiApp/xfflood/iaCHsfwater/insert', params)
|
||||
|
|
@ -606,50 +588,14 @@ export default {
|
|||
})
|
||||
})
|
||||
.catch(errors => {
|
||||
uni.$u.toast('校验失败', res)
|
||||
uni.$u.toast('校验失败', errors)
|
||||
console.log('校验失败')
|
||||
})
|
||||
} else if (key == 3) {
|
||||
this.$refs.form3
|
||||
.validate()
|
||||
.then(res => {
|
||||
uni.$u.toast('校验通过', res)
|
||||
console.log('this.==', this.formList)
|
||||
|
||||
let params = Object.assign(this.formList)
|
||||
if (this.fileId !== '') {
|
||||
params = Object.assign(this.formList, this.fileId)
|
||||
}
|
||||
// 严重程度(1一般险情 2较大险情 3重大险情 4特别重大险情
|
||||
let type = {
|
||||
一般险情: 1,
|
||||
较大险情: 2,
|
||||
重大险情: 3,
|
||||
特别重大险情: 4
|
||||
}
|
||||
params.severity = this.formLis.severity[type]
|
||||
params.projectType = this.params.projectType
|
||||
|
||||
uni.$http
|
||||
.post('/gunshiApp/xfProjectIncident/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('校验失败', res)
|
||||
})
|
||||
} else {
|
||||
}
|
||||
// 如果有错误,会在catch中返回报错信息数组,校验通过则在then中返回true
|
||||
},
|
||||
reset () {
|
||||
const validateList = ['projectName', 'isPowerGeneration', 'radiovalue1']
|
||||
const validateList = ['projectName', 'radiovalue1']
|
||||
this.$refs.form1.resetFields()
|
||||
this.$refs.form1.clearValidate()
|
||||
setTimeout(() => {
|
||||
|
|
|
|||
|
|
@ -139,133 +139,6 @@
|
|||
></u-upload>
|
||||
</u-form-item>
|
||||
</u--form>
|
||||
<!-- 工程详情上报 -->
|
||||
<u--form
|
||||
labelPosition="left"
|
||||
:model="formList"
|
||||
ref="form2"
|
||||
labelWidth="100"
|
||||
v-if="key == 2"
|
||||
>
|
||||
<u-form-item
|
||||
label="工程名称"
|
||||
prop="projectName"
|
||||
@click="
|
||||
isName = true
|
||||
hideKeyboard()
|
||||
"
|
||||
:borderBottom="false"
|
||||
ref="item1"
|
||||
>
|
||||
<u--input
|
||||
placeholder="请选择"
|
||||
v-model="model1.projectName"
|
||||
suffixIcon="arrow-right"
|
||||
suffixIconStyle="color: #909399"
|
||||
></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item
|
||||
label="严重程度"
|
||||
prop="severityList"
|
||||
:borderBottom="false"
|
||||
@click="
|
||||
isseverity = true
|
||||
hideKeyboard()
|
||||
"
|
||||
ref="item1"
|
||||
>
|
||||
<u--input
|
||||
placeholder="请选择"
|
||||
v-model="formList.severity"
|
||||
suffixIcon="arrow-right"
|
||||
suffixIconStyle="color: #909399"
|
||||
></u--input>
|
||||
</u-form-item>
|
||||
<u-form-item
|
||||
label="是否已管控"
|
||||
prop="isControlled"
|
||||
:borderBottom="false"
|
||||
@click="
|
||||
isControlled = true
|
||||
hideKeyboard()
|
||||
"
|
||||
ref="item1"
|
||||
>
|
||||
<u--input
|
||||
placeholder="请选择"
|
||||
v-model="formList.isControlled"
|
||||
suffixIcon="arrow-right"
|
||||
suffixIconStyle="color: #909399"
|
||||
></u--input>
|
||||
</u-form-item>
|
||||
<!-- 水位(m) -->
|
||||
<u-form-item
|
||||
label="险情描述"
|
||||
prop="incidentDescription"
|
||||
:borderBottom="false"
|
||||
ref="item3"
|
||||
>
|
||||
<u--textarea
|
||||
placeholder="请输入"
|
||||
v-model="formList.incidentDescription"
|
||||
count
|
||||
></u--textarea>
|
||||
</u-form-item>
|
||||
<!-- 管控责任人: -->
|
||||
<u-form-item label="管控责任人" prop="controlResponsiblePerson" ref="item3">
|
||||
<u--input
|
||||
v-model="formList.controlResponsiblePerson"
|
||||
placeholder="请输入"
|
||||
border="surround"
|
||||
clearable
|
||||
></u--input>
|
||||
</u-form-item>
|
||||
<!-- 出库流量 (m³/s): -->
|
||||
<u-form-item
|
||||
label="联系电话"
|
||||
prop="responsiblePersonPhone"
|
||||
:borderBottom="false"
|
||||
ref="item3"
|
||||
>
|
||||
<u--input
|
||||
v-model="formList.responsiblePersonPhone"
|
||||
placeholder="请输入"
|
||||
type="number"
|
||||
clearable
|
||||
border="surround"
|
||||
@blur="BlurText($event)"
|
||||
></u--input>
|
||||
</u-form-item>
|
||||
<!-- 其他运行情况 -->
|
||||
<u-form-item
|
||||
label="其他情况说明"
|
||||
prop="remark"
|
||||
:borderBottom="false"
|
||||
ref="item3"
|
||||
>
|
||||
<u--textarea
|
||||
placeholder="请输入"
|
||||
v-model="formList.remark"
|
||||
count
|
||||
></u--textarea>
|
||||
</u-form-item>
|
||||
<u-form-item
|
||||
label="附件"
|
||||
prop="fileList"
|
||||
:borderBottom="false"
|
||||
ref="item3"
|
||||
>
|
||||
<u-upload
|
||||
:fileList="fileList1"
|
||||
@afterRead="afterRead"
|
||||
@delete="deletePic"
|
||||
name="1"
|
||||
multiple
|
||||
:maxCount="10"
|
||||
:previewFullImage="true"
|
||||
></u-upload>
|
||||
</u-form-item>
|
||||
</u--form>
|
||||
|
||||
<u-button
|
||||
type="primary"
|
||||
|
|
@ -389,7 +262,6 @@
|
|||
@select="controlledSelect"
|
||||
>
|
||||
</u-action-sheet>
|
||||
</u-action-sheet>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -423,9 +295,8 @@ export default {
|
|||
severity: '', // 严重程度(1一般险情 2较大险情 3重大险情 4特别重大险情)
|
||||
isControlled: '', // 是否已管控(0 否 1 是)
|
||||
incidentDescription: '',
|
||||
controlResponsiblePerson:"", // 管控责任人
|
||||
controlResponsiblePerson: '', // 管控责任人
|
||||
responsiblePersonPhone: '' //责任人电话
|
||||
|
||||
},
|
||||
model1: {
|
||||
projectName: '',
|
||||
|
|
@ -445,20 +316,16 @@ export default {
|
|||
|
||||
severityList: [
|
||||
{
|
||||
name: '一般险情',
|
||||
|
||||
name: '一般险情'
|
||||
},
|
||||
{
|
||||
name: '较大险情',
|
||||
|
||||
name: '较大险情'
|
||||
},
|
||||
{
|
||||
name: '重大险情',
|
||||
|
||||
name: '重大险情'
|
||||
},
|
||||
{
|
||||
name: '特别重大险情',
|
||||
|
||||
name: '特别重大险情'
|
||||
}
|
||||
],
|
||||
|
||||
|
|
@ -492,11 +359,7 @@ export default {
|
|||
onReady () {
|
||||
console.log('搜索框22key', this.key)
|
||||
// 如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则
|
||||
if (this.key == 1) {
|
||||
this.$refs.form1.setRules(this.rules)
|
||||
} else if(this.key == 1) {
|
||||
this.$refs.form2.setRules(this.rules)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getresList () {
|
||||
|
|
@ -586,6 +449,8 @@ export default {
|
|||
})
|
||||
for (let i = 0; i < lists.length; i++) {
|
||||
const result = await this.uploadFilePromise(lists[i].url)
|
||||
console.log('result', JSON.parse(result))
|
||||
|
||||
let item = this[`fileList${event.name}`][fileListLen]
|
||||
this[`fileList${event.name}`].splice(
|
||||
fileListLen,
|
||||
|
|
@ -602,27 +467,19 @@ export default {
|
|||
uploadFilePromise (url) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let a = uni.uploadFile({
|
||||
url: uni.$http.baseUrl + '/xfProjectRun/file/upload/singleSimple', // 仅为示例,非真实的接口地址
|
||||
url: `${uni.$http.baseUrl}/gunshiApp/xfflood/xfProjectRun/file/upload/singleSimple`,
|
||||
filePath: url,
|
||||
name: 'file',
|
||||
formData: {
|
||||
user: 'test'
|
||||
},
|
||||
success: res => {
|
||||
console.log('res888', JSON.parse(res.data))
|
||||
setTimeout(() => {
|
||||
resolve(res.data.data)
|
||||
resolve(res.data)
|
||||
this.fileId = JSON.parse(res.data).data.fileId
|
||||
}, 1000)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
afterRead (event) {
|
||||
this.fileList1.push({
|
||||
url: event.file,
|
||||
status: 'uploading',
|
||||
message: '上传中'
|
||||
})
|
||||
},
|
||||
|
||||
open () {},
|
||||
groupChange (n) {
|
||||
|
|
@ -655,23 +512,25 @@ export default {
|
|||
this.$refs.form2.validateField('isControlled')
|
||||
},
|
||||
|
||||
|
||||
submit () {
|
||||
if(key ==1){
|
||||
this.$refs.form1
|
||||
.validate()
|
||||
.then(res => {
|
||||
uni.$u.toast('校验通过', res)
|
||||
console.log('this.model1', this.model1)
|
||||
debugger
|
||||
console.log('文件', this.fileId)
|
||||
|
||||
let params = Object.assign(this.model1)
|
||||
if (this.fileId !== '') {
|
||||
params = Object.assign(this.model1, this.fileId)
|
||||
}
|
||||
params.projectType = this.params.projectType
|
||||
let params = this.model1
|
||||
|
||||
params.projectType = this.projectType
|
||||
params.isPowerGeneration = params.isPowerGeneration == '是' ? 1 : 0
|
||||
params.isFloodRelease = params.isFloodRelease == '是' ? 1 : 0
|
||||
|
||||
console.log('参数', params)
|
||||
|
||||
if (this.fileId != '') {
|
||||
params.fileId = [this.fileId]
|
||||
}
|
||||
|
||||
uni.$http
|
||||
.post('/gunshiApp/xfflood/xfProjectRun/insert', params)
|
||||
.then(res => {
|
||||
|
|
@ -685,11 +544,10 @@ export default {
|
|||
})
|
||||
})
|
||||
.catch(errors => {
|
||||
uni.$u.toast('校验失败', res)
|
||||
uni.$u.toast('校验失败', errors)
|
||||
})
|
||||
}
|
||||
// 如果有错误,会在catch中返回报错信息数组,校验通过则在then中返回true
|
||||
|
||||
// 如果有错误,会在catch中返回报错信息数组,校验通过则在then中返回true
|
||||
},
|
||||
reset () {
|
||||
const validateList = ['projectName', 'isPowerGeneration', 'radiovalue1']
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
:model="formList"
|
||||
ref="form2"
|
||||
labelWidth="100"
|
||||
v-if="key == 2"
|
||||
>
|
||||
<u-form-item
|
||||
label="工程名称"
|
||||
|
|
@ -83,7 +82,11 @@
|
|||
></u--textarea>
|
||||
</u-form-item>
|
||||
<!-- 管控责任人: -->
|
||||
<u-form-item label="管控责任人" prop="controlResponsiblePerson" ref="item3">
|
||||
<u-form-item
|
||||
label="管控责任人"
|
||||
prop="controlResponsiblePerson"
|
||||
ref="item3"
|
||||
>
|
||||
<u--input
|
||||
v-model="formList.controlResponsiblePerson"
|
||||
placeholder="请输入"
|
||||
|
|
@ -147,7 +150,6 @@
|
|||
|
||||
<!-- 下拉选择 -->
|
||||
|
||||
|
||||
<!-- mode="top" -->
|
||||
<view v-if="isName">
|
||||
<u-popup
|
||||
|
|
@ -244,7 +246,6 @@
|
|||
@select="controlledSelect"
|
||||
>
|
||||
</u-action-sheet>
|
||||
</u-action-sheet>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -278,13 +279,11 @@ export default {
|
|||
severity: '', // 严重程度(1一般险情 2较大险情 3重大险情 4特别重大险情)
|
||||
isControlled: '', // 是否已管控(0 否 1 是)
|
||||
incidentDescription: '',
|
||||
controlResponsiblePerson:"", // 管控责任人
|
||||
controlResponsiblePerson: '', // 管控责任人
|
||||
responsiblePersonPhone: '', //责任人电话
|
||||
remark:""
|
||||
|
||||
remark: ''
|
||||
},
|
||||
|
||||
fileIds: [],
|
||||
isControlled: false,
|
||||
isseverity: false, // 严重程度
|
||||
showSex: false,
|
||||
|
|
@ -293,20 +292,16 @@ export default {
|
|||
|
||||
severityList: [
|
||||
{
|
||||
name: '一般险情',
|
||||
|
||||
name: '一般险情'
|
||||
},
|
||||
{
|
||||
name: '较大险情',
|
||||
|
||||
name: '较大险情'
|
||||
},
|
||||
{
|
||||
name: '重大险情',
|
||||
|
||||
name: '重大险情'
|
||||
},
|
||||
{
|
||||
name: '特别重大险情',
|
||||
|
||||
name: '特别重大险情'
|
||||
}
|
||||
],
|
||||
|
||||
|
|
@ -328,7 +323,8 @@ export default {
|
|||
}
|
||||
]
|
||||
},
|
||||
projectType: 1
|
||||
projectType: 1,
|
||||
fileId: []
|
||||
}
|
||||
},
|
||||
onLoad (options) {
|
||||
|
|
@ -340,11 +336,7 @@ export default {
|
|||
onReady () {
|
||||
console.log('搜索框22key', this.key)
|
||||
// 如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则
|
||||
if (this.key == 1) {
|
||||
this.$refs.form1.setRules(this.rules)
|
||||
} else if(this.key == 1) {
|
||||
this.$refs.form2.setRules(this.rules)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getresList () {
|
||||
|
|
@ -397,8 +389,6 @@ export default {
|
|||
item.isShow = true
|
||||
this.gclabel = item.resName
|
||||
this.formList.projectName = item.resName
|
||||
|
||||
this.$refs.form1.validateField('isPowerGeneration')
|
||||
} else {
|
||||
item.isShow = false
|
||||
}
|
||||
|
|
@ -435,6 +425,7 @@ export default {
|
|||
})
|
||||
for (let i = 0; i < lists.length; i++) {
|
||||
const result = await this.uploadFilePromise(lists[i].url)
|
||||
|
||||
let item = this[`fileList${event.name}`][fileListLen]
|
||||
this[`fileList${event.name}`].splice(
|
||||
fileListLen,
|
||||
|
|
@ -447,31 +438,23 @@ export default {
|
|||
)
|
||||
fileListLen++
|
||||
}
|
||||
|
||||
console.log('fileList1111', this.fileList1)
|
||||
},
|
||||
uploadFilePromise (url) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let a = uni.uploadFile({
|
||||
url: uni.$http.baseUrl + '/xfProjectRun/file/upload/singleSimple', // 仅为示例,非真实的接口地址
|
||||
url: `${uni.$http.baseUrl}/gunshiApp/xfflood/xfProjectIncident/file/upload/singleSimple`,
|
||||
filePath: url,
|
||||
name: 'file',
|
||||
formData: {
|
||||
user: 'test'
|
||||
},
|
||||
success: res => {
|
||||
setTimeout(() => {
|
||||
resolve(res.data.data)
|
||||
resolve(res.data)
|
||||
}, 1000)
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
afterRead (event) {
|
||||
this.fileList1.push({
|
||||
url: event.file,
|
||||
status: 'uploading',
|
||||
message: '上传中'
|
||||
})
|
||||
},
|
||||
|
||||
open () {},
|
||||
groupChange (n) {
|
||||
|
|
@ -484,8 +467,6 @@ export default {
|
|||
uni.navigateBack()
|
||||
},
|
||||
|
||||
|
||||
|
||||
severitySelect (e) {
|
||||
console.log('severitySelect0', e)
|
||||
this.formList.severity = e.name
|
||||
|
|
@ -496,33 +477,34 @@ export default {
|
|||
this.$refs.form2.validateField('isControlled')
|
||||
},
|
||||
|
||||
|
||||
submit () {
|
||||
if(key ==2){
|
||||
this.$refs.form2
|
||||
.validate()
|
||||
.then(res => {
|
||||
uni.$u.toast('校验通过', res)
|
||||
|
||||
|
||||
let params = Object.assign(this.formList)
|
||||
if (this.fileId !== '') {
|
||||
params = Object.assign(this.formList, this.fileId)
|
||||
}
|
||||
// 严重程度(1一般险情 2较大险情 3重大险情 4特别重大险情
|
||||
let type ={
|
||||
'一般险情':1,
|
||||
'较大险情':2,
|
||||
'重大险情':3,
|
||||
'特别重大险情':4,
|
||||
}
|
||||
params.severity = this.formLis.severity[type]
|
||||
params.projectType = this.params.projectType
|
||||
params.isControlled = params.isControlled == '是' ? 1 : 0
|
||||
|
||||
// 严重程度(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.projectType = this.projectType
|
||||
params.isControlled = params.isControlled == '是' ? 1 : 0
|
||||
if (this.fileList1.length > 0) {
|
||||
params.fileId = this.fileList1.map(item => {
|
||||
return JSON.parse(item.url).data.fileId
|
||||
})
|
||||
}
|
||||
|
||||
uni.$http
|
||||
.post('/gunshiApp/xfProjectIncident/insert', params)
|
||||
.post('/gunshiApp/xfflood/xfProjectIncident/insert', params)
|
||||
.then(res => {
|
||||
console.log('this.---', res)
|
||||
if (res.data.code == 200) {
|
||||
|
|
@ -534,54 +516,11 @@ export default {
|
|||
})
|
||||
})
|
||||
.catch(errors => {
|
||||
uni.$u.toast('校验失败', res)
|
||||
uni.$u.toast('校验失败', errors)
|
||||
})
|
||||
}else if(key ==3){
|
||||
this.$refs.form3
|
||||
.validate()
|
||||
.then(res => {
|
||||
uni.$u.toast('校验通过', res)
|
||||
console.log('this.==', this.formList)
|
||||
|
||||
let params = Object.assign(this.formList)
|
||||
if (this.fileId !== '') {
|
||||
params = Object.assign(this.formList, this.fileId)
|
||||
}
|
||||
// 严重程度(1一般险情 2较大险情 3重大险情 4特别重大险情
|
||||
let type ={
|
||||
'一般险情':1,
|
||||
'较大险情':2,
|
||||
'重大险情':3,
|
||||
'特别重大险情':4,
|
||||
}
|
||||
params.severity = this.formLis.severity[type]
|
||||
params.projectType = this.params.projectType
|
||||
params.isControlled = params.isControlled == '是' ? 1 : 0
|
||||
|
||||
|
||||
uni.$http
|
||||
.post('/gunshiApp/xfProjectIncident/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('校验失败', res)
|
||||
})
|
||||
}else{
|
||||
|
||||
}
|
||||
// 如果有错误,会在catch中返回报错信息数组,校验通过则在then中返回true
|
||||
|
||||
},
|
||||
reset () {
|
||||
const validateList = ['projectName', 'isPowerGeneration', 'radiovalue1']
|
||||
const validateList = ['projectName', 'radiovalue1']
|
||||
this.$refs.form1.resetFields()
|
||||
this.$refs.form1.clearValidate()
|
||||
setTimeout(() => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue