|
|
@ -10,6 +10,8 @@ import { |
|
|
|
listUser, |
|
|
|
} from "@/api/management"; |
|
|
|
|
|
|
|
import { deleteProjectCheckingPlan } from "@/api/dike"; |
|
|
|
|
|
|
|
import TopBackTitle from "@/components/TopBackTitle/index.vue"; |
|
|
|
|
|
|
|
import { uploadFileData } from "@/api/system/upload"; |
|
|
@ -42,6 +44,7 @@ export default { |
|
|
|
pageSizes: [10, 20, 50, 100], |
|
|
|
total: 0, // 总数量 |
|
|
|
}, |
|
|
|
tableCheckData: [], // 选中的数据 |
|
|
|
ruleForm: { |
|
|
|
dikeCode: this.$route.query.dikeCode || "", |
|
|
|
name: "", |
|
|
@ -237,6 +240,31 @@ export default { |
|
|
|
this.pageData.total = res.total; |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 批量删除 |
|
|
|
handleDelAll() { |
|
|
|
if (this.tableCheckData.length === 0) { |
|
|
|
this.$message.warning("请选择要删除的数据"); |
|
|
|
return; |
|
|
|
} |
|
|
|
this.$confirm("是否删除选中的记录?", "提示", { |
|
|
|
confirmButtonText: "确定", |
|
|
|
cancelButtonText: "取消", |
|
|
|
type: "warning", |
|
|
|
}) |
|
|
|
.then(() => { |
|
|
|
console.log("删除"); |
|
|
|
const ids = this.tableCheckData.map((item) => item.id); |
|
|
|
deleteProjectCheckingPlan(ids.join(",")).then((res) => { |
|
|
|
if (res) { |
|
|
|
this.$message.success("删除成功"); |
|
|
|
this.getTableData(); |
|
|
|
} |
|
|
|
}); |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
console.log("取消删除"); |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 上传前 |
|
|
|
beforeUpload(e) { |
|
|
@ -263,8 +291,17 @@ export default { |
|
|
|
this.ruleForm.files.splice(index, 1); |
|
|
|
}, |
|
|
|
handleChangeQuery() { |
|
|
|
this.pageData.pageNum = 1; |
|
|
|
this.getTableData(); |
|
|
|
if(this.paramsData.userIds.length > 5){ |
|
|
|
this.$message.warning("最多只能选取5名责任人"); |
|
|
|
this.paramsData.userIds.splice(-1); |
|
|
|
}else{ |
|
|
|
this.pageData.pageNum = 1; |
|
|
|
this.getTableData(); |
|
|
|
} |
|
|
|
}, |
|
|
|
handleSelectionChange(e) { |
|
|
|
console.log("handleSelectionChange >>>>> ", e); |
|
|
|
this.tableCheckData = e || []; |
|
|
|
}, |
|
|
|
handleResetQuery() { |
|
|
|
this.paramsData.name = ""; |
|
|
@ -399,11 +436,11 @@ export default { |
|
|
|
>新增</el-button |
|
|
|
> |
|
|
|
<!-- <el-button size="small">编辑</el-button> --> |
|
|
|
<el-button type="danger" size="small">删除</el-button> |
|
|
|
<el-button type="danger" size="small" @click="handleDelAll">删除</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<el-table :data="tableData" border> |
|
|
|
<el-table :data="tableData" border @selection-change="handleSelectionChange"> |
|
|
|
<el-table-column type="selection" width="55"></el-table-column> |
|
|
|
<el-table-column prop="status" align="center" label="状态"> |
|
|
|
<template slot-scope="scope"> |
|
|
|