lilei 3 年 前
コミット
807a083626

+ 13 - 4
src/views/purchasingManagement/purchaseOrder/edit.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-  <div class="purchaseOrderEdit-wrap">
+  <div v-if="showPage" class="purchaseOrderEdit-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
     <a-spin :spinning="spinning" tip="Loading...">
       <a-page-header :ghost="false" :backIcon="false" class="purchaseOrderEdit-cont">
       <a-page-header :ghost="false" :backIcon="false" class="purchaseOrderEdit-cont">
         <!-- 自定义的二级文字标题 -->
         <!-- 自定义的二级文字标题 -->
@@ -254,6 +254,7 @@ export default {
   components: { STable, VSelect, ProductType, ProductBrand, ImportGuideModal, outStockModal, Print, chooseAddressModal },
   components: { STable, VSelect, ProductType, ProductBrand, ImportGuideModal, outStockModal, Print, chooseAddressModal },
   data () {
   data () {
     return {
     return {
+      showPage: false,
       spinning: false,
       spinning: false,
       detail: null, // 详细信息
       detail: null, // 详细信息
       subLoading: false,
       subLoading: false,
@@ -544,22 +545,30 @@ export default {
       this.$router.push({ path: '/purchasingManagement/purchaseOrder/list' })
       this.$router.push({ path: '/purchasingManagement/purchaseOrder/list' })
     },
     },
     pageInit () {
     pageInit () {
-      this.getOrderDetail()
-      this.resetPurchaseForm()
-      this.resetSearchForm()
+      this.$nextTick(() => {
+        this.getOrderDetail()
+        this.resetPurchaseForm()
+        this.resetSearchForm()
+      })
     }
     }
   },
   },
   mounted () {
   mounted () {
+    this.showPage = true
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
       this.pageInit()
       this.pageInit()
     }
     }
   },
   },
   activated () {
   activated () {
+    this.showPage = true
+    console.log(this.$store.state.app.isNewTab)
     // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
     // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
     if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
     if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
       this.pageInit()
       this.pageInit()
     }
     }
   },
   },
+  deactivated () {
+    // this.showPage = false
+  },
   beforeRouteEnter (to, from, next) {
   beforeRouteEnter (to, from, next) {
     next(vm => {})
     next(vm => {})
   }
   }

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

@@ -208,8 +208,8 @@ export default {
     }
     }
   },
   },
   deactivated () {
   deactivated () {
-    this.localDataSource = []
-    this.showPage = false
+    // this.localDataSource = []
+    // this.showPage = false
   },
   },
   beforeRouteEnter (to, from, next) {
   beforeRouteEnter (to, from, next) {
     next(vm => {})
     next(vm => {})

+ 2 - 2
src/views/salesManagement/salesQuery/edit.vue

@@ -572,8 +572,8 @@ export default {
     }
     }
   },
   },
   deactivated () {
   deactivated () {
-    this.dataSource = []
-    this.showPage = false
+    // this.dataSource = []
+    // this.showPage = false
   },
   },
   beforeRouteEnter (to, from, next) {
   beforeRouteEnter (to, from, next) {
     next(vm => {})
     next(vm => {})