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