From 4da40604690325917d208e386e3add022f181147 Mon Sep 17 00:00:00 2001
From: 周宾 <2802492122@qq.com>
Date: 星期一, 08 十二月 2025 15:35:47 +0800
Subject: [PATCH] 修改设备管理选择设备时可搜索

---
 src/views/equipmentManagement/upkeep/index.vue |   50 ++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 36 insertions(+), 14 deletions(-)

diff --git a/src/views/equipmentManagement/upkeep/index.vue b/src/views/equipmentManagement/upkeep/index.vue
index 7183964..2659ae0 100644
--- a/src/views/equipmentManagement/upkeep/index.vue
+++ b/src/views/equipmentManagement/upkeep/index.vue
@@ -7,7 +7,6 @@
             style="width: 240px"
             placeholder="璇疯緭鍏ヨ澶囧悕绉�"
             clearable
-            :prefix-icon="Search"
             @change="getTableData"
         />
       </el-form-item>
@@ -35,7 +34,6 @@
             style="width: 240px"
             placeholder="璇疯緭鍏ュ疄闄呬繚鍏讳汉"
             clearable
-            :prefix-icon="Search"
             @change="getTableData"
         />
       </el-form-item>
@@ -48,6 +46,9 @@
       <div class="actions">
         <el-text class="mx-1" size="large">璁惧淇濆吇</el-text>
         <div>
+					<el-button type="success" icon="Van" @click="addPlan">
+						鏂板璁″垝
+					</el-button>
           <el-button
             type="primary"
             icon="Plus"
@@ -56,8 +57,8 @@
           >
             鏂板淇濆吇
           </el-button>
-          <el-button type="success" icon="Van" @click="addPlan">
-            鏂板璁″垝
+          <el-button @click="handleOut">
+            瀵煎嚭
           </el-button>
           <el-button
             type="danger"
@@ -97,16 +98,14 @@
         <template #operation="{ row }">
           <el-button
             type="primary"
-            text
-            icon="editPen"
+            link
             @click="editPlan(row.id)"
           >
             缂栬緫
           </el-button>
           <el-button
             type="danger"
-            text
-            icon="delete"
+						link
             @click="delRepairByIds(row.id)"
           >
             鍒犻櫎
@@ -122,7 +121,7 @@
 <script setup>
 import { usePaginationApi } from "@/hooks/usePaginationApi";
 import { getUpkeepPage, delUpkeep } from "@/api/equipmentManagement/upkeep";
-import { onMounted } from "vue";
+import { onMounted, getCurrentInstance } from "vue";
 import PlanModal from "./Modal/PlanModal.vue";
 import MaintenanceModal from "./Modal/MaintenanceModal.vue";
 import dayjs from "dayjs";
@@ -131,6 +130,8 @@
 defineOptions({
   name: "璁惧淇濆吇",
 });
+
+const { proxy } = getCurrentInstance();
 
 // 璁″垝寮圭獥鎺у埗鍣�
 const planModalRef = ref();
@@ -154,7 +155,12 @@
   getTableData,
   resetFilters,
   onCurrentChange,
-} = usePaginationApi(getUpkeepPage, {}, [
+} = usePaginationApi(getUpkeepPage, {
+  deviceName: undefined,
+  maintenancePlanTime: undefined,
+  maintenanceActuallyTime: undefined,
+  maintenanceActuallyName: undefined,
+}, [
   {
     label: "璁惧鍚嶇О",
     align: "center",
@@ -215,7 +221,7 @@
     dataType: "slot",
     slot: "operation",
     align: "center",
-    width: "200px",
+    width: "150px",
   },
 ]);
 // type == 1瀹為檯淇濆吇鏃堕棿 2璁″垝淇濆吇鏃堕棿
@@ -250,9 +256,10 @@
   planModalRef.value.openEdit(id);
 };
 
-const changePage = ({ page }) => {
-  pagination.currentPage = page;
-  onCurrentChange(page);
+const changePage = ({ page, limit }) => {
+	pagination.currentPage = page;
+	pagination.pageSize = limit;
+	onCurrentChange(page);
 };
 
 // 鍗曡鍒犻櫎
@@ -270,6 +277,21 @@
   });
 };
 
+// 瀵煎嚭
+const handleOut = () => {
+  ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+    confirmButtonText: "纭",
+    cancelButtonText: "鍙栨秷",
+    type: "warning",
+  })
+    .then(() => {
+      proxy.download("/device/maintenance/export", {}, "璁惧淇濆吇.xlsx");
+    })
+    .catch(() => {
+      ElMessage.info("宸插彇娑�");
+    });
+};
+
 onMounted(() => {
   getTableData();
 });

--
Gitblit v1.9.3