<template>
    <fullscreen :fullscreen.sync="fullscreen" class="container" style="margin: 0;width: 100%;">
        <div class="container-box" style="padding: 0 20px 0 0;">
            <toolList @iconCli='iconCli' :tooltit='tooltit'></toolList>
            <div class="search">
                <mySearch :searchList="searchList" @searchInfo="searchInfo"></mySearch>
            </div>
            <div class="tabbox">
                <el-table height="calc(100% - 40px)" class="com-table" ref="multipleTable" :data="tableData" tooltip-effect="dark"
                    size="small" border style="width: 100%" v-loading="loading">
                    <el-table-column prop="terminalTypeName" label="类别">
                    </el-table-column>
                    <el-table-column prop="brandName" label="品牌">
                    </el-table-column>
                    <el-table-column prop="modelType" label="型号">
                    </el-table-column>
                    <el-table-column prop="resId" label="终端编码" width="160">
                    </el-table-column>
                    <el-table-column prop="modelType" label="终端序列">
                    </el-table-column>
                    <el-table-column prop="opName" label="操作工号">
                    </el-table-column>
                    <el-table-column prop="opNo" label="操作姓名">
                    </el-table-column>
                    <el-table-column prop="opTime" label="操作时间">
                    </el-table-column>
                    <el-table-column prop="dealContent" label="内容">
                    </el-table-column>
                </el-table>
                <el-pagination class="pageBox" @current-change="currchange" layout="prev, pager, next" background
                    :total="total">
                </el-pagination>
            </div>
        </div>
    </fullscreen>
</template>
<script>
    import toolList from '../../../components/toolList'
    import mySearch from '../../../components/search'

    export default {
        components: {
            toolList,
            mySearch
        },
        data() {
            return {
                tooltit: '测试终端管理台账',
                fullscreen: false,
                total: 0,
                pageSize: 1,
                tableData: [{}],
                searchList: [{
                        type: 'input',
                        tit: '类别',
                        value: '',
                        width: '32%',
                    },
                    {
                        type: 'input',
                        tit: '品牌',
                        value: '',
                        width: '32%',
                    },
                    {
                        type: 'input',
                        tit: '型号',
                        value: '',
                        width: '32%',
                    },
                ],
                loading:false,
                params:{}
            }
        },
        methods: {
            //搜索数据
            searchInfo(v) {
                this.params = {};
                v[0] ? this.params.terminalTypeName = v[0] : '';
                v[1] ? this.params.brandName = v[1] : '';
                v[2] ? this.params.modelType = v[2] : '';
                this.getList(this.params, this.pageSize);
            },
            //获取列表
            getList(v, n) {
                this.pageSize = n;
                let _this = this;
                this.tableData = [];
                this.loading = true;
                this.$http({
                    url: "/market/terminal/terminalacct/queryPage",
                    method: "post",
                    headers: {
                        "Content-Type": "application/json",
                        "page": '{"pageNo":"' + n + '","pageSize":"10"}'
                    },
                    data: v,
                }).then((res) => {
                    this.tableData = res.data.data;
                    this.total = res.data.totalRecord;
                    this.loading = false;
                });
            },
            // 分页
            currchange(v) {
                this.pageSize = v;
                this.getList(this.params, this.pageSize);
            },
            //功能栏
            iconCli(v) {
                if (v === 1) {
                    this.getList(this.params, this.pageSize);
                }
                if (v === 2) {
                    this.fullscreen = !this.fullscreen
                }
            },
        },
        mounted() {
            this.getList({}, 1);
        },
        created() {

        }
    }
</script>
<style scoped lang="scss">
    .onetab {
        margin-bottom: 20px;
        padding: 0 20px;
    }

    .titbox {
        div {
            float: right;

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

    .tabbox {
        margin-top: 15px;
    }

    .pageBox {
        text-align: right;
        margin-top: 10px;
    }

    .info-line {
        width: 100%;
        display: block;
        padding-left: 20px;

        div {
            width: 50%;
            display: inline-block;
        }

        span {
            width: 80px;
            display: inline-block;
            text-align: left;

            i {
                color: red;
                display: inline-block;
                padding-right: 5px;
            }
        }

        .el-select,
        .el-input {
            width: calc(100% - 100px);
        }
    }

    .online {
        width: 100%;

        .el-select {
            width: calc(100% - 100px);
        }

        span {
            vertical-align: top;
        }

        .el-textarea {
            width: calc(100% - 100px);
        }
    }
</style>
