From 7fc66e7b2f47e2100d0a59c3abece2416ea4ae5b Mon Sep 17 00:00:00 2001 From: "han\\hanst" Date: Thu, 23 Jul 2026 11:11:43 +0800 Subject: [PATCH] site --- .../modules/eam/com_project_proof_record.vue | 85 +++++++++++++++---- .../modules/eam/eamDocumentTypeDefinition.vue | 82 ++++++++++++++---- src/views/modules/eam/eamProjectPartInfo.vue | 2 +- 3 files changed, 136 insertions(+), 33 deletions(-) diff --git a/src/views/modules/eam/com_project_proof_record.vue b/src/views/modules/eam/com_project_proof_record.vue index 4b2ed85..b4d2cad 100644 --- a/src/views/modules/eam/com_project_proof_record.vue +++ b/src/views/modules/eam/com_project_proof_record.vue @@ -675,6 +675,11 @@ inModal: { type: Boolean, default: false + }, + // 当前选中项目料号所属工厂(由父组件传入) + selectedSite: { + type: String, + default: '' } }, computed: { @@ -704,6 +709,14 @@ this.getProofDocument() } }, + selectedSite: { + immediate: true, + handler (val) { + if (val) { + this.syncSiteContext(val) + } + } + } }, data() { return { @@ -711,7 +724,7 @@ userBuList: [], dataList: [], searchData: { - site: this.$store.state.user.site, + site: this.selectedSite || this.$store.state.user.site, username: this.$store.state.user.name, projectId: '', projectPartId: '', @@ -719,7 +732,7 @@ limit: 1000 }, searchProofData: { - site: this.$store.state.user.site, + site: this.selectedSite || this.$store.state.user.site, username: this.$store.state.user.name, projectId: '', page: 1, @@ -751,7 +764,7 @@ proofDocumenCurrentRow:{}, documentClickRow: {}, currentData: { - site: this.$store.state.user.site, + site: this.selectedSite || this.$store.state.user.site, username: this.$store.state.user.name, projectId: '', projectNo: '', @@ -762,7 +775,7 @@ limit: 1000 }, copyModalData: { - site: this.$store.state.user.site, + site: this.selectedSite || this.$store.state.user.site, username: this.$store.state.user.name, projectId: '', projectNo: '', @@ -831,7 +844,7 @@ createBy: '' }, searchDocumentTypeData: { - site: this.$store.state.user.site, + site: this.selectedSite || this.$store.state.user.site, projectId: '', projectNo: '', proofingId: '', @@ -846,7 +859,7 @@ }, documentTypeData: { // bu: this.userBuList[0].buNo, - site: this.$store.state.user.site, + site: this.selectedSite || this.$store.state.user.site, proofingId: '', proofingNo: '', documentTypeId: '', @@ -1361,6 +1374,32 @@ }, methods: { + resolveProofingSite (site) { + if (site !== null && site !== undefined && site !== '') { + return site + } + if (this.selectedSite !== null && this.selectedSite !== undefined && this.selectedSite !== '') { + return this.selectedSite + } + if (this.proofDocumenCurrentRow && this.proofDocumenCurrentRow.site) { + return this.proofDocumenCurrentRow.site + } + if (this.searchData && this.searchData.site) { + return this.searchData.site + } + return this.$store.state.user.site + }, + syncSiteContext (site) { + const currentSite = this.resolveProofingSite(site) + this.searchData.site = currentSite + this.searchProofData.site = currentSite + this.currentData.site = currentSite + this.copyModalData.site = currentSite + this.searchDocumentTypeData.site = currentSite + this.documentTypeData.site = currentSite + this.modalData.site = currentSite + return currentSite + }, handleColumnResize(newWidth, oldWidth, column, event){ let inData= this.columnList.filter(item => item.columnProp === column.property)[0] inData.columnWidth=newWidth @@ -1416,6 +1455,8 @@ //初始化参数 this.searchData = JSON.parse(JSON.stringify(inData)); this.authUpdate = authUpdate + const currentSite = this.syncSiteContext(inData ? inData.site : '') + this.searchData.site = currentSite //刷新表格 proofingInformationSearch(this.searchData).then(({data}) => { //区分请求成功和失败的状况 @@ -1437,8 +1478,9 @@ }); }, getProofingInformation(proofingId) { + const currentSite = this.syncSiteContext(this.searchData.site) let tempData = { - site: this.$store.state.user.site, + site: currentSite, username: this.$store.state.user.name, projectId: this.searchData.projectId, projectPartId: this.searchData.projectPartId, @@ -1464,8 +1506,9 @@ }); }, async getProofDocument() { + const currentSite = this.syncSiteContext(this.proofDocumenCurrentRow.site) let tempData = { - site: this.$store.state.user.site, + site: currentSite, username: this.$store.state.user.name, buNo: this.proofDocumenCurrentRow.buNo, proofingId: this.proofDocumenCurrentRow.proofingId, @@ -1594,6 +1637,7 @@ } }, addDocumentList(row) { + this.syncSiteContext(row.site) this.proofDocumenCurrentRow = row this.getProofDocument() this.documentListVisible = true @@ -1607,6 +1651,7 @@ projectPartId: row.projectPartId, testPartNo: row.testPartNo, partDesc: row.partDesc, + site: row.site, bu: row.bu, cProjectTypeDb: row.cProjectTypeDb, proofingId: row.proofingId, @@ -1619,6 +1664,7 @@ // 遍历proofDocumentList }, updateProofingRecord(row) { + this.syncSiteContext(row.site) this.proofingRecordVisible = true this.modalData = { projectId: row.projectId, @@ -1651,9 +1697,10 @@ } }, saveProofingRecord(row,type) { + const currentSite = this.syncSiteContext(this.modalData.site || (row && row.site) || this.proofDocumenCurrentRow.site) let inData = { id: this.modalData.id, - site: this.$store.state.user.site, + site: currentSite, username: this.$store.state.user.name, buNo: this.modalData.buNo, cProjectTypeDb: this.modalData.cProjectTypeDb, @@ -1684,7 +1731,7 @@ } if (row.proofingStatus === '草稿' && type === 1){ inData = { - site: this.$store.state.user.site, + site: currentSite, username: this.$store.state.user.name, buNo: row.buNo, cProjectTypeDb: row.cProjectTypeDb, @@ -1824,8 +1871,9 @@ }) }, proofingRecordDelete(row) { + const currentSite = this.syncSiteContext(row.site) let tempData = { - site: this.$store.state.user.site, + site: currentSite, username: this.$store.state.user.name, buNo: row.buNo, cProjectTypeDb: row.cProjectTypeDb, @@ -1927,6 +1975,7 @@ }); }, searchDocumentTypeList() { + this.searchDocumentTypeData.site = this.resolveProofingSite(this.modalData.site || this.proofDocumenCurrentRow.site) this.searchDocumentTypeData.proofingId = this.modalData.proofingId this.searchDocumentTypeData.projectId = this.modalData.projectId getExtraDocumentList(this.searchDocumentTypeData).then(({data}) => { @@ -1938,6 +1987,7 @@ }) }, saveSelectionDocumentType() { + const currentSite = this.syncSiteContext(this.modalData.site || this.proofDocumenCurrentRow.site) if (this.documentSelection.length === 0) { this.$message({ message: '请选择文档类型', @@ -1948,7 +1998,7 @@ } this.documentSelection.forEach((item) => { const inData = { - site: this.$store.state.user.site, + site: currentSite, proofingId: this.modalData.proofingId, proofingNo: this.modalData.proofingNo, projectId: this.modalData.projectId, @@ -1984,8 +2034,9 @@ }, closeAddDocumentTypeFlag() { this.addDocumentTypeFlag = false + const currentSite = this.resolveProofingSite(this.modalData.site || this.proofDocumenCurrentRow.site) this.searchDocumentTypeData = { - site: this.$store.state.user.site, + site: currentSite, projectId: '', projectNo: '', projectPartId: '', @@ -2063,8 +2114,9 @@ cancelButtonText: '取消', type: 'warning' }).then(() => { + const currentSite = this.resolveProofingSite(this.modalData.site || this.proofDocumenCurrentRow.site) const inData = { - site: this.$store.state.user.site, + site: currentSite, documentDefinitionListIds: documentDefinitionListIds } batchDeleteDocumentType(inData).then(({data}) => { @@ -2137,6 +2189,7 @@ this.proofDocumentList = [] } this.proofDocumenCurrentRow = JSON.parse(JSON.stringify(row)) + this.syncSiteContext(row ? row.site : '') }, /** * 当前值发生变化的时候修改 @@ -2150,6 +2203,7 @@ // 判断是否是获取焦点的事件 if (row) { this.proofDocumenCurrentRow = JSON.parse(JSON.stringify(row)) + this.syncSiteContext(row.site) //刷新当前页表 this.refreshCurrentTabTable() } @@ -2200,6 +2254,7 @@ }) }, saveSelectionCopyDocumentType() { + const currentSite = this.resolveProofingSite(this.copyModalData.site || this.proofDocumenCurrentRow.site) if (this.documentCopySelection.length === 0) { this.$message({ message: '请选择文档', @@ -2217,7 +2272,7 @@ } const inDataList = this.documentCopySelection.map(item => ({ ossId: item.ossId, - orderRef1: this.$store.state.user.site, + orderRef1: currentSite, orderRef2: this.copyModalData.proofingId.toString(), orderRef3: this.copyModalData.documentDefinitionListId, orderRef4: this.copyModalData.projectId.toString(), diff --git a/src/views/modules/eam/eamDocumentTypeDefinition.vue b/src/views/modules/eam/eamDocumentTypeDefinition.vue index dabbaa7..6676d4b 100644 --- a/src/views/modules/eam/eamDocumentTypeDefinition.vue +++ b/src/views/modules/eam/eamDocumentTypeDefinition.vue @@ -126,17 +126,40 @@ - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - + - - - + + + + + + - + + 保存 @@ -404,6 +431,13 @@ ], levelList: [], rules:{ + siteType:[ + { + required: true, + message: ' ', + trigger: ['blur','change'] + } + ], documentTypeIdType:[ { required: true, @@ -644,7 +678,7 @@ this.modalData = { flag: '1', // bu: this.userBuList[0].buNo, - site: this.$store.state.user.site, + site: '', documentTypeId: '', documentType: '', responsibleDepartment: '', @@ -657,6 +691,10 @@ this.modalDisableFlag = false this.modalFlag = true }, + handleModalSiteChange () { + this.modalData.responsibleDepartment = '' + this.getResponsibleDepartment() + }, updateModal (row) { this.modalData = { @@ -703,6 +741,10 @@ }, saveData () { + if (this.modalData.site === '' || this.modalData.site == null) { + this.$message.warning('请选择工厂!') + return + } // if (this.modalData.bu === '' || this.modalData.bu == null) { // this.$message.warning('请选择BU!') // return @@ -767,9 +809,15 @@ } }, getResponsibleDepartment() { + if (this.modalData.site === '' || this.modalData.site == null) { + this.responsibleDepartmentList = [] + return + } this.responsibleDepartmentList = [] - this.modalData.site = this.$store.state.user.site - getResponsibleDepartment(this.modalData).then(({data}) => { + let params = { + site: this.modalData.site + } + getResponsibleDepartment(params).then(({data}) => { if (data.code === 0) { data.rows.forEach((item) => { // 判断roleNo是否为A开头 diff --git a/src/views/modules/eam/eamProjectPartInfo.vue b/src/views/modules/eam/eamProjectPartInfo.vue index 463521e..a3f7571 100644 --- a/src/views/modules/eam/eamProjectPartInfo.vue +++ b/src/views/modules/eam/eamProjectPartInfo.vue @@ -1273,7 +1273,7 @@ - + 文档清单定义