shish пре 2 месеци
родитељ
комит
55218afb6b

+ 60 - 3
ghsApp/src/admin/home/member.vue

@@ -83,7 +83,17 @@
     </block>
     </div>
     <NotLogin></NotLogin>
-    <ShopSelect ref="shopSelectComponent" class="bar" :isShowTit="false" top="0upx" @selectShopFn="selectShopFn" />
+
+    <view class="shop-select-wrap">
+      <view v-if="shopSelectOpen" class="pull-custom-tip">从其他门店拉取客户</view>
+      <ShopSelect
+        ref="shopSelectComponent"
+        class="bar"
+        :isShowTit="false"
+        top="0upx"
+        @selectShopFn="selectShopFn"
+      />
+    </view>
 
     <view v-if="showFilterPanel" class="filter-overlay" @click="closeFilterPanel">
       <view class="filter-panel" @click.stop>
@@ -274,7 +284,8 @@ export default {
       seekVal: "",
       searchText: "",
       lastSearchText: "",
-      searchTimer: null
+      searchTimer: null,
+      shopSelectOpen: false
     };
   },
   onLoad(option) {
@@ -313,6 +324,7 @@ export default {
       clearTimeout(this.searchTimer);
       this.searchTimer = null;
     }
+    this.clearShopSelectWatch();
   },
   onHide() {
     // 清理搜索定时器
@@ -392,9 +404,39 @@ export default {
       this.$util.pageTo({url: "/admin/custom/set"})
     },
     showAllShop () {
-      this.$refs.shopSelectComponent.dropdownShow = true;
+      const comp = this.$refs.shopSelectComponent;
+      if (!comp) {
+        return;
+      }
+      comp.dropdownShow = true;
+      this.watchShopSelectOpen();
+    },
+    watchShopSelectOpen () {
+      this.clearShopSelectWatch();
+      const comp = this.$refs.shopSelectComponent;
+      if (!comp) {
+        return;
+      }
+      this.shopSelectOpen = comp.dropdownShow;
+      this._shopSelectWatch = this.$watch(
+        () => comp.dropdownShow,
+        (val) => {
+          this.shopSelectOpen = val;
+          if (!val) {
+            this.clearShopSelectWatch();
+          }
+        }
+      );
+    },
+    clearShopSelectWatch () {
+      if (this._shopSelectWatch) {
+        this._shopSelectWatch();
+        this._shopSelectWatch = null;
+      }
+      this.shopSelectOpen = false;
     },
     selectShopFn(val){
+      this.clearShopSelectWatch();
       let fromShopId = val.id
       uni.showLoading({mask:true})
       copyCumtomer({fromShopId}).then(res => {
@@ -785,4 +827,19 @@ export default {
   color: #fff;
   background: #3385ff;
 }
+.shop-select-wrap {
+  .pull-custom-tip {
+    position: fixed;
+    left: 30upx;
+    right: 30upx;
+    top: 48upx;
+    z-index: 30;
+    padding-bottom: 20upx;
+    font-size: 28upx;
+    line-height: 40upx;
+    color: #0f0f0f;
+    font-weight: bold;
+    background: #ffffff;
+  }
+}
 </style>

+ 10 - 1
ghsApp/src/admin/home/order.vue

@@ -22,7 +22,7 @@
 
     <view class="input-wrap_box">
       <view class="select-dn_bx">
-        <DateSelect class="bar" top="0" @selectDateFn="selectDateFn" defaultShowName="时间" />
+        <DateSelect ref="dateSelectRef" class="bar" top="0" @selectDateFn="selectDateFn" defaultShowName="时间" />
       </view>
       <view class="search-container">
         <AppSearchModule ref="appSearch" placeholder="这里搜索" @input="searchFn" />
@@ -481,10 +481,19 @@ export default {
       this.filterBook = -1;
       this.filterShopAdminId = 0;
       this.filterSendType = -1;
+      this.searchTime = '';
+      this.startTime = '';
+      this.endTime = '';
+      this.resetDateSelect();
       this.closeFilterPanel();
       this.resetList();
       this.getOrderList();
     },
+    resetDateSelect() {
+      if (this.$refs.dateSelectRef && this.$refs.dateSelectRef.reset) {
+        this.$refs.dateSelectRef.reset();
+      }
+    },
     confirmFilters() {
       this.closeFilterPanel();
       this.resetList();

+ 9 - 0
ghsApp/src/components/module/dateSelect.vue

@@ -201,6 +201,15 @@ export default {
             this.dropdownShow = false;
             this.defaultDateName = val.name;
             this.$emit('selectDateFn',{searchTime:val.value})
+        },
+        reset() {
+            this.dropdownShow = false;
+            this.showPicker = false;
+            this.startDate = '';
+            this.endDate = '';
+            this.showMonth = null;
+            this.defaultDateName = this.defaultShowName;
+            this.selectItem = '';
         }
     }
 }