<template>
|
<FormDialog
|
v-model="dialogVisitable"
|
title="保养记录详情"
|
width="800px"
|
operation-type="detail"
|
@close="cancel"
|
>
|
<el-descriptions border :column="2">
|
<el-descriptions-item label="设备名称">
|
{{ detailData.deviceName || '--' }}
|
</el-descriptions-item>
|
<el-descriptions-item label="规格型号">
|
{{ detailData.deviceModel || '--' }}
|
</el-descriptions-item>
|
<el-descriptions-item label="计划保养日期">
|
{{ formatDate(detailData.maintenancePlanTime) }}
|
</el-descriptions-item>
|
<el-descriptions-item label="录入人">
|
{{ detailData.createUserName || '--' }}
|
</el-descriptions-item>
|
<el-descriptions-item label="保养项目" :span="2">
|
{{ detailData.machineryCategory || '--' }}
|
</el-descriptions-item>
|
<el-descriptions-item label="实际保养人">
|
{{ detailData.maintenanceActuallyName || '--' }}
|
</el-descriptions-item>
|
<el-descriptions-item label="实际保养日期">
|
{{ formatDate(detailData.maintenanceActuallyTime) }}
|
</el-descriptions-item>
|
<el-descriptions-item label="保养结果" :span="2">
|
{{ detailData.maintenanceResult || '--' }}
|
</el-descriptions-item>
|
<el-descriptions-item label="状态" :span="2">
|
<el-tag v-if="detailData.status === 2" type="danger">失败</el-tag>
|
<el-tag v-else-if="detailData.status === 1" type="success">完结</el-tag>
|
<el-tag v-else type="warning">待保养</el-tag>
|
</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 dayjs from "dayjs";
|
import { attachmentList } from "@/api/basicData/storageAttachment.js";
|
import AttachmentUploadImage from '@/components/AttachmentUpload/image/index.vue';
|
|
const dialogVisitable = ref(false);
|
const detailData = ref({});
|
const fileList = ref([]);
|
|
const formatDate = (date) => {
|
return date ? dayjs(date).format("YYYY-MM-DD") : "--";
|
};
|
|
const openDialog = (row) => {
|
dialogVisitable.value = true;
|
detailData.value = { ...row };
|
fileList.value = [];
|
|
if (row.id) {
|
attachmentList({
|
recordType: 'device_maintenance',
|
recordId: row.id,
|
}).then(res => {
|
if (res && res.data) {
|
fileList.value = res.data || [];
|
}
|
});
|
}
|
};
|
|
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>
|