济南项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.8 KiB

import { Component, OnInit, Input } from '@angular/core';
import { NzModalRef } from 'ng-zorro-antd/modal';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { HttpClient } from '@angular/common/http';
import { TreeService } from 'src/app/service/tree.service';
@Component({
selector: 'app-apply-look',
templateUrl: './apply-look.component.html',
styleUrls: ['./apply-look.component.scss']
})
export class ApplyLookComponent implements OnInit {
@Input() title?: string;
@Input() subtitle?: string;
validateForm!: FormGroup;
constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient, private toTree: TreeService) { }
ngOnInit(): void {
this.validateForm = this.fb.group({
taskname: [true, [Validators.required]],
unitname: [null, [Validators.required]],
organization: [null, [Validators.required]]
});
this.getAllOrganization()
}
destroyModal(): void {
this.modal.destroy({ data: 'this the result data' });
}
//获取所有组织机构
nodes: any = []
getAllOrganization() {
// let OrganizationUnitId = sessionStorage.getItem('isGasStation') == 'true' ? JSON.parse(sessionStorage.getItem('userdataOfgasstation')).organization.id : JSON.parse(sessionStorage.getItem('userdata')).organization.id
// let params = {
// OrganizationUnitId: OrganizationUnitId,
// IsContainsChildren: "true"
// }
// this.http.get('/api/services/app/Organization/GetAll', {
// params: params
// }).subscribe((data: any) => {
// data.result.items.forEach(element => {
// if (element.id == OrganizationUnitId) {
// element.parentId = null
// }
// element.key = element.id
// element.title = element.displayName
// });
// this.nodes = [...this.toTree.toTree(data.result.items)]
// })
}
}