领料打印调整

yangwl
guoshuang 3 months ago
parent 0cbc9f5e85
commit ad5f2dae9f

@ -226,14 +226,14 @@
<el-dialog <el-dialog
title="备料信息" title="备料信息"
:visible.sync="printDialogVisible" :visible.sync="printDialogVisible"
:width="shengchan?'821px':'721px'" :width="shengchan?'731px':'721px'"
> >
<div id="printFrom" class="my-print-box"> <div id="printFrom" class="my-print-box">
<el-form :model="form"> <el-form :model="form">
<!-- 表头-工单信息 --> <!-- 表头-工单信息 -->
<div class="my-print-barcode" :width="shengchan?'821px':'721px'"> <div class="my-print-barcode" :width="shengchan?'731px':'721px'">
<svg id="barcode"></svg> <svg id="barcode"></svg>
</div> </div>
<el-row> <el-row>
@ -256,21 +256,21 @@
<div v-for="(item,index) in printData.workTable" :key="index"> <div v-for="(item,index) in printData.workTable" :key="index">
<el-table <el-table
v-if="refreshNewWorkerTable" v-loading="newWorkerLoading" class="my-print-table" :data="item" v-if="refreshNewWorkerTable" v-loading="newWorkerLoading" class="my-print-table" :data="item"
border style="width: 100%"> border style="width: 100%;">
<el-table-column label="序号" width="40"> <el-table-column label="序号" width="40">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- scope.$index 是当前行的索引 0 开始 1 后乘以 2 --> <!-- scope.$index 是当前行的索引 0 开始 1 后乘以 2 -->
{{ (scope.$index + 1) + fenyeNumber* index}} {{ (scope.$index + 1) + (index==0?fenyeNumber* index:fenyeNumberTwo* index-2) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="materialCode" label="料号" width="120" :formatter="productCodeFormate"></el-table-column> <el-table-column prop="materialCode" label="料号" :width="shengchan?85:125" :formatter="productCodeFormate"></el-table-column>
<el-table-column prop="materialName" label="物料描述" width="250"></el-table-column> <el-table-column prop="materialName" label="物料描述" :width="shengchan?200:240"></el-table-column>
<el-table-column prop="unit" width="50" label="单位"></el-table-column> <el-table-column prop="unit" width="60" label="单位"></el-table-column>
<el-table-column v-if="showWorkorderCode" prop="workorderCode" width="100" label="生产订单" :formatter="orderCodeFormate"></el-table-column> <el-table-column v-if="showWorkorderCode" prop="workorderCode" width="90" label="生产订单" :formatter="orderCodeFormate"></el-table-column>
<el-table-column prop="quantity" label="请领数量" width="100"></el-table-column> <el-table-column prop="quantity" label="请领数量" width="80"></el-table-column>
<el-table-column prop="routeCode" width="60" label="实发数量"></el-table-column> <el-table-column prop="routeCode" width="60" label="实发数量"></el-table-column>
<el-table-column prop="routeCode" width="60" label="实发数量2"></el-table-column> <el-table-column prop="routeCode" width="75" label="实发数量2"></el-table-column>
</el-table> </el-table>
<div class="fy" v-if="index!=printData.workTable.length-1"></div> <div class="fy" v-if="index!=printData.workTable.length-1"></div>
@ -310,7 +310,8 @@ export default {
// components: {Detail}, // components: {Detail},
data() { data() {
return { return {
fenyeNumber:13, fenyeNumber:2,
fenyeNumberTwo:4,
shengchan:true, shengchan:true,
newWorkerLoading: false, newWorkerLoading: false,
refreshNewWorkerTable:true, refreshNewWorkerTable:true,
@ -432,8 +433,10 @@ export default {
targetStyles: ['*'], targetStyles: ['*'],
style: ` style: `
body {margin: 5mm;padding: 0;} body {margin: 3mm;padding: 0;}
.fy{page-break-after: always;} .fy{page-break-after: always;}
table { border-collapse: collapse; } table, th, td { border: 2px solid black; }
.el-table .cell{padding-left:5px;padding-right:5px;}
`, `,
ignoreElements: params.ignore || [], // ['no-print'] ignoreElements: params.ignore || [], // ['no-print']
properties: params.properties || null properties: params.properties || null
@ -463,9 +466,9 @@ export default {
let chunkedArray = []; let chunkedArray = [];
// this.printData.workTable // this.printData.workTable
for (let i = 0; i < this.printData.workTable.length; i += this.fenyeNumber) { for (let i = 0; i < this.printData.workTable.length; i += (i==0?this.fenyeNumber:this.fenyeNumberTwo)) {
// 使slicei1010 // 使slicei1010
let chunk = this.printData.workTable.slice(i, i + this.fenyeNumber); let chunk = this.printData.workTable.slice(i, i + (i==0?this.fenyeNumber:this.fenyeNumberTwo));
// chunkedArray // chunkedArray
chunkedArray.push(chunk); chunkedArray.push(chunk);
} }
@ -506,9 +509,9 @@ export default {
let chunkedArray = []; let chunkedArray = [];
// this.printData.workTable // this.printData.workTable
for (let i = 0; i < this.printData.workTable.length; i += this.fenyeNumber) { for (let i = 0; i < this.printData.workTable.length; i += (i==0?this.fenyeNumber:this.fenyeNumberTwo)) {
// 使slicei1010 // 使slicei1010
let chunk = this.printData.workTable.slice(i, i + this.fenyeNumber); let chunk = this.printData.workTable.slice(i, i + (i==0?this.fenyeNumber:this.fenyeNumberTwo));
// chunkedArray // chunkedArray
chunkedArray.push(chunk); chunkedArray.push(chunk);
} }
@ -653,8 +656,25 @@ export default {
}; };
</script> </script>
<style> <style>
.my-print-table .el-table {
border-collapse: collapse;
border-spacing: 0;
}
.my-print-table .el-table__header-wrapper th {
border: 1px solid black !important;
}
.my-print-table .el-table__body-wrapper td {
border: 1px solid black !important;
}
.my-print-head { .my-print-head {
margin-top: 20px; margin-top: 2px;
font-weight: bold; font-weight: bold;
text-align: center; text-align: center;
} }
@ -666,8 +686,8 @@ export default {
} }
.my-print-nav { .my-print-nav {
margin-top: 15px; margin-top: 10px;
margin-bottom: 15px; margin-bottom: 10px;
} }
.my-print-foot { .my-print-foot {
@ -677,13 +697,12 @@ export default {
body { body {
font-family: 'Arial', sans-serif; /* 设置字体为'Arial'或其他清晰的无衬线字体 */ font-family: 'Arial', sans-serif; /* 设置字体为'Arial'或其他清晰的无衬线字体 */
font-size: 14px; /* 设置字体大小 */ font-size: 14px; /* 设置字体大小 */
-webkit-print-color-adjust: exact;
}
table, th, td {
border: 1px solid black;
border-collapse: collapse;
font-size: 14px; /* 确保表格内字体大小一致 */
} }
.my-print-table .el-table {
border-collapse: collapse; /* 合并表格边框 */
}
} }
.fy{ .fy{
page-break-after: always; page-break-after: always;

Loading…
Cancel
Save