|
|
@ -41,6 +41,7 @@ |
|
|
|
placeholder="请输入" |
|
|
|
size="small" |
|
|
|
class="u-item-width-normal" |
|
|
|
clearable |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="是否过期" prop="expiredFlag"> |
|
|
@ -121,6 +122,12 @@ |
|
|
|
> |
|
|
|
导出</el-button |
|
|
|
> |
|
|
|
<el-button |
|
|
|
type="primary" |
|
|
|
size="small" |
|
|
|
@click="deleteBatch" |
|
|
|
>批量删除</el-button |
|
|
|
> |
|
|
|
</div> |
|
|
|
|
|
|
|
<el-table |
|
|
@ -195,7 +202,7 @@ |
|
|
|
label="政策发布时间" |
|
|
|
> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.createdTime.substr(0, 10) }}</span> |
|
|
|
<span>{{ scope.row.createdTime }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
@ -370,6 +377,30 @@ export default { |
|
|
|
this.getTableData(); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
deleteBatch () { |
|
|
|
if (this.selection.length > 0) { |
|
|
|
this.$confirm("确认删除选择的楼栋?", "提示", { |
|
|
|
confirmButtonText: "确定", |
|
|
|
cancelButtonText: "取消", |
|
|
|
type: "warning" |
|
|
|
}) |
|
|
|
.then(() => { |
|
|
|
this.delPolicy() |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
if (err == "cancel") { |
|
|
|
// this.$message({ |
|
|
|
// type: "info", |
|
|
|
// message: "已取消删除" |
|
|
|
// }); |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
} else { |
|
|
|
this.$message.warning('请先选择要删除的楼栋') |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
handleSearch(val) { |
|
|
|
console.log(this.formData); |
|
|
|
this.pageNo = 1; |
|
|
@ -494,7 +525,22 @@ export default { |
|
|
|
type: "warning", |
|
|
|
}) |
|
|
|
.then(() => { |
|
|
|
this.delPolicy(); |
|
|
|
this.$http |
|
|
|
.post("/governance/policy/deletePolicy", [row.id]) |
|
|
|
.then(({ data: res }) => { |
|
|
|
console.log("row2", row); |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg); |
|
|
|
} else { |
|
|
|
console.log("row3", row); |
|
|
|
this.$message.success("删除成功"); |
|
|
|
this.getTableData(); |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
console.log("row4", err); |
|
|
|
return this.$message.error("网络错误"); |
|
|
|
}); |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
if (err == "cancel") { |
|
|
@ -518,6 +564,26 @@ export default { |
|
|
|
this.$message.error("操作失败!"); |
|
|
|
} |
|
|
|
}, |
|
|
|
//写好的批量删除直接用 |
|
|
|
// async delPolicy() { |
|
|
|
// if (this.selection.length === 0) |
|
|
|
// return this.$message.error("请选择之后进行操作"); |
|
|
|
// let policyIds = this.selection.map((item) => item.id); |
|
|
|
// this.$http |
|
|
|
// .post("/governance/policy/deletePolicy", policyIds) |
|
|
|
// .then(({ data: res }) => { |
|
|
|
// if (res.code !== 0) { |
|
|
|
// return this.$message.error(res.msg); |
|
|
|
// } else { |
|
|
|
// this.$message.success("删除成功"); |
|
|
|
// this.getTableData(); |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// .catch((err) => { |
|
|
|
// console.log("row4", err); |
|
|
|
// return this.$message.error("网络错误"); |
|
|
|
// }); |
|
|
|
// }, |
|
|
|
selectAll(selection) { |
|
|
|
this.selection = selection; |
|
|
|
if (selection.length > 0) { |
|
|
|