From 1bff80bbdf419b9635fe3264204b302e6be6b315 Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Thu, 20 Nov 2025 16:48:30 +0800 Subject: [PATCH] =?UTF-8?q?2025-11-20=20IPQC=E6=A3=80=E9=AA=8C=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E9=A1=B9=E7=9B=AE=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/qc/qc.js | 3 + src/views/modules/qc/IPQCResultEntry.vue | 328 +++++++++++++++++++++-- 2 files changed, 304 insertions(+), 27 deletions(-) diff --git a/src/api/qc/qc.js b/src/api/qc/qc.js index b4db556..036bcc7 100644 --- a/src/api/qc/qc.js +++ b/src/api/qc/qc.js @@ -209,6 +209,9 @@ export const saveInspectionStandard = data => createAPI(`/pms/qc/saveInspectionS export const getIPQCItemList = data => createAPI(`/pms/qc/getIPQCItemList`,'post',data) export const addIPQCItemDetails = data => createAPI(`/pms/qc/addIPQCItemDetails`,'post',data) export const deleteIPQCItemDetails = data => createAPI(`/pms/qc/deleteIPQCItemDetails`,'post',data) +// IPQC模板导入 +export const getIPQCTemplateList = data => createAPI(`/pms/qc/getIPQCTemplateList`,'post',data) +export const importIPQCTemplateItems = data => createAPI(`/pms/qc/importIPQCTemplateItems`,'post',data) export const dataAcquisitionByItem = data => createAPI(`/pms/qc/dataAcquisitionByItem`,'post',data) export const getSiteAndBuByUserName2 = data => createAPI(`/pms/qc/getSiteAndBuByUserName2`,'post',data) export const cancelApproval = data => createAPI(`/pms/qc/cancelApproval`,'post',data) diff --git a/src/views/modules/qc/IPQCResultEntry.vue b/src/views/modules/qc/IPQCResultEntry.vue index bb8e6fc..1c3573b 100644 --- a/src/views/modules/qc/IPQCResultEntry.vue +++ b/src/views/modules/qc/IPQCResultEntry.vue @@ -533,7 +533,7 @@ - + @@ -548,32 +548,31 @@ - - 项目操作 + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + 项目操作 + 模板导入 @@ -1206,6 +1205,110 @@ + + + +
+ + + + + + + + + + + 查询 + 重置 + + +
+ + +
+
+ + IPQC检验模板 + ({{ templateList.length }}) +
+ + + + + + + + + + + + + +
+ + + +
+ @@ -1258,7 +1361,9 @@ getOperatorList, getIPQCItemList, // 获取IPQC检验项目列表 addIPQCItemDetails, // 添加IPQC检验项目 - deleteIPQCItemDetails // 删除IPQC检验项目 + deleteIPQCItemDetails, // 删除IPQC检验项目 + getIPQCTemplateList, // 获取IPQC模板列表 + importIPQCTemplateItems // 导入IPQC模板项目 } from "@/api/qc/qc.js" import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js" import Chooselist from '@/views/modules/common/Chooselist_eam' @@ -2755,6 +2860,15 @@ selectedItemList: [], availableItemSelections: [], selectedItemSelections: [], + // 模板导入相关 + templateImportDialogFlag: false, + templateQuery: { + templateId: '', + templateDesc: '', + }, + templateList: [], + templateSelections: [], + importLoading: false, itemObjectColumnList: [ { columnProp: 'itemNo', @@ -4548,6 +4662,98 @@ this.getInspectionFormData() } }, + + // ======================== 模板导入相关方法 ======================== + // 打开模板导入对话框 + openTemplateImportDialog() { + this.templateQuery = { + templateId: '', + templateDesc: '', + } + this.searchIPQCTemplates() + this.templateImportDialogFlag = true + }, + + // 查询IPQC检验模板 + async searchIPQCTemplates() { + try { + const {data} = await getIPQCTemplateList({ + site: this.detailData.site, + buNo: this.detailData.buNo, + templateId: this.templateQuery.templateId, + templateDesc: this.templateQuery.templateDesc, + }) + if (data && data.code === 0) { + this.templateList = data.rows || [] + } else { + this.$message.error(data.msg || '查询失败') + } + } catch (error) { + this.$message.error('查询失败,请检查') + } + }, + + // 重置模板查询条件 + resetTemplateQuery() { + this.templateQuery = { + templateId: '', + templateDesc: '', + } + this.searchIPQCTemplates() + }, + + // 模板行点击 + templateClickRow(row) { + this.$refs.templateTable.toggleRowSelection(row) + }, + + // 模板选择变化 + templateSelectionChange(selection) { + this.templateSelections = selection + }, + + // 确认导入模板 + async confirmImportTemplate() { + if (!this.templateSelections || this.templateSelections.length === 0) { + this.$message.warning('请选择要导入的模板!') + return + } + + this.$confirm(`确定要导入选中的 ${this.templateSelections.length} 个模板吗?`, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(async () => { + this.importLoading = true + try { + const {data} = await importIPQCTemplateItems({ + site: this.detailData.site, + buNo: this.detailData.buNo, + inspectionNo: this.detailData.inspectionNo, + orderNo: this.detailData.orderNo, + templateList: this.templateSelections.map(t => ({ + templateId: t.templateId, + templateName: t.templateName + })) + }) + if (data && data.code === 0) { + this.$message.success(`导入成功!共导入 ${data.importCount || 0} 个检验项目`) + this.templateImportDialogFlag = false + this.templateSelections = [] + // 刷新检验明细列表 + this.getInspectionFormData() + } else { + this.$message.error(data.msg || '导入失败') + } + } catch (error) { + this.$message.error('导入失败,请检查') + } finally { + this.importLoading = false + } + }).catch(() => { + this.$message.info('已取消导入') + }) + }, } } @@ -4986,4 +5192,72 @@ font-size: 18px; } } + +/* ==================== 模板导入对话框样式 ==================== */ +/deep/ .template-import-dialog { + border-radius: 8px; + box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12); +} + +/deep/ .template-import-dialog .el-dialog__header { + background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); + padding: 20px 24px; + border-radius: 8px 8px 0 0; +} + +/deep/ .template-import-dialog .el-dialog__title { + color: #ffffff; + font-size: 16px; + font-weight: 600; + letter-spacing: 0.5px; +} + +/deep/ .template-import-dialog .el-dialog__headerbtn .el-dialog__close { + color: #ffffff; + font-size: 20px; + font-weight: bold; +} + +/deep/ .template-import-dialog .el-dialog__headerbtn:hover .el-dialog__close { + color: #f0f0f0; +} + +/deep/ .template-import-dialog .el-dialog__body { + padding: 24px; + background: #f8f9fa; +} + +/* 模板列表容器 */ +.template-list-container { + background: #ffffff; + border-radius: 6px; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); + overflow: hidden; + transition: all 0.3s ease; +} + +.template-list-container:hover { + box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1); +} + +/* 模板表格 */ +.template-table { + border: none !important; +} + +.template-table /deep/ .el-table__body tr:hover > td { + background-color: #f0fff4 !important; +} + +.template-table /deep/ .el-table__row.current-row > td { + background-color: #e6ffed !important; +} + +.template-table /deep/ td { + border-bottom: 1px solid #f0f0f0; +} + +.template-table /deep/ .el-table__body { + font-size: 13px; +}