|
@@ -341,6 +341,8 @@ export class PageRoleComponent implements OnInit {
|
|
|
}
|
|
|
//添加成员
|
|
|
addMember() {
|
|
|
+ this.radio = '';
|
|
|
+ this.modalValue = ''
|
|
|
this.parentList = this.nodes;
|
|
|
this.account = {
|
|
|
name: '',
|
|
@@ -363,6 +365,8 @@ export class PageRoleComponent implements OnInit {
|
|
|
parent: '',
|
|
|
branch: '',
|
|
|
};
|
|
|
+ this.radio = '';
|
|
|
+ this.modalValue = ''
|
|
|
if (type == 'edit') {
|
|
|
let query = new Parse.Query('Department');
|
|
|
query.include('parent','parent.parent')
|
|
@@ -419,26 +423,12 @@ export class PageRoleComponent implements OnInit {
|
|
|
}
|
|
|
//选择所属类别下级列表
|
|
|
async onCheckedDepart(type: string, e: any, checked?: boolean) {
|
|
|
+ console.log(e);
|
|
|
this.radio = e.key;
|
|
|
if (type == 'account') this.account.identity = '';
|
|
|
this.parentMap = await this.tbookSer.formatNode(e.key);
|
|
|
- if (checked) {
|
|
|
- // this.editObject.name = e.title
|
|
|
- if (type == 'account' && e.parent) {
|
|
|
- this.account.department = { title: e.title, id: e.key };
|
|
|
- this.account.companyType = e.branch || e.title;
|
|
|
- this.userType = this.parents.some((item) => e.parent == item.key)
|
|
|
- ? !e.type ? ['工作联系人'] : ['评审专家', '工作联系人', '教师']
|
|
|
- : e.type == '单位'
|
|
|
- ? ['评审专家', '高校联系人', '教师']
|
|
|
- : ['评审专家', '教师'];
|
|
|
- } else {
|
|
|
- this.editObject.parent = {
|
|
|
- title: e.title,
|
|
|
- id: e.key,
|
|
|
- };
|
|
|
- this.editObject.branch = e.branch || e.title;
|
|
|
- }
|
|
|
+ if (checked || e.isLeaf) {
|
|
|
+ this.pushValue(type,e)
|
|
|
return;
|
|
|
}
|
|
|
if (e.isLeaf) {
|
|
@@ -446,6 +436,25 @@ export class PageRoleComponent implements OnInit {
|
|
|
}
|
|
|
this.parentList = await this.getDepart(e?.key);
|
|
|
}
|
|
|
+ //赋值
|
|
|
+ pushValue(type:string, e: any){
|
|
|
+ this.modalValue = e.title
|
|
|
+ if (type == 'account' && e.parent) {
|
|
|
+ this.account.department = { title: e.title, id: e.key };
|
|
|
+ this.account.companyType = e.branch || e.title;
|
|
|
+ this.userType = this.parents.some((item) => e.parent == item.key)
|
|
|
+ ? !e.type ? ['工作联系人'] : ['评审专家', '工作联系人', '教师']
|
|
|
+ : e.type == '单位'
|
|
|
+ ? ['评审专家', '高校联系人', '教师']
|
|
|
+ : ['评审专家', '教师'];
|
|
|
+ } else {
|
|
|
+ this.editObject.parent = {
|
|
|
+ title: e.title,
|
|
|
+ id: e.key,
|
|
|
+ };
|
|
|
+ this.editObject.branch = e.branch || e.title;
|
|
|
+ }
|
|
|
+ }
|
|
|
async handleOk(): Promise<void> {
|
|
|
if (!this.editObject?.name || !this.editObject.parent?.id) {
|
|
|
this.message.error('请填写完整信息');
|