Browse Source

处理bug

wangcz 7 years ago
parent
commit
16845b7f69
1 changed files with 5 additions and 39 deletions
  1. 5 39
      pages/mobile/center/vendor/outOfStorage/index.vue

+ 5 - 39
pages/mobile/center/vendor/outOfStorage/index.vue

@@ -23,7 +23,7 @@
             <span :class="{'active': handleItem === 1}" @click="setHandleItem(1)">{{switchType === 'INBOUND' ? '其它入库' : '其它出库'}}</span>
             <span :class="{'active': handleItem === 2}" @click="setHandleItem(2)">{{switchType === 'INBOUND' ? '采购入库' : '销售出库'}}</span>
           </div>
-          <div class="filters-wrap" v-if="handleItem !== 1">
+          <div class="filters-wrap" v-show="handleItem !== 1">
             <base-filter
               v-for="filterOption in filterOptions"
               :key="filterOption.selectOption"
@@ -35,8 +35,10 @@
             </base-filter>
           </div>
           <div class="list-content">
-            <storage-list :listData="storageList" :switchType="switchType" :handleItem="handleItem" v-show="handleItem !== 1"></storage-list>
-            <other-storage :switchType="switchType" v-show="handleItem === 1"></other-storage>
+            <keep-alive>
+              <storage-list :listData="storageList" :switchType="switchType" :handleItem="handleItem" v-if="handleItem !== 1"></storage-list>
+              <other-storage :switchType="switchType" v-else></other-storage>
+            </keep-alive>
           </div>
           <empty-status  v-if="isEmpty && handleItem !== 1" :type="'collect'" :showLink="true" :text="'抱歉,没有相关信息'"></empty-status>
           <pull-up :fixId="'mobile-storage-center'" :searchMore="fetching" :allPage="allPage" :page="page" @pullUpAction="onPullUpAction"></pull-up>
@@ -103,42 +105,6 @@
     created () {
       this.switchType = this.$route.query.type ? this.$route.query.type : 'INBOUND'
       this.handleItem = this.$route.query.handleItem ? Number(this.$route.query.handleItem) : 0
-      let currentTime = this.baseUtils.getClearDay(new Date())
-      let fromDate = currentTime - 29 * 24 * 60 * 60 * 1000
-      let toDate = currentTime + 23 * 60 * 60 * 1000 + 59 * 60 * 1000 + 59 * 1000
-      if(this.handleItem === 0) {
-        this.$store.dispatch('product/getLoadStorageData', {
-          count: 10,
-          page: 1,
-          fromDate: fromDate,
-          toDate: toDate,
-          type: this.switchType
-        })
-      } else if(this.handleItem === 2) {
-        if(this.switchType === 'INBOUND') {
-          this.filterParams.type = null
-          this.$store.dispatch('product/getLoadEnterpriseData', {
-            count: 10,
-            page: 1,
-            fromDate: fromDate,
-            toDate: toDate
-          })
-        } else if(this.switchType === 'OUTBOUND'){
-          this.$store.dispatch('product/getLoadPurchaseData', {
-            count: 10,
-            page: 1,
-            startMils: fromDate,
-            endMils: toDate,
-            type: this.switchType,
-            sorting: {"createtime":"DESC"},
-            status: '502-406'
-          })
-        } else {
-          this.$router.push('/mobile/center/vendor/outOfStorage?providerType=person')
-        }
-      } else {
-        this.$router.push('/mobile/center/vendor/outOfStorage?providerType=person')
-      }
     },
     watch: {
       'storageData': {