printDialog.vue
2.7 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<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="detailList.length>0?detailList[0].adjustCode:''"
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="containerCode" />
<el-table-column label="明细id" align="left" prop="id" />
<el-table-column label="物料编码" align="left" prop="materialCode" />
<el-table-column label="物料名称" align="left" prop="materialName" />
<el-table-column label="调整前数量" align="left" prop="fromQty" />
<el-table-column label="调整后数量" align="left" prop="toQty" />
<el-table-column label="调整数量" align="left" prop="gapQty" />
<el-table-column label="二维码" align="left">
<template slot-scope="scope">
<qrcode-vue
:value="scope.row.materialCode + '/' + scope.row.materialName + '//' + scope.row.toQty"
size="60"
level="H"
renderAs="svg"
style="margin-top: 5px"
></qrcode-vue>
</template>
</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(newValue) {
this.detailList = newValue;
},
},
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>