From f49bfd6c085cbf28a25d9404f8dc5b74368b716a Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期五, 29 五月 2026 15:54:02 +0800
Subject: [PATCH] 新疆马铃薯 1.代码更新

---
 src/views/equipmentManagement/repair/index.vue |  463 +++++++++++++++++++++++++++------------------------------
 1 files changed, 221 insertions(+), 242 deletions(-)

diff --git a/src/views/equipmentManagement/repair/index.vue b/src/views/equipmentManagement/repair/index.vue
index f1573cb..1699cff 100644
--- a/src/views/equipmentManagement/repair/index.vue
+++ b/src/views/equipmentManagement/repair/index.vue
@@ -1,195 +1,168 @@
 <template>
   <div class="app-container">
-    <el-form :model="filters"
-             :inline="true">
+    <el-form :model="filters" :inline="true">
       <el-form-item label="璁惧鍚嶇О">
-        <el-input v-model="filters.deviceName"
-                  style="width: 240px"
-                  placeholder="璇疯緭鍏ヨ澶囧悕绉�"
-                  clearable
-                  :prefix-icon="Search"
-                  @change="getTableData" />
+        <el-input
+            v-model="filters.deviceName"
+            style="width: 240px"
+            placeholder="璇疯緭鍏ヨ澶囧悕绉�"
+            clearable
+            @change="getTableData"
+        />
       </el-form-item>
       <el-form-item label="瑙勬牸鍨嬪彿">
-        <el-input v-model="filters.deviceModel"
-                  style="width: 240px"
-                  placeholder="璇烽�夋嫨瑙勬牸鍨嬪彿"
-                  clearable
-                  :prefix-icon="Search"
-                  @change="getTableData" />
+        <el-input
+            v-model="filters.deviceModel"
+            style="width: 240px"
+            placeholder="璇烽�夋嫨瑙勬牸鍨嬪彿"
+            clearable
+            @change="getTableData"
+        />
       </el-form-item>
       <el-form-item label="鏁呴殰鐜拌薄">
-        <el-input v-model="filters.remark"
-                  style="width: 240px"
-                  placeholder="璇疯緭鍏ユ晠闅滅幇璞�"
-                  clearable
-                  :prefix-icon="Search"
-                  @change="getTableData" />
+        <el-input
+            v-model="filters.remark"
+            style="width: 240px"
+            placeholder="璇疯緭鍏ユ晠闅滅幇璞�"
+            clearable
+            @change="getTableData"
+        />
       </el-form-item>
       <el-form-item label="缁翠慨浜�">
-        <el-input v-model="filters.maintenanceName"
-                  style="width: 240px"
-                  placeholder="璇疯緭鍏ョ淮淇汉"
-                  clearable
-                  :prefix-icon="Search"
-                  @change="getTableData" />
+        <el-input
+            v-model="filters.maintenanceName"
+            style="width: 240px"
+            placeholder="璇疯緭鍏ョ淮淇汉"
+            clearable
+            @change="getTableData"
+        />
       </el-form-item>
       <el-form-item label="鎶ヤ慨鏃ユ湡">
-        <el-date-picker v-model="filters.repairTimeStr"
-                        type="date"
-                        placeholder="璇烽�夋嫨鎶ヤ慨鏃ユ湡"
-                        size="default"
-                        @change="(date) => handleDateChange(date,2)" />
+        <el-date-picker
+            v-model="filters.repairTimeStr"
+            type="date"
+            placeholder="璇烽�夋嫨鎶ヤ慨鏃ユ湡"
+            size="default"
+            @change="(date) => handleDateChange(date,2)"
+        />
       </el-form-item>
       <el-form-item label="缁翠慨鏃ユ湡">
-        <el-date-picker v-model="filters.maintenanceTimeStr"
-                        type="date"
-                        placeholder="璇烽�夋嫨缁翠慨鏃ユ湡"
-                        size="default"
-                        @change="(date) => handleDateChange(date,1)" />
+        <el-date-picker
+            v-model="filters.maintenanceTimeStr"
+            type="date"
+            placeholder="璇烽�夋嫨缁翠慨鏃ユ湡"
+            size="default"
+            @change="(date) => handleDateChange(date,1)"
+        />
       </el-form-item>
       <el-form-item>
-        <el-button type="primary"
-                   @click="getTableData">鎼滅储</el-button>
+        <el-button type="primary" @click="getTableData">鎼滅储</el-button>
         <el-button @click="resetFilters">閲嶇疆</el-button>
       </el-form-item>
     </el-form>
     <div class="table_list">
       <div class="actions">
-        <el-text class="mx-1"
-                 size="large">璁惧鎶ヤ慨</el-text>
+        <el-text class="mx-1" size="large">璁惧鎶ヤ慨</el-text>
         <div>
-          <el-button type="success"
-                     icon="Van"
-                     @click="addRepair">
+          <el-button type="success" icon="Van" @click="addRepair">
             鏂板鎶ヤ慨
           </el-button>
           <el-button @click="handleOut">
             瀵煎嚭
           </el-button>
-          <el-button type="danger"
-                     icon="Delete"
-                     :disabled="multipleList.length <= 0 || hasFinishedStatus"
-                     @click="delRepairByIds(multipleList.map((item) => item.id))">
+          <el-button
+            type="danger"
+            icon="Delete"
+            :disabled="multipleList.length <= 0 || hasFinishedStatus"
+            @click="delRepairByIds(multipleList.map((item) => item.id))"
+          >
             鎵归噺鍒犻櫎
           </el-button>
         </div>
       </div>
-      <PIMTable rowKey="id"
-                isSelection
-                :column="columns"
-                :tableData="dataList"
-                :page="{
+      <PIMTable
+          rowKey="id"
+          isSelection
+          :column="columns"
+          :tableData="dataList"
+          :page="{
           current: pagination.currentPage,
           size: pagination.pageSize,
           total: pagination.total,
         }"
-                @selection-change="handleSelectionChange"
-                @pagination="changePage">
+          @selection-change="handleSelectionChange"
+          @pagination="changePage"
+      >
         <template #statusRef="{ row }">
-          <el-tag v-if="row.status === 2"
-                  type="danger">澶辫触</el-tag>
-          <el-tag v-if="row.status === 1"
-                  type="success">瀹岀粨</el-tag>
-          <el-tag v-if="row.status === 3"
-                  type="info">寰呴獙鏀�</el-tag>
-          <el-tag v-if="row.status === 0"
-                  type="warning">寰呯淮淇�</el-tag>
+          <el-tag v-if="row.status === 2" type="danger">澶辫触</el-tag>
+          <el-tag v-if="row.status === 1" type="success">瀹岀粨</el-tag>
+          <el-tag v-if="row.status === 0" type="warning">寰呯淮淇�</el-tag>
         </template>
         <template #operation="{ row }">
-          <el-button type="primary"
-                     link
-                     @click="viewRepair(row.id)">
-            璇︽儏
-          </el-button>
-          <el-button type="primary"
-                     link
-                     :disabled="row.status === 1 || row.status === 3"
-                     @click="editRepair(row.id)">
+          <el-button
+            type="primary"
+            link
+            :disabled="row.status === 1"
+            @click="editRepair(row.id)"
+          >
             缂栬緫
           </el-button>
-          <el-button type="success"
-                     link
-                     :disabled="row.status !== 0"
-                     @click="addMaintain(row)">
+          <el-button
+            type="success"
+            link
+            :disabled="row.status === 1"
+            @click="addMaintain(row)"
+          >
             缁翠慨
           </el-button>
-          <el-button type="warning"
-                     link
-                     :disabled="row.status !== 3"
-                     @click="openAcceptance(row)">
-            楠屾敹
-          </el-button>
-          <el-button type="danger"
-                     link
-                     :disabled="row.status === 1 || row.status === 3"
-                     @click="delRepairByIds(row.id)">
+          <el-button
+            type="danger"
+            link
+            :disabled="row.status === 1"
+            @click="delRepairByIds(row.id)"
+          >
             鍒犻櫎
-          </el-button>
-          <el-button type="primary"
-                     link
-                     @click="openFileDialog(row)">
-            闄勪欢
           </el-button>
         </template>
       </PIMTable>
     </div>
-    <RepairModal ref="repairModalRef"
-                 @ok="getTableData" />
-    <MaintainModal ref="maintainModalRef"
-                   @ok="getTableData" />
-    <AcceptanceModal ref="acceptanceModalRef"
-                     @ok="getTableData" />
-    <FileList v-if="fileDialogVisible"
-              v-model:visible="fileDialogVisible"
-              :record-type="'device_repair'"
-              :record-id="recordId" />
+    <RepairModal ref="repairModalRef" @ok="getTableData"/>
+    <MaintainModal ref="maintainModalRef" @ok="getTableData"/>
   </div>
 </template>
 
 <script setup>
-  import {
-    onMounted,
-    getCurrentInstance,
-    computed,
-    ref,
-    defineAsyncComponent,
-  } from "vue";
-  import { usePaginationApi } from "@/hooks/usePaginationApi";
-  import { getRepairPage, delRepair } from "@/api/equipmentManagement/repair";
-  import RepairModal from "./Modal/RepairModal.vue";
-  import { ElMessageBox, ElMessage } from "element-plus";
-  import dayjs from "dayjs";
-  import MaintainModal from "./Modal/MaintainModal.vue";
-  import AcceptanceModal from "./Modal/AcceptanceModal.vue";
-  const FileList = defineAsyncComponent(() =>
-    import("@/components/Dialog/FileList.vue")
-  );
+import { onMounted, getCurrentInstance, computed } from "vue";
+import {usePaginationApi} from "@/hooks/usePaginationApi";
+import {getRepairPage, delRepair} from "@/api/equipmentManagement/repair";
+import RepairModal from "./Modal/RepairModal.vue";
+import {ElMessageBox, ElMessage} from "element-plus";
+import dayjs from "dayjs";
+import MaintainModal from "./Modal/MaintainModal.vue";
 
-  defineOptions({
-    name: "璁惧鎶ヤ慨",
-  });
+defineOptions({
+  name: "璁惧鎶ヤ慨",
+});
 
-  const { proxy } = getCurrentInstance();
+const {proxy} = getCurrentInstance();
 
-  // 妯℃�佹瀹炰緥
-  const repairModalRef = ref();
-  const maintainModalRef = ref();
-  const acceptanceModalRef = ref();
+// 妯℃�佹瀹炰緥
+const repairModalRef = ref();
+const maintainModalRef = ref();
 
-  // 琛ㄦ牸澶氶�夋閫変腑椤�
-  const multipleList = ref([]);
+// 琛ㄦ牸澶氶�夋閫変腑椤�
+const multipleList = ref([]);
 
-  // 琛ㄦ牸閽╁瓙
-  const {
-    filters,
-    columns,
-    dataList,
-    pagination,
-    getTableData,
-    resetFilters,
-    onCurrentChange,
-  } = usePaginationApi(
+// 琛ㄦ牸閽╁瓙
+const {
+  filters,
+  columns,
+  dataList,
+  pagination,
+  getTableData,
+  resetFilters,
+  onCurrentChange,
+} = usePaginationApi(
     getRepairPage,
     {
       deviceName: undefined,
@@ -200,6 +173,10 @@
       maintenanceTimeStr: undefined,
     },
     [
+			{
+				label: "鎵�鍦ㄥ尯鍩�",
+				prop: "areaName",
+			},
       {
         label: "璁惧鍚嶇О",
         align: "center",
@@ -214,12 +191,33 @@
         label: "鎶ヤ慨鏃ユ湡",
         align: "center",
         prop: "repairTime",
-        formatData: cell => dayjs(cell).format("YYYY-MM-DD"),
+        formatData: (cell) => dayjs(cell).format("YYYY-MM-DD"),
       },
       {
         label: "鎶ヤ慨浜�",
         align: "center",
         prop: "repairName",
+      },
+      {
+        label: "鏁呴殰鐜拌薄",
+        align: "center",
+        prop: "remark",
+      },
+      {
+        label: "缁翠慨浜�",
+        align: "center",
+        prop: "maintenanceName",
+      },
+      {
+        label: "缁翠慨缁撴灉",
+        align: "center",
+        prop: "maintenanceResult",
+      },
+      {
+        label: "缁翠慨鏃ユ湡",
+        align: "center",
+        prop: "maintenanceTime",
+        formatData: (cell) => (cell ? dayjs(cell).format("YYYY-MM-DD") : ""),
       },
       {
         label: "鐘舵��",
@@ -234,132 +232,113 @@
         dataType: "slot",
         slot: "operation",
         align: "center",
-        width: "320px",
+        width: "300px",
       },
     ]
-  );
+);
 
-  // type === 1 缁翠慨 2鎶ヤ慨闂�
-  const handleDateChange = (value, type) => {
-    filters.maintenanceTimeStr = null;
-    filters.c = null;
-    if (type === 1) {
-      if (value) {
-        filters.maintenanceTimeStr = dayjs(value).format("YYYY-MM-DD");
-      }
-    } else {
-      if (value) {
-        filters.repairTimeStr = dayjs(value).format("YYYY-MM-DD");
-      }
+// type === 1 缁翠慨 2鎶ヤ慨闂�
+const handleDateChange = (value, type) => {
+  filters.maintenanceTimeStr = null
+  filters.c = null
+  if (type === 1) {
+    if (value) {
+      filters.maintenanceTimeStr = dayjs(value).format("YYYY-MM-DD");
     }
-    getTableData();
-  };
+  } else {
+    if (value) {
+      filters.repairTimeStr = dayjs(value).format("YYYY-MM-DD");
+    }
+  }
+  getTableData();
+};
 
-  // 鎵撳紑闄勪欢寮圭獥
-  const recordId = ref(0);
-  const fileDialogVisible = ref(false);
+// 澶氶�夊悗鍋氫粈涔�
+const handleSelectionChange = (selectionList) => {
+  multipleList.value = selectionList;
+};
 
-  const openFileDialog = async row => {
-    recordId.value = row.id;
-    fileDialogVisible.value = true;
-  };
+// 妫�鏌ラ�変腑鐨勮褰曚腑鏄惁鏈夊畬缁撶姸鎬佺殑
+const hasFinishedStatus = computed(() => {
+  return multipleList.value.some(item => item.status === 1)
+})
 
-  // 澶氶�夊悗鍋氫粈涔�
-  const handleSelectionChange = selectionList => {
-    multipleList.value = selectionList;
-  };
+// 鏂板鎶ヤ慨
+const addRepair = () => {
+  repairModalRef.value.openAdd();
+};
 
-  // 妫�鏌ラ�変腑鐨勮褰曚腑鏄惁鏈夊畬缁撶姸鎬佺殑
-  const hasFinishedStatus = computed(() => {
-    return multipleList.value.some(item => item.status === 1);
+// 缂栬緫鎶ヤ慨
+const editRepair = (id) => {
+  repairModalRef.value.openEdit(id);
+};
+
+// 鏂板缁翠慨
+const addMaintain = (row) => {
+  maintainModalRef.value.open(row.id, row);
+};
+
+const changePage = ({page, limit}) => {
+  pagination.currentPage = page;
+  pagination.pageSize = limit;
+  onCurrentChange(page);
+};
+
+// 鍗曡鍒犻櫎
+const delRepairByIds = async (ids) => {
+  // 妫�鏌ユ槸鍚︽湁瀹岀粨鐘舵�佺殑璁板綍
+  const idsArray = Array.isArray(ids) ? ids : [ids];
+  const hasFinished = idsArray.some(id => {
+    const record = dataList.value.find(item => item.id === id);
+    return record && record.status === 1;
   });
 
-  // 鏂板鎶ヤ慨
-  const addRepair = () => {
-    repairModalRef.value.openAdd();
-  };
+  if (hasFinished) {
+    ElMessage.warning('涓嶈兘鍒犻櫎鐘舵�佷负瀹岀粨鐨勮褰�');
+    return;
+  }
 
-  // 璇︽儏鏌ョ湅
-  const viewRepair = id => {
-    repairModalRef.value.openView(id);
-  };
-
-  // 缂栬緫鎶ヤ慨
-  const editRepair = id => {
-    repairModalRef.value.openEdit(id);
-  };
-
-  // 鏂板缁翠慨
-  const addMaintain = row => {
-    maintainModalRef.value.open(row.id, row);
-  };
-
-  // 鎵撳紑楠屾敹寮圭獥
-  const openAcceptance = row => {
-    acceptanceModalRef.value.open(row);
-  };
-
-  const changePage = ({ page, limit }) => {
-    pagination.currentPage = page;
-    pagination.pageSize = limit;
-    onCurrentChange(page);
-  };
-
-  // 鍗曡鍒犻櫎
-  const delRepairByIds = async ids => {
-    // 妫�鏌ユ槸鍚︽湁瀹岀粨鐘舵�佺殑璁板綍
-    const idsArray = Array.isArray(ids) ? ids : [ids];
-    const hasFinished = idsArray.some(id => {
-      const record = dataList.value.find(item => item.id === id);
-      return record && record.status === 1;
-    });
-
-    if (hasFinished) {
-      ElMessage.warning("涓嶈兘鍒犻櫎鐘舵�佷负瀹岀粨鐨勮褰�");
-      return;
+  ElMessageBox.confirm("纭鍒犻櫎鎶ヤ慨鏁版嵁, 姝ゆ搷浣滀笉鍙��?", "璀﹀憡", {
+    confirmButtonText: "纭畾",
+    cancelButtonText: "鍙栨秷",
+    type: "warning",
+  }).then(async () => {
+    const {code} = await delRepair(ids);
+    if (code === 200) {
+      ElMessage.success("鍒犻櫎鎴愬姛");
+      getTableData();
     }
+  });
+};
 
-    ElMessageBox.confirm("纭鍒犻櫎鎶ヤ慨鏁版嵁, 姝ゆ搷浣滀笉鍙��?", "璀﹀憡", {
-      confirmButtonText: "纭畾",
-      cancelButtonText: "鍙栨秷",
-      type: "warning",
-    }).then(async () => {
-      const { code } = await delRepair(ids);
-      if (code === 200) {
-        ElMessage.success("鍒犻櫎鎴愬姛");
-        getTableData();
-      }
-    });
-  };
-
-  // 瀵煎嚭
-  const handleOut = () => {
-    ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
-      confirmButtonText: "纭",
-      cancelButtonText: "鍙栨秷",
-      type: "warning",
-    })
+// 瀵煎嚭
+const handleOut = () => {
+  ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+    confirmButtonText: "纭",
+    cancelButtonText: "鍙栨秷",
+    type: "warning",
+  })
       .then(() => {
         proxy.download("/device/repair/export", {}, "璁惧鎶ヤ慨.xlsx");
       })
       .catch(() => {
         ElMessage.info("宸插彇娑�");
       });
-  };
+};
 
-  onMounted(() => {
-    getTableData();
-  });
+onMounted(() => {
+  getTableData();
+});
 </script>
 
 <style lang="scss" scoped>
-  .table_list {
-    margin-top: unset;
-  }
+.table_list {
+  margin-top: unset;
+}
 
-  .actions {
-    display: flex;
-    justify-content: space-between;
-    margin-bottom: 10px;
-  }
+.actions {
+  display: flex;
+  justify-content: space-between;
+  margin-bottom: 10px;
+}
 </style>

--
Gitblit v1.9.3