<template>
    <div class="Marketingamount-box">
        <!-- 详情弹出框 -->
        <el-dialog title="详情" :visible.sync="particulars">
            <el-table :data="gridData">
                <el-table-column property="date" label="日期" width="150"></el-table-column>
                <el-table-column property="name" label="姓名" width="200"></el-table-column>
                <el-table-column property="address" label="地址"></el-table-column>
            </el-table>
        </el-dialog>
        <!-- 详情弹出框 -->
        <el-dialog title="拜访记录" :visible.sync="visitlog">
            
        </el-dialog>
        <el-form ref="form" label-width="75px">
            <el-form-item label="人员名称:">
                <el-select v-model="DiId" placeholder="请选择团队名称">
                    <el-option v-for="(item,index) in cTablelist" :key="index" :label="item.teamName" :value="item.id"></el-option>
                </el-select>
            </el-form-item>
        </el-form>
        <div class="Marketingamount-head-ul">
            <div style="background-color: #ff4f4f;" class="Marketingamount-head-li">
                <div class="head-li-title">全年销售总金额</div>
                <div class="head-li-info">
                    <div class="li-info-amount">¥99,999</div>
                    <div class="li-info-ratio">年同比:5%&nbsp;&nbsp;&nbsp;▲</div>
                </div>
            </div>
            <div style="background-color: #069305;" class="Marketingamount-head-li">
                <div class="head-li-title">全年销售总金额</div>
                <div class="head-li-info">
                    <div class="li-info-amount">¥99,999</div>
                    <div class="li-info-ratio">年同比:5%&nbsp;&nbsp;&nbsp;▼</div>
                </div>
            </div>
            <div  style="background-color: #ff4f4f;" class="Marketingamount-head-li">
                <div class="head-li-title">全年销售总金额</div>
                <div class="head-li-info">
                    <div class="li-info-amount">¥99,999</div>
                    <div class="li-info-ratio">年同比:5%&nbsp;&nbsp;&nbsp;▲</div>
                </div>
            </div>
        </div>
        <div class="Marketingamount-content">
            <div class="content-chart">
                <el-table
                :header-cell-style="{background:'#eef1f6',color:'#606266'}"
                :data="tableDatas"
                border
                style="width: 100%">
                    <el-table-column
                    prop=""
                    label="排名"
                    width="50">
                    </el-table-column>
                    <el-table-column
                    prop="date"
                    label="名称"
                    width="100">
                    </el-table-column>
                    <el-table-column
                    prop="date"
                    label="成单量">
                    </el-table-column>
                </el-table>
                <div style="text-align: center;margin: 5px 0">
                    <el-pagination
                    small
                    layout="prev, pager, next"
                    :total="50">
                    </el-pagination>
                </div>
                <div id="statisticallyone" style="height:300px;"></div>
                <div id="statisticallytwo" style="height:300px;"></div>
            </div>
            <div class="content-table">
                <el-table
                :header-cell-style="{background:'#eef1f6',color:'#606266'}"
                :data="tableData"
                border
                style="width: 100%">
                    <el-table-column
                    prop=""
                    label="序号"
                    width="50">
                    </el-table-column>
                    <el-table-column
                    prop="date"
                    label="团组名"
                    width="100">
                    </el-table-column>
                    <el-table-column
                    prop="date"
                    label="客户单位">
                    </el-table-column>
                    <el-table-column
                    prop="date"
                    label="客户名称">
                    </el-table-column>
                    <el-table-column
                    prop="date"
                    label="出访日期"
                    width="100">
                    </el-table-column>
                    <el-table-column
                    prop=""
                    label="人数"
                    width="50">
                    </el-table-column>
                    <el-table-column
                    width="150"
                    label="操作">
                        <template>
                            <el-button size="mini" @click="particulars=true" type="primary">查看</el-button>
                            <el-button size="mini" @click="visitlog=true" type="primary">拜访</el-button>
                        </template>
                    </el-table-column>
                </el-table>
                <div class="block">
                    <el-pagination
                      @size-change="handleSizeChange"
                      @current-change="handleCurrentChange"
                      :current-page="currentPage"
                      :page-size="pagesize"
                      layout="total, sizes, prev, pager, next, jumper"
                      :total="400">
                    </el-pagination>
                  </div>
            </div>
        </div>
    </div>
</template>
<script>
import * as echarts from 'echarts';
export default {
    data() {
        return {
            DiId:'',
            cTablelist:[],
            currentPage:1,
            pagesize:10,
            tableDatas:[
                {
                date: '2016-05-02',
                name: '王小虎',
                address: '上海市普陀区金沙江路 1518 弄'
                }, {
                date: '2016-05-04',
                name: '王小虎',
                address: '上海市普陀区金沙江路 1517 弄'
                }, {
                date: '2016-05-01',
                name: '王小虎',
                address: '上海市普陀区金沙江路 1519 弄'
                }
            ],
            tableData: [{
            date: '2016-05-02',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1518 弄'
            }, {
            date: '2016-05-04',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1517 弄'
            }, {
            date: '2016-05-01',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1519 弄'
            }, {
            date: '2016-05-03',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1516 弄'
            }, {
            date: '2016-05-03',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1516 弄'
            }, {
            date: '2016-05-03',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1516 弄'
            }, {
            date: '2016-05-03',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1516 弄'
            }, {
            date: '2016-05-03',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1516 弄'
            }, {
            date: '2016-05-03',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1516 弄'
            }, {
            date: '2016-05-03',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1516 弄'
            }, {
            date: '2016-05-03',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1516 弄'
            }, {
            date: '2016-05-03',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1516 弄'
            }, {
            date: '2016-05-03',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1516 弄'
            }
            ],
            particulars:false,
            visitlog:false,
        }
    },
    methods:{
        handleSizeChange(val) {
            console.log(`每页 ${val} 条`);
        },
        handleCurrentChange(val) {
            console.log(`当前页: ${val}`);
        },
        statisone(){
            var myChart = echarts.init(document.getElementById('statisticallyone'));
            myChart.setOption({
                title: {
                    text: '客户类型分布表',
                    left: 'center'
                },
                tooltip: {
                    trigger: 'item'
                },
                // legend: {
                //     orient: 'vertical',
                //     left: 'left'
                // },
                series: [
                    {
                    type: 'pie',
                    radius: '50%',
                    data: [
                        { value: 1048, name: '政府' },
                        { value: 735, name: '企业' },
                        { value: 580, name: '散客' },
                        { value: 484, name: '高校' },
                        { value: 484, name: '非团组' },
                        { value: 484, name: '成都会务活动' },
                        { value: 484, name: '四川会务活动' },
                        { value: 484, name: '成都赛事' },
                        { value: 484, name: '四川赛事' },
                        { value: 300, name: '未知' }
                    ],
                    emphasis: {
                        itemStyle: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                        }
                    }
                    }
                ]
            });
            var myCharttwo = echarts.init(document.getElementById('statisticallytwo'));
            myCharttwo.setOption({
                title: {
                    text: '客户等级分布表',
                    left: 'center'
                },
                tooltip: {
                    trigger: 'item'
                },
                series: [
                    {
                    type: 'pie',
                    radius: '50%',
                    data: [
                        { value: 1048, name: 'VIP' },
                        { value: 735, name: 'VVIP' },
                        { value: 580, name: '暂未定级' },
                    ],
                    emphasis: {
                        itemStyle: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                        }
                    }
                    }
                ]
            });
        }
    },
    mounted(){
        this.statisone()
    }
}
</script>
<style>
.Marketingamount-box{
    background-color: #fff;
    padding: 10px;
    box-shadow: 0 0 5px #0005;
    border-radius: 10px;
    min-height: 830px;
}
.Marketingamount-head-ul{
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
}
.Marketingamount-head-li{
    color: #fff;
    min-width: 25%;
    padding: 15px;
    box-shadow: 0 0 10px #0005;
    border-radius: 10px;
}
.head-li-title{
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 20px;
}
.head-li-info{
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}
.Marketingamount-content{
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
}
.content-chart{
    padding-top: 25px;
    min-width: 26.5%;
}
.content-table{
    margin-top: 25px;
    min-width: 60%;
}
.content-table .block{
    text-align: center;
}
</style>