clientGroupDetail.vue 10.1 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" :style="{ height: heightBox + 'px' }">
        <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" :style="{ 'min-height': heightBox + 'px' }">
        <div class="rightWrapBtn" style="display: flex">
          <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>({{ item.personNum || 0 }})个</template>
              </span>
            </div>
            <el-button style="border: 1px solid #5850ff; color: #5850ff; right: 0px; position: absolute;background:none;" size="small" @click="handleExport(currentIndex)">导出</el-button>
          </div>
        </div>

        <template v-if="currentIndex == 0">
          <client ref="childCompClient" :url="url" @goDetail="goDetail"></client>
        </template>
        <template v-if="currentIndex == 1">
          <follow-employee ref="childCompFollow" :url="url"></follow-employee>
        </template>
        <template v-if="currentIndex == 2">
          <leave-group-client ref="childCompLeave" :url="url" @goDetail="goDetail"></leave-group-client>
        </template>
        <template v-if="currentIndex == 3">
          <potential-client ref="childCompPotential" :url="url"></potential-client>
        </template>
        <GLDialog mode="small" :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 potentialClient from '@/views/clientGroupManage/components/potentialClient.vue'
import url from '@/assets/clientDataOverview/nodata.png'
export default {
  name: 'clientGroupDetail',
  components: {
    client,
    followEmployee,
    leaveGroupClient,
    potentialClient
  },
  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()
    let clientHeight = document.documentElement.clientHeight
    this.heightBox = clientHeight - 175
  },

  // 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)
    //   }
    // },
    handleExport(currentIndex) {
      if (currentIndex == 0) {
        this.$refs.childCompClient.handleExport()
      } else if (currentIndex == 1) {
        this.$refs.childCompFollow.handleExport()
      } else if (currentIndex == 2) {
        this.$refs.childCompLeave.handleExport()
      } else {
        this.$refs.childCompPotential.handleExport()
      }
    },
    tabClick(index) {
      this.currentIndex = index
    },
    async getTableDetail(id = this.$route.query.id) {
      const res = await getTableDetail({ id: id, pageNum: 1, pageSize: 10 })
      
      if (!res) {
        return false
      }
      this.leftPanelList = res
      this.$set(this.titles[0], 'personNum', res.allCount)
      this.$set(this.titles[1], 'personNum', res.staffCount)
      this.$set(this.titles[2], 'personNum', res.quitCount)
      this.$set(this.titles[3], 'personNum', res.potentialCount)
    },

    goBack() {
      this.$router.push({ path: '/clientGroupManage/index' })
    },
    handleClose() {
      this.dialogVisible = !this.dialogVisible
    },
    handleConfirm() {
      this.handleClose()
    },
    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: 370px; //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: 120px;
        }
      }
    }
    .rightWrap {
      position: relative;
      margin-left: 20px;
      width: calc(100% - 260px);
      box-sizing: border-box;
      background-color: #fff;
      padding: 20px;
      padding-top: 50px;
      .rightWrapBtn {
        display: flex;
        .choseRow {
          position: absolute;
          width: 100%;
          left: 0;
          top: 0;
          display: flex;
          background-color: $bgColor;
          z-index: 10;
          .choseItem {
            height: 40px;
            line-height: 40px;
            width: 180px;
            box-sizing: border-box;
            background: #ffffff;
            text-align: center;
            border: 1px solid #eeedff;
            cursor: pointer;
            &:first-child {
              border-left: 0;
            }
            span {
              font-weight: 400;
              font-size: 14px;
              color: #37383a;
            }
          }
          .activeItem {
            border-radius: 4px 4px 0 0;
            span {
              color: $btnBlue;
              font-weight: 600;
            }
            box-sizing: border-box;
            border-bottom: 0 !important;
          }
        }
      }

      .el-button + .el-button {
        margin-left: 20px;
      }
      .glsx-table {
        margin-top: 20px;
      }
    }
  }
    .content-body {
      font-size: 18px;
      text-align: center;
      font-weight: 400;
      color: #333333;
      .bottomText {
        margin-top: 10px;
      }
    }
}
</style>