333
schangxiang@126.com
2025-09-19 18966e02fb573c7e2bb0c6426ed792b38b910940
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<template>
  <div class="print-container">
    <template v-for="(row) in tableData">
      <template v-for="i in row.productStorage">
        <div :key="i">
          <barcode :value="row.productModel">
          </barcode>
          <div class="print-page"></div>
        </div>
      </template>
    </template>
 
    <el-button type="primary" @click="print">打印</el-button>
  </div>
 
</template>
 
<script>
import VueBarcode from "@xkeshi/vue-barcode";
 
export default {
  name: "position-group-print-barcode",
  components: {
    barcode: VueBarcode
  },
  data() {
    return {
      tableData: []
    };
  },
  computed: {},
  created() {
    this.tableData = JSON.parse(localStorage.getItem("tableData") || "[]");
  },
  methods: {
    print() {
      window.print();
    }
  }
};
</script>
 
<style lang="scss" scoped>
.print-container {
  padding: 20px;
  .print-page {
    page-break-after: always;
    margin-top: 20px;
  }
}
</style>