|
|
|
@ -8,42 +8,22 @@ import { NzFormatEmitEvent, NzTreeComponent, NzTreeNodeOptions } from 'ng-zorro-
|
|
|
|
|
import { FormBuilder, FormGroup, Validators } from '@angular/forms'; |
|
|
|
|
import { NzModalService } from 'ng-zorro-antd/modal'; |
|
|
|
|
import { NzMessageService } from 'ng-zorro-antd/message'; |
|
|
|
|
interface Person { |
|
|
|
|
id: string; |
|
|
|
|
name: string; |
|
|
|
|
integrity: number; |
|
|
|
|
organization: string; |
|
|
|
|
level: string; |
|
|
|
|
nature:string; |
|
|
|
|
time:string; |
|
|
|
|
addr:string; |
|
|
|
|
state:string |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
|
|
selector: 'app-unit', |
|
|
|
|
templateUrl: './unit.component.html', |
|
|
|
|
styleUrls: ['./unit.component.scss'] |
|
|
|
|
}) |
|
|
|
|
export class UnitComponent implements OnInit { |
|
|
|
|
checked=true |
|
|
|
|
listOfData: Person[] = [ |
|
|
|
|
{ |
|
|
|
|
id: '1', |
|
|
|
|
name: 'John Brown', |
|
|
|
|
integrity: 20, |
|
|
|
|
organization: 'New York No. 1 Lake Park', |
|
|
|
|
level:'重点单位', |
|
|
|
|
nature:'会议中心', |
|
|
|
|
time:'time', |
|
|
|
|
addr:'单位地址', |
|
|
|
|
state:'' |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
]; |
|
|
|
|
checked = true |
|
|
|
|
|
|
|
|
|
listOfData: any = []; |
|
|
|
|
integrity = 0 |
|
|
|
|
validateForm!: FormGroup; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
constructor(private router: Router, private fb: FormBuilder, private http: HttpClient, private toTree: TreeService, private modal: NzModalService, private message: NzMessageService, private viewContainerRef: ViewContainerRef) { } |
|
|
|
|
|
|
|
|
|
datas = "" |
|
|
|
|
ngOnInit(): void { |
|
|
|
|
this.validateForm = this.fb.group({ |
|
|
|
|
level: [null], |
|
|
|
@ -51,25 +31,35 @@ export class UnitComponent implements OnInit {
|
|
|
|
|
event: [null], |
|
|
|
|
area: [null], |
|
|
|
|
disposalState: [null], |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
this.http.get('/api/Companies').subscribe((data: any) => { |
|
|
|
|
console.log(data); |
|
|
|
|
}) |
|
|
|
|
this.getCompanies() |
|
|
|
|
} |
|
|
|
|
constructor(private router: Router,private fb: FormBuilder, private http: HttpClient, private toTree: TreeService, private modal: NzModalService, private message: NzMessageService, private viewContainerRef: ViewContainerRef) { } |
|
|
|
|
|
|
|
|
|
searchValue = ''; |
|
|
|
|
next() { |
|
|
|
|
this.router.navigate(['/basicInfo/unit/details']); |
|
|
|
|
} |
|
|
|
|
getCompanies() { |
|
|
|
|
this.http.get('/api/Companies').subscribe((data: any) => { |
|
|
|
|
console.log(data); |
|
|
|
|
|
|
|
|
|
this.listOfData = data.items |
|
|
|
|
this.listOfData = [...this.listOfData] |
|
|
|
|
console.log(this.listOfData); |
|
|
|
|
for (let index = 0; index < this.listOfData.length; index++) { |
|
|
|
|
this.listOfData[index].creationTime=this.listOfData[index].creationTime.substring(0,10) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ngOnDestroy(): void { |
|
|
|
|
console.log('删除了6666666666666') |
|
|
|
|
// CustomReuseStrategy.deleteRouteSnapshot('/basicInfo/unit');
|
|
|
|
|
} |
|
|
|
|
addOr(node?: any) { |
|
|
|
|
console.log(node) |
|
|
|
|
|
|
|
|
|
const modal = this.modal.create({ |
|
|
|
|
nzTitle: "新增单位", |
|
|
|
|
nzContent: AddUnitComponent, |
|
|
|
@ -86,26 +76,27 @@ export class UnitComponent implements OnInit {
|
|
|
|
|
companyName: instance.validateForm.value.unit, |
|
|
|
|
directorName: instance.validateForm.value.name, |
|
|
|
|
directorPhone: instance.validateForm.value.iphone, |
|
|
|
|
address:instance.validateForm.value.addr, |
|
|
|
|
organizationId:instance.validateForm.value.role.id || 0, |
|
|
|
|
relatedOrganizationId:instance.validateForm.value.role2.id || 0, |
|
|
|
|
buildingTypeId:instance.validateForm.value.role3.id || 0, |
|
|
|
|
useNature:instance.validateForm.value.role4.id || 0, |
|
|
|
|
address: instance.validateForm.value.addr, |
|
|
|
|
organizationId: instance.validateForm.value.role || null, |
|
|
|
|
relatedOrganizationId: instance.validateForm.value.role2 || null, |
|
|
|
|
buildingTypeId: instance.validateForm.value.role4 || null, |
|
|
|
|
useNature: instance.validateForm.value.nature, |
|
|
|
|
data: null |
|
|
|
|
} |
|
|
|
|
this.http.post('/api/Companies', body).subscribe({ |
|
|
|
|
next: (data: any) => { |
|
|
|
|
console.log(data,80808) |
|
|
|
|
|
|
|
|
|
console.log(data, 80808) |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
error: (err) => { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log(err) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
this.message.create('warning', '请填写完整!'); |
|
|
|
|
return false |
|
|
|
|