测试完成
parent
8062274b39
commit
0f75e526de
|
@ -30,13 +30,12 @@
|
|||
<el-date-picker
|
||||
:disabled="isDisabled"
|
||||
v-model="infoForm.incidentDate"
|
||||
type="date"
|
||||
type="datetime"
|
||||
placeholder="选择事故发生时间"
|
||||
style="width: 100%;"
|
||||
format="yyyy-MM-dd HH:mm:ss"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"/>
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label-width="formLabelWidth" label="直接经济损失" prop="directLoss">
|
||||
<el-form-item :label-width="formLabelWidth" label="直接经济损失(万元)" prop="directLoss">
|
||||
<el-input v-model="infoForm.directLoss" :disabled="isDisabled" type="number" autocomplete="off"/>
|
||||
</el-form-item>
|
||||
<el-form-item :label-width="formLabelWidth" label="受伤人数" prop="injured">
|
||||
|
@ -90,11 +89,9 @@
|
|||
<el-date-picker
|
||||
v-model="infoForm.reportDate"
|
||||
:disabled="isDisabled"
|
||||
type="date"
|
||||
type="datetime"
|
||||
placeholder="请选择报出日期"
|
||||
style="width: 100%;"
|
||||
format="yyyy-MM-dd HH:mm:ss"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
@ -162,8 +159,7 @@ export default {
|
|||
rules: {
|
||||
incidentNumber: [{ required: true, message: '事故案号不能为空', trigger: 'blur' }],
|
||||
incidentName: [{ required: true, message: '事故名称不能为空', trigger: 'blur' }],
|
||||
HIDDENTYPE: [{ required: true, message: '事故类型不能为空', trigger: 'blur' }],
|
||||
incidentType: [{ required: true, message: '隐患类型不能为空', trigger: 'blur' }],
|
||||
incidentType: [{ required: true, message: '事故类型不能为空', trigger: 'blur' }],
|
||||
incidentLevel: [{ required: true, message: '事故级别不能为空', trigger: 'blur' }],
|
||||
incidentNature: [{ required: true, message: '事故性质不能为空', trigger: 'blur' }],
|
||||
location: [{ required: true, message: '事故发生地点不能为空', trigger: 'blur' }],
|
||||
|
@ -339,6 +335,10 @@ export default {
|
|||
* 表单确认按钮
|
||||
*/
|
||||
confirm() {
|
||||
this.$refs.form.validate(valid => {
|
||||
if (!valid) {
|
||||
return false
|
||||
}
|
||||
const params = {
|
||||
...this.infoForm,
|
||||
photos: this.infoForm.fileList[0].remotePathName
|
||||
|
@ -354,6 +354,7 @@ export default {
|
|||
}).catch((error) => {
|
||||
this.$message.error(this.tableName + '失败')
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -4,16 +4,16 @@
|
|||
<el-row :gutter="12">
|
||||
<el-col :span="4">
|
||||
<el-form-item label="事故名称" prop="incidentName">
|
||||
<el-input v-model="searchForm.incidentName" placeholder="请输入隐患描述" class="filter-item"/>
|
||||
<el-input v-model="searchForm.incidentName" placeholder="请输入事故名称" class="filter-item"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="发生时间" prop="incidentDates">
|
||||
<el-date-picker
|
||||
v-model="searchForm.incidentDates"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
format="yyyy-MM-dd HH:mm:ss"
|
||||
format="yyyy-MM-dd"
|
||||
style="width: 100%"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
|
@ -27,14 +27,14 @@
|
|||
<el-input v-model="searchForm.location" placeholder="请输入发生地点" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-col :span="3">
|
||||
<el-form-item label="事故类型" prop="incidentType">
|
||||
<el-select v-model="searchForm.incidentType" placeholder="请选择">
|
||||
<el-option v-for="item in incidentTypes" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-col :span="3">
|
||||
<el-form-item label="事故等级" prop="incidentLevel">
|
||||
<el-select v-model="searchForm.incidentLevel" placeholder="请选择">
|
||||
<el-option v-for="item in incidentLevels" :key="item.id" :label="item.name" :value="item.id" />
|
||||
|
@ -53,7 +53,6 @@
|
|||
<el-col :span="24">
|
||||
<el-button type="primary" icon="el-icon-circle-plus" @click="goView('', '新增')">新增</el-button>
|
||||
<el-button icon="el-icon-s-promotion" @click="handleAllExport">全部导出</el-button>
|
||||
<el-button icon="el-icon-refresh-left" @click="handleRefresh">刷新</el-button>
|
||||
<el-button type="danger" icon="el-icon-delete-solid" @click="handleBatchDel">批量删除</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
@ -74,7 +73,11 @@
|
|||
<el-table-column type="selection" width="55"/>
|
||||
<el-table-column label="事故名称" prop="incidentName"/>
|
||||
<el-table-column label="所属公司" prop="companyName"/>
|
||||
<el-table-column label="发生时间" prop="incidentDate"/>
|
||||
<el-table-column label="发生时间" prop="incidentDate">
|
||||
<template v-slot="{row}">
|
||||
{{ formatDate(row.incidentDate,'YYYY-MM-DD HH:mm:ss') }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="发生地点" prop="location"/>
|
||||
<el-table-column label="操作" width="300">
|
||||
<template v-slot="{row}">
|
||||
|
@ -96,6 +99,7 @@
|
|||
<script>
|
||||
import Pagination from '@/components/Pagination'
|
||||
import waves from '@/directive/waves'
|
||||
import formatDate from '@/utils/dateformat'
|
||||
import { requestFN } from '../../../../utils/request'
|
||||
|
||||
export default {
|
||||
|
@ -158,7 +162,6 @@ export default {
|
|||
if (dates != null && dates.length === 2) {
|
||||
this.searchForm.startTime = dates[0]
|
||||
this.searchForm.endTime = dates[1]
|
||||
delete this.searchForm.incidentDates
|
||||
}
|
||||
const url = '/accident/page?showCount=' + this.listQuery.limit + '¤tPage=' + this.listQuery.page
|
||||
requestFN(url, { ...this.searchForm }).then((data) => {
|
||||
|
@ -175,6 +178,7 @@ export default {
|
|||
*/
|
||||
handleReset() {
|
||||
this.searchForm = this.$options.data().searchForm
|
||||
this.searchList()
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -318,6 +322,10 @@ export default {
|
|||
).then((data) => {
|
||||
this.incidentLevels = JSON.parse(data.zTreeNodes)
|
||||
})
|
||||
},
|
||||
|
||||
formatDate(date, format) {
|
||||
return formatDate(date, format)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue