修复全部问题

hyx_2024-9-25_tongbu
shanao 2024-09-12 14:10:14 +08:00
parent 54845b2422
commit 84451f1c7b
2 changed files with 12 additions and 11 deletions

View File

@ -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()
},
/**

View File

@ -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 {