lilei 2 лет назад
Родитель
Сommit
da6b845fc8
1 измененных файлов с 22 добавлено и 8 удалено
  1. 22 8
      src/views/salesReturnManagement/salesReturn/detail.vue

+ 22 - 8
src/views/salesReturnManagement/salesReturn/detail.vue

@@ -55,7 +55,7 @@
         </a-collapse>
       </a-card>
       <a-card size="small" :bordered="false" class="pages-wrap">
-        <a-tabs v-model="curTab">
+        <a-tabs v-model="curTab" @change="changeTab">
           <a-tab-pane :key="1" tab="产品明细" force-render>
             <a-alert style="margin-bottom: 10px;" type="info">
               <div slot="message" class="total-bar">
@@ -242,20 +242,34 @@ export default {
           _this.spinning = false
         })
       }
+    },
+    changeTab (v) {
+      this.$nextTick(() => {
+        if (v == 1) {
+          this.$refs.table.refresh(true)
+        }
+        if (v == 2) {
+          this.$refs.auditDetail.refresh()
+        }
+        if (v == 3) {
+          this.$refs.operateTable.refresh(true)
+        }
+      })
+    },
+    pageInit () {
+      this.getDetail()
+      if (!this.disabled) {
+        this.$refs.table.refresh(true)
+      }
     }
   },
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
-      this.getDetail()
+      this.pageInit()
     }
   },
   activated () {
-    this.getDetail()
-    if (!this.$store.state.app.isNewTab) {
-      this.$refs.table.refresh(true)
-      this.$refs.auditDetail.refresh()
-      this.$refs.operateTable.refresh(true)
-    }
+    this.pageInit()
   },
   beforeRouteEnter (to, from, next) {
     next(vm => {})