|
|
|
@ -16,11 +16,11 @@
|
|
|
|
|
|
|
|
|
|
<el-row class="my-print-foot">
|
|
|
|
|
<el-col :offset="1" :span="10">
|
|
|
|
|
<div>产品名称: {{ printData.factory }}</div><br />
|
|
|
|
|
<div>批次号: {{ printData.factory }}</div><br />
|
|
|
|
|
<div>生产日期: {{ printData.factory }}</div><br />
|
|
|
|
|
<div>板次: {{ printData.factory }}</div><br />
|
|
|
|
|
<div>数量: {{ printData.factory }}</div>
|
|
|
|
|
<div>产品名称: {{ item.productName }}</div><br />
|
|
|
|
|
<div>批次号: {{ item.batchCode }}</div><br />
|
|
|
|
|
<div>生产日期: {{ item.productDateStr }}</div><br />
|
|
|
|
|
<div>板次: {{ item.PalletNo }}</div><br />
|
|
|
|
|
<div>数量: {{ item.batchQuantity }}</div>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :offset="1" :span="10">
|
|
|
|
|
<canvas :id="'qrcode-' + index" class="qrcode"></canvas>
|
|
|
|
@ -89,12 +89,13 @@ export default {
|
|
|
|
|
created() {
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
//this.showPrint();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
init(workorderCode){
|
|
|
|
|
this.workorderCode = workorderCode;
|
|
|
|
|
this.showPrint();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 打印预览-浏览器打印
|
|
|
|
@ -115,13 +116,12 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
// 打印预览-点击打印预览按钮
|
|
|
|
|
async showPrint() {
|
|
|
|
|
console.log('执行了打印预览');
|
|
|
|
|
let response = await getIdCardList(this.workorderCode,this.idCardNum);
|
|
|
|
|
this.printData.idCardList = response.idCards;
|
|
|
|
|
let response = await getIdCardList(this.workorderCode);
|
|
|
|
|
this.printData.idCardList = response;
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
this.printData.idCardList.forEach((item, index) => {
|
|
|
|
|
const canvas = document.getElementById('qrcode-' + index);
|
|
|
|
|
QRCode.toCanvas(canvas, item, { width: 350,margin:1 }, function (error) {
|
|
|
|
|
QRCode.toCanvas(canvas, item.palletCode, { width: 350,margin:1 }, function (error) {
|
|
|
|
|
if (error) console.error(error);
|
|
|
|
|
console.log('success!');
|
|
|
|
|
});
|
|
|
|
|