| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-dialog v-model="dialogVisible" title="详æ
" width="720px"> |
| | | <div class="detail-content"> |
| | | <el-row :gutter="20" class="detail-row"> |
| | | <el-col :span="12"> |
| | | <p class="detail-item"><span class="detail-label">ç¶æï¼</span><span class="detail-value">{{ formatInspectState(detailForm.inspectState) }}</span></p> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <p class="detail-item"><span class="detail-label">æ£æµæ¥æï¼</span><span class="detail-value">{{ detailForm.checkTime || "-" }}</span></p> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20" class="detail-row"> |
| | | <el-col :span="12"> |
| | | <p class="detail-item"><span class="detail-label">ç±»å«ï¼</span><span class="detail-value">{{ formatInspectType(detailForm.inspectType) }}</span></p> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <p class="detail-item"><span class="detail-label">æ£éªåï¼</span><span class="detail-value">{{ detailForm.checkName || "-" }}</span></p> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20" class="detail-row"> |
| | | <el-col :span="12"> |
| | | <p class="detail-item"><span class="detail-label">产ååç§°ï¼</span><span class="detail-value">{{ detailForm.productName || "-" }}</span></p> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <p class="detail-item"><span class="detail-label">è§æ ¼åå·ï¼</span><span class="detail-value">{{ detailForm.model || "-" }}</span></p> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20" class="detail-row"> |
| | | <el-col :span="12"> |
| | | <p class="detail-item"><span class="detail-label">åä½ï¼</span><span class="detail-value">{{ detailForm.unit || "-" }}</span></p> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <p class="detail-item"><span class="detail-label">æ°éï¼</span><span class="detail-value">{{ detailForm.quantity ?? "-" }}</span></p> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20" class="detail-row"> |
| | | <el-col :span="12"> |
| | | <p class="detail-item"><span class="detail-label">ä¸åæ ¼ç°è±¡ï¼</span><span class="detail-value">{{ detailForm.defectivePhenomena || "-" }}</span></p> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <p class="detail-item"><span class="detail-label">å¤çç»æï¼</span><span class="detail-value">{{ detailForm.dealResult || "-" }}</span></p> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20" class="detail-row"> |
| | | <el-col :span="12"> |
| | | <p class="detail-item"><span class="detail-label">å¤ç人ï¼</span><span class="detail-value">{{ detailForm.dealName || "-" }}</span></p> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <p class="detail-item"><span class="detail-label">å¤çæ¥æï¼</span><span class="detail-value">{{ detailForm.dealTime || "-" }}</span></p> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20" class="detail-row"> |
| | | <el-col :span="12"> |
| | | <p class="detail-item"><span class="detail-label">å·¥æ¶æå¤±ï¼</span><span class="detail-value">{{ detailForm.lossWorking ?? "-" }}</span></p> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <p class="detail-item"><span class="detail-label">ææè´¹æå¤±ï¼</span><span class="detail-value">{{ detailForm.lossMaterial ?? "-" }}</span></p> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row class="detail-row"> |
| | | <el-col :span="24"> |
| | | <p class="detail-item"> |
| | | <span class="detail-label">åå åæï¼</span> |
| | | <span class="detail-value detail-textarea">{{ detailForm.reasonAnalysis || "-" }}</span> |
| | | </p> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row class="detail-row"> |
| | | <el-col :span="24"> |
| | | <p class="detail-item"> |
| | | <span class="detail-label">é¢é²ä¸çº æ£æªæ½ï¼</span> |
| | | <span class="detail-value detail-textarea">{{ detailForm.preventiveCorrective || "-" }}</span> |
| | | </p> |
| | | </el-col> |
| | | </el-row> |
| | | <!-- <el-row class="detail-row"> |
| | | <el-col :span="24"> |
| | | <div class="detail-item"> |
| | | <span class="detail-label">éä»¶ï¼</span> |
| | | <div class="detail-value"> |
| | | <div v-if="attachmentList.length" class="attachment-list"> |
| | | <p |
| | | v-for="(item, idx) in attachmentList" |
| | | :key="`${item.url}-${idx}`" |
| | | :href="item.url" |
| | | target="_blank" |
| | | rel="noopener noreferrer" |
| | | class="attachment-link" |
| | | > |
| | | {{ item.name }} |
| | | </p> |
| | | </div> |
| | | <span v-else>-</span> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | </el-row> --> |
| | | </div> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { computed, ref } from "vue"; |
| | | |
| | | const dialogVisible = ref(false); |
| | | const detailForm = ref({}); |
| | | const baseApi = import.meta.env.VITE_APP_BASE_API; |
| | | |
| | | const normalizeUrl = (url) => { |
| | | if (!url) return ""; |
| | | if (String(url).startsWith("http")) return url; |
| | | return `${baseApi}${url}`; |
| | | }; |
| | | // const attachmentList = computed(() => { |
| | | // const list = []; |
| | | // const commonFileList = Array.isArray(detailForm.value?.commonFileList) ? detailForm.value.commonFileList : []; |
| | | // commonFileList.forEach((item, index) => { |
| | | // const url = normalizeUrl(item?.url || item?.tempPath); |
| | | // if (!url) return; |
| | | // list.push({ |
| | | // name: item?.name || `éä»¶${index + 1}`, |
| | | // url, |
| | | // }); |
| | | // }); |
| | | // if (list.length) return list; |
| | | |
| | | // const photos = detailForm.value?.defectivePhotos; |
| | | // if (!photos) return []; |
| | | // return String(photos) |
| | | // .split(",") |
| | | // .map((item, index) => { |
| | | // const path = item?.trim(); |
| | | // if (!path) return null; |
| | | // return { |
| | | // name: `éä»¶${index + 1}`, |
| | | // url: normalizeUrl(path), |
| | | // }; |
| | | // }) |
| | | // .filter(Boolean); |
| | | // }); |
| | | |
| | | const formatInspectState = (value) => { |
| | | if (value == 0) return "å¾
å¤ç"; |
| | | if (value == 1) return "å·²å¤ç"; |
| | | return "-"; |
| | | }; |
| | | const formatInspectType = (value) => { |
| | | if (value == 0) return "åæææ£éª"; |
| | | if (value == 1) return "è¿ç¨æ£éª"; |
| | | if (value == 2) return "åºåæ£éª"; |
| | | return "-"; |
| | | }; |
| | | |
| | | const openDialog = (row) => { |
| | | detailForm.value = { ...(row || {}) }; |
| | | dialogVisible.value = true; |
| | | }; |
| | | |
| | | defineExpose({ |
| | | openDialog, |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .detail-content { |
| | | line-height: 1.6; |
| | | color: #606266; |
| | | max-height: 60vh; |
| | | overflow-y: auto; |
| | | overflow-x: hidden; |
| | | } |
| | | .detail-row { |
| | | margin-bottom: 10px; |
| | | } |
| | | .detail-item { |
| | | margin: 0; |
| | | display: flex; |
| | | align-items: flex-start; |
| | | } |
| | | .detail-label { |
| | | flex: 0 0 116px; |
| | | color: #303133; |
| | | font-weight: 600; |
| | | } |
| | | .detail-value { |
| | | flex: 1; |
| | | min-width: 0; |
| | | overflow-x: hidden; |
| | | } |
| | | .detail-value-multiline { |
| | | white-space: pre-wrap; |
| | | word-break: break-word; |
| | | } |
| | | .detail-textarea { |
| | | display: block; |
| | | min-height: 92px; |
| | | max-height: 92px; |
| | | overflow-y: auto; |
| | | overflow-x: hidden; |
| | | padding: 8px 10px; |
| | | border-radius: 4px; |
| | | background: #f5f7fa; |
| | | white-space: pre-wrap; |
| | | word-break: break-word; |
| | | overflow-wrap: anywhere; |
| | | } |
| | | .attachment-list { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | gap: 8px 12px; |
| | | } |
| | | .attachment-link { |
| | | color: #409eff; |
| | | text-decoration: none; |
| | | } |
| | | .attachment-link:hover { |
| | | text-decoration: underline; |
| | | } |
| | | </style> |