<template>
  <div v-show="false" id="packing-label-prinit-template">
    <div v-for="item in printData" :key="item.id" class="print-item">
      <table>
        <colgroup>
          <col width="25">
          <col width="25">
          <col width="25">
        </colgroup>
        <thead>
          <tr height="16">
            <th colspan="2" style="font-size: 12px" />
            <th colspan="4" align="center" style="font-size: 12px">东旭达集团淮安麦禾田新材料科技有限公司</th>
            <th colspan="2" align="center" valign="center">
              <VueQr
                :text="item.id"
                :binarize="true"
                :size="50"
                :margin="5"
              />
            </th>
          </tr>
        </thead>
        <tbody>
          <tr height="16">
            <td align="right" colspan="2">批次号:</td>
            <td colspan="6">{{ item.boxSn }}</td>
          </tr>
          <tr height="16">
            <td align="right" colspan="2">物料编码:</td>
            <td colspan="6">{{ item.materialNo }}</td>
          </tr>
          <tr height="16">
            <td align="right" colspan="2">物料名称:</td>
            <td colspan="6">{{ item.materialName }}</td>
          </tr>
          <tr height="16">
            <td align="right" colspan="2">装箱数量:</td>
            <td colspan="6">{{ item.boxQty }}</td>
          </tr>
          <tr height="16">
            <td align="right" colspan="2">BOM版本:</td>
            <td colspan="6">{{ item.mesBomVersion }}</td>
          </tr>
          <tr height="16">
            <td align="right" colspan="2">生产日期:</td>
            <td colspan="6">{{ parseTime(item.createTime) }}</td>
          </tr>
          <tr />
        </tbody>
      </table>
    </div>
  </div>
</template>

<script>
import VueQr from 'vue-qr'

export default {
  components: {
    VueQr
  },
  props: {
    printData: {
      type: Array,
      default: () => []
    }
  }
}
</script>

<style scoped>
table {
  width: 600px;
  margin: 0 auto;
  border: 1px solid #000000;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  border: 1px solid #000000;
}
</style>
