<!-- 搜索表单 -->
<template>
  <seekPage :seekList="seekList" :formLength="3" @search="search"></seekPage>
</template>
<script>
  export default {

    data() {
      return {
        stateList: [
          {
            label: '待派单',
            value: '0'
          },
          {
            label: '已派单',
            value: 1
          },
          {
            label: '执行中',
            value: 2
          },
          {
            label: '已完成',
            value: 3
          },
          {
            label: '已撤回',
            value: 4
          },
          {
            label: '已驳回',
            value: 5
          }
        ],
        exigencyList: [
          {
            label: '普通',
            value: 1
          },
          {
            label: '紧急',
            value: 2
          },
          {
            label: '重要',
            value: 3
          }
        ]
      };
    },
    props: {},
    computed: {
      // 表格列配置
      seekList() {
        return [
          {
            label: '关键字：',
            value: 'keyWord',
            type: 'input',
            placeholder: '计划单号/计划名称/设备名称'
          },
          {
            label: '计划单号:',
            value: 'code',
            type: 'input',
            placeholder: ''
          },
          {
            label: '计划名称:',
            value: 'name',
            type: 'input',
            placeholder: ''
          },
          {
            label: '客户名称:',
            width: 380,
            value: 'contactName',
            type: 'input',
            placeholder: ''
          },
          {
            label: '设备名称:',
            width: 380,
            value: 'deviceName',
            type: 'input',
            placeholder: ''
          },
          {
            label: '状态:',
            width: 380,
            value: 'planStatus',
            type: 'select',
            planList: this.stateList,
            placeholder: ''
          },
          {
            label: '紧急状态：',
            width: 380,
            value: 'urgent',
            type: 'select',
            planList: this.exigencyList,
            placeholder: ''
          },
          {
            label: '创建人：',
            width: 380,
            value: 'createUserName',
            type: 'input',
            placeholder: ''
          },
          {
            label: '创建时间：',
            value: 'createTime',
            type: 'date',
            dateType: 'datetimerange',
            placeholder: '',
            width: 380,
            valueAr: ['startTime', 'endTime']
          }
        ];
      }
    },
    methods: {
      /* 搜索 */
      search(e) {
        this.$emit('search', {
          ...e
        });
      }
    }
  };
</script>
