lilei 2 years ago
parent
commit
70a4064592

+ 1 - 1
public/version.json

@@ -1,5 +1,5 @@
 {
   "message": "发现有新版本发布,确定更新系统?",
   "vendorJsVersion": "",
-  "version": 1678686400404
+  "version": 1678755807415
 }

+ 3 - 0
src/App.vue

@@ -42,6 +42,9 @@ export default {
         window.location.reload()
       }
     })
+    window.addEventListener('visibilitychange',()=>{
+      this.$store.state.app.visibilityState = document.visibilityState == 'visible'
+    })
     this.$message.config({
       top: `100px`,
       duration: 3,

+ 1 - 0
src/store/modules/app.js

@@ -34,6 +34,7 @@ const app = {
     closeTabPages: [], // 已关闭的页面
     isNewSubTab: false,
     updateList: false,
+    visibilityState: false,
     loadingStatus: false,
     winHeight: 0 ,//  窗口高度
     isLastDayForMonth: false, // 是否是当月最后一天

+ 18 - 1
src/utils/mixin.js

@@ -79,7 +79,8 @@ const AppDeviceEnquire = {
 const commonMixin = {
   data(){
     return {
-      toThousands
+      toThousands,
+      isActiveComp: false
     }
   },
   watch: {
@@ -92,8 +93,24 @@ const commonMixin = {
           this.spinning = a
         }
       }
+    },
+    '$store.state.app.visibilityState':function(a,b){
+      if(a && this.isActiveComp){
+        if(this.$refs.table){
+          this.$refs.table.refresh()
+        }
+        if(this.$refs.chooseTable){
+          this.$refs.chooseTable.refresh()
+        }
+      }
     }
   },
+  activated(){
+    this.isActiveComp = true
+  },
+  deactivated(){
+    this.isActiveComp = false
+  },
   methods: {
     getIsHomeNav () {
       const data = sessionStorage.getItem('isHomeNav')

+ 1 - 1
src/views/salesManagement/salesQueryNew/chooseShelfProduct.vue

@@ -378,7 +378,7 @@ export default {
       this.$refs.table.refresh(true)
     },
     reload () {
-      // this.$refs.table.clearSelected()
+      this.$refs.table.clearSelected()
       this.$refs.table.refresh()
     },
     // ---------- 全部产品----------

+ 1 - 1
src/views/salesManagement/salesQueryNew/outInDetialModal.vue

@@ -10,7 +10,7 @@
     @close="isShow = false"
     wrapClassName="outIndetail-modal jg-drawer-wrap"
      >
-    <a-spin :spinning="spinning" tip="Loading...">
+    <a-spin :spinning="spinning" tip="Loading..." v-if="isShow">
       <div class="baseInfo" ref="searchBox" v-if="baseData">
         <div>
           <span>产品编码:{{ baseData.dealerProductEntity ? baseData.dealerProductEntity.code : baseData.productCode }}</span>

+ 1 - 1
src/views/salesManagement/salesQueryNew/productSalesRecordModal.vue

@@ -9,7 +9,7 @@
       :z-index="150"
       wrapClassName="salesRecord-modal jg-drawer-wrap"
       width="70%">
-      <div>
+      <div v-if="isShow">
         <div ref="searchBox">
           <div style="padding: 0 0 10px 0;line-height: 24px;" v-if="baseData">
             <div style="flex:1">产品编码:{{ baseData.productCode }}</div>