<!-- 搜索表单 -->
<template>
  <seekPage :seekList="seekList" :formLength="3" @search="search"></seekPage>
</template>
<script>
export default {
  data() {
    return {
      auditStatus: [
        {
          label: '待审核',
          value: '0'
        },
        {
          label: '已拒绝',
          value: 2
        },
        {
          label: '已通过',
          value: 1
        },
        {
          label: '已撤回',
          value: 3
        }
      ]
    };
  },
  props: {
    levelList: {
      type: Array,
      default: () => []
    }
  },
  computed: {
    // 表格列配置
    seekList() {
      return [
        {
          label: '关键字：',
          value: 'searchName',
          type: 'input',
          placeholder: '客户名称/客户编码/编码/报修编码'
        },
        {
          label: '客户名称：',
          value: 'contactName',
          type: 'input',
          placeholder: ''
        },
        {
          label: '编码：',
          value: 'code',
          type: 'input',
          placeholder: ''
        },
        {
          label: '客户编码：',
          value: 'contactCode',
          width: 380,
          type: 'input',
          placeholder: ''
        },
        {
          label: '创建人：',
          value: 'createUserName',
          width: 380,
          type: 'input',
          placeholder: ''
        },
        {
          label: '报修编码：',
          value: 'code',
          width: 380,
          type: 'input',
          placeholder: ''
        },
        {
          label: '故障等级：',
          value: 'faultLevel',
          width: 380,
          type: 'select',
          planList: this.levelList,
          placeholder: ''
        },
        {
          label: '状态：',
          value: 'demandStatus',
          width: 380,
          type: 'select',
          planList: this.auditStatus,
          placeholder: ''
        },
      ];
    }
  },
  methods: {
    /* 搜索 */
    search(e) {
      this.$emit('search', {
        ...e
      });
    }
  }
};
</script>
