| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-dialog v-model="dialogVisible" |
| | | :title="dialogTitle" |
| | | width="1000px" |
| | | :close-on-click-modal="false" |
| | | custom-class="custom-dialog"> |
| | | <div class="detail-container"> |
| | | <!-- åºç¡ä¿¡æ¯ --> |
| | | <div class="detail-section"> |
| | | <h3 class="section-title">åºç¡ä¿¡æ¯</h3> |
| | | <el-descriptions :column="3" |
| | | border> |
| | | <el-descriptions-item label="ç产订åå·">{{ detailData.npsNo || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="çç»"><el-tag :type="detailData.schedule == 'ç½ç' ? 'primary' : 'warning'">{{ detailData.schedule || '-' }}</el-tag></el-descriptions-item> |
| | | <el-descriptions-item label="å²ä½äººå">{{ detailData.postName || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="产åç¼ç ">{{ detailData.materialCode || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="产ååç§°">{{ detailData.productName || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="è§æ ¼">{{ detailData.model || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="åæ ¼æ°é"><span class="num2">{{ detailData.qualifiedQuantity || 0 }}</span> <span class="unit">æ¹</span></el-descriptions-item> |
| | | <el-descriptions-item label="ä¸åæ ¼æ°é"><span class="num3">{{ detailData.unqualifiedQuantity || 0 }}</span> <span class="unit">æ¹</span></el-descriptions-item> |
| | | <el-descriptions-item label="æ»æ°é"><span class="num1">{{ detailData.quantity || 0 }}</span> <span class="unit">æ¹</span></el-descriptions-item> |
| | | <el-descriptions-item label="æ¥å·¥æ¶é´">{{ formatTime(detailData.reportingTime) }}</el-descriptions-item> |
| | | <el-descriptions-item label="å建æ¶é´">{{ formatTime(detailData.createTime) }}</el-descriptions-item> |
| | | <el-descriptions-item label="æ´æ°æ¶é´">{{ formatTime(detailData.updateTime) }}</el-descriptions-item> |
| | | </el-descriptions> |
| | | </div> |
| | | <!-- å·¥åºä¿¡æ¯ --> |
| | | <div class="detail-section" |
| | | v-if="detailData.productionProductRouteItemDtoList && detailData.productionProductRouteItemDtoList.length > 0"> |
| | | <h3 class="section-title">å·¥åºä¿¡æ¯</h3> |
| | | <div v-for="(process, index) in detailData.productionProductRouteItemDtoList" |
| | | :key="process.id" |
| | | class="process-item"> |
| | | <div class="process-header"> |
| | | <h4 class="process-title">{{ process.processName || '-' }}</h4> |
| | | <div class="process-info"> |
| | | <span class="process-label">å²ä½äººåï¼{{ process.postName || '-' }}</span> |
| | | <span class="process-label">å·¥åºIDï¼{{ process.processNo || '-' }}</span> |
| | | </div> |
| | | </div> |
| | | <!-- å·¥åºåºæ¬ä¿¡æ¯ --> |
| | | <div class="process-details"> |
| | | <el-descriptions :column="2" |
| | | border> |
| | | <el-descriptions-item label="设å¤å¼å¸¸æ
åµ">{{ process.equipmentMalfunction || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="å½ç设å¤å¤ç½®">{{ process.equipmentDisposal || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="å·¥èºäººå交å¾
" |
| | | :span="2">{{ process.processExplained || '-' }}</el-descriptions-item> |
| | | </el-descriptions> |
| | | </div> |
| | | <!-- å·¥åºåæ° --> |
| | | <div v-if="process.productionProductRouteItemParamDtoList && process.productionProductRouteItemParamDtoList.length > 0"> |
| | | <!-- BOMä¿¡æ¯ --> |
| | | <div class="param-section" |
| | | v-if="getBomList(process.productionProductRouteItemParamDtoList).length > 0"> |
| | | <h5 class="param-title">æå
¥åä¿¡æ¯</h5> |
| | | <el-table :data="getBomList(process.productionProductRouteItemParamDtoList)" |
| | | style="width: 100%" |
| | | size="small"> |
| | | <el-table-column prop="paramName" |
| | | label="产ååç§°" |
| | | min-width="120"></el-table-column> |
| | | <el-table-column prop="model" |
| | | label="è§æ ¼åå·" |
| | | min-width="120"></el-table-column> |
| | | <el-table-column prop="productValue" |
| | | label="æå
¥é" |
| | | min-width="100"></el-table-column> |
| | | <el-table-column prop="unit" |
| | | label="åä½" |
| | | width="80"></el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <!-- åæ°ä¿¡æ¯ --> |
| | | <div class="param-section" |
| | | v-if="getParamList(process.productionProductRouteItemParamDtoList).length > 0"> |
| | | <h5 class="param-title">ç产记å½</h5> |
| | | <div v-for="(group, sort) in getParamGroups(process.productionProductRouteItemParamDtoList)" |
| | | :key="sort" |
| | | class="param-group"> |
| | | <div class="group-header"> |
| | | <span class="group-title">ç产记å½ç» {{ sort }}</span> |
| | | </div> |
| | | <div class="param-grid"> |
| | | <div v-for="param in group" |
| | | :key="param.id" |
| | | class="param-item"> |
| | | <span class="param-label">{{ param.paramName || '-' }}:</span> |
| | | <span class="param-value">{{ param.paramValue || '-' }}</span> |
| | | <span v-if="param.unit && param.unit !== '/'" |
| | | class="param-unit">{{ param.unit }}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- ä¸ä¼ æä»¶ --> |
| | | <div class="file-section" |
| | | v-if="process.fileList && process.fileList.length > 0"> |
| | | <h5 class="file-title">ä¸ä¼ æä»¶</h5> |
| | | <div class="file-grid"> |
| | | <div v-for="file in process.fileList" |
| | | :key="file.id" |
| | | class="file-item"> |
| | | <el-image style="width: 100px; height: 100px" |
| | | v-if="file.fileUrl" |
| | | :src="baseUrl + file.fileUrl" |
| | | :zoom-rate="1.2" |
| | | :max-scale="7" |
| | | :alt="file.fileName" |
| | | :min-scale="0.2" |
| | | :preview-src-list="formatFileList(process.fileList)" |
| | | show-progress |
| | | :initial-index="4" |
| | | fit="cover" /> |
| | | <div class="file-info"> |
| | | <span class="file-name">{{ file.fileName || '-' }}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button @click="dialogVisible = false">å
³é</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, computed, watch } from "vue"; |
| | | import dayjs from "dayjs"; |
| | | |
| | | const baseUrl = import.meta.env.VITE_APP_BASE_API; |
| | | const props = defineProps({ |
| | | visible: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | data: { |
| | | type: Object, |
| | | default: () => ({}), |
| | | }, |
| | | }); |
| | | |
| | | const emit = defineEmits(["update:visible"]); |
| | | |
| | | const dialogVisible = computed({ |
| | | get: () => props.visible, |
| | | set: value => emit("update:visible", value), |
| | | }); |
| | | |
| | | const dialogTitle = computed(() => "ç产æ¥å·¥è¯¦æ
"); |
| | | const detailData = ref(props.data); |
| | | |
| | | // æ ¼å¼åæ¶é´ |
| | | const formatTime = time => { |
| | | return time ? dayjs(time).format("YYYY-MM-DD HH:mm:ss") : "-"; |
| | | }; |
| | | |
| | | // æ ¼å¼åæä»¶å表 |
| | | const formatFileList = fileList => { |
| | | return fileList.map(file => ({ |
| | | name: file.fileName, |
| | | url: baseUrl + file.fileUrl, |
| | | size: file.fileSize, |
| | | })); |
| | | }; |
| | | |
| | | // å¤çæä»¶é¢è§ |
| | | const handleFilePreview = file => { |
| | | if (file.fileUrl) { |
| | | window.open(baseUrl + file.fileUrl, "_blank"); |
| | | } else { |
| | | console.log("æä»¶æ²¡æURLï¼æ æ³é¢è§"); |
| | | } |
| | | }; |
| | | |
| | | // è·åBOMå表 |
| | | const getBomList = paramList => { |
| | | return paramList.filter(item => item.bomId); |
| | | }; |
| | | |
| | | // è·ååæ°å表 |
| | | const getParamList = paramList => { |
| | | return paramList.filter(item => !item.bomId); |
| | | }; |
| | | |
| | | // æsourceSortåç»åæ° |
| | | const getParamGroups = paramList => { |
| | | const params = getParamList(paramList); |
| | | const groups = {}; |
| | | |
| | | params.forEach(param => { |
| | | const sort = param.sourceSort || 1; |
| | | if (!groups[sort]) { |
| | | groups[sort] = []; |
| | | } |
| | | groups[sort].push(param); |
| | | }); |
| | | |
| | | return groups; |
| | | }; |
| | | |
| | | // ç嬿°æ®åå |
| | | watch( |
| | | () => props.data, |
| | | newData => { |
| | | detailData.value = newData; |
| | | }, |
| | | { deep: true } |
| | | ); |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .detail-container { |
| | | max-height: 600px; |
| | | overflow-y: auto; |
| | | padding: 0 16px; |
| | | } |
| | | |
| | | .detail-section { |
| | | margin-bottom: 28px; |
| | | background-color: #ffffff; |
| | | border-radius: 8px; |
| | | padding: 20px; |
| | | box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); |
| | | } |
| | | |
| | | .section-title { |
| | | font-size: 16px; |
| | | font-weight: 600; |
| | | margin-bottom: 16px; |
| | | color: #1a1a1a; |
| | | border-bottom: 2px solid #409eff; |
| | | padding-bottom: 10px; |
| | | } |
| | | |
| | | .process-item { |
| | | margin-bottom: 24px; |
| | | padding: 20px; |
| | | background-color: #ffffff; |
| | | border-radius: 8px; |
| | | border: 1px solid #ebeef5; |
| | | box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); |
| | | } |
| | | |
| | | .process-header { |
| | | margin-bottom: 20px; |
| | | padding-bottom: 12px; |
| | | border-bottom: 1px solid #f0f2f5; |
| | | } |
| | | |
| | | .process-title { |
| | | font-size: 15px; |
| | | font-weight: 600; |
| | | margin-bottom: 12px; |
| | | color: #1a1a1a; |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .process-title::before { |
| | | content: ""; |
| | | display: inline-block; |
| | | width: 4px; |
| | | height: 16px; |
| | | background-color: #409eff; |
| | | margin-right: 8px; |
| | | border-radius: 2px; |
| | | } |
| | | |
| | | .process-info { |
| | | display: flex; |
| | | gap: 20px; |
| | | font-size: 13px; |
| | | color: #606266; |
| | | } |
| | | |
| | | .process-label { |
| | | padding: 4px 12px; |
| | | background-color: #ecf5ff; |
| | | border-radius: 4px; |
| | | color: #409eff; |
| | | font-weight: 500; |
| | | } |
| | | |
| | | .process-details { |
| | | margin-bottom: 20px; |
| | | } |
| | | |
| | | .param-section { |
| | | margin-bottom: 20px; |
| | | background-color: #f9f9f9; |
| | | border-radius: 6px; |
| | | padding: 16px; |
| | | border: 1px solid #f0f2f5; |
| | | } |
| | | |
| | | .param-title { |
| | | font-size: 14px; |
| | | font-weight: 600; |
| | | margin-bottom: 14px; |
| | | color: #1a1a1a; |
| | | padding-bottom: 8px; |
| | | border-bottom: 1px solid #e8e8e8; |
| | | } |
| | | |
| | | .file-section { |
| | | margin-top: 20px; |
| | | background-color: #f9f9f9; |
| | | border-radius: 6px; |
| | | padding: 16px; |
| | | border: 1px solid #f0f2f5; |
| | | } |
| | | |
| | | .file-title { |
| | | font-size: 14px; |
| | | font-weight: 600; |
| | | margin-bottom: 14px; |
| | | color: #1a1a1a; |
| | | padding-bottom: 8px; |
| | | border-bottom: 1px solid #e8e8e8; |
| | | } |
| | | |
| | | .file-grid { |
| | | display: grid; |
| | | grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); |
| | | gap: 16px; |
| | | } |
| | | |
| | | .file-item { |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | background-color: #ffffff; |
| | | border: 1px solid #e8e8e8; |
| | | border-radius: 6px; |
| | | padding: 10px; |
| | | box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); |
| | | transition: all 0.3s ease; |
| | | } |
| | | |
| | | .file-item:hover { |
| | | box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); |
| | | border-color: #409eff; |
| | | transform: translateY(-2px); |
| | | } |
| | | |
| | | .file-image { |
| | | width: 100px; |
| | | height: 100px; |
| | | object-fit: cover; |
| | | border-radius: 4px; |
| | | cursor: pointer; |
| | | margin-bottom: 8px; |
| | | } |
| | | |
| | | :deep(.el-image) { |
| | | border-radius: 4px; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | :deep(.el-image__inner) { |
| | | transition: transform 0.3s ease; |
| | | } |
| | | |
| | | .file-item:hover :deep(.el-image__inner) { |
| | | transform: scale(1.05); |
| | | } |
| | | |
| | | .file-info { |
| | | width: 100%; |
| | | text-align: center; |
| | | } |
| | | |
| | | .file-name { |
| | | font-size: 12px; |
| | | color: #606266; |
| | | word-break: break-all; |
| | | line-height: 1.4; |
| | | } |
| | | |
| | | .param-group { |
| | | margin-bottom: 16px; |
| | | padding: 14px; |
| | | background-color: #ffffff; |
| | | border-radius: 6px; |
| | | border: 1px solid #e8e8e8; |
| | | } |
| | | |
| | | .group-header { |
| | | margin-bottom: 12px; |
| | | padding-bottom: 8px; |
| | | border-bottom: 1px solid #f0f2f5; |
| | | } |
| | | .num1 { |
| | | color: #1107cc; |
| | | font-weight: 600; |
| | | } |
| | | .num2 { |
| | | color: #0fcf25; |
| | | font-weight: 600; |
| | | } |
| | | .num3 { |
| | | color: #d31818; |
| | | font-weight: 600; |
| | | } |
| | | .unit { |
| | | font-size: 12px; |
| | | color: #5d5a66; |
| | | } |
| | | |
| | | .group-title { |
| | | font-size: 14px; |
| | | font-weight: 600; |
| | | color: #303133; |
| | | } |
| | | |
| | | .param-grid { |
| | | display: grid; |
| | | grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); |
| | | gap: 16px; |
| | | } |
| | | |
| | | .param-item { |
| | | display: flex; |
| | | align-items: center; |
| | | gap: 12px; |
| | | padding: 8px 0; |
| | | border-bottom: 1px solid #f5f7fa; |
| | | } |
| | | |
| | | .param-item:last-child { |
| | | border-bottom: none; |
| | | } |
| | | |
| | | .param-label { |
| | | font-size: 13px; |
| | | color: #606266; |
| | | min-width: 100px; |
| | | font-weight: 500; |
| | | } |
| | | |
| | | .param-value { |
| | | font-size: 13px; |
| | | color: #1a1a1a; |
| | | font-weight: 600; |
| | | flex: 1; |
| | | } |
| | | |
| | | .param-unit { |
| | | font-size: 12px; |
| | | color: #909399; |
| | | background-color: #f0f2f5; |
| | | padding: 2px 6px; |
| | | border-radius: 3px; |
| | | } |
| | | |
| | | .dialog-footer { |
| | | text-align: center; |
| | | padding: 20px; |
| | | border-top: 1px solid #ebeef5; |
| | | } |
| | | |
| | | .dialog-footer .el-button { |
| | | min-width: 100px; |
| | | padding: 8px 20px; |
| | | } |
| | | |
| | | /* èªå®ä¹å¯¹è¯æ¡æ ·å¼ */ |
| | | :deep(.custom-dialog) { |
| | | border-radius: 12px; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | :deep(.custom-dialog .el-dialog__header) { |
| | | background-color: #f5f7fa; |
| | | padding: 20px; |
| | | border-bottom: 1px solid #ebeef5; |
| | | } |
| | | |
| | | :deep(.custom-dialog .el-dialog__title) { |
| | | font-size: 18px; |
| | | font-weight: 600; |
| | | color: #1a1a1a; |
| | | } |
| | | |
| | | :deep(.custom-dialog .el-dialog__body) { |
| | | padding: 20px; |
| | | } |
| | | |
| | | /* è¡¨æ ¼æ ·å¼ä¼å */ |
| | | :deep(.el-table) { |
| | | border-radius: 6px; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | :deep(.el-table th) { |
| | | background-color: #f5f7fa; |
| | | font-weight: 600; |
| | | color: #303133; |
| | | } |
| | | |
| | | :deep(.el-table tr:hover > td) { |
| | | background-color: #ecf5ff !important; |
| | | } |
| | | |
| | | /* æè¿°åè¡¨æ ·å¼ä¼å */ |
| | | :deep(.el-descriptions) { |
| | | border-radius: 6px; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | :deep(.el-descriptions__label) { |
| | | font-weight: 500; |
| | | color: #606266; |
| | | } |
| | | |
| | | :deep(.el-descriptions__content) { |
| | | color: #1a1a1a; |
| | | font-weight: 500; |
| | | } |
| | | </style> |