<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>
|