diff --git a/src/views/modules/eam/com_project_proof_record.vue b/src/views/modules/eam/com_project_proof_record.vue index 2b3ba82..ef9f231 100644 --- a/src/views/modules/eam/com_project_proof_record.vue +++ b/src/views/modules/eam/com_project_proof_record.vue @@ -231,7 +231,6 @@ + + + @@ -233,6 +249,114 @@ :customer-no="projectAllDocumentCurrentRow.customerNo" :customer-desc="projectAllDocumentCurrentRow.customerDesc" :test-part-no="projectAllDocumentCurrentRow.testPartNo" :project-part-id="projectAllDocumentCurrentRow.projectPartId" :part-desc="projectAllDocumentCurrentRow.partDesc" :column-file-content-array="columnFileContentArray" :proof-document-list="projectPartDocumentList" path="/upload/test" :is-editable="isEditable" :is-mass-production-stage="isMassProductionStage"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 确定 + 关闭 + + @@ -248,7 +372,7 @@ import { searchAllConfirmProgressList, queryProjectOverUploadsDocumentList, queryProjectUploadsDocumentList, - queryAllProjectUploadsDocumentList + queryAllProjectUploadsDocumentList, deleteProofDocument, getCopyDocumentFileList, copyDocumentFileToDoc } from "../../../api/eam/eamProofing"; import {searchConfirmProgressPusherList, warnSendMailHandle} from "../../../api/eam/eamProject"; import {getSiteAndBuByUserName} from "../../../api/qc/qc"; @@ -287,6 +411,10 @@ export default { exportFooter: [], exportList:[], folder: '', + authSearch: false, + authSave: false, + authUpdate: false, + authDelete: false, dataList: [], allDataList: [], fileList: [], @@ -1194,9 +1322,356 @@ export default { status: '正式量产', } ], + rules:{ + projectNo:[ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + projectDesc:[ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + customerNo:[ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + customerDesc:[ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + testPartNo:[ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + partDesc:[ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + projectManager:[ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + engineer:[ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + projectOwner:[ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + cProjectRegion:[ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + cQualityEngineer1:[ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + cQualityEngineer2:[ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + cQualityEngineer3:[ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + cQualityEngineer4:[ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + cQualityEngineer5:[ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + cQualityEngineer6:[ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + cManufactureEngineer:[ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + docEngineer:[ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + docEngineerName:[ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + projectManagerName:[ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + engineerName:[ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + cQualityEngineer1Name:[ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + cQualityEngineer2Name:[ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + cQualityEngineer3Name:[ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + cQualityEngineer4Name:[ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + cQualityEngineer5Name:[ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + cQualityEngineer6Name:[ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + cManufactureEngineerName:[ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + projectCategoryType:[ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + documentTypeIdType:[ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + documentTypeType:[ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + responsibleDepartmentType:[ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + estimatedCompletionDaysType:[ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + activeType:[ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + bu:[ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + finalPartNo:[ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + needDate:[ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + projectCreationDate:[ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + wantedConfirmDate:[ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + projectCategory: [ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + projectPhase: [ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + proofingNo: [ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + planStartDate: [ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + requiredDeliveryDate: [ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + proofingNumber: [ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + //请选择项目分类 + cProjectTypeDb: [ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + conclusion: [ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], + }, + + copyModalData: { + site: this.$store.state.user.site, + username: this.$store.state.user.name, + projectId: '', + projectNo: '', + proofingId: '', + proofingNo: '', + documentTypeId: '' + }, + copyDialog: false, + documentCopySelection: [], + copyDocumentList: [], }; }, created() { + // 按钮控制 + this.getButtonAuthData() // 获取用户的 site 和 bu this.getSiteAndBuByUserName() // 校验用户是否收藏 @@ -1228,7 +1703,7 @@ export default { }, methods: { handleColumnResize(newWidth, oldWidth, column, event){ - let inData= this.columnList.filter(item => item.columnProp === column.property)[0] + let inData= this.columnProjectAllDocumentList.filter(item => item.columnProp === column.property)[0] inData.columnWidth=newWidth updateColumnSize(inData).then(({data}) => { if (data.code === 0) { @@ -2418,6 +2893,100 @@ export default { }); }, + copyFile (row) { + this.copyModalData = { + ...row, + projectNo: row.projectNo, + projectDesc: row.projectDesc, + projectPartId: row.projectPartId, + testPartNo: row.testPartNo, + partDesc: row.partDesc, + }; + this.copyDialog = true + }, + + searchCopyDocumentFileList() { + getCopyDocumentFileList(this.copyModalData).then(({data}) => { + if (data && data.code === 0) { + this.copyDocumentList = data.list + } else { + this.copyDocumentList = [] + } + }) + }, + saveSelectionCopyDocumentType() { + if (this.documentCopySelection.length === 0) { + this.$message({ + message: '请选择文档', + type: 'error' + }) + return + } else if (this.documentCopySelection.length > 1) { + this.$message({ + message: '只能选择一个文档', + type: 'error' + }) + return + } + if (this.copyModalData.proofingNo === '*'){ + this.copyModalData.conclusion = 'N/A' + } + if (this.copyModalData.conclusion === '' || this.copyModalData.conclusion === null || + this.copyModalData.conclusion === undefined) { + this.$message({ + message: '结论不能为空', + type: 'warning' + }) + return + } + const inData = { + site: this.$store.state.user.site, + ossId: this.documentCopySelection[0].ossId, + proofingId: this.copyModalData.proofingId, + projectId: this.copyModalData.projectId, + projectPartId: this.copyModalData.projectPartId, + documentDefinitionListId: this.copyModalData.documentDefinitionListId, + conclusion: this.copyModalData.conclusion, + createBy: this.$store.state.user.name, + } + copyDocumentFileToDoc(inData).then(({data}) => { + //区分请求成功和失败的状况 + if (data && data.code === 0) { + this.$message({ + message: '复制成功', + type: 'success' + }) + this.getDataList() + this.closeCopyDocumentFileFlag() + } else { + this.$message({ + message: '复制失败', + type: 'error' + }) + } + }) + }, + closeCopyDocumentFileFlag() { + this.copyDialog = false + this.copyModalData = {} + this.copyDocumentList = [] + }, + + selectionCopyDocument(selection) { + if (selection.length > 1) { + // 只保留最后选择的那一行 + const lastRow = selection[selection.length - 1]; + // 清除所有选择 + this.$refs.copyDocumentTable.clearSelection(); + // 选中最后一次选择的那一行 + this.$refs.copyDocumentTable.toggleRowSelection(lastRow, true); + // 如有需要,可以将选中行存储到一个 data 变量中 + this.documentCopySelection = [lastRow]; + } else { + this.documentCopySelection = selection; + } + }, + // 每页数 sizeChangeHandle (val) { this.pageSize = val diff --git a/src/views/modules/eam/eamProjectPartInfo.vue b/src/views/modules/eam/eamProjectPartInfo.vue index 688ebb9..77842dd 100644 --- a/src/views/modules/eam/eamProjectPartInfo.vue +++ b/src/views/modules/eam/eamProjectPartInfo.vue @@ -697,7 +697,6 @@ @@ -1383,9 +1382,9 @@ label="操作"> @@ -4050,8 +4049,6 @@ import {updateColumnSize} from "../../../api/table"; if (this.totalPage > 0) { // 设置选中行 this.$refs.mainTable.setCurrentRow(this.dataList[this.dataListIndex]) - // 加载当前的页签的table - this.refreshCurrentTabTable() this.proofingClickRow(this.dataList[this.dataListIndex]) this.dataListIndex = 0 } @@ -4252,8 +4249,6 @@ import {updateColumnSize} from "../../../api/table"; // 判断是否是获取焦点的事件 if (row) { this.proofingCurrentRow = JSON.parse(JSON.stringify(row)) - //刷新当前页表 - this.refreshCurrentTabTable() } }, // 每页数 @@ -4465,7 +4460,7 @@ import {updateColumnSize} from "../../../api/table"; this.newProofingDocument(data.proofingId).then(() => { this.visible = false //刷新表格 - this.getRowProjectInfo() + this.refreshCurrentTabTable() }) } else { this.$alert(data.msg, '错误', { @@ -4738,34 +4733,37 @@ import {updateColumnSize} from "../../../api/table"; } }, getRowProjectInfo(){ - let inData={ - site: this.proofingCurrentRow.site, - projectId: this.proofingCurrentRow.projectId, - projectNo: this.proofingCurrentRow.projectNo, - projectDesc: this.proofingCurrentRow.projectDesc, - projectPartId: this.proofingCurrentRow.projectPartId, - testPartNo: this.proofingCurrentRow.testPartNo, - partDesc: this.proofingCurrentRow.partDesc, - projectManager: this.proofingCurrentRow.projectManager, - projectOwner: this.proofingCurrentRow.projectOwner, - engineer: this.proofingCurrentRow.engineer, - cQualityEngineer1: this.proofingCurrentRow.cQualityEngineer1, - cQualityEngineer2: this.proofingCurrentRow.cQualityEngineer2, - cQualityEngineer3: this.proofingCurrentRow.cQualityEngineer3, - cQualityEngineer4: this.proofingCurrentRow.cQualityEngineer4, - cQualityEngineer5: this.proofingCurrentRow.cQualityEngineer5, - cQualityEngineer6: this.proofingCurrentRow.cQualityEngineer6, - cManufactureEngineer: this.proofingCurrentRow.cManufactureEngineer, - docEngineer: this.proofingCurrentRow.docEngineer, - ipqcHardTag: this.proofingCurrentRow.ipqcHardTag, - // username:this.$store.state.user.name, - page: 1, - limit: 1000 - } - this.$refs.proofRecord.init(inData,this.authUpdate) + this.$nextTick(() => { + let inData = { + site: this.proofingCurrentRow.site, + projectId: this.proofingCurrentRow.projectId, + projectNo: this.proofingCurrentRow.projectNo, + projectDesc: this.proofingCurrentRow.projectDesc, + projectPartId: this.proofingCurrentRow.projectPartId, + testPartNo: this.proofingCurrentRow.testPartNo, + partDesc: this.proofingCurrentRow.partDesc, + projectManager: this.proofingCurrentRow.projectManager, + projectOwner: this.proofingCurrentRow.projectOwner, + engineer: this.proofingCurrentRow.engineer, + cQualityEngineer1: this.proofingCurrentRow.cQualityEngineer1, + cQualityEngineer2: this.proofingCurrentRow.cQualityEngineer2, + cQualityEngineer3: this.proofingCurrentRow.cQualityEngineer3, + cQualityEngineer4: this.proofingCurrentRow.cQualityEngineer4, + cQualityEngineer5: this.proofingCurrentRow.cQualityEngineer5, + cQualityEngineer6: this.proofingCurrentRow.cQualityEngineer6, + cManufactureEngineer: this.proofingCurrentRow.cManufactureEngineer, + docEngineer: this.proofingCurrentRow.docEngineer, + ipqcHardTag: this.proofingCurrentRow.ipqcHardTag, + // username:this.$store.state.user.name, + page: 1, + limit: 1000 + } + this.$refs.proofRecordModal.init(inData, this.authUpdate) + }); }, showProofDetailModal(row) { + this.activeModalTab = 'proofRecord' // 保存当前行数据 this.proofingCurrentRow = row; // 打开模态框 @@ -6289,23 +6287,23 @@ import {updateColumnSize} from "../../../api/table"; this.refreshCurrentTabTable() }, async refreshCurrentTabTable () { - if (this.activeName === 'proofRecord') { + if (this.activeModalTab === 'proofRecord') { this.getRowProjectInfo(); } - if (this.activeName === 'massProductionStage' || this.activeModalTab === 'massProductionStage') { + if (this.activeModalTab === 'massProductionStage') { this.getProjectOtherDocument(); } - if (this.activeName === 'allDocument' || this.activeModalTab === 'allDocument') { + if (this.activeModalTab === 'allDocument') { this.getRowProjectInfo(); this.getProjectOtherDocument(); this.searchProjectAllDocumentList() this.searchConfirmatorList() } - if (this.activeName === 'productionDocumentsConfirmProgress' || this.activeModalTab === 'productionDocumentsConfirmProgress') { + if (this.activeModalTab === 'productionDocumentsConfirmProgress') { this.getConfirmProgressDocumentList() this.getConfirmProgressPusherList() } - if ((this.activeName === 'massProductionBOM' || this.activeModalTab === 'massProductionBOM') && this.proofingCurrentRow.finalPartNo + if (this.activeModalTab === 'massProductionBOM' && this.proofingCurrentRow.finalPartNo !== '' && this.proofingCurrentRow.finalPartNo !== null){ this.dataListLoading = true; @@ -6322,7 +6320,7 @@ import {updateColumnSize} from "../../../api/table"; } else { this.projectPartBomList = [] } - if ((this.activeName === 'Routing' || this.activeModalTab === 'Routing') && + if (this.activeModalTab === 'Routing' && this.proofingCurrentRow.finalPartNo !== '' && this.proofingCurrentRow.finalPartNo !== null){ this.dataListLoading = true;