| | |
| | | style="width: 240px" |
| | | placeholder="请输入设备名称" |
| | | clearable |
| | | :prefix-icon="Search" |
| | | @change="getTableData" |
| | | /> |
| | | </el-form-item> |
| | |
| | | style="width: 240px" |
| | | placeholder="请输入实际保养人" |
| | | clearable |
| | | :prefix-icon="Search" |
| | | @change="getTableData" |
| | | /> |
| | | </el-form-item> |
| | |
| | | <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" |
| | |
| | | > |
| | | 新增保养 |
| | | </el-button> |
| | | <el-button type="success" icon="Van" @click="addPlan"> |
| | | 新增计划 |
| | | <el-button @click="handleOut"> |
| | | 导出 |
| | | </el-button> |
| | | <el-button |
| | | type="danger" |
| | |
| | | <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)" |
| | | > |
| | | 删除 |
| | |
| | | <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"; |
| | |
| | | defineOptions({ |
| | | name: "设备保养", |
| | | }); |
| | | |
| | | const { proxy } = getCurrentInstance(); |
| | | |
| | | // 计划弹窗控制器 |
| | | const planModalRef = ref(); |
| | |
| | | getTableData, |
| | | resetFilters, |
| | | onCurrentChange, |
| | | } = usePaginationApi(getUpkeepPage, {}, [ |
| | | } = usePaginationApi(getUpkeepPage, { |
| | | deviceName: undefined, |
| | | maintenancePlanTime: undefined, |
| | | maintenanceActuallyTime: undefined, |
| | | maintenanceActuallyName: undefined, |
| | | }, [ |
| | | { |
| | | label: "设备名称", |
| | | align: "center", |
| | |
| | | dataType: "slot", |
| | | slot: "operation", |
| | | align: "center", |
| | | width: "200px", |
| | | width: "150px", |
| | | }, |
| | | ]); |
| | | // type == 1实际保养时间 2计划保养时间 |
| | |
| | | planModalRef.value.openEdit(id); |
| | | }; |
| | | |
| | | const changePage = ({ page }) => { |
| | | pagination.currentPage = page; |
| | | onCurrentChange(page); |
| | | const changePage = ({ page, limit }) => { |
| | | pagination.currentPage = page; |
| | | pagination.pageSize = limit; |
| | | onCurrentChange(page); |
| | | }; |
| | | |
| | | // 单行删除 |
| | |
| | | }); |
| | | }; |
| | | |
| | | // 导出 |
| | | const handleOut = () => { |
| | | ElMessageBox.confirm("选中的内容将被导出,是否确认导出?", "导出", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | proxy.download("/device/maintenance/export", {}, "设备保养.xlsx"); |
| | | }) |
| | | .catch(() => { |
| | | ElMessage.info("已取消"); |
| | | }); |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | getTableData(); |
| | | }); |