Ver código fonte

fixed page jump in business

maqingyang 11 meses atrás
pai
commit
885d48c675

+ 1 - 1
package.json

@@ -4,7 +4,7 @@
   "private": true,
   "scripts": {
     
-    "serve": "vue-cli-service serve",
+    "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
     "build": "vue-cli-service build"
   },
   "dependencies": {

+ 1 - 1
src/router/index.js

@@ -363,7 +363,7 @@ var routes = [{
                 meta: {
                     keepAlive: false,
                     show: true,
-                    menu: 'businessInfo'
+                    menu: 'business'
                 }
             },
             {

+ 66 - 58
src/views/system/business.vue

@@ -9,20 +9,20 @@
         </el-button>
 
         <el-menu
-          default-active="1"
+          :default-active="activeIndex"
           class="el-menu-vertical-demo"
-
+          @select="handleMenuSelect"
           :collapse="isCollapse"
           >
-          <el-menu-item  @click="gotolink1" class="vertical-center" index="1">
+          <el-menu-item  class="vertical-center" index="1">
             <i class="el-icon-location"></i>
             <span slot="title">待办业务</span>
           </el-menu-item>
-          <el-menu-item @click="gotolink2" class="vertical-center" index="2">
+          <el-menu-item  class="vertical-center" index="2">
             <i class="el-icon-menu"></i>
             <span slot="title">解析业务</span>
           </el-menu-item>
-          <el-menu-item  @click="gotolink3" class="vertical-center" index="3">
+          <el-menu-item  class="vertical-center" index="3">
             <i class="el-icon-setting"></i>
             <span slot="title">失败业务</span>
           </el-menu-item>
@@ -127,6 +127,7 @@ export default {
   components: {},
   data() {
     return {
+      activeIndex:'1',
       activeKey: 0,
       activeName: "second",
       currentPage: 1,
@@ -145,19 +146,28 @@ export default {
       input:'',
       showSize:'',
       totalSize:'',
-      businessType:0,
+      businessType:1,
     }
   },
   watch: {},
   computed: {},
   beforeCreate() {},
   created() {
-    
+  
   },
   beforeMount() {},
   mounted()
   {
-    businessList(this.currentPage,this.pagesize,this.businessType).then(
+    this.activeIndex = this.$route.query.activeIndex || 1; // 使用默认值 1
+    this.handleMenuSelect(this.activeIndex);
+  },
+  beforeUpdate() {},
+  updated() {},
+  destroyed() {},
+  methods: {
+    handleMenuSelect(index) {
+      this.activeIndex = index;
+      businessList(this.currentPage,this.pagesize,this.activeIndex).then(
           res=>
           {
             this.businessData=res.data.business_list.list;
@@ -168,11 +178,8 @@ export default {
 
           }
       )
-  },
-  beforeUpdate() {},
-  updated() {},
-  destroyed() {},
-  methods: {
+     
+    },
     toggleCollapse(){
       this.isCollapse = !this.isCollapse;
     },
@@ -259,52 +266,52 @@ export default {
           console.error(error);
         }
       },
-      gotolink1()
-      {
-        this.businessType=0;
-        businessList(this.currentPage,this.pagesize,this.businessType).then(
-          res=>
-          {
-            this.businessData=res.data.business_list.list;
-            this.businessShowData = this.businessData
-            var j = parseInt(res.data.business_list.total)
-            this.totalSize = j
-            this.showSize = this.totalSize
+      // gotolink1()
+      // {
+      //   this.businessType=0;
+      //   businessList(this.currentPage,this.pagesize,this.businessType).then(
+      //     res=>
+      //     {
+      //       this.businessData=res.data.business_list.list;
+      //       this.businessShowData = this.businessData
+      //       var j = parseInt(res.data.business_list.total)
+      //       this.totalSize = j
+      //       this.showSize = this.totalSize
   
-          }
-      )
-      },
-      gotolink2()
-      {
-        this.businessType=1;
-        businessList(this.currentPage,this.pagesize,this.businessType).then(
-          res=>
-          {
-            this.businessData=res.data.business_list.list;
-            this.businessShowData = this.businessData
-            var j = parseInt(res.data.business_list.total)
-            this.totalSize = j
-            this.showSize = this.totalSize
-            console.log("阿斯蒂芬贵哦")
-
-            console.log(this.businessShowData)
-          }
-      )
-      },
-      gotolink3()
-      {
-        this.businessType=2;
-        businessList(this.currentPage,this.pagesize,this.businessType).then(
-          res=>
-          {
-            this.businessData=res.data.business_list.list;
-            this.businessShowData = this.businessData
-            var j = parseInt(res.data.business_list.total)
-            this.totalSize = j
-            this.showSize = this.totalSize
+      //     }
+      // )
+      // },
+      // gotolink2()
+      // {
+      //   this.businessType=1;
+      //   businessList(this.currentPage,this.pagesize,this.businessType).then(
+      //     res=>
+      //     {
+      //       this.businessData=res.data.business_list.list;
+      //       this.businessShowData = this.businessData
+      //       var j = parseInt(res.data.business_list.total)
+      //       this.totalSize = j
+      //       this.showSize = this.totalSize
+      //       console.log("阿斯蒂芬贵哦")
+
+      //       console.log(this.businessShowData)
+      //     }
+      // )
+      // },
+      // gotolink3()
+      // {
+      //   this.businessType=2;
+      //   businessList(this.currentPage,this.pagesize,this.businessType).then(
+      //     res=>
+      //     {
+      //       this.businessData=res.data.business_list.list;
+      //       this.businessShowData = this.businessData
+      //       var j = parseInt(res.data.business_list.total)
+      //       this.totalSize = j
+      //       this.showSize = this.totalSize
   
-          })
-      },
+      //     })
+      // },
     tables:function () { //在你的数据表格中定义tabels
       const input = this.input
       if (input) {
@@ -326,7 +333,8 @@ export default {
           headInfId:row.headInfId,
           rptNo:row.rptNo,
           businessId:row.businessId,
-          cooperatorName:row.cooperatorName
+          cooperatorName:row.cooperatorName,
+          activeIndex: this.activeIndex
         }
       })
     },

+ 42 - 39
src/views/system/businessInfo.vue

@@ -9,19 +9,19 @@
                        class="el-icon-s-fold">
           </el-button>
           <el-menu
-              default-active="1"
+              :default-active="activeIndex"
               class="el-menu-vertical-demo"
-  
+              @select="handleMenuSelect"
           >
-            <el-menu-item  @click="gotolink1" class="vertical-center" index="1">
+            <el-menu-item   class="vertical-center" index="1">
               <i class="el-icon-location"></i>
               <span slot="title">待办业务</span>
             </el-menu-item>
-            <el-menu-item @click="gotolink2" class="vertical-center" index="2">
+            <el-menu-item class="vertical-center" index="2">
               <i class="el-icon-menu"></i>
               <span slot="title">解析业务</span>
             </el-menu-item>
-            <el-menu-item  @click="gotolink3" class="vertical-center" index="3">
+            <el-menu-item   class="vertical-center" index="3">
               <i class="el-icon-setting"></i>
               <span slot="title">失败业务</span>
             </el-menu-item>
@@ -194,7 +194,10 @@
             <!--            yuan-->
   
           </el-tabs>
-          <el-button type="primary" round @click="onButtonClickReturn" size="small" style="margin-left: 350px">返回</el-button>
+          <div class = "bottom-bar" style="margin-top: 20px" >
+                <el-button round type="primary" size="medium" style="position: absolute; left: 55%;" @click="onButtonClickReturn" >返回</el-button>
+            </div>
+          <!-- <el-button type="primary" round @click="onButtonClickReturn" size="small" style="margin-left: 350px">返回</el-button> -->
   
   
   
@@ -265,6 +268,7 @@
     components: {},
     data() {
       return {
+        activeIndex:this.$route.query.activeIndex,
         activeKey: 0,
         activeName: "first",
         currentPage1: 1,
@@ -381,6 +385,16 @@
     updated() {},
     destroyed() {},
     methods: {
+      handleMenuSelect(index) {
+      this.activeIndex = index;
+      this.$router.push({
+        path: '/business',
+        query: {
+          activeIndex: this.activeIndex
+        }
+      })
+     
+    },
       request() {},
       toggleCollapse(){
         this.isCollapse = !this.isCollapse;
@@ -447,42 +461,31 @@
         location.reload();
   
       },
-      gotolink1()
-      {
-        this.$router.replace('/business');
-        this.selected1 = false;
-        this.selected2 = true;
-        this.selected3 = true;
-        this.selected4 = false;
-        this.selected5 = true;
-        this.selected6 = false;
-      },
+      // gotolink1()
+      // {
+      //   this.$router.replace('/business');
+      // },
   
-      gotolink2()
-      {
-        //指定跳转地址
-        this.$router.replace('/business');
-        this.selected1 = true;
-        this.selected2 = false;
-        this.selected3 = false;
-        this.selected4 = true;
-        this.selected5 = true;
-        this.selected6 = false;
-      },
-      gotolink3()
-      {
-        //指定跳转地址
-        this.$router.replace('/business');
-        this.selected1 = true;
-        this.selected2 = false;
-        this.selected3 = true;
-        this.selected4 = false;
-        this.selected5 = false;
-        this.selected6 = true;
-      },
+      // gotolink2()
+      // {
+      //   //指定跳转地址
+      //   this.$router.replace('/business');
+
+      // },
+      // gotolink3()
+      // {
+      //   //指定跳转地址
+      //   this.$router.replace('/business');
+
+      // },
       onButtonClickReturn()
       {
-        this.$router.replace('/business');
+        this.$router.push({
+          path: '/business',
+          query: {
+            activeIndex: this.activeIndex
+          }
+        })
       },
   
       //yuan

+ 1 - 1
src/views/system/cooperatorProductInfoBase.vue

@@ -53,7 +53,7 @@
                 
             </el-descriptions>
             <div class = "bottom-bar" style="margin-top: 20px" >
-                <el-button round type="success" size="medium" style="position: absolute; left: 55%;" @click="gotolink2" >完成</el-button>
+                <el-button round type="primary" size="medium" style="position: absolute; left: 55%;" @click="gotolink2" >完成</el-button>
             </div>
           
         </el-main>

+ 3 - 3
src/views/system/homePage.vue

@@ -124,7 +124,7 @@ export default {
   beforeMount() {},
   mounted() 
   {
-    getBusinessSize(0).then(
+    getBusinessSize(1).then(
         res=>
         {
           var j = parseInt(res.data.business_size)
@@ -133,14 +133,14 @@ export default {
         }
     )
 
-    getBusinessSize(1).then(
+    getBusinessSize(2).then(
         res=>
         {
           var j = parseInt(res.data.business_size)
           this.analysisSize = j
         }
     )
-    getBusinessSize(2).then(
+    getBusinessSize(3).then(
         res=>
         {
           var j = parseInt(res.data.business_size)