index.vue 10.3 KB
<template>
  <div>
    <div class="scrm-sub-client-container">
      <div class="pageContent">
        <GLCombiForm :rowNumber="1" :formObj="searchForm" :formData="leadManageFormList" @handleOk="searchTable" @handleRest="resetTable"></GLCombiForm>
        <!-- 线索分配 -->
        <div class="leadList">
          <div>
            <span>线索列表</span>
            <span @click="handleToggle()">功能介绍</span>
          </div>
          <GLButton fn="线索分配" size="small" @click="goAllocation">线索分配</GLButton>
        </div>
        <GLTable v-loading="loading" :hasNum="true" @setTableHeightEvent="setTableHeightEvent" @setTableFinishFun="setTableFinishFun" ref="leadManage" :getListApi="getListApi" :searchForm="searchForm" :pageConf="pageConf" :noDataImg="url" :tableParams="tableParams">
          <!-- 线索类型 -->
          <template slot="type" slot-scope="scope">
            <span>{{ switchStaff(scope.scope.type) }}</span>
          </template>
          <!-- 线索状态 -->
          <template slot="status" slot-scope="scope">
            <span :class="{ circleStatusYellow: scope.scope.status == 0, circleStatusPurple: scope.scope.status == 1, circleStatusGreen: scope.scope.status == 2 }"></span>
            <span>{{ scope.scope.status == 0 ? '待跟进' : scope.scope.status == 1 ? '跟进中' : scope.scope.status == 2 ? '已完成' : '' }}</span>
          </template>
          <!-- 跟进员工 -->
          <template slot="userName" slot-scope="scope">
            <el-tag type="info" :disable-transitions="false" v-if="scope.scope.userName">
              <!-- <i class="el-icon-user-solid"></i> -->
              <img class="headPortrait" src="@/assets/headPortrait.png" />
              {{ scope.scope.userName }}
            </el-tag>
          </template>
          <template slot="options" slot-scope="scope">
            <GLButton class="blue-text" type="text" fn="线索详情" @click="goBasicInfo(scope.scope)">查看</GLButton>
          </template>
        </GLTable>
      </div>
    </div>
    <!-- 功能介绍 -->
    <GLDialog mode="big" :bigTitle="true" :visible.sync="showFuncIntro" :hasFooter="true">
      <span slot="custombigtitle">功能介绍</span>
      <div class="dialogEncircle ">
        <span class="funcText">线索管理模块可查看客户在小程序端留存的售前售后线索,通过配置跟进员工,使线索展示在员工企微任务栏并推送消息提醒,员工跟进线索并输入跟进记录后完成线索跟进</span>
        <div class="funcIro">
          <div>
            <div>
              <img src="@/assets/leadManage/newInquiry.png" alt="" />
            </div>
            <p>客户在小程序留存售前售后线索</p>
          </div>
          <div>
            <div>
              <img src="@/assets/leadManage/group.png" alt="" />
            </div>
            <p>SCRM后台配置线索跟进员工</p>
          </div>
          <div>
            <div>
              <img src="@/assets/leadManage/myTodo.png" alt="" />
            </div>
            <p>线索展示在员工企微任务栏并推送消息提醒</p>
          </div>
          <div>
            <div>
              <img src="@/assets/leadManage/addRecord.png" alt="" />
            </div>
            <p>员工跟进线索并输入跟进记录</p>
          </div>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" size="small" @click="showFuncIntro = false">关闭</el-button>
      </span>
    </GLDialog>
  </div>
</template>

<script>
import { getTableList } from '@/api/modules/leadManage'
import url from '@/assets/clientDataOverview/nodata.png'
export default {
  name: 'leadManage',
  data() {
    return {
      loading: false,
      url: url,
      searchForm: {
        status: '',
        type: ''
      },
      leadManageFormList: [
        {
          type: 'input',
          inputType: 'text',
          name: 'keyword',
          label: '关键字',
          placeholder: '请输入客户名称/手机号'
        },
        {
          type: 'select',
          name: 'status',
          label: '线索状态',
          optionLabel: 'label',
          optionId: 'value',
          optionList: [
            {
              label: '全部',
              value: ''
            },
            {
              label: '待跟进',
              value: 0
            },
            {
              label: '跟进中',
              value: 1
            },
            {
              label: '已完成',
              value: 2
            }
          ],
          placeholder: '请选择'
        },
        {
          type: 'input',
          inputType: 'text',
          name: 'userName',
          label: '跟进人',
          placeholder: '请输入跟进人名称'
        },
        {
          type: 'select',
          name: 'type',
          label: '线索类型',
          optionLabel: 'label',
          optionId: 'value',
          optionList: [
            {
              label: '全部',
              value: ''
            },
            // {
            //   label: '客户意见',
            //   value: 1
            // },
            // {
            //   label: '卖车询价',
            //   value: 2
            // },
            {
              label: '救援服务',
              value: 3
            },
            {
              label: '新车询价',
              value: 4
            },
            {
              label: '试驾预约',
              value: 5
            },
            {
              label: '维保预约',
              value: 6
            }
          ],
          placeholder: '请选择'
        }
      ],
      getListApi: getTableList,
      pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
      tableParams: {
        listName: 'list',
        tableColumns: [
          {
            label: '单号',
            prop: 'orderNo',
            minWidth: 180
          },
          {
            label: '客户名称',
            prop: 'name',
            minWidth: 150
          },
          {
            label: '手机号',
            prop: 'phone',
            minWidth: 150
          },
          {
            label: '线索类型',
            prop: 'type',
            addHtml: 'type',
            minWidth: 120
          },
          {
            label: '线索状态',
            prop: 'status',
            addHtml: 'status',
            minWidth: 120
          },
          {
            label: '跟进人',
            prop: 'userName',
            addHtml: 'userName',
            minWidth: 140
          },
          {
            label: '创建时间',
            prop: 'createdDate',
            minWidth: 180
          },
          {
            label: '操作',
            prop: 'options',
            fixed: 'right',
            addHtml: 'options',
            width: 70
          }
        ]
      },
      showFuncIntro: true //功能介绍的显示与隐藏
    }
  },
  created() {
    if (window.__POWERED_BY_QIANKUN__) {
      //运行在qiankun容器中
      this.merchantModel = this.$globalState.session.merchantModel
      this.accountLevel = this.$globalState.session.accountLevel
    }
    // 页面首次加载添加缓存
    if (sessionStorage.getItem('isReload')) {
      this.showFuncIntro = false
    } else {
      sessionStorage.setItem('isReload', true)
    }
  },
  mounted() {
    //没数据的时候要算高度
    setTimeout(() => {
      if (!this.$refs.leadManage.data.length) {
        this.loading = true
        this.$refs.leadManage.setTableHeightFun()
        this.loading = false
      }
    }, 200)
  },
  methods: {
    setTableFinishFun() {
      this.$refs.leadManage.data.length ? (this.$refs.leadManage.tableHeightValues = '') : this.$refs.leadManage.setTableHeightFun()
    },
    setTableHeightEvent() {
      this.$refs.leadManage.setTableHeightFun()
    },
    goAllocation() {
      this.$router.push('./leadAllocation')
    },
    goBasicInfo(row) {
      let id = row.id
      let type = row.type
      this.$router.push({
        path: `/leadManage/leadBasicInfo/${id}/${type}`
      })
    },
    handleToggle() {
      this.showFuncIntro = !this.showFuncIntro
    },
    // 搜索表格
    searchTable() {
      
      this.$refs.leadManage.refreshTable()
    },
    //重置表格
    resetTable() {
      this.searchForm = {
        status: '',
        type: ''
      }
      this.$refs.leadManage.refreshTable()
    },
    // 跟进转换
    switchStaff(num) {
      switch (num) {
        case '3':
          return '救援服务'
        case '4':
          return '新车询价'
        case '5':
          return '试驾预约'
        case '6':
          return '维保预约'
        default:
          break
      }
    }
  }
}
</script>

<style lang="scss" scoped>
.scrm-sub-client-container {
  /deep/ .el-table .cell {
    text-overflow: clip;
  }
  /deep/ .el-table .cell,
  .el-table th div {
    text-overflow: clip;
  }
  .pageContent {
    padding: 20px 20px 30px;
    
    // min-width: 1300px;
    background-color: #fff;
    /deep/ .el-icon-user-solid {
      color: #75acff;
      // margin-right: 3px;
      font-size: 14px;
    }
    .leadList {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 8px;
      div {
        text-align: center;
        span:nth-child(1) {
          font-weight: 600;
          font-size: 16px;
        }
        span:nth-child(2) {
          font-size: 14px;
          margin-left: 8px;
          color: #5850ff;
          border-bottom: 1px solid #5850ff;
          cursor: pointer;
        }
      }
      /deep/ .el-button {
        color: #5850ff;
        border: 1px solid #5850ff;
      }
    }
    /deep/ .el-tag {
      height: 26px;
      line-height: 26px;
      padding: 0 8px;
    }
  }
  .blue-text {
    color: #5850ff;
  }
}
.dialogEncircle {
  // width: 100%;
  .funcText {
    line-height: 20px;
    color: #333;
    font-weight: 600;
    font-size: 14px;
  }
  .funcIro {
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
    > div {
      width: 23%;
      div {
        height: calc(100% - 65px);
        display: flex;
        align-items: center;
        img {
          width: 100%;
        }
      }
      p {
        margin-left: 5px;
        margin-top: 22px;
        color: #333;
        line-height: 20px;
        font-size: 14px;
      }
    }
  }
}
</style>