<template>
  <div id="search-1">
    <el-row>
      <el-col :span="24" class="main">
        <el-form :model="form" ref="form" label-width="130px">
          <el-col :span="6">
            <el-form-item label="订单号" prop="no">
              <el-input v-model="form.no" placeholder="请输入订单号" size="small"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="7">
            <el-form-item label="下单日期" prop="buy_time">
              <el-date-picker
                v-model="form.buy_time"
                type="daterange"
                range-separator="至"
                start-placeholder="开始日期"
                end-placeholder="结束日期"
                value-format="yyyy-MM-dd"
              >
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="24" class="btn">
            <el-button type="primary" icon="el-icon-search" size="mini" @click="onSubmit('form')">搜索</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="toReset('form')">重置</el-button>
          </el-col>
        </el-form>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import { mapState, createNamespacedHelpers } from 'vuex';
export default {
  name: 'search-1',
  props: { form: { type: Object } },
  components: {},
  data: function () {
    return {};
  },
  created() {},
  methods: {
    onSubmit() {
      this.$emit('onSubmit');
    },
    toReset(formName) {
      this.$refs[formName].resetFields();
      this.$emit('toReset');
    },
  },
  computed: {},
  metaInfo() {
    return { title: this.$route.meta.title };
  },
  watch: {
    test: {
      deep: true,
      immediate: true,
      handler(val) {},
    },
  },
};
</script>

<style lang="less" scoped>
.main {
  .btn {
    text-align: right;
  }
  /deep/.el-form-item {
    float: left;
    width: 100%;
    margin: 0 0 10px 0;
  }
}
</style>
