<template>
  <div class="app-container">
    <el-form
      :model="queryParams"
      ref="queryForm"
      size="small"
      :inline="true"
      v-show="showSearch"
      label-width="110px"
    >
      <el-row>
        <el-col :span="6">
          <el-form-item label="业务申请号" prop="key1">
            <el-input
              v-model="queryParams.key1"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="标准名称" prop="key2">
            <el-input
              v-model="queryParams.key2"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="申请人" prop="key3">
            <el-input
              v-model="queryParams.key3"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="审核状态" prop="key4">
            <el-select v-model="queryParams.key4" placeholder="请选择">
              <el-option label="全部" value=""></el-option>
              <el-option label="待审核" value="01"></el-option>
              <el-option label="已审核" value="02"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="申请日期" prop="key5">
            <el-date-picker
              v-model="queryParams.key5"
            >
            </el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="标准状态" prop="key6">
            <el-input
              v-model="queryParams.key6"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="参与主持" prop="key7">
            <el-input
              v-model="queryParams.key7"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="公示参编人员" prop="key8">
            <el-input
              v-model="queryParams.key8"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="标准编号" prop="key9">
            <el-input
              v-model="queryParams.key9"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item>
            <el-button type="primary" icon="el-icon-search" size="mini">
              搜索
            </el-button>
            <el-button icon="el-icon-refresh" size="mini">重置</el-button>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAddClick">
          新增
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="danger" plain icon="el-icon-delete" size="mini" @click="btnClick">
          删除
        </el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch"></right-toolbar>
    </el-row>

    <el-table :data="listData" border>
      <el-table-column label="序号" type="index" align="center">
        <template slot-scope="scope">
          <span>{{ scope.$index + 1 }}</span>
        </template>
      </el-table-column>
      <el-table-column label="业务申请号" align="center" prop="key1" />
      <el-table-column label="标准名称" align="center" prop="key2" show-overflow-tooltip />
      <el-table-column label="颁布部门" align="center" prop="key3" />
      <el-table-column label="参与主持" align="center" prop="key4" />
      <el-table-column label="公司参编人员" align="center" prop="key5" />
      <el-table-column label="登记批次" align="center" prop="key6" />
      <el-table-column label="标准编号" align="center" prop="key7" />
      <el-table-column label="发布时间" align="center" prop="key8" />
      <el-table-column label="实施时间" align="center" prop="key9" />
      <el-table-column label="起草单位/申请单位" align="center" prop="key10" />
    </el-table>

    <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <el-dialog :title="dialogTitle" :visible.sync="visible" width="800px" append-to-body>
      <el-form ref="form" :model="form" label-width="120px">
        <el-form-item label="业务申请号" prop="key1">
          <el-input v-model="form.key1" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="标准名称" prop="key2">
          <el-input v-model="form.key2" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="颁布部门" prop="key3">
          <el-input v-model="form.key3" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="参与主持" prop="key4">
          <el-input v-model="form.key4" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="公示参编人员" prop="key5">
          <el-input v-model="form.key5" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="登记批次" prop="key6">
          <el-input v-model="formData.key6" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="标准编号" prop="key7">
          <el-input v-model="formData.key7" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="发布时间" prop="key8">
          <el-date-picker v-model="formData.key8" placeholder="请选择" />
        </el-form-item>
        <el-form-item label="实时时间" prop="key9">
          <el-date-picker v-model="formData.key9" placeholder="请选择" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: "ReserveProjectApply",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 表单参数
      form: {},
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
      },
      listData: [
        {
          key1: "552220",
          key2: "一类专于钢质材料研发",
          key3: "标准类型1",
          key4: "技术部",
          key5: "张三",
          key6: "张三、李四",
          key7: "G452632",
        },
      ],
      visible: false,
      formData: {},
      dialogTitle: "新增"
    };
  },
  methods: {
    handleQuery() {},
    getList() {},
    btnClick() {
      this.$message.warning("功能建设中...");
    },
    handleAddClick() {
      this.visible = true;
    },
    submitForm() {
      this.$message.warning("功能建设中...");
    },
    cancel() {
      this.visible = false;
    }
  },
};
</script>
