Ver código fonte

Merge branch 'ai' into dev

huoyi 4 dias atrás
pai
commit
c436e8b912

+ 9 - 6
src/views/assistant/components/dutyOrganization.vue

@@ -18,16 +18,19 @@
18 18
           <div class="stat-content">
19 19
             {{ attendanceData && attendanceData.length > 0 ? attendanceData[attendanceData.length -
20 20
               1]?.deptName : ''
21
-            }}出勤<span>{{ attendanceData && attendanceData.length > 3 ? attendanceData[3]?.currentValue : 0
21
+            }}出勤<span>{{ attendanceData && attendanceData.length > 0 ? attendanceData[attendanceData.length -
22
+              1]?.currentValue : 0
22 23
             }}</span>人次,同比
23 24
             <span
24
-              :class="getTrendClass(attendanceData && attendanceData.length > 3 ? attendanceData[3]?.yearOnYearValue : 0)">{{
25
-                formatRate(attendanceData && attendanceData.length > 3 ? attendanceData[3]?.yearOnYearValue : 0) }}</span>
25
+              :class="getTrendClass(attendanceData && attendanceData.length > 0 ? attendanceData[attendanceData.length - 1]?.yearOnYearValue : 0)">{{
26
+                formatRate(attendanceData && attendanceData.length > 0 ? attendanceData[attendanceData.length -
27
+                  1]?.yearOnYearValue : 0) }}</span>
26 28
             <template v-if="props.queryForm.dateRangeQueryType !== 'YEAR'">
27 29
               ,环比
28 30
               <span
29
-                :class="getTrendClass(attendanceData && attendanceData.length > 3 ? attendanceData[3]?.chainRatioValue : 0)">{{
30
-                  formatRate(attendanceData && attendanceData.length > 3 ? attendanceData[3]?.chainRatioValue : 0)
31
+                :class="getTrendClass(attendanceData && attendanceData.length > 0 ? attendanceData[attendanceData.length - 1]?.chainRatioValue : 0)">{{
32
+                  formatRate(attendanceData && attendanceData.length > 0 ? attendanceData[attendanceData.length -
33
+                    1]?.chainRatioValue : 0)
31 34
                 }}</span>
32 35
             </template>
33 36
           </div>
@@ -188,7 +191,7 @@ const isStationType = computed(() => {
188 191
   return selectedDeptType.value === 'STATION' || !selectedDeptType.value
189 192
 })
190 193
 const isDepartmentType = computed(() => {
191
-  return selectedDeptType.value === 'DEPARTMENT'
194
+  return selectedDeptType.value === 'MANAGER'
192 195
 })
193 196
 const isTeamsType = computed(() => {
194 197
   return selectedDeptType.value === 'TEAMS'

+ 11 - 4
src/views/assistant/components/qualityControl.vue

@@ -156,7 +156,7 @@ const isStationType = computed(() => {
156 156
 
157 157
 // 计算属性:检查是否为DEPARTMENT类型
158 158
 const isDepartmentType = computed(() => {
159
-  return selectedDeptType.value === 'DEPARTMENT'
159
+  return selectedDeptType.value === 'MANAGER'
160 160
 })
161 161
 const isBrigadeType = computed(() => {
162 162
   return selectedDeptType.value === 'BRIGADE'
@@ -296,13 +296,20 @@ const fetchAnalysisData = async (queryParams) => {
296 296
     // 添加null检查,防止props.selectedDeptObject为null
297 297
     const selectedDept = props.selectedDeptObject
298 298
     const { deptType = "", id } = selectedDept ? selectedDept : { deptType: "", id: "" }
299
-
299
+    let progressParams = { ...queryParams }
300
+    if (progressParams.dateRangeQueryType === 'YEAR') {
301
+      progressParams.yearOnYear = true
302
+      delete progressParams.chainRatio
303
+    } else {
304
+      progressParams.chainRatio = true
305
+      progressParams.yearOnYear = true
306
+    }
300 307
     let rangParams = {
301 308
       userId: deptType == 'USER' ? id : "",
302
-      deptId: ["STATION", "DEPARTMENT", "TEAMS", "BRIGADE"].includes(deptType) ? id : ""
309
+      deptId: ["STATION", "MANAGER", "TEAMS", "BRIGADE"].includes(deptType) ? id : ""
303 310
     }
304 311
 
305
-    const response = await getAnalysisReport({ ...queryParams, ...rangParams })
312
+    const response = await getAnalysisReport({ ...progressParams, ...rangParams })
306 313
     console.log('质控分析数据:', response.data)
307 314
 
308 315
     // 解构赋值API返回的数据

+ 1 - 1
src/views/assistant/components/riskHazard.vue

@@ -287,7 +287,7 @@ const isStationType = computed(() => {
287 287
 })
288 288
 // 计算属性:检查是否为STATION类型
289 289
 const isDepartmentType = computed(() => {
290
-  return selectedDeptType.value === 'DEPARTMENT'
290
+  return selectedDeptType.value === 'MANAGER'
291 291
 })
292 292
 
293 293
 const isBrigadeType = computed(() => {