From 0a251e40e30e7c8a96d71b3b9b6c459d4dfa4b22 Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期三, 08 七月 2026 23:04:45 +0800
Subject: [PATCH] 暂存
---
src/views/equipmentManagement/upkeep/index.vue | 70 +++++++++++++++++++++++++++++++---
1 files changed, 63 insertions(+), 7 deletions(-)
diff --git a/src/views/equipmentManagement/upkeep/index.vue b/src/views/equipmentManagement/upkeep/index.vue
index c22ebcc..cd1adff 100644
--- a/src/views/equipmentManagement/upkeep/index.vue
+++ b/src/views/equipmentManagement/upkeep/index.vue
@@ -63,6 +63,12 @@
}"
@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>
@@ -70,6 +76,11 @@
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)">
@@ -171,6 +182,11 @@
type="warning">寰呬繚鍏�</el-tag>
</template>
<template #operation="{ row }">
+ <el-button type="primary"
+ link
+ @click="handleRecordDetail(row)">
+ 璇︽儏
+ </el-button>
<!-- 杩欎釜鍔熻兘璺熸柊澧炰繚鍏诲姛鑳戒竴妯′竴鏍凤紝鏈夊暐鎰忎箟锛� -->
<!-- <el-button
type="primary"
@@ -213,6 +229,8 @@
@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'"
@@ -235,6 +253,8 @@
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,
@@ -257,6 +277,10 @@
const maintainModalRef = ref();
// 瀹氭椂浠诲姟寮圭獥鎺у埗鍣�
const formDiaRef = ref();
+ // 瀹氭椂浠诲姟璇︽儏寮圭獥鎺у埗鍣�
+ const detailDiaRef = ref();
+ // 淇濆吇璁板綍璇︽儏寮圭獥鎺у埗鍣�
+ const recordDetailDiaRef = ref();
// 闄勪欢寮圭獥
const fileListDialogRef = ref(null);
const fileDialogVisible = ref(false);
@@ -308,7 +332,7 @@
{
prop: "frequencyType",
label: "棰戞",
- minWidth: 150,
+ minWidth: 80,
// PIMTable 浣跨敤鐨勬槸 formatData锛岃�屼笉鏄� Element-Plus 鐨� formatter
formatData: cell =>
({
@@ -321,7 +345,7 @@
{
prop: "frequencyDetail",
label: "寮�濮嬫棩鏈熶笌鏃堕棿",
- minWidth: 150,
+ minWidth: 130,
// 鍚屾牱鏀圭敤 formatData锛孭IMTable 鍐呴儴浼氭妸鍗曞厓鏍煎�间紶杩涙潵
formatData: cell => {
if (typeof cell !== "string") return "";
@@ -342,16 +366,30 @@
);
},
},
+ {
+ 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",
},
]);
@@ -371,7 +409,9 @@
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: "褰曞叆浜�",
@@ -401,7 +441,7 @@
align: "center",
prop: "maintenanceActuallyTime",
formatData: cell =>
- cell ? dayjs(cell).format("YYYY-MM-DD HH:mm:ss") : "-",
+ cell ? dayjs(cell).format("YYYY-MM-DD") : "-",
},
{
label: "淇濆吇缁撴灉",
@@ -423,7 +463,7 @@
dataType: "slot",
slot: "operation",
align: "center",
- width: "350px",
+ width: "250px",
},
]);
@@ -481,6 +521,14 @@
if (row) {
nextTick(() => {
formDiaRef.value?.openDialog("edit", row);
+ });
+ }
+ };
+
+ const handleDetail = row => {
+ if (row) {
+ nextTick(() => {
+ detailDiaRef.value?.openDialog(row);
});
}
};
@@ -556,6 +604,14 @@
maintainModalRef.value.open(row.id, row);
};
+ const handleRecordDetail = row => {
+ if (row) {
+ nextTick(() => {
+ recordDetailDiaRef.value?.openDialog(row);
+ });
+ }
+ };
+
const addPlan = () => {
planModalRef.value.openModal();
};
--
Gitblit v1.9.3