From fb9591ea38b263afe9d051168e34aa03028494eb Mon Sep 17 00:00:00 2001
From: zhaoxiaoqiang
Date: Tue, 18 May 2021 10:03:06 +0800
Subject: [PATCH] 商户添加店员

---
 src/views/mine/stores/stores.vue |   39 +++++++++++++++++++++++++++++++++------
 1 files changed, 33 insertions(+), 6 deletions(-)

diff --git a/src/views/mine/stores/stores.vue b/src/views/mine/stores/stores.vue
index 66fb061..4d12a22 100644
--- a/src/views/mine/stores/stores.vue
+++ b/src/views/mine/stores/stores.vue
@@ -5,7 +5,6 @@
 -->
 <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"/>
     <div class="item-box">
@@ -27,11 +26,12 @@
             <p class="name" v-text="item.storeName || ''">门店名称</p>
             <p class="c-text-666-g font-12-g" v-text="item.priMblNo || ''">13586695442</p>
           </div>
+          <van-button :style="{background:$store.state.backColor}" class="opr-btn" @click.stop="goStoreOprs(item.storeId)" v-if="orgType != 2">店员管理</van-button>
         </div>
       </van-list>
     </div>
 
-    <van-button class="btn" @click="$router.push('/mine/stores-add')">
+    <van-button class="btn" @click="$router.push(`/mine/stores-add?merId=${merId}`)">
       <div class="inner">
         <van-icon name="plus"/>
         <span class="text">新增</span>
@@ -43,6 +43,7 @@
 </template>
 
 <script>
+import { mapState } from 'vuex';
   export default {
     name: "stores",
     data() {
@@ -51,19 +52,25 @@
         list:[],
         loading:false,
         finished:false,
-        storeId:''
+        storeId:'',
+        merId:'',
       }
     },
-    
+    computed:{
+      ...mapState(['userinfo'])
+    },
     created(){
+      this.merId = this.$route.query.merId?this.$route.query.merId:this.userinfo.orgId;
       this.init();
     },
     methods: {
       init(){
+        console.log("merId:"+this.merId);
         this.loading = true
         this.$api.storeStoreList({
           searchKey:this.value,
           storeId:this.storeId,
+          merId:this.merId,
         }).then((res) => {
           if(res.body.storeList.length < 10){
             this.list = [...this.list,...res.body.storeList]
@@ -78,8 +85,14 @@
           }
         })
       },
-
-
+      goStoreOprs(storeId){
+          this.$router.push({
+              path:'/mine/storesOprs',
+              query:{
+                  storeId:storeId
+              }
+          })
+      },
       go(id) {
         this.$router.push({path:'/mine/stores-detail',query:{storeId:id}});
       },
@@ -92,6 +105,7 @@
         this.loading = true
         this.$api.storeStoreList({
           searchKey:this.value,
+          merId:this.merId,
         }).then(res=>{
           if(res.body.storeList.length < 10){
             this.list = [...this.list,...res.body.storeList]
@@ -172,6 +186,19 @@
       .name {
         margin-bottom: 5px;
         font-weight: bold;
+        width:200px;
+        overflow: hidden;
+        white-space: nowrap;
+        text-overflow: ellipsis;
+      }
+
+      .opr-btn {
+        .lh(25px);
+        margin-right: 0px;
+        padding: 0 12px;
+        background: @c-bg-default;
+        border-radius: 13px;
+        color: @c-text-fff;
       }
     }
 

--
Gitblit v1.8.0