diff --git a/src/router/index.js b/src/router/index.js index 44af31f..30b78bf 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -23,7 +23,7 @@ const globalRoutes = [ { path: '/login-token', component: _import('common/login-token'), name: 'login', meta: { title: '登录' } }, { path: '/cdc', component: _import('modules/cdc/collectScreen'), name: 'cdc', meta: { title: '大屏' } }, { path: '/pre', component: _import('common/previewFile'), name: 'pre', meta: { title: '文件预览' } }, - { path: '/BMPage', component: _import('modules/sampleManagement/technicalSpecificationDetail/technicalSpecificationDetail'), name: 'BM', meta: { title: '技术参数卡' } }, + { path: '/BMPage/:id', component: _import('modules/sampleManagement/technicalSpecificationDetail/technicalSpecificationDetail'), name: 'BM', meta: { title: '技术参数卡' } }, ] // 主入口路由(需嵌套上左右整体布局) diff --git a/src/views/modules/sampleManagement/com_technical-add-or-update.vue b/src/views/modules/sampleManagement/com_technical-add-or-update.vue index 99f392c..c22cd18 100644 --- a/src/views/modules/sampleManagement/com_technical-add-or-update.vue +++ b/src/views/modules/sampleManagement/com_technical-add-or-update.vue @@ -1091,14 +1091,17 @@ this.$emit('refreshDataList') if(this.jumpFlag){ setTimeout(() => { + let now = Date.now(); let inData = { site: this.$store.state.user.site, codeNo: data.row.codeNo, buNo: data.row.buNo, - username: this.$store.state.user.name + username: this.$store.state.user.name, + uuid:now+'', + activeName:'baseInfo' }; localStorage.setItem('tsfData', JSON.stringify(inData)) - window.open('#/BMPage'); + window.open('#/BMPage/'+now); },500) } diff --git a/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_bom.vue b/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_bom.vue index 2b7552b..e41b5a1 100644 --- a/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_bom.vue +++ b/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_bom.vue @@ -637,7 +637,8 @@ submitChange(tempData).then(({data}) => { if (data && data.code === 0) { this.submitModalFlag = false - this.searchTable(); + // this.searchTable(); + window.location.reload(); this.$message({message: '操作成功', type: 'success'}) } else { this.$alert(data.msg, '错误', { diff --git a/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_customerInformation.vue b/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_customerInformation.vue index 985d217..72714cf 100644 --- a/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_customerInformation.vue +++ b/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_customerInformation.vue @@ -153,6 +153,7 @@ label="参数卡编码" height="150px" style="margin-top: 5px" + :disabled="ifDisableFlag" :columns="ossColumns" :order-ref1="dataForm.site?dataForm.site:''" :order-ref2="dataForm.codeNo?dataForm.codeNo:''" @@ -180,6 +181,7 @@ label="参数卡编码" height="150px" style="margin-top: 5px" + :disabled="ifDisableFlag" :columns="ossColumns" :order-ref1="dataForm.site?dataForm.site:''" :order-ref2="dataForm.codeNo?dataForm.codeNo:''" @@ -596,7 +598,8 @@ if (data && data.code === 0) { submitChange(tempData).then(({data}) => { if (data && data.code === 0) { - this.searchTable() + // this.searchTable() + window.location.reload(); this.submitModalFlag = false this.$message({message: '操作成功', type: 'success'}) } else { diff --git a/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_demoSlot.vue b/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_demoSlot.vue index 7b18b9e..4615d21 100644 --- a/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_demoSlot.vue +++ b/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_demoSlot.vue @@ -401,7 +401,8 @@ if (data && data.code === 0) { submitChange(tempData).then(({data}) => { if (data && data.code === 0) { - this.searchTable() + // this.searchTable() + window.location.reload(); this.submitModalFlag = false this.$emit("closeModel") } else { diff --git a/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_routing.vue b/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_routing.vue index d8792c6..c68685c 100644 --- a/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_routing.vue +++ b/src/views/modules/sampleManagement/technicalSpecificationDetail/com_bm_routing.vue @@ -1591,10 +1591,10 @@ tsdBasicInformationSearch(this.searchData).then(({data}) => { if(data.row){ this.sheetData=data.row + window.location.reload(); }else { } - }); } else { this.$message.error(data.msg) diff --git a/src/views/modules/sampleManagement/technicalSpecificationDetail/com_tsd_basicInformation.vue b/src/views/modules/sampleManagement/technicalSpecificationDetail/com_tsd_basicInformation.vue index d0e78f1..74eff4a 100644 --- a/src/views/modules/sampleManagement/technicalSpecificationDetail/com_tsd_basicInformation.vue +++ b/src/views/modules/sampleManagement/technicalSpecificationDetail/com_tsd_basicInformation.vue @@ -1011,7 +1011,8 @@ if (data && data.code === 0) { issueChange(tempData).then(({data}) => { if (data && data.code === 0) { - this.searchTable() + // this.searchTable() + window.location.reload(); this.$message({message: '操作成功', type: 'success'}) } else { this.$alert(data.msg, '错误', { @@ -1061,7 +1062,8 @@ if (data && data.code === 0) { submitChange(tempData).then(({data}) => { if (data && data.code === 0) { - this.searchTable() + // this.searchTable() + window.location.reload(); this.submitModalFlag = false this.$message({message: '操作成功', type: 'success'}) } else { diff --git a/src/views/modules/sampleManagement/technicalSpecificationDetail/technicalSpecificationDetail.vue b/src/views/modules/sampleManagement/technicalSpecificationDetail/technicalSpecificationDetail.vue index b8ace46..e9e59c6 100644 --- a/src/views/modules/sampleManagement/technicalSpecificationDetail/technicalSpecificationDetail.vue +++ b/src/views/modules/sampleManagement/technicalSpecificationDetail/technicalSpecificationDetail.vue @@ -125,20 +125,44 @@ activeName:'baseInfo', } }, + created() { + // 注册 页面销毁前,即刷新 存储最新的activeName 即 TAB标签 + window.addEventListener('beforeunload', () => { + localStorage.setItem('activeName', this.activeName); + }); + }, mounted() { - if(localStorage.getItem('tsfData')!=undefined){ - let data=JSON.parse(localStorage.getItem('tsfData')) + let data=JSON.parse(localStorage.getItem('tsfData')) + if(data){ + let id = this.$route.params.id + if (data.uuid !== id){ + // localStorage.removeItem('tsfData'); + this.$router.replace("/404") + } this.dataForm.site=data.site this.dataForm.codeNo=data.codeNo this.dataForm.buNo=data.buNo this.dataForm.username=data.username - localStorage.removeItem('tsfData'); - } - this.$nextTick(() => { + // 页面数据和页面高度 this.getPageRole() this.changeHeightAuto(); - this.getBaseInfoData(); - }) + // 传递的 tab + if (data.activeName){ + // 当前使用哪个tab + this.activeName = data.activeName; + // 使用后清除 + data.activeName = '' + }else { + // 使用刷新的tab + this.activeName = localStorage.getItem('activeName') + } + // 重新保存当前数据 目的是刷新首次的TAB + localStorage.setItem('tsfData',JSON.stringify(data)) + // 刷新数据 + // this.$nextTick(() => { + // // this.getBaseInfoData(); + // }) + } }, methods: { refreshCurrentTabTable(){ @@ -249,6 +273,11 @@ getBMPageBase(this.dataForm).then(({data}) => { if (data && data.code === 0) { this.pageRole=data.row + // 2025-05-12 新增页面初始化后调用 + // 用于刷新当前使用的TAB数据 + this.$nextTick(()=>{ + this.refreshCurrentTabTable(); + }) } }) }, diff --git a/src/views/modules/sampleManagement/technicalSpecificationList.vue b/src/views/modules/sampleManagement/technicalSpecificationList.vue index 1f33f1a..d1e6cf9 100644 --- a/src/views/modules/sampleManagement/technicalSpecificationList.vue +++ b/src/views/modules/sampleManagement/technicalSpecificationList.vue @@ -1113,13 +1113,17 @@ }) }, jumpDetail(row){ - let inData={ - site:this.$store.state.user.site, - codeNo:row.codeNo, - buNo:row.buNo, - username:this.$store.state.user.name}; + let now = Date.now(); + let inData = { + site: this.$store.state.user.site, + codeNo: row.codeNo, + buNo: row.buNo, + username: this.$store.state.user.name, + uuid:now+'', + activeName:'baseInfo' + }; localStorage.setItem('tsfData', JSON.stringify(inData)) - window.open('#/BMPage'); + window.open('#/BMPage/'+now); // this.$router.replace('sampleManagement-technicalSpecificationDetail/technicalSpecificationDetail') },