From f82a505c0232ce76117d41f34ed12c0482e35adb Mon Sep 17 00:00:00 2001
From: SHAOJIAHAO <55341701@qq.com>
Date: Sat, 7 Jan 2023 16:39:09 +0800
Subject: [PATCH] =?UTF-8?q?[=E6=96=B0=E5=A2=9E]=E7=BB=9F=E8=AE=A1=E5=AF=BC?=
=?UTF-8?q?=E5=87=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../form/examine/examine.component.html | 11 ++++---
.../form/examine/examine.component.ts | 32 ++++++++++++++++++-
.../form/review/review.component.html | 11 ++++---
.../form/review/review.component.ts | 31 ++++++++++++++++--
.../statistic-analysis/home/home.component.ts | 2 +-
src/theme.less | 1 +
6 files changed, 74 insertions(+), 14 deletions(-)
diff --git a/src/app/home/statistic-analysis/form/examine/examine.component.html b/src/app/home/statistic-analysis/form/examine/examine.component.html
index e5dbe5b..7b363b9 100644
--- a/src/app/home/statistic-analysis/form/examine/examine.component.html
+++ b/src/app/home/statistic-analysis/form/examine/examine.component.html
@@ -9,7 +9,8 @@
nzTheme="outline">查询
-
+
@@ -44,16 +45,16 @@
{{item['当场整改数']}}
- {{item['上报数量']}}
+ {{item['推送大队总数']}}
|
- {{item['消除隐患数量']}}
+ {{item['大队排除隐患数']}}
|
- {{item['单位数量']}}
+ {{item['社会单位总数']}}
|
- {{item['总隐患数'] == 0 ? '0.0' : ((item['消除隐患数量']/item['总隐患数'])*100).toFixed(1) }}%
+ {{item['隐患复查合格率']}}%
|
diff --git a/src/app/home/statistic-analysis/form/examine/examine.component.ts b/src/app/home/statistic-analysis/form/examine/examine.component.ts
index 3f0177b..fc32037 100644
--- a/src/app/home/statistic-analysis/form/examine/examine.component.ts
+++ b/src/app/home/statistic-analysis/form/examine/examine.component.ts
@@ -5,6 +5,7 @@ import { TreeService } from 'src/app/service/tree.service';
import * as moment from 'moment';
import * as echarts from 'echarts';
import { Router } from '@angular/router';
+import { NzMessageService } from 'ng-zorro-antd/message';
@Component({
selector: 'app-examine',
templateUrl: './examine.component.html',
@@ -12,7 +13,7 @@ import { Router } from '@angular/router';
})
export class ExamineComponent implements OnInit {
- constructor(private http: HttpClient, private toTree: TreeService, private methodService: MethodService, private router: Router) { }
+ constructor(private http: HttpClient, private toTree: TreeService, private methodService: MethodService, private router: Router, private message: NzMessageService) { }
echartsOfBar
@@ -285,4 +286,33 @@ export class ExamineComponent implements OnInit {
goback() {
this.router.navigate(['/statistic/home'])
}
+
+
+ exportExcel() {
+ const httpOptions = {
+ responseType: 'blob' as 'json',
+ params: {
+ OrganizationId: this.searchForm.or,
+ CheckStartTime: moment(this.searchForm.date[0]).format('yyyy-MM-DD') + ' 00:00:00',
+ CheckEndTime: moment(this.searchForm.date[1]).format('yyyy-MM-DD') + ' 23:59:59',
+ RecheckStaType: '检查情况'
+ }
+ };
+ this.http.get(`/api/PlanTasks/ExportOrgRecheckStat`, httpOptions).subscribe({
+ next: (data: any) => {
+ const link = document.createElement('a');
+ const blob = new Blob([data], { type: 'application/vnd.ms-excel' });
+ link.setAttribute('href', window.URL.createObjectURL(blob));
+ link.setAttribute('download', '检查情况统计' + '.xls');
+ link.style.visibility = 'hidden';
+ document.body.appendChild(link);
+ link.click();
+ document.body.removeChild(link);
+ this.message.create('success', `导出成功`);
+ },
+ error: err => {
+ this.message.create('error', `导出失败`);
+ }
+ })
+ }
}
diff --git a/src/app/home/statistic-analysis/form/review/review.component.html b/src/app/home/statistic-analysis/form/review/review.component.html
index fd67a7c..80833b8 100644
--- a/src/app/home/statistic-analysis/form/review/review.component.html
+++ b/src/app/home/statistic-analysis/form/review/review.component.html
@@ -9,7 +9,8 @@
nzTheme="outline">查询
-
+
@@ -36,16 +37,16 @@
- {{item['完成数']}}
+ {{item['完成总数']}}
|
- {{item['需要复查数']}}
+ {{item['大队需要复查数']}}
|
- {{item['复查通过数']}}
+ {{item['大队已复查数']}}
|
- {{item['需要复查数'] == 0 ? '0.0' : ((item['复查通过数']/item['需要复查数'])*100).toFixed(1) }}%
+ {{item['任务复查合格率']}}%
|
diff --git a/src/app/home/statistic-analysis/form/review/review.component.ts b/src/app/home/statistic-analysis/form/review/review.component.ts
index 6e1117a..59bcb6b 100644
--- a/src/app/home/statistic-analysis/form/review/review.component.ts
+++ b/src/app/home/statistic-analysis/form/review/review.component.ts
@@ -5,6 +5,7 @@ import { TreeService } from 'src/app/service/tree.service';
import * as moment from 'moment';
import * as echarts from 'echarts';
import { Router } from '@angular/router';
+import { NzMessageService } from 'ng-zorro-antd/message';
@Component({
selector: 'app-review',
templateUrl: './review.component.html',
@@ -13,7 +14,7 @@ import { Router } from '@angular/router';
export class ReviewComponent implements OnInit {
- constructor(private http: HttpClient, private toTree: TreeService, private methodService: MethodService, private router: Router) { }
+ constructor(private http: HttpClient, private toTree: TreeService, private methodService: MethodService, private router: Router, private message: NzMessageService) { }
echartsOfBar
@@ -256,5 +257,31 @@ export class ReviewComponent implements OnInit {
goback() {
this.router.navigate(['/statistic/home'])
}
-
+ exportExcel() {
+ const httpOptions = {
+ responseType: 'blob' as 'json',
+ params: {
+ OrganizationId: this.searchForm.or,
+ CheckStartTime: moment(this.searchForm.date[0]).format('yyyy-MM-DD') + ' 00:00:00',
+ CheckEndTime: moment(this.searchForm.date[1]).format('yyyy-MM-DD') + ' 23:59:59',
+ RecheckStaType: '复查情况'
+ }
+ };
+ this.http.get(`/api/PlanTasks/ExportOrgRecheckStat`, httpOptions).subscribe({
+ next: (data: any) => {
+ const link = document.createElement('a');
+ const blob = new Blob([data], { type: 'application/vnd.ms-excel' });
+ link.setAttribute('href', window.URL.createObjectURL(blob));
+ link.setAttribute('download', '复查情况统计' + '.xls');
+ link.style.visibility = 'hidden';
+ document.body.appendChild(link);
+ link.click();
+ document.body.removeChild(link);
+ this.message.create('success', `导出成功`);
+ },
+ error: err => {
+ this.message.create('error', `导出失败`);
+ }
+ })
+ }
}
diff --git a/src/app/home/statistic-analysis/home/home.component.ts b/src/app/home/statistic-analysis/home/home.component.ts
index c6b873a..b219552 100644
--- a/src/app/home/statistic-analysis/home/home.component.ts
+++ b/src/app/home/statistic-analysis/home/home.component.ts
@@ -566,7 +566,7 @@ export class HomeComponent implements OnInit {
center_left.forEach(element => {
let monthnum = new Date(element.date).getMonth() + 1
if (monthnum == new Date().getMonth() + 1) {
- element.percentOfPass = Math.round(((element.totalCount - element.badCount) / element.totalCount) * 100)
+ element.percentOfPass = Math.round(((element.totalCount - element.badCount) / element.totalCount) * 100) || 0
this.buhegedata = element
}
element.month = monthnum
diff --git a/src/theme.less b/src/theme.less
index eddaf12..c9dd731 100644
--- a/src/theme.less
+++ b/src/theme.less
@@ -36,6 +36,7 @@
// 周计划日期选择权
.weeklyplan {
+
.ant-picker {
padding-left: 0;
}