From 0b05cd2218b014db8d5bebb3b6d207471f11b70b Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Mon, 24 Nov 2025 13:13:31 +0800 Subject: [PATCH] =?UTF-8?q?2025-11-24=20IQC=E3=80=81FQC=E3=80=81OQC?= =?UTF-8?q?=E6=A3=80=E9=AA=8C=E5=A2=9E=E5=8A=A0=E9=A1=B9=E7=9B=AE=E6=93=8D?= =?UTF-8?q?=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/qc/FQCResultEntry.vue | 601 +++++++++++++++++- src/views/modules/qc/IQCResultEntry.vue | 795 +++++++++++++++++++++++- src/views/modules/qc/OQCResultEntry.vue | 565 ++++++++++++++++- 3 files changed, 1895 insertions(+), 66 deletions(-) diff --git a/src/views/modules/qc/FQCResultEntry.vue b/src/views/modules/qc/FQCResultEntry.vue index 1600022..1d6182c 100644 --- a/src/views/modules/qc/FQCResultEntry.vue +++ b/src/views/modules/qc/FQCResultEntry.vue @@ -497,7 +497,7 @@ - + @@ -512,29 +512,37 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + 项目导入 + + + + 模板导入 + @@ -1018,6 +1026,101 @@ + + + +
+ + + + + + + + 查询 + +
+
+
+
+ + 可选项目列表 + {{ availableItemList.length }} +
+ + + + + +
+
+ + + + + + +
+
+
+ + 已有项目列表 + {{ selectedItemList.length }} +
+ + + + + +
+
+ +
+ + + +
+ + + + + + + + 查询 + 重置 + +
+
+ + + + + + + +
+ +
+ @@ -1055,7 +1158,13 @@ dataAcquisitionByItem, // 根据项目数据采集 cancelApproval2, // 取消审核 getUserRoleList, // 获取用户角色列表 - getOperatorList + getOperatorList, + // FQC检验项目操作和模板导入 + getFQCItemList, + addFQCItemDetails, + deleteFQCItemDetails, + getFQCTemplateList, + importFQCTemplateItems } from "@/api/qc/qc.js" import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js" import Chooselist from '@/views/modules/common/Chooselist_eam' @@ -2518,7 +2627,26 @@ fileLoading: false, subDetailLoading: false, saveLoading: false, - searchLoading: false + searchLoading: false, + // FQC项目操作相关 + itemOperationDialogFlag: false, + itemOperationQuery: { + itemNo: '', + itemDesc: '', + }, + availableItemList: [], + selectedItemList: [], + availableItemSelections: [], + selectedItemSelections: [], + // FQC模板导入相关 + templateImportDialogFlag: false, + templateQuery: { + templateId: '', + templateDesc: '', + }, + templateList: [], + templateSelections: [], + importLoading: false } }, @@ -4135,6 +4263,179 @@ this.authFile = !fileFlag this.authCancelCheck = !cancelCheckFlag }, + + // ======================== FQC检验项目操作相关方法 ======================== + openItemOperationDialog() { + this.itemOperationQuery = { itemNo: '', itemDesc: '' } + this.searchFQCItems() + this.itemOperationDialogFlag = true + }, + async searchFQCItems() { + try { + const params = { + site: this.detailData.site, + buNo: this.detailData.buNo, + inspectionNo: this.detailData.inspectionNo, + itemNo: this.itemOperationQuery.itemNo || '', + itemDesc: this.itemOperationQuery.itemDesc || '' + } + const { data } = await getFQCItemList(params) + if (data && data.code === 0) { + this.availableItemList = data.row1 || [] + this.selectedItemList = data.row2 || [] + } + } catch (error) { + this.$message.error('查询检验项目失败') + } + }, + availableItemClickRow(row) { + this.$refs.availableItemTable.toggleRowSelection(row) + }, + availableItemSelectionChange(selection) { + this.availableItemSelections = selection + }, + selectedItemClickRow(row) { + this.$refs.selectedItemTable.toggleRowSelection(row) + }, + selectedItemSelectionChange(selection) { + this.selectedItemSelections = selection + }, + async addInspectionItems() { + if (!this.availableItemSelections || this.availableItemSelections.length === 0) { + this.$message.warning('请选择要添加的项目') + return + } + this.$confirm('确认添加选中的检验项目吗?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(async () => { + try { + const params = { + site: this.detailData.site, + buNo: this.detailData.buNo, + inspectionNo: this.detailData.inspectionNo, + itemList: this.availableItemSelections.map(item => ({ itemNo: item.itemNo })) + } + const { data } = await addFQCItemDetails(params) + if (data && data.code === 0) { + this.$message.success('添加成功') + this.searchFQCItems() + } else { + this.$message.error(data.msg || '添加失败') + } + } catch (error) { + this.$message.error('添加失败,请检查') + } + }).catch(() => { + this.$message.info('已取消添加') + }) + }, + async deleteInspectionItems() { + if (!this.selectedItemSelections || this.selectedItemSelections.length === 0) { + this.$message.warning('请选择要移除的项目') + return + } + this.$confirm('确认移除选中的检验项目吗?(将同时删除该项目的子明细数据)', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(async () => { + try { + const params = { + site: this.detailData.site, + buNo: this.detailData.buNo, + inspectionNo: this.detailData.inspectionNo, + itemList: this.selectedItemSelections.map(item => ({ itemNo: item.itemNo })) + } + const { data } = await deleteFQCItemDetails(params) + if (data && data.code === 0) { + this.$message.success('移除成功') + this.searchFQCItems() + } else { + this.$message.error(data.msg || '移除失败') + } + } catch (error) { + this.$message.error('移除失败,请检查') + } + }).catch(() => { + this.$message.info('已取消移除') + }) + }, + refreshInspectionDetailList() { + if (this.detailInformationFlag) { + this.getInspectionFormData() + } + }, + + // ======================== FQC模板导入相关方法 ======================== + openTemplateImportDialog() { + this.templateQuery = { templateId: '', templateDesc: '' } + this.searchFQCTemplates() + this.templateImportDialogFlag = true + }, + async searchFQCTemplates() { + try { + const params = { + site: this.detailData.site, + buNo: this.detailData.buNo, + templateId: this.templateQuery.templateId || '', + templateDesc: this.templateQuery.templateDesc || '' + } + const { data } = await getFQCTemplateList(params) + if (data && data.code === 0) { + this.templateList = data.rows || [] + } + } catch (error) { + this.$message.error('查询模板失败') + } + }, + templateClickRow(row) { + this.$refs.templateTable.toggleRowSelection(row) + }, + templateSelectionChange(selection) { + this.templateSelections = selection + }, + 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 params = { + site: this.detailData.site, + buNo: this.detailData.buNo, + inspectionNo: this.detailData.inspectionNo, + templateList: this.templateSelections.map(item => ({ templateId: item.templateId })) + } + const { data } = await importFQCTemplateItems(params) + 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('已取消导入') + }) + }, + resetTemplateQuery() { + this.templateQuery = { templateId: '', templateDesc: '' } + this.searchFQCTemplates() + }, } } @@ -4370,4 +4671,252 @@ height: auto; line-height: 1.5; } + +/* ==================== FQC检验项目操作对话框样式 ==================== */ +/deep/ .item-operation-dialog { + border-radius: 8px; + box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12); +} +/deep/ .item-operation-dialog .el-dialog__header { + background: linear-gradient(135deg, #9ac3d0 20%, #b6c7dd 80%); + padding: 20px 24px; + border-radius: 8px 8px 0 0; +} +/deep/ .item-operation-dialog .el-dialog__title { + color: #ffffff; + font-size: 16px; + font-weight: 600; + letter-spacing: 0.5px; +} +/deep/ .item-operation-dialog .el-dialog__headerbtn .el-dialog__close { + color: #ffffff; + font-size: 20px; + font-weight: bold; +} +/deep/ .item-operation-dialog .el-dialog__headerbtn:hover .el-dialog__close { + color: #f0f0f0; +} +/deep/ .item-operation-dialog .el-dialog__body { + padding: 24px; + background: #f8f9fa; +} +.search-container { + background: #ffffff; + padding: 16px 20px; + border-radius: 6px; + margin-bottom: 20px; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); +} +.search-container .el-form-item { + margin-bottom: 0; +} +.search-container .el-form-item__label { + font-weight: 500; + color: #606266; +} +.item-operation-content { + display: flex; + gap: 16px; + align-items: stretch; +} +.item-panel { + flex: 1; + background: #ffffff; + border-radius: 6px; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); + overflow: hidden; + transition: all 0.3s ease; +} +.item-panel:hover { + box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1); +} +.available-panel { + flex: 1.5; +} +.selected-panel { + flex: 1; +} +.panel-header { + padding: 14px 16px; + background: linear-gradient(135deg, #9ac3d0 20%, #b6c7dd 80%); + border-bottom: 2px solid #9ac3d0; + display: flex; + align-items: center; + gap: 8px; +} +.panel-header i { + font-size: 18px; + color: #ffffff; +} +.panel-title { + font-size: 14px; + font-weight: 600; + color: #ffffff; + letter-spacing: 0.5px; +} +.item-count { + margin-left: auto; + font-size: 12px; + color: #ffffff; + background: rgba(255, 255, 255, 0.25); + padding: 2px 10px; + border-radius: 12px; + font-weight: 500; +} +.operation-table { + border: none !important; +} +.operation-table /deep/ .el-table__body tr:hover > td { + background-color: #f0f7ff !important; +} +.operation-table /deep/ .el-table__row.current-row > td { + background-color: #e6f2ff !important; +} +.operation-table /deep/ td { + border-bottom: 1px solid #f0f0f0; +} +.operation-table /deep/ .el-table__body { + font-size: 13px; +} +.operation-buttons { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + gap: 20px; + padding: 0 8px; +} +.operation-buttons .el-button { + width: 48px; + height: 48px; + font-size: 20px; + transition: all 0.3s ease; + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); +} +.operation-buttons .el-button:hover { + transform: scale(1.1); + box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2); +} +.operation-buttons .el-button.is-disabled { + opacity: 0.4; + cursor: not-allowed; +} +.operation-buttons .el-button--primary { + background: linear-gradient(135deg, #409EFF 0%, #66b1ff 100%); + border: none; +} +.operation-buttons .el-button--danger { + background: linear-gradient(135deg, #F56C6C 0%, #f78989 100%); + border: none; +} +@media (max-width: 1200px) { + .item-operation-content { + flex-direction: column; + } + .operation-buttons { + flex-direction: row; + gap: 12px; + } + .operation-buttons .el-button { + width: 42px; + height: 42px; + 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, #9ac3d0 20%, #b6c7dd 80%); + 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: #f0f7ff !important; +} +.template-table /deep/ .el-table__row.current-row > td { + background-color: #e6f2ff !important; +} +.template-table /deep/ td { + border-bottom: 1px solid #f0f0f0; +} +.template-table /deep/ .el-table__body { + font-size: 13px; +} +.operation-btn { + position: relative; + padding: 8px 16px; + border: none; + border-radius: 4px; + font-size: 13px; + font-weight: 500; + cursor: pointer; + transition: all 0.3s ease; + overflow: hidden; + box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); +} +.operation-btn:hover { + transform: translateY(-1px); + box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15); +} +.operation-btn:active { + transform: translateY(0); +} +.operation-btn i { + margin-right: 4px; + font-size: 13px; +} +.operation-btn span { + position: relative; + z-index: 1; +} +.item-operation-btn { + background: linear-gradient(135deg, #97a9f7 0%, #ac97df 100%); + color: #ffffff; +} +.item-operation-btn:hover { + background: linear-gradient(135deg, #97a9f7 0%, #ac97df 100%); + color: #ffffff; +} +.template-import-btn { + background: linear-gradient(135deg, #97a9f7 0%, #ac97df 100%); + color: #ffffff; + margin-left: 10px; +} +.template-import-btn:hover { + background: linear-gradient(135deg, #97a9f7 0%, #ac97df 100%); + color: #ffffff; +} diff --git a/src/views/modules/qc/IQCResultEntry.vue b/src/views/modules/qc/IQCResultEntry.vue index 0214ad4..eb16e34 100644 --- a/src/views/modules/qc/IQCResultEntry.vue +++ b/src/views/modules/qc/IQCResultEntry.vue @@ -419,7 +419,7 @@
- + @@ -434,29 +434,37 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + 项目导入 + + + + 模板导入 + @@ -791,6 +799,183 @@ + + + +
+ + + + + + + + + + 查询 + +
+ + +
+ +
+
+ + 可选项目列表 + {{ availableItemList.length }} +
+ + + + + +
+ + +
+ + + + + + + + +
+ + +
+
+ + 已有项目列表 + {{ selectedItemList.length }} +
+ + + + + +
+
+ + + +
+ + + + +
+ + + + + + + + + + 查询 + 重置 + +
+ + +
+ + + + + + + +
+ + + +
+ @@ -816,7 +1001,13 @@ dataAcquisitionByItem, // 根据项目数据采集 cancelApproval, // 取消审核 getUserRoleList, // 获取用户角色列表 - getOperatorList + getOperatorList, + // IQC检验项目操作和模板导入 + getIQCItemList, + addIQCItemDetails, + deleteIQCItemDetails, + getIQCTemplateList, + importIQCTemplateItems } from "@/api/qc/qc.js" import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js" import Chooselist from '@/views/modules/common/Chooselist_eam' @@ -1992,7 +2183,26 @@ }, fileLoading: false, subDetailLoading: false, - searchLoading: false + searchLoading: false, + // IQC项目操作相关 + itemOperationDialogFlag: false, + itemOperationQuery: { + itemNo: '', + itemDesc: '', + }, + availableItemList: [], + selectedItemList: [], + availableItemSelections: [], + selectedItemSelections: [], + // IQC模板导入相关 + templateImportDialogFlag: false, + templateQuery: { + templateId: '', + templateDesc: '', + }, + templateList: [], + templateSelections: [], + importLoading: false } }, @@ -3220,6 +3430,226 @@ this.authFile = !fileFlag this.authCancelCheck = !cancelCheckFlag }, + + // ======================== IQC检验项目操作相关方法 ======================== + // 打开项目操作对话框 + openItemOperationDialog() { + this.itemOperationQuery = { + itemNo: '', + itemDesc: '', + } + this.searchIQCItems() + this.itemOperationDialogFlag = true + }, + + // 查询IQC类型的检验项目 + async searchIQCItems() { + try { + const params = { + site: this.detailData.site, + buNo: this.detailData.buNo, + inspectionNo: this.detailData.inspectionNo, + itemNo: this.itemOperationQuery.itemNo || '', + itemDesc: this.itemOperationQuery.itemDesc || '' + } + const { data } = await getIQCItemList(params) + if (data && data.code === 0) { + this.availableItemList = data.row1 || [] + this.selectedItemList = data.row2 || [] + } + } catch (error) { + this.$message.error('查询检验项目失败') + } + }, + + // 可选项目表格行点击 + availableItemClickRow(row) { + this.$refs.availableItemTable.toggleRowSelection(row) + }, + + // 可选项目选择变化 + availableItemSelectionChange(selection) { + this.availableItemSelections = selection + }, + + // 已选项目表格行点击 + selectedItemClickRow(row) { + this.$refs.selectedItemTable.toggleRowSelection(row) + }, + + // 已选项目选择变化 + selectedItemSelectionChange(selection) { + this.selectedItemSelections = selection + }, + + // 添加检验项目 + async addInspectionItems() { + if (!this.availableItemSelections || this.availableItemSelections.length === 0) { + this.$message.warning('请选择要添加的项目') + return + } + + this.$confirm('确认添加选中的检验项目吗?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(async () => { + try { + const params = { + site: this.detailData.site, + buNo: this.detailData.buNo, + inspectionNo: this.detailData.inspectionNo, + itemList: this.availableItemSelections.map(item => ({ + itemNo: item.itemNo + })) + } + const { data } = await addIQCItemDetails(params) + if (data && data.code === 0) { + this.$message.success('添加成功') + this.searchIQCItems() + } else { + this.$message.error(data.msg || '添加失败') + } + } catch (error) { + this.$message.error('添加失败,请检查') + } + }).catch(() => { + this.$message.info('已取消添加') + }) + }, + + // 删除检验项目 + async deleteInspectionItems() { + if (!this.selectedItemSelections || this.selectedItemSelections.length === 0) { + this.$message.warning('请选择要移除的项目') + return + } + + this.$confirm('确认移除选中的检验项目吗?(将同时删除该项目的子明细数据)', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(async () => { + try { + const params = { + site: this.detailData.site, + buNo: this.detailData.buNo, + inspectionNo: this.detailData.inspectionNo, + itemList: this.selectedItemSelections.map(item => ({ + itemNo: item.itemNo + })) + } + const { data } = await deleteIQCItemDetails(params) + if (data && data.code === 0) { + this.$message.success('移除成功') + this.searchIQCItems() + } else { + this.$message.error(data.msg || '移除失败') + } + } catch (error) { + this.$message.error('移除失败,请检查') + } + }).catch(() => { + this.$message.info('已取消移除') + }) + }, + + // 刷新检验明细列表 + refreshInspectionDetailList() { + if (this.detailInformationFlag) { + this.getInspectionFormData() + } + }, + + // ======================== IQC模板导入相关方法 ======================== + // 打开模板导入对话框 + openTemplateImportDialog() { + this.templateQuery = { + templateId: '', + templateDesc: '', + } + this.searchIQCTemplates() + this.templateImportDialogFlag = true + }, + + // 查询IQC检验模板 + async searchIQCTemplates() { + try { + const params = { + site: this.detailData.site, + buNo: this.detailData.buNo, + templateId: this.templateQuery.templateId || '', + templateDesc: this.templateQuery.templateDesc || '' + } + const { data } = await getIQCTemplateList(params) + if (data && data.code === 0) { + this.templateList = data.rows || [] + } + } catch (error) { + this.$message.error('查询模板失败') + } + }, + + // 模板表格行点击 + templateClickRow(row) { + this.$refs.templateTable.toggleRowSelection(row) + }, + + // 模板选择变化 + templateSelectionChange(selection) { + this.templateSelections = selection + }, + + // 确认导入模板 + 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 params = { + site: this.detailData.site, + buNo: this.detailData.buNo, + inspectionNo: this.detailData.inspectionNo, + templateList: this.templateSelections.map(item => ({ + templateId: item.templateId + })) + } + const { data } = await importIQCTemplateItems(params) + 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('已取消导入') + }) + }, + + // 重置模板查询条件 + resetTemplateQuery() { + this.templateQuery = { + templateId: '', + templateDesc: '', + } + this.searchIQCTemplates() + }, } } @@ -3455,5 +3885,318 @@ height: auto; line-height: 1.5; } + +/* ==================== IQC检验项目操作对话框样式 ==================== */ +/deep/ .item-operation-dialog { + border-radius: 8px; + box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12); +} + +/deep/ .item-operation-dialog .el-dialog__header { + background: linear-gradient(135deg, #9ac3d0 20%, #b6c7dd 80%); + padding: 20px 24px; + border-radius: 8px 8px 0 0; +} + +/deep/ .item-operation-dialog .el-dialog__title { + color: #ffffff; + font-size: 16px; + font-weight: 600; + letter-spacing: 0.5px; +} + +/deep/ .item-operation-dialog .el-dialog__headerbtn .el-dialog__close { + color: #ffffff; + font-size: 20px; + font-weight: bold; +} + +/deep/ .item-operation-dialog .el-dialog__headerbtn:hover .el-dialog__close { + color: #f0f0f0; +} + +/deep/ .item-operation-dialog .el-dialog__body { + padding: 24px; + background: #f8f9fa; +} + +/* 查询区域样式 */ +.search-container { + background: #ffffff; + padding: 16px 20px; + border-radius: 6px; + margin-bottom: 20px; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); +} + +.search-container .el-form-item { + margin-bottom: 0; +} + +.search-container .el-form-item__label { + font-weight: 500; + color: #606266; +} + +/* 主内容区域 */ +.item-operation-content { + display: flex; + gap: 16px; + align-items: stretch; +} + +/* 项目面板 */ +.item-panel { + flex: 1; + background: #ffffff; + border-radius: 6px; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); + overflow: hidden; + transition: all 0.3s ease; +} + +.item-panel:hover { + box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1); +} + +.available-panel { + flex: 1.5; +} + +.selected-panel { + flex: 1; +} + +/* 面板头部 */ +.panel-header { + padding: 14px 16px; + background: linear-gradient(135deg, #9ac3d0 20%, #b6c7dd 80%); + border-bottom: 2px solid #9ac3d0; + display: flex; + align-items: center; + gap: 8px; +} + +.panel-header i { + font-size: 18px; + color: #ffffff; +} + +.panel-title { + font-size: 14px; + font-weight: 600; + color: #ffffff; + letter-spacing: 0.5px; +} + +.item-count { + margin-left: auto; + font-size: 12px; + color: #ffffff; + background: rgba(255, 255, 255, 0.25); + padding: 2px 10px; + border-radius: 12px; + font-weight: 500; +} + +/* 表格样式优化 */ +.operation-table { + border: none !important; +} + +.operation-table /deep/ .el-table__body tr:hover > td { + background-color: #f0f7ff !important; +} + +.operation-table /deep/ .el-table__row.current-row > td { + background-color: #e6f2ff !important; +} + +.operation-table /deep/ td { + border-bottom: 1px solid #f0f0f0; +} + +.operation-table /deep/ .el-table__body { + font-size: 13px; +} + +/* 操作按钮区域 */ +.operation-buttons { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + gap: 20px; + padding: 0 8px; +} + +.operation-buttons .el-button { + width: 48px; + height: 48px; + font-size: 20px; + transition: all 0.3s ease; + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); +} + +.operation-buttons .el-button:hover { + transform: scale(1.1); + box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2); +} + +.operation-buttons .el-button.is-disabled { + opacity: 0.4; + cursor: not-allowed; +} + +.operation-buttons .el-button--primary { + background: linear-gradient(135deg, #409EFF 0%, #66b1ff 100%); + border: none; +} + +.operation-buttons .el-button--danger { + background: linear-gradient(135deg, #F56C6C 0%, #f78989 100%); + border: none; +} + +@media (max-width: 1200px) { + .item-operation-content { + flex-direction: column; + } + + .operation-buttons { + flex-direction: row; + gap: 12px; + } + + .operation-buttons .el-button { + width: 42px; + height: 42px; + font-size: 18px; + } +} + +/* ==================== IQC模板导入对话框样式 ==================== */ +/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, #9ac3d0 20%, #b6c7dd 80%); + 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: #f0f7ff !important; +} + +.template-table /deep/ .el-table__row.current-row > td { + background-color: #e6f2ff !important; +} + +.template-table /deep/ td { + border-bottom: 1px solid #f0f0f0; +} + +.template-table /deep/ .el-table__body { + font-size: 13px; +} + +/* ==================== 按钮样式优化 ==================== */ +.operation-btn { + position: relative; + padding: 8px 16px; + border: none; + border-radius: 4px; + font-size: 13px; + font-weight: 500; + cursor: pointer; + transition: all 0.3s ease; + overflow: hidden; + box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); +} + +.operation-btn:hover { + transform: translateY(-1px); + box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15); +} + +.operation-btn:active { + transform: translateY(0); +} + +.operation-btn i { + margin-right: 4px; + font-size: 13px; +} + +.operation-btn span { + position: relative; + z-index: 1; +} + +/* 项目导入按钮 */ +.item-operation-btn { + background: linear-gradient(135deg, #97a9f7 0%, #ac97df 100%); + color: #ffffff; +} + +.item-operation-btn:hover { + background: linear-gradient(135deg, #97a9f7 0%, #ac97df 100%); + color: #ffffff; +} + +/* 模板导入按钮 */ +.template-import-btn { + background: linear-gradient(135deg, #97a9f7 0%, #ac97df 100%); + color: #ffffff; + margin-left: 10px; +} + +.template-import-btn:hover { + background: linear-gradient(135deg, #97a9f7 0%, #ac97df 100%); + color: #ffffff; +} diff --git a/src/views/modules/qc/OQCResultEntry.vue b/src/views/modules/qc/OQCResultEntry.vue index ad6874a..c8082d3 100644 --- a/src/views/modules/qc/OQCResultEntry.vue +++ b/src/views/modules/qc/OQCResultEntry.vue @@ -350,30 +350,33 @@ - + - + - + - - + + - - + + - + - + 工作文件 + + 明细导入 +
- + @@ -401,8 +404,15 @@ - - 明细导入 + + + + 项目导入 + + + + 模板导入 + @@ -787,6 +797,87 @@ + + +
+ + + + + + + + 查询 + +
+
+
+
+ + 可选项目列表 + {{ availableItemList.length }} +
+ + + + + +
+
+ + + + + + +
+
+
+ + 已有项目列表 + {{ selectedItemList.length }} +
+ + + + + +
+
+ +
+ + + +
+ + + + + + + + 查询 + 重置 + +
+
+ + + + + + + +
+ +
+ @@ -810,7 +901,13 @@ downLoadObjectFile, deleteObjectFile, getUserRoleList, - getOperatorList + getOperatorList, + // OQC检验项目操作和模板导入 + getOQCItemList, + addOQCItemDetails, + deleteOQCItemDetails, + getOQCTemplateList, + importOQCTemplateItems } from "@/api/qc/qc.js" import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js" import Chooselist from '@/views/modules/common/Chooselist_eam' @@ -1829,7 +1926,26 @@ inspectionTypeNo: '' }, changeModalFlag: false, - overLoading: false + overLoading: false, + // OQC项目操作相关 + itemOperationDialogFlag: false, + itemOperationQuery: { + itemNo: '', + itemDesc: '', + }, + availableItemList: [], + selectedItemList: [], + availableItemSelections: [], + selectedItemSelections: [], + // OQC模板导入相关 + templateImportDialogFlag: false, + templateQuery: { + templateId: '', + templateDesc: '', + }, + templateList: [], + templateSelections: [], + importLoading: false } }, @@ -3191,6 +3307,179 @@ this.authFile = !fileFlag this.authChange = !changeFlag }, + + // ======================== OQC检验项目操作相关方法 ======================== + openItemOperationDialog() { + this.itemOperationQuery = { itemNo: '', itemDesc: '' } + this.searchOQCItems() + this.itemOperationDialogFlag = true + }, + async searchOQCItems() { + try { + const params = { + site: this.detailData.site, + buNo: this.detailData.buNo, + inspectionNo: this.detailData.inspectionNo, + itemNo: this.itemOperationQuery.itemNo || '', + itemDesc: this.itemOperationQuery.itemDesc || '' + } + const { data } = await getOQCItemList(params) + if (data && data.code === 0) { + this.availableItemList = data.row1 || [] + this.selectedItemList = data.row2 || [] + } + } catch (error) { + this.$message.error('查询检验项目失败') + } + }, + availableItemClickRow(row) { + this.$refs.availableItemTable.toggleRowSelection(row) + }, + availableItemSelectionChange(selection) { + this.availableItemSelections = selection + }, + selectedItemClickRow(row) { + this.$refs.selectedItemTable.toggleRowSelection(row) + }, + selectedItemSelectionChange(selection) { + this.selectedItemSelections = selection + }, + async addInspectionItems() { + if (!this.availableItemSelections || this.availableItemSelections.length === 0) { + this.$message.warning('请选择要添加的项目') + return + } + this.$confirm('确认添加选中的检验项目吗?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(async () => { + try { + const params = { + site: this.detailData.site, + buNo: this.detailData.buNo, + inspectionNo: this.detailData.inspectionNo, + itemList: this.availableItemSelections.map(item => ({ itemNo: item.itemNo })) + } + const { data } = await addOQCItemDetails(params) + if (data && data.code === 0) { + this.$message.success('添加成功') + this.searchOQCItems() + } else { + this.$message.error(data.msg || '添加失败') + } + } catch (error) { + this.$message.error('添加失败,请检查') + } + }).catch(() => { + this.$message.info('已取消添加') + }) + }, + async deleteInspectionItems() { + if (!this.selectedItemSelections || this.selectedItemSelections.length === 0) { + this.$message.warning('请选择要移除的项目') + return + } + this.$confirm('确认移除选中的检验项目吗?(将同时删除该项目的子明细数据)', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(async () => { + try { + const params = { + site: this.detailData.site, + buNo: this.detailData.buNo, + inspectionNo: this.detailData.inspectionNo, + itemList: this.selectedItemSelections.map(item => ({ itemNo: item.itemNo })) + } + const { data } = await deleteOQCItemDetails(params) + if (data && data.code === 0) { + this.$message.success('移除成功') + this.searchOQCItems() + } else { + this.$message.error(data.msg || '移除失败') + } + } catch (error) { + this.$message.error('移除失败,请检查') + } + }).catch(() => { + this.$message.info('已取消移除') + }) + }, + refreshInspectionDetailList() { + if (this.detailInformationFlag) { + this.getInspectionFormData() + } + }, + + // ======================== OQC模板导入相关方法 ======================== + openTemplateImportDialog() { + this.templateQuery = { templateId: '', templateDesc: '' } + this.searchOQCTemplates() + this.templateImportDialogFlag = true + }, + async searchOQCTemplates() { + try { + const params = { + site: this.detailData.site, + buNo: this.detailData.buNo, + templateId: this.templateQuery.templateId || '', + templateDesc: this.templateQuery.templateDesc || '' + } + const { data } = await getOQCTemplateList(params) + if (data && data.code === 0) { + this.templateList = data.rows || [] + } + } catch (error) { + this.$message.error('查询模板失败') + } + }, + templateClickRow(row) { + this.$refs.templateTable.toggleRowSelection(row) + }, + templateSelectionChange(selection) { + this.templateSelections = selection + }, + 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 params = { + site: this.detailData.site, + buNo: this.detailData.buNo, + inspectionNo: this.detailData.inspectionNo, + templateList: this.templateSelections.map(item => ({ templateId: item.templateId })) + } + const { data } = await importOQCTemplateItems(params) + 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('已取消导入') + }) + }, + resetTemplateQuery() { + this.templateQuery = { templateId: '', templateDesc: '' } + this.searchOQCTemplates() + }, } } @@ -3438,4 +3727,252 @@ height: auto; line-height: 1.5; } + +/* ==================== OQC检验项目操作对话框样式 ==================== */ +/deep/ .item-operation-dialog { + border-radius: 8px; + box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12); +} +/deep/ .item-operation-dialog .el-dialog__header { + background: linear-gradient(135deg, #9ac3d0 20%, #b6c7dd 80%); + padding: 20px 24px; + border-radius: 8px 8px 0 0; +} +/deep/ .item-operation-dialog .el-dialog__title { + color: #ffffff; + font-size: 16px; + font-weight: 600; + letter-spacing: 0.5px; +} +/deep/ .item-operation-dialog .el-dialog__headerbtn .el-dialog__close { + color: #ffffff; + font-size: 20px; + font-weight: bold; +} +/deep/ .item-operation-dialog .el-dialog__headerbtn:hover .el-dialog__close { + color: #f0f0f0; +} +/deep/ .item-operation-dialog .el-dialog__body { + padding: 24px; + background: #f8f9fa; +} +.search-container { + background: #ffffff; + padding: 16px 20px; + border-radius: 6px; + margin-bottom: 20px; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); +} +.search-container .el-form-item { + margin-bottom: 0; +} +.search-container .el-form-item__label { + font-weight: 500; + color: #606266; +} +.item-operation-content { + display: flex; + gap: 16px; + align-items: stretch; +} +.item-panel { + flex: 1; + background: #ffffff; + border-radius: 6px; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); + overflow: hidden; + transition: all 0.3s ease; +} +.item-panel:hover { + box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1); +} +.available-panel { + flex: 1.5; +} +.selected-panel { + flex: 1; +} +.panel-header { + padding: 14px 16px; + background: linear-gradient(135deg, #9ac3d0 20%, #b6c7dd 80%); + border-bottom: 2px solid #9ac3d0; + display: flex; + align-items: center; + gap: 8px; +} +.panel-header i { + font-size: 18px; + color: #ffffff; +} +.panel-title { + font-size: 14px; + font-weight: 600; + color: #ffffff; + letter-spacing: 0.5px; +} +.item-count { + margin-left: auto; + font-size: 12px; + color: #ffffff; + background: rgba(255, 255, 255, 0.25); + padding: 2px 10px; + border-radius: 12px; + font-weight: 500; +} +.operation-table { + border: none !important; +} +.operation-table /deep/ .el-table__body tr:hover > td { + background-color: #f0f7ff !important; +} +.operation-table /deep/ .el-table__row.current-row > td { + background-color: #e6f2ff !important; +} +.operation-table /deep/ td { + border-bottom: 1px solid #f0f0f0; +} +.operation-table /deep/ .el-table__body { + font-size: 13px; +} +.operation-buttons { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + gap: 20px; + padding: 0 8px; +} +.operation-buttons .el-button { + width: 48px; + height: 48px; + font-size: 20px; + transition: all 0.3s ease; + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); +} +.operation-buttons .el-button:hover { + transform: scale(1.1); + box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2); +} +.operation-buttons .el-button.is-disabled { + opacity: 0.4; + cursor: not-allowed; +} +.operation-buttons .el-button--primary { + background: linear-gradient(135deg, #409EFF 0%, #66b1ff 100%); + border: none; +} +.operation-buttons .el-button--danger { + background: linear-gradient(135deg, #F56C6C 0%, #f78989 100%); + border: none; +} +@media (max-width: 1200px) { + .item-operation-content { + flex-direction: column; + } + .operation-buttons { + flex-direction: row; + gap: 12px; + } + .operation-buttons .el-button { + width: 42px; + height: 42px; + 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, #9ac3d0 20%, #b6c7dd 80%); + 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: #f0f7ff !important; +} +.template-table /deep/ .el-table__row.current-row > td { + background-color: #e6f2ff !important; +} +.template-table /deep/ td { + border-bottom: 1px solid #f0f0f0; +} +.template-table /deep/ .el-table__body { + font-size: 13px; +} +.operation-btn { + position: relative; + padding: 8px 16px; + border: none; + border-radius: 4px; + font-size: 13px; + font-weight: 500; + cursor: pointer; + transition: all 0.3s ease; + overflow: hidden; + box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); +} +.operation-btn:hover { + transform: translateY(-1px); + box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15); +} +.operation-btn:active { + transform: translateY(0); +} +.operation-btn i { + margin-right: 4px; + font-size: 13px; +} +.operation-btn span { + position: relative; + z-index: 1; +} +.item-operation-btn { + background: linear-gradient(135deg, #97a9f7 0%, #ac97df 100%); + color: #ffffff; +} +.item-operation-btn:hover { + background: linear-gradient(135deg, #97a9f7 0%, #ac97df 100%); + color: #ffffff; +} +.template-import-btn { + background: linear-gradient(135deg, #97a9f7 0%, #ac97df 100%); + color: #ffffff; + margin-left: 10px; +} +.template-import-btn:hover { + background: linear-gradient(135deg, #97a9f7 0%, #ac97df 100%); + color: #ffffff; +}