<template>
  <div>
    <el-tabs v-model="activeName" type="border-card">
      <el-tab-pane label="按零件号查询" name="first">
        <el-form :model="search" inline>
          <el-form-item label="开始时间">
            <el-date-picker v-model="value2" type="datetime" placeholder="开始时间" :picker-options="pickerOptions"> </el-date-picker>
          </el-form-item>
          <el-form-item label="结束时间">
            <el-date-picker v-model="value2" type="datetime" placeholder="结束时间" :picker-options="pickerOptions"> </el-date-picker>
          </el-form-item>
          <el-form-item label="零件号">
            <el-input v-model="search.partNumber" placeholder="请输入零件号"></el-input>
          </el-form-item>
          <el-form-item label="班次">
            <el-radio-group v-model="radio1">
              <el-radio-button label="A班"></el-radio-button>
              <el-radio-button label="B班"></el-radio-button>
            </el-radio-group>
          </el-form-item>
          <el-button type="primary" icon="el-icon-search" @click="getList">搜索</el-button>
          <el-button type="warning" size="mini" @click="download_workorder">导出EXCEL</el-button>
        </el-form>
        <vxe-table border resizable show-overflow ref="xTable" v-loading="loading_1" height="800" :data="tableData">
          <vxe-colgroup title="订单信息">
            <vxe-column type="seq" width="60"></vxe-column>
            <vxe-column field="name" title="订单"></vxe-column>
            <vxe-column field="name" title="物料号"></vxe-column>
            <vxe-column field="name" title="描述"></vxe-column>
            <vxe-column field="name" title="订单数量"></vxe-column>
            <vxe-column field="name" title="班次"></vxe-column>
            <vxe-column field="name" title="合格数"></vxe-column>
            <vxe-column field="name" title="合格率"></vxe-column>
            <vxe-column field="name" title="抛光"></vxe-column>
            <vxe-column field="name" title="打磨"></vxe-column>
            <vxe-column field="name" title="报废"></vxe-column>
            <vxe-column field="name" title="开始时间"></vxe-column>
            <vxe-column field="name" title="结束时间"></vxe-column>
          </vxe-colgroup>


          
        </vxe-table>
        <pagination
          v-show="pagination.total > 0"
          :total="pagination.total"
          :page.sync="pagination.pageNum"
          :limit.sync="pagination.pageSize"
          @pagination="getList"
        />
      </el-tab-pane>
      <el-tab-pane label="按工单查询" name="second">
        <el-form :model="search" inline>
          <el-form-item label="工单号">
            <el-input v-model="search.partNumber" placeholder="请输入工单号"></el-input>
          </el-form-item>
          <el-form-item label="班次">
            <el-radio-group v-model="radio1">
              <el-radio-button label="A班"></el-radio-button>
              <el-radio-button label="B班"></el-radio-button>
            </el-radio-group>
          </el-form-item>
          <el-button type="primary" icon="el-icon-search" @click="getList">搜索</el-button>
          <el-button type="warning" size="mini" @click="download_workorder">导出EXCEL</el-button>
        </el-form>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
export default {
  name: 'qualityStatistics',
  data() {
    return {
      activeName: 'first',
      search: {},
      pickerOptions: {
        shortcuts: [
          {
            text: '今天',
            onClick(picker) {
              picker.$emit('pick', new Date())
            },
          },
          {
            text: '昨天',
            onClick(picker) {
              const date = new Date()
              date.setTime(date.getTime() - 3600 * 1000 * 24)
              picker.$emit('pick', date)
            },
          },
          {
            text: '一周前',
            onClick(picker) {
              const date = new Date()
              date.setTime(date.getTime() - 3600 * 1000 * 24 * 7)
              picker.$emit('pick', date)
            },
          },
        ],
      },
      loading_1: false,
      pagination: { total: 0, pageNum: 1, pageSize: 10 },
    }
  },
  methods: {},
}
</script>

<style lang="scss" scoped></style>
