From ad5f2dae9f046fdeea835f6924d7524d83ca0e74 Mon Sep 17 00:00:00 2001 From: guoshuang Date: Tue, 27 Aug 2024 14:41:51 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=86=E6=96=99=E6=89=93=E5=8D=B0=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/mes/prepare/index.vue | 73 +++++++++++++++++++++------------ 1 file changed, 46 insertions(+), 27 deletions(-) diff --git a/src/views/mes/prepare/index.vue b/src/views/mes/prepare/index.vue index eb520ff..5a9e31c 100644 --- a/src/views/mes/prepare/index.vue +++ b/src/views/mes/prepare/index.vue @@ -226,14 +226,14 @@
-
+
@@ -256,22 +256,22 @@
+ border style="width: 100%;"> - - - - - + + + + + - - + +
@@ -310,7 +310,8 @@ export default { // components: {Detail}, data() { return { - fenyeNumber:13, + fenyeNumber:2, + fenyeNumberTwo:4, shengchan:true, newWorkerLoading: false, refreshNewWorkerTable:true, @@ -431,9 +432,11 @@ export default { header: params.header, // '表单', targetStyles: ['*'], style: ` - - body {margin: 5mm;padding: 0;} + + body {margin: 3mm;padding: 0;} .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'] properties: params.properties || null @@ -463,9 +466,9 @@ export default { let chunkedArray = []; // 遍历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)) { // 使用slice方法从当前索引i开始切割,切割长度为10(如果剩余元素少于10,则切割剩余所有元素) - 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.push(chunk); } @@ -506,9 +509,9 @@ export default { let chunkedArray = []; // 遍历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)) { // 使用slice方法从当前索引i开始切割,切割长度为10(如果剩余元素少于10,则切割剩余所有元素) - 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.push(chunk); } @@ -653,8 +656,25 @@ export default { };