| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-dialog v-model="dialogVisible" |
| | | :title="dialogTitle" |
| | | width="800px" |
| | | :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="æ£æµæ¥æ">{{ formatTime(detailData.checkTime) }}</el-descriptions-item> |
| | | <el-descriptions-item label="ä¾åºå">{{ detailData.supplier || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="æ£éªå"><span style="color: #eb9113;">{{ detailData.checkName || '-' }}</span></el-descriptions-item> |
| | | <el-descriptions-item label="产ååç§°"><span style="color: hsl(210, 100%, 63%);">{{ detailData.productName || '-' }}</span></el-descriptions-item> |
| | | <el-descriptions-item label="è§æ ¼åå·"><span style="">{{ detailData.model || '-' }}</span></el-descriptions-item> |
| | | <el-descriptions-item label="åä½"><span style="">{{ detailData.unit || '-' }}</span></el-descriptions-item> |
| | | <el-descriptions-item label="æ°é">{{ detailData.quantity || 0 }}</el-descriptions-item> |
| | | <el-descriptions-item label="è¯æ ·ç¼å·">{{ detailData.sampleCode || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="车çå·">{{ detailData.licensePlateNumber || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="è¯æ ·ç¶æ"><el-tag>{{ detailData.sampleState || '-' }}</el-tag></el-descriptions-item> |
| | | <el-descriptions-item label="æ£æµæ§è´¨"><el-tag type="info">{{ detailData.inspectNature || '-' }}</el-tag></el-descriptions-item> |
| | | <el-descriptions-item label="ææ éæ©"><el-tag type="warning">{{ detailData.testStandardName || detailData.testStandardId || '-' }}</el-tag></el-descriptions-item> |
| | | <el-descriptions-item label="åæ ·æ¥æ">{{ formatTime(detailData.sampleTime) }}</el-descriptions-item> |
| | | <el-descriptions-item label="æ£æµåä½">{{ detailData.checkCompany || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="æ£æµç»æ"><el-tag :type="detailData.checkResult == 'åæ ¼' ? 'success' : 'danger'">{{ detailData.checkResult || '-' }}</el-tag></el-descriptions-item> |
| | | <el-descriptions-item label="æäº¤ç¶æ"><el-tag :type="detailData.inspectState ? 'success' : 'danger'">{{ detailData.inspectState ? 'å·²æäº¤' : 'æªæäº¤' }}</el-tag></el-descriptions-item> |
| | | </el-descriptions> |
| | | </div> |
| | | <!-- ææ ä¿¡æ¯ --> |
| | | <div class="detail-section" |
| | | v-if="detailData.qualityInspectParams && detailData.qualityInspectParams.length > 0"> |
| | | <h3 class="section-title">ææ ä¿¡æ¯</h3> |
| | | <el-table :data="detailData.qualityInspectParams" |
| | | style="width: 100%" |
| | | border> |
| | | <el-table-column prop="parameterItem" |
| | | label="ææ " |
| | | min-width="150"></el-table-column> |
| | | <el-table-column prop="unit" |
| | | label="åä½" |
| | | width="100"></el-table-column> |
| | | <el-table-column prop="standardValue" |
| | | label="æ åå¼" |
| | | width="120"></el-table-column> |
| | | <el-table-column prop="controlValue" |
| | | label="å
æ§å¼" |
| | | width="120"></el-table-column> |
| | | <el-table-column prop="testValue" |
| | | label="æ£éªå¼" |
| | | width="120"> |
| | | <template #default="scope"> |
| | | <span style="color: hsl(210, 100%, 63%);">{{ scope.row.testValue || '-' }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </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"; |
| | | import { |
| | | qualityInspectDetailByProductId, |
| | | getQualityTestStandardParamByTestStandardId, |
| | | } from "@/api/qualityManagement/metricMaintenance.js"; |
| | | import { qualityInspectParamInfo } from "@/api/qualityManagement/qualityInspectParam.js"; |
| | | |
| | | 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 loading = ref(false); |
| | | |
| | | // æ ¼å¼åæ¶é´ |
| | | const formatTime = time => { |
| | | return time ? dayjs(time).format("YYYY-MM-DD HH:mm:ss") : "-"; |
| | | }; |
| | | |
| | | // å è½½ææ éæ©åè¡¨æ ¼æ°æ® |
| | | const loadIndicatorData = async () => { |
| | | if (!detailData.value.productId) return; |
| | | |
| | | loading.value = true; |
| | | try { |
| | | // å è½½ææ éæ©å表 |
| | | const params = { |
| | | productId: detailData.value.productId, |
| | | inspectType: 0, |
| | | }; |
| | | const standardRes = await qualityInspectDetailByProductId(params); |
| | | if (standardRes.data && standardRes.data.length > 0) { |
| | | // æ¥æ¾å½åéæ©çææ åç§° |
| | | const selectedStandard = standardRes.data.find( |
| | | item => item.id == detailData.value.testStandardId |
| | | ); |
| | | if (selectedStandard) { |
| | | detailData.value.testStandardName = |
| | | selectedStandard.standardName || selectedStandard.standardNo; |
| | | } |
| | | } |
| | | |
| | | // å è½½åæ°æ°æ®ï¼ä¸ç¼è¾é¡µé¢ä¿æä¸è´ï¼ |
| | | if (detailData.value.id) { |
| | | getQualityInspectParamList(detailData.value.id); |
| | | } |
| | | } catch (error) { |
| | | console.error("å è½½ææ æ°æ®å¤±è´¥:", error); |
| | | } finally { |
| | | loading.value = false; |
| | | } |
| | | }; |
| | | const getQualityInspectParamList = id => { |
| | | qualityInspectParamInfo(id).then(res => { |
| | | detailData.value.qualityInspectParams = res.data; |
| | | }); |
| | | }; |
| | | // ç嬿°æ®åå |
| | | watch( |
| | | () => props.data, |
| | | newData => { |
| | | detailData.value = newData; |
| | | }, |
| | | { deep: true } |
| | | ); |
| | | |
| | | // æ´é²æ¹æ³ç»ç¶ç»ä»¶ |
| | | defineExpose({ |
| | | loadIndicatorData, |
| | | }); |
| | | </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; |
| | | } |
| | | |
| | | .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-descriptions) { |
| | | border-radius: 6px; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | :deep(.el-descriptions__label) { |
| | | font-weight: 500; |
| | | color: #606266; |
| | | } |
| | | |
| | | :deep(.el-descriptions__content) { |
| | | color: #1a1a1a; |
| | | font-weight: 500; |
| | | } |
| | | |
| | | /* è¡¨æ ¼æ ·å¼ä¼å */ |
| | | :deep(.el-table) { |
| | | border-radius: 6px; |
| | | overflow: hidden; |
| | | box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); |
| | | } |
| | | |
| | | :deep(.el-table th) { |
| | | background-color: #f5f7fa; |
| | | font-weight: 600; |
| | | color: #303133; |
| | | } |
| | | |
| | | :deep(.el-table tr:hover > td) { |
| | | background-color: #ecf5ff !important; |
| | | } |
| | | |
| | | :deep(.el-table td) { |
| | | color: #303133; |
| | | } |
| | | </style> |