group.vue 6.69 KB
<template>
  <div class="scrm-sub-client-container">
    <div class="head-container">
      <div class="head-container-title color-3 font-20"> {{describeData[id-1].name}}</div>
      <div class="head-container-content color-6 font-14">{{ describeData[id-1].info }}</div>
      <!-- <div class="reminder font-14 color-3">企业标签 | 自动更新</div> -->
      <div class="back color-58 font-14" @click="goBack">返回人群管理</div>
    </div>
    <div class="main-container">
      <div class="main-container-head flex-between">
        <div class="main-container-head-title color-3 font-20">
          全部客户
          <span class="main-container-head-number font-14">{{ totalCount }}个</span>
        </div>
        <div class="export font-14 color-6" @click="handleExport()">导出</div>
      </div>
      <GLTable ref="groupRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :noDataImg="url" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
        <span slot="customerName" class="flex-center" slot-scope="scope">
          <el-tooltip effect="dark" :content="scope.scope.customerName" placement="top">
            <span class="ellipsis-1" style="display: inline-block; max-width: 70px; text-align: left">{{ scope.scope.customerName }}</span>
          </el-tooltip>

          <span :class="[scope.scope.type == 1 ? 'pure-blue-text' : '', scope.scope.type == 2 ? 'pure-yello-text' : '']">{{ scope.scope.type == 1 ? '@微信' : scope.scope.type == 2 ? '@企微' : '' }}</span>
        </span>
      </GLTable>
    </div>
  </div>
</template>

<script>
import { getCustomerList, customerClusterListExport } from '@/api/modules/clientDataOverview'
import url from '@/assets/empty.png'
export default {
  name: 'group',
  data() {
    return {
      getListApi: getCustomerList,
      pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
      tableSearchForm: {},
      id: this.$route.params.id ? this.$route.params.id : '',
      totalCount: '',
      tableParams: {
        listName: 'data',
        tableOption: false,
        tableColumns: [
          {
            label: '客户名称',
            prop: 'customerName',
            addHtml: 'customerName',
            minWidth: '120'
          },
          {
            label: '手机号',
            prop: 'customerPhone',
            minWidth: '110'
          },
          {
            label: '车牌号',
            prop: 'carNumber'
          },
          {
            label: '车架号(后6位)',
            prop: 'carVin',
            minWidth: '110'
          },
          {
            label: '车系',
            prop: 'audi',
            line: 2
          },
          {
            label: '跟进员工',
            prop: 'followStaff',
            // addHtml: 'followStaff',
            minWidth: 140
          },
          {
            label: '是否加企微', //1. 加入,0.未加入
            prop: 'isJoinName'
          },
          {
            label: '添加时间',
            prop: 'addTime'
          }
        ]
      },
      url: url,
      describeData: [
        {
          name: '潜在意向客户',
          info: '无购车且无其他交易行为的所有客户'
        },
        {
          name: '潜在意向客户(已加企微客户)',
          info: '在潜在意向客户中,已加企微的客户'
        },
        {
          name: '潜在意向客户(未加企微客户)',
          info: '在潜在意向客户中,未加企微的客户'
        },
        {
          name: '基盘客户',
          info: '有购车或其他交易行为的所有客户'
        },
        {
          name: '基盘客户(已加企微客户)',
          info: '在基盘客户中,已加企微的客户'
        },
        {
          name: '基盘客户(未加企微客户)',
          info: '在基盘客户中,未加企微的客户'
        },
        {
          name: '新车客户',
          info: '购车时间3个月的客户'
        },
        {
          name: '车险待续保客户',
          info: '近一个月内车险即将到期的客户'
        },
        {
          name: '新车待首保客户',
          info: '购车时间5~7个月内,且无保养记录的客户'
        },
        {
          name: '沉默客户',
          info: '超过180天未到店的客户'
        }
      ]
    }
  },
  created() {
    let { id } = this
    this.init(id)
  },
  methods: {
    init(id) {
      this.tableSearchForm = {
        crowdId: id
      }
      // this.getTotalCount()
    },
    //导出
    handleExport() {
      var params = {
        crowdId: this.id,
        pageSize: 10,
        pageNum: 1
      }
      customerClusterListExport(params).then(res => {
        this.$Utils.exportFn(res)
      })
    },
    setTableFinishFun() {
      this.totalCount = this.$refs.groupRef.total
      this.$refs.groupRef.data.length ? (this.$refs.groupRef.tableHeightValues = '') : this.$refs.groupRef.setTableHeightFun()
    },
    goBack() {
      this.$router.replace({ path: '/clientDataOverview/index' })
    }
  }
}
</script> 

<style lang="scss" scoped>
@import '@/styles/variables.scss';
.scrm-sub-client-container {
  .head-container {
    position: relative;
    margin-bottom: 10px;
    width: 100%;
    height: 112px;
    background: #ffffff;
    box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
    padding: 20px;
    box-sizing: border-box;
    &-title {
      font-weight: 500;
      line-height: 20px;
      letter-spacing: 1px;
      margin-bottom: 10px;
    }
    &-content {
      font-weight: 400;
      line-height: 20px;
      width: calc(100% - 156px);
    }
    .back {
      font-weight: 400;
      line-height: 22px;
      padding: 5px 16px;
      border-radius: 4px;
      border: 1px solid $btnBlue;
      position: absolute;
      right: 20px;
      top: 20px;
      color: $btnBlue;
      cursor: pointer;
    }
  }
  .main-container {
    width: 100%;
    height: 100%;
    background: #ffffff;
    box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
    padding: 20px;
    box-sizing: border-box;
    .main-container-head {
      margin-bottom: 20px;
      &-title {
        font-weight: 500;
        line-height: 20px;
        letter-spacing: 1px;
      }
      &-number {
        color: $btnBlue;
        margin-left: 6px;
        font-weight: 400;
        line-height: 20px;
      }
      .export {
        font-weight: 400;
        padding: 6px 23px;
        line-height: 20px;
        background: #ffffff;
        border-radius: 4px;
        border: 1px solid rgba(105, 105, 105, 0.3);
        cursor: pointer;
      }
    }
  }
  .pure-blue-text {
    color: #61cc43;
  }
  .pure-yello-text {
    color: #fb8f28;
  }
}
</style>