| | |
| | | <div class="app-container"> |
| | | <el-tabs v-model="activeTab" |
| | | @tab-change="handleTabChange"> |
| | | <!-- 定时任务管理tab --> |
| | | <el-tab-pane label="定时任务管理" |
| | | <!-- 保养任务tab --> |
| | | <el-tab-pane label="保养任务" |
| | | name="scheduled"> |
| | | <div class="search_form"> |
| | | <el-form :model="scheduledFilters" |
| | |
| | | <div class="table_list"> |
| | | <div class="actions"> |
| | | <el-text class="mx-1" |
| | | size="large">定时任务管理</el-text> |
| | | size="large">保养任务</el-text> |
| | | <div> |
| | | <el-button type="primary" |
| | | icon="Plus" |
| | |
| | | }" |
| | | @selection-change="handleScheduledSelectionChange" |
| | | @pagination="changeScheduledPage"> |
| | | <template #isActiveRef="{ row }"> |
| | | <el-tag v-if="row.isActive === 1" |
| | | type="success">开启</el-tag> |
| | | <el-tag v-else |
| | | type="info">关闭</el-tag> |
| | | </template> |
| | | <template #statusRef="{ row }"> |
| | | <el-tag v-if="row.status === 1" |
| | | type="success">启用</el-tag> |
| | |
| | | type="danger">停用</el-tag> |
| | | </template> |
| | | <template #operation="{ row }"> |
| | | <el-button type="primary" |
| | | link |
| | | @click="handleDetail(row)"> |
| | | 详情 |
| | | </el-button> |
| | | <el-button type="primary" |
| | | link |
| | | @click="editScheduledTask(row)"> |
| | |
| | | </PIMTable> |
| | | </div> |
| | | </el-tab-pane> |
| | | <!-- 任务记录tab(原设备保养页面) --> |
| | | <el-tab-pane label="任务记录" |
| | | <!-- 保养记录tab(原设备保养页面) --> |
| | | <el-tab-pane label="保养记录" |
| | | name="record"> |
| | | <div class="search_form"> |
| | | <el-form :model="filters" |
| | |
| | | <div class="table_list"> |
| | | <div class="actions"> |
| | | <el-text class="mx-1" |
| | | size="large">任务记录</el-text> |
| | | size="large">保养记录</el-text> |
| | | <div> |
| | | <el-button type="success" |
| | | icon="Van" |
| | |
| | | type="warning">待保养</el-tag> |
| | | </template> |
| | | <template #operation="{ row }"> |
| | | <el-button type="primary" |
| | | link |
| | | @click="handleRecordDetail(row)"> |
| | | 详情 |
| | | </el-button> |
| | | <!-- 这个功能跟新增保养功能一模一样,有啥意义? --> |
| | | <!-- <el-button |
| | | type="primary" |
| | |
| | | @ok="getTableData" /> |
| | | <FormDia ref="formDiaRef" |
| | | @closeDia="getScheduledTableData" /> |
| | | <DetailDia ref="detailDiaRef" /> |
| | | <RecordDetailDia ref="recordDetailDiaRef" /> |
| | | <FileList v-if="fileDialogVisible" |
| | | v-model:visible="fileDialogVisible" |
| | | :record-type="'device_maintenance'" |
| | |
| | | import PlanModal from "./Form/PlanModal.vue"; |
| | | import MaintenanceModal from "./Form/MaintenanceModal.vue"; |
| | | import FormDia from "./Form/formDia.vue"; |
| | | import DetailDia from "./Form/detailDia.vue"; |
| | | import RecordDetailDia from "./Form/RecordDetailDia.vue"; |
| | | import { |
| | | getUpkeepPage, |
| | | delUpkeep, |
| | |
| | | const maintainModalRef = ref(); |
| | | // 定时任务弹窗控制器 |
| | | const formDiaRef = ref(); |
| | | // 定时任务详情弹窗控制器 |
| | | const detailDiaRef = ref(); |
| | | // 保养记录详情弹窗控制器 |
| | | const recordDetailDiaRef = ref(); |
| | | // 附件弹窗 |
| | | const fileListDialogRef = ref(null); |
| | | const fileDialogVisible = ref(false); |
| | | const currentMaintenanceTaskId = ref(null); |
| | | |
| | | // 任务记录tab(原设备保养页面)相关变量 |
| | | // 保养记录tab(原设备保养页面)相关变量 |
| | | const filters = reactive({ |
| | | deviceName: "", |
| | | maintenancePlanTime: "", |
| | |
| | | }); |
| | | const multipleList = ref([]); |
| | | |
| | | // 定时任务管理tab相关变量 |
| | | // 保养任务tab相关变量 |
| | | const scheduledFilters = reactive({ |
| | | taskName: "", |
| | | status: "", |
| | |
| | | }); |
| | | const scheduledMultipleList = ref([]); |
| | | |
| | | // 定时任务管理表格列配置 |
| | | // 保养任务表格列配置 |
| | | const scheduledColumns = ref([ |
| | | { prop: "taskName", label: "设备名称" }, |
| | | { |
| | |
| | | { |
| | | prop: "frequencyType", |
| | | label: "频次", |
| | | minWidth: 150, |
| | | minWidth: 80, |
| | | // PIMTable 使用的是 formatData,而不是 Element-Plus 的 formatter |
| | | formatData: cell => |
| | | ({ |
| | |
| | | { |
| | | prop: "frequencyDetail", |
| | | label: "开始日期与时间", |
| | | minWidth: 150, |
| | | minWidth: 130, |
| | | // 同样改用 formatData,PIMTable 内部会把单元格值传进来 |
| | | formatData: cell => { |
| | | if (typeof cell !== "string") return ""; |
| | |
| | | ); |
| | | }, |
| | | }, |
| | | { |
| | | prop: "isActive", |
| | | label: "定时任务", |
| | | dataType: "slot", |
| | | slot: "isActiveRef", |
| | | align: "center", |
| | | minWidth: 100, |
| | | }, |
| | | { prop: "maintenancePerson", label: "保养人", minWidth: 100 }, |
| | | { prop: "registrant", label: "登记人", minWidth: 100 }, |
| | | { prop: "registrationDate", label: "登记日期", minWidth: 100 }, |
| | | { |
| | | prop: "registrationDate", |
| | | label: "登记日期", |
| | | minWidth: 100, |
| | | formatData: cell => |
| | | cell ? dayjs(cell).format("YYYY-MM-DD") : "-", |
| | | }, |
| | | { |
| | | fixed: "right", |
| | | label: "操作", |
| | | dataType: "slot", |
| | | slot: "operation", |
| | | align: "center", |
| | | width: "200px", |
| | | width: "160px", |
| | | }, |
| | | ]); |
| | | |
| | | // 任务记录表格列配置(原设备保养表格列) |
| | | // 保养记录表格列配置(原设备保养表格列) |
| | | const columns = ref([ |
| | | { |
| | | label: "设备名称", |
| | |
| | | label: "计划保养日期", |
| | | align: "center", |
| | | prop: "maintenancePlanTime", |
| | | formatData: cell => dayjs(cell).format("YYYY-MM-DD"), |
| | | formatData: cell => { |
| | | return cell == null ? "-" : dayjs(cell).format("YYYY-MM-DD"); |
| | | }, |
| | | }, |
| | | { |
| | | label: "录入人", |
| | |
| | | align: "center", |
| | | prop: "maintenanceActuallyTime", |
| | | formatData: cell => |
| | | cell ? dayjs(cell).format("YYYY-MM-DD HH:mm:ss") : "-", |
| | | cell ? dayjs(cell).format("YYYY-MM-DD") : "-", |
| | | }, |
| | | { |
| | | label: "保养结果", |
| | |
| | | dataType: "slot", |
| | | slot: "operation", |
| | | align: "center", |
| | | width: "350px", |
| | | width: "250px", |
| | | }, |
| | | ]); |
| | | |
| | |
| | | } |
| | | }; |
| | | |
| | | // 定时任务管理相关方法 |
| | | // 保养任务相关方法 |
| | | const getScheduledTableData = async () => { |
| | | try { |
| | | const params = { |
| | |
| | | } |
| | | }; |
| | | |
| | | const handleDetail = row => { |
| | | if (row) { |
| | | nextTick(() => { |
| | | detailDiaRef.value?.openDialog(row); |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | const delScheduledTaskByIds = async ids => { |
| | | try { |
| | | await ElMessageBox.confirm("确定删除选中的定时任务吗?", "提示", { |
| | |
| | | ElMessage.info("导出定时任务功能待实现"); |
| | | }; |
| | | |
| | | // 任务记录相关方法(原设备保养页面方法) |
| | | // 保养记录相关方法(原设备保养页面方法) |
| | | const getTableData = async () => { |
| | | try { |
| | | const params = { |
| | |
| | | maintainModalRef.value.open(row.id, row); |
| | | }; |
| | | |
| | | const handleRecordDetail = row => { |
| | | if (row) { |
| | | nextTick(() => { |
| | | recordDetailDiaRef.value?.openDialog(row); |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | const addPlan = () => { |
| | | planModalRef.value.openModal(); |
| | | }; |