<template>
  <div class="cmain">
    <div class="bos" style="border: 0px">
      <el-form :model="queryParams" ref="queryForm" @submit.native.prevent label-width="90px">
        <el-row>
          <el-col :span="12">
            <el-form-item label="车辆分类" prop="type">
              <el-select v-model="queryParams.type" placeholder="请选择" clearable>
                <el-option value="0" label="散货"></el-option>
                <el-option value="1" label="集装箱"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="放行结果" prop="state">
              <el-select v-model="queryParams.state" placeholder="请选择" clearable>
                <el-option value="2" label="禁止通行"></el-option>
                <el-option value="1" label="放行"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="前箱号" prop="boxF">
              <el-input v-model="queryParams.boxF" placeholder="请输入前箱号" @keyup.enter.native="handleQuery" clearable />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="后箱号" prop="boxB">
              <el-input v-model="queryParams.boxB" placeholder="请输入后箱号" @keyup.enter.native="handleQuery" clearable />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="放行提示" prop="op">
              <el-input v-model="queryParams.op" placeholder="请输入放行提示" @keyup.enter.native="handleQuery" clearable />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="放行类型" prop="one">
              <el-select v-model="queryParams.one" placeholder="请选择" clearable>
                <el-option value="0" label="一次性放行不通过"></el-option>
                <el-option value="1" label="一次性放行"></el-option>
                <el-option value="2" label="人工抬杆放行"></el-option>
                <el-option value="3" label="补采放行"></el-option>
                <el-option value="4" label="补采不放行"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="电子车牌" prop="eri">
              <el-input v-model="queryParams.eri" placeholder="请输入车牌号" @keyup.enter.native="handleQuery" clearable />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="采集时间">
              <el-date-picker v-model="$parent.dateRange" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </div>
    <div class="mfooter">
      <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
      <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
    </div>
  </div>
</template>

<script>
export default {
  name: 'search',
  components: {},
  props: {
    param: {
      type: Object,
      default: () => {
        return {};
      }
    },
    layerid: {
      type: String
    }
  },
  data() {
    return {
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        placeId: null,
        channelId: null,
        carNo: null,
        state: null,
        deptId: null,
        type: null,
        boxF: null,
        boxB: null,
        op: null,
        eri: null,
        one: null,
        orderByColumn: 'id',
        isAsc: 'desc'
      }
    };
  },
  mounted() {
    this.queryParams = this.param;
  },
  methods: {
    handleQuery() {
      this.$layer.close(this.layerid);
      this.$parent.queryParams = this.queryParams;
      this.$parent.handleQuery();
    },
    resetQuery() {
      this.resetForm('queryForm');
    }
  }
};
</script>
