Browse Source

[完善]年份自动获取

master
邵佳豪 3 months ago
parent
commit
2f06c9e101
  1. 2
      package.json
  2. 2
      src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.html
  3. 2
      src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.ts
  4. 2
      src/app/home/task/da-subordinate-audit/da-subordinate-audit.component.html
  5. 276
      src/app/home/task/da-subordinate-audit/da-subordinate-audit.component.ts
  6. 2
      src/app/home/task/station-task-apply/station-task-apply.component.html
  7. 460
      src/app/home/task/station-task-apply/station-task-apply.component.ts
  8. 2
      src/app/home/task/station-task-execution/station-task-execution.component.html
  9. 409
      src/app/home/task/station-task-execution/station-task-execution.component.ts
  10. 2
      src/app/home/task/station-weekly-plan/station-weekly-plan.component.html
  11. 1041
      src/app/home/task/station-weekly-plan/station-weekly-plan.component.ts
  12. 12
      src/app/home/task/zhi-audit/zhi-audit.component.html
  13. 125
      src/app/home/task/zhi-audit/zhi-audit.component.ts
  14. 2
      src/app/home/task/zhi-indicators/zhi-indicators.component.html
  15. 2
      src/app/home/task/zhi-indicators/zhi-indicators.component.ts

2
package.json

@ -3,7 +3,7 @@
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve --proxy-config proxy.config.json --open --port 8888 --host 192.168.1.46",
"start": "ng serve --proxy-config proxy.config.json --open --port 8888",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"

2
src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.html

@ -6,6 +6,8 @@
<nz-option [nzValue]="2023" nzLabel="2023年"></nz-option>
<nz-option [nzValue]="2024" nzLabel="2024年"></nz-option>
<nz-option [nzValue]="2025" nzLabel="2025年"></nz-option>
<nz-option [nzValue]="2026" nzLabel="2026年"></nz-option>
<nz-option [nzValue]="2027" nzLabel="2027年"></nz-option>
</nz-select>
<div *ngFor="let item of months" class="monthbtn" (click)="selectMonth(item)"
[ngClass]="{'selectedMonth': item.id == selectedMonth}">

2
src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.ts

@ -21,7 +21,7 @@ export class DaMonthlyTaskOverviewComponent implements OnInit {
) {}
selectedMonth;
selectedYear = 2024;
selectedYear = new Date().getFullYear();
selectedTime;
selectMonth(item) {
this.selectedMonth = item.id;

2
src/app/home/task/da-subordinate-audit/da-subordinate-audit.component.html

@ -6,6 +6,8 @@
<nz-option [nzValue]="2023" nzLabel="2023年"></nz-option>
<nz-option [nzValue]="2024" nzLabel="2024年"></nz-option>
<nz-option [nzValue]="2025" nzLabel="2025年"></nz-option>
<nz-option [nzValue]="2026" nzLabel="2026年"></nz-option>
<nz-option [nzValue]="2027" nzLabel="2027年"></nz-option>
</nz-select>
<div *ngFor="let item of months" class="monthbtn" (click)="selectMonth(item)"
[ngClass]="{'selectedMonth': item.id == selectedMonth}">

276
src/app/home/task/da-subordinate-audit/da-subordinate-audit.component.ts

@ -7,33 +7,36 @@ import { AllotPersonComponent } from './allot-person/allot-person.component';
@Component({
selector: 'app-da-subordinate-audit',
templateUrl: './da-subordinate-audit.component.html',
styleUrls: ['./da-subordinate-audit.component.scss']
styleUrls: ['./da-subordinate-audit.component.scss'],
})
export class DaSubordinateAuditComponent implements OnInit {
constructor(
private http: HttpClient,
private modal: NzModalService,
private viewContainerRef: ViewContainerRef,
private message: NzMessageService
) {}
constructor(private http: HttpClient, private modal: NzModalService, private viewContainerRef: ViewContainerRef, private message: NzMessageService) { }
OrganizationId;
selectedTab = 0;
OrganizationId
selectedTab = 0
atPresentData = { id: 0, name: '', finished: 0, totalCount: 0, list: [] }
atPresentData = { id: 0, name: '', finished: 0, totalCount: 0, list: [] };
selectTab(item) {
this.selectedTab = item.id
this.atPresentData = item
this.selectedTab = item.id;
this.atPresentData = item;
}
ngOnInit(): void {
this.OrganizationId = JSON.parse(sessionStorage.getItem('userData')).organizationId
this.selectedMonth = new Date().getMonth() + 1
this.getTaskList(0)
this.OrganizationId = JSON.parse(
sessionStorage.getItem('userData')
).organizationId;
this.selectedMonth = new Date().getMonth() + 1;
this.getTaskList(0);
//获得主协调查人员
this.getSupervisor('main')
this.getSupervisor('assisted')
this.getSupervisor('main');
this.getSupervisor('assisted');
}
months = [
{ id: 1, name: '1月', isable: true },
@ -47,104 +50,110 @@ export class DaSubordinateAuditComponent implements OnInit {
{ id: 9, name: '9月', isable: true },
{ id: 10, name: '10月', isable: true },
{ id: 11, name: '11月', isable: true },
{ id: 12, name: '12月', isable: true }
]
selectedMonth
selectedYear = 2024
selectedTime
{ id: 12, name: '12月', isable: true },
];
selectedMonth;
selectedYear = new Date().getFullYear();
selectedTime;
selectMonth(item) {
this.selectedMonth = item.id
this.selectedMonth = item.id;
this.getTaskList(this.selectedTab)
this.getTaskList(this.selectedTab);
}
selectYear(e) {
this.selectedYear = e
console.log('年', e)
this.getTaskList(this.selectedTab)
this.selectedYear = e;
console.log('年', e);
this.getTaskList(this.selectedTab);
}
PageNumber = 1
PageSize = 9999
PageNumber = 1;
PageSize = 9999;
data = [
{ id: 0, name: '熟悉演练任务', finished: 0, totalCount: 0, list: [] },
{ id: 1, name: '联络指导任务', finished: 0, totalCount: 0, list: [] }
]
{ id: 1, name: '联络指导任务', finished: 0, totalCount: 0, list: [] },
];
isloading = false
isloading = false;
getTaskList(index) {
this.isloading = true
this.isloading = true;
this.data = [
{ id: 0, name: '熟悉演练任务', finished: 0, totalCount: 0, list: [] },
{ id: 1, name: '联络指导任务', finished: 0, totalCount: 0, list: [] }
]
let selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01'
console.log('查询时间', selectedTime)
{ id: 1, name: '联络指导任务', finished: 0, totalCount: 0, list: [] },
];
let selectedTime =
this.selectedYear + '-' + this.selectedMonth + '-' + '01';
console.log('查询时间', selectedTime);
let params = {
Month: selectedTime,
OrganizationId: this.OrganizationId,
PageNumber: this.PageNumber,
PageSize: this.PageSize
}
this.http.get('/api/PlanTasks', {
params: params
}).subscribe((data: any) => {
let arr1 = []
let arr2 = []
data.items.forEach(element => {
if (element.taskName == '熟悉演练') {
arr1.push(element)
}
if (element.taskName == '联络指导') {
arr2.push(element)
}
});
arr1.forEach(item => {
if (!!item.approvalStatus) {
this.data[0].finished += 1
}
});
arr2.forEach(item => {
if (!!item.approvalStatus) {
this.data[1].finished += 1
}
PageSize: this.PageSize,
};
this.http
.get('/api/PlanTasks', {
params: params,
})
.subscribe((data: any) => {
let arr1 = [];
let arr2 = [];
data.items.forEach((element) => {
if (element.taskName == '熟悉演练') {
arr1.push(element);
}
if (element.taskName == '联络指导') {
arr2.push(element);
}
});
arr1.forEach((item) => {
if (!!item.approvalStatus) {
this.data[0].finished += 1;
}
});
arr2.forEach((item) => {
if (!!item.approvalStatus) {
this.data[1].finished += 1;
}
});
this.data[0].totalCount = arr1.length;
this.data[0].list = [...arr1];
this.data[1].totalCount = arr2.length;
this.data[1].list = [...arr2];
this.atPresentData = this.data[index];
console.log(this.atPresentData);
this.isloading = false;
});
this.data[0].totalCount = arr1.length
this.data[0].list = [...arr1]
this.data[1].totalCount = arr2.length
this.data[1].list = [...arr2]
this.atPresentData = this.data[index]
console.log(this.atPresentData)
this.isloading = false
})
}
assitantsupervisorList
mainsupervisorList
assitantsupervisorList;
mainsupervisorList;
getSupervisor(type) {
let params = {
inspectorType: type
}
this.http.get('/api/Users/Inspectors', {
params: params
}).subscribe((data: any) => {
console.log('检查员列表', data)
if (type == 'main') {
this.mainsupervisorList = data
} else {
this.assitantsupervisorList = data
}
})
inspectorType: type,
};
this.http
.get('/api/Users/Inspectors', {
params: params,
})
.subscribe((data: any) => {
console.log('检查员列表', data);
if (type == 'main') {
this.mainsupervisorList = data;
} else {
this.assitantsupervisorList = data;
}
});
}
allot(item) {
console.log(item)
if (this.mainsupervisorList.length == 0 || this.assitantsupervisorList.length == 0) {
console.log(item);
if (
this.mainsupervisorList.length == 0 ||
this.assitantsupervisorList.length == 0
) {
this.message.create('warning', '请从用户管理添加检查人员');
return
return;
}
const modal = this.modal.create({
nzTitle: '分配监督检查员',
@ -154,38 +163,40 @@ export class DaSubordinateAuditComponent implements OnInit {
nzMaskClosable: false,
nzComponentParams: {
mainsupervisorList: this.mainsupervisorList,
assitantsupervisorList: this.assitantsupervisorList
assitantsupervisorList: this.assitantsupervisorList,
},
nzOnOk: async () => {
if (instance.validateForm.valid) {
await new Promise((resolve, reject) => {
let body = {
mainSupervisorId: instance.validateForm.value.main,
assitantSupervisorId: instance.validateForm.value.assitant
}
assitantSupervisorId: instance.validateForm.value.assitant,
};
this.http.patch(`/api/PlanTasks/${item.id}`, body).subscribe({
next: async (data) => {
this.message.create('success', '分配成功');
resolve(data)
this.getTaskList(this.selectedTab)
return true
resolve(data);
this.getTaskList(this.selectedTab);
return true;
},
error: (err) => {
this.message.create('warning', '分配失败');
reject(err)
return false
}
})
})
reject(err);
return false;
},
});
});
} else {
this.message.create('warning', '请填写完整!');
return false
return false;
}
}
},
});
const instance = modal.getContentComponent();
modal.afterOpen.subscribe(() => console.log('[afterOpen] emitted!'));
modal.afterClose.subscribe(result => console.log('[afterClose] The result is:', result));
modal.afterClose.subscribe((result) =>
console.log('[afterClose] The result is:', result)
);
}
agree(item) {
@ -194,21 +205,23 @@ export class DaSubordinateAuditComponent implements OnInit {
nzOkText: '确定',
nzOkType: 'default',
nzOnOk: () => {
this.http.post(`/api/PlanTasks/Approval/${item.id}`, null, {
params: {
approvalStatus: 'approved'
}
}).subscribe({
next: (data) => {
this.message.create('success', '审核成功');
this.getTaskList(this.selectedTab)
},
error: (err) => {
this.message.create('warning', '审核失败');
}
})
this.http
.post(`/api/PlanTasks/Approval/${item.id}`, null, {
params: {
approvalStatus: 'approved',
},
})
.subscribe({
next: (data) => {
this.message.create('success', '审核成功');
this.getTaskList(this.selectedTab);
},
error: (err) => {
this.message.create('warning', '审核失败');
},
});
},
nzCancelText: '取消'
nzCancelText: '取消',
});
}
@ -218,22 +231,23 @@ export class DaSubordinateAuditComponent implements OnInit {
nzOkText: '确定',
nzOkType: 'default',
nzOnOk: () => {
this.http.post(`/api/PlanTasks/Approval/${item.id}`, null, {
params: {
approvalStatus: 'reject'
}
}).subscribe({
next: (data) => {
this.message.create('success', '审核成功');
this.getTaskList(this.selectedTab)
},
error: (err) => {
this.message.create('warning', '审核失败');
}
})
this.http
.post(`/api/PlanTasks/Approval/${item.id}`, null, {
params: {
approvalStatus: 'reject',
},
})
.subscribe({
next: (data) => {
this.message.create('success', '审核成功');
this.getTaskList(this.selectedTab);
},
error: (err) => {
this.message.create('warning', '审核失败');
},
});
},
nzCancelText: '取消'
nzCancelText: '取消',
});
}
}

2
src/app/home/task/station-task-apply/station-task-apply.component.html

@ -27,6 +27,8 @@
<nz-option [nzValue]="2023" nzLabel="2023年"></nz-option>
<nz-option [nzValue]="2024" nzLabel="2024年"></nz-option>
<nz-option [nzValue]="2025" nzLabel="2025年"></nz-option>
<nz-option [nzValue]="2026" nzLabel="2026年"></nz-option>
<nz-option [nzValue]="2027" nzLabel="2027年"></nz-option>
</nz-select>
<div *ngFor="let item of months" class="monthbtn" (click)="selectMonth(item)"
[ngClass]="{'selectedMonth': item.id == selectedMonth}">

460
src/app/home/task/station-task-apply/station-task-apply.component.ts

@ -1,6 +1,15 @@
import { Component, OnInit, TemplateRef, ViewContainerRef } from '@angular/core';
import {
Component,
OnInit,
TemplateRef,
ViewContainerRef,
} from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { NzFormatEmitEvent, NzTreeComponent, NzTreeNodeOptions } from 'ng-zorro-antd/tree';
import {
NzFormatEmitEvent,
NzTreeComponent,
NzTreeNodeOptions,
} from 'ng-zorro-antd/tree';
import { NzModalService } from 'ng-zorro-antd/modal';
import { NzMessageService } from 'ng-zorro-antd/message';
import { HttpClient, HttpHeaders } from '@angular/common/http';
@ -10,25 +19,31 @@ import { ApplyLookComponent } from './apply-look/apply-look.component';
import { ThisReceiver } from '@angular/compiler';
import { MethodService } from 'src/app/service/method.service';
@Component({
selector: 'app-station-task-apply',
templateUrl: './station-task-apply.component.html',
styleUrls: ['./station-task-apply.component.scss']
styleUrls: ['./station-task-apply.component.scss'],
})
export class StationTaskApplyComponent implements OnInit {
validateForm!: FormGroup;
constructor(private fb: FormBuilder, private modal: NzModalService, private viewContainerRef: ViewContainerRef, private message: NzMessageService, private http: HttpClient, private toTree: TreeService, public methodService: MethodService) { }
constructor(
private fb: FormBuilder,
private modal: NzModalService,
private viewContainerRef: ViewContainerRef,
private message: NzMessageService,
private http: HttpClient,
private toTree: TreeService,
public methodService: MethodService
) {}
searchForm = {
taskname: '',
unitname: '',
unitlevel: '',
or: ''
}
OrganizationId
or: '',
};
OrganizationId;
isSupervisor: boolean //是否为检查员
isSupervisor: boolean; //是否为检查员
months = [
{ id: 1, name: '1月', isable: true },
@ -42,142 +57,151 @@ export class StationTaskApplyComponent implements OnInit {
{ id: 9, name: '9月', isable: true },
{ id: 10, name: '10月', isable: true },
{ id: 11, name: '11月', isable: true },
{ id: 12, name: '12月', isable: true }
]
selectedMonth
selectedYear = 2024
selectedTime
{ id: 12, name: '12月', isable: true },
];
selectedMonth;
selectedYear = new Date().getFullYear();
selectedTime;
selectMonth(item) {
this.selectedMonth = item.id
this.getTaskList()
this.selectedMonth = item.id;
this.getTaskList();
}
selectYear(e) {
this.selectedYear = e
this.getTaskList()
this.selectedYear = e;
this.getTaskList();
}
isloading = false
totalCount
PageNumber = 1
PageSize = 10
taskLIst = []
isloading = false;
totalCount;
PageNumber = 1;
PageSize = 10;
taskLIst = [];
getTaskList() {
this.isloading = true
let selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01'
this.isloading = true;
let selectedTime =
this.selectedYear + '-' + this.selectedMonth + '-' + '01';
let params = {
Month: selectedTime,
TaskName: this.searchForm.taskname,
CompanyName: this.searchForm.unitname,
assistantOrganizationId: this.searchForm.or,
TaskTypes: this.isSupervisor ? ['双随机', '联络指导'] : ['熟悉演练'],
CreatorId: this.isSupervisor ? this.userId : null,//如果是检查员需要传CreatorId只针对这个账户 如果是救援站就不需要
CreatorId: this.isSupervisor ? this.userId : null, //如果是检查员需要传CreatorId只针对这个账户 如果是救援站就不需要
CreationTypes: ['申领任务'],
OrganizationId: this.OrganizationId,
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.taskLIst = [...data.items]
})
PageSize: this.PageSize,
};
this.http
.get('/api/PlanTasks', {
params: params,
})
.subscribe((data: any) => {
this.isloading = false;
console.log('任务申请列表', data);
this.totalCount = data.totalCount;
this.taskLIst = [...data.items];
});
}
pageChange($event) {
this.PageNumber = $event
this.getTaskList()
this.PageNumber = $event;
this.getTaskList();
}
search() {
this.PageNumber = 1
this.getTaskList()
this.PageNumber = 1;
this.getTaskList();
}
reset() {
this.PageNumber = 1
this.PageNumber = 1;
this.searchForm = {
taskname: '',
unitname: '',
unitlevel: '',
or: ''
}
this.getTaskList()
or: '',
};
this.getTaskList();
}
expandKeys
defaultOrId: string
expandKeys;
defaultOrId: string;
//获取所有组织机构
organizationList: any
organizationListAll: any
nodes: any = []
organizationList: any;
organizationListAll: any;
nodes: any = [];
async getAllOrganization() {
let params = {
ContainsChildren: "true",
ContainsChildren: 'true',
PageNumber: 1,
PageSize: 9999,
code: '0000'
}
code: '0000',
};
var p = new Promise<void>((resolve, reject) => {
this.http.get('/api/Organizations', {
params: params
}).subscribe((data: any) => {
data.items.forEach(element => {
element.key = element.id
element.title = element.name
element.disableCheckbox = true
element.selectable = false
element.level == 'squadron' ? element.disableCheckbox = false : null
});
this.organizationListAll = JSON.parse(JSON.stringify(data.items))
this.organizationList = JSON.parse(JSON.stringify(data.items)).filter(item => {
return item.level != 'squadron'
this.http
.get('/api/Organizations', {
params: params,
})
resolve(data)
})
})
return p
.subscribe((data: any) => {
data.items.forEach((element) => {
element.key = element.id;
element.title = element.name;
element.disableCheckbox = true;
element.selectable = false;
element.level == 'squadron'
? (element.disableCheckbox = false)
: null;
});
this.organizationListAll = JSON.parse(JSON.stringify(data.items));
this.organizationList = JSON.parse(JSON.stringify(data.items)).filter(
(item) => {
return item.level != 'squadron';
}
);
resolve(data);
});
});
return p;
}
//获得所有检查员
supervisorList = []
supervisorList = [];
async getSupervisor() {
return new Promise<void>((resolve, reject) => {
this.http.get('/api/Users/Inspectors').subscribe((data: any) => {
console.log('检查员列表', data)
data.forEach(element => {
element.key = element.id
element.title = element.name
element.parentId = element.organizationId
console.log('检查员列表', data);
data.forEach((element) => {
element.key = element.id;
element.title = element.name;
element.parentId = element.organizationId;
});
this.supervisorList = data
resolve(data)
})
})
this.supervisorList = data;
resolve(data);
});
});
}
mainsupervisorList = []
assitantsupervisorList = []
mainsupervisorList = [];
assitantsupervisorList = [];
getSupervisortype(type) {
let params = {
inspectorType: type
}
this.http.get('/api/Users/Inspectors', {
params: params
}).subscribe((data: any) => {
if (type == 'main') {
this.mainsupervisorList = data
} else {
this.assitantsupervisorList = data
}
})
inspectorType: type,
};
this.http
.get('/api/Users/Inspectors', {
params: params,
})
.subscribe((data: any) => {
if (type == 'main') {
this.mainsupervisorList = data;
} else {
this.assitantsupervisorList = data;
}
});
}
//获得除了检查员的其他用户
users
users;
async getUsers() {
var p = new Promise<void>((resolve, reject) => {
let params = {
@ -185,60 +209,66 @@ export class StationTaskApplyComponent implements OnInit {
OrganizationLevel: 'squadron',
ContainsChildren: true,
PageNumber: 1,
PageSize: 9999
}
this.http.get('/api/Users', {
params: params
}).subscribe((data: any) => {
console.log('用户列表', data.items)
data.items.forEach(element => {
element.key = element.id
element.title = element.name
element.parentId = element.organizationId
PageSize: 9999,
};
this.http
.get('/api/Users', {
params: params,
})
.subscribe((data: any) => {
console.log('用户列表', data.items);
data.items.forEach((element) => {
element.key = element.id;
element.title = element.name;
element.parentId = element.organizationId;
});
this.users = data.items;
resolve(data);
});
this.users = data.items
resolve(data)
})
})
return p
});
return p;
}
userId
userId;
ngOnInit(): void {
this.OrganizationId = JSON.parse(sessionStorage.getItem('userData')).organizationId
this.userId = JSON.parse(sessionStorage.getItem('userData')).id
let roles = JSON.parse(sessionStorage.getItem('userData')).roles
let isSupervisor = roles.find(item => {
return item.name.indexOf('检查') != -1
})
isSupervisor ? this.isSupervisor = true : this.isSupervisor = false
this.selectedMonth = new Date().getMonth() + 1
this.getTaskList()
Promise.all([this.getAllOrganization(), this.getSupervisor(), this.getUsers()])
.then((results) => {
if (this.isSupervisor) {
// let arr = [...this.users, ...this.organizationListAll]
let arr = [...this.organizationListAll]
this.nodes = this.toTree.toTree(JSON.parse(JSON.stringify(arr)))
} else {
let arr = [...this.supervisorList, ...this.organizationList]
this.nodes = this.toTree.toTree(JSON.parse(JSON.stringify(arr)))
}
});
this.OrganizationId = JSON.parse(
sessionStorage.getItem('userData')
).organizationId;
this.userId = JSON.parse(sessionStorage.getItem('userData')).id;
let roles = JSON.parse(sessionStorage.getItem('userData')).roles;
let isSupervisor = roles.find((item) => {
return item.name.indexOf('检查') != -1;
});
isSupervisor ? (this.isSupervisor = true) : (this.isSupervisor = false);
this.selectedMonth = new Date().getMonth() + 1;
this.getTaskList();
Promise.all([
this.getAllOrganization(),
this.getSupervisor(),
this.getUsers(),
]).then((results) => {
if (this.isSupervisor) {
// let arr = [...this.users, ...this.organizationListAll]
let arr = [...this.organizationListAll];
this.nodes = this.toTree.toTree(JSON.parse(JSON.stringify(arr)));
} else {
let arr = [...this.supervisorList, ...this.organizationList];
this.nodes = this.toTree.toTree(JSON.parse(JSON.stringify(arr)));
}
});
setTimeout(() => {
this.rollStart()
this.rollStart();
}, 0);
//获得主协调查人员
this.getSupervisortype('main')
this.getSupervisortype('assisted')
this.getSupervisortype('main');
this.getSupervisortype('assisted');
}
timer
timer;
rollStart() {
var ROLL_SPEED = 100
var ROLL_SPEED = 100;
var noticeList1 = document.getElementById('notice-list');
var noticeList2 = document.getElementById('notice-list-2');
var listWrapper = document.getElementById('list-wrapper');
@ -246,18 +276,20 @@ export class StationTaskApplyComponent implements OnInit {
this.timer = setInterval(rollStart, ROLL_SPEED);
function rollStart() {
if (Math.abs(_subStr(listWrapper.style.top)) >= noticeList1.clientHeight) {
listWrapper.style.top = '0px'
if (
Math.abs(_subStr(listWrapper.style.top)) >= noticeList1.clientHeight
) {
listWrapper.style.top = '0px';
} else {
var top = listWrapper.style.top
listWrapper.style.top = _subStr(top) - 1 + 'px'
var top = listWrapper.style.top;
listWrapper.style.top = _subStr(top) - 1 + 'px';
}
}
// 截取px前数值
function _subStr(str) {
var index = str.indexOf('px');
if (index > -1) {
return parseFloat(str.substr(0, index + 1))
return parseFloat(str.substr(0, index + 1));
}
}
}
@ -265,20 +297,20 @@ export class StationTaskApplyComponent implements OnInit {
window.clearInterval(this.timer);
}
mouseleave() {
this.rollStart()
this.rollStart();
}
ngOnDestroy(): void {
console.log('退出了')
this.mouseEnter()
console.log('退出了');
this.mouseEnter();
}
apply() {
if (this.nodes.length == 0) {
this.message.create('warning', '组织机构为空,请稍后重试');
return
return;
}
if (this.supervisorList.length == 0) {
this.message.create('warning', '检查员名单为空,请稍后重试');
return
return;
}
const modal = this.modal.create({
nzTitle: '申请',
@ -287,40 +319,53 @@ export class StationTaskApplyComponent implements OnInit {
nzWidth: 660,
nzMaskClosable: false,
nzComponentParams: {
title: this.isSupervisor ? ["联络指导", "双随机"] : ["熟悉演练"],
title: this.isSupervisor ? ['联络指导', '双随机'] : ['熟悉演练'],
isSupervisor: this.isSupervisor,
supervisorList: JSON.parse(JSON.stringify(this.supervisorList)),
organizationList: JSON.parse(JSON.stringify(this.organizationList)),
users: JSON.parse(JSON.stringify(this.users)),
nodes: JSON.parse(JSON.stringify(this.nodes)),
mainsupervisorList: JSON.parse(JSON.stringify(this.mainsupervisorList)),
assitantsupervisorList: JSON.parse(JSON.stringify(this.assitantsupervisorList))
assitantsupervisorList: JSON.parse(
JSON.stringify(this.assitantsupervisorList)
),
},
nzOnOk: async () => {
console.log(instance.validateForm.value)
console.log(instance.validateForm.value);
if (instance.validateForm.valid && instance.selectedUnitData.id) {
if (instance.taskType == '双随机') {
if (!instance.validateForm.value.main || !instance.validateForm.value.assist) {
if (
!instance.validateForm.value.main ||
!instance.validateForm.value.assist
) {
this.message.create('warning', '请填写检查人员!');
return false
return false;
}
}
await new Promise((resolve, reject) => {
let selectedMonth = this.selectedMonth < 10 ? "0" + this.selectedMonth : this.selectedMonth;
let selectedTime = this.selectedYear + '-' + selectedMonth + '-' + '01'
let supervisorIds
let assistantOrganizationIds
let selectedMonth =
this.selectedMonth < 10
? '0' + this.selectedMonth
: this.selectedMonth;
let selectedTime =
this.selectedYear + '-' + selectedMonth + '-' + '01';
let supervisorIds;
let assistantOrganizationIds;
if (this.isSupervisor) {
if (instance.taskType == '双随机') {
supervisorIds = [instance.validateForm.value.main, instance.validateForm.value.assist]
supervisorIds = [
instance.validateForm.value.main,
instance.validateForm.value.assist,
];
} else {
supervisorIds = []
supervisorIds = [];
}
assistantOrganizationIds = instance.validateForm.value.organization
assistantOrganizationIds =
instance.validateForm.value.organization;
} else {
supervisorIds = instance.validateForm.value.organization
assistantOrganizationIds = []
supervisorIds = instance.validateForm.value.organization;
assistantOrganizationIds = [];
}
let body = {
@ -332,36 +377,35 @@ export class StationTaskApplyComponent implements OnInit {
supervisorIds: supervisorIds,
assistantOrganizationIds: assistantOrganizationIds,
creationType: '申领任务',
approvalStatus: '待处理'
}
approvalStatus: '待处理',
};
this.http.post('/api/PlanTasks', body).subscribe({
next: (data) => {
this.message.create('success', '创建成功');
resolve(data)
this.getTaskList()
return true
resolve(data);
this.getTaskList();
return true;
},
error: (err) => {
this.message.create('warning', '创建失败');
reject(err)
return false
}
})
})
reject(err);
return false;
},
});
});
} else {
this.message.create('warning', '请填写完整!');
return false
return false;
}
}
},
});
const instance = modal.getContentComponent();
modal.afterOpen.subscribe(() => console.log('[afterOpen] emitted!'));
modal.afterClose.subscribe(result => console.log('[afterClose] The result is:', result));
modal.afterClose.subscribe((result) =>
console.log('[afterClose] The result is:', result)
);
}
look(item) {
const modal = this.modal.create({
nzTitle: '详情',
@ -372,44 +416,40 @@ export class StationTaskApplyComponent implements OnInit {
nzComponentParams: {
data: item,
},
nzFooter: null
nzFooter: null,
});
const instance = modal.getContentComponent();
modal.afterOpen.subscribe(() => console.log('[afterOpen] emitted!'));
modal.afterClose.subscribe(result => console.log('[afterClose] The result is:', result));
modal.afterClose.subscribe((result) =>
console.log('[afterClose] The result is:', result)
);
}
//删除任务
deleteTask(item, incomingData) {
console.log(item)
console.log(incomingData)
console.log(item);
console.log(incomingData);
this.modal.confirm({
nzTitle: `确定要删除该任务吗?`,
nzOkText: '确定',
nzOkType: 'primary',
nzOnOk: () => {
this.http.delete(`/api/PlanTasks/${item.id}`).subscribe(data => {
this.http.delete(`/api/PlanTasks/${item.id}`).subscribe((data) => {
for (let index = 0; index < incomingData.length; index++) {
const element = incomingData[index];
if (element.id == item.id) {
incomingData.splice(index, 1)
index--
incomingData.splice(index, 1);
index--;
}
}
this.message.create('success', '删除成功!');
})
});
},
nzCancelText: '取消',
nzOnCancel: () => {
}
nzOnCancel: () => {},
});
}
//待检查撤销
revocationTask(item, taskLIst) {
this.modal.confirm({
@ -417,21 +457,23 @@ export class StationTaskApplyComponent implements OnInit {
nzOkText: '确定',
nzOkType: 'default',
nzOnOk: () => {
this.http.post(`/api/PlanTasks/Approval/${item.id}`, null, {
params: {
approvalStatus: '待处理'
}
}).subscribe({
next: (data) => {
this.message.create('success', '已撤销');
item.approvalStatus = '待处理'
},
error: (err) => {
this.message.create('warning', '撤销失败');
}
})
this.http
.post(`/api/PlanTasks/Approval/${item.id}`, null, {
params: {
approvalStatus: '待处理',
},
})
.subscribe({
next: (data) => {
this.message.create('success', '已撤销');
item.approvalStatus = '待处理';
},
error: (err) => {
this.message.create('warning', '撤销失败');
},
});
},
nzCancelText: '取消'
nzCancelText: '取消',
});
}
}
@ -451,5 +493,5 @@ export enum TaskType {
,
,
,
}
,
}

2
src/app/home/task/station-task-execution/station-task-execution.component.html

@ -27,6 +27,8 @@
<nz-option [nzValue]="2023" nzLabel="2023年"></nz-option>
<nz-option [nzValue]="2024" nzLabel="2024年"></nz-option>
<nz-option [nzValue]="2025" nzLabel="2025年"></nz-option>
<nz-option [nzValue]="2026" nzLabel="2026年"></nz-option>
<nz-option [nzValue]="2027" nzLabel="2027年"></nz-option>
</nz-select>
<div *ngFor="let item of months" class="monthbtn" (click)="selectMonth(item)"
[ngClass]="{'selectedMonth': item.id == selectedMonth}">

409
src/app/home/task/station-task-execution/station-task-execution.component.ts

@ -1,6 +1,15 @@
import { Component, OnInit, TemplateRef, ViewContainerRef } from '@angular/core';
import {
Component,
OnInit,
TemplateRef,
ViewContainerRef,
} from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { NzFormatEmitEvent, NzTreeComponent, NzTreeNodeOptions } from 'ng-zorro-antd/tree';
import {
NzFormatEmitEvent,
NzTreeComponent,
NzTreeNodeOptions,
} from 'ng-zorro-antd/tree';
import { NzModalService } from 'ng-zorro-antd/modal';
import { NzMessageService } from 'ng-zorro-antd/message';
import { HttpClient, HttpHeaders } from '@angular/common/http';
@ -12,21 +21,29 @@ import { Router } from '@angular/router';
@Component({
selector: 'app-station-task-execution',
templateUrl: './station-task-execution.component.html',
styleUrls: ['./station-task-execution.component.scss']
styleUrls: ['./station-task-execution.component.scss'],
})
export class StationTaskExecutionComponent implements OnInit {
validateForm!: FormGroup;
constructor(private router: Router, public methodService: MethodService, private fb: FormBuilder, private modal: NzModalService, private viewContainerRef: ViewContainerRef, private message: NzMessageService, private http: HttpClient, private toTree: TreeService) { }
constructor(
private router: Router,
public methodService: MethodService,
private fb: FormBuilder,
private modal: NzModalService,
private viewContainerRef: ViewContainerRef,
private message: NzMessageService,
private http: HttpClient,
private toTree: TreeService
) {}
searchForm = {
taskname: '',
unitname: '',
unitlevel: '',
or: ''
}
OrganizationId
or: '',
};
OrganizationId;
isSupervisor: boolean //是否为检查员
isSupervisor: boolean; //是否为检查员
months = [
{ id: 1, name: '1月', isable: true },
@ -40,18 +57,18 @@ export class StationTaskExecutionComponent implements OnInit {
{ id: 9, name: '9月', isable: true },
{ id: 10, name: '10月', isable: true },
{ id: 11, name: '11月', isable: true },
{ id: 12, name: '12月', isable: true }
]
selectedMonth
selectedYear = 2024
selectedTime
{ id: 12, name: '12月', isable: true },
];
selectedMonth;
selectedYear = new Date().getFullYear();
selectedTime;
selectMonth(item) {
this.selectedMonth = item.id
this.getTaskList()
this.selectedMonth = item.id;
this.getTaskList();
}
selectYear(e) {
this.selectedYear = e
this.getTaskList()
this.selectedYear = e;
this.getTaskList();
}
cancel(item) {
@ -60,60 +77,59 @@ export class StationTaskExecutionComponent implements OnInit {
nzOkText: '确定',
nzOkType: 'default',
nzOnOk: () => {
item.isLoading = true
this.http.post(`/api/PlanTasks/Approval/${item.id}`, null, {
params: {
approvalStatus: '驳回'
}
}).subscribe({
next: (data) => {
this.getTaskList()
this.message.create('success', '已驳回');
},
error: (err) => {
this.message.create('warning', '驳回失败');
}
})
item.isLoading = true;
this.http
.post(`/api/PlanTasks/Approval/${item.id}`, null, {
params: {
approvalStatus: '驳回',
},
})
.subscribe({
next: (data) => {
this.getTaskList();
this.message.create('success', '已驳回');
},
error: (err) => {
this.message.create('warning', '驳回失败');
},
});
},
nzCancelText: '取消'
nzCancelText: '取消',
});
}
delete(item) {
console.log(item)
console.log(item);
this.modal.confirm({
nzTitle: `确定要删除该任务吗?`,
nzOkText: '确定',
nzOkType: 'primary',
nzOnOk: () => {
this.http.delete(`/api/PlanTasks/${item.id}`).subscribe(data => {
this.http.delete(`/api/PlanTasks/${item.id}`).subscribe((data) => {
for (let index = 0; index < this.taskLIst.length; index++) {
const element = this.taskLIst[index];
if (element.id == item.id) {
this.taskLIst.splice(index, 1)
index--
this.taskLIst.splice(index, 1);
index--;
}
}
this.message.create('success', '删除成功!');
})
});
},
nzCancelText: '取消',
nzOnCancel: () => {
}
nzOnCancel: () => {},
});
}
isloading = false
totalCount
PageNumber = 1
PageSize = 10
taskLIst = []
isloading = false;
totalCount;
PageNumber = 1;
PageSize = 10;
taskLIst = [];
getTaskList() {
this.isloading = true
let selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01'
this.isloading = true;
let selectedTime =
this.selectedYear + '-' + this.selectedMonth + '-' + '01';
let params = {
Month: selectedTime,
// OrganizationId: this.OrganizationId,
@ -124,92 +140,97 @@ export class StationTaskExecutionComponent implements OnInit {
AssistantOrganizationId: this.isSupervisor ? null : this.OrganizationId,
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.taskLIst = [...data.items]
})
PageSize: this.PageSize,
};
this.http
.get('/api/PlanTasks', {
params: params,
})
.subscribe((data: any) => {
this.isloading = false;
console.log('任务申请列表', data);
this.totalCount = data.totalCount;
this.taskLIst = [...data.items];
});
}
pageChange($event) {
this.PageNumber = $event
this.getTaskList()
this.PageNumber = $event;
this.getTaskList();
}
search() {
this.PageNumber = 1
this.getTaskList()
this.PageNumber = 1;
this.getTaskList();
}
reset() {
this.PageNumber = 1
this.PageNumber = 1;
this.searchForm = {
taskname: '',
unitname: '',
unitlevel: '',
or: ''
}
this.getTaskList()
or: '',
};
this.getTaskList();
}
expandKeys
defaultOrId: string
expandKeys;
defaultOrId: string;
//获取所有组织机构
organizationList: any
organizationListAll: any
nodes: any = []
organizationList: any;
organizationListAll: any;
nodes: any = [];
async getAllOrganization() {
let params = {
ContainsChildren: "true",
ContainsChildren: 'true',
PageNumber: 1,
PageSize: 9999
}
PageSize: 9999,
};
var p = new Promise<void>((resolve, reject) => {
this.http.get('/api/Organizations', {
params: params
}).subscribe((data: any) => {
data.items.forEach(element => {
element.key = element.id
element.title = element.name
element.disableCheckbox = true
element.selectable = false
});
this.organizationListAll = JSON.parse(JSON.stringify(data.items))
this.organizationList = JSON.parse(JSON.stringify(data.items)).filter(item => {
return item.level != 'squadron'
this.http
.get('/api/Organizations', {
params: params,
})
resolve(data)
})
})
return p
.subscribe((data: any) => {
data.items.forEach((element) => {
element.key = element.id;
element.title = element.name;
element.disableCheckbox = true;
element.selectable = false;
});
this.organizationListAll = JSON.parse(JSON.stringify(data.items));
this.organizationList = JSON.parse(JSON.stringify(data.items)).filter(
(item) => {
return item.level != 'squadron';
}
);
resolve(data);
});
});
return p;
}
//获得所有检查员
supervisorList = []
mainsupervisorList = []
assitantsupervisorList = []
supervisorList = [];
mainsupervisorList = [];
assitantsupervisorList = [];
async getSupervisor() {
var p = new Promise<void>((resolve, reject) => {
this.http.get('/api/Users/Inspectors').subscribe((data: any) => {
console.log('检查员列表', data)
data.forEach(element => {
element.key = element.id
element.title = element.name
element.parentId = element.organizationId
console.log('检查员列表', data);
data.forEach((element) => {
element.key = element.id;
element.title = element.name;
element.parentId = element.organizationId;
});
this.supervisorList = data
resolve(data)
})
})
return p
this.supervisorList = data;
resolve(data);
});
});
return p;
}
//获得除了检查员的其他用户
users
users;
async getUsers() {
var p = new Promise<void>((resolve, reject) => {
let params = {
@ -217,69 +238,75 @@ export class StationTaskExecutionComponent implements OnInit {
OrganizationLevel: 'squadron',
ContainsChildren: true,
PageNumber: 1,
PageSize: 9999
}
this.http.get('/api/Users', {
params: params
}).subscribe((data: any) => {
console.log('用户列表', data.items)
data.items.forEach(element => {
element.key = element.id
element.title = element.name
element.parentId = element.organizationId
PageSize: 9999,
};
this.http
.get('/api/Users', {
params: params,
})
.subscribe((data: any) => {
console.log('用户列表', data.items);
data.items.forEach((element) => {
element.key = element.id;
element.title = element.name;
element.parentId = element.organizationId;
});
this.users = data.items;
resolve(data);
});
this.users = data.items
resolve(data)
})
})
return p
});
return p;
}
userId
userId;
time1
time2
time1;
time2;
ngOnInit(): void {
this.userId = JSON.parse(sessionStorage.getItem('userData')).id
this.OrganizationId = JSON.parse(sessionStorage.getItem('userData')).organizationId
this.userId = JSON.parse(sessionStorage.getItem('userData')).id
let roles = JSON.parse(sessionStorage.getItem('userData')).roles
let isSupervisor = roles.find(item => {
return item.name.indexOf('检查') != -1
})
isSupervisor ? this.isSupervisor = true : this.isSupervisor = false
this.selectedMonth = new Date().getMonth() + 1
this.getTaskList()
Promise.all([this.getAllOrganization(), this.getSupervisor(), this.getUsers()])
.then((results) => {
if (this.isSupervisor) {
let arr = [...this.users, ...this.organizationListAll]
this.nodes = this.toTree.toTree(JSON.parse(JSON.stringify(arr)))
} else {
let arr = [...this.supervisorList, ...this.organizationList]
this.nodes = this.toTree.toTree(JSON.parse(JSON.stringify(arr)))
}
});
this.userId = JSON.parse(sessionStorage.getItem('userData')).id;
this.OrganizationId = JSON.parse(
sessionStorage.getItem('userData')
).organizationId;
this.userId = JSON.parse(sessionStorage.getItem('userData')).id;
let roles = JSON.parse(sessionStorage.getItem('userData')).roles;
let isSupervisor = roles.find((item) => {
return item.name.indexOf('检查') != -1;
});
isSupervisor ? (this.isSupervisor = true) : (this.isSupervisor = false);
this.selectedMonth = new Date().getMonth() + 1;
this.getTaskList();
Promise.all([
this.getAllOrganization(),
this.getSupervisor(),
this.getUsers(),
]).then((results) => {
if (this.isSupervisor) {
let arr = [...this.users, ...this.organizationListAll];
this.nodes = this.toTree.toTree(JSON.parse(JSON.stringify(arr)));
} else {
let arr = [...this.supervisorList, ...this.organizationList];
this.nodes = this.toTree.toTree(JSON.parse(JSON.stringify(arr)));
}
});
setTimeout(() => {
this.rollStart()
this.rollStart();
}, 0);
let t1 = new Date().getTime();
let t1 = new Date().getTime()
let date = '2022-9-10'
let t2 = Date.parse(date)
let date = '2022-9-10';
let t2 = Date.parse(date);
// this.methodService.countdown(t1, t2, (res) => {
// // console.log(666, res)
// this.time1 = res.day + '天' + res.hour + '小时'
// })
}
timer
timer;
rollStart() {
var ROLL_SPEED = 100
var ROLL_SPEED = 100;
var noticeList1 = document.getElementById('notice-list');
var noticeList2 = document.getElementById('notice-list-2');
var listWrapper = document.getElementById('list-wrapper');
@ -287,18 +314,20 @@ export class StationTaskExecutionComponent implements OnInit {
this.timer = setInterval(rollStart, ROLL_SPEED);
function rollStart() {
if (Math.abs(_subStr(listWrapper.style.top)) >= noticeList1.clientHeight) {
listWrapper.style.top = '0px'
if (
Math.abs(_subStr(listWrapper.style.top)) >= noticeList1.clientHeight
) {
listWrapper.style.top = '0px';
} else {
var top = listWrapper.style.top
listWrapper.style.top = _subStr(top) - 1 + 'px'
var top = listWrapper.style.top;
listWrapper.style.top = _subStr(top) - 1 + 'px';
}
}
// 截取px前数值
function _subStr(str) {
var index = str.indexOf('px');
if (index > -1) {
return parseFloat(str.substr(0, index + 1))
return parseFloat(str.substr(0, index + 1));
}
}
}
@ -307,28 +336,32 @@ export class StationTaskExecutionComponent implements OnInit {
window.clearInterval(this.timer);
}
mouseleave() {
this.rollStart()
this.rollStart();
}
ngOnDestroy(): void {
console.log('退出了')
this.mouseEnter()
this.methodService.cleartimer()
}
apply() {
console.log('退出了');
this.mouseEnter();
this.methodService.cleartimer();
}
apply() {}
look(item) {
console.log(item)
console.log(item);
if (item.approvalStatus == '待检查') {
this.message.create('warning', '该单位未检查');
return
return;
}
this.router.navigate(['/task/taskexecution/taskdetails'], { queryParams: { id: item.id, company: item.company.companyName, organization: item.organization.name, legalPersonName: item.company.legalPersonName ? item.company.legalPersonName : '' } })
this.router.navigate(['/task/taskexecution/taskdetails'], {
queryParams: {
id: item.id,
company: item.company.companyName,
organization: item.organization.name,
legalPersonName: item.company.legalPersonName
? item.company.legalPersonName
: '',
},
});
}
complete(item) {
@ -346,39 +379,41 @@ export class StationTaskExecutionComponent implements OnInit {
await new Promise((resolve, reject) => {
let body = {
inspectionResult: instance.validateForm.value.result,
resultAttachment: instance.fileList
}
resultAttachment: instance.fileList,
};
this.http.patch(`/api/PlanTasks/${item.id}`, body).subscribe({
next: (data) => {
this.message.create('success', '已完成');
this.getTaskList()
resolve(data)
this.getTaskList();
resolve(data);
},
error: (err) => {
this.message.create('warning', '完成失败');
reject(err)
}
})
})
reject(err);
},
});
});
} else {
this.message.create('warning', '请选择结果!');
return false
return false;
}
}
},
});
const instance = modal.getContentComponent();
modal.afterOpen.subscribe(() => console.log('[afterOpen] emitted!'));
modal.afterClose.subscribe(result => console.log('[afterClose] The result is:', result));
modal.afterClose.subscribe((result) =>
console.log('[afterClose] The result is:', result)
);
}
ischat = false
taskId
ischat = false;
taskId;
openchat(item) {
console.log(item)
this.taskId = item.id
this.ischat = true
console.log(item);
this.taskId = item.id;
this.ischat = true;
}
closechat() {
this.ischat = false
this.ischat = false;
}
}

2
src/app/home/task/station-weekly-plan/station-weekly-plan.component.html

@ -27,6 +27,8 @@
<nz-option [nzValue]="2023" nzLabel="2023年"></nz-option>
<nz-option [nzValue]="2024" nzLabel="2024年"></nz-option>
<nz-option [nzValue]="2025" nzLabel="2025年"></nz-option>
<nz-option [nzValue]="2026" nzLabel="2026年"></nz-option>
<nz-option [nzValue]="2027" nzLabel="2027年"></nz-option>
</nz-select>
<div *ngFor="let item of months" class="monthbtn" (click)="selectMonth(item)"
[ngClass]="{'selectedMonth': item.id == selectedMonth}">

1041
src/app/home/task/station-weekly-plan/station-weekly-plan.component.ts

File diff suppressed because it is too large Load Diff

12
src/app/home/task/zhi-audit/zhi-audit.component.html

@ -1,11 +1,13 @@
<!-- <p>任务审批</p> -->
<div class="box">
<div class="timebox">
<nz-select ngModel="2024">
<nz-option nzValue="2022" nzLabel="2022年"></nz-option>
<nz-option nzValue="2023" nzLabel="2023年"></nz-option>
<nz-option nzValue="2024" nzLabel="2024年"></nz-option>
<nz-option nzValue="2025" nzLabel="2025年"></nz-option>
<nz-select [(ngModel)]="selectedYear">
<nz-option [nzValue]="2022" nzLabel="2022年"></nz-option>
<nz-option [nzValue]="2023" nzLabel="2023年"></nz-option>
<nz-option [nzValue]="2024" nzLabel="2024年"></nz-option>
<nz-option [nzValue]="2025" nzLabel="2025年"></nz-option>
<nz-option [nzValue]="2026" nzLabel="2026年"></nz-option>
<nz-option [nzValue]="2027" nzLabel="2027年"></nz-option>
</nz-select>
<div *ngFor="let item of months" class="monthbtn" (click)="selectMonth(item)"
[ngClass]="{'selectedMonth': item.name == selectedMonth}">

125
src/app/home/task/zhi-audit/zhi-audit.component.ts

@ -7,13 +7,18 @@ import { LookTaskComponent } from './look-task/look-task.component';
@Component({
selector: 'app-zhi-audit',
templateUrl: './zhi-audit.component.html',
styleUrls: ['./zhi-audit.component.scss']
styleUrls: ['./zhi-audit.component.scss'],
})
export class ZhiAuditComponent implements OnInit {
validateForm!: FormGroup;
constructor(private fb: FormBuilder, private http: HttpClient, private toTree: TreeService, private modal: NzModalService, private viewContainerRef: ViewContainerRef) { }
selectedYear = new Date().getFullYear();
constructor(
private fb: FormBuilder,
private http: HttpClient,
private toTree: TreeService,
private modal: NzModalService,
private viewContainerRef: ViewContainerRef
) {}
months = [
{ name: '1月', isable: true },
@ -27,41 +32,46 @@ export class ZhiAuditComponent implements OnInit {
{ name: '9月', isable: true },
{ name: '10月', isable: true },
{ name: '11月', isable: true },
{ name: '12月', isable: true }
]
selectedMonth
{ name: '12月', isable: true },
];
selectedMonth;
selectMonth(item) {
this.selectedMonth = item.name
this.selectedMonth = item.name;
}
// 双随机
doubleRandom = {
isExpand: true,//卡片展开
isPopover: false,//选择单位气泡卡片
search1: '',//选择单位气泡卡片---单位选择列表
isExpand: true, //卡片展开
isPopover: false, //选择单位气泡卡片
search1: '', //选择单位气泡卡片---单位选择列表
search1Value: [],
search2: '',//选择单位气泡卡片---组织选择列表
search2: '', //选择单位气泡卡片---组织选择列表
search2Value: [],
selectedMenu: 1,//选择单位气泡卡片
data: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],//表格数据
nodes: []
}
selectedMenu: 1, //选择单位气泡卡片
data: [
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
], //表格数据
nodes: [],
};
// 熟悉演练
rehearsal = {
isExpand: false,//卡片展开
isPopover: false,//选择单位气泡卡片
search1: '',//选择单位气泡卡片---单位选择列表
isExpand: false, //卡片展开
isPopover: false, //选择单位气泡卡片
search1: '', //选择单位气泡卡片---单位选择列表
search1Value: [],
search2: '',//选择单位气泡卡片---组织选择列表
search2: '', //选择单位气泡卡片---组织选择列表
search2Value: [],
selectedMenu: 1,//选择单位气泡卡片
data: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],//表格数据
nodes: []
}
selectedMenu: 1, //选择单位气泡卡片
data: [
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
], //表格数据
nodes: [],
};
isPopover(data) {
data.isPopover = !data.isPopover
data.isPopover = !data.isPopover;
}
//搜索框提交
submitForm(value): void {
@ -69,55 +79,57 @@ export class ZhiAuditComponent implements OnInit {
}
// 弹出 tab
popoverMenuSelect(data, type) {
data.selectedMenu = type
data.selectedMenu = type;
}
expand(data) {
data.isExpand = !data.isExpand
data.isExpand = !data.isExpand;
}
ngOnInit(): void {
this.getAllOrganization()
this.getAllOrganization();
}
nzExpandAll = false;
totalCount: string
totalCount: string;
allOrList: any
nodes
allOrList: any;
nodes;
getAllOrganization() {
let params = {
ContainsChildren: "true",
ContainsChildren: 'true',
PageNumber: 1,
PageSize: 9999
}
this.http.get('/api/Organizations', {
params: params
}).subscribe((data: any) => {
this.totalCount = data.totalCount
data.items.forEach(element => {
element.key = element.id
element.title = element.name
element.selectable = false
});
this.allOrList = data.items
this.nodes = [...this.toTree.toTree(data.items)]
PageSize: 9999,
};
this.http
.get('/api/Organizations', {
params: params,
})
.subscribe((data: any) => {
this.totalCount = data.totalCount;
data.items.forEach((element) => {
element.key = element.id;
element.title = element.name;
element.selectable = false;
});
this.allOrList = data.items;
this.nodes = [...this.toTree.toTree(data.items)];
this.doubleRandom.nodes = JSON.parse(JSON.stringify(this.nodes))
this.rehearsal.nodes = JSON.parse(JSON.stringify(this.nodes))
})
this.doubleRandom.nodes = JSON.parse(JSON.stringify(this.nodes));
this.rehearsal.nodes = JSON.parse(JSON.stringify(this.nodes));
});
}
orcheckbox(data, $event, node) {
if ($event) {
data.search2Value.push(node.origin.name)
data.search2Value.push(node.origin.name);
} else {
for (let index = 0; index < data.search2Value.length; index++) {
const element = data.search2Value[index];
if (element == node.origin.name) {
data.search2Value.splice(index, 1)
data.search2Value.splice(index, 1);
}
}
}
console.log(data.search2Value)
console.log(data.search2Value);
}
lookTask() {
@ -126,13 +138,14 @@ export class ZhiAuditComponent implements OnInit {
nzContent: LookTaskComponent,
nzViewContainerRef: this.viewContainerRef,
nzFooter: null,
nzWidth:800,
nzOnOk: () => new Promise(resolve => setTimeout(resolve, 1000))
nzWidth: 800,
nzOnOk: () => new Promise((resolve) => setTimeout(resolve, 1000)),
});
const instance = modal.getContentComponent();
modal.afterOpen.subscribe(() => console.log('[afterOpen] emitted!'));
// Return a result when closed
modal.afterClose.subscribe(result => console.log('[afterClose] The result is:', result));
modal.afterClose.subscribe((result) =>
console.log('[afterClose] The result is:', result)
);
}
}

2
src/app/home/task/zhi-indicators/zhi-indicators.component.html

@ -6,6 +6,8 @@
<nz-option [nzValue]="2023" nzLabel="2023年"></nz-option>
<nz-option [nzValue]="2024" nzLabel="2024年"></nz-option>
<nz-option [nzValue]="2025" nzLabel="2025年"></nz-option>
<nz-option [nzValue]="2026" nzLabel="2026年"></nz-option>
<nz-option [nzValue]="2027" nzLabel="2027年"></nz-option>
</nz-select>
<div *ngFor="let item of months" class="monthbtn" (click)="selectMonth(item)"
[ngClass]="{'selectedMonth': item.id == selectedMonth}">

2
src/app/home/task/zhi-indicators/zhi-indicators.component.ts

@ -52,7 +52,7 @@ export class ZhiIndicatorsComponent implements OnInit {
{ id: 12, name: '12月', isable: true },
];
selectedMonth;
selectedYear = 2024;
selectedYear = new Date().getFullYear();
selectedTime;
selectMonth(item) {
console.log('选择月份');

Loading…
Cancel
Save