<template>
  <div class="table-page-search-wrapper">
    <!-- 搜索区域 -->
    <a-form layout="inline" :form="queryParam" ref="form" @keyup.enter.native="searchQuery">
      <a-row :gutter="24">
        <a-col :md="4" :sm="24">
          <a-form-item label="盘点状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
            <a-select placeholder="请选择盘点状态" showSearch :options="taskStatusList" v-model="queryParam.taskStatus">
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :md="5" :sm="24">
          <a-form-item label="盘点单号" :labelCol="labelCol" :wrapperCol="wrapperCol">
            <a-input placeholder="请输入条码、名称" v-model="queryParam.number"></a-input>
          </a-form-item>
        </a-col>
        <a-col :md="5" :sm="24">
          <a-form-item label="盘点仓库" :labelCol="labelCol" :wrapperCol="wrapperCol">
            <a-select placeholder="请选择盘点仓库" showSearch :options="deoptData" v-model="queryParam.depotId">
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :md="4" :sm="24">
          <a-form-item label="创建人" :labelCol="labelCol" :wrapperCol="wrapperCol">
            <a-select placeholder="请选择创建人" showSearch :options="spinnerList" v-model="queryParam.createBy">
            </a-select>
          </a-form-item>
        </a-col>
        <!-- <a-col :md="6" :sm="24">
          <a-form-item label="商品类别" :labelCol="labelCol" :wrapperCol="wrapperCol">
            <a-select placeholder="请选择商品类别" showSearch optionFilterProp="children" v-model="queryParam.organId">
              <a-select-option v-for="(item, index) in statusList" :key="index" :value="item.id">
                {{ item.supplier }}
              </a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :md="6" :sm="24">
          <a-form-item label="商品信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
            <a-input placeholder="请输入商品信息" v-model="queryParam.number"></a-input>
          </a-form-item>
        </a-col> -->
        <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
          <a-col :md="6" :sm="24">
            <a-button type="primary" @click="onSearch">查询</a-button>
            <a-button style="margin-left: 8px" @click="onReset">重置</a-button>
          </a-col>
        </span>
      </a-row>
    </a-form>
  </div>
</template>

<script>
export default {
  props: {
    queryParam: {
      type: Object,
      default: () => {},
    },
    spinnerList: {
      type: Array,
      default: () => [],
    },
    deoptData: {
      type: Array,
      default: () => [],
    },
  },
  data() {
    return {
      labelCol: {
        xs: { span: 24 },
        sm: { span: 8 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 16 },
      },
      taskStatusList: [
        { value: 1, label: '未开始' },
        { value: 2, label: '进行中' },
        { value: 3, label: '已完成' },
        { value: 4, label: '已取消' },
      ],
    }
  },
  methods: {
    onSearch() {
      this.$emit('search')
    },
    onReset() {
      this.$emit('reset')
    },
  },
}
</script>

<style></style>
