From a7a9f53ef126659f664f5cbfe4eb10bebdfc4a6a Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期二, 19 五月 2026 23:33:56 +0800
Subject: [PATCH] feat: 设备巡检修改

---
 src/views/equipmentManagement/inspectionManagement/index.vue |  528 +++++++++++++++++++++++++++++++++-------------------------
 1 files changed, 297 insertions(+), 231 deletions(-)

diff --git a/src/views/equipmentManagement/inspectionManagement/index.vue b/src/views/equipmentManagement/inspectionManagement/index.vue
index f0196b9..423830f 100644
--- a/src/views/equipmentManagement/inspectionManagement/index.vue
+++ b/src/views/equipmentManagement/inspectionManagement/index.vue
@@ -1,13 +1,8 @@
 <template>
   <div class="app-container">
     <el-form :inline="true" :model="queryParams" class="search-form">
-      <el-form-item label="鎼滅储">
-        <el-input
-            v-model="queryParams.searchAll"
-            placeholder="璇疯緭鍏ュ叧閿瓧"
-            clearable
-            :style="{ width: '100%' }"
-        />
+      <el-form-item label="宸℃浠诲姟鍚嶇О">
+        <el-input v-model="queryParams.taskName" placeholder="璇疯緭鍏ュ贰妫�浠诲姟鍚嶇О" clearable style="width: 200px " />
       </el-form-item>
       <el-form-item>
         <el-button type="primary" @click="handleQuery">鏌ヨ</el-button>
@@ -15,151 +10,95 @@
       </el-form-item>
     </el-form>
     <el-card>
-      <!-- 鏍囩椤� -->
-      <el-tabs
-          v-model="activeTab"
-          class="info-tabs"
-          @tab-click="handleTabClick"
-      >
-        <el-tab-pane
-            v-for="tab in tabs"
-            :key="tab.name"
-            :label="tab.label"
-            :name="tab.name"
-        />
-      </el-tabs>
-      <div style="display: flex;flex-direction: row;justify-content: space-between;" v-if="tabName === 'task'">
+      <div style="display: flex;flex-direction: row;justify-content: space-between;margin-bottom: 10px;">
         <el-radio-group v-model="activeRadio" @change="radioChange">
-          <el-radio-button v-for="tab in radios"
-                           :key="tab.name"
-                           :label="tab.label"
-                           :value="tab.name"/>
+          <el-radio-button v-for="tab in radios" :key="tab.name" :label="tab.label" :value="tab.name" />
         </el-radio-group>
         <!-- 鎿嶄綔鎸夐挳鍖� -->
         <el-space v-if="activeRadio !== 'task'">
           <el-button type="primary" :icon="Plus" @click="handleAdd(undefined)">鏂板缓</el-button>
           <el-button type="danger" :icon="Delete" @click="handleDelete">鍒犻櫎</el-button>
-          <!-- <el-button type="info" plain :icon="Download">瀵煎嚭</el-button> -->
+          <el-button @click="handleOut">瀵煎嚭</el-button>
+        </el-space>
+        <el-space v-else>
+          <el-button @click="handleOut">瀵煎嚭</el-button>
         </el-space>
       </div>
       <div>
-        <div>
-          <PIMTable :table-loading="tableLoading"
-                  :table-data="tableData"
-                  :column="tableColumns"
-                  @selection-change="handleSelectionChange"
-                  :is-selection="true"
-                  :border="true"
-                  :table-style="{ width: '100%', height: 'calc(100vh - 30em)' }"
-                  v-if="tabName === 'task'"
-          >
+        <PIMTable :table-loading="tableLoading" :table-data="tableData" :column="tableColumns"
+          @selection-change="handleSelectionChange" @pagination="handlePagination" :is-selection="true" :border="true"
+          :page="{
+            current: pageNum,
+            size: pageSize,
+            total: total,
+            layout: 'total, sizes, prev, pager, next, jumper'
+          }" :table-style="{ width: '100%', height: 'calc(100vh - 23em)' }">
           <template #inspector="{ row }">
             <div class="person-tags">
-              <!-- 璋冭瘯淇℃伅锛屼笂绾挎椂鍒犻櫎 -->
-              <!-- {{ console.log('inspector data:', row.inspector) }} -->
               <template v-if="row.inspector && row.inspector.length > 0">
-                <el-tag
-                  v-for="(person, index) in row.inspector"
-                  :key="index"
-                  size="small"
-                  type="primary"
-                  class="person-tag"
-                >
+                <el-tag v-for="(person, index) in row.inspector" :key="index" size="small" type="primary"
+                  class="person-tag">
                   {{ person }}
                 </el-tag>
               </template>
               <span v-else class="no-data">--</span>
             </div>
           </template>
-          </PIMTable>
-          <el-table ref="table" :data="tableData" height="480" v-loading="tableLoading" border v-else style="width: 100%;height: calc(100vh - 25em)">
-            <el-table-column label="搴忓彿" type="index" width="60" align="center" />
-            <el-table-column prop="deviceName" label="璁惧鍚嶇О" :show-overflow-tooltip="true">
-              <template #default="scope">
-                {{scope.row.qrCode.deviceName}}
-              </template>
-            </el-table-column>
-            <el-table-column prop="location" label="鎵�鍦ㄤ綅缃弿杩�" :show-overflow-tooltip="true">
-              <template #default="scope">
-                {{scope.row.qrCode.location}}
-              </template>
-            </el-table-column>
-            <el-table-column prop="scanner" label="宸℃浜�"></el-table-column>
-            <el-table-column prop="scanTime" label="宸℃鏃堕棿"></el-table-column>
-            <el-table-column fixed="right" label="鎿嶄綔">
-              <template #default="scope">
-                <el-button link type="primary" @click="handleAdd(scope.row)">鏌ョ湅闄勪欢</el-button>
-              </template>
-            </el-table-column>
-          </el-table>
-        </div>
-        <pagination
-            v-if="total>0"
-            :page="pageNum"
-            :limit="pageSize"
-            :total="total"
-            @pagination="handlePagination"
-            :layout="'total, prev, pager, next, jumper'"
-        />
+
+          <template #acceptStatusSlot="{ row }">
+            <el-tag v-if="row.acceptStatus === 1" type="success">宸查�氳繃</el-tag>
+            <el-tag v-else-if="row.acceptStatus === 2" type="danger">宸查��鍥�</el-tag>
+            <el-tag v-else-if="row.inspectionStatus > 0" type="warning">寰呴獙鏀�</el-tag>
+            <span v-else>--</span>
+          </template>
+
+          <template #statusRef="{ row }">
+            <el-tag v-if="row.isActive === true || row.isActive === 1" type="success">鍚敤</el-tag>
+            <el-tag v-else type="danger">鍋滅敤</el-tag>
+          </template>
+        </PIMTable>
       </div>
     </el-card>
     <form-dia ref="formDia" @closeDia="handleQuery"></form-dia>
-    <qr-code-dia ref="qrCodeDia" @closeDia="handleQuery"></qr-code-dia>
     <view-files ref="viewFiles"></view-files>
-    <view-qr-code-files ref="viewQrCodeFiles"></view-qr-code-files>
   </div>
 </template>
 
 <script setup>
 import { Delete, Plus } from "@element-plus/icons-vue";
 import { onMounted, ref, reactive, getCurrentInstance, nextTick } from "vue";
+import { ElMessageBox } from "element-plus";
+import dayjs from "dayjs";
 
 // 缁勪欢寮曞叆
-import Pagination from "@/components/Pagination/index.vue";
 import PIMTable from "@/components/PIMTable/PIMTable.vue";
 import FormDia from "@/views/equipmentManagement/inspectionManagement/components/formDia.vue";
-import QrCodeDia from "@/views/equipmentManagement/inspectionManagement/components/qrCodeDia.vue";
 import ViewFiles from "@/views/equipmentManagement/inspectionManagement/components/viewFiles.vue";
-import ViewQrCodeFiles from "@/views/equipmentManagement/inspectionManagement/components/viewQrCodeFiles.vue";
 
 // 鎺ュ彛寮曞叆
 import {
   delTimingTask,
   inspectionTaskList,
-  timingTaskList
+  timingTaskList,
+  addOrEditTimingTask,
+  acceptInspectionTask,
 } from "@/api/inspectionManagement/index.js";
-import {
-  delQrCode,
-  qrCodeList,
-  qrCodeScanRecordList
-} from "@/api/inspectionUpload/index.js";
 
 // 鍏ㄥ眬鍙橀噺
 const { proxy } = getCurrentInstance();
 const formDia = ref();
-const qrCodeDia = ref();
 const viewFiles = ref();
-const viewQrCodeFiles = ref();
 
 // 鏌ヨ鍙傛暟
 const queryParams = reactive({
-  searchAll: "",
+  taskName: "",
 });
-
-// 鏍囩椤甸厤缃�
-const activeTab = ref("task");
-const tabName = ref("task");
-const tabs = reactive([
-  { name: "task", label: "鐢熶骇宸℃" },
-  { name: "qrCodeScanRecord", label: "鐜板満宸℃璁板綍" },
-]);
 
 // 鍗曢�夋閰嶇疆
 const activeRadio = ref("taskManage");
 const radios = reactive([
-  { name: "taskManage", label: "瀹氭椂浠诲姟绠$悊" },
-  { name: "task", label: "瀹氭椂浠诲姟璁板綍" },
-  { name: "qrCode", label: "浜岀淮鐮佺鐞�" },
+  { name: "taskManage", label: "宸℃浠诲姟绠$悊" },
+  { name: "task", label: "宸℃浠诲姟璁板綍" },
 ]);
 
 // 琛ㄦ牸鏁版嵁
@@ -175,109 +114,162 @@
 // 鍒楅厤缃�
 const columns = ref([
   { prop: "taskName", label: "宸℃浠诲姟鍚嶇О", minWidth: 160 },
-  { prop: "inspectionLocation", label: "鍦扮偣", minWidth: 120 },
   { prop: "remarks", label: "澶囨敞", minWidth: 150 },
   { prop: "inspector", label: "鎵ц宸℃浜�", minWidth: 150, slot: "inspector" },
+  { prop: "inspectionAcceptor", label: "楠屾敹浜�", minWidth: 100 },
   {
     prop: "frequencyType",
     label: "棰戞",
-    minWidth: 150,
-    formatter: (_, __, val) => ({
-      DAILY: "姣忔棩",
-      WEEKLY: "姣忓懆",
-      MONTHLY: "姣忔湀",
-      QUARTERLY: "瀛e害"
-    }[val] || "")
+    minWidth: 100,
+    formatData: params => {
+      return params === "DAILY"
+        ? "姣忔棩"
+        : params === "WEEKLY"
+          ? "姣忓懆"
+          : params === "MONTHLY"
+            ? "姣忔湀"
+            : params === "QUARTERLY"
+              ? "瀛e害"
+              : "";
+    },
   },
   {
     prop: "frequencyDetail",
-    label: "寮�濮嬫棩鏈熶笌鏃堕棿",
-    minWidth: 150,
+    label: "寮�濮嬫椂闂�",
+    minWidth: 120,
     formatter: (row, column, cellValue) => {
-      // 鍏堝垽鏂槸鍚︽槸瀛楃涓�
-      if (typeof cellValue !== 'string') return '';
+      if (typeof cellValue !== "string") return "";
       let val = cellValue;
       const replacements = {
-        MON: '鍛ㄤ竴',
-        TUE: '鍛ㄤ簩',
-        WED: '鍛ㄤ笁',
-        THU: '鍛ㄥ洓',
-        FRI: '鍛ㄤ簲',
-        SAT: '鍛ㄥ叚',
-        SUN: '鍛ㄦ棩'
+        MON: "鍛ㄤ竴",
+        TUE: "鍛ㄤ簩",
+        WED: "鍛ㄤ笁",
+        THU: "鍛ㄥ洓",
+        FRI: "鍛ㄤ簲",
+        SAT: "鍛ㄥ叚",
+        SUN: "鍛ㄦ棩",
       };
-      // 浣跨敤姝e垯涓�娆℃�ф浛鎹㈡墍鏈夊尮閰嶉」
-      return val.replace(/MON|TUE|WED|THU|FRI|SAT|SUN/g, match => replacements[match]);
-    }
+      return val.replace(
+        /MON|TUE|WED|THU|FRI|SAT|SUN/g,
+        match => replacements[match]
+      );
+    },
   },
   { prop: "registrant", label: "鐧昏浜�", minWidth: 100 },
-  { prop: "createTime", label: "鐧昏鏃ユ湡", minWidth: 100 },
+  { prop: "createTime", label: "鐧昏鏃ユ湡", minWidth: 120, formatData: (cell) => cell ? dayjs(cell).format("YYYY-MM-DD") : "-" },
 ]);
 
+const inspectionStatusColumn = {
+  prop: "inspectionStatus",
+  label: "宸℃鐘舵��",
+  minWidth: 100,
+  dataType: "tag",
+  formatData: params => {
+    if (params === 0) return "鏈贰妫�";
+    if (params === 1) return "姝e父";
+    if (params === 2) return "寮傚父";
+    return "--";
+  },
+  formatType: params => {
+    if (params === 0) return "warning";
+    if (params === 1) return "success";
+    if (params === 2) return "danger";
+    return "info";
+  }
+};
+
+const inspectionAcceptorColumn = { prop: "inspectionAcceptor", label: "楠屾敹浜�", minWidth: 100 };
+
+const acceptStatusColumn = {
+  prop: "acceptStatus",
+  label: "楠屾敹鐘舵��",
+  minWidth: 100,
+  dataType: "slot",
+  slot: "acceptStatusSlot",
+};
+
+const statusColumn = {
+  prop: "isActive",
+  label: "浠诲姟鐘舵��",
+  minWidth: 100,
+  align: "center",
+  dataType: "slot",
+  slot: "statusRef",
+};
+
 // 鎿嶄綔鍒楅厤缃�
-const getOperationColumn = (operations) => {
+const getOperationColumn = operations => {
   if (!operations || operations.length === 0) return null;
-  
-  const operationConfig = {
-    label: "鎿嶄綔",
-    width: 130,
-    fixed: "right",
-    dataType: "action",
-    operation: operations.map(op => {
+
+  const operationList = operations
+    .map(op => {
       switch (op) {
-        case 'edit':
+        case "edit":
           return {
             name: "缂栬緫",
             clickFun: handleAdd,
-            color: "#409EFF"
+            color: "#409EFF",
           };
-        case 'viewFile':
+        case "viewFile":
           return {
-            name: "鏌ョ湅闄勪欢",
+            name: "宸℃璇︽儏",
             clickFun: viewFile,
-            color: "#67C23A"
+            color: "#67C23A",
+          };
+        case "accept":
+            return {
+              name: "楠屾敹",
+              clickFun: handleAccept,
+              color: "#E6A23C",
+              showHide: (row) => row.inspectionStatus > 0 && (!row.acceptStatus || row.acceptStatus === 0),
+            };
+        case "toggleActive":
+          return {
+            name: (row) => row.isActive === true || row.isActive === 1 ? "鍋滅敤" : "鍚敤",
+            clickFun: handleToggleActive,
+            color: (row) => row.isActive === true || row.isActive === 1 ? "#F56C6C" : "#67C23A",
           };
         default:
           return null;
       }
-    }).filter(Boolean)
+    })
+    .filter(Boolean);
+
+  const operationConfig = {
+    label: "鎿嶄綔",
+    width: 200,
+    fixed: "right",
+    dataType: "action",
+    operation: operationList,
   };
-  
+
   return operationConfig;
 };
 
-const columns1 = ref([
-  { prop: "deviceName", label: "璁惧鍚嶇О", minWidth: 160 },
-  { prop: "location", label: "鎵�鍦ㄤ綅缃弿杩�", minWidth: 120 },
-  { prop: "createBy", label: "鍒涘缓鑰�", minWidth: 100 },
-  { prop: "createTime", label: "鍒涘缓鏃堕棿", minWidth: 100 },
-]);
-
 onMounted(() => {
-  radioChange('taskManage');
+  radioChange("taskManage");
 });
 
-// 鏍囩椤电偣鍑讳簨浠�
-const handleTabClick = (tab) => {
-  tabName.value = tab.props.name;
-  tableData.value = [];
-  getList();
-};
-
 // 鍗曢�夊彉鍖�
-const radioChange = (value) => {
+const radioChange = value => {
+  activeRadio.value = value;
   if (value === "taskManage") {
-    const operationColumn = getOperationColumn(['edit']);
-    tableColumns.value = [...columns.value, ...(operationColumn ? [operationColumn] : [])];
-    operationsArr.value = ['edit'];
+    const operationColumn = getOperationColumn(["edit", "toggleActive"]);
+    tableColumns.value = [
+      ...columns.value,
+      statusColumn,
+      ...(operationColumn ? [operationColumn] : []),
+    ];
+    operationsArr.value = ["edit", "toggleActive"];
   } else if (value === "task") {
-    const operationColumn = getOperationColumn(['viewFile']);
-    tableColumns.value = [...columns.value, ...(operationColumn ? [operationColumn] : [])];
-    operationsArr.value = ['viewFile'];
-  } else {
-    const operationColumn = getOperationColumn(['edit']);
-    tableColumns.value = [...columns1.value, ...(operationColumn ? [operationColumn] : [])];
-    operationsArr.value = ['edit'];
+    const operationColumn = getOperationColumn(["viewFile", "accept"]);
+    tableColumns.value = [
+      ...columns.value,
+      inspectionStatusColumn,
+      acceptStatusColumn,
+      ...(operationColumn ? [operationColumn] : []),
+    ];
+    operationsArr.value = ["viewFile", "accept"];
   }
   pageNum.value = 1;
   pageSize.value = 10;
@@ -291,59 +283,59 @@
   getList();
 };
 // 鍒嗛〉澶勭悊
-const handlePagination = (val) => {
-	pageNum.value = val.page;
-	pageSize.value = val.limit;
-	getList();
+const handlePagination = val => {
+  pageNum.value = val.page;
+  pageSize.value = val.limit;
+  getList();
 };
 // 鑾峰彇鍒楄〃鏁版嵁
 const getList = () => {
   tableLoading.value = true;
-  
-  const params = { ...queryParams, size: pageSize.value, current: pageNum.value };
-  
+
+  const params = {
+    ...queryParams,
+    size: pageSize.value,
+    current: pageNum.value,
+  };
+
   let apiCall;
-  if (tabName.value === 'task') {
-    switch (activeRadio.value) {
-      case "task":
-        apiCall = inspectionTaskList(params);
-        break;
-      case "qrCode":
-        apiCall = qrCodeList(params);
-        break;
-      default:
-        apiCall = timingTaskList(params);
-    }
+  if (activeRadio.value === "task") {
+    apiCall = inspectionTaskList(params);
   } else {
-    apiCall = qrCodeScanRecordList(params);
+    apiCall = timingTaskList(params);
   }
-  
-  apiCall.then(res => {
-    const rawData = res.data.records || [];
-    // 澶勭悊 inspector 瀛楁锛屽皢瀛楃涓茶浆鎹负鏁扮粍锛堥�傜敤浜庢墍鏈夋儏鍐碉級
-    tableData.value = rawData.map(item => {
-      const processedItem = { ...item };
-      
-      // 澶勭悊 inspector 瀛楁
-      if (processedItem.inspector) {
-        if (typeof processedItem.inspector === 'string') {
-          // 瀛楃涓叉寜閫楀彿鍒嗗壊
-          processedItem.inspector = processedItem.inspector.split(',').map(s => s.trim()).filter(s => s);
-        } else if (!Array.isArray(processedItem.inspector)) {
-          // 闈炴暟缁勮浆涓烘暟缁�
-          processedItem.inspector = [processedItem.inspector];
+
+  apiCall
+    .then(res => {
+      const rawData = res.data.records || [];
+      // 澶勭悊 inspector 瀛楁锛屽皢瀛楃涓茶浆鎹负鏁扮粍锛堥�傜敤浜庢墍鏈夋儏鍐碉級
+      tableData.value = rawData.map(item => {
+        const processedItem = { ...item };
+
+        // 澶勭悊 inspector 瀛楁
+        if (processedItem.inspector) {
+          if (typeof processedItem.inspector === "string") {
+            // 瀛楃涓叉寜閫楀彿鍒嗗壊
+            processedItem.inspector = processedItem.inspector
+              .split(",")
+              .map(s => s.trim())
+              .filter(s => s);
+          } else if (!Array.isArray(processedItem.inspector)) {
+            // 闈炴暟缁勮浆涓烘暟缁�
+            processedItem.inspector = [processedItem.inspector];
+          }
+        } else {
+          // 绌哄�艰涓虹┖鏁扮粍
+          processedItem.inspector = [];
         }
-      } else {
-        // 绌哄�艰涓虹┖鏁扮粍
-        processedItem.inspector = [];
-      }
-      
-      return processedItem;
+
+        return processedItem;
+      });
+      total.value = res.data.total || 0;
+    })
+    .finally(() => {
+      tableLoading.value = false;
     });
-    total.value = res.data.total || 0;
-  }).finally(() => {
-    tableLoading.value = false;
-  });
 };
 
 // 閲嶇疆鏌ヨ
@@ -357,27 +349,47 @@
 };
 
 // 鏂板 / 缂栬緫
-const handleAdd = (row) => {
-  const type = row ? 'edit' : 'add';
+const handleAdd = row => {
+  const type = row ? "edit" : "add";
   nextTick(() => {
-    if (tabName.value === 'task') {
-      if (activeRadio.value === "taskManage") {
-        formDia.value?.openDialog(type, row);
-      } else if (activeRadio.value === "qrCode") {
-        qrCodeDia.value?.openDialog(type, row);
-      }
-    } else {
-      viewQrCodeFiles.value?.openDialog(row);
-    }
+    formDia.value?.openDialog(type, row);
   });
 };
 
-// 鏌ョ湅闄勪欢
-const viewFile = (row) => {
+// 宸℃璇︽儏
+const viewFile = row => {
   nextTick(() => {
     viewFiles.value?.openDialog(row);
   });
 };
+
+  // 楠屾敹鎿嶄綔
+  const handleAccept = (row) => {
+    ElMessageBox.confirm(`璇烽�夋嫨瀵逛换鍔°��${row.taskName}銆戠殑楠屾敹缁撴灉`, "绯荤粺鎻愮ず", {
+      distinguishCancelAndClose: true,
+      confirmButtonText: '楠屾敹閫氳繃',
+      cancelButtonText: '閫�鍥為噸妫�',
+      type: 'warning'
+    }).then(async () => {
+      try {
+        await acceptInspectionTask({ id: row.id, acceptStatus: 1 });
+        proxy.$modal.msgSuccess("宸查獙鏀堕�氳繃");
+        handleQuery();
+      } catch (error) {
+        console.error("楠屾敹澶辫触:", error);
+      }
+    }).catch(async (action) => {
+      if (action === 'cancel') {
+        try {
+          await acceptInspectionTask({ id: row.id, acceptStatus: 2 });
+          proxy.$modal.msgWarning("宸查��鍥烇紝绛夊緟閲嶆柊宸℃");
+          handleQuery();
+        } catch (error) {
+          console.error("閫�鍥炲け璐�:", error);
+        }
+      }
+    });
+  };
 
 // 鍒犻櫎鎿嶄綔
 const handleDelete = () => {
@@ -385,22 +397,76 @@
     proxy.$modal.msgWarning("璇烽�夋嫨瑕佸垹闄ょ殑鏁版嵁");
     return;
   }
-  
+
   const deleteIds = selectedRows.value.map(item => item.id);
-  const api = activeRadio.value === "taskManage" ? delTimingTask : delQrCode;
-  
-  proxy.$modal.confirm('鏄惁纭鍒犻櫎鎵�閫夋暟鎹」锛�').then(() => {
-    return api(deleteIds);
-  }).then(() => {
-    proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
-    handleQuery();
-  }).catch(() => {});
+
+  proxy.$modal
+    .confirm("鏄惁纭鍒犻櫎鎵�閫夋暟鎹」锛�")
+    .then(() => {
+      return delTimingTask(deleteIds);
+    })
+    .then(() => {
+      proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+      handleQuery();
+    })
+    .catch(() => { });
+};
+
+// 鍚敤/鍋滅敤鍒囨崲
+const handleToggleActive = async (row) => {
+  const newStatus = row.isActive === true || row.isActive === 1 ? 0 : 1;
+  const actionText = newStatus === 1 ? "鍚敤" : "鍋滅敤";
+
+  try {
+    await proxy.$modal.confirm(`鏄惁纭${actionText}璇ヤ换鍔★紵`)
+  } catch {
+    return
+  }
+
+  try {
+    await addOrEditTimingTask({
+      id: row.id,
+      taskId: row.taskId,
+      taskName: row.taskName,
+      inspectorIds: row.inspectorIds,
+      remarks: row.remarks,
+      frequencyType: row.frequencyType,
+      frequencyDetail: row.frequencyDetail,
+      isActive: newStatus,
+    })
+    proxy.$modal.msgSuccess(`${actionText}鎴愬姛`)
+    handleQuery()
+  } catch (error) {
+    console.error(`${actionText}澶辫触:`, error)
+  }
 };
 
 // 澶氶�夊彉鏇�
-const handleSelectionChange = (selection) => {
+const handleSelectionChange = selection => {
   selectedRows.value = selection;
 };
+
+// 瀵煎嚭
+const handleOut = () => {
+  ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+    confirmButtonText: "纭",
+    cancelButtonText: "鍙栨秷",
+    type: "warning",
+  })
+    .then(() => {
+      // 鏍规嵁褰撳墠閫変腑鐨勬爣绛鹃〉璋冪敤涓嶅悓鐨勫鍑烘帴鍙�
+      if (activeRadio.value === "taskManage") {
+        // 淇濆吇浠诲姟绠$悊
+        proxy.download("/timingTask/export", {}, "淇濆吇浠诲姟绠$悊.xlsx");
+      } else if (activeRadio.value === "task") {
+        // 瀹氭椂浠诲姟璁板綍
+        proxy.download("/inspectionTask/export", {}, "淇濆吇浠诲姟璁板綍.xlsx");
+      }
+    })
+    .catch(() => {
+      proxy.$modal.msg("宸插彇娑�");
+    });
+};
 </script>
 
 <style scoped>

--
Gitblit v1.9.3