From 633568cff8a45c9f92aec1ec5edb5a09a3b0d8a4 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期六, 14 三月 2026 13:26:38 +0800
Subject: [PATCH] fix: 隐患地点需要拍照而不是文字描述,需要可预览。

---
 src/pages/inspectionManagement/index.vue |   75 ++++---------------------------------
 1 files changed, 9 insertions(+), 66 deletions(-)

diff --git a/src/pages/inspectionManagement/index.vue b/src/pages/inspectionManagement/index.vue
index 349d1d0..56a1fcb 100644
--- a/src/pages/inspectionManagement/index.vue
+++ b/src/pages/inspectionManagement/index.vue
@@ -1,17 +1,8 @@
 <template>
   <view class="inspection-management-page">
-    <PageHeader title="宸℃浠诲姟绠$悊"
+    <PageHeader title="瀹氭椂浠诲姟绠$悊"
                 @back="goBack" />
     <view class="toolbar">
-      <view class="tab-wrap">
-        <view v-for="tab in tabs"
-              :key="tab.name"
-              class="tab-item"
-              :class="{ active: activeTab === tab.name }"
-              @click="switchTab(tab.name)">
-          {{ tab.label }}
-        </view>
-      </view>
       <view class="search-section">
         <view class="search-bar">
           <view class="search-input">
@@ -36,8 +27,7 @@
       <uni-swipe-action>
         <uni-swipe-action-item v-for="item in tableData"
                                :key="item.id"
-                               :right-options="activeTab === 'taskManage' ? swipeOptions : []"
-                               :disabled="activeTab !== 'taskManage'"
+                               :right-options="swipeOptions"
                                @click="onSwipeActionClick($event, item)">
           <view class="ledger-item">
             <view class="item-header">
@@ -92,16 +82,15 @@
               </view>
               <up-divider></up-divider>
               <view class="card-actions">
-                <u-button v-if="activeTab === 'taskManage'"
-                          type="primary"
+                <u-button type="primary"
                           size="small"
                           class="action-btn"
                           @click.stop="handleAdd(item)">缂栬緫</u-button>
-                <u-button v-else
-                          type="success"
+                <u-button type="error"
                           size="small"
+                          plain
                           class="action-btn"
-                          @click.stop="viewFile(item)">鏌ョ湅闄勪欢</u-button>
+                          @click.stop="deleteOne(item)">鍒犻櫎</u-button>
               </view>
             </view>
           </view>
@@ -113,8 +102,7 @@
         <text>鏆傛棤鏁版嵁</text>
       </view>
     </view>
-    <view v-if="activeTab === 'taskManage'"
-          class="fab-button"
+    <view class="fab-button"
           @click="handleAdd()">
       <up-icon name="plus"
                size="24"
@@ -122,7 +110,6 @@
     </view>
     <form-dia ref="formDia"
               @closeDia="handleQuery" />
-    <view-files ref="viewFiles" />
   </view>
 </template>
 
@@ -131,20 +118,12 @@
   import { onShow, onReachBottom, onPullDownRefresh } from "@dcloudio/uni-app";
   import PageHeader from "@/components/PageHeader.vue";
   import FormDia from "@/pages/inspectionManagement/components/formDia.vue";
-  import ViewFiles from "@/pages/inspectionManagement/components/viewFiles.vue";
   import {
     delTimingTask,
-    inspectionTaskList,
     timingTaskList,
   } from "@/api/inspectionManagement/index.js";
 
   const formDia = ref();
-  const viewFiles = ref();
-  const activeTab = ref("taskManage");
-  const tabs = [
-    { name: "taskManage", label: "瀹氭椂浠诲姟绠$悊" },
-    { name: "task", label: "瀹氭椂浠诲姟璁板綍" },
-  ];
   const queryParams = reactive({
     taskName: "",
   });
@@ -219,12 +198,6 @@
     return [String(val)];
   };
 
-  const switchTab = tabName => {
-    if (activeTab.value === tabName) return;
-    activeTab.value = tabName;
-    handleQuery();
-  };
-
   const getList = async () => {
     if (loading.value) return;
     loading.value = true;
@@ -234,8 +207,7 @@
         current: pageParams.current,
         size: pageParams.size,
       };
-      const request = activeTab.value === "task" ? inspectionTaskList : timingTaskList;
-      const res = await request(params);
+      const res = await timingTaskList(params);
       const records = res?.data?.records || [];
       const normalized = records.map(item => ({
         ...item,
@@ -278,12 +250,6 @@
     });
   };
 
-  const viewFile = row => {
-    nextTick(() => {
-      viewFiles.value?.openDialog(row);
-    });
-  };
-
   const deleteOne = async row => {
     if (!row?.id) return;
     const canDelete = await new Promise(resolve => {
@@ -311,7 +277,6 @@
   };
 
   const onSwipeActionClick = (event, row) => {
-    if (activeTab.value !== "taskManage") return;
     if (event?.position !== "right") return;
     deleteOne(row);
   };
@@ -345,30 +310,8 @@
     z-index: 10;
   }
 
-  .tab-wrap {
-    display: flex;
-    background: #f4f5f8;
-    border-radius: 16rpx;
-    padding: 6rpx;
-  }
-
-  .tab-item {
-    flex: 1;
-    text-align: center;
-    padding: 14rpx 0;
-    font-size: 26rpx;
-    color: #666;
-    border-radius: 12rpx;
-  }
-
-  .tab-item.active {
-    background: #1677ff;
-    color: #fff;
-    font-weight: 600;
-  }
-
   .search-section {
-    margin-top: 20rpx;
+    margin-top: 0;
   }
 
   .search-bar {

--
Gitblit v1.9.3