邵佳豪
2 years ago
11 changed files with 288 additions and 50 deletions
@ -0,0 +1,56 @@
|
||||
<nz-table #basicTable [nzData]="listOfData" [nzShowPagination]="false" [nzLoading]="isloading"> |
||||
<thead> |
||||
<tr> |
||||
<th>任务名称</th> |
||||
<th>时间</th> |
||||
<th>单位名称</th> |
||||
<th>单位级别</th> |
||||
<th>主负责人</th> |
||||
<th [nzWidth]="'25%'">协助机构/人员</th> |
||||
<th>检查结果</th> |
||||
<th>操作</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<tr *ngFor="let item of basicTable.data"> |
||||
<td>{{ item.taskType }}</td> |
||||
<td>{{ item.planTime | date:"yyyy-MM-dd HH:mm:ss" }}</td> |
||||
<td>{{ item.company.companyName }}</td> |
||||
<td>{{ item.company.companyLevel }}</td> |
||||
<td>{{item.organization.level == 'battalion'? item.creator.name : item.organization.name}}</td> |
||||
<td> |
||||
<span class="assistant"> |
||||
<ng-container *ngIf="item.relatedTaskId && item.relatedTask; else elseTemplate"> |
||||
<span *ngFor="let o of item.relatedTask.supervisors"> |
||||
{{o.name}} |
||||
</span> |
||||
<span *ngFor="let o of item.relatedTask.assistantOrganizations"> |
||||
{{o.name}} |
||||
</span> |
||||
</ng-container> |
||||
<ng-template #elseTemplate> |
||||
<span *ngFor="let o of item.supervisors"> |
||||
{{o.name}} |
||||
</span> |
||||
<span *ngFor="let o of item.assistantOrganizations"> |
||||
{{o.name}} |
||||
</span> |
||||
</ng-template> |
||||
|
||||
</span> |
||||
</td> |
||||
<td> |
||||
{{item.inspectionResult}} |
||||
</td> |
||||
<td> |
||||
<span class="blue" (click)="look(item)">查看</span> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</nz-table> |
||||
<div class="pagination"> |
||||
<nz-pagination [nzHideOnSinglePage]="false" [nzPageIndex]="1" [nzTotal]="totalCount" [nzPageSize]="10" |
||||
[nzShowTotal]="totalTemplate" nzShowQuickJumper (nzPageIndexChange)="pageChange($event)"> |
||||
</nz-pagination> |
||||
<ng-template #totalTemplate let-total> 10条/页,共{{totalCount}}条 </ng-template> |
||||
</div> |
@ -0,0 +1,25 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing'; |
||||
|
||||
import { TaskListComponent } from './task-list.component'; |
||||
|
||||
describe('TaskListComponent', () => { |
||||
let component: TaskListComponent; |
||||
let fixture: ComponentFixture<TaskListComponent>; |
||||
|
||||
beforeEach(async () => { |
||||
await TestBed.configureTestingModule({ |
||||
declarations: [ TaskListComponent ] |
||||
}) |
||||
.compileComponents(); |
||||
}); |
||||
|
||||
beforeEach(() => { |
||||
fixture = TestBed.createComponent(TaskListComponent); |
||||
component = fixture.componentInstance; |
||||
fixture.detectChanges(); |
||||
}); |
||||
|
||||
it('should create', () => { |
||||
expect(component).toBeTruthy(); |
||||
}); |
||||
}); |
@ -0,0 +1,68 @@
|
||||
import { HttpClient } from '@angular/common/http'; |
||||
import { Component, Input, OnInit } from '@angular/core'; |
||||
import { Router } from '@angular/router'; |
||||
import { NzMessageService } from 'ng-zorro-antd/message'; |
||||
import { NzModalRef } from 'ng-zorro-antd/modal'; |
||||
|
||||
@Component({ |
||||
selector: 'app-task-list', |
||||
templateUrl: './task-list.component.html', |
||||
styleUrls: ['./task-list.component.scss'] |
||||
}) |
||||
export class TaskListComponent implements OnInit { |
||||
@Input() data?: any; |
||||
constructor(private router: Router, private http: HttpClient, private message: NzMessageService, private modalRef: NzModalRef) { } |
||||
|
||||
ngOnInit(): void { |
||||
console.log(this.data) |
||||
this.getTaskList() |
||||
} |
||||
listOfData: any = []; |
||||
|
||||
isloading = false |
||||
totalCount |
||||
PageNumber = 1 |
||||
PageSize = 10 |
||||
getTaskList() { |
||||
this.isloading = true |
||||
let params = { |
||||
// Month: selectedTime,
|
||||
// OrganizationId: this.OrganizationId,
|
||||
TaskTypes: ['熟悉演练'], |
||||
// TaskName: this.searchForm.taskname,
|
||||
// CompanyName: this.searchForm.unitname,
|
||||
AssistantOrganizationId: this.data.id, |
||||
approvalStatuses: ['待检查', '已检查'], |
||||
PageNumber: this.PageNumber, |
||||
PageSize: this.PageSize |
||||
} |
||||
this.http.get('/api/PlanTasks', { |
||||
params: params |
||||
}).subscribe((data: any) => { |
||||
this.isloading = false |
||||
console.log('任务列表', data); |
||||
this.totalCount = data.totalCount |
||||
this.listOfData = [...data.items] |
||||
}) |
||||
} |
||||
|
||||
pageChange($event) { |
||||
this.PageNumber = $event |
||||
this.getTaskList() |
||||
} |
||||
|
||||
look(item) { |
||||
console.log(item) |
||||
if (item.approvalStatus == '待检查') { |
||||
this.message.create('warning', '该单位未检查'); |
||||
return |
||||
} |
||||
// this.modalRef.close()
|
||||
// this.router.navigate(['/statistic/taskdetails'], { queryParams: { id: item.id, company: item.company.companyName, organization: item.organization.name, legalPersonName: item.company.legalPersonName ? item.company.legalPersonName : '' } })
|
||||
|
||||
window.open(`/statistic/taskdetails?id=${item.id}&company=${item.company.companyName}&organization=${item.organization.name}&legalPersonName=${item.company.legalPersonName ? item.company.legalPersonName : ''}`) |
||||
|
||||
|
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue