瀏覽代碼

bug修复,新品信息详情返回列表不关闭详情 问题

chenrui 3 年之前
父節點
當前提交
66ce88ebc0

+ 2 - 2
src/config/router.config.js

@@ -50,8 +50,8 @@ export const asyncRouterMap = [
       },
       // 新品列表
       {
-        path: '/newProduct/:onlineFalg',
-        name: 'newProduct',
+        path: '/newProduct/list/:onlineFalg',
+        name: 'newProductList',
         component: () => import(/* webpackChunkName: "home" */ '@/views/productManagement/newProduct/list'),
         meta: {
           title: '新品信息',

+ 1 - 1
src/views/Home.vue

@@ -70,7 +70,7 @@ export default {
     // 查看更多产品
     seeMore () {
       this.openNewProduct = false
-      this.$router.push({ name: 'newProduct', params: { onlineFalg: this.onlineFalg } })
+      this.$router.push({ name: 'newProductList', params: { onlineFalg: this.onlineFalg } })
     },
     // 关闭弹框
     cancelProductTips () {

+ 10 - 3
src/views/productManagement/newProduct/detail.vue

@@ -3,7 +3,7 @@
     <a-page-header :ghost="false" :backIcon="false" class="newProductDetail-back">
       <!-- 自定义的二级文字标题 -->
       <template slot="subTitle">
-        <a id="newProductDetail-back-btn" href="javascript:;" @click="$router.go(-1)">
+        <a id="newProductDetail-back-btn" href="javascript:;" @click="goBack">
           <a-icon type="left" />
           返回
         </a>
@@ -57,7 +57,8 @@ export default {
   data () {
     return {
       itemId: null,
-      detailsData: null //  详情数据
+      detailsData: null, //  详情数据
+      pageInfo: null
     }
   },
   methods: {
@@ -71,6 +72,10 @@ export default {
           this.detailsData = null
         }
       })
+    },
+    // 返回
+    goBack () {
+      this.$router.push({ path: this.pageInfo && this.pageInfo.path, query: { closeLastOldTab: true } })
     }
   },
   mounted () {
@@ -87,7 +92,9 @@ export default {
     }
   },
   beforeRouteEnter (to, from, next) {
-    next(vm => {})
+    next(vm => {
+      vm.pageInfo = from
+    })
   }
 }
 </script>

+ 3 - 3
src/views/salesManagement/salesQuery/detail.vue

@@ -93,7 +93,7 @@
         :columns="columns"
         :data="loadData"
         :scroll="{ x: 1290 }"
-		:defaultLoadData="false"
+        :defaultLoadData="false"
         bordered>
         <!-- 产品编码 -->
         <template slot="productCode" slot-scope="text, record">
@@ -215,8 +215,8 @@ export default {
   methods: {
     //  返回
     handleBack () {
-      // this.$router.push({ path: '/salesManagement/salesQuery/list', query: { closeLastOldTab: true } })
-      this.$router.go(-1)
+      this.$router.push({ path: '/salesManagement/salesQuery/list', query: { closeLastOldTab: true } }) // 为解决,销售列表=>销售详情=>其他页=>销售详情 时,点击返回列表,此时返回的是其他页的问题
+      // this.$router.go(-1)
     },
     // 编辑
     handleEdit () {