From 8774a0e5edb89f586af09260e614f46d3ddade1b Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Thu, 8 Jan 2026 11:00:34 +0800 Subject: [PATCH] =?UTF-8?q?2026-01-08=20QC=E5=B7=A5=E4=BD=9C=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=A2=9E=E5=8A=A0SOP=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/qc/qc.js | 2 + src/views/modules/qc/FQCResultEntry.vue | 81 +++++++++-- src/views/modules/qc/IPQCResultEntry.vue | 121 ++++++++++++++++- src/views/modules/qc/IQCResultEntry.vue | 107 ++++++++++++++- src/views/modules/qc/OQCResultEntry.vue | 128 ++++++++++++------ .../yieldReport/com_process_inspection.vue | 80 ++++++++++- 6 files changed, 455 insertions(+), 64 deletions(-) diff --git a/src/api/qc/qc.js b/src/api/qc/qc.js index 145a11f..7638caf 100644 --- a/src/api/qc/qc.js +++ b/src/api/qc/qc.js @@ -244,6 +244,8 @@ export const getCustomerList = data => createAPI(`/pms/qc/getCustomerList`,'post // ===================================== SOP清单 ===================================== export const sopListSearch = data => createAPI(`/pms/qc/sopListSearch`,'post',data) export const sopAvailableFiles = data => createAPI(`/pms/qc/sopAvailableFiles`,'post',data) +// 查询检验页面的SOP文件列表(IPQC/IQC/FQC/OQC/过程检验) +export const searchQcSopFileList = data => createAPI(`/pms/qc/searchQcSopFileList`,'post',data) export const sopFileUploadSave = data => createAPI(`/pms/qc/sopFileUploadSave`,'post',data) export const sopRecordDelete = data => createAPI(`/pms/qc/sopList/delete`,'post',data) export const downloadSopFile = sopUrl => createAPI(`/pms/qc/downloadSopFile?sopUrl=${encodeURIComponent(sopUrl)}`,'post', 777) diff --git a/src/views/modules/qc/FQCResultEntry.vue b/src/views/modules/qc/FQCResultEntry.vue index 754142f..b6dd9e8 100644 --- a/src/views/modules/qc/FQCResultEntry.vue +++ b/src/views/modules/qc/FQCResultEntry.vue @@ -919,13 +919,31 @@ - - - - 上传文件 - - - + + + + + + 上传文件 + + + + + + + + + + + + + + + + + 关闭 @@ -1258,6 +1276,7 @@ import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js" import Chooselist from '@/views/modules/common/Chooselist_eam' import {getInspectionFile} from '@/api/eam/eam_object_list.js' + import { searchQcSopFileList, downloadSopFile } from '@/api/qc/qc.js' import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js' import {qcPrint} from '@/api/qc/qcPrint.js' import excel from "@/utils/excel-util.js" @@ -1325,6 +1344,10 @@ inspectionNo: '', fileFlag: false, fileContentList: [], + fileActiveTab: 'qcFile', + sopFileList: [], + sopFileLoading: false, + currentFileRow: null, // 是否收藏 favorite: false, // 导出 start @@ -3526,6 +3549,8 @@ // 刷新派设备文档的列表 getFileContentData (row) { + this.currentFileRow = row + this.fileActiveTab = 'qcFile' let currentData = { orderRef1: row.site, orderRef2: row.inspectionNo, @@ -3534,7 +3559,6 @@ } this.fileLoading = true getInspectionFile(currentData).then(({data}) => { - //区分请求成功和失败的状况 if (data && data.code === 0) { this.fileContentList = data.rows } else { @@ -3544,9 +3568,50 @@ }).catch(()=>{ this.fileLoading = false }) + this.getSopFileList(row) this.fileFlag = true }, + // 获取SOP文件列表(FQC传所有条件:site, partNo, operationDesc, workcenterNo, orderNo) + getSopFileList(row) { + this.sopFileLoading = true + this.sopFileList = [] + searchQcSopFileList({ + site: row.site, + partNo: row.partNo || '', + operationDesc: row.operationDesc || '', + workcenterNo: row.workCenterNo || '', + orderNo: row.orderNo || '' + }).then(({data}) => { + if (data && data.code === 0) { + this.sopFileList = data.rows || [] + } else { + this.sopFileList = [] + } + this.sopFileLoading = false + }).catch(() => { + this.sopFileList = [] + this.sopFileLoading = false + }) + }, + + previewSopFile(row) { + if (!row.sopUrl) { this.$message.warning('该文件暂无预览路径'); return } + const fileName = row.sopName || row.sopUrl + let fileSuffix = fileName.includes('.') ? fileName.substring(fileName.lastIndexOf('.') + 1).toLowerCase() : '' + const officeTypes = ['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx'] + if (officeTypes.includes(fileSuffix)) { this.$message.warning(`暂不支持在线预览${fileSuffix.toUpperCase()}文件`); return } + let mimeType = 'application/octet-stream' + if (['jpg', 'jpeg', 'png', 'gif', 'bmp'].includes(fileSuffix)) { mimeType = 'image/' + fileSuffix } + else if (['mp4', 'avi', 'mov', 'wmv', 'flv'].includes(fileSuffix)) { mimeType = 'video/' + fileSuffix } + else if (fileSuffix === 'pdf') { mimeType = 'application/pdf' } + else if (fileSuffix === 'txt') { mimeType = 'text/plain' } + downloadSopFile(row.sopUrl).then(({ data }) => { + const blob = new Blob([data], { type: mimeType }) + window.open(URL.createObjectURL(blob), '_blank') + }).catch(() => { this.$message.error('文件预览失败,请稍后重试') }) + }, + // 新增文件的modal addUploadFileModal () { let currentData = { diff --git a/src/views/modules/qc/IPQCResultEntry.vue b/src/views/modules/qc/IPQCResultEntry.vue index a27c33c..c5d7743 100644 --- a/src/views/modules/qc/IPQCResultEntry.vue +++ b/src/views/modules/qc/IPQCResultEntry.vue @@ -1011,13 +1011,38 @@ - - - - 上传文件 - - - + + + + + + + 上传文件 + + + + + + + + + + + + + + + + + + 关闭 @@ -1453,6 +1478,7 @@ import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js" import Chooselist from '@/views/modules/common/Chooselist_eam' import {getInspectionFile} from '@/api/eam/eam_object_list.js' + import { searchQcSopFileList, downloadSopFile } from '@/api/qc/qc.js' import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js' import {qcPrint} from '@/api/qc/qcPrint.js' import excel from "@/utils/excel-util.js" @@ -1521,6 +1547,11 @@ inspectionNo: '', fileFlag: false, fileContentList: [], + fileActiveTab: 'qcFile', + // SOP文件相关 + sopFileList: [], + sopFileLoading: false, + currentFileRow: null, // 是否收藏 favorite: false, // 导出 start @@ -3429,6 +3460,8 @@ //刷新派设备文档的列表 getFileContentData (row) { + this.currentFileRow = row + this.fileActiveTab = 'qcFile' let currentData = { orderRef1: row.site, orderRef2: row.inspectionNo, @@ -3447,9 +3480,83 @@ }).catch(()=>{ this.fileLoading = false }) + // 同时获取SOP文件列表 + this.getSopFileList(row) this.fileFlag = true }, + // 获取SOP文件列表(IPQC传所有条件:site, partNo, operationDesc, workcenterNo, orderNo) + getSopFileList(row) { + this.sopFileLoading = true + this.sopFileList = [] + searchQcSopFileList({ + site: row.site, + partNo: row.partNo || '', + operationDesc: row.operationDesc || '', + workcenterNo: row.workCenterNo || '', + orderNo: row.orderNo || '' + }).then(({data}) => { + if (data && data.code === 0) { + this.sopFileList = data.rows || [] + } else { + this.sopFileList = [] + } + this.sopFileLoading = false + }).catch(() => { + this.sopFileList = [] + this.sopFileLoading = false + }) + }, + + // 预览SOP文件 + previewSopFile(row) { + if (!row.sopUrl) { + this.$message.warning('该文件暂无预览路径') + return + } + + // 获取文件后缀 + const fileName = row.sopName || row.sopUrl + let fileSuffix = '' + if (fileName.includes('.')) { + fileSuffix = fileName.substring(fileName.lastIndexOf('.') + 1).toLowerCase() + } + + // 判断文件类型 + const imageTypes = ['jpg', 'jpeg', 'png', 'gif', 'bmp'] + const videoTypes = ['mp4', 'avi', 'mov', 'wmv', 'flv'] + const pdfTypes = ['pdf'] + const txtTypes = ['txt'] + const officeTypes = ['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx'] + + // 不支持的文件类型 + if (officeTypes.includes(fileSuffix)) { + this.$message.warning(`暂不支持在线预览${fileSuffix.toUpperCase()}文件`) + return + } + + // 设置MIME类型 + let mimeType = 'application/octet-stream' + if (imageTypes.includes(fileSuffix)) { + mimeType = 'image/' + fileSuffix + } else if (videoTypes.includes(fileSuffix)) { + mimeType = 'video/' + fileSuffix + } else if (pdfTypes.includes(fileSuffix)) { + mimeType = 'application/pdf' + } else if (txtTypes.includes(fileSuffix)) { + mimeType = 'text/plain' + } + + // 调用下载API并创建Blob预览 + downloadSopFile(row.sopUrl).then(({ data }) => { + const blob = new Blob([data], { type: mimeType }) + const fileURL = URL.createObjectURL(blob) + window.open(fileURL, '_blank') + }).catch(() => { + this.$message.error('文件预览失败,请稍后重试') + }) + }, + /*新增文件的modal*/ addUploadFileModal () { let currentData = { diff --git a/src/views/modules/qc/IQCResultEntry.vue b/src/views/modules/qc/IQCResultEntry.vue index 0da563d..917ba3b 100644 --- a/src/views/modules/qc/IQCResultEntry.vue +++ b/src/views/modules/qc/IQCResultEntry.vue @@ -653,13 +653,38 @@ - - - - 上传文件 - - - + + + + + + + 上传文件 + + + + + + + + + + + + + + + + + + 关闭 @@ -1099,6 +1124,7 @@ import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js" import Chooselist from '@/views/modules/common/Chooselist_eam' import {getInspectionFile} from '@/api/eam/eam_object_list.js' + import { searchQcSopFileList, downloadSopFile } from '@/api/qc/qc.js' import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js' import {qcPrint} from '@/api/qc/qcPrint.js' import excel from "@/utils/excel-util.js" @@ -2141,6 +2167,10 @@ options: [], fileFlag: false, fileContentList: [], + fileActiveTab: 'qcFile', + sopFileList: [], + sopFileLoading: false, + currentFileRow: null, IQCSelections: [], batchHandleAddModalFlag: false, batchAddData: { @@ -2657,6 +2687,8 @@ // 刷新派设备文档的列表 getFileContentData (row) { + this.currentFileRow = row + this.fileActiveTab = 'qcFile' let currentData = { orderRef1: row.site, orderRef2: row.inspectionNo, @@ -2675,9 +2707,70 @@ }).catch(()=>{ this.fileLoading = false }) + // 同时获取SOP文件列表 + this.getSopFileList(row) this.fileFlag = true }, + // 获取SOP文件列表(IQC只传site和partNo) + getSopFileList(row) { + this.sopFileLoading = true + this.sopFileList = [] + searchQcSopFileList({ + site: row.site, + partNo: row.partNo || '' + }).then(({data}) => { + if (data && data.code === 0) { + this.sopFileList = data.rows || [] + } else { + this.sopFileList = [] + } + this.sopFileLoading = false + }).catch(() => { + this.sopFileList = [] + this.sopFileLoading = false + }) + }, + + // 预览SOP文件 + previewSopFile(row) { + if (!row.sopUrl) { + this.$message.warning('该文件暂无预览路径') + return + } + const fileName = row.sopName || row.sopUrl + let fileSuffix = '' + if (fileName.includes('.')) { + fileSuffix = fileName.substring(fileName.lastIndexOf('.') + 1).toLowerCase() + } + const imageTypes = ['jpg', 'jpeg', 'png', 'gif', 'bmp'] + const videoTypes = ['mp4', 'avi', 'mov', 'wmv', 'flv'] + const pdfTypes = ['pdf'] + const txtTypes = ['txt'] + const officeTypes = ['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx'] + if (officeTypes.includes(fileSuffix)) { + this.$message.warning(`暂不支持在线预览${fileSuffix.toUpperCase()}文件`) + return + } + let mimeType = 'application/octet-stream' + if (imageTypes.includes(fileSuffix)) { + mimeType = 'image/' + fileSuffix + } else if (videoTypes.includes(fileSuffix)) { + mimeType = 'video/' + fileSuffix + } else if (pdfTypes.includes(fileSuffix)) { + mimeType = 'application/pdf' + } else if (txtTypes.includes(fileSuffix)) { + mimeType = 'text/plain' + } + downloadSopFile(row.sopUrl).then(({ data }) => { + const blob = new Blob([data], { type: mimeType }) + const fileURL = URL.createObjectURL(blob) + window.open(fileURL, '_blank') + }).catch(() => { + this.$message.error('文件预览失败,请稍后重试') + }) + }, + // 新增文件的modal addUploadFileModal () { let currentData = { diff --git a/src/views/modules/qc/OQCResultEntry.vue b/src/views/modules/qc/OQCResultEntry.vue index 472e828..e8d0861 100644 --- a/src/views/modules/qc/OQCResultEntry.vue +++ b/src/views/modules/qc/OQCResultEntry.vue @@ -617,45 +617,45 @@ - - - - 上传文件 - - - - - - - - - - + + + + + + 上传文件 + + + + + + + + + + + + + + + + + + + + + + + + 关闭 @@ -984,7 +984,9 @@ addOQCItemDetails, deleteOQCItemDetails, getOQCTemplateList, - importOQCTemplateItems + importOQCTemplateItems, + searchQcSopFileList, + downloadSopFile } from "@/api/qc/qc.js" import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js" import Chooselist from '@/views/modules/common/Chooselist_eam' @@ -1918,6 +1920,10 @@ options: [], fileFlag: false, fileContentList: [], + fileActiveTab: 'qcFile', + sopFileList: [], + sopFileLoading: false, + currentFileRow: null, FQASSelections: [], batchHandleAddModalFlag: false, batchAddData: { @@ -2442,6 +2448,8 @@ // 刷新派设备文档的列表 getFileContentData (row) { + this.currentFileRow = row + this.fileActiveTab = 'qcFile' this.fileData = { site: row.site, buNo: row.buNo, @@ -2450,16 +2458,54 @@ inspectionTypeNo: '109' } getFileContentList2(this.fileData).then(({data}) => { - //区分请求成功和失败的状况 if (data && data.code == 200) { this.fileContentList = data.rows } else { this.fileContentList = [] } }) + this.getSopFileList(row) this.fileFlag = true }, + // 获取SOP文件列表(OQC传site、partNo和orderNo) + getSopFileList(row) { + this.sopFileLoading = true + this.sopFileList = [] + searchQcSopFileList({ + site: row.site, + partNo: row.partNo || '', + orderNo: row.orderNo || '' + }).then(({data}) => { + if (data && data.code === 0) { + this.sopFileList = data.rows || [] + } else { + this.sopFileList = [] + } + this.sopFileLoading = false + }).catch(() => { + this.sopFileList = [] + this.sopFileLoading = false + }) + }, + + previewSopFile(row) { + if (!row.sopUrl) { this.$message.warning('该文件暂无预览路径'); return } + const fileName = row.sopName || row.sopUrl + let fileSuffix = fileName.includes('.') ? fileName.substring(fileName.lastIndexOf('.') + 1).toLowerCase() : '' + const officeTypes = ['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx'] + if (officeTypes.includes(fileSuffix)) { this.$message.warning(`暂不支持在线预览${fileSuffix.toUpperCase()}文件`); return } + let mimeType = 'application/octet-stream' + if (['jpg', 'jpeg', 'png', 'gif', 'bmp'].includes(fileSuffix)) { mimeType = 'image/' + fileSuffix } + else if (['mp4', 'avi', 'mov', 'wmv', 'flv'].includes(fileSuffix)) { mimeType = 'video/' + fileSuffix } + else if (fileSuffix === 'pdf') { mimeType = 'application/pdf' } + else if (fileSuffix === 'txt') { mimeType = 'text/plain' } + downloadSopFile(row.sopUrl).then(({ data }) => { + const blob = new Blob([data], { type: mimeType }) + window.open(URL.createObjectURL(blob), '_blank') + }).catch(() => { this.$message.error('文件预览失败,请稍后重试') }) + }, + // 新增文件的modal addUploadFileModal () { let currentData = { diff --git a/src/views/modules/yieldReport/com_process_inspection.vue b/src/views/modules/yieldReport/com_process_inspection.vue index a7a6d7d..bcdcaaf 100644 --- a/src/views/modules/yieldReport/com_process_inspection.vue +++ b/src/views/modules/yieldReport/com_process_inspection.vue @@ -913,6 +913,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + 关闭 + + + @@ -951,6 +982,7 @@ import { } from "@/api/qc/qc.js" import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js" import { getInspectionFile } from '@/api/eam/eam_object_list.js' +import { searchQcSopFileList, downloadSopFile } from '@/api/qc/qc.js' export default { name: 'ComProcessInspection', @@ -1380,6 +1412,10 @@ export default { fileFlag: false, fileContentList: [], fileLoading: false, + fileActiveTab: 'qcFile', + sopFileList: [], + sopFileLoading: false, + currentFileRow: null, // 派工单号相关 seqDetailFlag: false, seqInfoList: [], @@ -2182,6 +2218,8 @@ export default { // 刷新派设备文档的列表 getFileContentData(row) { + this.currentFileRow = row + this.fileActiveTab = 'qcFile' let currentData = { orderRef1: row.site, orderRef2: row.inspectionNo, @@ -2190,7 +2228,6 @@ export default { } this.fileLoading = true getInspectionFile(currentData).then(({data}) => { - //区分请求成功和失败的状况 if (data && data.code === 0) { this.fileContentList = data.rows } else { @@ -2200,9 +2237,50 @@ export default { }).catch(()=>{ this.fileLoading = false }) + this.getSopFileList(row) this.fileFlag = true }, + // 获取SOP文件列表(过程检验传所有条件:site, partNo, operationDesc, workcenterNo, orderNo) + getSopFileList(row) { + this.sopFileLoading = true + this.sopFileList = [] + searchQcSopFileList({ + site: row.site, + partNo: row.partNo || '', + operationDesc: row.operationDesc || '', + workcenterNo: row.workCenterNo || '', + orderNo: row.orderNo || '' + }).then(({data}) => { + if (data && data.code === 0) { + this.sopFileList = data.rows || [] + } else { + this.sopFileList = [] + } + this.sopFileLoading = false + }).catch(() => { + this.sopFileList = [] + this.sopFileLoading = false + }) + }, + + previewSopFile(row) { + if (!row.sopUrl) { this.$message.warning('该文件暂无预览路径'); return } + const fileName = row.sopName || row.sopUrl + let fileSuffix = fileName.includes('.') ? fileName.substring(fileName.lastIndexOf('.') + 1).toLowerCase() : '' + const officeTypes = ['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx'] + if (officeTypes.includes(fileSuffix)) { this.$message.warning(`暂不支持在线预览${fileSuffix.toUpperCase()}文件`); return } + let mimeType = 'application/octet-stream' + if (['jpg', 'jpeg', 'png', 'gif', 'bmp'].includes(fileSuffix)) { mimeType = 'image/' + fileSuffix } + else if (['mp4', 'avi', 'mov', 'wmv', 'flv'].includes(fileSuffix)) { mimeType = 'video/' + fileSuffix } + else if (fileSuffix === 'pdf') { mimeType = 'application/pdf' } + else if (fileSuffix === 'txt') { mimeType = 'text/plain' } + downloadSopFile(row.sopUrl).then(({ data }) => { + const blob = new Blob([data], { type: mimeType }) + window.open(URL.createObjectURL(blob), '_blank') + }).catch(() => { this.$message.error('文件预览失败,请稍后重试') }) + }, + // 保存检验明细(应用/保存) Transfer(type) { // 保存时校验