printDialog.vue 2.84 KB
<template>
  <el-dialog
    title="调整单打印"
    :visible.sync="visible"
    :showprint="showprint"
    width="800px"
    append-to-body
    @close="$emit('update:showprint', false)"
  >
    <div ref="print">
      <el-row>
        <el-col :span="10"
          ><div>{{ parseTime(printDate) }}</div></el-col
        >
        <el-col :span="4"><div class="ad-sheet">调整单</div></el-col>
        <el-col :span="10">
          <div class="pull-right">
            <barcode
              text="AD2020102300005"
              width="1"
              height="70"
              fontSize="12"
              marginTop="-30"
              format="code128"
            ></barcode>
          </div>
        </el-col>
      </el-row>
      <el-row class="no-print">
        <el-button
          size="mini"
          type="primary"
          icon="el-icon-printer"
          @click="print"
          class="pull-right"
          >打印</el-button
        >
      </el-row>

      <el-divider></el-divider>

      <el-table :data="detailList">
        <el-table-column label="容器" align="left" prop="companyCode" />
        <el-table-column label="明细id" align="left" prop="locationCode" />
        <el-table-column label="物料编码" align="left" prop="materialCode" />
        <el-table-column label="物料名称" align="left" prop="materialName" />
        <el-table-column label="系统数" align="left" prop="materialName" />
        <el-table-column label="实际数" align="left" prop="qty" />
        <el-table-column label="差异数" align="left" prop="materialUnit" />
        <el-table-column label="调整数" align="left" prop="materialUnit" />
        <el-table-column label="条码" align="left" prop="materialUnit">
        <!-- <qrcode-vue
                    :value="
                      item.materialCode +
                      '/' +
                      item.materialName +
                      '//' +
                      item.totalQty
                    "
                    size="60"
                    level="H"
                    renderAs="svg"
                    style="padding-top: 4px"
                  ></qrcode-vue> -->
                  </el-table-column>
      </el-table>
    </div>
  </el-dialog>
</template>

<script>
export default {
  props: {
    showprint: {
      type: Boolean,
      default: false,
    },
    printlist: {
      type: Array,
    },
  },
  data() {
    return {
      printDate: new Date(),
      visible: this.showprint,
      detailList: this.printlist,
    };
  },
  watch: {
    showprint() {
      this.visible = this.showprint;
    },
    printlist() {
      this.detailList = this.printlist;
    },
  },

  methods: {
    print() {
      this.$print(this.$refs.print);
    },
  },
};
</script>

<style lang="scss" scoped>
.no-print {
  margin-top: 15px;
}
.ad-sheet {
  font-size: 22px;
  text-align: center;
}
</style>