修复全部问题

hyx_2024-10-30_new
shanao 2024-09-12 14:10:14 +08:00
parent 638f6d4901
commit 270d0d3c86
2 changed files with 12 additions and 11 deletions

View File

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

View File

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