From cd384b5b498cefb6ec2a7645fe7da39397b07166 Mon Sep 17 00:00:00 2001
From: zhaoxiaoqiang <287285524@qq.com>
Date: Wed, 01 Sep 2021 16:00:22 +0800
Subject: [PATCH] storID

---
 src/views/mine/stores/storeOprs.vue |   93 +++++++++++++++-------------------------------
 1 files changed, 30 insertions(+), 63 deletions(-)

diff --git a/src/views/mine/stores/storeOprs.vue b/src/views/mine/stores/storeOprs.vue
index 54c58df..a78e593 100644
--- a/src/views/mine/stores/storeOprs.vue
+++ b/src/views/mine/stores/storeOprs.vue
@@ -5,40 +5,27 @@
 -->
 <template>
   <div class="stores-box h-100-g">
-
     <v-navbar title="店员管理" fixed></v-navbar>
-    <van-search class="search" placeholder="请输入门店名称/负责人姓名/负责人手机号" v-model="value" shape='round' @search="onSearch"/>
+    <van-search class="search" placeholder="负责人姓名/负责人手机号" v-model="value" shape='round' />
     <div class="item-box">
-      <van-list
-        v-model="loading"
-        :finished="finished"
-        immediate-check='false'
-        offset="50"
-        finished-text="没有更多了"
-        @load="onLoad"
-      >
-        <div class="stores-item flex-start-g" v-for="(item, index) in list" :key="index" @click="go(item.storeId)">
+        <div class="stores-item flex-start-g" v-for="(item, index) in calcList" :key="index" @click="go(item.id)">
           <p class="icon-box flex-center-g">
             <svg class="icon" aria-hidden="true" style="width:25px;height:25px;fill:#fff" >
               <use xlink:href="#iconyonghu"></use>
             </svg>
           </p>
           <div>
-            <p class="name" v-text="item.storeName || ''">店员名称</p>
-            <p class="c-text-666-g font-12-g" v-text="item.priMblNo || ''">13586695442</p>
+            <p class="name" v-text="item.name || ''">店员名称</p>
+            <p class="c-text-666-g font-12-g" v-text="item.mblNo || ''">13586695442</p>
           </div>
         </div>
-      </van-list>
     </div>
-
-    <van-button class="btn" @click="$router.push('/mine/stores-add')">
+    <van-button class="btn" @click="goAdd">
       <div class="inner">
         <van-icon name="plus"/>
         <span class="text">新增</span>
       </div>
     </van-button>
-
-
   </div>
 </template>
 
@@ -51,63 +38,43 @@
         list:[],
         loading:false,
         finished:false,
-        storeId:''
+        storeId:'',
+        queryStoreId:""
       }
     },
-
+    computed:{
+        // 根据搜索关键字获取 对应的数据
+        calcList(){
+            let v = this.value;
+            let arr = this.list.filter(item=>{
+                return item.name.indexOf(v) > -1 || item.mblNo.indexOf(v) > -1;
+            })
+            if(arr){
+                return arr
+            }
+            return this.list;
+        }
+    },
     created(){
+      this.queryStoreId =this.$route.query.storeId;
       this.init();
     },
     methods: {
       init(){
-        this.loading = true
-        this.$api.storeStoreList({
-          searchKey:this.value,
-          storeId:this.storeId,
+        this.loading =true;
+        this.$api.storeStorePersonList({
+          orgId:this.queryStoreId,
         }).then((res) => {
-          if(res.body.storeList.length < 10){
-            this.list = [...this.list,...res.body.storeList]
-            this.storeId = ''
-            this.finished = true
-            this.loading = false
-          }else{
-            this.list = [...this.list,...res.body.storeList]
-            this.storeId = this.list[this.list.length-1].storeId
-            this.finished = false
-            this.loading = false
-          }
+           this.loading =false;
+           this.list = res.body ||[];
         })
       },
-
-
       go(id) {
-        this.$router.push({path:'/mine/stores-detail',query:{storeId:id}});
+        this.$router.push({path:'/mine/storeOprs-detail',query:{mgrId:id,storeId:this.queryStoreId}});
       },
-
-      onLoad(){
-        this.init()
-      },
-      onSearch(val){
-        this.list = []
-        this.loading = true
-        this.$api.storeStoreList({
-          searchKey:this.value,
-        }).then(res=>{
-          if(res.body.storeList.length < 10){
-            this.list = [...this.list,...res.body.storeList]
-            this.storeId = ''
-            this.finished = true
-            this.loading = false
-          }else{
-            this.list = [...this.list,...res.body.storeList]
-            this.storeId = this.list[this.list.length-1].storeId
-            this.finished = false
-            this.loading = false
-          }
-        })
+      goAdd(){
+        this.$router.push({path:'/mine/storeOprs-add',query:{storeId:this.queryStoreId}})
       }
-
-
     }
   }
 </script>
@@ -117,7 +84,7 @@
 
     background-color: @c-bg-f5;
     padding-top: 44px;
-
+    box-sizing: border-box;
     .btn {
       position: fixed;
       width: 50px;

--
Gitblit v1.8.0