customDetail.vue 4.74 KB
<template>
  <div class="form-panel scrm-box-f">
    <div class="form-header"><el-button type="primary" size="small" @click="goback">返回</el-button></div>
    <el-form :inline="true" :model="tableSearchForm" class="follow-form-item">
      <el-form-item size="small" label="客户名称">
        <el-input size="small" v-model="tableSearchForm.phone" placeholder="请输入客户名称"></el-input>
      </el-form-item>
      <el-form-item size="small" label="电话号码">
        <el-input size="small" v-model="tableSearchForm.phone" placeholder="请输入电话号码"></el-input>
      </el-form-item>
      <el-form-item size="small" label="是否添加企微">
        <el-select v-model="tableSearchForm.status" placeholder="请选择">
          <el-option v-for="item in optionstatus" :key="item.value" :label="item.label" :value="item.value"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item size="small" label="首次添加企微">
        <el-date-picker :picker-options="pickerOptions" v-model="createTime" type="daterange" value-format="yyyy-MM-dd" start-placeholder="开始时间" end-placeholder="结束时间"></el-date-picker>
      </el-form-item>
      <el-form-item size="small" style="float: right; margin-right: 0px">
        <el-button @click="handleReset">重置</el-button>
        <el-button type="primary" @click="handleSearch">导出</el-button>
        <el-button type="primary" @click="handleSearch">查询</el-button>
      </el-form-item>
    </el-form>
    <GLTable ref="employeeRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
      <div class="table-btns" slot="optionBtns" slot-scope="scope">
        <el-button type="text" @click="handleDetail(scope.scope)">客户详情</el-button>
      </div>
    </GLTable>
  </div>
</template>

<script>
export default {
  name: 'customDetail',
  data() {
    return {
      pickerOptions: {
        disabledDate: time => {
          return time.getTime() > Date.now()
        }
      },
      createTime: '',
      totalCount: 0,
      percentage: 0,
      optionstatus: [
        {
          value: '',
          label: '全部'
        },
        {
          value: '0',
          label: '是'
        },
        {
          value: '1',
          label: '否'
        }
      ],
      tableSearchForm: {},
      getListApi: this.$apis.overview.findAllMessageByPage,
      tableParams: {
        mutiSelectUniqueKey: 'id',
        mutiSelectName: 'emp',
        listName: 'data',
        tableOption: false,
        otherOptions: {
          label: '启用开关'
        },
        tableColumns: [
          {
            label: '客户名称',
            prop: 'phone'
          },
          {
            label: '手机号',
            prop: 'phone'
          },
          {
            label: '性别',
            prop: 'phone'
          },
          {
            label: '是否加企微',
            prop: 'statusName'
          },
          {
            label: '来源',
            prop: 'sendTime',
            align: 'left'
          },
          {
            label: '跟进员工',
            prop: 'phone'
          },
          {
            label: '首次添加企微',
            prop: 'sendTime'
          },
          {
            label: '操作',
            prop: 'optionBtns',
            width: '140px',
            addHtml: 'optionBtns',
            fixed: 'right'
          }
        ]
      },
      pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
      baseData: {
        allMerchantList: [],
        roleList: [],
        staffStatusList: []
      }
    }
  },
  watch: {
    createTime(value) {
      if (value) {
        this.tableSearchForm.startTime = value[0] + ' 00:00:00'
        this.tableSearchForm.endTime = value[1] + ' 23:59:59'
      } else {
        delete this.tableSearchForm.startTime
        delete this.tableSearchForm.endTime
      }
    }
  },
  methods: {
    findMessageStatic() {
      this.$apis.overview.findMessageStatic({}).then(res => {
        this.totalCount = res.totalCount
        this.percentage = res.percentage
      })
    },
    goback() {
      this.$router.go('-1')
    },
    handleReset() {
      this.tableSearchForm = {}
      this.handleSearch()
    },
    handleSearch() {
      this.$refs.employeeRef.refreshTable()
    },
    handleDetail(scope) {
      this.$alert(scope.content, { center: true })
    }
  },
  mounted() {
    this.findMessageStatic()
  }
}
</script> 

<style lang="scss" scoped>
.form-header {
  margin-bottom: 20px;
}
.form-panel {
  padding: 20px;
  .follow-form-item {
    /deep/ {
      .el-form-item {
        margin-right: 20px;
      }
      .el-input__inner {
        width: 215px;
      }
    }
  }
}
</style>