<template>
  <div id="index">
    <el-row>
      <el-col :span="24" class="main">
        <el-col :span="24" class="one">
          <el-col :span="24" class="one_1"> 自动对比问题人员查询</el-col>
          <el-col :span="24" class="one_2">
            <el-form ref="searchFrom" :model="searchFrom" label-width="100px">
              <el-col :span="24" class="one_2txt">
                <el-col :span="8">
                  <el-form-item label="姓名">
                    <el-input v-model="searchFrom.name"></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="管辖单位">
                    <el-input v-model="searchFrom.tube_company"></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="公民身份号码">
                    <el-input v-model="searchFrom.card"></el-input>
                  </el-form-item>
                </el-col>
              </el-col>
              <el-col :span="24" class="one_2txt">
                <el-col :span="8">
                  <el-form-item label="户籍地">
                    <el-input v-model="searchFrom.house_city"></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="性别">
                    <el-select v-model="searchFrom.gender" clearable placeholder="请选择">
                      <el-option label="男" value="男"></el-option>
                      <el-option label="女" value="女"></el-option>
                    </el-select>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="问题类别">
                    <el-select v-model="searchFrom.question_type" clearable placeholder="请选择">
                      <el-option label="问题类别" value="问题类别"></el-option>
                      <el-option label="问题类别" value="问题类别"></el-option>
                    </el-select>
                  </el-form-item>
                </el-col>
              </el-col>
              <el-col :span="24" class="one_2txt">
                <el-col :span="8">
                  <el-form-item label="户籍地派出所">
                    <el-input v-model="searchFrom.house_police"></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="民族">
                    <el-select v-model="searchFrom.nation" clearable placeholder="请选择">
                      <el-option v-for="(item, index) in nationList" :key="index" :label="item" :value="item"> </el-option>
                    </el-select>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="报名单位">
                    <el-input v-model="searchFrom.sign_company"></el-input>
                  </el-form-item>
                </el-col>
              </el-col>
              <el-col :span="24" class="one_2txt">
                <el-col :span="16">
                  <el-form-item label="出生日期">
                    <el-date-picker v-model="searchFrom.birth" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
                    </el-date-picker>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="是否处理">
                    <el-select v-model="searchFrom.is_handle" clearable placeholder="请选择">
                      <el-option label="已处理" value="已处理"></el-option>
                      <el-option label="未处理" value="未处理"></el-option>
                      <el-option label="撤销" value="撤销"></el-option>
                    </el-select>
                  </el-form-item>
                </el-col>
              </el-col>
              <el-col :span="24" class="one_2txt">
                <el-col :span="24" class="btn">
                  <el-button type="primary" size="mini" @click="search()">查询</el-button>
                  <el-button type="primary" size="mini" @click="toExport">导出</el-button>
                </el-col>
              </el-col>
            </el-form>
          </el-col>
        </el-col>
        <el-col :span="24" class="two">
          <data-table @query="search" :fields="fields" :opera="opera" :data="list" :total="total" @handle="toHandle" @view="toView"> </data-table>
        </el-col>
      </el-col>
    </el-row>
  </div>
</template>

<script>
const { nation } = require('@common/src/layout/deploy/dict');
import { mapState, createNamespacedHelpers } from 'vuex';
export default {
  name: 'index',
  props: {},
  components: {},
  data: function () {
    return {
      // 查询
      searchFrom: {},
      // 列表
      fields: [
        { label: '姓名', model: 'name' },
        { label: '身份号码', model: 'card' },
        { label: '出生日期', model: 'birth' },
        { label: '民族', model: 'nation' },
        { label: '联系电话', model: 'phone' },
        { label: '性别', model: 'gender' },
        { label: '报名单位', model: 'sign_company' },
        { label: '管辖单位', model: 'tube_company' },
        { label: '户籍地', model: 'house_city' },
        { label: '问题类型', model: 'question_type' },
        { label: '比对时间', model: 'comparison_date' },
      ],
      opera: [
        { label: '处理', method: 'handle' },
        { label: '详情', method: 'view' },
      ],
      list: [{ id: '1', name: '1112' }],
      total: 0,
      nationList: nation,
    };
  },
  created() {},
  methods: {
    async search() {
      console.log(this.searchFrom);
    },
    // 处理
    toHandle({ data }) {},
    // 详情
    toView({ data }) {
      this.$router.push({ path: '/adminPolice/information/zdbdwtrycx/info', query: { id: data.id } });
    },
    // 导出
    toExport() {
      this.$message({ type: `success`, message: `导出成功` });
    },
  },
  computed: {
    ...mapState(['user']),
  },
  metaInfo() {
    return { title: this.$route.meta.title };
  },
  watch: {
    test: {
      deep: true,
      immediate: true,
      handler(val) {},
    },
  },
};
</script>

<style lang="less" scoped>
.main {
  .one {
    .one_1 {
      height: 40px;
      line-height: 40px;
      border-bottom: 1px solid #ccc;
      margin: 0 0 10px 0;
      font-size: 18px;
      font-weight: bold;
    }
    .one_2 {
      .one_2txt {
        border: 1px solid #ccc;
        /deep/.el-form-item {
          margin: 0;
        }
        /deep/.el-date-editor.el-input,
        .el-date-editor.el-input__inner {
          width: 100%;
        }
        /deep/.el-select {
          width: 100%;
        }
        .btn {
          text-align: right;
          padding: 5px 5px;
        }
      }
    }
  }
}
</style>
