From 1d4ccecb62ecb8cdacb28f7f52b7fbc03d63315d Mon Sep 17 00:00:00 2001 From: DouDou <877258667@qq.com> Date: Tue, 18 Jun 2024 09:15:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=A5=E5=B7=A5=E9=83=A8=E5=88=86=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scheduleReport/com_die_cutting_report.js | 4 + src/api/scheduleReport/com_fqc_report.js | 4 + .../modules/label/print_die_cutting_label.js | 34 ++++++++ src/views/modules/label/print_fqc_label.js | 35 +++++++++ .../scheduleReport/com_die_cutting_report.vue | 27 ++++--- .../modules/scheduleReport/com_fqc_report.vue | 78 +++++-------------- .../scheduleReport/com_separate_roll.vue | 8 +- 7 files changed, 118 insertions(+), 72 deletions(-) create mode 100644 src/views/modules/label/print_die_cutting_label.js create mode 100644 src/views/modules/label/print_fqc_label.js diff --git a/src/api/scheduleReport/com_die_cutting_report.js b/src/api/scheduleReport/com_die_cutting_report.js index d4de8b9..1906b12 100644 --- a/src/api/scheduleReport/com_die_cutting_report.js +++ b/src/api/scheduleReport/com_die_cutting_report.js @@ -15,4 +15,8 @@ export const getSoFinalRollsByCon = data => createAPI('schedule/getSoFinalRollsB // 删除成品卷 export const deleteSoFinalRoll = data => createAPI('schedule/deleteSoFinalRoll', 'POST', data) +// 获取模切工站的打印信息 +export const getDieCuttingFinalRollPrintData = data => createAPI('schedule/getDieCuttingFinalRollPrintData', 'POST', data) + + diff --git a/src/api/scheduleReport/com_fqc_report.js b/src/api/scheduleReport/com_fqc_report.js index b896257..020e062 100644 --- a/src/api/scheduleReport/com_fqc_report.js +++ b/src/api/scheduleReport/com_fqc_report.js @@ -12,3 +12,7 @@ export const scanFinalRollNo = data => createAPI('schedule/scanFinalRollNo', 'PO // 取消检验成品卷 export const cancelCheckSoFinalRoll = data => createAPI('schedule/cancelCheckSoFinalRoll', 'POST', data) +// 获取fqc入库的标签 +export const getFqcFinalRollPrintData = data => createAPI('schedule/getFqcFinalRollPrintData', 'POST', data) + + diff --git a/src/views/modules/label/print_die_cutting_label.js b/src/views/modules/label/print_die_cutting_label.js new file mode 100644 index 0000000..42dbae9 --- /dev/null +++ b/src/views/modules/label/print_die_cutting_label.js @@ -0,0 +1,34 @@ +/*调用js打印标签*/ +import getLodop from '@/utils/LodopFuncs.js' +/*打印材料卷标签*/ +export function printDieCuttingLabel(printList) { + const LODOP = getLodop() + if (LODOP) { + //循环调用打印机 + for(let i = 0; i < printList.length; i++){ + let printData = printList[i]; + LODOP.NewPage(); + LODOP.SET_PRINT_PAGESIZE(0,660,570,""); + LODOP.ADD_PRINT_BARCODE(5,5,105,105,"QRCode", printData.rollNo); + LODOP.ADD_PRINT_TEXT(110,10,245,25,"卷号: "+printData.rollNo); + LODOP.SET_PRINT_STYLEA(0,"FontSize",12); + LODOP.ADD_PRINT_TEXT(10,105,140,20,"工单号: "+printData.orderNo); + LODOP.SET_PRINT_STYLEA(0,"FontSize",12); + LODOP.ADD_PRINT_TEXT(35,105,140,20,"料号: "+printData.partNo); + LODOP.SET_PRINT_STYLEA(0,"FontSize",12); + LODOP.ADD_PRINT_TEXT(135,10,245,40,"描述: "+printData.partDesc); + LODOP.SET_PRINT_STYLEA(0,"FontSize",12); + LODOP.ADD_PRINT_TEXT(60,105,140,20,"数量: "+printData.rollQty); + LODOP.SET_PRINT_STYLEA(0,"FontSize",12); + LODOP.ADD_PRINT_TEXT(85,105,140,20,"操作人: admin"+printData.createdBy); + LODOP.SET_PRINT_STYLEA(0,"FontSize",12); + LODOP.ADD_PRINT_TEXT(180,10,250,25,"下机时间: "+printData.createdDate); + LODOP.SET_PRINT_STYLEA(0,"FontSize",12); + } + LODOP.PRINT_DESIGN(); + // LODOP.PREVIEW(); + // LODOP.PRINT(); + console.log("操作成功!") + } +} + diff --git a/src/views/modules/label/print_fqc_label.js b/src/views/modules/label/print_fqc_label.js new file mode 100644 index 0000000..2bb20c9 --- /dev/null +++ b/src/views/modules/label/print_fqc_label.js @@ -0,0 +1,35 @@ +/*调用js打印标签*/ +import getLodop from '@/utils/LodopFuncs.js' +/*打印材料卷标签*/ +export function printFqcLabel(printData) { + const LODOP = getLodop() + if (LODOP) { + //循环调用打印机 + LODOP.NewPage(); + LODOP.SET_PRINT_PAGESIZE(0,800,1250,""); + LODOP.SET_PRINT_MODE("PRINT_NOCOLLATE",1); + LODOP.ADD_PRINT_BARCODE(5,15,160,160,"QRCode",printData.qrCode); + LODOP.SET_PRINT_STYLEA(0,"FontSize",10); + LODOP.ADD_PRINT_TEXT(140,15,300,20,"发料时间: "+printData.outTime); + LODOP.ADD_PRINT_TEXT(160,15,300,20,"入库时间: "+printData.stockTime); + LODOP.ADD_PRINT_TEXT(180,15,300,20,"原料时间: "+printData.materialTime); + LODOP.ADD_PRINT_TEXT(200,15,300,20,"系统批次: "+printData.systemBatchNo); + LODOP.ADD_PRINT_TEXT(220,15,300,20,"原料批号: "+printData.rawMaterialBatchNo); + LODOP.ADD_PRINT_TEXT(240,15,300,20,"有效期: "+printData.expiredTime); + LODOP.ADD_PRINT_TEXT(260,15,300,20,"回温次数: "+printData.reheatingNums); + LODOP.ADD_PRINT_TEXT(280,15,300,20,"暴露时间: "+printData.exposureHours); + LODOP.ADD_PRINT_TEXT(310,108,123,36,"阶段 "+printData.phaseDesc); + LODOP.SET_PRINT_STYLEA(0,"FontSize",15); + LODOP.ADD_PRINT_TEXT(350,195,120,20,"工单号: "+printData.orderNo); + LODOP.ADD_PRINT_TEXT(380,195,120,20,"检验员: "+printData.fqcBy); + LODOP.ADD_PRINT_TEXT(380,40,150,20,"800#: "+printData.partNo); + LODOP.ADD_PRINT_TEXT(410,195,120,20,"数量: "+printData.rollQty); + LODOP.ADD_PRINT_TEXT(410,40,150,20,"客户料号:"+printData.customerPartNo); + + LODOP.PRINT_DESIGN(); + // LODOP.PREVIEW(); + // LODOP.PRINT(); + console.log("操作成功!") + } +} + diff --git a/src/views/modules/scheduleReport/com_die_cutting_report.vue b/src/views/modules/scheduleReport/com_die_cutting_report.vue index 9bc6aef..02f1afa 100644 --- a/src/views/modules/scheduleReport/com_die_cutting_report.vue +++ b/src/views/modules/scheduleReport/com_die_cutting_report.vue @@ -120,6 +120,9 @@ 删除 + 补打标签 @@ -147,11 +150,13 @@ import { getSfdcRollOpsByCon, getSoFinalRollsByCon, deleteSoFinalRoll, + getDieCuttingFinalRollPrintData, } from "@/api/scheduleReport/com_die_cutting_report.js"; + /*打印标签专用的js*/ import { - printSfdcLabel, -} from "@/views/modules/scheduleReport/print_roll_label.js" + printDieCuttingLabel, +} from "@/views/modules/label/print_die_cutting_label.js" import comScanMaterial from './com_scan_material' /* 扫描卷的组件 */ import comSeparateRoll from "./com_separate_roll"; @@ -1086,14 +1091,16 @@ export default { }); }, - /*开始调机modal*/ - startProduceModal() { - //1.首先调用菜单判断方式 看看是否可以结束卷 - //checkProduceButton('startProduceFlag'); - //打开开始生产的页面 - this.$nextTick(() => { - this.showProduceFlag = true; - this.$refs.comStartProduce.init(this.scheduleData) + /*补打标签*/ + reprintFinalRoll(printRow) { + //调用打印标签 + getDieCuttingFinalRollPrintData(printRow).then(({data}) =>{ + if(data.code == 200) { + //调用打印方法 + printDieCuttingLabel(data.printList); + }else { + this.$message.error(data.msg); + } }); }, diff --git a/src/views/modules/scheduleReport/com_fqc_report.vue b/src/views/modules/scheduleReport/com_fqc_report.vue index 744e718..342fcd5 100644 --- a/src/views/modules/scheduleReport/com_fqc_report.vue +++ b/src/views/modules/scheduleReport/com_fqc_report.vue @@ -86,6 +86,9 @@ 取消检验 + 补打标签 @@ -103,14 +106,17 @@ import { getSoFinalRollsByCon, scanFinalRollNo, cancelCheckSoFinalRoll, + getFqcFinalRollPrintData, } from "@/api/scheduleReport/com_fqc_report.js"; + /*打印标签专用的js*/ import { - printSfdcLabel, -} from "@/views/modules/scheduleReport/print_roll_label.js" + printDieCuttingLabel, +} from "@/views/modules/label/print_fqc_label.js" import comScanMaterial from './com_scan_material' /* 扫描卷的组件 */ import comSeparateRoll from "./com_separate_roll"; +import {printFqcLabel} from "../label/print_fqc_label"; var functionId = 'C10000004'; export default { @@ -825,6 +831,8 @@ export default { // 查询卷信息 scanFinalRollNo(this.searchData).then(({data}) => { if (data.code == 200){ + //调用打印方法 + printFqcLabel(data.printRow); this.getSoFinalList(); this.searchData.rollNo = ''; }else{ @@ -917,69 +925,19 @@ export default { }); }, - /*结束使用 工具确认功能*/ - warnFinishToolConfirm(toolRow) { - this.$confirm(this.labels.sureEndThisToolUsed, '提示', { - confirmButtonText: this.labels.confirmLabel, - celButtonText: this.labels.cancelLabel, - type: 'warning' - }).then(() => { - //执行结束使用工具的的操作 - this.finishToolOperation(toolRow); - }); - }, - - /*执行删除sfdcRolls的数据功能*/ - finishToolOperation(toolRow) { - let toolData = { - 'site': this.scheduleData.site, 'orderNo': this.scheduleData.orderNo, - 'itemNo': this.scheduleData.itemNo, 'seqNo': this.scheduleData.seqNo, - 'histSeqNo': toolRow.histSeqNo, 'toolInstanceId': toolRow.toolInstanceId - }; - //执行删除卷的操作 - processFinishTool(toolData).then(({data}) => { - //判断是否成功 - if (data.code == 500) { + /*补打标签*/ + reprintFinalRoll(printRow) { + //调用打印标签 + getFqcFinalRollPrintData(printRow).then(({data}) =>{ + if(data.code == 200) { + //调用打印方法 + printFqcLabel(data.printRow); + }else { this.$message.error(data.msg); - } else { - this.$message.success(data.msg); - //刷新报工的页面 - this.refreshPageData(); } }); }, - /*结束使用 材料确认功能*/ - warnFinishMaterialWithNoRemainderConfirm(materialRow) { - this.$confirm(this.labels.sureEndThisToolUsed, '提示', { - confirmButtonText: this.labels.confirmLabel, - celButtonText: this.labels.cancelLabel, - type: 'warning' - }).then(() => { - //执行结束使用材料的的操作 - this.finishMaterialWithNoRemainderOperation(materialRow); - }); - }, - - /*执行结束使用 材料的数据功能*/ - finishMaterialWithNoRemainderOperation(materialRow) { - let materialData = { - 'site': this.scheduleData.site, 'orderNo': this.scheduleData.orderNo, - 'itemNo': this.scheduleData.itemNo, 'seqNo': this.scheduleData.seqNo, - 'histSeqNo': materialRow.histSeqNo, 'rollNo': materialRow.rollNo - }; - //执行结束使用材料卷且无剩余的操作 - finishMaterialWithNoRemainder(materialData).then(({data}) => { - //判断是否成功 - if (data.code == 500) { - this.$message.error(data.msg); - } else { - this.$message.success(data.msg); - //刷新报工的页面 - this.refreshPageData(); - } - }); - }, }, created() { diff --git a/src/views/modules/scheduleReport/com_separate_roll.vue b/src/views/modules/scheduleReport/com_separate_roll.vue index 6a1a41a..bc71d92 100644 --- a/src/views/modules/scheduleReport/com_separate_roll.vue +++ b/src/views/modules/scheduleReport/com_separate_roll.vue @@ -37,8 +37,8 @@ import { /*打印标签专用的js*/ import { - printSfdcLabel, -} from "@/views/modules/scheduleReport/print_roll_label.js"; + printDieCuttingLabel, +} from "@/views/modules/label/print_die_cutting_label.js" var functionId = 'C10000003'; @@ -179,6 +179,7 @@ export default { languageCode: this.$i18n.locale, objectType: 'label' }, + printList: [], } }, methods: { @@ -280,6 +281,9 @@ export default { //清空卷数 重置数据量 this.pageData.rollQty = this.pageData.standardRollQty; this.pageData.rollNums = 1; + this.printList = data.printList; + //调用打印方法 打印数 + printDieCuttingLabel(this.printList); } else { this.$message.error(data.msg); }