From e1b1e1d5c378856ea47dc7fd86caa684ed2d3500 Mon Sep 17 00:00:00 2001 From: zhaoxiaolin Date: Wed, 11 Sep 2024 16:13:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E5=8D=B0=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/plan/workorder.js | 7 + src/layout/components/Navbar.vue | 4 +- src/views/mes/prepare/index.vue | 157 ++++++++++------------ src/views/plan/workorder/printID.vue | 17 +++ src/views/quality/produceReport/index.vue | 21 +-- src/views/quality/qcTableDL/index.vue | 14 +- src/views/technology/proroute/index.vue | 2 +- 7 files changed, 127 insertions(+), 95 deletions(-) diff --git a/src/api/plan/workorder.js b/src/api/plan/workorder.js index d1fa835..24729a8 100644 --- a/src/api/plan/workorder.js +++ b/src/api/plan/workorder.js @@ -188,6 +188,13 @@ export function getIdCardList(data){ data:data }) } +export function getIdCardListRefresh(data){ + return request({ + url:'/plan/pro/workorder/getIdCardListRefresh', + method:'post', + data:data + }) +} export function getBatchCode(workorderId){ return request({ diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index a438160..ef12da5 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -313,14 +313,14 @@ export default { setInterval(() => this.getAlarmData(), 1000 * 60); this.poolNameList = JSON.parse(localStorage.getItem("POOL_NAME_LIST")); this.poolName = localStorage.getItem("USER_POOL_NAME_CURRENT"); - /** + //先执行一次 this.getUnReadList(); // 实现轮询 this.timer = setInterval(() => { setTimeout(this.getUnReadList(), 30000); }, 30000); - **/ + }, components: { Breadcrumb, diff --git a/src/views/mes/prepare/index.vue b/src/views/mes/prepare/index.vue index 66fc58c..09ef7df 100644 --- a/src/views/mes/prepare/index.vue +++ b/src/views/mes/prepare/index.vue @@ -226,62 +226,56 @@
+ + + + +
+ +
+
+
- - - -
- 生产订单备料单({{printData.printTitle}}) -
-
- - - 工厂:{{printData.factory}} - 工作中心:{{printData.workCenter}} - 线体:{{printData.prodLineCode}} - -
- -
-
-
- - 生产日期:{{printData.productDate}} - 打印日期:{{printData.printDate}} - 页次: 1/ 1 -
+ + +
+ 生产订单备料单({{printData.printTitle}}) +
+
+ + + 工厂:{{printData.factory}} + 工作中心:{{printData.workCenter}} + 线体:{{printData.prodLineCode}} + + + 生产日期:{{printData.productDate}} + 打印日期:{{printData.printDate}} + 条数: {{printData.pageNo}} + - - - - - - - - + border style="width: 100%;padding-bottom: 1px;"> + + + + + + - - + + -
-
- - - - + + 发料人: 收料人: 白色:车间联 @@ -290,8 +284,10 @@ SAP-No:{{printData.SAPNo}} - Z-PM-F-030-A.2 + Z-PM-F-030-A.2 +
+
@@ -313,8 +309,8 @@ export default { // components: {Detail}, data() { return { - fenyeNumber:4, - fenyeNumberTwo:6, + fenyeNumber:5, + fenyeNumberTwo:7, shengchan:true, newWorkerLoading: false, refreshNewWorkerTable:true, @@ -324,6 +320,7 @@ export default { // 打印 printData: { printable: 'printFrom', + pageNo:1, ignore: ['no-print'], workCenter: "暂无数据", SAPNo: null, @@ -430,17 +427,11 @@ export default { printJS({ printable: params.printable, // 'printFrom', // 标签元素id type: params.type || 'html', - dpi: 300, // 清晰度 + dpi: 360, // 清晰度 //font_size: "",// 设置字体大小 header: params.header, // '表单', targetStyles: ['*'], - style: ` - - 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;} - `, + //没用//style:'body {margin: 2mm;padding: 0;}.fy{page-break-after: always;} table { width:100%;height:800px;border-collapse: collapse;} table, th, td { border: 2px solid black; white-space: pre-wrap; word-break: break-all;} .el-table .cell{padding-left:1px;padding-right:1px;border: 2px solid black;}', ignoreElements: params.ignore || [], // ['no-print'] properties: params.properties || null }) @@ -450,6 +441,7 @@ export default { this.shengchan = true; // 清楚缓存 this.printData.workCenter = "暂无数据"; + this.printData.pageNo =0 ; this.printData.printDate = null; this.printData.workTable = []; this.printData.factory = null; @@ -466,16 +458,17 @@ export default { this.printData.productDate = response.data.mesPrepareDetailList[0].productDate this.printData.printDate = moment(new Date()).format('YYYY-MM-DD') this.printData.workTable = response.data.mesPrepareDetailList; + this.printData.pageNo = response.data.mesPrepareDetailList.length; let chunkedArray = []; -// 遍历this.printData.workTable - 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 + (i==0?this.fenyeNumber:this.fenyeNumberTwo)); - // 将切割后的数组添加到chunkedArray中 - chunkedArray.push(chunk); - } - this.printData.workTable = chunkedArray; + //遍历this.printData.workTable + 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 + (i==0?this.fenyeNumber:this.fenyeNumberTwo)); + // 将切割后的数组添加到chunkedArray中 + chunkedArray.push(chunk); + } + this.printData.workTable = chunkedArray; this.printData.prodLineCode = response.data.mesPrepare.prodLineCode this.refreshNewWorkerTable = true // 立即将refreshProTable设置为true,显示表格 this.newWorkerLoading = false // 设置加载状态为false,表示加载完成 @@ -509,14 +502,17 @@ export default { this.printData.productDate = moment(this.queryParams.productDate).format('YYYY-MM-DD') this.printData.printDate = moment(new Date()).format('YYYY-MM-DD') this.printData.workTable = response.data.mesPrepareDetailList + this.printData.pageNo = response.data.mesPrepareDetailList.length; let chunkedArray = []; -// 遍历this.printData.workTable + // 遍历this.printData.workTable 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 + (i==0?this.fenyeNumber:this.fenyeNumberTwo)); - // 将切割后的数组添加到chunkedArray中 - chunkedArray.push(chunk); + + + // 使用slice方法从当前索引i开始切割,切割长度为10(如果剩余元素少于10,则切割剩余所有元素) + let chunk = this.printData.workTable.slice(i, i + (i==0?this.fenyeNumber:this.fenyeNumberTwo)); + // 将切割后的数组添加到chunkedArray中 + chunkedArray.push(chunk); } this.printData.workTable = chunkedArray; this.refreshNewWorkerTable = true // 立即将refreshProTable设置为true,显示表格 @@ -672,12 +668,8 @@ export default { border: 1px solid black !important; } - - - - .my-print-head { - margin-top: 2px; + margin-top: 5px; font-weight: bold; text-align: center; } @@ -694,18 +686,17 @@ export default { } .my-print-foot { - margin-top: 20px; + margin-top: 10px; } +.my-print-foot0 { + margin-top: -1px; + padding-top:2px; + border-top: 1px solid black; + width: 94%; +} + @media print { - body { - font-family: 'Arial', sans-serif; /* 设置字体为'Arial'或其他清晰的无衬线字体 */ - font-size: 14px; /* 设置字体大小 */ - - } - .my-print-table .el-table { - border-collapse: collapse; /* 合并表格边框 */ -} - + } .fy{ page-break-after: always; diff --git a/src/views/plan/workorder/printID.vue b/src/views/plan/workorder/printID.vue index eee1517..bf1fb1a 100644 --- a/src/views/plan/workorder/printID.vue +++ b/src/views/plan/workorder/printID.vue @@ -3,6 +3,7 @@
+ @@ -31,6 +32,7 @@ + 重置
@@ -85,6 +87,7 @@ import { getIdCardList, getBatchCode, + getIdCardListRefresh } from '@/api/plan/workorder'; import QRCode from 'qrcode'; @@ -198,6 +201,20 @@ export default { }) }, + async refreshCards(){ + let response = await getIdCardListRefresh({workorderCode:this.workorderCode}); + this.printData.idCardList = response; + this.$nextTick(() => { + this.printData.idCardList.forEach((item, index) => { + const canvas = document.getElementById('qrcode-' + index); + QRCode.toCanvas(canvas, item.palletCode, { width: 300 , margin:1 }, function (error) { + if (error) console.error(error); + console.log('success!'); + }); + }); + }) + }, + // 打印预览-增打 async showAddPrint() { console.log('执行了新增打印预览'); diff --git a/src/views/quality/produceReport/index.vue b/src/views/quality/produceReport/index.vue index d3fbd88..011427c 100644 --- a/src/views/quality/produceReport/index.vue +++ b/src/views/quality/produceReport/index.vue @@ -664,12 +664,17 @@ + + + @@ -680,7 +685,7 @@ @@ -912,7 +917,7 @@ export default { delFlag: null, jgy: null, pgy: null, - + cxzz: null }; this.spanArr = []; this.position = 0; diff --git a/src/views/quality/qcTableDL/index.vue b/src/views/quality/qcTableDL/index.vue index 3ca3399..2b223fd 100644 --- a/src/views/quality/qcTableDL/index.vue +++ b/src/views/quality/qcTableDL/index.vue @@ -223,7 +223,9 @@ :visible.sync="open" width="1300px" append-to-body - > + > + + 导出CPK
{ this.getList() this.$modal.msgSuccess('同步成功')