<template>
  <div style="width:99.3%; height: 99.5%; background-color: #d7dee6; padding: 5px; border: 2px solid #9e9b9b">
    <el-row style="height: 87%; width: 99%; margin-top: 10px">
      <el-table
        :data="tableData"
        :header-cell-style="{background:'#eef1f6',color:'#606266'}"
        border
        height="830px"
        style="width: 100%; border: 1px solid #9e9b9b"
        tooltip-effect="dark"
      >
        <el-table-column type="index" width="60" label="序号" align="center" />
        <el-table-column align="center" label="订单号">
          <template slot-scope="scope">
            {{ scope.row.订单号 }}
          </template>
        </el-table-column>
        <el-table-column align="center" label="产品型号">
          <template slot-scope="scope">
            {{ scope.row.发动机型号 }}
          </template>
        </el-table-column>
        <el-table-column align="center" label="产品编号">
          <template slot-scope="scope">
            {{ scope.row.发动机号 }}
          </template>
        </el-table-column>
        <!--        <el-table-column align="center" label="工位号">-->
        <!--          <template slot-scope="scope">-->
        <!--            {{ scope.row.工位号 }}-->
        <!--          </template>-->
        <!--        </el-table-column>-->
        <!--        <el-table-column align="center" label="工位名称">-->
        <!--          <template slot-scope="scope">-->
        <!--            {{ scope.row.工序名称 }}-->
        <!--          </template>-->
        <!--        </el-table-column>-->
        <el-table-column align="center" label="数量" width="70">
          <template slot-scope="scope">
            {{ scope.row.零件数量 }}
          </template>
        </el-table-column>
        <el-table-column align="center" label="零件名称">
          <template slot-scope="scope">
            {{ scope.row.零件名称 }}
          </template>
        </el-table-column>
        <!--        <el-table-column align="center" label="零件图号">-->
        <!--          <template slot-scope="scope">-->
        <!--            {{ scope.row.零件图号 }}-->
        <!--          </template>-->
        <!--        </el-table-column>-->
        <el-table-column align="center" label="物料号">
          <template slot-scope="scope">
            {{ scope.row.物料号 }}
          </template>
        </el-table-column>
        <!--        <el-table-column align="center" label="生产厂家">-->
        <!--          <template slot-scope="scope">-->
        <!--            {{ scope.row.生产厂家 }}-->
        <!--          </template>-->
        <!--        </el-table-column>-->
        <el-table-column align="center" label="物料条码">
          <template slot-scope="scope">
            {{ scope.row.物料条码 }}
          </template>
        </el-table-column>
        <el-table-column align="center" label="批次条码">
          <template slot-scope="scope">
            {{ scope.row.物料条码批次 }}
          </template>
        </el-table-column>
        <el-table-column align="center" label="操作时间" width="140">
          <template slot-scope="scope">
            {{ scope.row.操作时间 }}
          </template>
        </el-table-column>
      </el-table>
    </el-row>
    <!--    <div class="block" style="margin-top: 10px;margin-left: 20px">-->
    <!--      <el-pagination-->
    <!--        v-if="!loading"-->
    <!--        :current-page="pageCurrent"-->
    <!--        :page-sizes="[15, 30, 40]"-->
    <!--        :page-size="pageSize"-->
    <!--        :total="total"-->
    <!--        layout="total, sizes, prev, pager, next, jumper"-->
    <!--        @size-change="handleSizeChange"-->
    <!--        @current-change="handleCurrentChange"-->
    <!--      />-->
    <!--    </div>-->
  </div>
</template>
<script>
export default {
  name: 'MaterialPull',
  data() {
    return {
      tableData: [],
      engineTypeValue_check: 0,
      engineTypeValue: '',
      assemblyNumberValue_check: 0,
      assemblyNumberValue: '',
      stationNumberValue_check: 1,
      partNameValue_check: 0,
      partNameValue: '',
      traceabilityCode_check: 0,
      traceabilityCode: '',
      batchBarcodeValue_check: 0,
      batchBarcodeValue: '',
      pageCurrent: 1,
      pageSize: 30,
      loading: false,
      stationNumberValue: '',
      dateTime: '',
      total: 0,
      stationArr: []
    }
  },
  created() {
    this.selectDate()
  },
  methods: {
    // 确定编辑
    getStation() {
      this.stationArr = []
      const Data = this.CreateData('11', '工位与名称_视图_查询')
      this.ExecDatabase(Data).then(response => {
        for (let i = 0; i < response.data.length; i++) {
          this.stationArr.push({
            label: response.data[i].工位号,
            value: response.data[i].工位号
          })
        }
      })
    },
    selectDate() {
      this.tableData = []
      var param = []
      param[0] = ['工位号', this.$store.state.station.stationNumber]
      param[1] = ['查询工位号', this.$store.state.station.stationNumber]
      var Data = this.CreateData('11', '显示物料数据_工位数据_查询', param)
      this.ExecDatabase(Data).then(response => {
        if (response.data.length !== 0) {
          this.tableData = response.data
        }
        this.loading = false
      })
    },
    handleSizeChange(val) {
      this.pageCurrent = 1
      this.pageSize = val
      this.selectDate()
    },
    handleCurrentChange(val) {
      this.pageCurrent = val
      this.selectDate()
    }
  }
}
</script>

<style scoped>

::v-deep .el-table--striped .el-table__body tr.el-table__row--striped td {
  background-color: #cedcf3;
}

::v-deep.el-table th.el-table__cell > .cell {
  font-size: 18px;
  color: #2f2f2f;
}

::v-deep.qualityDataDialog .el-table th.el-table__cell > .cell {
  font-size: 18px;
  color: #2f2f2f;
}

</style>
