Browse Source

首页调整

xuzhancheng 19 hours ago
parent
commit
dad27f127a

+ 12 - 0
yudao-ui-admin-vue3/src/api/pressure2/indextodo/index.ts

@@ -38,9 +38,21 @@ export interface IndexTodoCountVO {
   pipePressureWorkingInstructionCount: number
 }
 
+// OA待办统计 VO
+export interface OATodoCountVO {
+  boilerCheckCount: number
+  boilerRatifyCount: number
+  pipeCheckCount: number
+  pipeRatifyCount: number
+}
+
 export const IndexTodoApi = {
   // 获取首页待办/审核数量统计
   getTodoCount: async () => {
     return await request.get({ url: `/pressure2/index-todo/count` })
   },
+  // 获取OA待办中锅炉/管道审核、审批数量统计(独立接口,避免阻塞首页)
+  getOATodoCount: async () => {
+    return await request.get({ url: `/pressure2/external-oa/getOATodoCount` })
+  },
 }

+ 31 - 6
yudao-ui-admin-vue3/src/views/Home/Index.vue

@@ -225,6 +225,9 @@ const auditTodoList = ref([
   { title: '检验意见通知书审核', key: 'boilerPressureInspectionOpinionNoticeCount', equipType: 'boiler', iconUrl: jljhIcon, task: 0, routerName: 'AuditInspectionCommentsNoticeBoiler' },
   { title: '检验方案审核', key: 'boilerPressureInspectionSchemeCount', equipType: 'boiler', iconUrl: zlshIcon, task: 0, routerName: 'InspectionPlanAuditBoiler' },
   { title: '操作指导书审核', key: 'boilerPressureWorkingInstructionCount', equipType: 'boiler', iconUrl: rwdshIcon, task: 0, routerName: 'WorkInstructionAuditBoiler' },
+  // OA流程:锅炉审核/审批
+  { title: '锅炉审核', key: 'boilerCheckCount', equipType: 'boiler', iconUrl: bgspIcon, task: 0, routerPath: '/gljy/report-check-boiler', oaType: true },
+  { title: '锅炉审批', key: 'boilerRatifyCount', equipType: 'boiler', iconUrl: bgspIcon, task: 0, routerPath: '/gljy/report-ratify-boiler', oaType: true },
 
   { title: '记录校核', key: 'pipeRecheckOrderItemCount', equipType: 'pipe', iconUrl: jljhIcon, task: 0, routerName: 'PipeCheckerRecordCheck' },
   { title: '上报市局审核', key: 'pipeReportCityBureauCount', equipType: 'pipe', iconUrl: rwdshIcon, task: 0, routerName: 'appointmentconfirmorderCityBureauListPressure2' },
@@ -234,6 +237,9 @@ const auditTodoList = ref([
   { title: '检验意见通知书审核', key: 'pipePressureInspectionOpinionNoticeCount', equipType: 'pipe', iconUrl: jljhIcon, task: 0, routerName: 'AuditInspectionCommentsNoticePipe' },
   { title: '检验方案审核', key: 'pipePressureInspectionSchemeCount', equipType: 'pipe', iconUrl: zlshIcon, task: 0, routerName: 'InspectionPlanAuditPipe' },
   { title: '操作指导书审核', key: 'pipePressureWorkingInstructionCount', equipType: 'pipe', iconUrl: rwdshIcon, task: 0, routerName: 'WorkInstructionAuditPipe' },
+  // OA流程:管道审核/审批
+  { title: '管道审核', key: 'pipeCheckCount', equipType: 'pipe', iconUrl: bgspIcon, task: 0, routerPath: '/gdjy/report-check-pipe', oaType: true },
+  { title: '管道审批', key: 'pipeRatifyCount', equipType: 'pipe', iconUrl: bgspIcon, task: 0, routerPath: '/gdjy/report-ratify-pipe', oaType: true },
 ])
 
 const showAuditList = computed(() => {
@@ -287,6 +293,13 @@ const quickAccessList = ref([
 const userStore = useUserStore()
 const handleRouteTo = (item: any) => {
   const { id } = userStore.getUser
+
+  // 支持直接路径跳转(OA审批卡片等)
+  if (item.routerPath) {
+    router.push({ path: item.routerPath })
+    return
+  }
+
   if (item.routerName) {
     // 特殊处理任务单跳转:默认带上 inspectorIds 和 taskStatusList 参数
     const query: any = {
@@ -294,12 +307,6 @@ const handleRouteTo = (item: any) => {
       ...(item.routerQuery || {})
     }
 
-    // 如果是任务单页面,额外添加 inspectorIds 和 taskStatusList 参数
-    // if (item.routerName === 'TaskOrder') {
-    //   query.inspectorIds = id
-    //   query.taskStatusList = 100
-    // }
-
     router.push({
       name: item.routerName,
       query
@@ -320,6 +327,8 @@ const fetchAllCounts = async () => {
       return item
     })
     auditTodoList.value = auditTodoList.value.map((item: any) => {
+      // OA类型的卡片(锅炉/管道审核审批)使用独立接口加载数据,此处跳过
+      if (item.oaType) return item
       if (result[item.key] !== undefined) {
         item.task = result[item.key]
       }
@@ -330,6 +339,21 @@ const fetchAllCounts = async () => {
   }
 }
 
+// 获取OA待办中锅炉/管道审核、审批数量(独立接口,不阻塞首页主查询)
+const fetchOATodoCount = async () => {
+  try {
+    const result = await IndexTodoApi.getOATodoCount()
+    auditTodoList.value = auditTodoList.value.map((item: any) => {
+      if (item.oaType && result[item.key] !== undefined) {
+        item.task = result[item.key]
+      }
+      return item
+    })
+  } catch (err) {
+    console.error('获取OA待办统计失败', err)
+  }
+}
+
 // 旧逻辑保留(注释)
 // const fetchTodoList = ... 
 // const fetchAuditTodoList = ...
@@ -397,6 +421,7 @@ const toMoreNotice = () => {
 // fetchTodoList()
 // fetchAuditTodoList()
 fetchAllCounts()
+fetchOATodoCount()
 selectNoticeList()
 </script>