Merge remote-tracking branch 'origin/dev_天津_阳光印刷' into dev_天津_阳光印刷
| | |
| | | "YGYS": { |
| | | "env": { |
| | | "VITE_APP_TITLE": "é³å
å°å·ä¿¡æ¯ç®¡ç", |
| | | "VITE_BASE_API": "http://1.15.17.182:9022", |
| | | "VITE_BASE_API": "http://1.15.17.182:9023", |
| | | "VITE_JAVA_API": "http://1.15.17.182:9022" |
| | | }, |
| | | "screen": "screen/login-background.png", |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <el-dialog |
| | | v-model="showUploadDialog" |
| | | title="ä¸ä¼ å·¡æ£è®°å½" |
| | | width="560px" |
| | | :before-close="closeUploadDialog" |
| | | > |
| | | <el-tabs v-model="currentUploadType"> |
| | | <el-tab-pane label="ç产å" name="before" /> |
| | | <el-tab-pane label="ç产ä¸" name="after" /> |
| | | <el-tab-pane label="ç产å" name="issue" /> |
| | | </el-tabs> |
| | | |
| | | <div class="exception-section"> |
| | | <div class="section-title">æ¯å¦åå¨å¼å¸¸ï¼</div> |
| | | <el-radio-group v-model="hasException"> |
| | | <el-radio :value="false">æ£å¸¸</el-radio> |
| | | <el-radio :value="true">åå¨å¼å¸¸</el-radio> |
| | | </el-radio-group> |
| | | </div> |
| | | |
| | | <div class="upload-buttons"> |
| | | <el-upload |
| | | ref="uploadRef" |
| | | v-model:file-list="uploadFileList" |
| | | :action="uploadUrl" |
| | | :headers="uploadHeaders" |
| | | :show-file-list="false" |
| | | :accept="uploadAccept" |
| | | :multiple="false" |
| | | :before-upload="handleBeforeUpload" |
| | | :on-success="handleUploadSuccess" |
| | | :on-error="handleUploadError" |
| | | :on-progress="handleUploadProgress" |
| | | :disabled="uploading || getCurrentFiles().length >= uploadConfig.limit" |
| | | > |
| | | <el-button |
| | | type="primary" |
| | | :loading="uploading" |
| | | :disabled="getCurrentFiles().length >= uploadConfig.limit" |
| | | > |
| | | éæ©å¾ç/è§é¢ |
| | | </el-button> |
| | | </el-upload> |
| | | </div> |
| | | |
| | | <el-progress |
| | | v-if="uploading" |
| | | :percentage="uploadProgress" |
| | | style="margin: 12px 0" |
| | | /> |
| | | |
| | | <div v-if="getCurrentFiles().length" class="file-list"> |
| | | <div |
| | | v-for="(file, index) in getCurrentFiles()" |
| | | :key="file.uid || file.id || index" |
| | | class="file-item" |
| | | > |
| | | <div class="file-preview-container"> |
| | | <img |
| | | v-if="isImageFile(file)" |
| | | :src="file.url || file.downloadUrl" |
| | | class="file-preview" |
| | | @click="previewAttachment(file)" |
| | | /> |
| | | <div |
| | | v-else |
| | | class="video-preview" |
| | | @click="previewAttachment(file)" |
| | | > |
| | | è§é¢ |
| | | </div> |
| | | |
| | | <button class="delete-btn" @click="removeFile(index)">x</button> |
| | | </div> |
| | | |
| | | <div class="file-name"> |
| | | {{ file.bucketFilename || file.name || "éä»¶" }} |
| | | </div> |
| | | <div class="file-size"> |
| | | {{ formatFileSize(file.size || file.byteSize) }} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <el-empty |
| | | v-else |
| | | :description="`è¯·éæ©è¦ä¸ä¼ ç${getUploadTypeText()}å¾çæè§é¢`" |
| | | /> |
| | | |
| | | <div class="upload-summary"> |
| | | ç产åï¼{{ beforeModelValue.length }} 个 | |
| | | ç产ä¸ï¼{{ afterModelValue.length }} 个 | |
| | | ç产åï¼{{ issueModelValue.length }} 个 |
| | | </div> |
| | | |
| | | <template #footer> |
| | | <el-button type="primary" @click="submitUpload">æäº¤</el-button> |
| | | <el-button @click="closeUploadDialog">åæ¶</el-button> |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | <el-dialog |
| | | v-model="showVideoDialog" |
| | | :title="currentVideoFile?.originalFilename || 'è§é¢é¢è§'" |
| | | width="720px" |
| | | > |
| | | <video |
| | | v-if="currentVideoFile" |
| | | :src="currentVideoFile.url || currentVideoFile.downloadUrl" |
| | | class="video-player" |
| | | controls |
| | | autoplay |
| | | /> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { computed, ref } from "vue"; |
| | | import { ElLoading, ElMessage, ElMessageBox } from "element-plus"; |
| | | import { getToken } from "@/utils/auth"; |
| | | import { uploadInspectionTask } from "@/api/inspectionManagement/index.js"; |
| | | |
| | | const emit = defineEmits(["closeDia", "success"]); |
| | | |
| | | const showUploadDialog = ref(false); |
| | | const uploading = ref(false); |
| | | const uploadProgress = ref(0); |
| | | const uploadRef = ref(null); |
| | | const uploadFileList = ref([]); |
| | | |
| | | const beforeModelValue = ref([]); |
| | | const afterModelValue = ref([]); |
| | | const issueModelValue = ref([]); |
| | | const currentUploadType = ref("before"); |
| | | const hasException = ref(null); |
| | | const currentTask = ref(null); |
| | | |
| | | const showVideoDialog = ref(false); |
| | | const currentVideoFile = ref(null); |
| | | |
| | | const uploadConfig = { |
| | | action: "/file/upload", |
| | | limit: 10, |
| | | fileSize: 50, |
| | | fileType: ["jpg", "jpeg", "png", "gif", "webp", "mp4", "mov", "avi", "wmv"], |
| | | }; |
| | | |
| | | const uploadUrl = computed(() => { |
| | | const type = getTabType(); |
| | | return `${import.meta.env.VITE_APP_BASE_API}${uploadConfig.action}?type=${type}`; |
| | | }); |
| | | const uploadHeaders = { |
| | | Authorization: `Bearer ${getToken()}`, |
| | | }; |
| | | const uploadAccept = computed(() => |
| | | uploadConfig.fileType.map(item => `.${item}`).join(",") |
| | | ); |
| | | const filePreviewBase = __BASE_API__; |
| | | |
| | | const cloneData = value => JSON.parse(JSON.stringify(value || {})); |
| | | |
| | | const normalizeFileUrl = rawUrl => { |
| | | if (!rawUrl || typeof rawUrl !== "string") return ""; |
| | | |
| | | let fileUrl = rawUrl.trim(); |
| | | if (!fileUrl) return ""; |
| | | if (/^https?:\/\//i.test(fileUrl)) return fileUrl; |
| | | |
| | | if (fileUrl.indexOf("\\") > -1) { |
| | | const uploadsIndex = fileUrl.toLowerCase().indexOf("uploads"); |
| | | if (uploadsIndex > -1) { |
| | | const relativePath = fileUrl.substring(uploadsIndex).replace(/\\/g, "/"); |
| | | fileUrl = `/${relativePath}`; |
| | | } else { |
| | | const parts = fileUrl.split("\\"); |
| | | const fileName = parts[parts.length - 1]; |
| | | fileUrl = `/uploads/${fileName}`; |
| | | } |
| | | } |
| | | |
| | | if (!fileUrl.startsWith("http")) { |
| | | if (!fileUrl.startsWith("/")) { |
| | | fileUrl = `/${fileUrl}`; |
| | | } |
| | | fileUrl = `${filePreviewBase}${fileUrl}`; |
| | | } |
| | | |
| | | return fileUrl; |
| | | }; |
| | | |
| | | const mapExistingFile = (file, type) => ({ |
| | | ...file, |
| | | id: file?.id, |
| | | tempId: file?.tempId ?? file?.tempFileId ?? file?.id, |
| | | tempFileId: file?.tempFileId ?? file?.id, |
| | | url: normalizeFileUrl(file?.url || file?.downloadUrl || file?.fileUrl || ""), |
| | | downloadUrl: normalizeFileUrl( |
| | | file?.downloadUrl || file?.url || file?.fileUrl || "" |
| | | ), |
| | | bucketFilename: |
| | | file?.bucketFilename || file?.originalFilename || file?.fileName || file?.name, |
| | | originalFilename: |
| | | file?.originalFilename || file?.bucketFilename || file?.fileName || file?.name, |
| | | size: file?.size || file?.byteSize, |
| | | byteSize: file?.byteSize || file?.size, |
| | | contentType: file?.contentType || "", |
| | | type, |
| | | uid: file?.uid || `${type}-${file?.id || file?.url || Math.random()}`, |
| | | }); |
| | | |
| | | const resetDialogState = () => { |
| | | beforeModelValue.value = []; |
| | | afterModelValue.value = []; |
| | | issueModelValue.value = []; |
| | | currentUploadType.value = "before"; |
| | | hasException.value = null; |
| | | currentTask.value = null; |
| | | uploadProgress.value = 0; |
| | | uploading.value = false; |
| | | uploadFileList.value = []; |
| | | uploadRef.value?.clearFiles?.(); |
| | | }; |
| | | |
| | | const openDialog = task => { |
| | | const rawTask = cloneData(task?.__raw || task); |
| | | currentTask.value = { |
| | | ...rawTask, |
| | | taskId: rawTask.taskId || rawTask.id, |
| | | storageBlobDTO: [], |
| | | }; |
| | | |
| | | beforeModelValue.value = Array.isArray(rawTask.commonFileListBefore) |
| | | ? rawTask.commonFileListBefore.map(file => mapExistingFile(file, 10)) |
| | | : []; |
| | | afterModelValue.value = Array.isArray(rawTask.commonFileListAfter) |
| | | ? rawTask.commonFileListAfter.map(file => mapExistingFile(file, 11)) |
| | | : []; |
| | | issueModelValue.value = Array.isArray(rawTask.commonFileList) |
| | | ? rawTask.commonFileList.map(file => mapExistingFile(file, 12)) |
| | | : []; |
| | | |
| | | currentUploadType.value = "before"; |
| | | hasException.value = |
| | | typeof rawTask.hasException === "boolean" ? rawTask.hasException : null; |
| | | uploadFileList.value = []; |
| | | showUploadDialog.value = true; |
| | | }; |
| | | |
| | | const closeUploadDialog = () => { |
| | | showUploadDialog.value = false; |
| | | resetDialogState(); |
| | | emit("closeDia"); |
| | | }; |
| | | |
| | | const getCurrentFiles = () => { |
| | | if (currentUploadType.value === "before") return beforeModelValue.value; |
| | | if (currentUploadType.value === "after") return afterModelValue.value; |
| | | return issueModelValue.value; |
| | | }; |
| | | |
| | | const getUploadTypeText = () => { |
| | | if (currentUploadType.value === "before") return "ç产å"; |
| | | if (currentUploadType.value === "after") return "ç产ä¸"; |
| | | return "ç产å"; |
| | | }; |
| | | |
| | | const getTabType = () => { |
| | | if (currentUploadType.value === "before") return 10; |
| | | if (currentUploadType.value === "after") return 11; |
| | | return 12; |
| | | }; |
| | | |
| | | const handleBeforeUpload = file => { |
| | | if (getCurrentFiles().length >= uploadConfig.limit) { |
| | | ElMessage.warning(`æå¤åªè½éæ©${uploadConfig.limit}个æä»¶`); |
| | | return false; |
| | | } |
| | | |
| | | const ext = file.name.split(".").pop()?.toLowerCase(); |
| | | if (!uploadConfig.fileType.includes(ext)) { |
| | | ElMessage.warning(`æä»¶æ ¼å¼ä¸æ¯æï¼è¯·ä¸ä¼ ${uploadConfig.fileType.join("/")} æ ¼å¼`); |
| | | return false; |
| | | } |
| | | |
| | | const maxSize = uploadConfig.fileSize * 1024 * 1024; |
| | | if (file.size > maxSize) { |
| | | ElMessage.warning(`æä»¶å¤§å°ä¸è½è¶
è¿ ${uploadConfig.fileSize}MB`); |
| | | return false; |
| | | } |
| | | |
| | | uploading.value = true; |
| | | uploadProgress.value = 0; |
| | | return true; |
| | | }; |
| | | |
| | | const handleUploadProgress = event => { |
| | | if (event?.percent) { |
| | | uploadProgress.value = Math.round(event.percent); |
| | | } |
| | | }; |
| | | |
| | | const handleUploadSuccess = (response, file) => { |
| | | uploading.value = false; |
| | | uploadProgress.value = 0; |
| | | uploadFileList.value = []; |
| | | uploadRef.value?.clearFiles?.(); |
| | | |
| | | const uploadedFile = response?.data; |
| | | if (response?.code !== 200 || !uploadedFile) { |
| | | ElMessage.error(response?.msg || "ä¸ä¼ ååºæ°æ®æ ¼å¼é误"); |
| | | return; |
| | | } |
| | | |
| | | const type = getTabType(); |
| | | const objectUrl = file?.raw ? URL.createObjectURL(file.raw) : ""; |
| | | const fileData = { |
| | | id: uploadedFile.id, |
| | | tempId: uploadedFile.tempId ?? uploadedFile.tempFileId ?? uploadedFile.id, |
| | | tempFileId: uploadedFile.tempFileId ?? uploadedFile.id, |
| | | url: normalizeFileUrl(uploadedFile.url || uploadedFile.downloadUrl || objectUrl), |
| | | downloadUrl: normalizeFileUrl( |
| | | uploadedFile.downloadUrl || uploadedFile.url || objectUrl |
| | | ), |
| | | bucketFilename: |
| | | uploadedFile.bucketFilename || uploadedFile.originalFilename || file.name, |
| | | originalFilename: |
| | | uploadedFile.originalFilename || uploadedFile.bucketFilename || file.name, |
| | | size: uploadedFile.size || uploadedFile.byteSize || file.size, |
| | | byteSize: uploadedFile.byteSize || uploadedFile.size || file.size, |
| | | createTime: uploadedFile.createTime || Date.now(), |
| | | contentType: uploadedFile.contentType || file.raw?.type || "", |
| | | type, |
| | | uid: `${Date.now()}-${Math.random()}`, |
| | | }; |
| | | |
| | | if (currentUploadType.value === "before") { |
| | | beforeModelValue.value.push(fileData); |
| | | } else if (currentUploadType.value === "after") { |
| | | afterModelValue.value.push(fileData); |
| | | } else { |
| | | issueModelValue.value.push(fileData); |
| | | } |
| | | |
| | | ElMessage.success("ä¸ä¼ æå"); |
| | | }; |
| | | |
| | | const handleUploadError = error => { |
| | | uploading.value = false; |
| | | uploadProgress.value = 0; |
| | | uploadFileList.value = []; |
| | | uploadRef.value?.clearFiles?.(); |
| | | ElMessage.error(error?.message || "ä¸ä¼ 失败"); |
| | | }; |
| | | |
| | | const removeFile = async index => { |
| | | try { |
| | | await ElMessageBox.confirm("ç¡®å®è¦å é¤è¿ä¸ªæä»¶åï¼", "确认å é¤", { |
| | | type: "warning", |
| | | }); |
| | | |
| | | if (currentUploadType.value === "before") { |
| | | beforeModelValue.value.splice(index, 1); |
| | | } else if (currentUploadType.value === "after") { |
| | | afterModelValue.value.splice(index, 1); |
| | | } else { |
| | | issueModelValue.value.splice(index, 1); |
| | | } |
| | | |
| | | ElMessage.success("å 餿å"); |
| | | } catch {} |
| | | }; |
| | | |
| | | const buildSubmitFiles = () => { |
| | | const list = [ |
| | | ...beforeModelValue.value, |
| | | ...afterModelValue.value, |
| | | ...issueModelValue.value, |
| | | ]; |
| | | |
| | | return list.map(item => ({ |
| | | ...item, |
| | | url: item?.downloadUrl || item?.url || "", |
| | | })); |
| | | }; |
| | | |
| | | const buildSubmitFileItem = item => { |
| | | if (!item) return null; |
| | | |
| | | return { |
| | | id: item.id, |
| | | tempId: item.tempId, |
| | | tempFileId: item.tempFileId, |
| | | type: item.type, |
| | | url: item?.downloadUrl || item?.url || "", |
| | | downloadUrl: item?.downloadUrl || item?.url || "", |
| | | bucketFilename: item.bucketFilename, |
| | | originalFilename: item.originalFilename, |
| | | size: item.size, |
| | | byteSize: item.byteSize, |
| | | contentType: item.contentType, |
| | | }; |
| | | }; |
| | | |
| | | const buildGroupedFiles = list => { |
| | | return (list || []).map(buildSubmitFileItem).filter(Boolean); |
| | | }; |
| | | |
| | | const buildSubmitPayload = () => { |
| | | const { |
| | | createTime, |
| | | updateTime, |
| | | storageBlobDTO, |
| | | commonFileListBefore, |
| | | commonFileListAfter, |
| | | commonFileList, |
| | | __raw, |
| | | ...rest |
| | | } = currentTask.value || {}; |
| | | |
| | | const files = buildSubmitFiles(); |
| | | const tempFileIds = files |
| | | .map(item => item?.tempId ?? item?.tempFileId ?? item?.id) |
| | | .filter(Boolean); |
| | | |
| | | return { |
| | | ...rest, |
| | | hasException: hasException.value, |
| | | tempFileIds, |
| | | commonFileListBefore: buildGroupedFiles(beforeModelValue.value), |
| | | commonFileListAfter: buildGroupedFiles(afterModelValue.value), |
| | | commonFileList: buildGroupedFiles(issueModelValue.value), |
| | | }; |
| | | }; |
| | | |
| | | const submitUpload = async () => { |
| | | if (hasException.value === null) { |
| | | ElMessage.warning("è¯·éæ©æ¯å¦åå¨å¼å¸¸"); |
| | | return; |
| | | } |
| | | |
| | | const files = buildSubmitFiles(); |
| | | if (!files.length) { |
| | | ElMessage.warning("请å
ä¸ä¼ æä»¶"); |
| | | return; |
| | | } |
| | | |
| | | const loadingInstance = ElLoading.service({ |
| | | text: "æäº¤ä¸...", |
| | | background: "rgba(0, 0, 0, 0.3)", |
| | | }); |
| | | |
| | | try { |
| | | const payload = buildSubmitPayload(); |
| | | |
| | | const result = await uploadInspectionTask(payload); |
| | | if (result?.code === 200 || result?.success) { |
| | | ElMessage.success("æäº¤æå"); |
| | | showUploadDialog.value = false; |
| | | resetDialogState(); |
| | | emit("success"); |
| | | emit("closeDia"); |
| | | } else { |
| | | ElMessage.error(result?.msg || result?.message || "æäº¤å¤±è´¥"); |
| | | } |
| | | } catch (error) { |
| | | ElMessage.error(error?.message || "æäº¤å¤±è´¥"); |
| | | } finally { |
| | | loadingInstance.close(); |
| | | } |
| | | }; |
| | | |
| | | const goToRepair = () => { |
| | | const taskInfo = { |
| | | taskId: currentTask.value?.taskId || currentTask.value?.id, |
| | | taskName: currentTask.value?.taskName, |
| | | inspectionLocation: currentTask.value?.inspectionLocation, |
| | | inspector: currentTask.value?.inspector, |
| | | uploadedFiles: { |
| | | before: beforeModelValue.value, |
| | | after: afterModelValue.value, |
| | | issue: issueModelValue.value, |
| | | }, |
| | | }; |
| | | |
| | | sessionStorage.setItem("repairTaskInfo", JSON.stringify(taskInfo)); |
| | | window.location.href = "/equipmentManagement/repair"; |
| | | }; |
| | | |
| | | const previewAttachment = file => { |
| | | if (isImageFile(file)) { |
| | | window.open(file.url || file.downloadUrl, "_blank"); |
| | | } else { |
| | | currentVideoFile.value = file; |
| | | showVideoDialog.value = true; |
| | | } |
| | | }; |
| | | |
| | | const isImageFile = file => { |
| | | if (file?.contentType?.startsWith("image/")) return true; |
| | | const name = |
| | | file?.bucketFilename || file?.originalFilename || file?.name || ""; |
| | | const ext = name.split(".").pop()?.toLowerCase(); |
| | | return ["jpg", "jpeg", "png", "gif", "webp"].includes(ext); |
| | | }; |
| | | |
| | | const formatFileSize = size => { |
| | | if (!size) return ""; |
| | | if (size < 1024) return `${size}B`; |
| | | if (size < 1024 * 1024) return `${(size / 1024).toFixed(1)}KB`; |
| | | return `${(size / 1024 / 1024).toFixed(1)}MB`; |
| | | }; |
| | | |
| | | defineExpose({ |
| | | openDialog, |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .exception-section { |
| | | margin-bottom: 16px; |
| | | padding: 12px; |
| | | background: #f8f9fa; |
| | | border-radius: 8px; |
| | | } |
| | | |
| | | .section-title { |
| | | font-weight: 600; |
| | | margin-bottom: 8px; |
| | | } |
| | | |
| | | .upload-buttons { |
| | | margin-bottom: 12px; |
| | | } |
| | | |
| | | .file-list { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | gap: 12px; |
| | | } |
| | | |
| | | .file-item { |
| | | width: 120px; |
| | | padding: 8px; |
| | | border: 1px solid #e5e5e5; |
| | | border-radius: 10px; |
| | | background: #fff; |
| | | text-align: center; |
| | | } |
| | | |
| | | .file-preview-container { |
| | | position: relative; |
| | | } |
| | | |
| | | .file-preview { |
| | | width: 90px; |
| | | height: 90px; |
| | | object-fit: cover; |
| | | border-radius: 8px; |
| | | border: 1px solid #eee; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .video-preview { |
| | | width: 90px; |
| | | height: 90px; |
| | | margin: 0 auto; |
| | | border-radius: 8px; |
| | | background: #eef3f8; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | color: #409eff; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .delete-btn { |
| | | position: absolute; |
| | | top: -6px; |
| | | right: 6px; |
| | | width: 22px; |
| | | height: 22px; |
| | | border: none; |
| | | border-radius: 50%; |
| | | color: #fff; |
| | | background: #f56c6c; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .file-name { |
| | | margin-top: 6px; |
| | | font-size: 12px; |
| | | color: #333; |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | } |
| | | |
| | | .file-size { |
| | | font-size: 11px; |
| | | color: #999; |
| | | } |
| | | |
| | | .upload-summary { |
| | | margin-top: 16px; |
| | | padding: 10px; |
| | | background: #f8f9fa; |
| | | border-left: 3px solid #409eff; |
| | | font-size: 13px; |
| | | color: #666; |
| | | } |
| | | |
| | | .video-player { |
| | | width: 100%; |
| | | max-height: 70vh; |
| | | background: #000; |
| | | } |
| | | </style> |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- ç产å --> |
| | | <!-- çäº§ä¸ --> |
| | | <div class="form-container"> |
| | | <div class="title">ç产å</div> |
| | | <div class="title">ç产ä¸</div> |
| | | |
| | | <!-- å¾çå表 --> |
| | | <div style="display: flex; flex-wrap: wrap;"> |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- ç产é®é¢ --> |
| | | <!-- ç产å --> |
| | | <div class="form-container"> |
| | | <div class="title">ç产é®é¢</div> |
| | | <div class="title">ç产å</div> |
| | | |
| | | <!-- å¾çå表 --> |
| | | <div style="display: flex; flex-wrap: wrap;"> |
| | |
| | | <form-dia ref="formDia" |
| | | @closeDia="handleQuery"></form-dia> |
| | | <view-files ref="viewFiles"></view-files> |
| | | <upload-files ref="uploadFiles" |
| | | @closeDia="handleQuery"></upload-files> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | // ç»ä»¶å¼å
¥ |
| | | import PIMTable from "@/components/PIMTable/PIMTable.vue"; |
| | | import FormDia from "@/views/equipmentManagement/inspectionManagement/components/formDia.vue"; |
| | | import UploadFiles from "@/views/equipmentManagement/inspectionManagement/components/uploadFiles.vue"; |
| | | import ViewFiles from "@/views/equipmentManagement/inspectionManagement/components/viewFiles.vue"; |
| | | |
| | | // æ¥å£å¼å
¥ |
| | |
| | | const { proxy } = getCurrentInstance(); |
| | | const formDia = ref(); |
| | | const viewFiles = ref(); |
| | | const uploadFiles = ref(); |
| | | |
| | | // æ¥è¯¢åæ° |
| | | const queryParams = reactive({ |
| | |
| | | |
| | | const operationConfig = { |
| | | label: "æä½", |
| | | width: 130, |
| | | width: operations.length > 1 ? 180 : 130, |
| | | fixed: "right", |
| | | align: 'center', |
| | | dataType: "action", |
| | | operation: operations |
| | | .map(op => { |
| | |
| | | return { |
| | | name: "ç¼è¾", |
| | | clickFun: handleAdd, |
| | | color: "#409EFF", |
| | | }; |
| | | case "upload": |
| | | return { |
| | | name: "ä¸ä¼ ", |
| | | clickFun: openUploadFiles, |
| | | color: "#409EFF", |
| | | }; |
| | | case "viewFile": |
| | |
| | | ]; |
| | | operationsArr.value = ["edit"]; |
| | | } else if (value === "task") { |
| | | const operationColumn = getOperationColumn(["viewFile"]); |
| | | const operationColumn = getOperationColumn(["upload", "viewFile"]); |
| | | tableColumns.value = [ |
| | | ...columns.value, |
| | | ...(operationColumn ? [operationColumn] : []), |
| | | ]; |
| | | operationsArr.value = ["viewFile"]; |
| | | operationsArr.value = ["upload", "viewFile"]; |
| | | } |
| | | pageNum.value = 1; |
| | | pageSize.value = 10; |
| | |
| | | // å¤ç inspector åæ®µï¼å°å符串转æ¢ä¸ºæ°ç»ï¼éç¨äºæææ
åµï¼ |
| | | tableData.value = rawData.map(item => { |
| | | const processedItem = { ...item }; |
| | | processedItem.__raw = { ...item }; |
| | | |
| | | // å¤ç inspector åæ®µ |
| | | if (processedItem.inspector) { |
| | |
| | | const viewFile = row => { |
| | | nextTick(() => { |
| | | viewFiles.value?.openDialog(row); |
| | | }); |
| | | }; |
| | | |
| | | // ä¸ä¼ éä»¶ |
| | | const openUploadFiles = row => { |
| | | nextTick(() => { |
| | | uploadFiles.value?.openDialog(row); |
| | | }); |
| | | }; |
| | | |
| | |
| | | color: #909399; |
| | | font-size: 14px; |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ¥ä¿®é¡¹ç®"> |
| | | <el-input |
| | | v-model="form.repairProject" |
| | | placeholder="请è¾å
¥æ¥ä¿®é¡¹ç®" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ¥ä¿®æ¥æ"> |
| | | <el-date-picker |
| | | v-model="form.repairTime" |
| | |
| | | deviceLedgerId: undefined, // 设å¤Id |
| | | deviceName: undefined, // 设å¤åç§° |
| | | deviceModel: undefined, // è§æ ¼åå· |
| | | repairProject: undefined, // æ¥ä¿®é¡¹ç® |
| | | repairTime: dayjs().format("YYYY-MM-DD"), // æ¥ä¿®æ¥æï¼é»è®¤å½å¤© |
| | | repairName: userStore.nickName, // æ¥ä¿®äºº |
| | | remark: undefined, // æ
éç°è±¡ |
| | |
| | | form.deviceLedgerId = data.deviceLedgerId; |
| | | form.deviceName = data.deviceName; |
| | | form.deviceModel = data.deviceModel; |
| | | form.repairProject = data.repairProject; |
| | | form.repairTime = data.repairTime; |
| | | form.repairName = data.repairName; |
| | | form.remark = data.remark; |
| | |
| | | prop: "deviceModel", |
| | | }, |
| | | { |
| | | label: "æ¥ä¿®é¡¹ç®", |
| | | align: "center", |
| | | prop: "repairProject", |
| | | }, |
| | | { |
| | | label: "æ¥ä¿®æ¥æ", |
| | | align: "center", |
| | | prop: "repairTime", |
| | |
| | | minWidth: 100, |
| | | }, |
| | | { |
| | | label: "æ¥åºæ°é", |
| | | prop: "scrapQty", |
| | | minWidth: 100, |
| | | }, |
| | | { |
| | | label: "补产æ°é", |
| | | prop: "replenishQty", |
| | | minWidth: 100, |
| | | }, |
| | | { |
| | | label: "å æ¾æ°", |
| | | prop: "addQty", |
| | | minWidth: 100, |
| | | }, |
| | | { |
| | | label: "æºå°", |
| | | prop: "deviceName", |
| | | minWidth: 100, |
| | |
| | | <el-table-column label="ææåç§°"> |
| | | <template #default="{ row, $index }"> |
| | | <el-tree-select |
| | | v-if="props.type === 'add'" |
| | | v-if="!isDetail && !row.productById" |
| | | v-model="row.productById" |
| | | placeholder="è¯·éæ©" |
| | | clearable |
| | |
| | | @change="(val) => getModels(val, row, $index)" |
| | | :data="productOptions" |
| | | :render-after-expand="false" |
| | | :disabled="isDetail" |
| | | style="width: 100%" |
| | | /> |
| | | <span v-else>{{ row.name }}</span> |
| | |
| | | </template> |
| | | <template #default="{ row }"> |
| | | <el-select |
| | | v-if="props.type === 'add'" |
| | | v-if="!isDetail && !row.productModelId" |
| | | v-model="row.productModelId" |
| | | placeholder="è¯·éæ©è§æ ¼" |
| | | filterable |
| | | clearable |
| | | @change="(val) => handleMaterialModelChange(val, row)" |
| | | :disabled="isDetail" |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="item in row.modelOptions" |
| | |
| | | style="width: 200px;" |
| | | @change="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="å®¡æ ¸ç¶æ:"> |
| | | <el-select v-model="searchForm.auditStatus" placeholder="è¯·éæ©" style="width: 200px;" @change="handleQuery"> |
| | | <el-option v-for="item in auditStatusOptions" :key="item.value" :label="item.label" :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="å®¡æ ¸ç¶æ:">--> |
| | | <!-- <el-select v-model="searchForm.auditStatus" placeholder="è¯·éæ©" style="width: 200px;" @change="handleQuery">--> |
| | | <!-- <el-option v-for="item in auditStatusOptions" :key="item.value" :label="item.label" :value="item.value">--> |
| | | <!-- </el-option>--> |
| | | <!-- </el-select>--> |
| | | <!-- </el-form-item>--> |
| | | <el-form-item> |
| | | <el-button type="primary" |
| | | @click="handleQuery">æç´¢</el-button> |
| | |
| | | prop: "deviceName", |
| | | width: 120, |
| | | }, |
| | | { |
| | | label: "å®¡æ ¸äºº", |
| | | prop: "auditUserName", |
| | | width: 120, |
| | | }, |
| | | { |
| | | label: "å®¡æ ¸ç¶æ", |
| | | prop: "auditStatus", |
| | | width: 120, |
| | | dataType: "tag", |
| | | formatData: val => { |
| | | const statusMap = { 0: "æªå®¡æ ¸", 1: "éè¿", 2: "ä¸éè¿" }; |
| | | return statusMap[val] ?? "æªç¥"; |
| | | }, |
| | | formatType: val => { |
| | | const typeMap = { 0: "info", 1: "success", 2: "danger" }; |
| | | return typeMap[val] ?? ""; |
| | | }, |
| | | }, |
| | | { |
| | | label: "æç»å®¡æ ¸äºº", |
| | | prop: "sureAuditUserName", |
| | | width: 120, |
| | | }, |
| | | // { |
| | | // label: "å®¡æ ¸äºº", |
| | | // prop: "auditUserName", |
| | | // width: 120, |
| | | // }, |
| | | // { |
| | | // label: "å®¡æ ¸ç¶æ", |
| | | // prop: "auditStatus", |
| | | // width: 120, |
| | | // dataType: "tag", |
| | | // formatData: val => { |
| | | // const statusMap = { 0: "æªå®¡æ ¸", 1: "éè¿", 2: "ä¸éè¿" }; |
| | | // return statusMap[val] ?? "æªç¥"; |
| | | // }, |
| | | // formatType: val => { |
| | | // const typeMap = { 0: "info", 1: "success", 2: "danger" }; |
| | | // return typeMap[val] ?? ""; |
| | | // }, |
| | | // }, |
| | | // { |
| | | // label: "æç»å®¡æ ¸äºº", |
| | | // prop: "sureAuditUserName", |
| | | // width: 120, |
| | | // }, |
| | | { |
| | | label: "产ååç§°", |
| | | prop: "productName", |
| | |
| | | { |
| | | label: "æ¥åºæ°é", |
| | | prop: "scrapQty", |
| | | width: 120, |
| | | }, |
| | | { |
| | | label: "å æ¾æ°", |
| | | prop: "addQty", |
| | | width: 120, |
| | | }, |
| | | { |
| | |
| | | deleteReport(row); |
| | | }, |
| | | }, |
| | | { |
| | | name:"å®¡æ ¸", |
| | | clickFun: row => { |
| | | handleAudit(row); |
| | | }, |
| | | disabled: row => !(Number(row?.auditStatus) === 0 && (Number(row?.auditUserId) === -1 || Number(row?.auditUserId) === Number(userStore.id))) |
| | | }, |
| | | // { |
| | | // name:"å®¡æ ¸", |
| | | // clickFun: row => { |
| | | // handleAudit(row); |
| | | // }, |
| | | // disabled: row => !(Number(row?.auditStatus) === 0 && (Number(row?.auditUserId) === -1 || Number(row?.auditUserId) === Number(userStore.id))) |
| | | // }, |
| | | ], |
| | | }, |
| | | ]); |
| | |
| | | step="1" |
| | | placeholder="请è¾å
¥æ¬æ¬¡ç产æ°é" |
| | | style="width: 100%" |
| | | :class="{ 'over-limit': reportForm.quantity > reportForm.planQuantity }" |
| | | @input="handleQuantityInput" |
| | | /> |
| | | </el-form-item> |
| | |
| | | step="1" |
| | | placeholder="请è¾å
¥æ¥åºæ°é" |
| | | @input="handleScrapQtyInput" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="12"> |
| | | <el-form-item label="å æ¾æ°" prop="addQty"> |
| | | <el-input |
| | | v-model.number="reportForm.addQty" |
| | | type="number" |
| | | min="0" |
| | | step="1" |
| | | placeholder="请è¾å
¥å æ¾æ°" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-col>--> |
| | | |
| | | <el-col :span="12"> |
| | | <el-form-item label="å®¡æ ¸äºº" prop="auditUserId"> |
| | | <el-select |
| | | v-model="reportForm.auditUserId" |
| | | placeholder="è¯·éæ©å®¡æ ¸äºº" |
| | | clearable |
| | | filterable |
| | | @change="handleReviewerIdChange" |
| | | > |
| | | <el-option |
| | | v-for="user in userOptions" |
| | | :key="user.userId" |
| | | :label="user.nickName" |
| | | :value="user.userId" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <!-- <el-col :span="12">--> |
| | | <!-- <el-form-item label="å®¡æ ¸äºº" prop="auditUserId">--> |
| | | <!-- <el-select--> |
| | | <!-- v-model="reportForm.auditUserId"--> |
| | | <!-- placeholder="è¯·éæ©å®¡æ ¸äºº"--> |
| | | <!-- clearable--> |
| | | <!-- filterable--> |
| | | <!-- @change="handleReviewerIdChange"--> |
| | | <!-- >--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="user in userOptions"--> |
| | | <!-- :key="user.userId"--> |
| | | <!-- :label="user.nickName"--> |
| | | <!-- :value="user.userId"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-col>--> |
| | | |
| | | </el-row> |
| | | </el-form> |
| | |
| | | planQuantity: 0, |
| | | quantity: null, |
| | | scrapQty: null, |
| | | addQty: 0, |
| | | startTime: "", |
| | | endTime: "", |
| | | userName: "", |
| | |
| | | scrapQty: [{validator: validateScrapQty, trigger: "blur"}], |
| | | startTime: [{required: true, message: "è¯·éæ©å¼å§æ¶é´", trigger: "change"}], |
| | | endTime: [{required: true, message: "è¯·éæ©ç»ææ¶é´", trigger: "change"}], |
| | | auditUserId: [{required: true, message: "è¯·éæ©å®¡æ ¸äºº", trigger: "change"}], |
| | | // auditUserId: [{required: true, message: "è¯·éæ©å®¡æ ¸äºº", trigger: "change"}], |
| | | teamList: [{required: true, message: "è¯·éæ©çç»", trigger: "change"}], |
| | | deviceId: [{required: true, message: "è¯·éæ©è®¾å¤", trigger: "change"}], |
| | | }; |
| | |
| | | } |
| | | const num = Number(value); |
| | | if (isNaN(num)) { |
| | | return; |
| | | } |
| | | // 妿è¶
è¿å¾
ç产æ°é |
| | | if (num > reportForm.planQuantity) { |
| | | proxy.$modal.msgWarning("æ¬æ¬¡ç产æ°éä¸è½å¤§äºå¾
ç产æ°é"); |
| | | reportForm.quantity = reportForm.planQuantity; |
| | | return; |
| | | } |
| | | // 妿å°äº1ï¼æ¸
é¤ |
| | |
| | | reportForm.replenishQty = 0; |
| | | reportForm.teamList = []; |
| | | reportForm.scrapQty = 0; |
| | | reportForm.addQty = 0; |
| | | reportForm.userIds = row.userIds || []; |
| | | |
| | | const ids = (row.userIds || "") |
| | |
| | | .filter(Boolean); |
| | | |
| | | reportForm.userIdsList = userTeamOptions.value |
| | | .filter(item => ids.includes(String(item.userId))) |
| | | // .filter(item => ids.includes(String(item.userId))) |
| | | .map(item => ({ |
| | | userId: item.userId, |
| | | nickName: item.nickName |
| | |
| | | return; |
| | | } |
| | | |
| | | if (quantity > reportForm.planQuantity) { |
| | | ElMessageBox.alert("æ¬æ¬¡ç产æ°éä¸è½è¶
è¿å¾
ç产æ°é", "æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | | }); |
| | | return; |
| | | } |
| | | // if (quantity > reportForm.planQuantity) { |
| | | // ElMessageBox.alert("æ¬æ¬¡ç产æ°éä¸è½è¶
è¿å¾
ç产æ°é", "æç¤º", { |
| | | // confirmButtonText: "ç¡®å®", |
| | | // }); |
| | | // return; |
| | | // } |
| | | |
| | | const submitData = { |
| | | ...reportForm, |
| | |
| | | white-space: normal !important; |
| | | word-break: break-all; |
| | | } |
| | | |
| | | .over-limit .el-input__inner { |
| | | color: #f56c6c !important; |
| | | } |
| | | </style> |
| | |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ£éªåï¼" prop="checkName"> |
| | | <el-select v-model="form.checkName" placeholder="è¯·éæ©" clearable> |
| | | <el-select v-model="form.checkName" placeholder="è¯·éæ©" clearable filterable> |
| | | <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName" |
| | | :value="item.nickName"/> |
| | | </el-select> |
| | |
| | | const modelOptions = ref([]); |
| | | |
| | | // æå¼å¼¹æ¡ |
| | | const openDialog = async (type, row) => { |
| | | const openDialog = async (type, row, defaultCheckResult = "", defaultCheckName = "") => { |
| | | operationType.value = type; |
| | | dialogFormVisible.value = true; |
| | | // å
æ¸
空表åéªè¯ç¶æï¼é¿å
éªç |
| | | await nextTick(); |
| | | proxy.$refs.formRef?.clearValidate(); |
| | | |
| | | |
| | | // å¹¶è¡å è½½åºç¡æ°æ® |
| | | const [userListsRes] = await Promise.all([ |
| | | userListNoPage(), |
| | |
| | | supplierList.value = res.data; |
| | | }) |
| | | ]); |
| | | userList.value = userListsRes.data; |
| | | |
| | | // çé roleIds å
å« 106 çç¨æ· |
| | | userList.value = (userListsRes.data || []).filter(user => { |
| | | const roleIds = user.roleIds || []; |
| | | return roleIds.includes(106) || roleIds.includes('106'); |
| | | }); |
| | | |
| | | form.value = {} |
| | | testStandardOptions.value = []; |
| | | tableData.value = []; |
| | | |
| | | |
| | | if (operationType.value === 'edit') { |
| | | // å
ä¿å testStandardIdï¼é¿å
被æ¸
空 |
| | | const savedTestStandardId = row.testStandardId; |
| | | // å
è®¾ç½®è¡¨åæ°æ®ï¼ä½ææ¶æ¸
空 testStandardIdï¼çé项å è½½å®æåå设置 |
| | | form.value = {...row, testStandardId: ''} |
| | | // å¦æä¼ å
¥äºé»è®¤æ£æµç»æï¼è¦çrowä¸çå¼ |
| | | if (defaultCheckResult) { |
| | | form.value.checkResult = defaultCheckResult; |
| | | } |
| | | // å¦æä¼ å
¥äºé»è®¤æ£éªåï¼è¦çrowä¸çå¼ï¼ä¼å
使ç¨ä¼ å
¥çæ£éªåï¼ |
| | | console.log('formDia checkName debug:', { defaultCheckName, rowCheckName: row.checkName }); |
| | | form.value.checkName = defaultCheckName || row.checkName || ""; |
| | | currentProductId.value = row.productId || 0 |
| | | // æ¸
空éªè¯ç¶æï¼é¿å
æ°æ®å è½½è¿ç¨ä¸çæ ¡éªéªç |
| | | nextTick(() => { |
| | |
| | | <InspectionFormDia ref="inspectionFormDia" @close="handleQuery"></InspectionFormDia> |
| | | <FormDia ref="formDia" @close="handleQuery"></FormDia> |
| | | <files-dia ref="filesDia" @close="handleQuery"></files-dia> |
| | | <el-dialog v-model="dialogFormVisible" title="ç¼è¾æ£éªå" width="30%" |
| | | <!-- æ£éªç»æéæ©å¯¹è¯æ¡ --> |
| | | <el-dialog v-model="quickCheckVisible" title="æ£éªç»æ" width="30%" @close="closeQuickCheck"> |
| | | <el-form :model="quickCheckForm" label-width="140px" label-position="top" ref="quickCheckRef"> |
| | | <el-form-item label="æ£æµç»æï¼" required> |
| | | <el-radio-group v-model="quickCheckForm.checkResult"> |
| | | <el-radio value="åæ ¼">åæ ¼</el-radio> |
| | | <el-radio value="ä¸åæ ¼">ä¸åæ ¼</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item label="æ£éªåï¼"> |
| | | <el-select v-model="quickCheckForm.checkName" placeholder="è¯·éæ©" clearable style="width: 100%"> |
| | | <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName" :value="item.nickName"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="æ£æµæ¥æï¼"> |
| | | <el-date-picker |
| | | v-model="quickCheckForm.checkTime" |
| | | type="date" |
| | | placeholder="è¯·éæ©æ¥æ" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | clearable |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="handleQuickCheckConfirm">确认</el-button> |
| | | <el-button @click="closeQuickCheck">åæ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <el-dialog v-model="dialogFormVisible" title="ç¼è¾æ£éªå" width="30%" |
| | | @close="closeDia"> |
| | | <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef"> |
| | | <el-form-item label="æ£éªåï¼" prop="checkName"> |
| | | <el-select v-model="form.checkName" placeholder="è¯·éæ©" clearable> |
| | | <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName" |
| | | :value="item.nickName"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">确认</el-button> |
| | | <el-button @click="closeDia">åæ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef"> |
| | | <el-form-item label="æ£éªåï¼" prop="checkName"> |
| | | <el-select v-model="form.checkName" placeholder="è¯·éæ©" clearable> |
| | | <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName" |
| | | :value="item.nickName"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">确认</el-button> |
| | | <el-button @click="closeDia">åæ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | width: 280, |
| | | operation: [ |
| | | { |
| | | name: "ç¼è¾", |
| | | name: "æ£éª", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | openForm("edit", row); |
| | | openQuickCheck(row); |
| | | }, |
| | | disabled: (row) => { |
| | | // å·²æäº¤åç¦ç¨ |
| | |
| | | openFilesFormDia(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "æäº¤", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | submit(row.id); |
| | | }, |
| | | disabled: (row) => { |
| | | // å·²æäº¤åç¦ç¨ |
| | | if (row.inspectState == 1) return true; |
| | | // 妿æ£éªåæå¼ï¼åªæå½åç»å½ç¨æ·è½æäº¤ |
| | | if (row.checkName) { |
| | | return row.checkName !== userStore.nickName; |
| | | } |
| | | return false; |
| | | } |
| | | }, |
| | | { |
| | | name: "åé
æ£éªå", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | if (!row.checkName) { |
| | | open(row) |
| | | } else { |
| | | proxy.$modal.msgError("æ£éªåå·²åå¨"); |
| | | { |
| | | name: "æäº¤", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | submit(row.id); |
| | | }, |
| | | disabled: (row) => { |
| | | // å·²æäº¤åç¦ç¨ |
| | | if (row.inspectState == 1) return true; |
| | | // 妿æ£éªåæå¼ï¼åªæå½åç»å½ç¨æ·è½æäº¤ |
| | | if (row.checkName) { |
| | | return row.checkName !== userStore.nickName; |
| | | } |
| | | return false; |
| | | } |
| | | }, |
| | | disabled: (row) => { |
| | | return row.inspectState == 1 || row.checkName; |
| | | } |
| | | }, |
| | | { |
| | | name: "ä¸è½½", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | downLoadFile(row); |
| | | { |
| | | name: "åé
æ£éªå", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | if (!row.checkName) { |
| | | open(row) |
| | | } else { |
| | | proxy.$modal.msgError("æ£éªåå·²åå¨"); |
| | | } |
| | | }, |
| | | disabled: (row) => { |
| | | return row.inspectState == 1 || row.checkName; |
| | | } |
| | | }, |
| | | }, |
| | | { |
| | | name: "ä¸è½½", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | downLoadFile(row); |
| | | }, |
| | | }, |
| | | ], |
| | | }, |
| | | ]); |
| | |
| | | checkName: "" |
| | | }); |
| | | const dialogFormVisible = ref(false); |
| | | const quickCheckVisible = ref(false); |
| | | const quickCheckForm = ref({ |
| | | checkResult: "åæ ¼", |
| | | checkName: "", |
| | | checkTime: "" |
| | | }); |
| | | const quickCheckRef = ref(null); |
| | | |
| | | const changeDaterange = (value) => { |
| | | searchForm.value.entryDateStart = undefined; |
| | |
| | | |
| | | const open = async (row) => { |
| | | let userLists = await userListNoPage(); |
| | | userList.value = userLists.data; |
| | | // çé roleIds å
å« 106 çç¨æ· |
| | | userList.value = (userLists.data || []).filter(user => { |
| | | const roleIds = user.roleIds || []; |
| | | return roleIds.includes(106) || roleIds.includes('106'); |
| | | }); |
| | | currentRow.value = row |
| | | dialogFormVisible.value = true |
| | | } |
| | |
| | | type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', |
| | | }) |
| | | const downloadUrl = window.URL.createObjectURL(blob) |
| | | |
| | | |
| | | const link = document.createElement('a') |
| | | link.href = downloadUrl |
| | | link.download = 'åæææ£éªæ¥å.docx' |
| | | document.body.appendChild(link) |
| | | link.click() |
| | | |
| | | |
| | | document.body.removeChild(link) |
| | | window.URL.revokeObjectURL(downloadUrl) |
| | | }) |
| | | }; |
| | | |
| | | // æå¼æ£éªç»æéæ©å¯¹è¯æ¡ |
| | | const openQuickCheck = async (row) => { |
| | | currentRow.value = row; |
| | | // å è½½ç¨æ·å表ï¼çé roleIds å
å« 106 çç¨æ· |
| | | try { |
| | | const userLists = await userListNoPage(); |
| | | userList.value = (userLists.data || []).filter(user => { |
| | | const roleIds = user.roleIds || []; |
| | | return roleIds.includes(106) || roleIds.includes('106'); |
| | | }); |
| | | } catch (e) { |
| | | console.error("å è½½æ£éªåå表失败", e); |
| | | userList.value = []; |
| | | } |
| | | // 设置é»è®¤å¼ï¼æ£éªåé»è®¤ä¸ºå½åç»å½ç¨æ·ï¼ |
| | | quickCheckForm.value = { |
| | | checkResult: "åæ ¼", |
| | | checkName: userStore.nickName || "", |
| | | checkTime: dayjs().format("YYYY-MM-DD") |
| | | }; |
| | | quickCheckVisible.value = true; |
| | | }; |
| | | |
| | | // å
³éæ£éªç»æéæ©å¯¹è¯æ¡ |
| | | const closeQuickCheck = () => { |
| | | quickCheckVisible.value = false; |
| | | quickCheckForm.value = { |
| | | checkResult: "åæ ¼", |
| | | checkName: "", |
| | | checkTime: "" |
| | | }; |
| | | }; |
| | | |
| | | // 确认æ£éªç»æ |
| | | const handleQuickCheckConfirm = () => { |
| | | if (!quickCheckForm.value.checkResult) { |
| | | proxy.$modal.msgWarning("è¯·éæ©æ£æµç»æ"); |
| | | return; |
| | | } |
| | | if (!quickCheckForm.value.checkName) { |
| | | proxy.$modal.msgWarning("è¯·éæ©æ£éªå"); |
| | | return; |
| | | } |
| | | if (!quickCheckForm.value.checkTime) { |
| | | proxy.$modal.msgWarning("è¯·éæ©æ£æµæ¥æ"); |
| | | return; |
| | | } |
| | | |
| | | if (quickCheckForm.value.checkResult === "åæ ¼") { |
| | | // åæ ¼ï¼ç´æ¥æäº¤ |
| | | const data = { |
| | | id: currentRow.value.id, |
| | | checkResult: "åæ ¼", |
| | | checkName: quickCheckForm.value.checkName, |
| | | checkTime: quickCheckForm.value.checkTime, |
| | | inspectType: 2 |
| | | }; |
| | | qualityInspectUpdate(data).then(res => { |
| | | proxy.$modal.msgSuccess("æ£éªæå"); |
| | | closeQuickCheck(); |
| | | getList(); |
| | | }); |
| | | } else { |
| | | // ä¸åæ ¼ï¼æå¼è¯¦ç»å¡«å页é¢ï¼ä¼ 鿣éªåä¿¡æ¯ |
| | | // å
ä¿åæ£éªåå¼ï¼é¿å
closeQuickCheck éç½®å丢失 |
| | | const checkNameToPass = quickCheckForm.value.checkName; |
| | | closeQuickCheck(); |
| | | nextTick(() => { |
| | | formDia.value?.openDialog("edit", currentRow.value, "ä¸åæ ¼", checkNameToPass); |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | getList(); |
| | | }); |
| | |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ£éªåï¼" prop="checkName"> |
| | | <el-select v-model="form.checkName" placeholder="è¯·éæ©" clearable> |
| | | <el-select v-model="form.checkName" placeholder="è¯·éæ©" clearable filterable> |
| | | <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName" |
| | | :value="item.nickName"/> |
| | | </el-select> |
| | |
| | | const modelOptions = ref([]); |
| | | |
| | | // æå¼å¼¹æ¡ |
| | | const openDialog = async (type, row) => { |
| | | const openDialog = async (type, row, defaultCheckResult = "", defaultCheckName = "") => { |
| | | operationType.value = type; |
| | | getOptions().then((res) => { |
| | | supplierList.value = res.data; |
| | |
| | | processList.value = []; |
| | | } |
| | | let userLists = await userListNoPage(); |
| | | userList.value = userLists.data; |
| | | // å
éç½®è¡¨åæ°æ®ï¼ä¿æåæ®µå®æ´ï¼é¿å
å¼¹çªé¦æ¬¡æ¸²ææ¶è§¦åå¿
填红æ¡âéªä¸ä¸âï¼ |
| | | // çé roleIds å
å« 106 çç¨æ· |
| | | userList.value = (userLists.data || []).filter(user => { |
| | | const roleIds = user.roleIds || []; |
| | | return roleIds.includes(106) || roleIds.includes('106'); |
| | | }); |
| | | // å
éç½®è¡¨åæ°æ®ï¼ä¿æåæ®µå®æ´ï¼é¿å
å¼¹çªé¦æ¬¡æ¸²ææ¶è§¦åå¿
填红æ¡"éªä¸ä¸"ï¼ |
| | | form.value = { |
| | | checkTime: "", |
| | | process: "", |
| | | checkName: "", |
| | | checkName: defaultCheckName || "", |
| | | productName: "", |
| | | productId: "", |
| | | productModelId: "", |
| | |
| | | unit: "", |
| | | quantity: "", |
| | | checkCompany: "", |
| | | checkResult: "", |
| | | checkResult: defaultCheckResult || "", |
| | | } |
| | | testStandardOptions.value = []; |
| | | tableData.value = []; |
| | |
| | | const savedTestStandardId = row.testStandardId; |
| | | // å
è®¾ç½®è¡¨åæ°æ®ï¼ä½ææ¶æ¸
空 testStandardIdï¼çé项å è½½å®æåå设置 |
| | | form.value = {...row, testStandardId: ''} |
| | | // å¦æä¼ å
¥äºé»è®¤æ£æµç»æï¼è¦çrowä¸çå¼ |
| | | if (defaultCheckResult) { |
| | | form.value.checkResult = defaultCheckResult; |
| | | } |
| | | // å¦æä¼ å
¥äºé»è®¤æ£éªåï¼è¦çrowä¸çå¼ï¼ä¼å
使ç¨ä¼ å
¥çæ£éªåï¼ |
| | | console.log('formDia checkName debug:', { defaultCheckName, rowCheckName: row.checkName }); |
| | | form.value.checkName = defaultCheckName || row.checkName || ""; |
| | | currentProductId.value = row.productId || 0 |
| | | // å
³é®ï¼ç¼è¾æ¶å è½½è§æ ¼åå·ä¸æéé¡¹ï¼æè½åæ¾ productModelId |
| | | if (currentProductId.value) { |
| | |
| | | <InspectionFormDia ref="inspectionFormDia" @close="handleQuery"></InspectionFormDia> |
| | | <FormDia ref="formDia" @close="handleQuery"></FormDia> |
| | | <files-dia ref="filesDia" @close="handleQuery"></files-dia> |
| | | <el-dialog v-model="dialogFormVisible" title="ç¼è¾æ£éªå" width="30%" |
| | | <!-- æ£éªç»æéæ©å¯¹è¯æ¡ --> |
| | | <el-dialog v-model="quickCheckVisible" title="æ£éªç»æ" width="30%" @close="closeQuickCheck"> |
| | | <el-form :model="quickCheckForm" label-width="140px" label-position="top" ref="quickCheckRef"> |
| | | <el-form-item label="æ£æµç»æï¼" required> |
| | | <el-radio-group v-model="quickCheckForm.checkResult"> |
| | | <el-radio value="åæ ¼">åæ ¼</el-radio> |
| | | <el-radio value="ä¸åæ ¼">ä¸åæ ¼</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item label="æ£éªåï¼"> |
| | | <el-select v-model="quickCheckForm.checkName" placeholder="è¯·éæ©" clearable style="width: 100%"> |
| | | <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName" :value="item.nickName"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="æ£æµæ¥æï¼"> |
| | | <el-date-picker |
| | | v-model="quickCheckForm.checkTime" |
| | | type="date" |
| | | placeholder="è¯·éæ©æ¥æ" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | clearable |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="handleQuickCheckConfirm">确认</el-button> |
| | | <el-button @click="closeQuickCheck">åæ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <el-dialog v-model="dialogFormVisible" title="ç¼è¾æ£éªå" width="30%" |
| | | @close="closeDia"> |
| | | <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef"> |
| | | <el-form-item label="æ£éªåï¼" prop="checkName"> |
| | | <el-select v-model="form.checkName" placeholder="è¯·éæ©" clearable> |
| | | <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName" |
| | | :value="item.nickName"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">确认</el-button> |
| | | <el-button @click="closeDia">åæ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef"> |
| | | <el-form-item label="æ£éªåï¼" prop="checkName"> |
| | | <el-select v-model="form.checkName" placeholder="è¯·éæ©" clearable> |
| | | <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName" |
| | | :value="item.nickName"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">确认</el-button> |
| | | <el-button @click="closeDia">åæ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | width: 280, |
| | | operation: [ |
| | | { |
| | | name: "ç¼è¾", |
| | | name: "æ£éª", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | openForm("edit", row); |
| | | openQuickCheck(row); |
| | | }, |
| | | disabled: (row) => { |
| | | // å·²æäº¤åç¦ç¨ |
| | |
| | | openFilesFormDia(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "æäº¤", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | submit(row.id); |
| | | }, |
| | | disabled: (row) => { |
| | | // å·²æäº¤åç¦ç¨ |
| | | if (row.inspectState == 1) return true; |
| | | // 妿æ£éªåæå¼ï¼åªæå½åç»å½ç¨æ·è½æäº¤ |
| | | if (row.checkName) { |
| | | return row.checkName !== userStore.nickName; |
| | | } |
| | | return false; |
| | | } |
| | | }, |
| | | { |
| | | name: "åé
æ£éªå", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | if (!row.checkName) { |
| | | open(row) |
| | | } else { |
| | | proxy.$modal.msgError("æ£éªåå·²åå¨"); |
| | | { |
| | | name: "æäº¤", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | submit(row.id); |
| | | }, |
| | | disabled: (row) => { |
| | | // å·²æäº¤åç¦ç¨ |
| | | if (row.inspectState == 1) return true; |
| | | // 妿æ£éªåæå¼ï¼åªæå½åç»å½ç¨æ·è½æäº¤ |
| | | if (row.checkName) { |
| | | return row.checkName !== userStore.nickName; |
| | | } |
| | | return false; |
| | | } |
| | | }, |
| | | disabled: (row) => { |
| | | return row.inspectState == 1 || row.checkName; |
| | | } |
| | | }, |
| | | { |
| | | name: "ä¸è½½", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | downLoadFile(row); |
| | | { |
| | | name: "åé
æ£éªå", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | if (!row.checkName) { |
| | | open(row) |
| | | } else { |
| | | proxy.$modal.msgError("æ£éªåå·²åå¨"); |
| | | } |
| | | }, |
| | | disabled: (row) => { |
| | | return row.inspectState == 1 || row.checkName; |
| | | } |
| | | }, |
| | | }, |
| | | { |
| | | name: "ä¸è½½", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | downLoadFile(row); |
| | | }, |
| | | }, |
| | | ], |
| | | }, |
| | | ]); |
| | |
| | | const form = ref({ |
| | | checkName: "" |
| | | }); |
| | | const quickCheckVisible = ref(false); |
| | | const quickCheckForm = ref({ |
| | | checkResult: "åæ ¼", |
| | | checkName: "", |
| | | checkTime: "" |
| | | }); |
| | | const quickCheckRef = ref(null); |
| | | const page = reactive({ |
| | | current: 1, |
| | | size: 100, |
| | |
| | | } |
| | | const open = async (row) => { |
| | | let userLists = await userListNoPage(); |
| | | userList.value = userLists.data; |
| | | // çé roleIds å
å« 106 çç¨æ· |
| | | userList.value = (userLists.data || []).filter(user => { |
| | | const roleIds = user.roleIds || []; |
| | | return roleIds.includes(106) || roleIds.includes('106'); |
| | | }); |
| | | currentRow.value = row |
| | | dialogFormVisible.value = true |
| | | } |
| | |
| | | type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', |
| | | }) |
| | | const downloadUrl = window.URL.createObjectURL(blob) |
| | | |
| | | |
| | | const link = document.createElement('a') |
| | | link.href = downloadUrl |
| | | link.download = 'è¿ç¨æ£éªæ¥å.docx' |
| | | document.body.appendChild(link) |
| | | link.click() |
| | | |
| | | |
| | | document.body.removeChild(link) |
| | | window.URL.revokeObjectURL(downloadUrl) |
| | | }) |
| | |
| | | proxy.$modal.msg("已忶"); |
| | | }); |
| | | }; |
| | | |
| | | // æå¼æ£éªç»æéæ©å¯¹è¯æ¡ |
| | | const openQuickCheck = async (row) => { |
| | | currentRow.value = row; |
| | | // å è½½ç¨æ·å表ï¼çé roleIds å
å« 106 çç¨æ· |
| | | try { |
| | | const userLists = await userListNoPage(); |
| | | userList.value = (userLists.data || []).filter(user => { |
| | | const roleIds = user.roleIds || []; |
| | | return roleIds.includes(106) || roleIds.includes('106'); |
| | | }); |
| | | } catch (e) { |
| | | console.error("å è½½æ£éªåå表失败", e); |
| | | userList.value = []; |
| | | } |
| | | // 设置é»è®¤å¼ï¼æ£éªåé»è®¤ä¸ºå½åç»å½ç¨æ·ï¼ |
| | | quickCheckForm.value = { |
| | | checkResult: "åæ ¼", |
| | | checkName: userStore.nickName || "", |
| | | checkTime: dayjs().format("YYYY-MM-DD") |
| | | }; |
| | | quickCheckVisible.value = true; |
| | | }; |
| | | |
| | | // å
³éæ£éªç»æéæ©å¯¹è¯æ¡ |
| | | const closeQuickCheck = () => { |
| | | quickCheckVisible.value = false; |
| | | quickCheckForm.value = { |
| | | checkResult: "åæ ¼", |
| | | checkName: "", |
| | | checkTime: "" |
| | | }; |
| | | }; |
| | | |
| | | // 确认æ£éªç»æ |
| | | const handleQuickCheckConfirm = () => { |
| | | if (!quickCheckForm.value.checkResult) { |
| | | proxy.$modal.msgWarning("è¯·éæ©æ£æµç»æ"); |
| | | return; |
| | | } |
| | | if (!quickCheckForm.value.checkName) { |
| | | proxy.$modal.msgWarning("è¯·éæ©æ£éªå"); |
| | | return; |
| | | } |
| | | if (!quickCheckForm.value.checkTime) { |
| | | proxy.$modal.msgWarning("è¯·éæ©æ£æµæ¥æ"); |
| | | return; |
| | | } |
| | | |
| | | if (quickCheckForm.value.checkResult === "åæ ¼") { |
| | | // åæ ¼ï¼ç´æ¥æäº¤ |
| | | const data = { |
| | | id: currentRow.value.id, |
| | | checkResult: "åæ ¼", |
| | | checkName: quickCheckForm.value.checkName, |
| | | checkTime: quickCheckForm.value.checkTime, |
| | | inspectType: 1 |
| | | }; |
| | | qualityInspectUpdate(data).then(res => { |
| | | proxy.$modal.msgSuccess("æ£éªæå"); |
| | | closeQuickCheck(); |
| | | getList(); |
| | | }); |
| | | } else { |
| | | // ä¸åæ ¼ï¼æå¼è¯¦ç»å¡«å页é¢ï¼ä¼ 鿣éªåä¿¡æ¯ |
| | | // å
ä¿åæ£éªåå¼ï¼é¿å
closeQuickCheck éç½®å丢失 |
| | | const checkNameToPass = quickCheckForm.value.checkName; |
| | | closeQuickCheck(); |
| | | nextTick(() => { |
| | | formDia.value?.openDialog("edit", currentRow.value, "ä¸åæ ¼", checkNameToPass); |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | getList(); |
| | | }); |
| | |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ£éªåï¼" prop="checkName"> |
| | | <el-select v-model="form.checkName" placeholder="è¯·éæ©" clearable style="width: 100%"> |
| | | <el-select v-model="form.checkName" placeholder="è¯·éæ©" clearable style="width: 100%" filterable> |
| | | <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName" :value="item.nickName"/> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | }); |
| | | |
| | | // æå¼å¼¹æ¡ |
| | | const openDialog = async (type, row) => { |
| | | const openDialog = async (type, row, defaultCheckResult = "", defaultCheckName = "") => { |
| | | operationType.value = type; |
| | | getOptions().then((res) => { |
| | | supplierList.value = res.data; |
| | |
| | | |
| | | try { |
| | | const userRes = await userListNoPage(); |
| | | userList.value = userRes.data || []; |
| | | // çé roleIds å
å« 106 çç¨æ· |
| | | userList.value = (userRes.data || []).filter(user => { |
| | | const roleIds = user.roleIds || []; |
| | | return roleIds.includes(106) || roleIds.includes('106'); |
| | | }); |
| | | } catch (e) { |
| | | console.error("å è½½æ£éªåå表失败", e); |
| | | userList.value = []; |
| | | } |
| | | // å
éç½®è¡¨åæ°æ®ï¼ä¿æåæ®µå®æ´ï¼é¿å
å¼¹çªé¦æ¬¡æ¸²ææ¶è§¦åå¿
填红æ¡âéªä¸ä¸âï¼ |
| | | // å
éç½®è¡¨åæ°æ®ï¼ä¿æåæ®µå®æ´ï¼é¿å
å¼¹çªé¦æ¬¡æ¸²ææ¶è§¦åå¿
填红æ¡"éªä¸ä¸"ï¼ |
| | | form.value = { |
| | | checkTime: "", |
| | | supplier: "", |
| | | checkName: "", |
| | | checkName: defaultCheckName || "", |
| | | productName: "", |
| | | productId: "", |
| | | productModelId: "", |
| | |
| | | unit: "", |
| | | quantity: "", |
| | | checkCompany: "", |
| | | checkResult: "", |
| | | checkResult: defaultCheckResult || "", |
| | | } |
| | | testStandardOptions.value = []; |
| | | tableData.value = []; |
| | |
| | | // å
ä¿å testStandardIdï¼é¿å
被æ¸
空 |
| | | const savedTestStandardId = row.testStandardId; |
| | | form.value = {...row} |
| | | // å¦æä¼ å
¥äºé»è®¤æ£æµç»æï¼è¦çrowä¸çå¼ |
| | | if (defaultCheckResult) { |
| | | form.value.checkResult = defaultCheckResult; |
| | | } |
| | | // å¦æä¼ å
¥äºé»è®¤æ£éªåï¼è¦çrowä¸çå¼ï¼ä¼å
使ç¨ä¼ å
¥çæ£éªåï¼ |
| | | console.log('formDia checkName debug:', { defaultCheckName, rowCheckName: row.checkName }); |
| | | form.value.checkName = defaultCheckName || row.checkName || ""; |
| | | currentProductId.value = row.productId || 0 |
| | | // å
³é®ï¼ç¼è¾æ¶å è½½è§æ ¼åå·ä¸æéé¡¹ï¼æè½åæ¾ productModelId |
| | | if (currentProductId.value) { |
| | |
| | | <InspectionFormDia ref="inspectionFormDia" @close="handleQuery"></InspectionFormDia> |
| | | <FormDia ref="formDia" @close="handleQuery"></FormDia> |
| | | <files-dia ref="filesDia" @close="handleQuery"></files-dia> |
| | | <!-- æ£éªç»æéæ©å¯¹è¯æ¡ --> |
| | | <el-dialog v-model="quickCheckVisible" title="æ£éªç»æ" width="30%" @close="closeQuickCheck"> |
| | | <el-form :model="quickCheckForm" label-width="140px" label-position="top" ref="quickCheckRef"> |
| | | <el-form-item label="æ£æµç»æï¼" required> |
| | | <el-radio-group v-model="quickCheckForm.checkResult"> |
| | | <el-radio value="åæ ¼">åæ ¼</el-radio> |
| | | <el-radio value="ä¸åæ ¼">ä¸åæ ¼</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item label="æ£éªåï¼"> |
| | | <el-select v-model="quickCheckForm.checkName" placeholder="è¯·éæ©" clearable style="width: 100%"> |
| | | <el-option v-for="item in userList" :key="item.nickName" :label="item.nickName" :value="item.nickName"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="æ£æµæ¥æï¼"> |
| | | <el-date-picker |
| | | v-model="quickCheckForm.checkTime" |
| | | type="date" |
| | | placeholder="è¯·éæ©æ¥æ" |
| | | value-format="YYYY-MM-DD" |
| | | format="YYYY-MM-DD" |
| | | clearable |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="handleQuickCheckConfirm">确认</el-button> |
| | | <el-button @click="closeQuickCheck">åæ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <el-dialog v-model="dialogFormVisible" title="ç¼è¾æ£éªå" width="30%" |
| | | @close="closeDia"> |
| | | <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef"> |
| | |
| | | width: 280, |
| | | operation: [ |
| | | { |
| | | name: "ç¼è¾", |
| | | name: "æ£éª", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | openForm("edit", row); |
| | | openQuickCheck(row); |
| | | }, |
| | | disabled: (row) => { |
| | | // å·²æäº¤åç¦ç¨ |
| | |
| | | const form = ref({ |
| | | checkName: "" |
| | | }); |
| | | const quickCheckVisible = ref(false); |
| | | const quickCheckForm = ref({ |
| | | checkResult: "åæ ¼", |
| | | checkName: "", |
| | | checkTime: "" |
| | | }); |
| | | const quickCheckRef = ref(null); |
| | | const page = reactive({ |
| | | current: 1, |
| | | size: 100, |
| | |
| | | |
| | | const open = async (row) => { |
| | | let userLists = await userListNoPage(); |
| | | userList.value = userLists.data; |
| | | // çé roleIds å
å« 106 çç¨æ· |
| | | userList.value = (userLists.data || []).filter(user => { |
| | | const roleIds = user.roleIds || []; |
| | | return roleIds.includes(106) || roleIds.includes('106'); |
| | | }); |
| | | currentRow.value = row |
| | | dialogFormVisible.value = true |
| | | } |
| | |
| | | }) |
| | | }; |
| | | |
| | | // æå¼æ£éªç»æéæ©å¯¹è¯æ¡ |
| | | const openQuickCheck = async (row) => { |
| | | currentRow.value = row; |
| | | // å è½½ç¨æ·å表ï¼çé roleIds å
å« 106 çç¨æ· |
| | | try { |
| | | const userLists = await userListNoPage(); |
| | | userList.value = (userLists.data || []).filter(user => { |
| | | const roleIds = user.roleIds || []; |
| | | return roleIds.includes(106) || roleIds.includes('106'); |
| | | }); |
| | | } catch (e) { |
| | | console.error("å è½½æ£éªåå表失败", e); |
| | | userList.value = []; |
| | | } |
| | | // 设置é»è®¤å¼ï¼æ£éªåé»è®¤ä¸ºå½åç»å½ç¨æ·ï¼ |
| | | quickCheckForm.value = { |
| | | checkResult: "åæ ¼", |
| | | checkName: userStore.nickName || "", |
| | | checkTime: dayjs().format("YYYY-MM-DD") |
| | | }; |
| | | quickCheckVisible.value = true; |
| | | }; |
| | | |
| | | // å
³éæ£éªç»æéæ©å¯¹è¯æ¡ |
| | | const closeQuickCheck = () => { |
| | | quickCheckVisible.value = false; |
| | | quickCheckForm.value = { |
| | | checkResult: "åæ ¼", |
| | | checkName: "", |
| | | checkTime: "" |
| | | }; |
| | | }; |
| | | |
| | | // 确认æ£éªç»æ |
| | | const handleQuickCheckConfirm = () => { |
| | | if (!quickCheckForm.value.checkResult) { |
| | | proxy.$modal.msgWarning("è¯·éæ©æ£æµç»æ"); |
| | | return; |
| | | } |
| | | if (!quickCheckForm.value.checkName) { |
| | | proxy.$modal.msgWarning("è¯·éæ©æ£éªå"); |
| | | return; |
| | | } |
| | | if (!quickCheckForm.value.checkTime) { |
| | | proxy.$modal.msgWarning("è¯·éæ©æ£æµæ¥æ"); |
| | | return; |
| | | } |
| | | |
| | | if (quickCheckForm.value.checkResult === "åæ ¼") { |
| | | // åæ ¼ï¼ç´æ¥æäº¤ |
| | | const data = { |
| | | id: currentRow.value.id, |
| | | checkResult: "åæ ¼", |
| | | checkName: quickCheckForm.value.checkName, |
| | | checkTime: quickCheckForm.value.checkTime, |
| | | inspectType: 0 |
| | | }; |
| | | qualityInspectUpdate(data).then(res => { |
| | | proxy.$modal.msgSuccess("æ£éªæå"); |
| | | closeQuickCheck(); |
| | | getList(); |
| | | }); |
| | | } else { |
| | | // ä¸åæ ¼ï¼æå¼è¯¦ç»å¡«å页é¢ï¼ä¼ 鿣éªåä¿¡æ¯ |
| | | // å
ä¿åæ£éªåå¼ï¼é¿å
closeQuickCheck éç½®å丢失 |
| | | const checkNameToPass = quickCheckForm.value.checkName; |
| | | closeQuickCheck(); |
| | | nextTick(() => { |
| | | formDia.value?.openDialog("edit", currentRow.value, "ä¸åæ ¼", checkNameToPass); |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | getList(); |
| | | }); |
| | |
| | | :formatter="formattedNumber" |
| | | /> |
| | | <el-table-column |
| | | label="忬¾éé¢(å
)" |
| | | prop="receiptPaymentAmount" |
| | | show-overflow-tooltip |
| | | :formatter="formattedNumber" |
| | | width="200" |
| | | /> |
| | | <el-table-column |
| | | label="åºæ¶éé¢(å
)" |
| | | prop="unReceiptPaymentAmount" |
| | | show-overflow-tooltip |
| | |
| | | width="200" |
| | | /> |
| | | <el-table-column |
| | | label="忬¾éé¢(å
)" |
| | | prop="receiptPaymentAmount" |
| | | show-overflow-tooltip |
| | | :formatter="formattedNumber" |
| | | width="200" |
| | | /> |
| | | <el-table-column |
| | | label="åºæ¶éé¢(å
)" |
| | | prop="unReceiptPaymentAmount" |
| | | show-overflow-tooltip |
| | |
| | | const { VITE_APP_ENV } = env; |
| | | const baseUrl = |
| | | env.VITE_APP_ENV === "development" |
| | | ? "http://1.15.17.182:9023" |
| | | ? "http://1.15.17.182:9038" |
| | | : env.VITE_BASE_API; |
| | | const javaUrl = |
| | | env.VITE_APP_ENV === "development" |
| | | ? "http://1.15.17.182:9023" |
| | | ? "http://1.15.17.182:9039" |
| | | : env.VITE_JAVA_API; |
| | | return { |
| | | define:{ |