系统管理bug修改及添加个人修改密码

This commit is contained in:
zhouyuejun
2019-04-16 15:09:47 +08:00
parent 0cf197c0d1
commit 465bd37dc5
10 changed files with 365 additions and 135 deletions
@@ -33,6 +33,7 @@ export class DepartmentManagementComponent implements OnInit {
real_name: '',
}
public orgDetail: any = ''; //左侧机构目录当前选中项机构的详情信息
public sekOrgDetail: any = '';
public orgSeleted: any = ''; //新增或者修改时,当前选中的所属机构的机构详情信息
public modifyType: any = '3'; //操作状态 1新增 2修改 3详情
public parentName: any = '';
@@ -73,10 +74,9 @@ export class DepartmentManagementComponent implements OnInit {
shortName: ['', [Validators.maxLength(10)]],
code: ['', [Validators.required, Validators.maxLength(10)]],
contact_person: ['', [Validators.maxLength(10)]],
contact_method: [''],
contact_method: ['', [Validators.maxLength(20)]],
organization_type: [''],
address: [''],
address: ['', [Validators.maxLength(30)]],
});
this.initTree();
this.queryTable();
@@ -85,23 +85,35 @@ export class DepartmentManagementComponent implements OnInit {
addModify(type) {
//数据清空重置
this.modifyType = type;
this.validateForm.reset();
// this.validateForm.reset();
this.userSelecteds = [];
this.orgSeleted = '';
this.checkNameStatus = '';
this.nameOnly = true;
this.validateForm.patchValue({ organization_type: 1, });
// this.validateForm.patchValue({ organization_type: 1, });
if (type == 1) {
this.sekOrgDetail = true;
this.zNodesChild = this.zNodes.concat();
$.fn.zTree.init($("#treeDemoChild"), this.settingChild, this.zNodesChild);
this.validateForm.patchValue({
organization: '',
shortName: '',
code: '',
contact_person: '',
contact_method: '',
organization_type: 1,
address: '',
});
} else if (type == 2) {
this.sekOrgDetail = false;
let item = this.orgDetail;
this.zNodesChild = this.zNodes.concat();
for (let i = 0; i < this.zNodesChild.length; i++) {
if (this.zNodesChild[i].id === item.id) {
this.zNodesChild.splice(i, 1);
break;
}
}
// for (let i = 0; i < this.zNodesChild.length; i++) {
// if (this.zNodesChild[i].id === item.id) {
// this.zNodesChild.splice(i, 1);
// break;
// }
// }
$.fn.zTree.init($("#treeDemoChild"), this.settingChild, this.zNodesChild);
this.validateForm.patchValue({
organization: item.organization,
@@ -190,6 +202,18 @@ export class DepartmentManagementComponent implements OnInit {
//保存选择机构
treeSave() {
if (this.treeSelectedChild) {
if (this.sekOrgDetail) {
//新增
} else {
//修改
if (this.orgDetail && this.orgDetail.id === this.treeSelectedChild.id) {
this.message.create('warning', '不能选择自己作为所属机构!');
this.close();
return;
}
}
this.orgSeleted = this.treeSelectedChild;
this.close();
// this.visible = false;
@@ -354,7 +378,7 @@ export class DepartmentManagementComponent implements OnInit {
if (node[0].children && node[0].children.length > 0) {
zTree.selectNode(node[0].children[0])
zTree.setting.callback.onClick(null, zTree.setting.treeId, node[0].children[0])
}else{
} else {
zTree.selectNode(node[0])
zTree.setting.callback.onClick(null, zTree.setting.treeId, node[0])
}