clientGroupDetailNext.vue 8.76 KB
<template>
  <div class="scrm-sub-client-container">
    <div class="header">
      <div class="vehicleGroupName">
        <span>{{ groupName }}</span>
      </div>
      <button class="backBtn" @click="goBack">返回客户群管理</button>
    </div>
    <div class="content">
      <div class="leftWrap">
        <div class="avator">
          <img src="@/assets/clientDetail/defaultAvator.png" alt="" />
        </div>
        <p>
          <span>群主</span>
          <span class="ellipsis-1">{{ leftPanelList.groupHostName }}</span>
        </p>
        <p>
          <span>群主手机</span>
          <span class="ellipsis-1">{{ leftPanelList.groupHostPhone }}</span>
        </p>
        <p>
          <span>群主邮箱</span>
          <el-tooltip class="item" :content="leftPanelList.groupHostEmail" placement="top">
            <span class="ellipsis-1">{{ leftPanelList.groupHostEmail }}</span>
          </el-tooltip>
        </p>
        <!-- <p>
          <span>群主部门</span>
          <span class="ellipsis-1">{{ leftPanelList.groupHostDepart }}</span>
        </p> -->
        <p>
          <span>群管理员</span>
          <el-tooltip class="item" :content="leftPanelList.groupAdmin" placement="top">
            <span class="ellipsis-1">{{ leftPanelList.groupAdmin }}</span>
          </el-tooltip>
        </p>
        <p>
          <span>创建时间</span>
          <el-tooltip class="item" :content="leftPanelList.createDate" placement="top">
            <span class="ellipsis-1">{{ leftPanelList.createDate }}</span>
          </el-tooltip>
        </p>
      </div>
      <div class="rightWrap">
        <div class="choseRow">
          <div class="choseItem" :class="{ activeItem: currentIndex == index }" v-for="(item, index) in titles" :key="index" @click="tabClick(index)">
            <span>
              {{ item.name }}
              <template v-if="currentIndex == index">({{ item.personNum || 0 }})个</template>
            </span>
          </div>
        </div>
        <template v-if="currentIndex == 0">
          <client ref="childComp" :url="url" @goDetail="goDetail" @getTotal="getTotal"></client>
        </template>
        <template v-if="currentIndex == 1">
          <follow-employee ref="childComp" :url="url" @getTotal="getTotal"></follow-employee>
        </template>
        <template v-if="currentIndex == 2">
          <leave-group-client ref="childComp" :url="url" @goDetail="goDetail"></leave-group-client>
        </template>
        <template v-if="currentIndex == 3"></template>

        <GLDialog title="" :visible.sync="dialogVisible">
          <div class="content-body">
            <p>该客户暂无员工跟进,无法查看该客户详情,</p>
            <p class="bottomText">赶紧去加好友吧!</p>
          </div>
          <span slot="footer" class="dialog-footer">
            <el-button type="primary" size="small" @click="dialogVisible = false">我知道了</el-button>
          </span>
        </GLDialog>
      </div>
    </div>
  </div>
</template>

<script>
import { getTableDetail, getClientTableDetail } from '@/api/modules/clientGroupManage'
import client from '@/views/clientGroupManage/components/client.vue'
import followEmployee from '@/views/clientGroupManage/components/followEmployee.vue'
import leaveGroupClient from '@/views/clientGroupManage/components/leaveGroupClient.vue'
import url from '@/assets/clientDataOverview/nodata.png'
export default {
  name: 'clientGroupDetail',
  components: {
    client,
    followEmployee,
    leaveGroupClient
  },
  data() {
    return {
      dialogVisible: false,
      // ['全部客户', '跟进员工', '退群客户', '潜在客户']
      titles: [
        {
          name: '全部客户',
          personNum: 0
        },
        {
          name: '跟进员工',
          personNum: 0
        },
        {
          name: '退群客户',
          personNum: 0
        },
        {
          name: '潜在客户',
          personNum: 0
        }
      ],
      currentIndex: 0,
      groupName: this.$route.query.groupName,
      url: url,
      leftPanelList: {},

      flushTime: false
    }
  },
  created() {
    this.getTableDetail()
  },

  // watch: {
  //   'searchForm.daterange':{
  //     deep: true,
  //     // immediate:true,
  //     handler(val) {
  //       
  //       if(val){
  //           
  //         this.searchTable()
  //       }
  //     }
  //   }
  // },

  methods: {
    getTotal(num) {
      if (this.currentIndex == 0) {
        this.$set(this.titles[0], 'personNum', num)
      }
    },
    tabClick(index) {
      this.currentIndex = index
    },
    async getTableDetail(id = this.$route.query.id) {
      const res = await getTableDetail({ id: id })
      
      if (!res) {
        return false
      }
      this.leftPanelList = res
    },

    goBack() {
      this.$router.push({ path: '/clientGroupManage/index' })
    },

    goDetail(id) {
      //  接口通过了跳转
      getClientTableDetail({ oneId: id }).then(res => {
        if (res.code == '0') {
          if (!res.data) {
            this.dialogVisible = true
            return false
          }
          this.$router.push({
            path: '/clientManage/clientDetail',
            query: {
              id: id
            }
          })
        } else {
          this.$message({
            type: 'error',
            message: res.message
          })
        }
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.scrm-sub-client-container {
  @import '@/styles/variables.scss';
  @import '@/styles/resetelement.scss';
  .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
    background: #ffffff;
    box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
    .vehicleGroupName {
      margin-left: 26px;
      height: 20px;
      font-size: 20px;
      font-weight: 600;
      color: #333333;
      line-height: 20px;
      letter-spacing: 1px;
    }
    .backBtn {
      margin-right: 20px;
      height: 32px;
      font-size: 14px;
      background: $btnBlue;
      color: #fff;
      border-radius: 4px;
      padding: 0 20px;
      border: none;
      &:hover {
        background-color: $lightBtnBlue;
      }
    }
  }
  .content {
    display: flex;
    width: 100%;
    margin-top: 20px;
    .leftWrap {
      width: 240px;
      // height: 877px;
      min-height: 270px; //calc(100vh - 92px);
      background-color: #fff;
      box-sizing: border-box;
      .avator {
        margin: 0 auto;
        margin-top: 40px;
        width: 60px;
        height: 60px;
        text-align: center;
        line-height: 60px;
        img {
          border-radius: 50%;
          width: 100%;
          height: 100%;
        }
      }
      p {
        padding-left: 20px;
        position: relative;
        margin-top: 20px;
        span:first-child {
          display: inline-block;
          height: 20px;
          font-size: 14px;
          font-weight: 600;
          color: #333333;
          line-height: 20px;
        }
        span:nth-child(2) {
          position: absolute;
          left: 100px;
          display: inline-block;
          height: 20px;
          font-size: 14px;
          font-weight: 400;
          color: #666666;
          line-height: 20px;
          max-width: 131px;
        }
      }
    }
    .rightWrap {
      position: relative;
      margin-left: 20px;
      width: calc(100% - 260px);
      box-sizing: border-box;
      background-color: #fff;
      padding: 20px;
      padding-top: 50px;
      .choseRow {
        position: absolute;
        width: 100%;
        left: 0;
        top: 0;
        display: flex;
        background-color: $bgColor;
        z-index: 10;

        padding: 2px 0 0 0;
        .choseItem {
          height: 40px;
          line-height: 40px;
          width: 180px;
          // background: #FFFFFF;
          text-align: center;
          border: 1px solid #eeedff;
          border-bottom: 0;
          &:first-child {
            border-left: 0;
          }
          span {
            font-weight: 400;
            font-size: 14px;
            color: #37383a;
          }
        }
        .activeItem {
          border-radius: 4px 4px 0 0;
          background-color: #fff;
          span {
            color: $btnBlue;
            font-weight: 600;
          }
        }
      }

      .el-button + .el-button {
        margin-left: 20px;
      }
      // .el-button {
      //   font-size: 14px;
      //   font-weight: 400;
      //   padding: 9px 21px;
      //   background: $btnBlue;
      //   border-radius: 4px;
      //   border: none;
      // }
      // .el-button:first-child {
      //   background: #ffffff;
      //   border-radius: 4px;
      //   border: 1px solid #999999;
      //   font-weight: 400;
      //   color: #666666;
      // }
      .glsx-table {
        margin-top: 20px;
      }
    }
  }
}
</style>