From 51b2c1935688d9e75787625d93b485c5f44a5777 Mon Sep 17 00:00:00 2001 From: "han\\hanst" Date: Thu, 3 Sep 2026 11:34:05 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=BC=96=E7=A0=81=E5=92=8C?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=89=A9=E6=96=99=E5=A6=82=E6=9E=9C=E6=98=AF?= =?UTF-8?q?=E5=B7=B2=E7=BB=8F=E5=90=8C=E6=AD=A5=E7=9A=84=EF=BC=8C=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E5=8A=A0=E8=B6=85=E9=93=BE=E6=8E=A5=EF=BC=8C=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E5=8F=AF=E4=BB=A5=E8=B7=B3=E8=BD=AC=E5=88=B0NPI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/eam/eamProjectInfo.vue | 35 +++++++++ src/views/modules/eam/eamProjectPartInfo.vue | 54 +++++++++++--- .../sampleTracking/projectProofTracking.vue | 74 +++++++++++++++++-- 3 files changed, 146 insertions(+), 17 deletions(-) diff --git a/src/views/modules/eam/eamProjectInfo.vue b/src/views/modules/eam/eamProjectInfo.vue index 58a8edb..55c5f80 100644 --- a/src/views/modules/eam/eamProjectInfo.vue +++ b/src/views/modules/eam/eamProjectInfo.vue @@ -1332,6 +1332,7 @@ import {updateColumnSize} from "../../../api/table"; page: 1, limit: 10, }, + lastAppliedRouteQueryKey: '', height: 200, dialogHeight: 200, dialogWidth: 200, @@ -2998,6 +2999,9 @@ import {updateColumnSize} from "../../../api/table"; }, activated() { + if (this.applyProjectInfoRouteQuery() && !this.authSearch) { + this.getDataList() + } this.$store.commit("sift/commitSearchFunction",this.queryDataList) }, @@ -3011,6 +3015,7 @@ import {updateColumnSize} from "../../../api/table"; // 动态列 this.getTableUserColumn(this.$route.meta.menuId+'table1',1) this.getTableUserColumn(this.$route.meta.menuId+'table2',2) + this.applyProjectInfoRouteQuery() if (!this.authSearch) { if (!this.agencyMatters){ // 获取数据列表 @@ -3020,6 +3025,36 @@ import {updateColumnSize} from "../../../api/table"; }, methods: { + applyProjectInfoRouteQuery () { + const queryProjectNo = this.$route.query && this.$route.query.projectNo + if (queryProjectNo === undefined || queryProjectNo === null || String(queryProjectNo).trim() === '') { + return false + } + const projectNo = String(queryProjectNo).trim() + const queryKey = 'projectNo=' + projectNo + // 同一组路由参数只自动查询一次,避免 keep-alive 切回页签时覆盖用户手工条件。 + if (this.lastAppliedRouteQueryKey === queryKey) { + return false + } + this.lastAppliedRouteQueryKey = queryKey + this.searchData.projectNo = projectNo + // 自动查询只带项目编码,清掉页签里残留的其它条件,避免查不到目标项目。 + this.searchData.projectDesc = '' + this.searchData.customerNo = '' + this.searchData.customerDesc = '' + this.searchData.buDesc = '' + this.searchData.projectCategory = '' + this.searchData.status = '' + this.searchData.projectManager = '' + this.searchData.projectOwner = '' + this.searchData.engineer = '' + this.searchData.startDate = '' + this.searchData.endDate = '' + this.searchData.cProjectRegion = '' + this.pageIndex = 1 + this.searchData.page = 1 + return true + }, normalizeBuText (value) { if (value === null || value === undefined) { return '' diff --git a/src/views/modules/eam/eamProjectPartInfo.vue b/src/views/modules/eam/eamProjectPartInfo.vue index bb91af7..5895395 100644 --- a/src/views/modules/eam/eamProjectPartInfo.vue +++ b/src/views/modules/eam/eamProjectPartInfo.vue @@ -1985,6 +1985,7 @@ import {uploadFileList} from '@/api/base/baseFunction.js'; confirmVisible: false, confirmationPrompted: false, // 是否已经进行过确认提示的标志 agencyMatters: false, // 是否代办事项 + lastAppliedRouteQueryKey: '', finalPartFlag: false, visible: false, // 新增打样模态框 dataListIndex: 0, @@ -3902,11 +3903,7 @@ import {uploadFileList} from '@/api/base/baseFunction.js'; this.getTableUserColumn(this.$route.meta.menuId+'table1',1) if (!this.authSearch) { if (!this.agencyMatters){ - if (this.$route.query.projectNo || this.$route.query.testPartNo) { - this.searchData1.projectNo = this.$route.query.projectNo; - this.searchData1.testPartNo = this.$route.query.testPartNo; - this.agencyMatters = true; - } + this.applyProjectPartRouteQuery() // 获取 URL 查询参数 const { projectPartId } = this.$route.query; // 将查询参数赋值给 searchData @@ -3920,16 +3917,55 @@ import {uploadFileList} from '@/api/base/baseFunction.js'; }, activated() { - if (this.$route.query.projectNo || this.$route.query.testPartNo) { - this.searchData1.projectNo = this.$route.query.projectNo; - this.searchData1.testPartNo = this.$route.query.testPartNo; - this.agencyMatters = true; + if (this.applyProjectPartRouteQuery()) { this.getDataList(); } this.$store.commit("sift/commitSearchFunction",this.queryEamProjectPart) }, methods: { + applyProjectPartRouteQuery () { + const query = this.$route.query || {} + const projectNo = query.projectNo === undefined || query.projectNo === null ? '' : String(query.projectNo).trim() + const testPartNo = query.testPartNo === undefined || query.testPartNo === null ? '' : String(query.testPartNo).trim() + if (!projectNo && !testPartNo) { + return false + } + const queryKey = 'projectNo=' + projectNo + '|testPartNo=' + testPartNo + // 同一组路由参数只自动查询一次,避免 keep-alive 切回页签时覆盖用户手工条件。 + if (this.lastAppliedRouteQueryKey === queryKey) { + return false + } + this.lastAppliedRouteQueryKey = queryKey + // 同步到查询表单,便于用户看到当前自动查询条件;searchData1 供跳转查询使用。 + this.searchData.projectNo = projectNo + this.searchData.testPartNo = testPartNo + this.searchData.projectDesc = '' + this.searchData.partDesc = '' + this.searchData.buDesc = '' + this.searchData.customerNo = '' + this.searchData.customerDesc = '' + this.searchData.projectCategory = '' + this.searchData.status = '' + this.searchData.projectManager = '' + this.searchData.projectOwner = '' + this.searchData.engineer = '' + this.searchData.startDate = '' + this.searchData.endDate = '' + this.searchData.cProjectRegion = '' + this.searchData1.projectNo = projectNo + this.searchData1.testPartNo = testPartNo + this.searchData1.buDesc = '' + this.searchData1.projectDesc = '' + this.searchData1.partDesc = '' + this.searchData1.customerNo = '' + this.searchData1.customerDesc = '' + this.agencyMatters = true + this.pageIndex = 1 + this.searchData.page = 1 + this.searchData1.page = 1 + return true + }, resolveCurrentPartSite (site) { if (site !== null && site !== undefined && site !== '') { return site diff --git a/src/views/modules/sampleTracking/projectProofTracking.vue b/src/views/modules/sampleTracking/projectProofTracking.vue index ad99f70..4ac9e3b 100644 --- a/src/views/modules/sampleTracking/projectProofTracking.vue +++ b/src/views/modules/sampleTracking/projectProofTracking.vue @@ -143,7 +143,13 @@ class="el-icon-success project-part-sync-icon" aria-hidden="true" > - {{ getTrackingColumnDisplayValue(scope.row, item.columnProp) }} + {{ getTrackingColumnDisplayValue(scope.row, item.columnProp) }} + {{ getTrackingColumnDisplayValue(scope.row, item.columnProp) }} - + @@ -522,7 +528,7 @@ - + @@ -621,7 +627,7 @@ PM/Sales - + @@ -1843,6 +1849,53 @@ export default { isSyncIconTrackingColumn (columnProp) { return ['projectNo', 'testPartNo', 'proofingNo'].indexOf(columnProp) > -1 }, + // 仅已同步到 NPI 的项目编码/项目物料可跳转,避免临时 tracking 主键误进正式库页面。 + canOpenNpiFromTracking (row, columnProp) { + if (!row || this.isBlankValue(this.getTrackingColumnDisplayValue(row, columnProp))) { + return false + } + if (columnProp === 'projectNo') { + return this.isSyncedByIdRule(row.projectId || row.project_id) + } + if (columnProp === 'testPartNo') { + return this.isSyncedByIdRule(this.getTrackingProjectPartId(row)) + } + return false + }, + openNpiFromTracking (columnProp, row) { + if (!this.canOpenNpiFromTracking(row, columnProp)) { + return + } + if (columnProp === 'projectNo') { + this.openNpiTab('eam-eamProjectInfo', { + projectNo: this.getTrackingColumnDisplayValue(row, 'projectNo') + }) + return + } + this.openNpiTab('eam-eamProjectPartInfo', { + projectNo: this.getTrackingColumnDisplayValue(row, 'projectNo'), + testPartNo: this.getTrackingColumnDisplayValue(row, 'testPartNo') + }) + }, + // 跳转时同步更新已打开页签上的 query,否则再次点页签会带回第一次进入时的旧查询条件。 + openNpiTab (routeName, query) { + const tabs = this.$store.state.common.mainTabs || [] + const existingTab = tabs.find(item => item && item.name === routeName) + if (existingTab) { + this.$store.commit('common/updateMainTabs', tabs.map(item => { + if (!item || item.name !== routeName) { + return item + } + return Object.assign({}, item, { query: query }) + })) + } + this.$router.push({ name: routeName, query: query }).catch((err) => { + if (err && err.name === 'NavigationDuplicated') { + return + } + this.$message.error('未找到对应NPI页面,请确认是否有菜单权限') + }) + }, getTrackingColumnDisplayValue (row, columnProp) { if (!row || !columnProp) { return '' @@ -6116,10 +6169,6 @@ export default { padding: 0 8px; } -.one-key-grid-form--detail { - pointer-events: none; -} - .one-key-grid-form .el-form-item { margin-bottom: 10px; } @@ -6163,6 +6212,15 @@ export default { align-items: center; } +.npi-jump-link { + color: #0c4dbb; + cursor: pointer; +} + +.npi-jump-link:hover { + text-decoration: underline; +} + .project-part-sync-icon { margin-left: -4px; margin-right: 2px;