Browse Source

指标溯源页面query更改code

Karsa 10 months ago
parent
commit
49f5d48054
2 changed files with 10 additions and 4 deletions
  1. 8 2
      src/main.js
  2. 2 2
      src/views/edbHistoryPage.vue

+ 8 - 2
src/main.js

@@ -11,6 +11,7 @@ import "font-awesome/css/font-awesome.min.css";
 import "@/utils/dialog.js";
 import "@/utils/option-scroll.js";
 import "@/utils/buttonPermission.js";
+import { dataBaseInterface } from '@/api/api.js';
 import { mixins } from "@/mixins";
 Vue.mixin(mixins);
 
@@ -24,7 +25,7 @@ import{endCalc,optionTimeCalc,init}from'@/utils/TimeOnPage.js';
 import setting from '@/mixins/theme.js'
 Vue.prototype.$setting = setting;
 
-Vue.prototype.toHistoryPage = (EdbInfoId,from=[])=>{
+Vue.prototype.toHistoryPage =  async(EdbInfoId,from=[])=>{
     console.log('from',from)
     let pathArr = from.map(p=>{
         return {
@@ -37,10 +38,15 @@ Vue.prototype.toHistoryPage = (EdbInfoId,from=[])=>{
         path:'/edbHistory'
     })
     sessionStorage.setItem('edbHistoryPath',JSON.stringify(pathArr))
+
+    //改为传code获取溯源 改的地方太多了在这里直接获取code算了
+    const {Ret,Data} = await dataBaseInterface.targetDetail({EdbInfoId})
+    if(Ret!==200) return
+
     const href = router.resolve({
         path:'/edbHistory',
         query:{
-            edbId:EdbInfoId,
+            code:Data.UniqueCode,
         }
     }).href
     window.open(href,"_blank")

+ 2 - 2
src/views/edbHistoryPage.vue

@@ -42,13 +42,13 @@ export default {
             window.open(href, '_blank');
         },
         async getData() {
-            const res = await dataBaseInterface.getEdbCreateHistory({ EdbInfoId: Number(this.$route.query.edbId) })
+            const res = await dataBaseInterface.getEdbCreateHistory({ UniqueCode: this.$route.query.code})
             if (res.Ret !== 200) return
             this.treeData = res.Data;
         }
     },
     mounted(){
-        if(this.$route.query.edbId){
+        if(this.$route.query.code){
             this.getData()
         }
     }