Commit 3bd200b2 authored by 仇晓婷's avatar 仇晓婷

Merge branch 'product' of http://git.mes123.com/zhouyx/mes-ui into product

parents 7d359cdc b6425633
...@@ -113,7 +113,7 @@ export default { ...@@ -113,7 +113,7 @@ export default {
"op", "op",
{ {
attrs: { oprate: "delete" }, attrs: { oprate: "delete" },
on: { click: () => this.remove(params.row.id) } on: { click: () => this.remove(params.row) }
}, },
"删除" "删除"
) )
...@@ -253,14 +253,22 @@ export default { ...@@ -253,14 +253,22 @@ export default {
this.detail = () => import("./edit"); this.detail = () => import("./edit");
this.modal = true; this.modal = true;
}, },
remove(id) { remove(row) {
Api.delete(id).then(r => { if(row.children&&row.children.length==0)
{
Api.delete(row.id).then(r => {
if (r.success) { if (r.success) {
this.$Message.success("删除成功"); this.$Message.success("删除成功");
var name = this.searchValue; var name = this.searchValue;
this.laodaction(name); this.laodaction(name);
} }
}); });
}
else
{
this.$Message.error("此节点有子节点,不能删除!");
return false
}
}, },
cancel() { cancel() {
this.curId = 0; this.curId = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment