<template>
  <div class="simCardcontain">
    <div class="simBtnGroup">
      <el-button type="primary">新增</el-button>
      <el-button type="primary">修改</el-button>
      <el-button type="primary">删除</el-button>
      <el-button type="primary">查询</el-button>
      <el-button type="primary">质保延期</el-button>
      <el-button type="primary">导入</el-button>
      <el-button type="primary">导入模板下载</el-button>
      <el-button type="primary">导出</el-button>
    </div>
    <div class="searchForm">
      <el-form :inline="true" :model="formInline" class="demo-form-inline">
        <el-form-item label="单位:">
          <el-select v-model="formInline.region" placeholder="活动区域">
            <el-option label="区域一" value="shanghai"></el-option>
            <el-option label="区域二" value="beijing"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="网络类型:">
          <el-select v-model="formInline.region" placeholder="活动区域">
            <el-option label="区域一" value="shanghai"></el-option>
            <el-option label="区域二" value="beijing"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="状态:">
          <el-input v-model="formInline.user" placeholder="审批人"></el-input>
        </el-form-item>
        <el-form-item label="是否已使用">
          <el-select v-model="formInline.region" placeholder="活动区域">
            <el-option label="区域一" value="shanghai"></el-option>
            <el-option label="区域二" value="beijing"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="电话号码:">
          <el-input v-model="formInline.user" placeholder="审批人"></el-input>
        </el-form-item>
      </el-form>
    </div>
    <div class="simTable">
      <el-table
        ref="multipleTable"
        :data="tableData"
        stripe
        tooltip-effect="dark"
        style="width: 100%"
        @selection-change="handleSelectionChange"
      >
        <el-table-column type="index" width="55"> </el-table-column>
        <el-table-column type="selection" width="55"> </el-table-column>
        <el-table-column label="单位">
          <template slot-scope="scope">{{ scope.row.date }}</template>
        </el-table-column>
        <el-table-column prop="name" label="电话号码"> </el-table-column>
        <el-table-column prop="address" label="网络类型" show-overflow-tooltip>
        </el-table-column>
        <el-table-column prop="name" label="质保到期日"> </el-table-column>
        <el-table-column prop="name" label="流量包(M)"> </el-table-column>
        <el-table-column prop="name" label="告警阀值(%)"> </el-table-column>
        <el-table-column prop="name" label="状态"> </el-table-column>
        <el-table-column prop="name" label="是否已使用"> </el-table-column>
      </el-table>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      formInline: {
        user: "",
        region: "",
      },
      tableData: [
        {
          date: "2016-05-03",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-02",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-04",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-01",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-08",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-06",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-07",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
      ],
      multipleSelection: [],
    };
  },
  methods: {
    onSubmit() {
      console.log("submit!");
    },
    toggleSelection(rows) {
      if (rows) {
        rows.forEach((row) => {
          this.$refs.multipleTable.toggleRowSelection(row);
        });
      } else {
        this.$refs.multipleTable.clearSelection();
      }
    },
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
  },
};
</script>
<style lang="less">
.simCardcontain {
  width: 100%;
  height: 100%;
  background: @color-white;
  .simBtnGroup {
    padding: 16px 8px;
  }
  .searchForm {
    padding: 0px 8px;
    .el-form {
      .el-form-item {
        margin-bottom: 0px;
      }
    }
  }
  .simTable {
    padding: 16px 8px 0 8px;
  }
}
</style>
