<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-input
              v-model="queryParams.key4"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="报支日期" prop="key5">
            <el-date-picker
              v-model="queryParams.key5"
              type="date"
              placeholder="选择日期"
            >
            </el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="查询创建" prop="key6">
            <el-select v-model="queryParams.key6" placeholder="请选择" style="width: 100%;">
              <el-option label="全部" value=""></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="审核状态" prop="key7">
            <el-select v-model="queryParams.key7" placeholder="请选择" style="width: 100%;">
              <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="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-date-picker
              v-model="queryParams.key9"
              type="date"
              placeholder="选择日期"
            >
            </el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="编制单位" prop="key10">
            <el-select v-model="queryParams.key10" placeholder="请选择" style="width: 100%;">
              <el-option label="全部" value=""></el-option>
              <el-option label="单位1" value="01"></el-option>
              <el-option label="单位2" value="02"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="供应商" prop="key11">
            <el-input
              v-model="queryParams.key11"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="费用科目" prop="key12">
            <el-input
              v-model="queryParams.key12"
              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" />
      <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="key12" />
      <el-table-column label="供应商" align="center" prop="key9" />
      <el-table-column label="审批状态" align="center" prop="key10" />
      <el-table-column label="编制单位" align="center" prop="key11" />
    </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 type="textarea" v-model="form.key1" 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="key12">
          <el-input v-model="form.key12" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="不含税金额" prop="key5">
          <el-input-number v-model="form.key5" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="税额" prop="key6">
          <el-input-number v-model="form.key6" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="报支金额" prop="key12">
          <el-input-number v-model="form.key12" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="付款金额" prop="key13">
          <el-input-number v-model="form.key13" placeholder="请输入" />
        </el-form-item>
        <el-form-item label="供应商" prop="key9">
          <el-input v-model="form.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: "123456789",
          key2: "钢质费用",
          key3: "5263200",
          key4: "关于采购合同",
          key5: "钢铁升降式改装",
          key6: "1500",
          key7: "0",
          key7: "1500",
          key8: "1500",
          key9: "张三",
          key10: "审核中",
        },
      ],
      visible: false,
      formData: {},
      dialogTitle: "新增"
    };
  },
  methods: {
    handleQuery() {},
    getList() {},
    btnClick() {
      this.$message.warning("功能建设中...");
    },
    handleAddClick() {
      this.visible = true;
    },
    submitForm() {
      this.$message.warning("功能建设中...");
    },
    cancel() {
      this.visible = false;
    }
  },
};
</script>
