修复全部问题
parent
54845b2422
commit
84451f1c7b
|
@ -11,13 +11,15 @@
|
||||||
<el-form-item label="发生时间" prop="incidentDates">
|
<el-form-item label="发生时间" prop="incidentDates">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="searchForm.incidentDates"
|
v-model="searchForm.incidentDates"
|
||||||
|
:default-time="['00:00:00', '23:59:59']"
|
||||||
value-format="yyyy-MM-dd HH:mm:ss"
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
format="yyyy-MM-dd HH:mm:ss"
|
format="yyyy-MM-dd HH:mm:ss"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
type="daterange"
|
type="daterange"
|
||||||
range-separator="-"
|
range-separator="-"
|
||||||
start-placeholder="开始日期"
|
start-placeholder="开始日期"
|
||||||
end-placeholder="结束日期" />
|
end-placeholder="结束日期"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="4">
|
<el-col :span="4">
|
||||||
|
@ -64,10 +66,11 @@
|
||||||
v-loading="listLoading"
|
v-loading="listLoading"
|
||||||
ref="multipleTable"
|
ref="multipleTable"
|
||||||
:data="varList"
|
:data="varList"
|
||||||
border
|
|
||||||
tooltip-effect="dark"
|
tooltip-effect="dark"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
@selection-change="handleSelectionChange">
|
border
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
<el-table-column type="selection" width="55"/>
|
<el-table-column type="selection" width="55"/>
|
||||||
<el-table-column label="事故名称" prop="incidentName"/>
|
<el-table-column label="事故名称" prop="incidentName"/>
|
||||||
<el-table-column label="所属公司" prop="companyName"/>
|
<el-table-column label="所属公司" prop="companyName"/>
|
||||||
|
@ -177,7 +180,7 @@ export default {
|
||||||
* 表格行选择器处理
|
* 表格行选择器处理
|
||||||
*/
|
*/
|
||||||
handleSelectionChange(val) {
|
handleSelectionChange(val) {
|
||||||
this.multipleSelection.push(val)
|
this.multipleSelection = val
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -264,7 +267,7 @@ export default {
|
||||||
// 获取选中的行数据
|
// 获取选中的行数据
|
||||||
const selectedRows = this.multipleSelection
|
const selectedRows = this.multipleSelection
|
||||||
// 如果没有选中任何行,则提示用户
|
// 如果没有选中任何行,则提示用户
|
||||||
if (selectedRows.length === 0) {
|
if (this.multipleSelection === '' || selectedRows.length === 0) {
|
||||||
this.$message.warning('请选择要删除的行')
|
this.$message.warning('请选择要删除的行')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -275,15 +278,16 @@ export default {
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
// 获取所有选中行的 ID
|
// 获取所有选中行的 ID
|
||||||
const ids = selectedRows.map(row => row.id).join(',')
|
let ids = ''
|
||||||
|
selectedRows.forEach(row => { ids += row.id + ',' })
|
||||||
// 发送批量删除请求
|
// 发送批量删除请求
|
||||||
const url = '/accident/delete/' + '' + ids
|
const url = '/accident/delete/' + '' + ids
|
||||||
requestFN(url).then((response) => {
|
requestFN(url).then((response) => {
|
||||||
// 删除成功后的处理
|
// 删除成功后的处理
|
||||||
this.$message.success('删除成功')
|
this.$message.success('删除成功')
|
||||||
|
this.searchList()
|
||||||
// eslint-disable-next-line handle-callback-err
|
// eslint-disable-next-line handle-callback-err
|
||||||
}).catch((error) => {
|
}).catch(() => {
|
||||||
this.$message.error('删除失败')
|
this.$message.error('删除失败')
|
||||||
})
|
})
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
|
@ -292,7 +296,6 @@ export default {
|
||||||
message: '已取消删除'
|
message: '已取消删除'
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
this.searchList()
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
<div>
|
<div>
|
||||||
<List v-if="activeName === 'List'" ref="List" />
|
<List v-if="activeName === 'List'" ref="List" />
|
||||||
<Add v-if="activeName === 'AddOrEdit'" ref="AddOrEdit" />
|
<Add v-if="activeName === 'AddOrEdit'" ref="AddOrEdit" />
|
||||||
<!-- <Detail v-if="activeName==='Detail'"/>-->
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -14,7 +13,6 @@ export default {
|
||||||
components: {
|
components: {
|
||||||
List: List,
|
List: List,
|
||||||
Add: Add
|
Add: Add
|
||||||
// Detail: Detail
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in New Issue