<template>
    <div>
        <search-layout :needBox="true">
            <template slot="searchItem1">
                <span class="label">账户名称</span>
                <el-input
                    v-model="searchParams.id"
                    size="small"
                    clearable
                    placeholder="请输入"
                >
                </el-input>
            </template>
            <template slot="searchItem2">
                <span class="label">所属公司</span>
                <el-input
                    v-model="searchParams.clientOrgName"
                    size="small"
                    clearable
                    placeholder="请输入"
                >
                </el-input>
            </template>
            <template slot="searchItem3">
                <span class="label">账户类型</span>
                <el-select v-model="searchParams.status">
                    <el-option
                        v-for="item in list"
                        :label="item.caption"
                        :value="item.code"
                        :key="item.code"
                    ></el-option>
                </el-select>
            </template>
            <template slot="searchItem4">
                <span class="label">状态</span>
                <el-select v-model="searchParams.status">
                    <el-option
                        v-for="item in list"
                        :label="item.caption"
                        :value="item.code"
                        :key="item.code"
                    ></el-option>
                </el-select>
            </template>
            <template slot="searchBtn1">
                <el-button type="primary">查询</el-button>
            </template>
            <template slot="searchBtn2">
                <el-button type="primary">重置</el-button>
            </template>
        </search-layout>

        <div class="btnsPanel">
            <el-button type="primary" plain icon="el-icon-video-pause"
                >批量停用</el-button
            >
            <el-button type="primary" plain icon="el-icon-video-play"
                >批量启用</el-button
            >
            <el-button
                type="primary"
                icon="el-icon-circle-plus-outline"
                @click="addConfig"
                >创建</el-button
            >
        </div>

        <tableList
            ref="table"
            style="border-top: none; margin: 0 30px"
            :columns="columns"
            :getDataWay="getDataWay"
            :pagination="pagination"
            index
            selection
        >
            <el-table-column label="操作" slot="cgInfos" align="center">
                <template v-slot="scope">
                    <i
                        @click="addMarkDia(scope.row)"
                        class="el-icon-edit-outline elIcon"
                    ></i>
                    <i
                        @click="addMarkDia(scope.row)"
                        class="el-icon-video-pause elIcon"
                    ></i>
                </template>
            </el-table-column>
        </tableList>
    </div>
</template>

<script>
import searchLayout from "@/components/grid/searchLayout";
import tableList from "@/components/grid/TableList";

export default {
    name: "accountManagement", // 账户管理
    components: { searchLayout, tableList },
    data() {
        return {
            searchParams: {
                //搜索参数
                id: "", //ID
                clientOrgName: "", //车辆名称
                clientOrgName1: "", //配置名称
                clientOrgName2: "", //配置描述
                status: "",
            },
            list: [],
            columns: [
                //表格列
                {
                    label: "账户名称",
                    prop: "id",
                },
                {
                    label: "账户类型",
                    prop: "aid",
                },
                {
                    label: "所属公司",
                    prop: "ktName",
                },
                {
                    label: "联系人",
                    prop: "jbSource",
                },
                {
                    label: "联系方式",
                    prop: "aid",
                },
                {
                    label: "状态",
                    prop: "ktName",
                },
                {
                    label: "创建人",
                    prop: "jbSource",
                },
                {
                    label: "创建时间",
                    prop: "jbSource",
                },
                {
                    label: "操作",
                    prop: "cgInfos",
                    template: true,
                },
            ],
            pagination: {
                //分页使用
                currentPage: 1,
                pageSize: 10,
                position: "right",
                pageSizes: [10, 30, 50, 100, 200],
                layout: "sizes, total, prev, pager, next, jumper",
            },
            getDataWay: {
                //加载表格数据
                dataType: "data",
                type: "post",
                firstRequest: false,
                data: [
                    {
                        id: 1,
                        ktName: "kjdhfkjsdhfkjsjhdfksdjhfkhwoieyrhfisdhfksjhdf",
                        jbSource: "收到就好付款时间的回复可见收到货覅无痕",
                    },
                    { id: 2 },
                    { id: 3 },
                    { id: 4 },
                    { id: 51 },
                    { id: 6 },
                ],
                // data: this.$api.scientificStatistics.typeProjectStatistics,
                param: {},
            },
        };
    },
    methods: {
        addConfig() {
            this.$router.push({ path: "/addAccount" });
        },
        addMarkDia() {},
    },
};
</script>

<style scoped lang="less">
.btnsPanel {
    margin: 45px 40px 15px;
}
</style>