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