|
@@ -290,9 +290,12 @@ export default {
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
try {
|
|
|
+ const isParent = this.depts.find(v => {
|
|
|
+ return v.children.length
|
|
|
+ })
|
|
|
this.depts.forEach(o => {
|
|
|
// 选中父级
|
|
|
- if (o.children.length) {
|
|
|
+ if (o.children.length || isParent.children.length) {
|
|
|
this.$message({
|
|
|
type: 'warning',
|
|
|
message: '删除失败,请先删除下级部门'
|