<template>
  <div id="search-1">
    <el-row>
      <el-col :span="24" class="main">
        <el-col :span="24" class="one">
          <el-form ref="form" :model="form" label-width="140px">
            <el-col :span="24" class="one_2txt">
              <el-col :span="8">
                <el-form-item label="企业名称">
                  <el-input v-model="form.company"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="管辖单位">
                  <el-select v-model="form.tube_company" placeholder="请选择" clearable filterable style="width: 100%">
                    <el-option-group v-for="(item, index) in tube_companyList" :key="index" :label="item.label">
                      <el-option v-for="(ci, cindex) in item.children" :key="`child-${cindex}`" :label="ci.name" :value="ci.id"></el-option>
                    </el-option-group>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="法人姓名">
                  <el-input v-model="form.legal_name"></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="form.legal_card"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="提交时间">
                  <el-date-picker
                    v-model="form['start@submit_date']"
                    placeholder="请选择"
                    value-format="yyyy-MM-dd"
                    format="yyyy-MM-dd"
                    type="date"
                    style="width: 100%"
                  >
                  </el-date-picker>
                </el-form-item>
              </el-col>
              <el-col :span="8">
                <el-form-item label="至">
                  <el-date-picker
                    v-model="form['end@submit_date']"
                    placeholder="请选择"
                    value-format="yyyy-MM-dd"
                    format="yyyy-MM-dd"
                    type="date"
                    style="width: 100%"
                  >
                  </el-date-picker>
                </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="onSubmit()">查询</el-button>
              </el-col>
            </el-col>
          </el-form>
        </el-col>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import { mapState, createNamespacedHelpers } from 'vuex';
export default {
  name: 'search-1',
  props: {
    form: { type: Object },
    tube_companyList: { type: Array },
  },
  components: {},
  data: function () {
    return {};
  },
  created() {},
  methods: {
    onSubmit() {
      this.$emit('onSubmit');
    },
  },
  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_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>
