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();
});