|
|
|
@ -63,6 +63,7 @@ |
|
|
|
v-model="formChild" |
|
|
|
v-model="formChild" |
|
|
|
:permission="permissionList" |
|
|
|
:permission="permissionList" |
|
|
|
:before-open="beforeOpenChild" |
|
|
|
:before-open="beforeOpenChild" |
|
|
|
|
|
|
|
:before-close="beforeCloseChild" |
|
|
|
@row-del="rowDelChild" |
|
|
|
@row-del="rowDelChild" |
|
|
|
@row-update="rowUpdateChild" |
|
|
|
@row-update="rowUpdateChild" |
|
|
|
@row-save="rowSaveChild" |
|
|
|
@row-save="rowSaveChild" |
|
|
|
@ -85,6 +86,16 @@ |
|
|
|
>删 除 |
|
|
|
>删 除 |
|
|
|
</el-button> |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
<template slot-scope="scope" slot="menu"> |
|
|
|
|
|
|
|
<el-button |
|
|
|
|
|
|
|
type="text" |
|
|
|
|
|
|
|
icon="el-icon-circle-plus-outline" |
|
|
|
|
|
|
|
size="small" |
|
|
|
|
|
|
|
@click.stop="handleAdd(scope.row,scope.index)" |
|
|
|
|
|
|
|
v-if="userInfo.role_name.includes('admin')" |
|
|
|
|
|
|
|
>新增子项 |
|
|
|
|
|
|
|
</el-button> |
|
|
|
|
|
|
|
</template> |
|
|
|
<template slot-scope="{row}" slot="isSealed"> |
|
|
|
<template slot-scope="{row}" slot="isSealed"> |
|
|
|
<el-tag>{{row.isSealed===0?'否':'是'}}</el-tag> |
|
|
|
<el-tag>{{row.isSealed===0?'否':'是'}}</el-tag> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
@ -139,7 +150,7 @@ |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
computed: { |
|
|
|
...mapGetters(["permission"]), |
|
|
|
...mapGetters(["userInfo", "permission"]), |
|
|
|
permissionList() { |
|
|
|
permissionList() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
addBtn: this.vaildData(this.permission.dictbiz_add, false), |
|
|
|
addBtn: this.vaildData(this.permission.dictbiz_add, false), |
|
|
|
@ -157,12 +168,24 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
mounted() { |
|
|
|
getDictTree().then(res => { |
|
|
|
this.initData(); |
|
|
|
const column = this.findObject(this.optionChild.column, "parentId"); |
|
|
|
|
|
|
|
column.dicData = res.data.data; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
|
|
|
|
initData() { |
|
|
|
|
|
|
|
getDictTree().then(res => { |
|
|
|
|
|
|
|
const column = this.findObject(this.optionChild.column, "parentId"); |
|
|
|
|
|
|
|
column.dicData = res.data.data; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleAdd(row) { |
|
|
|
|
|
|
|
this.$refs.crudChild.value.parentId = row.id; |
|
|
|
|
|
|
|
this.$refs.crudChild.option.column.filter(item => { |
|
|
|
|
|
|
|
if (item.prop === "parentId") { |
|
|
|
|
|
|
|
item.value = row.id; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
this.$refs.crudChild.rowAdd(); |
|
|
|
|
|
|
|
}, |
|
|
|
rowSave(row, done, loading) { |
|
|
|
rowSave(row, done, loading) { |
|
|
|
const form = { |
|
|
|
const form = { |
|
|
|
...row, |
|
|
|
...row, |
|
|
|
@ -365,6 +388,9 @@ |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
beforeOpenChild(done, type) { |
|
|
|
beforeOpenChild(done, type) { |
|
|
|
|
|
|
|
if (["add", "edit"].includes(type)) { |
|
|
|
|
|
|
|
this.initData(); |
|
|
|
|
|
|
|
} |
|
|
|
if (["edit", "view"].includes(type)) { |
|
|
|
if (["edit", "view"].includes(type)) { |
|
|
|
getDict(this.formChild.id).then(res => { |
|
|
|
getDict(this.formChild.id).then(res => { |
|
|
|
this.formChild = res.data.data; |
|
|
|
this.formChild = res.data.data; |
|
|
|
@ -372,6 +398,15 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
done(); |
|
|
|
done(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
beforeCloseChild(done) { |
|
|
|
|
|
|
|
this.$refs.crudChild.value.parentId = this.parentId; |
|
|
|
|
|
|
|
this.$refs.crudChild.option.column.filter(item => { |
|
|
|
|
|
|
|
if (item.prop === "parentId") { |
|
|
|
|
|
|
|
item.value = this.parentId; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
done(); |
|
|
|
|
|
|
|
}, |
|
|
|
currentChangeChild(currentPage) { |
|
|
|
currentChangeChild(currentPage) { |
|
|
|
this.pageChild.currentPage = currentPage; |
|
|
|
this.pageChild.currentPage = currentPage; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|