seimin hai 1 ano
pai
achega
af82924dbc

+ 10 - 10
src/app/share/businessData-detail-modal/businessData-detail-modal.component.ts

@@ -1,7 +1,7 @@
1 1
 import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
2 2
 import { MainService } from '../../services/main.service';
3 3
 import { ToolService } from 'src/app/services/tool.service';
4
-
4
+import { format, startOfDay, endOfDay } from 'date-fns';
5 5
 @Component({
6 6
   selector: 'app-businessData-detail-modal',
7 7
   templateUrl: './businessData-detail-modal.component.html',
@@ -72,7 +72,7 @@ export class BusinessDataDetailModalComponent implements OnInit {
72 72
           this.getSpecimen();
73 73
           break;
74 74
       case 'deptInspectionRateStatistics':
75
-        this.getDeptInspectionRateStatistics(1);
75
+        this.getDeptInspectionRateStatistics();
76 76
         break;
77 77
     }
78 78
   }
@@ -139,28 +139,28 @@ export class BusinessDataDetailModalComponent implements OnInit {
139 139
       case 'total':
140 140
         postData.deptId = this.dataInfo.data.deptId;
141 141
         postData.hosId = this.hosId;
142
-        postData.startTime = this.dataInfo.searchDto.startTime;
143
-        postData.endTime = this.dataInfo.searchDto.endTime;
142
+        postData.startTime = this.dataInfo.searchDto.dateRange[0] ? format(startOfDay(this.dataInfo.searchDto.dateRange[0]), 'yyyy-MM-dd HH:mm:ss') : undefined;
143
+        postData.endTime = this.dataInfo.searchDto.dateRange[1] ? format(endOfDay(this.dataInfo.searchDto.dateRange[1]), 'yyyy-MM-dd HH:mm:ss') : undefined;
144 144
         break;
145 145
       case 'noCheckCount':
146 146
         postData.deptId = this.dataInfo.data.deptId;
147 147
         postData.hosId = this.hosId;
148
-        postData.startTime = this.dataInfo.searchDto.startTime;
149
-        postData.endTime = this.dataInfo.searchDto.endTime;
148
+        postData.startTime = this.dataInfo.searchDto.dateRange[0] ? format(startOfDay(this.dataInfo.searchDto.dateRange[0]), 'yyyy-MM-dd HH:mm:ss') : undefined;
149
+        postData.endTime = this.dataInfo.searchDto.dateRange[1] ? format(endOfDay(this.dataInfo.searchDto.dateRange[1]), 'yyyy-MM-dd HH:mm:ss') : undefined;
150 150
         postData.reportInsState = 'noCheck';
151 151
         break;
152 152
       case 'checkCount':
153 153
         postData.deptId = this.dataInfo.data.deptId;
154 154
         postData.hosId = this.hosId;
155
-        postData.startTime = this.dataInfo.searchDto.startTime;
156
-        postData.endTime = this.dataInfo.searchDto.endTime;
155
+        postData.startTime = this.dataInfo.searchDto.dateRange[0] ? format(startOfDay(this.dataInfo.searchDto.dateRange[0]), 'yyyy-MM-dd HH:mm:ss') : undefined;
156
+        postData.endTime = this.dataInfo.searchDto.dateRange[1] ? format(endOfDay(this.dataInfo.searchDto.dateRange[1]), 'yyyy-MM-dd HH:mm:ss') : undefined;
157 157
         postData.reportInsState = 'check';
158 158
         break;
159 159
       case 'insCount':
160 160
         postData.deptId = this.dataInfo.data.deptId;
161 161
         postData.hosId = this.hosId;
162
-        postData.startTime = this.dataInfo.searchDto.startTime;
163
-        postData.endTime = this.dataInfo.searchDto.endTime;
162
+        postData.startTime = this.dataInfo.searchDto.dateRange[0] ? format(startOfDay(this.dataInfo.searchDto.dateRange[0]), 'yyyy-MM-dd HH:mm:ss') : undefined;
163
+        postData.endTime = this.dataInfo.searchDto.dateRange[1] ? format(endOfDay(this.dataInfo.searchDto.dateRange[1]), 'yyyy-MM-dd HH:mm:ss') : undefined;
164 164
         postData.reportInsState = 'inspect';
165 165
         break;
166 166
     }

+ 2 - 2
src/app/views/dept-inspection-rate-statistics/dept-inspection-rate-statistics.component.ts

@@ -91,8 +91,8 @@ export class DeptInspectionRateStatisticsComponent implements OnInit {
91 91
   }
92 92
 
93 93
   personDetail(dataInfo){
94
-    let startDate = dataInfo.searchDto.startTime || 'null';
95
-    let endDate = dataInfo.searchDto.endDate || 'null';
94
+    let startDate = dataInfo.searchDto.dateRange[0] ? format(startOfDay(dataInfo.searchDto.dateRange[0]), 'yyyy-MM-dd HH:mm:ss') : 'null';
95
+    let endDate = dataInfo.searchDto.dateRange[1] ? format(endOfDay(dataInfo.searchDto.dateRange[1]), 'yyyy-MM-dd HH:mm:ss') : 'null';
96 96
     let deptId = dataInfo.data.deptId || 'null';
97 97
     this.router.navigateByUrl(
98 98
       `/main/deptInspectionRateStatistics/workerStatisticsDetail/null/${startDate}/${endDate}/null/deptInspectionRateStatistics/${deptId}`