+
+
+
+
+
+
+
+
+
+
+
+ 查询
+ 重置
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -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 @@