From d4388c096aabe3fce67fdd5f3fefd9e3fcafd8cc Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Fri, 09 May 2025 13:35:49 +0800
Subject: [PATCH]  【历史任务详情】【机巢详情】点击事件后面的“查看”按钮,跳转不正确处理

---
 src/views/tickets/ticket.vue |   29 +++++++++++++++++++++++------
 1 files changed, 23 insertions(+), 6 deletions(-)

diff --git a/src/views/tickets/ticket.vue b/src/views/tickets/ticket.vue
index 8517048..a999d33 100644
--- a/src/views/tickets/ticket.vue
+++ b/src/views/tickets/ticket.vue
@@ -502,6 +502,11 @@
 
 import { mapGetters } from 'vuex'
 import { getAdcodeObj } from '@/utils/disposeData'
+function regExp (label, name) {
+  var reg = new RegExp(label + "=([^&]*)(&|$)", "g")
+  return name.match(reg)[0].split("=")[1]
+}
+
 export default {
   name: "TicketPage",
   data () {
@@ -683,18 +688,30 @@
     }
   },
   created () {
-    let orderNumber = new URLSearchParams(window.location.search).get('orderNumber')
-    if (orderNumber) {
-      this.filters.keyword = orderNumber
-      this.isShowInfo = true
-    }
     this.loadAMapScripts()
     this.fetchDropdownData()
-    this.fetchTabCounts() // 新增:初始化时获取 tab 数据
     console.log('permission.tickets_processing_btn', this.permission.tickets_processing_btn)
     console.log('permission', this.permission.tickets_tab_pending)
   },
   mounted () {
+    const href = this.$route.query.redirect
+
+    if (href.split("?").length > 0) {
+      const [orderNumber] = href.split("?")[1].split("&")
+
+      const order = regExp('orderNumber', orderNumber)
+      console.log(order, 1111111)
+      if (order) {
+        this.filters.keyword = order
+
+        this.$nextTick(() => {
+          this.isShowInfo = true
+        })
+      }
+    }
+
+
+    this.fetchTabCounts() // 新增:初始化时获取 tab 数据
     this.fetchTableData()
   },
   computed: {

--
Gitblit v1.9.3