<template>
|
<FormDialog
|
v-model="dialogVisitable"
|
title="保养任务详情"
|
width="800px"
|
operation-type="detail"
|
@close="cancel"
|
>
|
<el-descriptions border :column="2">
|
<el-descriptions-item label="设备名称">
|
{{ detailData.taskName || '--' }}
|
</el-descriptions-item>
|
<el-descriptions-item label="规格型号">
|
{{ detailData.deviceModel || '--' }}
|
</el-descriptions-item>
|
<el-descriptions-item label="录入人">
|
{{ detailData.registrant || '--' }}
|
</el-descriptions-item>
|
<el-descriptions-item label="登记时间">
|
{{ detailData.registrationDate || '--' }}
|
</el-descriptions-item>
|
<el-descriptions-item label="保养项目" :span="2">
|
{{ detailData.machineryCategory || '--' }}
|
</el-descriptions-item>
|
<el-descriptions-item label="保养人">
|
{{ detailData.maintenancePerson || '--' }}
|
</el-descriptions-item>
|
<el-descriptions-item label="任务频率">
|
{{ formatFrequencyType(detailData.frequencyType) }}
|
</el-descriptions-item>
|
<el-descriptions-item label="执行时间">
|
{{ formatFrequencyDetail(detailData.frequencyDetail) }}
|
</el-descriptions-item>
|
<el-descriptions-item label="定时任务">
|
<el-tag :type="detailData.isActive === 1 ? 'success' : 'info'">
|
{{ detailData.isActive === 1 ? '开启' : '关闭' }}
|
</el-tag>
|
</el-descriptions-item>
|
<el-descriptions-item label="备注" :span="2">
|
{{ detailData.remarks || '--' }}
|
</el-descriptions-item>
|
</el-descriptions>
|
|
<div v-if="fileList && fileList.length > 0" class="image-section">
|
<div class="image-title">设备图片:</div>
|
<AttachmentUploadImage
|
v-model:fileList="fileList"
|
:disabled="true"
|
/>
|
</div>
|
</FormDialog>
|
</template>
|
|
<script setup>
|
import FormDialog from "@/components/Dialog/FormDialog.vue";
|
import { ref } from "vue";
|
import { getLedgerById } from "@/api/equipmentManagement/ledger";
|
import AttachmentUploadImage from '@/components/AttachmentUpload/image/index.vue';
|
|
const dialogVisitable = ref(false);
|
const detailData = ref({});
|
const fileList = ref([]);
|
|
const formatFrequencyType = (type) => {
|
const map = {
|
DAILY: "每日",
|
WEEKLY: "每周",
|
MONTHLY: "每月",
|
QUARTERLY: "季度",
|
};
|
return map[type] || "--";
|
};
|
|
const formatFrequencyDetail = (detail) => {
|
if (!detail) return "--";
|
const replacements = {
|
MON: "周一",
|
TUE: "周二",
|
WED: "周三",
|
THU: "周四",
|
FRI: "周五",
|
SAT: "周六",
|
SUN: "周日",
|
};
|
return detail.replace(/MON|TUE|WED|THU|FRI|SAT|SUN/g, match => replacements[match]);
|
};
|
|
const openDialog = (row) => {
|
dialogVisitable.value = true;
|
detailData.value = { ...row };
|
fileList.value = [];
|
|
if (row.taskId) {
|
getLedgerById(row.taskId).then(res => {
|
if (res.code === 200 && res.data) {
|
fileList.value = res.data.storageBlobVOs || [];
|
}
|
});
|
}
|
};
|
|
const cancel = () => {
|
dialogVisitable.value = false;
|
};
|
|
defineExpose({ openDialog });
|
</script>
|
|
<style scoped>
|
.image-section {
|
margin-top: 20px;
|
}
|
.image-title {
|
font-weight: bold;
|
margin-bottom: 10px;
|
color: #606266;
|
}
|
</style>
|