打印页面问题优化
This commit is contained in:
parent
ada12001a0
commit
d2067df999
|
|
@ -470,8 +470,8 @@
|
|||
</el-dialog>
|
||||
|
||||
<!-- 入库单弹窗 -->
|
||||
<el-dialog :visible.sync="openPrint" width="80%" append-to-body>
|
||||
<div>
|
||||
<el-dialog :visible.sync="openPrint" append-to-body>
|
||||
<div id="print-content" style="max-width: 210mm">
|
||||
<vue-easy-print
|
||||
tableShow
|
||||
ref="remarksPrintRef"
|
||||
|
|
@ -535,7 +535,7 @@
|
|||
<span>车辆信息:</span>
|
||||
</div> -->
|
||||
</div>
|
||||
<el-table :data="printTableData" class="table">
|
||||
<el-table :data="printTableData" style="max-width: 210mm">
|
||||
<!-- <el-table-column type="selection" width="55" align="center" />-->
|
||||
<el-table-column
|
||||
label="序号"
|
||||
|
|
@ -930,7 +930,18 @@ export default {
|
|||
},
|
||||
//打印
|
||||
print() {
|
||||
this.$refs.remarksPrintRef.print()
|
||||
const printContent = document.querySelector('#print-content')
|
||||
|
||||
// 动态调整打印内容样式
|
||||
printContent.style.width = '100%'
|
||||
this.$refs.remarksPrintRef.print({
|
||||
content: '#print-content',
|
||||
options: {
|
||||
pageSize: 'A4',
|
||||
orientation: 'portrait',
|
||||
// margins: { top: 10, right: 10, bottom: 10, left: 10 },
|
||||
},
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
|
|
@ -996,4 +1007,17 @@ export default {
|
|||
width: 60px !important;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
@media print {
|
||||
#print-content {
|
||||
width: 100%; /* 确保打印内容宽度为 100% */
|
||||
max-width: 210mm; /* 纸张宽度(A4) */
|
||||
margin: auto; /* 居中对齐 */
|
||||
}
|
||||
|
||||
@page {
|
||||
size: A4; /* 设置纸张大小 */
|
||||
margin: 20mm; /* 页面边距 */
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -42,11 +42,11 @@ module.exports = {
|
|||
// target: `https://test-cc.zhgkxt.com`,//线上环境-南网
|
||||
// target: `https://z.csgmall.com.cn`,
|
||||
|
||||
target: `http://192.168.2.160:39080`, //超
|
||||
// target: `http://192.168.2.160:39080`, //超
|
||||
// target: `http://10.40.92.81:8080`, //韩/
|
||||
// target: `http://10.40.92.74:8080`,//旭/
|
||||
// target: `http://10.40.92.138:28080`, //帅
|
||||
// target: `http://192.168.2.216:39080`, //福
|
||||
target: `http://192.168.2.218:39080`, //福
|
||||
// target: `http://192.168.2.120:39080`, //跃
|
||||
|
||||
//******** 注意事项 ********* */
|
||||
|
|
|
|||
Reference in New Issue