From 6d313a4a6f9f9d7ea65ec50ab0d4491e595edb97 Mon Sep 17 00:00:00 2001 From: admin <15939171744@163.com> Date: 星期二, 15 十月 2024 09:47:26 +0800 Subject: [PATCH] -打印bug修改 --- jcdm-ui/src/views/main/cfkb/Instructions/index.vue | 55 +++++++++++++++++++++++++++++++++++++++---------------- 1 files changed, 39 insertions(+), 16 deletions(-) diff --git a/jcdm-ui/src/views/main/cfkb/Instructions/index.vue b/jcdm-ui/src/views/main/cfkb/Instructions/index.vue index 2f02ed9..7e30a95 100644 --- a/jcdm-ui/src/views/main/cfkb/Instructions/index.vue +++ b/jcdm-ui/src/views/main/cfkb/Instructions/index.vue @@ -31,26 +31,29 @@ <div> <div style="display: none" id="printMe"> <br> - <p style="margin-left: 43px">9900166410</p> - <p style="margin-left: 43px">HW001.001</p> - <p style="margin-left: 43px">SW002.005</p> + <p style="margin-left: 43px">{{printInfoData.partNumber}}</p> + <p style="margin-left: 43px">{{printInfoData.hardwareVersion}}</p> + <p style="margin-left: 43px">{{printInfoData.softwareVersion}}</p> <br> - <span style="font-size: 30px;font-weight: bold;margin-left: 40px;">GEELY</span><br> - <span style="font-size: 10px;margin-left: 29px">COMMERCIAL VEHICLE</span><br> - <span style="margin-left: 60px">H2155D</span><br> - <span style="margin-left: 63px">993083</span><br> - <span style="margin-left: 40px">9900166410</span><br> - <span style="font-size: 10px;margin-left: 17px;">{{text1}}</span> + <br> +<!-- <span style="font-size: 30px;font-weight: bold;margin-left: 40px;">GEELY</span><br>--> + <img style="width: 140px;height: 20px;margin-left: 25px" :src="require('@/assets/images/a8963a24920640508e96150a053fc41.png')"> + <span style="margin-left: 60px">{{printInfoData.printModel}}</span><br> + <span style="margin-left: 63px">{{printInfoData.supplierCode}}</span><br> + <span style="margin-left: 40px">{{printInfoData.partNumber}}</span><br> + <span style="font-size: 10px;margin-left: 17px;">{{text1}}</span><br> + <span style="font-size: 10px;margin-left: 52px">MADE IN CHINA</span><br> <br> <br> <br> - <br> - <div ref="canvasWrapper" id="canvasWrapper1" style="display: flex;justify-content: center;margin-top: -27px"></div> - <span style="font-size: 10px;word-break: break-all;display: flex;justify-content: center;width: 155px;margin-left: 9px">P9900166410#T{{text1}}#V993983#SSW002.005#HHW001.001#NBMS#</span> + <div ref="canvasWrapper" id="canvasWrapper1" style="display: flex;justify-content: center;margin-top: -27px;"></div> + <span style="font-size: 10px;word-break: break-all;display: flex;justify-content: center;width: 155px;margin-left: 9px">P{{printInfoData.partNumber}}#T{{text1}}#V{{printInfoData.supplierCode}}#S{{printInfoData.softwareVersion}}#H{{printInfoData.hardwareVersion}}#NBMS#</span> +<!-- <span style="font-size: 10px;word-break: break-all;display: flex;justify-content: center;width: 155px;margin-left: 9px">P{{printInfoData.partNumber}}#T{{text1}}#V{{printInfoData.supplierCode}}#S{{// printInfoData.softwareVersion}}#H{{printInfoData.hardwareVersion}}#NBMS#</span>--> <br> <br> <div ref="canvasWrapper" id="canvasWrapper2" style="display: flex;justify-content: center;margin-top: -27px"></div> - <span style="font-size: 10px;word-break: break-all;display: flex;justify-content: center;width: 155px;margin-left: 9px">P9900166410#T{{text1}}#V993983#SSW002.005#HHW001.001#NBMS#</span> + <span style="font-size: 10px;word-break: break-all;display: flex;justify-content: center;width: 155px;margin-left: 9px">P{{printInfoData.partNumber}}#T{{text1}}#V{{printInfoData.supplierCode}}#S{{printInfoData.softwareVersion}}#H{{printInfoData.hardwareVersion}}#NBMS#</span> +<!-- <span style="font-size: 10px;word-break: break-all;display: flex;justify-content: center;width: 155px;margin-left: 9px">P{{printInfoData.partNumber}}#T{{text1}}#V{{printInfoData.supplierCode}}#S{{// printInfoData.softwareVersion}}#H{{printInfoData.hardwareVersion}}#NBMS#</span>--> </div> <el-button @click="print1">鎵撳嵃</el-button> <el-button style="display: none" @click="test1">鐢熸垚浜岀淮鐮�</el-button> @@ -223,11 +226,19 @@ yzAddBasicParameters, } from "@/api/main/da/paramCollection/paramCollection"; import QRCode from "qrcodejs2"; +import {listEquipmentArchives} from "@/api/main/em/equipmentArchives/equipmentArchives"; export default { name: "stationTerminal", data() { return { + printInfoData: { + softwareVersion: 'SW001.001', //杞欢鐗堟湰鍙� + hardwareVersion: 'HW001.001', //纭欢鐗堟湰鍙� + printModel: 'H2155D', //鍨嬪彿 + partNumber: '9900200136', //闆堕儴浠跺彿 + supplierCode: '993983', //渚涘簲鍟嗙紪鐮� + }, weightValue: '', showInput: true, serialPortContent: '', @@ -343,12 +354,21 @@ }, }, methods: { + initializePrintInfoData(){ + listEquipmentArchives().then(response => { + this.printInfoData.softwareVersion = response.rows[0].equipmentCode + this.printInfoData.hardwareVersion = response.rows[0].equipmentName + this.printInfoData.supplierCode = response.rows[0].equipmentSpec + this.printInfoData.printModel = response.rows[0].equipmentBrand + this.printInfoData.partNumber = response.rows[0].equipmentTypeName + }); + }, enterWeighing(){ if(this.headContent.sfcCode ==='' || this.weightValue === '' ){ this.$message.error('鍙傛暟涓嶅叏锛�'); }else { let param = { - sfcCode: this.headContent.sfcCode, + productBarcode: this.headContent.sfcCode, weightValue: this.weightValue, } enterWeighing(param).then(response => { @@ -473,7 +493,7 @@ let qrCode = new QRCode('canvasWrapper1',{ width: 120, height: 120, - text: 'P9900166410#T'+ this.text1 +'#V993983#SSW002.005#HHW001.001#NBMS#', + text: 'P'+this.printInfoData.partNumber+'#T'+ this.text1 +'#V'+this.printInfoData.supplierCode+'#S'+this.printInfoData.softwareVersion+'#H'+this.printInfoData.hardwareVersion+'#NBMS#', colorDark: '#000', colorLight: '#fff' }) @@ -486,7 +506,7 @@ let qrCode = new QRCode('canvasWrapper2',{ width: 120, height: 120, - text: 'P9900166410#T'+ this.text1 +'#V993983#SSW002.005#HHW001.001#NBMS#', + text: 'P'+this.printInfoData.partNumber+'#T'+ this.text1 +'#V'+this.printInfoData.supplierCode+'#S'+this.printInfoData.softwareVersion+'#H'+this.printInfoData.hardwareVersion+'#NBMS#', colorDark: '#000', colorLight: '#fff' }) @@ -524,7 +544,10 @@ }, initStation: async function () { + await getIpv4().then(response => { + this.initializePrintInfoData(); + this.StationConfQueryParams.ipAddress = response.msg console.log('鏌ヨ鍒版湰宸ヤ綅IP涓�' + this.StationConfQueryParams.ipAddress) }); -- Gitblit v1.9.3