|
|
|
/*
|
|
|
|
* @Descripttion:
|
|
|
|
* @version:
|
|
|
|
* @Author: sueRimn
|
|
|
|
* @Date: 2020-12-24 14:15:10
|
|
|
|
* @LastEditors: sueRimn
|
|
|
|
* @LastEditTime: 2021-01-08 09:48:06
|
|
|
|
*/
|
|
|
|
import { Component, OnInit, ViewChild, Inject } from '@angular/core';
|
|
|
|
import { HttpClient } from '@angular/common/http'
|
|
|
|
import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree';
|
|
|
|
import { MatPaginator } from '@angular/material/paginator';
|
|
|
|
import { FlatTreeControl } from '@angular/cdk/tree';
|
|
|
|
import { FormControl } from '@angular/forms';
|
|
|
|
import { Router,ActivatedRoute } from '@angular/router'
|
|
|
|
import { PageEvent } from '@angular/material/paginator';
|
|
|
|
import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
|
|
|
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
|
|
|
|
import { TreeService } from '../../http-interceptors/tree.service'
|
|
|
|
import { ConstantPool } from '@angular/compiler';
|
|
|
|
import { MatTableDataSource } from '@angular/material/table';
|
|
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'app-onetwo-entry-plan',
|
|
|
|
templateUrl: './onetwo-entry-plan.component.html',
|
|
|
|
styleUrls: ['./onetwo-entry-plan.component.scss']
|
|
|
|
})
|
|
|
|
export class OnetwoEntryPlanComponent implements OnInit {
|
|
|
|
|
|
|
|
constructor(private http:HttpClient,private router:Router,private route:ActivatedRoute,private tree: TreeService,public dialog: MatDialog,public snackBar: MatSnackBar) { }
|
|
|
|
|
|
|
|
ngOnInit(): void {
|
|
|
|
let level = sessionStorage.getItem("level");
|
|
|
|
if(level == "0"){//如果是总队
|
|
|
|
this.preparelevels = [
|
|
|
|
{name:"总队",value:"1"},
|
|
|
|
{name:"支队",value:"2"},
|
|
|
|
{name:"大队",value:"4"},
|
|
|
|
{name:"中队",value:"8"}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
if(level == "1"){//如果是支队
|
|
|
|
this.preparelevels = [
|
|
|
|
{name:"支队",value:"2"},
|
|
|
|
{name:"大队",value:"4"},
|
|
|
|
{name:"中队",value:"8"}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
if(level == "2"){//如果是大队
|
|
|
|
this.preparelevels = [
|
|
|
|
{name:"大队",value:"4"},
|
|
|
|
{name:"中队",value:"8"}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
if(level == "3"){//如果是中队
|
|
|
|
this.preparelevels = [
|
|
|
|
{name:"中队",value:"8"}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
this.url=window.location.href.substring(window.location.href.length-1,window.location.href.length)
|
|
|
|
this.getAlltabledate()
|
|
|
|
}
|
|
|
|
|
|
|
|
url
|
|
|
|
preparelevels:any
|
|
|
|
plcheck:boolean //编制级别勾选框
|
|
|
|
displayedColumns: string[] = ['unitname','level','addname','addtime', 'plantype', 'passstate','isopen','projectlevel','operation'];
|
|
|
|
tabledataSource
|
|
|
|
unitname//预案名称
|
|
|
|
level//预案级别
|
|
|
|
addname//添加人
|
|
|
|
addtime//添加时间
|
|
|
|
endtime//结束时间
|
|
|
|
reservePlanType//预案类型
|
|
|
|
unitstate//审核状态
|
|
|
|
projectlevel//编制级别
|
|
|
|
//分页
|
|
|
|
@ViewChild(MatPaginator, {static: true})
|
|
|
|
pageEvent: PageEvent;
|
|
|
|
paginator: MatPaginator;
|
|
|
|
length:any; //共多少条数据
|
|
|
|
pageSize:any; //每页条数
|
|
|
|
pageSizeOptions: number[] = [10] //设置每页条数
|
|
|
|
PageNumber:any; //第几页
|
|
|
|
|
|
|
|
//获得所有预案信息
|
|
|
|
getAllPlanInfo(){
|
|
|
|
let paramsdata:any = {
|
|
|
|
HasChildrenPlanLevel: this.plcheck || '',
|
|
|
|
PageNumber: this.PageNumber || '1',
|
|
|
|
PageSize: this.pageSizeOptions[0],
|
|
|
|
}
|
|
|
|
this.http.get("/api/Plans",{params:paramsdata}).subscribe((data:any)=>{
|
|
|
|
|
|
|
|
this.length = data.totalCount
|
|
|
|
//this.allPlanInfo = data
|
|
|
|
|
|
|
|
//this.tabledataSource = new MatTableDataSource(data.items)
|
|
|
|
console.log(this.tabledataSource)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
//获取表格数据
|
|
|
|
getAlltabledate(){
|
|
|
|
let paramsdata:any = {
|
|
|
|
PlanCategory:this.url=='2'?2:1,
|
|
|
|
PlanType:this.projectlevel||'',
|
|
|
|
AuditStatus:this.unitstate|| '',
|
|
|
|
PageNumber: this.PageNumber || '1',
|
|
|
|
PageSize: this.pageSizeOptions[0],
|
|
|
|
|
|
|
|
}
|
|
|
|
this.http.get("/api/PlanComponentsMajor",{params:paramsdata}).subscribe((data:any)=>{
|
|
|
|
this.length = data.totalCount
|
|
|
|
this.tabledataSource = data.items
|
|
|
|
console.log(this.tabledataSource)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
//重置
|
|
|
|
reset(){
|
|
|
|
this.unitname=''
|
|
|
|
this.level=''
|
|
|
|
this.addname=''
|
|
|
|
this.addtime=''
|
|
|
|
//this.unittype=''
|
|
|
|
this.unitstate=''
|
|
|
|
this.projectlevel=''
|
|
|
|
}
|
|
|
|
|
|
|
|
//查询
|
|
|
|
onSubmit (value) {
|
|
|
|
this.PageNumber = 1
|
|
|
|
this.pageEvent.pageIndex = 0
|
|
|
|
this.getAlltabledate();
|
|
|
|
}
|
|
|
|
|
|
|
|
//新增预案弹窗
|
|
|
|
addunit(){
|
|
|
|
const dialogRef = this.dialog.open(newunitComponent, {
|
|
|
|
width: '340px',
|
|
|
|
height:'430px'
|
|
|
|
//data: paperDataInfo
|
|
|
|
});
|
|
|
|
}
|
|
|
|
//查看预案按钮跳转
|
|
|
|
routerTo(element){
|
|
|
|
console.log(element)
|
|
|
|
sessionStorage.setItem("companyName",element.unitname)
|
|
|
|
window.open(`/planManagement/entryPlandetail?unitId=${element.company.id}&unitTypeId=${element.company.buildingTypes.length == 0 ? null :element.company.buildingTypes[0].id}&operation=true&pagetype=entryplan&unitName=${element.company.name}&orName=${element.company.organizationName}&unitType=${element.company.buildingTypes.length == 0 ? null :element.company.buildingTypes[0].name}&unitAdd=${element.company.address}`);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'new-unit',
|
|
|
|
templateUrl: './newunit.html',
|
|
|
|
styleUrls: ['./newunit.scss']
|
|
|
|
})
|
|
|
|
export class newunitComponent{
|
|
|
|
constructor(private router:Router,private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef<newunitComponent>,@Inject(MAT_DIALOG_DATA) public data: any) {}
|
|
|
|
unitname//预案名称
|
|
|
|
level//预案级别
|
|
|
|
addname//添加人
|
|
|
|
addtime//添加时间
|
|
|
|
unittype//预案类型
|
|
|
|
unitstate//审核状态
|
|
|
|
projectlevel//编制级别
|
|
|
|
close(){
|
|
|
|
this.dialogRef.close();
|
|
|
|
}
|
|
|
|
}
|