部门选择bug修改
This commit is contained in:
+10
-5
@@ -70,9 +70,9 @@ export class DepartmentManagementComponent implements OnInit {
|
|||||||
//表单实例化
|
//表单实例化
|
||||||
this.validateForm = this.fb.group({
|
this.validateForm = this.fb.group({
|
||||||
organization: ['', [Validators.required, Validators.maxLength(20)]],
|
organization: ['', [Validators.required, Validators.maxLength(20)]],
|
||||||
shortName: ['',[Validators.maxLength(10)]],
|
shortName: ['', [Validators.maxLength(10)]],
|
||||||
code: ['', [Validators.required,Validators.maxLength(10)]],
|
code: ['', [Validators.required, Validators.maxLength(10)]],
|
||||||
contact_person: ['',[Validators.maxLength(10)]],
|
contact_person: ['', [Validators.maxLength(10)]],
|
||||||
contact_method: [''],
|
contact_method: [''],
|
||||||
organization_type: [''],
|
organization_type: [''],
|
||||||
address: [''],
|
address: [''],
|
||||||
@@ -351,8 +351,13 @@ export class DepartmentManagementComponent implements OnInit {
|
|||||||
var zTree = $.fn.zTree.getZTreeObj("treeDemo");
|
var zTree = $.fn.zTree.getZTreeObj("treeDemo");
|
||||||
let node = zTree.getNodes();
|
let node = zTree.getNodes();
|
||||||
if (json.body.length > 0) {
|
if (json.body.length > 0) {
|
||||||
zTree.selectNode(node[0].children[0])
|
if (node[0].children && node[0].children.length > 0) {
|
||||||
zTree.setting.callback.onClick(null, zTree.setting.treeId, node[0].children[0])
|
zTree.selectNode(node[0].children[0])
|
||||||
|
zTree.setting.callback.onClick(null, zTree.setting.treeId, node[0].children[0])
|
||||||
|
}else{
|
||||||
|
zTree.selectNode(node[0])
|
||||||
|
zTree.setting.callback.onClick(null, zTree.setting.treeId, node[0])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user