diff --git a/src/views/accident/records/components/list.vue b/src/views/accident/records/components/list.vue
index 72c4fd7..2fa4053 100644
--- a/src/views/accident/records/components/list.vue
+++ b/src/views/accident/records/components/list.vue
@@ -11,13 +11,15 @@
+ end-placeholder="结束日期"
+ />
@@ -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"
+ >
@@ -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()
},
/**
diff --git a/src/views/accident/records/index.vue b/src/views/accident/records/index.vue
index 92c63da..33eb176 100644
--- a/src/views/accident/records/index.vue
+++ b/src/views/accident/records/index.vue
@@ -2,7 +2,6 @@
@@ -14,7 +13,6 @@ export default {
components: {
List: List,
Add: Add
- // Detail: Detail
},
data() {
return {