lipenghui 3 недель назад
Родитель
Сommit
48f4a204c9

+ 9 - 6
src/api/pms/stat/index.ts

@@ -6,7 +6,7 @@ export const IotStatApi = {
     return await request.get({ url: `/rq/stat/main/day` })
   },
   getOrderSeven: async (params: any) => {
-    return await request.get({ url: `/rq/stat/rh/order` })
+    return await request.get({ url: `/rq/stat/rh/order/`+params })
   },
   getMainWeek: async (params: any) => {
     return await request.get({ url: `/rq/stat/main/week` })
@@ -35,6 +35,9 @@ export const IotStatApi = {
   getInspectStatus: async (params: any) => {
     return await request.get({ url: `/rq/stat/inspect/status`, params })
   },
+  getInspectStatuss: async (params: any, dept:any) => {
+    return await request.get({ url: `/rq/stat/inspect/statuss/`+dept, params })
+  },
   getInspectTodayStatus: async (params: any) => {
     return await request.get({ url: `/rq/stat/inspect/today/status` })
   },
@@ -57,7 +60,7 @@ export const IotStatApi = {
     return await request.get({ url: `/rq/stat/maintenance/total` })
   },
   getMaintenanceStatus: async (params: any) => {
-    return await request.get({ url: `/rq/stat/maintenance/status` })
+    return await request.get({ url: `/rq/stat/maintenance/status/`+params })
   },
   getMaintenanceTodayStatus: async (params: any) => {
     return await request.get({ url: `/rq/stat/maintenance/today/status` })
@@ -71,10 +74,10 @@ export const IotStatApi = {
 
 
   getDeviceCount: async (params: any) => {
-    return await request.get({ url: `/rq/stat/home/device/count` })
+    return await request.get({ url: `/rq/stat/home/device/count/`+params })
   },
   getMaintainCount: async (params: any) => {
-    return await request.get({ url: `/rq/stat/home/maintain/count` })
+    return await request.get({ url: `/rq/stat/home/maintain/count/`+params })
   },
   getMainWorkCount: async (params: any) => {
     return await request.get({ url: `/rq/stat/home/work/count` })
@@ -83,11 +86,11 @@ export const IotStatApi = {
     return await request.get({ url: `/rq/stat/home/inspect/count` })
   },
   getDeviceStatusCount: async (params: any) => {
-    return await request.get({ url: `/rq/stat/home/device/status` })
+    return await request.get({ url: `/rq/stat/home/device/status/`+params })
   },
 
   getDeviceTypeCount: async (params: any) => {
-    return await request.get({ url: `/rq/stat/home/device/type` })
+    return await request.get({ url: `/rq/stat/home/device/type/`+params })
   },
   getDeptCount: async (params: any) => {
     return await request.get({ url: `/rq/stat/home/dept` })

+ 9 - 9
src/views/pms/stat/rdkb.vue

@@ -151,17 +151,17 @@
                   <div class="flex flex-col items-center">
                     <Icon icon="fa-solid:list" size="30" color="blue" />
                     <p style="font-size: 20px; margin-top: 5px">总工单数</p>
-                    <span style="font-size: 20px">{{ by.finished + by.todo }}</span>
+                    <span style="font-size: 20px">{{ (by.finished?by.finished:0) + (by.todo?by.todo:0) }}</span>
                   </div>
                   <div class="flex flex-col items-center">
                     <Icon icon="fa-solid:check-circle" size="30" color="green" />
                     <p style="font-size: 20px; margin-top: 5px">已执行工单数</p>
-                    <span style="font-size: 20px">{{ by.finished }}</span>
+                    <span style="font-size: 20px">{{ by.finished?by.finished:0 }}</span>
                   </div>
                   <div class="flex flex-col items-center">
                     <Icon icon="fa-solid:hourglass-half" size="30" color="orange" />
                     <p style="font-size: 20px; margin-top: 5px">待执行工单数 </p>
-                    <span style="font-size: 20px">{{ by.todo }}</span>
+                    <span style="font-size: 20px">{{ by.todo?by.todo:0 }}</span>
                   </div>
                 </div>
               </div>
@@ -314,21 +314,21 @@ const totalMaterialCost = computed(() => {
 })
 
 const getStats = () => {
-  IotStatApi.getDeviceStatusCount().then((res) => {
+  IotStatApi.getDeviceStatusCount('rd').then((res) => {
     typeData.value = res
     initDeviceStatusCharts()
   })
-  IotStatApi.getOrderSeven().then((res) => {
+  IotStatApi.getOrderSeven('rd').then((res) => {
     orderSevenData.value = res
     initQxChart()
   })
-  IotStatApi.getDeviceCount().then((res) => {
+  IotStatApi.getDeviceCount("rd").then((res) => {
     device.value = res
   })
-  IotStatApi.getMaintainCount().then((res) => {
+  IotStatApi.getMaintainCount("rd").then((res) => {
     maintain.value = res
   })
-  IotStatApi.getMaintenanceStatus().then((res) => {
+  IotStatApi.getMaintenanceStatus("rd").then((res) => {
     by.value = res
     initMaintenanceChart()
   })
@@ -339,7 +339,7 @@ const getStats = () => {
     deptId: null, // 选中的部门ID
     status: null // 填写状态
   })
-  IotStatApi.getInspectStatus(fillQueryParams).then((res) => {
+  IotStatApi.getInspectStatuss(fillQueryParams,'rd').then((res) => {
     inspect.value = res
     initInspectChart()
   })

+ 8 - 8
src/views/pms/stat/rhkb.vue

@@ -251,10 +251,10 @@ const safe = ref()
 const getStats =  () => {
   initYwcbChart()
   // 获取基础统计数据
-  IotStatApi.getDeviceCount().then((res) => {
+  IotStatApi.getDeviceCount("rh").then((res) => {
     device.value = res
   })
-  IotStatApi.getMaintainCount().then((res) => {
+  IotStatApi.getMaintainCount("rh").then((res) => {
     maintain.value = res
   })
   IotStatApi.getMainWorkCount().then((res) => {
@@ -272,7 +272,7 @@ const getStats =  () => {
     initTopChart()
   })
 
-  IotStatApi.getDeviceStatusCount().then((res) => {
+  IotStatApi.getDeviceStatusCount('rh').then((res) => {
     typeData.value = res
     initDeviceStatusCharts()
   })
@@ -284,13 +284,13 @@ const getStats =  () => {
     initMaterials()
   })
 
-  IotStatApi.getOrderSeven().then((res) => {
+  IotStatApi.getOrderSeven('rh').then((res) => {
     orderSevenData.value = res
     initQxChart();
   })
-  IotStatApi.getMaintenanceStatus().then((res) => {
+  IotStatApi.getMaintenanceStatus("rh").then((res) => {
     by.value = res
-    initMaintenanceChart()
+
   })
   const fillQueryParams = reactive({
     startTime: Date.now() - 7 * 24 * 60 * 60 * 1000, // 设置默认开始时间为 7 天前
@@ -299,7 +299,7 @@ const getStats =  () => {
     deptId: null, // 选中的部门ID
     status: null // 填写状态
   })
-  IotStatApi.getInspectStatus(fillQueryParams).then((res) => {
+  IotStatApi.getInspectStatuss(fillQueryParams,'rh').then((res) => {
     inspectt.value = res
   })
   fillQueryParams.deptId = useUserStore().getUser.deptId
@@ -579,7 +579,7 @@ const getTopOption = () => {
 
 // 初始化图表
 const initTopChart = async () => {
-  await IotStatApi.getDeviceTypeCount().then((res) => {
+  await IotStatApi.getDeviceTypeCount('rh').then((res) => {
     backendData.value = res
   })
   if (!topContainer.value) return

+ 8 - 8
src/views/pms/stat/rykb.vue

@@ -313,10 +313,10 @@ const drillingWellChartRef = ref()
 const getStats =  () => {
   initYwcbChart()
   // 获取基础统计数据
-  IotStatApi.getDeviceCount().then((res) => {
+  IotStatApi.getDeviceCount("ry").then((res) => {
     device.value = res
   })
-  IotStatApi.getMaintainCount().then((res) => {
+  IotStatApi.getMaintainCount("ry").then((res) => {
     maintain.value = res
   })
   IotStatApi.getMainWorkCount().then((res) => {
@@ -325,7 +325,7 @@ const getStats =  () => {
   IotStatApi.getInspectCount().then((res) => {
     inspect.value = res
   })
-  IotStatApi.getMaintenanceStatus().then((res) => {
+  IotStatApi.getMaintenanceStatus("ry").then((res) => {
     status.value = res
     // initCharts()
   })
@@ -334,7 +334,7 @@ const getStats =  () => {
     initTopChart()
   })
 
-  IotStatApi.getDeviceStatusCount().then((res) => {
+  IotStatApi.getDeviceStatusCount('ry').then((res) => {
     typeData.value = res
     initDeviceStatusCharts()
   })
@@ -346,14 +346,14 @@ const getStats =  () => {
     initMaterials()
   })
 
-  IotStatApi.getOrderSeven().then((res) => {
+  IotStatApi.getOrderSeven('ry').then((res) => {
     orderSevenData.value = res
     initQxChart();
   })
 
   IotStatApi.getMaintenanceStatus().then((res) => {
     by.value = res
-    initMaintenanceChart()
+
   })
   const fillQueryParams = reactive({
     startTime: Date.now() - 7 * 24 * 60 * 60 * 1000, // 设置默认开始时间为 7 天前
@@ -362,7 +362,7 @@ const getStats =  () => {
     deptId: null, // 选中的部门ID
     status: null // 填写状态
   })
-  IotStatApi.getInspectStatus(fillQueryParams).then((res) => {
+  IotStatApi.getInspectStatuss(fillQueryParams,'ry').then((res) => {
     inspectt.value = res
   })
   fillQueryParams.deptId = useUserStore().getUser.deptId
@@ -714,7 +714,7 @@ const getTopOption = () => {
 
 // 初始化图表
 const initTopChart = async () => {
-  await IotStatApi.getDeviceTypeCount().then((res) => {
+  await IotStatApi.getDeviceTypeCount('ry').then((res) => {
     backendData.value = res
   })
   if (!topContainer.value) return