|
|
@ -714,7 +714,7 @@ export class CreateUnit { |
|
|
|
}) |
|
|
|
}) |
|
|
|
export class upname{ |
|
|
|
export class upname{ |
|
|
|
constructor(private router:Router,private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef<upname>,@Inject(MAT_DIALOG_DATA) public data: any) {} |
|
|
|
constructor(private router:Router,private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef<upname>,@Inject(MAT_DIALOG_DATA) public data: any) {} |
|
|
|
unitname//修改后的名称
|
|
|
|
unitname:string//修改后的名称
|
|
|
|
oldname=this.data.name//原名
|
|
|
|
oldname=this.data.name//原名
|
|
|
|
oldid=this.data.id |
|
|
|
oldid=this.data.id |
|
|
|
|
|
|
|
|
|
|
@ -736,14 +736,10 @@ export class upname{ |
|
|
|
else{ |
|
|
|
else{ |
|
|
|
let paramsdata:any = { |
|
|
|
let paramsdata:any = { |
|
|
|
id:this.oldid, |
|
|
|
id:this.oldid, |
|
|
|
name: this.unitname, |
|
|
|
name: this.unitname |
|
|
|
buildingTypes:[{ |
|
|
|
|
|
|
|
id:this.data.buildingTypes[0].id, |
|
|
|
|
|
|
|
name:this.data.buildingTypes[0].name |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
console.log(paramsdata) |
|
|
|
this.http.put(`/api/Companies/${this.oldid}`,paramsdata).subscribe((data:any)=>{ |
|
|
|
this.http.put(`/api/Companies/${this.oldid}/UpdateName`,paramsdata).subscribe((data:any)=>{ |
|
|
|
this.snackBar.open("修改名字成功",'确定',config);
|
|
|
|
this.snackBar.open("修改名字成功",'确定',config);
|
|
|
|
},err => { |
|
|
|
},err => { |
|
|
|
this.snackBar.open(err,'确定',config); |
|
|
|
this.snackBar.open(err,'确定',config); |
|
|
|