<!-- 搜索表单 -->
<template>
  <seekPage :seekList="seekList" :formLength="3" @search="search"></seekPage>
</template>
<script>
export default {
  data() {
    return {};
  },
  props: {
    user: {
      type: 'String',
      default: ''
    }
  },
  computed: {
    // 表格列配置
    seekList() {
      return [
        {
          label: '关键字：',
          value: 'searchName',
          type: 'input',
          placeholder: '编码/物品名称/客户名称/设备名称'
        },
        {
          label: '编码:',
          value: 'code',
          type: 'input',
          placeholder: ''
        },
        {
          label: '工单编码:',
          value: 'workCode',
          type: 'input',
          placeholder: ''
        },
        {
          label: '物品名称:',
          value: 'categoryName',
          width: 380,
          type: 'input',
          placeholder: ''
        },
        {
          label: this.user == 'recycleName' ? '回收人' : '领用人',
          value: this.user == 'recycleName' ? 'recycleName' : 'recipientName',
          width: 380,
          type: 'input',
          placeholder: ''
        },
        {
          label: '客户名称:',
          value: 'contactName',
          width: 380,
          type: 'input',
          placeholder: ''
        },
        {
          label: '设备名称:',
          value: 'deviceName',
          width: 380,
          type: 'input',
          placeholder: ''
        },
        {
          label: '物品分类:',
          value: 'categoryLevelName',
          width: 380,
          type: 'input',
          placeholder: ''
        },
        {
          label: '物品名称:',
          value: 'categoryName',
          width: 380,
          type: 'input',
          placeholder: ''
        },
        {
          label: '领用部门:',
          value: 'receivingDeptName',
          width: 380,
          type: 'input',
          placeholder: ''
        },
        {
          label: '创建时间：',
          value: 'createTime',
          type: 'date',
          dateType: 'datetimerange',
          placeholder: '',
          width: 380,
          valueAr: ['createTimeStart', 'createTimeEnd']
        },
      ];
    }
  },
  methods: {
    /* 搜索 */
    search(e) {
      this.$emit('search', {
        ...e
      });
    }
  }
};
</script>
