Compare commits

..

8 Commits

  1. 2
      package.json
  2. 4
      proxy.config.json
  3. 6
      src/app/home/home.module.ts
  4. 4
      src/app/home/nav/nav.component.html
  5. 2
      src/app/home/nav/nav.component.scss
  6. 8
      src/app/home/statistic-analysis/home/home.component.ts
  7. 7
      src/app/home/statistic-analysis/home/unit-list/unit-list.component.ts
  8. 31
      src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.html
  9. 868
      src/app/home/task/da-monthly-task-overview/da-monthly-task-overview.component.ts
  10. 54
      src/app/home/task/da-monthly-task-overview/look-shuangsj/look-shuangsj.component.html
  11. 0
      src/app/home/task/da-monthly-task-overview/look-shuangsj/look-shuangsj.component.scss
  12. 25
      src/app/home/task/da-monthly-task-overview/look-shuangsj/look-shuangsj.component.spec.ts
  13. 35
      src/app/home/task/da-monthly-task-overview/look-shuangsj/look-shuangsj.component.ts
  14. 2
      src/app/home/task/da-oneself-plan/da-oneself-plan.component.ts
  15. 5
      src/app/home/task/da-subordinate-audit/da-subordinate-audit.component.html
  16. 276
      src/app/home/task/da-subordinate-audit/da-subordinate-audit.component.ts
  17. 5
      src/app/home/task/station-task-apply/station-task-apply.component.html
  18. 460
      src/app/home/task/station-task-apply/station-task-apply.component.ts
  19. 5
      src/app/home/task/station-task-execution/station-task-execution.component.html
  20. 409
      src/app/home/task/station-task-execution/station-task-execution.component.ts
  21. 2
      src/app/home/task/station-task-execution/task-details/task-details.component.html
  22. 5
      src/app/home/task/station-weekly-plan/station-weekly-plan.component.html
  23. 1041
      src/app/home/task/station-weekly-plan/station-weekly-plan.component.ts
  24. 11
      src/app/home/task/zhi-audit/zhi-audit.component.html
  25. 125
      src/app/home/task/zhi-audit/zhi-audit.component.ts
  26. 989
      src/app/home/task/zhi-indicators/dist/zhi-indicators.component.js
  27. 5
      src/app/home/task/zhi-indicators/zhi-indicators.component.html
  28. 2
      src/app/home/task/zhi-indicators/zhi-indicators.component.ts
  29. 8
      src/app/pages/login/login.component.html
  30. 9
      src/index.html
  31. 2
      src/theme.less

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 ",
"start": "ng serve --proxy-config proxy.config.json --open --port 8888",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"

4
proxy.config.json

@ -1,13 +1,13 @@
{
"/api": {
"target": "https://121.36.37.70:8204/",
"target": "https://fx.anxincloud.cn/",
"测试": "https://121.36.37.70:8204/",
"生产": "https://fx.anxincloud.cn/",
"secure": false,
"changeOrigin": true
},
"/hubs": {
"target": "https://121.36.37.70:8204/",
"target": "https://fx.anxincloud.cn/",
"secure": false,
"ws": true,
"logLevel": "debug"

6
src/app/home/home.module.ts

@ -81,7 +81,8 @@ import { TaskListComponent } from './statistic-analysis/home/task-list/task-list
import { FormComponent } from './statistic-analysis/form/form.component';
import { ExamineComponent } from './statistic-analysis/form/examine/examine.component';
import { ReviewComponent } from './statistic-analysis/form/review/review.component';
import { UnitListComponent } from './statistic-analysis/home/unit-list/unit-list.component';
import { UnitListComponent } from './statistic-analysis/home/unit-list/unit-list.component';
import { LookShuangsjComponent } from './task/da-monthly-task-overview/look-shuangsj/look-shuangsj.component';
@NgModule({
declarations: [
NavComponent,
@ -132,7 +133,8 @@ import { UnitListComponent } from './statistic-analysis/home/unit-list/unit-list
FormComponent,
ExamineComponent,
ReviewComponent,
UnitListComponent
UnitListComponent,
LookShuangsjComponent
],
imports: [
CommonModule,

4
src/app/home/nav/nav.component.html

@ -1,8 +1,8 @@
<nz-layout [ngClass]="{'bigfontpattern': isZhidui}">
<nz-header>
<div class="logobox">
<!-- <img src="../../../assets/images/logo/logo.png" alt=""> -->
<span>非煤矿山灾害智能感知和预警系统</span>
<img src="../../../assets/images/logo/logo.png" alt="">
<span>防消一体化综合治理平台</span>
</div>
<ul>
<li [routerLink]="['/basicInfo']" routerLinkActive="router-link-active">

2
src/app/home/nav/nav.component.scss

@ -14,7 +14,7 @@ nz-header {
padding: 0;
.logobox {
width: 300px;
width: 250px;
img {
margin-right: 8px;

8
src/app/home/statistic-analysis/home/home.component.ts

@ -731,8 +731,7 @@ export class HomeComponent implements OnInit {
}
echartsSetData_taskStatByOrg() {
console.log()
console.log();
this.completionOfTaskPie.clear();
this.completionOfTaskBar.clear();
@ -746,8 +745,7 @@ export class HomeComponent implements OnInit {
this.completionOfTaskPie &&
this.completionOfTaskPie.setOption(this.completionOfTaskPieOption);
console.log(666,this.statisticalData_taskStatByOrg)
console.log(666, this.statisticalData_taskStatByOrg);
let taskBar = task['组织机构数据'];
let taskBarx = [];
let taskBary1 = [];
@ -890,6 +888,7 @@ export class HomeComponent implements OnInit {
clickCard(item) {
console.log(item);
// return
if (item.name.indexOf('单位') !== -1) {
this.modal.create({
nzTitle: item.name + '列表',
@ -899,7 +898,6 @@ export class HomeComponent implements OnInit {
nzFooter: null,
nzComponentParams: {
name: item.name,
data: item.data,
},
});
} else {

7
src/app/home/statistic-analysis/home/unit-list/unit-list.component.ts

@ -9,14 +9,11 @@ import { NzMessageService } from 'ng-zorro-antd/message';
})
export class UnitListComponent implements OnInit {
@Input() name?: any;
@Input() data?: any;
constructor(private http: HttpClient, private message: NzMessageService) {}
ngOnInit(): void {
if (this.data.length !== 0) {
this.getUnitList();
}
this.getUnitList();
}
listOfData: any = [];
@ -28,9 +25,9 @@ export class UnitListComponent implements OnInit {
getUnitList() {
this.isloading = true;
let params = {
CompanyIds: this.data,
PageNumber: this.PageNumber,
PageSize: this.PageSize,
CheckType: this.name === '不合格单位数量' ? '不合格单位' : '隐患单位',
};
this.http
.get('/api/Companies', {

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

@ -2,9 +2,12 @@
<div class="box">
<div class="timebox">
<nz-select [(ngModel)]="selectedYear" (ngModelChange)="selectYear($event)">
<nz-option [nzValue]="2021" nzLabel="2021年"></nz-option>
<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.id == selectedMonth}">
@ -161,6 +164,10 @@
</ng-template>
</ng-template>
</div>
<!-- <span (click)="xxx(i)">xxx</span> -->
<nz-date-picker nzShowTime nzFormat="yyyy-MM-dd HH:mm:ss" [(ngModel)]="i.planTime"
nzPlaceHolder="请选择检查日期" nzBorderless (ngModelChange)="checkTime($event,i,item)">
</nz-date-picker>
</div>
</div>
</div>
@ -450,6 +457,28 @@
检查结果
</span>
</div>
<div class="flexcol" style="flex: 2;">
<span class="ellipsi">
<nz-date-picker nzShowTime nzFormat="yyyy-MM-dd HH:mm:ss"
[(ngModel)]="i.planTime" nzPlaceHolder="请选择检查日期" nzBorderless
(ngModelChange)="checkTime($event,i,element)">
</nz-date-picker>
</span>
<span>
检查时间
</span>
</div>
<div class="flexcol" style="flex: 1;">
<span class="ellipsi">
<span style="cursor: pointer;margin-right: 5px;" (click)="look(i)">查看</span>
<span style="cursor: pointer;color: rgb(255, 64, 77);" (click)="deleteTask(item,i)">删除</span>
</span>
<span>
操作
</span>
</div>
</div>
</div>

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

File diff suppressed because it is too large Load Diff

54
src/app/home/task/da-monthly-task-overview/look-shuangsj/look-shuangsj.component.html

@ -0,0 +1,54 @@
<div>
<div class="rowItem">
<span>单位名称:</span><span>{{data.company?.companyName}}</span>
</div>
<div class="rowItem">
<span>单位管理人:</span><span>{{data.company?.directorName}}</span>
</div>
<div class="rowItem">
<span>联系方式:</span><span>{{data.company?.directorPhone}}</span>
</div>
<div class="rowItem">
<span>单位地址:</span><span>{{data.company?.address}}</span>
</div>
<div class="rowItem">
<span>建筑结构:</span><span>{{data.company?.datas?.basicInfo.structure}}</span>
</div>
<div class="rowItem">
<span>建筑高度:</span><span>{{data.company?.datas?.basicInfo.height}}</span>
</div>
<div class="rowItem">
<span>建筑层数:</span><span>{{data.company?.datas?.basicInfo.layer}}</span>
</div>
<div class="rowItem">
<span>控制室位置:</span><span>{{data.company?.datas?.facilities.controlPosition}}</span>
</div>
<div class="rowItem">
<span>安全重点部位:</span><span>{{data.company?.useNature}}</span>
</div>
<div class="rowItem">
<span>单位性质:</span><span>{{data.company?.datas?.basicInfo.nature}}</span>
</div>
<div class="rowItem">
<span>消防设施及器材:</span><span>{{data.company?.datas?.facilities.fireFightingFacilities.title}}</span>
</div>
<div class="rowItem">
<span>单位主要消防设施:</span><span>{{data.company?.zhuyaosheshi?.title}}</span>
</div>
<div class="rowItem">
<span>位置:</span><span>{{data.position.name}}</span>
</div>
<div class="rowItem">
<span>姓名:</span><span>{{data.name}}</span>
</div>
<div class="rowItem">
<span>职务:</span><span>{{data.post}}</span>
</div>
<div class="rowItem">
<span>备注:</span><span>{{data.remarks}}</span>
</div>
<div class="rowItem">
<span>图片列表:</span>
<img *ngFor="let item of data.imgShow2" [src]="item" alt="" (click)="viewImg(item)" width="100" height="100">
</div>
</div>

0
src/app/home/task/da-monthly-task-overview/look-shuangsj/look-shuangsj.component.scss

25
src/app/home/task/da-monthly-task-overview/look-shuangsj/look-shuangsj.component.spec.ts

@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { LookShuangsjComponent } from './look-shuangsj.component';
describe('LookShuangsjComponent', () => {
let component: LookShuangsjComponent;
let fixture: ComponentFixture<LookShuangsjComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ LookShuangsjComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(LookShuangsjComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

35
src/app/home/task/da-monthly-task-overview/look-shuangsj/look-shuangsj.component.ts

@ -0,0 +1,35 @@
import { Component, Input, OnInit } from '@angular/core';
import Viewer from 'viewerjs';
@Component({
selector: 'app-look-shuangsj',
templateUrl: './look-shuangsj.component.html',
styleUrls: ['./look-shuangsj.component.scss'],
})
export class LookShuangsjComponent implements OnInit {
@Input() data?: any;
constructor() {}
ngOnInit(): void {
console.log(this.data);
}
//查看图片
viewImg(url) {
let dom = document.getElementById(`viewerjs`);
let pObjs = dom.childNodes;
let node = document.createElement('img');
node.style.display = 'none';
node.src = url;
node.id = 'img';
dom.appendChild(node);
setTimeout(() => {
let viewer = new Viewer(document.getElementById(`viewerjs`), {
hidden: () => {
dom.removeChild(pObjs[0]);
viewer.destroy();
},
});
node.click();
}, 0);
}
}

2
src/app/home/task/da-oneself-plan/da-oneself-plan.component.ts

@ -23,7 +23,7 @@ export class DaOneselfPlanComponent implements OnInit {
this.getTuesdayThursdayNum()
}
selectedMonth
selectedYear = 2023
selectedYear = 2024
selectedTime
selectMonth(item) {
this.selectedMonth = item.id

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

@ -2,9 +2,12 @@
<div class="box">
<div class="timebox">
<nz-select [(ngModel)]="selectedYear" (ngModelChange)="selectYear($event)">
<nz-option [nzValue]="2021" nzLabel="2021年"></nz-option>
<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.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 = 2023
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: '取消',
});
}
}

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

@ -23,9 +23,12 @@
</div>
<div class="timebox">
<nz-select [(ngModel)]="selectedYear" (ngModelChange)="selectYear($event)">
<nz-option [nzValue]="2021" nzLabel="2021年"></nz-option>
<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.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 = 2023
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 {
,
,
,
}
,
}

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

@ -23,9 +23,12 @@
</div>
<div class="timebox">
<nz-select [(ngModel)]="selectedYear" (ngModelChange)="selectYear($event)">
<nz-option [nzValue]="2021" nzLabel="2021年"></nz-option>
<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.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 = 2023
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-task-execution/task-details/task-details.component.html

@ -1,6 +1,6 @@
<div class="bigbox">
<div class="btnbox">
<button class="goback" nz-button nzType="primary" (click)="goback()">返回</button>
<!-- <button class="goback" nz-button nzType="primary" (click)="goback()">返回</button> -->
<button nz-button nzType="primary" (click)="print()" *ngIf="tabnum == 0" [nzLoading]="isprintLoading">打印表格</button>
<button nz-button nzType="primary" (click)="download(1)" *ngIf="tabnum == 1">下载演练卡</button>
<button nz-button nzType="primary" (click)="download(2)" *ngIf="tabnum == 2">下载数字化预案</button>

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

@ -23,9 +23,12 @@
</div>
<div class="timebox">
<nz-select [(ngModel)]="selectedYear" (ngModelChange)="selectYear($event)">
<nz-option [nzValue]="2021" nzLabel="2021年"></nz-option>
<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.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

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

@ -1,10 +1,13 @@
<!-- <p>任务审批</p> -->
<div class="box">
<div class="timebox">
<nz-select ngModel="2022">
<nz-option nzValue="2021" nzLabel="2021年"></nz-option>
<nz-option nzValue="2022" nzLabel="2022年"></nz-option>
<nz-option nzValue="2023" nzLabel="2023年"></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)
);
}
}

989
src/app/home/task/zhi-indicators/dist/zhi-indicators.component.js vendored

@ -0,0 +1,989 @@
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
var __spreadArrays = (this && this.__spreadArrays) || function () {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
};
exports.__esModule = true;
exports.ZhiIndicatorsComponent = void 0;
var core_1 = require("@angular/core");
var rxjs_1 = require("rxjs");
var operators_1 = require("rxjs/operators"); // 引入debounceTime、Subject
var edit_or_component_1 = require("./edit-or/edit-or.component");
var allot_person_component_1 = require("../da-subordinate-audit/allot-person/allot-person.component");
var ZhiIndicatorsComponent = /** @class */ (function () {
function ZhiIndicatorsComponent(ngZone, fb, http, toTree, message, modal, viewContainerRef) {
this.ngZone = ngZone;
this.fb = fb;
this.http = http;
this.toTree = toTree;
this.message = message;
this.modal = modal;
this.viewContainerRef = viewContainerRef;
this.valueChange = new rxjs_1.Subject();
this.targetCount = new rxjs_1.Subject();
this.months = [
{ id: 1, name: '1月', isable: true },
{ id: 2, name: '2月', isable: true },
{ id: 3, name: '3月', isable: true },
{ id: 4, name: '4月', isable: true },
{ id: 5, name: '5月', isable: true },
{ id: 6, name: '6月', isable: true },
{ id: 7, name: '7月', isable: true },
{ id: 8, name: '8月', isable: true },
{ id: 9, name: '9月', isable: true },
{ id: 10, name: '10月', isable: true },
{ id: 11, name: '11月', isable: true },
{ id: 12, name: '12月', isable: true },
];
this.selectedYear = 2024;
//投诉举报
this.complaint = {
name: '投诉举报',
allocated: 0,
isExpand: true,
isPopover: false,
isLoading: false,
search1: '',
search1Value: [],
search2: '',
search2Value: [],
searchAll: [],
selectedMenu: 1,
data: [],
nodes: [],
nodes2: [],
isnodes: true,
unitList: []
};
//行政许可
this.permission = {
name: '行政许可',
allocated: 0,
isExpand: true,
isPopover: false,
isLoading: false,
search1: '',
search1Value: [],
search2: '',
search2Value: [],
searchAll: [],
selectedMenu: 1,
data: [],
nodes: [],
nodes2: [],
isnodes: true,
unitList: []
};
// 双随机
this.doubleRandom = {
name: '双随机',
allocated: 0,
allPlanTasks: 0,
isExpand: true,
isPopover: false,
isLoading: false,
search1: '',
search1Value: [],
search2: '',
search2Value: [],
searchAll: [],
selectedMenu: 1,
data: [],
nodes: [],
nodes2: [],
isnodes: true,
unitList: []
};
// 熟悉演练
this.rehearsal = {
name: '熟悉演练',
allocated: 0,
allPlanTasks: 0,
isExpand: true,
isPopover: false,
isLoading: false,
search1: '',
search1Value: [],
search2: '',
search2Value: [],
searchAll: [],
selectedMenu: 1,
data: [],
nodes: [],
nodes2: [],
isnodes: true,
unitList: []
};
this.unitList = [];
this.PageNumber = 1;
this.moreDataLoading = false;
this.iszhanxun = false;
}
ZhiIndicatorsComponent.prototype.saveItem = function () { };
ZhiIndicatorsComponent.prototype.selectMonth = function (item) {
console.log('选择月份');
this.selectedMonth = item.id;
this.initializeData();
this.getTaskList('投诉举报');
this.getTaskList('行政许可');
this.getTaskTarget('双随机');
this.getTaskTarget('熟悉演练');
};
ZhiIndicatorsComponent.prototype.selectYear = function (e) {
console.log('选择年份');
this.selectedYear = e;
this.initializeData();
this.getTaskList('投诉举报');
this.getTaskList('行政许可');
this.getTaskTarget('双随机');
this.getTaskTarget('熟悉演练');
};
ZhiIndicatorsComponent.prototype.initializeData = function () {
this.complaint.isExpand = true;
this.complaint.isPopover = false;
this.complaint.isLoading = false;
this.complaint.search1 = '';
this.complaint.search1Value = [];
this.complaint.search2 = '';
this.complaint.search2Value = [];
this.complaint.selectedMenu = 1;
this.complaint.data = [];
this.permission.isExpand = true;
this.permission.isPopover = false;
this.permission.isLoading = false;
this.permission.search1 = '';
this.permission.search1Value = [];
this.permission.search2 = '';
this.permission.search2Value = [];
this.permission.selectedMenu = 1;
this.permission.data = [];
this.doubleRandom.isExpand = true;
this.doubleRandom.isPopover = false;
this.doubleRandom.isLoading = false;
this.doubleRandom.search1 = '';
this.doubleRandom.search1Value = [];
this.doubleRandom.search2 = '';
this.doubleRandom.search2Value = [];
this.doubleRandom.selectedMenu = 1;
this.doubleRandom.data = [];
this.rehearsal.isExpand = true;
this.rehearsal.isPopover = false;
this.rehearsal.isLoading = false;
this.rehearsal.search1 = '';
this.rehearsal.search1Value = [];
this.rehearsal.search2 = '';
this.rehearsal.search2Value = [];
this.rehearsal.selectedMenu = 1;
this.rehearsal.data = [];
};
ZhiIndicatorsComponent.prototype.log = function (data) {
var arr = [];
data.unitList.forEach(function (item) {
item.checked ? arr.push(item.id) : null;
});
data.search1Value = arr;
};
ZhiIndicatorsComponent.prototype.isPopover = function (data) {
console.log(data);
data.isPopover = !data.isPopover;
data.unitList.forEach(function (element) {
element.checked = false;
});
};
// 弹出 tab
ZhiIndicatorsComponent.prototype.popoverMenuSelect = function (data, type) {
data.selectedMenu = type;
};
ZhiIndicatorsComponent.prototype.expand = function (data) {
data.isExpand = !data.isExpand;
};
//搜索框提交
ZhiIndicatorsComponent.prototype.submitForm = function (data) {
data.unitList = [];
this.PageNumber = 1;
this.getCompanies(data);
};
ZhiIndicatorsComponent.prototype.getCompanies = function (incomingData) {
return __awaiter(this, void 0, void 0, function () {
var params;
var _this = this;
return __generator(this, function (_a) {
params = {
CompanyName: incomingData ? incomingData.search1 : '',
PageNumber: this.PageNumber,
PageSize: 50
};
return [2 /*return*/, new Promise(function (resolve, reject) {
_this.http
.get('/api/Companies', {
params: params
})
.subscribe(function (data) {
_this.moreDataLoading = false;
_this.totalCount = data.totalCount;
data.items.forEach(function (element) {
element.label = element.companyName;
element.value = element.id;
element.parentId = element.organizationId;
element.key = element.id;
element.title = element.companyName;
element.level = 4;
});
_this.unitList = data.items;
// if (incomingData && incomingData.name == '投诉举报') {
// this.complaint.unitList = JSON.parse(JSON.stringify(this.unitList))
// } else if (incomingData && incomingData.name == '行政许可') {
// this.permission.unitList = JSON.parse(JSON.stringify(this.unitList))
// } else if (incomingData && incomingData.name == '双随机') {
// this.doubleRandom.unitList = JSON.parse(JSON.stringify(this.unitList))
// } else if (incomingData && incomingData.name == '熟悉演练') {
// this.rehearsal.unitList = JSON.parse(JSON.stringify(this.unitList))
// } else {
// this.complaint.unitList = JSON.parse(JSON.stringify(this.unitList))
// this.permission.unitList = JSON.parse(JSON.stringify(this.unitList))
// this.doubleRandom.unitList = JSON.parse(JSON.stringify(this.unitList))
// this.rehearsal.unitList = JSON.parse(JSON.stringify(this.unitList))
// }
_this.complaint.unitList = _this.complaint.unitList.concat(JSON.parse(JSON.stringify(data.items)));
_this.complaint.unitList = __spreadArrays(_this.complaint.unitList);
_this.permission.unitList = _this.permission.unitList.concat(JSON.parse(JSON.stringify(data.items)));
_this.permission.unitList = __spreadArrays(_this.permission.unitList);
_this.doubleRandom.unitList = _this.doubleRandom.unitList.concat(JSON.parse(JSON.stringify(data.items)));
_this.doubleRandom.unitList = __spreadArrays(_this.doubleRandom.unitList);
_this.rehearsal.unitList = _this.rehearsal.unitList.concat(JSON.parse(JSON.stringify(data.items)));
_this.rehearsal.unitList = __spreadArrays(_this.rehearsal.unitList);
resolve(data);
});
})];
});
});
};
ZhiIndicatorsComponent.prototype.moreData = function () {
this.moreDataLoading = true;
this.PageNumber += 1;
this.getCompanies();
};
ZhiIndicatorsComponent.prototype.getAllOrganization = function () {
return __awaiter(this, void 0, void 0, function () {
var params;
var _this = this;
return __generator(this, function (_a) {
params = {
ContainsChildren: 'true',
PageNumber: 1,
PageSize: 9999,
code: '0000'
};
return [2 /*return*/, new Promise(function (resolve, reject) {
_this.http
.get('/api/Organizations', {
params: params
})
.subscribe(function (data) {
data.items.forEach(function (element) {
element.key = element.id;
element.title = element.name;
element.selectable = false;
element.disableCheckbox = true;
element.datatype = '机构';
element.level == 'squadron'
? (element.disableCheckbox = false)
: null;
});
_this.allOrList = JSON.parse(JSON.stringify(data.items));
_this.nodes = __spreadArrays(_this.toTree.toTree(JSON.parse(JSON.stringify(data.items))));
_this.complaint.nodes = JSON.parse(JSON.stringify(_this.nodes));
_this.permission.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));
resolve(data);
});
})];
});
});
};
ZhiIndicatorsComponent.prototype.getUsers = function () {
return __awaiter(this, void 0, void 0, function () {
var _this = this;
return __generator(this, function (_a) {
return [2 /*return*/, new Promise(function (resolve, reject) {
var params = {
OrganizationId: _this.OrganizationId,
OrganizationLevel: 'squadron',
ContainsChildren: true,
PageNumber: 1,
PageSize: 9999
};
_this.http
.get('/api/Users', {
params: params
})
.subscribe(function (data) {
console.log('用户列表', data.items);
data.items.forEach(function (element) {
element.key = element.id;
element.title = element.name;
element.parentId = element.organizationId;
});
_this.users = data.items;
resolve(data);
});
})];
});
});
};
ZhiIndicatorsComponent.prototype.editOr = function (incomingData, item) {
var _this = this;
var modal = this.modal.create({
nzTitle: '修改协助机构',
nzContent: edit_or_component_1.EditOrComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 660,
nzMaskClosable: false,
nzComponentParams: {
selectedData: __spreadArrays(item.supervisorIds, item.assistantOrganizationIds),
organizationList: JSON.parse(JSON.stringify(this.allOrList)),
// users: JSON.parse(JSON.stringify(this.users)),
supervisorList: __spreadArrays(JSON.parse(JSON.stringify(this.assitantsupervisorList)), JSON.parse(JSON.stringify(this.mainsupervisorList)))
},
nzOnOk: function () { return __awaiter(_this, void 0, void 0, function () {
var _this = this;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!instance.validateForm.valid) return [3 /*break*/, 2];
return [4 /*yield*/, new Promise(function (resolve, reject) {
console.log(instance.nzTreeComponent.getCheckedNodeList());
var supervisorIds = [];
var assistantOrganizationIds = [];
instance.nzTreeComponent.getCheckedNodeList().forEach(function (item) {
item.origin.datatype == '机构'
? assistantOrganizationIds.push(item.key)
: supervisorIds.push(item.key);
});
var body = {
supervisorIds: supervisorIds,
assistantOrganizationIds: assistantOrganizationIds
};
_this.http.patch("/api/PlanTasks/" + item.id, body).subscribe({
next: function (data) { return __awaiter(_this, void 0, void 0, function () {
return __generator(this, function (_a) {
this.message.create('success', '修改成功');
incomingData.name == '投诉举报'
? this.getTaskList('投诉举报')
: null;
incomingData.name == '行政许可'
? this.getTaskList('行政许可')
: null;
resolve(data);
return [2 /*return*/];
});
}); },
error: function (err) {
_this.message.create('warning', '修改失败');
reject(err);
}
});
})];
case 1:
_a.sent();
return [3 /*break*/, 3];
case 2:
this.message.create('warning', '请填写完整!');
return [2 /*return*/, false];
case 3: return [2 /*return*/];
}
});
}); }
});
var instance = modal.getContentComponent();
modal.afterOpen.subscribe(function () { return console.log('[afterOpen] emitted!'); });
modal.afterClose.subscribe(function (result) {
return console.log('[afterClose] The result is:', result);
});
};
ZhiIndicatorsComponent.prototype.orcheckbox = function (data, $event, node) {
if ($event) {
data.search2Value.push(node.origin.id);
}
else {
for (var index = 0; index < data.search2Value.length; index++) {
var element = data.search2Value[index];
if (element == node.origin.id) {
data.search2Value.splice(index, 1);
index--;
}
}
}
console.log(data.search2Value);
};
ZhiIndicatorsComponent.prototype.ngOnInit = function () {
var _this = this;
this.OrganizationId = JSON.parse(sessionStorage.getItem('userData')).organizationId;
this.selectedMonth = new Date().getMonth() + 1;
//说明保存防抖
this.valueChange.pipe(operators_1.debounceTime(1000)).subscribe(function (item) {
var body = {
description: item.description
};
return new Promise(function (resolve, reject) {
_this.http.patch("/api/PlanTasks/" + item.id, body).subscribe({
next: function (data) { return __awaiter(_this, void 0, void 0, function () {
return __generator(this, function (_a) {
this.message.create('success', '实时保存成功');
resolve(data);
return [2 /*return*/];
});
}); },
error: function (err) {
_this.message.create('warning', '保存失败');
reject(err);
}
});
});
});
//任务额保存防抖
this.targetCount.pipe(operators_1.debounceTime(1000)).subscribe(function (item) {
// console.log(item)
var body = {
targetCount: item.targetCount
};
return new Promise(function (resolve, reject) {
_this.http.patch("/api/TaskTargets/" + item.id, body).subscribe({
next: function (data) { return __awaiter(_this, void 0, void 0, function () {
return __generator(this, function (_a) {
this.message.create('success', '修改任务额成功');
resolve(data);
return [2 /*return*/];
});
}); },
error: function (err) {
_this.message.create('warning', '修改任务额失败');
reject(err);
}
});
});
});
// this.getUsers()
this.getCompanies();
this.getAllOrganization();
// Promise.all([this.getCompanies(), this.getAllOrganization()])
// .then((results) => {
// let arr = [...JSON.parse(JSON.stringify(this.allOrList)), ...JSON.parse(JSON.stringify(this.unitList))]
// this.nodes = [...this.toTree.toTree(arr)]
// this.complaint.nodes = JSON.parse(JSON.stringify(this.nodes))
// this.permission.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))
// });
this.getTaskList('投诉举报');
this.getTaskList('行政许可');
this.getTaskTarget('双随机');
this.getTaskTarget('熟悉演练');
//获得主协调查人员
this.getSupervisor('main');
this.getSupervisor('assisted');
var roles = JSON.parse(sessionStorage.getItem('userData')).roles;
var iszhanxun = roles.find(function (item) {
return item.name.indexOf('战训') != -1;
});
if (iszhanxun) {
this.iszhanxun = true;
}
console.log('iszhanxun', iszhanxun);
};
//投诉举报/行政许可 选择单位 确认按钮
ZhiIndicatorsComponent.prototype.selectedUnit = function (data, type) {
var _this = this;
var arr = __spreadArrays(data.search1Value, data.search2Value);
var arrSet = __spreadArrays(new Set(arr));
data.isLoading = true;
var selectedMonth = this.selectedMonth < 10 ? '0' + this.selectedMonth : this.selectedMonth;
var selectedTime = this.selectedYear + '-' + selectedMonth + '-' + '01';
this.http
.post("/api/PlanTasks/Many", null, {
params: {
month: selectedTime,
companyIds: arrSet,
taskType: type
}
})
.subscribe({
next: function (item) {
data.isLoading = false;
data.isPopover = false;
_this.message.create('success', '共创建' +
arrSet.length +
'条任务' +
',成功创建' +
item.length +
'条,剩余' +
(arrSet.length - item.length) +
'个单位已被创建');
type == '投诉举报' ? _this.getTaskList('投诉举报', data) : null;
type == '行政许可' ? _this.getTaskList('行政许可', data) : null;
},
error: function (err) {
data.isLoading = false;
_this.message.create('warning', '创建失败');
}
});
};
//双随机/熟悉演练 选择单位 确认按钮
ZhiIndicatorsComponent.prototype.selectedUnit2 = function (data, type) {
var _this = this;
var selectedMonth = this.selectedMonth < 10 ? '0' + this.selectedMonth : this.selectedMonth;
var selectedTime = this.selectedYear + '-' + selectedMonth + '-' + '01';
var arr = __spreadArrays(data.search1Value, data.search2Value);
var body = __spreadArrays(new Set(arr));
data.isLoading = true;
this.http
.post("/api/TaskTargets/" + selectedTime, body, {
params: {
taskType: type
}
})
.subscribe({
next: function (item) {
data.isLoading = false;
data.isPopover = false;
_this.message.create('success', '共创建' +
body.length +
'条任务' +
',成功创建' +
item.length +
'条,剩余' +
(body.length - item.length) +
'个单位已被创建');
type == '双随机' ? _this.getTaskTarget('双随机', data) : null;
type == '熟悉演练' ? _this.getTaskTarget('熟悉演练', data) : null;
},
error: function (err) {
data.isLoading = false;
_this.message.create('warning', '创建失败');
}
});
};
ZhiIndicatorsComponent.prototype.getTaskTarget = function (TaskType, carddata) {
return __awaiter(this, void 0, void 0, function () {
var selectedTime, params;
var _this = this;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
TaskType == '双随机'
? (this.doubleRandom.isLoading = true)
: (this.rehearsal.isLoading = true);
selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01';
params = {
taskType: TaskType
};
return [4 /*yield*/, new Promise(function (resolve, reject) {
_this.http
.get("/api/TaskTargets/" + selectedTime, {
params: params
})
.subscribe(function (data) {
_this.ngZone.run(function () {
//这里写需要立即渲染的代码
TaskType == '双随机'
? (_this.doubleRandom.isLoading = false)
: (_this.rehearsal.isLoading = false);
console.log(TaskType + '任务指标列表', data);
TaskType == '双随机' ? (_this.doubleRandom.allocated = 0) : null;
TaskType == '熟悉演练' ? (_this.rehearsal.allocated = 0) : null;
TaskType == '双随机' ? (_this.doubleRandom.allPlanTasks = 0) : null;
TaskType == '熟悉演练' ? (_this.rehearsal.allPlanTasks = 0) : null;
TaskType == '双随机' ? (_this.doubleRandom.data = data) : null;
TaskType == '熟悉演练' ? (_this.rehearsal.data = data) : null;
data.forEach(function (element) {
if (element.planTasks) {
if (TaskType == '双随机') {
_this.doubleRandom.allPlanTasks += element.planTasks.length;
}
if (TaskType == '熟悉演练') {
_this.rehearsal.allPlanTasks += element.planTasks.length;
}
element.planTasks.forEach(function (item) {
if (item.approvalStatus == '通过') {
TaskType == '双随机'
? (_this.doubleRandom.allocated += 1)
: null;
TaskType == '熟悉演练'
? (_this.rehearsal.allocated += 1)
: null;
}
});
}
});
});
resolve(data);
});
})];
case 1: return [2 /*return*/, _a.sent()];
}
});
});
};
ZhiIndicatorsComponent.prototype.getTaskList = function (TaskType, carddata) {
return __awaiter(this, void 0, void 0, function () {
var selectedTime, params;
var _this = this;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
TaskType == '投诉举报'
? (this.complaint.isLoading = true)
: (this.permission.isLoading = true);
selectedTime = this.selectedYear + '-' + this.selectedMonth + '-' + '01';
params = {
Month: selectedTime,
OrganizationId: this.OrganizationId,
TaskType: TaskType,
PageNumber: 1,
PageSize: 99999
};
return [4 /*yield*/, new Promise(function (resolve, reject) {
_this.http
.get('/api/PlanTasks', {
params: params
})
.subscribe(function (data) {
_this.ngZone.run(function () {
//这里写需要立即渲染的代码
console.log(TaskType + '任务列表', data.items);
TaskType == '投诉举报'
? (_this.complaint.isLoading = false)
: (_this.permission.isLoading = false);
TaskType == '投诉举报' ? (_this.complaint.allocated = 0) : null;
TaskType == '行政许可' ? (_this.permission.allocated = 0) : null;
TaskType == '投诉举报' ? (_this.complaint.data = data.items) : null;
TaskType == '行政许可' ? (_this.permission.data = data.items) : null;
data.items.forEach(function (item) {
if (item.approvalStatus == '通过') {
TaskType == '投诉举报' ? (_this.complaint.allocated += 1) : null;
TaskType == '行政许可'
? (_this.permission.allocated += 1)
: null;
}
});
});
resolve(data);
});
})];
case 1: return [2 /*return*/, _a.sent()];
}
});
});
};
//修改任务描述
ZhiIndicatorsComponent.prototype.taskDescChange = function (incomingData, item) {
this.valueChange.next(item);
};
//修改任务额
ZhiIndicatorsComponent.prototype.targetCountChange = function (incomingData, item, e) {
this.targetCount.next(item);
};
ZhiIndicatorsComponent.prototype.ngOnDestroy = function () {
// console.log('毁灭了')
// this.doubleRandom.isPopover = false
};
ZhiIndicatorsComponent.prototype.onExpandChange = function (e) {
var node = e.node;
if (node &&
node.getChildren().length === 0 &&
node.isExpanded &&
node.origin.level == 'squadron') {
this.loadNode(node.origin.id).then(function (data) {
node.addChildren(data);
});
}
else {
node.isLoading = false;
}
};
ZhiIndicatorsComponent.prototype.loadNode = function (id) {
var _this = this;
return new Promise(function (resolve) {
var params = {
OrganizationId: id,
PageNumber: 1,
PageSize: 9999
};
_this.http
.get('/api/Companies', {
params: params
})
.subscribe(function (data) {
console.log(data.items);
data.items.forEach(function (element) {
element.key = element.id;
element.title = element.companyName;
element.level = 4;
element.isLeaf = true;
});
resolve(data.items);
});
});
};
ZhiIndicatorsComponent.prototype.getCompaniesByName = function (incomingData) {
return __awaiter(this, void 0, void 0, function () {
var params_1;
var _this = this;
return __generator(this, function (_a) {
// incomingData.search2Value
console.log(incomingData.search2Value);
if (incomingData.search2) {
incomingData.isnodes = false;
params_1 = {
CompanyName: incomingData.search2,
PageNumber: this.PageNumber,
PageSize: 9999
};
return [2 /*return*/, new Promise(function (resolve, reject) {
_this.http
.get('/api/Companies', {
params: params_1
})
.subscribe(function (data) {
_this.moreDataLoading = false;
_this.totalCount = data.totalCount;
data.items.forEach(function (element) {
element.label = element.companyName;
element.value = element.id;
element.parentId = element.organizationId;
element.key = element.id;
element.title = element.companyName;
element.level = 4;
element.isLeaf = true;
incomingData.search2Value.forEach(function (item) {
item == element.id ? (element.isChecked = true) : null;
});
});
if (data.items.length == 0) {
_this.message.create('warning', '没有查询到任何单位');
incomingData.isnodes = true;
return;
}
var allOrList = JSON.parse(JSON.stringify(_this.allOrList));
allOrList.forEach(function (element) {
element.expanded = true;
});
var arr = __spreadArrays(allOrList, data.items);
incomingData.nodes2 = __spreadArrays(_this.toTree.toTree(arr));
resolve(data);
});
})];
}
else {
incomingData.isnodes = true;
}
return [2 /*return*/];
});
});
};
ZhiIndicatorsComponent.prototype.getSupervisor = function (type) {
var _this = this;
var params = {
inspectorType: type
};
this.http
.get('/api/Users/Inspectors', {
params: params
})
.subscribe(function (data) {
console.log('检查员列表', data);
data.forEach(function (element) {
element.parentId = element.organizationId;
element.key = element.id;
element.title = element.name;
element.selectable = false;
element.disableCheckbox = false;
element.datatype = '人员';
});
if (type == 'main') {
_this.mainsupervisorList = data;
}
else {
_this.assitantsupervisorList = data;
}
});
};
ZhiIndicatorsComponent.prototype.allot = function (item, type) {
var _this = this;
console.log(item);
if (this.mainsupervisorList.length == 0 ||
this.assitantsupervisorList.length == 0) {
this.message.create('warning', '请从用户管理添加检查人员');
return;
}
var modal = this.modal.create({
nzTitle: '分配监督检查员',
nzContent: allot_person_component_1.AllotPersonComponent,
nzViewContainerRef: this.viewContainerRef,
nzWidth: 485,
nzMaskClosable: false,
nzComponentParams: {
mainsupervisorList: this.mainsupervisorList,
assitantsupervisorList: this.assitantsupervisorList
},
nzOnOk: function () { return __awaiter(_this, void 0, void 0, function () {
var _this = this;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!instance.validateForm.valid) return [3 /*break*/, 2];
return [4 /*yield*/, new Promise(function (resolve, reject) {
var body = {
supervisorIds: [
instance.validateForm.value.main,
instance.validateForm.value.assitant,
]
};
_this.http.patch("/api/PlanTasks/" + item.id, body).subscribe({
next: function (data) { return __awaiter(_this, void 0, void 0, function () {
return __generator(this, function (_a) {
this.message.create('success', '分配成功');
this.getTaskTarget(type);
resolve(data);
return [2 /*return*/, true];
});
}); },
error: function (err) {
_this.message.create('warning', '分配失败');
reject(err);
return false;
}
});
})];
case 1:
_a.sent();
return [3 /*break*/, 3];
case 2:
this.message.create('warning', '请填写完整!');
return [2 /*return*/, false];
case 3: return [2 /*return*/];
}
});
}); }
});
var instance = modal.getContentComponent();
modal.afterOpen.subscribe(function () { return console.log('[afterOpen] emitted!'); });
modal.afterClose.subscribe(function (result) {
return console.log('[afterClose] The result is:', result);
});
};
ZhiIndicatorsComponent.prototype.distribute = function (item, type) {
var _this = this;
this.modal.confirm({
nzTitle: "\u786E\u5B9A\u8981\u6D3E\u53D1\u8BE5\u4EFB\u52A1\u5417?",
nzOkText: '确定',
nzOkType: 'default',
nzOnOk: function () {
item.isLoading = true;
_this.http
.post("/api/PlanTasks/Approval/" + item.id, null, {
params: {
approvalStatus: '待检查'
}
})
.subscribe({
next: function (data) {
_this.message.create('success', '已派发');
item.approvalStatus = '待检查';
item.isLoading = false;
item.passed += 1;
type == '投诉举报' ? (_this.complaint.allocated += 1) : null;
type == '行政许可' ? (_this.permission.allocated += 1) : null;
type == '双随机' ? (_this.doubleRandom.allocated += 1) : null;
type == '熟悉演练' ? (_this.rehearsal.allocated += 1) : null;
},
error: function (err) {
_this.message.create('warning', '派发失败');
item.isLoading = false;
}
});
},
nzCancelText: '取消'
});
};
//删除任务
ZhiIndicatorsComponent.prototype.deleteTask = function (item, incomingData) {
var _this = this;
console.log(item);
console.log(incomingData);
this.modal.confirm({
nzTitle: "\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u4EFB\u52A1\u5417?",
nzOkText: '确定',
nzOkType: 'primary',
nzOnOk: function () {
_this.http["delete"]("/api/PlanTasks/" + item.id).subscribe(function (data) {
var originaldata;
if (item.taskType == '投诉举报' || item.taskType == '行政许可') {
_this.getTaskList(item.taskType);
}
if (item.taskType == '双随机' || item.taskType == '熟悉演练') {
_this.getTaskTarget(item.taskType);
}
_this.message.create('success', '删除成功!');
});
},
nzCancelText: '取消',
nzOnCancel: function () { }
});
};
ZhiIndicatorsComponent = __decorate([
core_1.Component({
selector: 'app-zhi-indicators',
templateUrl: './zhi-indicators.component.html',
styleUrls: ['./zhi-indicators.component.scss']
})
], ZhiIndicatorsComponent);
return ZhiIndicatorsComponent;
}());
exports.ZhiIndicatorsComponent = ZhiIndicatorsComponent;

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

@ -2,9 +2,12 @@
<div class="box">
<div class="timebox">
<nz-select [(ngModel)]="selectedYear" (ngModelChange)="selectYear($event)">
<nz-option [nzValue]="2021" nzLabel="2021年"></nz-option>
<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.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 = 2023;
selectedYear = new Date().getFullYear();
selectedTime;
selectMonth(item) {
console.log('选择月份');

8
src/app/pages/login/login.component.html

@ -1,8 +1,8 @@
<div class="login" id="login">
<div class="left">
<!-- <p class="a1">Hi,欢迎登录</p> -->
<div style="width: 774px;height: 165px;">
<!-- <img src="../../../assets/images/logo/loginlogo.png" alt=""> -->
<p class="a1">Hi,欢迎登录</p>
<div>
<img src="../../../assets/images/logo/loginlogo.png" alt="">
</div>
</div>
@ -46,7 +46,7 @@
<button [nzLoading]="isLoading" nz-button class="login-form-button login-form-margin"
[nzType]="'primary'">登录</button>
</form>
<p class="company">非煤矿山灾害智能感知和预警系统 v1.1.0</p>
<p class="company">防消一体化综合治理平台 v1.1.0</p>
</div>
</div>

9
src/index.html

@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<title>非煤矿山灾害智能感知和预警系统</title>
<title>防消一体化综合治理平台</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
@ -20,7 +20,12 @@
<script type="text/javascript" src="/assets/wordexport/FileSaver.js"></script>
<script type="text/javascript" src="/assets/wordexport/jquery.wordexport.js"></script>
<script type="text/javascript" src="/assets/wordexport/jquery.print.js"></script>
<script src='https://webapi.amap.com/maps?v=2.0&key=e4b359dc7b03f9418b7497f807131346'></script>
<script type="text/javascript">
window._AMapSecurityConfig = {
securityJsCode: '0afa0b144398727fad2ca06f5f7156b3'
}
</script>
<script src="https://webapi.amap.com/maps?v=2.0&key=17bb9b27e49451cde8f2e6655b11ff1a"></script>
<script src="https://webapi.amap.com/ui/1.1/main.js?v=1.1.1"></script>
</html>

2
src/theme.less

@ -103,7 +103,7 @@
.bigfontpattern {
.logobox {
width: 350px !important;
width: 255px !important;
font-size: 20px !important;
}

Loading…
Cancel
Save