<template>
  <div class="test">
    <el-row :gutter="20">
      <el-col class="center" :span="22">
        <el-card shadow="always"
          >111
          <el-row :gutter="22">
            <el-col class="center" :span="22">
              <el-card shadow="always">
                <el-input
                  style="margin-right: 30px; width: 50%"
                  placeholder="请输入企业名称"
                  v-model="searchEnterName"
                  clearable
                >
                </el-input>
                <el-button type="success" @click="searchEnters">查找</el-button>
              </el-card>
            </el-col>
          </el-row>
          <el-row :gutter="22">
            <el-col class="center" :span="22">
              <el-card shadow="always">
                <el-table :data="enterCertifyList" border style="width: 100%">
                  <el-table-column prop="companyName" label="企业名称">
                  </el-table-column>
                  <el-table-column
                    prop="emergencyPlan"
                    label="应急预案证书数量"
                  >
                  </el-table-column>
                  <el-table-column
                    prop="dualSystem"
                    label="双体系证书数量"
                  ></el-table-column>
                  <el-table-column
                    prop="standardization"
                    label="标准化证书数量"
                  ></el-table-column>
                  <el-table-column label="操作">
                    <template slot-scope="scope">
                      <el-button
                        @click="handleClick(scope.row)"
                        type="text"
                        size="small"
                        >详情</el-button
                      >
                    </template>
                  </el-table-column>
                </el-table>
              </el-card>
            </el-col>
          </el-row>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>
<script>
import { certifyEnters } from "@/api/certify.js";

export default {
  data() {
    return {
      searchEnterName: "",
      enterCertifyList: [
        {
          companyName: "威海兴茂置业有限公司",
          companyId: 71522,
          emergencyPlan: 20,
          dualSystem: 10,
          standardization: 10,
        },
        {
          companyName: "中国石油天然气股份有限公司山东威海销售分公司",
          companyId: 71520,
          emergencyPlan: 20,
          dualSystem: 10,
          standardization: 10,
        },
        {
          companyName: "威海经济技术开发区洪氏家居生活馆",
          companyId: 71519,
          emergencyPlan: 15,
          dualSystem: 12,
          standardization: 11,
        },
        {
          companyName: "威海市教育局经济技术开发区教育服务中心",
          companyId: 71517,
          emergencyPlan: 8,
          dualSystem: 3,
          standardization: 1,
        },
      ],
    };
  },
  methods: {
    searchEnters() {
      console.log(1);
    },
    handleClick(row) {
      console.log(row);
      this.$router.push("/train/entercertifymanage/" + row.companyId);
    },
  },
};
</script>

<style scoped>
.center {
  margin: 20px auto;
}
[class*="el-col-"] {
  float: none;
}
</style>