<template>
  <div>
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
      <el-form-item label="关键字" prop="soNo">
        <el-input v-model="queryParams.soNo" style="width: 18rem" placeholder="请输入单号、备注"/>
      </el-form-item>
      <el-form-item label="日期" prop="searchTimeArray">
        <el-date-picker
          v-model="queryParams.searchTimeArray"
          type="daterange"
          range-separator="至"
          start-placeholder="开始日期"
          end-placeholder="结束日期">
        </el-date-picker>
      </el-form-item>
      <el-form-item v-if="TicketType === 'tp'"  label="服务顾问" prop="userId">
        <StaffChoose />
      </el-form-item>
      <el-form-item v-if="!(TicketType === 'tv')" label="维修类别" prop="userId">
        <StaffChoose />
      </el-form-item>
      <el-form-item label="门店" prop="userId">
        <SupplierChoose />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" >搜索</el-button>
        <el-button icon="el-icon-refresh" >重置</el-button>
      </el-form-item>
    </el-form>
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5" v-if="!(TicketType === 'tv')">
        <el-button type="primary" plain icon="el-icon-download" size="mini"
        >导出
        </el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch"></right-toolbar>
    </el-row>
    <TicketTable :ticket-type="TicketType"/>
    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
    />
  </div>
</template>

<script>
import StaffChoose from "@/views/repair/Components/StaffChoose.vue";
import SupplierChoose from "@/views/repair/Components/SupplierChoose.vue";
import TicketTable from "@/views/repair/tickets/Components/TicketTable.vue";

export default {
  name: "TicketSearch",
  components: {
    TicketTable,
    StaffChoose,
    SupplierChoose
  },
  props:{
    TicketType:{
      type: String,
      defaultValue: 'tp',
      required: true
    }
  },
  data() {
    return {
      queryParams:{},
      showSearch: true,
      total: 0,
    }
  },
  methods: {}
}
</script>

<style scoped lang="scss">

</style>
