headerprintDialog.vue
3.87 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
112
113
114
115
116
117
118
119
120
121
<template>
<el-dialog
title="出库单打印"
:visible.sync="visible"
:showheaderprint="showheaderprint"
width="800px"
append-to-body
@close="$emit('update:showheaderprint', false)">
<div ref="print">
<el-header style="height:40px;line-height: 30px">
发货单
</el-header>
<el-aside style="padding-bottom: 5px">发货单号:1</el-aside>
<el-main>
<el-header>
<el-row :gutter="24" style="border-bottom: 1px solid #333">
<el-col :span="8" style="text-align: left;font-size: 13px">{{ parseTime(printDate) }}</el-col>
<el-col :span="8" style="font-size: 24px">出库单</el-col>
<el-col :span="8" style="text-align: right;">二维码图</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="12" style="text-align: left;font-size: 13px">客户名称:</el-col>
<el-col :span="12" style="text-align: right;font-size: 13px;">
<span>明细条数:1</span>
<span style="padding-left: 20px">明细总数:100</span>
<el-button size="mini"
type="info" plain
icon="el-icon-printer"
@click="print"
class="no-print">打印</el-button>
</el-col>
</el-row>
</el-header>
<el-table :data="DetailList" border :cell-style="tableCellStyle" :header-cell-style="tableHeaderCellStyle">
<el-table-column prop="materialCode" label="物料编码"></el-table-column>
<el-table-column prop="materialName" label="物料名称"></el-table-column>
<el-table-column prop="batch" label="批次"></el-table-column>
<el-table-column prop="lot" label="批号"></el-table-column>
<el-table-column prop="projectNo" label="项目号"></el-table-column>
<el-table-column prop="shipQty" label="数量"></el-table-column>
<el-table-column prop="materialCodepic" label="条码"></el-table-column>
</el-table>
</el-main>
</div>
</el-dialog>
</template>
<script>
export default {
props: {
showheaderprint: {
type: Boolean,
default: false
},
printlist: {
type: Array,
},
},
data() {
return {
// DetailList:[
// {materialCode:'10302400695',materialName:'绘图纸,A0/880MM*50M/80G',batch:'',lot:'',projectNo:'',shipQty:'100',materialCodepic:'二维码',},
// {materialCode:'10302400695',materialName:'不锈钢挂钩,A0/880MM*50M/80G',batch:'',lot:'',projectNo:'',shipQty:'100',materialCodepic:'二维码',}
// ],
printDate: new Date(),
visible: this.showheaderprint,
DetailList: this.printlist,
};
},
watch: {
showheaderprint() {
this.visible = this.showheaderprint;
},
printlist() {
this.DetailList = this.printlist;
}
},
methods: {
print() {
this.$print(this.$refs.print);
},
// 修改 table cell边框的背景色...
tableCellStyle () {
return 'border-color: #868686;'
},
// 修改 table header cell的背景色、边框背景色...
tableHeaderCellStyle () {
return 'border-color: #868686; color: #606266; background:#fff;font-size:14px'
},
},
};
</script>
<style lang="scss" scoped>
.el-header {
color: #333;
text-align: center;
line-height: 60px;
font-size: 16px;
}
.el-main{
padding: 0;
border: 1px solid #333;
}
aside{padding:5px 0px;line-height:21px;background: none;margin-bottom: 0px; font-size: 13px}
.el-table--border, .el-table--group {
border-top: 1px solid #333;
}
.no-print {
margin-top: 15px;
margin-left: 10px
}
.ad-sheet {
font-size: 22px;
}
</style>