<style>
.myCustomer{
    height: 100%;
}
.myCustomer .title{
    padding: 10px 20px;
    font-size: 14px;
    color: #333;
}
.myCustomer .title .iconfont{
    display: inline-block;
    font-size: 12px;
    padding: 6px;
    color: #fff;
    margin-right: 10px;
}
.myCustomer .query-box{
    padding: 15px 20px;
}
.myCustomer .title .tips{
    cursor: pointer;
    font-size: 12px;
    color: white;
    background-color: #cbcbcb;
    display: inline-block;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    text-align: center;
    line-height: 13px;
    margin-left: 5px;
}
</style>
<template>
    <div class="myCustomer">
        <div class="title">
            <i class="iconfont iconkehu" style="background-color: rgb(25, 181, 246)"></i>
            <span>分配给我的客户</span>
            <el-tooltip class="item" effect="dark" content="转移、领取、分配之后未跟进的客户，默认显示自己负责的客户" placement="top">
                <span  class="tips">?</span>
            </el-tooltip>
        </div>
        <div class="query-box">
            <el-select size="mini" v-model="msg.ToDayContactType" @change="getList">
                <el-option :key="1" label="待跟进" :value="1"> </el-option>
                <el-option :key="2" label="已跟进" :value="2"> </el-option>
            </el-select>
        </div>
       <div>
            <el-table
                v-loading="loading"
                stripe
                ref="multipleTable"
                :data="dataList"
                tooltip-effect="dark"
                style="width: 100%"
                row-class-name="font-size-12"
                @selection-change="handleSelectionChange">
                <el-table-column fixed type="selection" width="40"></el-table-column>
                <el-table-column 
                    prop="CustomerName"
                    label="客户名称"
                    show-overflow-tooltip>
                    <template slot-scope="scope">
                        <p @click="openDetails(scope)" class="font-color-link cp">{{scope.row.CustomerName}}</p>
                    </template>
                </el-table-column>
                <el-table-column 
                    prop="CustomerLevelStr"
                    label="客户级别"
                    show-overflow-tooltip>
                </el-table-column>
                <el-table-column 
                    prop="CustomerSourceTypeStr"
                    label="客户来源"
                    show-overflow-tooltip>
                </el-table-column>
                <el-table-column 
                    prop="Contact"
                    label="联系人"
                    show-overflow-tooltip>
                </el-table-column>
                <el-table-column 
                    prop="ContactNumber"
                    label="联系电话"
                    show-overflow-tooltip>
                </el-table-column>
                
            </el-table>
        </div>
    </div>
</template>
<script>
export default {
    data(){
        return {
            msg: {
                ToDayContactType: 1,
                pageIndex: 1,
                pageSize: 15
            },
            dataList: [],
            loading: false,
            selectID: []
        }
    },
    mounted() {
        this.getList()
    },
    methods: {
        openDetails(scope){
            this.MsgBus.$emit('openCustomerWin', scope.row)
        },
        handleSelectionChange(val) {
            this.selectID = val.map(x=>
                x.ID
            )
        },
        getList(){
            this.loading = true
            this.apipost('/api/CustomerAgency/GetFollowUpPageList', this.msg, res=>{
                if (res.data.resultCode == 1) {
                    this.loading = false
                    this.dataList = res.data.data.pageData
                } else {
                    this.loading = false
                }
            })
        }
    }
}
</script>