<template>
    <div class="container">
        <fullscreen :fullscreen.sync="fullscreen" class="container-box">
            <div class="titbox">
                <h2 class="font-ui">集团客户信息</h2>
                <div>
                    <i class="el-icon-refresh" @click="iconCli(1)"></i>
                    <i class="el-icon-full-screen" @click="iconCli(2)"></i>
                    <!--                    <i class="el-icon-folder-opened"></i>-->
                    <!--                    <i class="el-icon-view"></i>-->
                    <!--                    <i class="el-icon-more"></i>-->
                </div>
            </div>
            <div class="search">
                <mySearch :searchList="searchList" @searchInfo="searchInfo"></mySearch>
            </div>
            <div class="tabbox">
                <el-table height="calc(100% - 40px)" v-loading="loading" class="com-table" ref="multipleTable"
                    :data="tableData" tooltip-effect="dark" size="small" border style="width: 100%">
                    <el-table-column align="center" prop="servNo" label="手机号">
                        <template slot-scope="scope">
                              <span>{{vague(scope.row.servNo)}}</span>
                        </template>
                    </el-table-column>
                    <el-table-column prop="groupCityName" label="地市" align="center"></el-table-column>
                    <el-table-column align="center" prop="groupName" label="单位名">
                    </el-table-column>
                    <el-table-column align="center" prop="groupCountyName" label="区域">
                    </el-table-column>
                    <el-table-column align="center" prop="groupScale" width="150" label="单位类型">
                    </el-table-column>
                    <el-table-column width="100" align="center" prop="memberName" label="客户角色">
                    </el-table-column>
                    <el-table-column width="100" align="center" prop="custManagerId" label="经理工号">
                    </el-table-column>
                    <el-table-column width="100" align="center" prop="custManagerName" label="经理姓名">
                        <template slot-scope="scope">
                              <span>{{$desensitization(scope.row.custManagerName,1)}}</span>
                        </template>
                    </el-table-column>
                    <el-table-column width="100" align="center" prop="itemName1" label="产品1">
                    </el-table-column>
                    <el-table-column width="100" align="center" prop="itemName2" label="产品2">
                    </el-table-column>
                    <el-table-column width="100" align="center" prop="itemName3" label="产品3">
                    </el-table-column>
                    <el-table-column width="100" align="center" prop="itemName4" label="产品4">
                    </el-table-column>
                    <el-table-column width="100" align="center" prop="itemName5" label="产品5">
                    </el-table-column>
                    <el-table-column width="100" align="center" prop="itemName6" label="产品6">
                    </el-table-column>
                    <el-table-column width="100" align="center" prop="itemName7" label="产品7">
                    </el-table-column>
                    <el-table-column width="100" align="center" prop="itemName8" label="产品8">
                    </el-table-column>
                </el-table>
                <el-pagination class="pageBox" @current-change="currchange" layout="prev, pager, next" background
                    :total="total">
                </el-pagination>
            </div>
        </fullscreen>
    </div>
</template>
<script>
    import mySearch from "../../../components/search";

    export default {
        components: {
            mySearch,
        },
        data() {
            return {
                fullscreen: false,
                total: 0,
                pageSize: 1,
                tableData: [],
                searchList: [{
                    type: "input",
                    tit: "手机号",
                    value: "",
                    width: "100%",
                    options: [],
                }, ],
                params: {
                    servNo: "",
                },
                loading: false,
            };
        },
        methods: {
            vague(v){
                v = v.split("");
                v[3] = "*";
                v[4] = "*";
                v[5] = "*";
                v[6] = "*";
                let phone = '';
                for (let i = 0; i < v.length; i++) {
                    phone += v[i]
                }
                return phone
            },
            //搜索数据
            searchInfo(v) {
                this.params = {};
                v[0] ? (this.params.servNo = v[0]) : "";
                this.getList(this.params, this.pageSize);
            },
            //获取列表
            getList(v, n) {
                this.loading = true;
                this.pageSize = n;
                this.$http({
                    url: "/satisfy/customer/ydGroupUserInfo",
                    method: "post",
                    headers: {
                        "Content-Type": "application/json",
                        page: '{"pageNo":"' + n + '","pageSize":"10"}',
                    },
                    data: v,
                }).then((res) => {
                    this.loading = false;
                    this.tableData = res.data.data;
                    this.total = res.data.totalRecord;
                });
            },
            //功能栏
            iconCli(v) {
                if (v === 1) {
                    this.getList(this.params, this.pageSize);
                }
                if (v === 2) {
                    this.fullscreen = !this.fullscreen;
                }
            },
            // 分页
            currchange(v) {
                this.pageSize = v;
                this.getList(this.params, this.pageSize);
            },
        },
        mounted() {
            this.getList(this.params, this.pageSize);
        },
        created() {},
    };
</script>
<style>
    .el-input__suffix {
        cursor: pointer;
    }
</style>
<style scoped lang="scss">
    .titbox {
        div {
            float: right;

            i {
                font-size: 22px;
                margin-left: 20px;
                cursor: pointer;
            }
        }
    }

    .tabbox {
        margin-top: 15px;
    }

    .pageBox {
        text-align: right;
        margin-top: 10px;
    }
</style>
