模板修改中文修改

This commit is contained in:
Cc 2025-02-18 16:00:31 +08:00
parent 573c35c881
commit ab81562fdd
9 changed files with 97 additions and 182 deletions

View File

@ -53,6 +53,7 @@
"jsencrypt": "^3.2.0",
"lodash": "^4.17.21",
"mockjs": "^1.1.0",
"node-ssh": "^13.2.0",
"nprogress": "^0.2.0",
"qrcode": "^1.5.4",
"qs": "^6.10.1",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 460 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 175 KiB

After

Width:  |  Height:  |  Size: 116 KiB

BIN
src/assets/mb1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

View File

@ -96,7 +96,6 @@
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
></el-pagination>
</div>
<el-dialog
v-model="dialogFormVisible"
@ -124,7 +123,7 @@
width="50%"
@close="close"
>
<qcode :url="codeUrl"></qcode>
<qcode v-if="dialogqrcodeVisible" :url="codeUrl" :id="codeId"></qcode>
<el-descriptions :column="3" border>
<el-descriptions-item
@ -137,6 +136,7 @@
<div class="dialog-footer"></div>
</el-dialog>
</div>
</template>
<script>
@ -159,6 +159,7 @@ export default {
layout: 'total, sizes, prev, pager, next, jumper',
total: 0,
codeId: '',
background: true,
listLoading: true,
dialogFormVisible: false,
@ -226,6 +227,7 @@ export default {
this.listLoading = false;
}, 500);
},
close() {},
getFormatData(time) {
return getDate(time);
},
@ -236,6 +238,7 @@ export default {
let code = 'C0200053'; // row.materialCode
productAttribute(code).then(res => {
this.dialogqrcodeVisible = true;
this.codeId = row.billNo;
this.codeUrl = 'http://sm.lidinghb.com?materialCode=' + code;
this.qrinfoData = res.data;
});

View File

@ -1,4 +1,5 @@
<template>
<div>
<el-button
type="primary"
style="display: block; margin-left: 40px"
@ -9,40 +10,12 @@
</el-button>
<div id="printCanvas" class="container">
<img src="@/assets/mb.jpg" />
<div class="equipment">HS CODE 8421219990</div>
<div class="date">2023-02-17</div>
<img :src="qcodeImg" class="qrcodeimg" ass />
<!--
<div class="containerTable">
<div class="flexCss">
<div class="flexleft">
<p>Li Ding</p>
<p>Environmenta</p>
</div>
<div>
<p>力鼎清道夫</p>
<p>LD Household Sewage Treatment Plant (STP)</p>
</div>
</div>
<div class="item">出厂日期(Date):</div>
<div class="item">
产地(Place of production): 江苏 南通 Nantong City, China
</div>
<div class="item">设备编码(Equipment code):</div>
<div class="footer">
<div class="footerLeft">
<p>江苏力鼎环保装备有限公司</p>
<p class="smallsize">
Jiangsu LiDing Environmental Protection Equipment Co., Ltd.
</p>
<p>E-mail:liding@lidinghb.com Tel: +86 4006-828-666</p>
</div>
<div></div>
</div>
<img src="@/assets/mb.png" />
<div class="date">{{ currentDate }}</div>
<img :src="qcodeImg" class="qrcodeimg" ass />
<div class="qrcodeSn">{{ sn }}</div>
</div>
-->
</div>
</template>
<script setup>
@ -53,64 +26,27 @@ const canvasref = ref(null);
const qcodeImg = ref();
const props = defineProps(['url']);
const props = defineProps(['url', 'id']);
console.log(props.url);
const sn = ref(props.id);
const printButton = ref(null);
const printObj = ref({
id: 'printMe', // ID
// url:'https://www.baidu.com/',
popTitle: '打印表单', //
// extraCss: "https://cdn.bootcdn.net/ajax/libs/animate.css/4.1.1/animate.compat.css, https://cdn.bootcdn.net/ajax/libs/hover.css/2.3.1/css/hover-min.css", // css
// extraHead: '<meta http-equiv="Content-Language"content="zh-cn"/>', //
// preview: true, // false
previewTitle: '打印客户账单', //
previewPrintBtnLabel: '预览结束,开始打印', //
zIndex: 20003, // z-index20002
previewBeforeOpenCallback() {
console.log('正在加载预览窗口!');
}, // callback
previewOpenCallback() {
console.log('已经加载完预览窗口,预览打开了!');
}, // callback
beforeOpenCallback(vue) {
vue.printLoading = true;
console.log('开始打印之前!');
}, // callback
openCallback(vue) {
vue.printLoading = false;
console.log('监听到了打印窗户弹起了!');
}, // callback
closeCallback() {
console.log('关闭了打印工具!');
}, // callback()
clickMounted() {
console.log('点击v-print绑定的按钮了');
},
});
function printCanvas() {
debugger;
const img = canvasref.value.toDataURL('image/png');
// Image
const printImage = new Image();
//
printImage.onload = () => {};
// canvasDataURL
printImage.src = img;
const currentDate = ref('');
function getCurrentDate() {
const date = new Date();
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
currentDate.value = `${year}-${month}-${day}`;
}
onMounted(() => {
QRCode.toDataURL(props.url, (error, url) => {
debugger;
if (url) {
qcodeImg.value = url;
}
if (error) console.error(error);
});
getCurrentDate(); //
});
</script>
<style second>
@ -122,11 +58,18 @@ onMounted(() => {
width: 100%;
}
.qrcodeimg {
width: 80px;
height: 80px;
width: 110px;
height: 110px;
position: absolute;
bottom: 49px;
right: 49px;
bottom: 73px;
right: 50px;
}
.qrcodeSn {
position: absolute;
bottom: 54px;
right: 59px;
color: #000;
font-weight: bold;
}
.equipment {
position: absolute;
@ -146,39 +89,6 @@ onMounted(() => {
color: #000;
}
}
.containerTable {
width: 500px;
border: 1px solid #000;
background: #ccc;
color: #000;
position: relative;
.item {
border-top: 1px solid #000;
padding-left: 10px;
height: 50px;
line-height: 50px;
}
.flexCss {
text-align: center;
display: flex;
.flexleft {
width: 30%;
border-right: 1px solid #000;
}
}
.footer {
border-top: 1px solid #000;
display: flex;
.footerLeft {
width: 70%;
text-align: center;
.smallsize {
font-size: 12px;
}
}
}
}
</style>
<style scoped>
@media print {
@ -226,11 +136,20 @@ onMounted(() => {
}
.qrcodeimg {
width: 8mm;
height: 8mm;
width: 12mm;
height: 12mm;
position: absolute;
bottom: 14px;
bottom: 20px;
right: 3mm;
}
.qrcodeSn {
position: absolute;
bottom: 13px;
right: 4mm;
font-size: 4pt;
color: #000;
font-weight: bold;
}
}
.containerTable {

View File

@ -95,17 +95,17 @@
</div>
<div class="site-bottom-base">
<div class="record-right-base">
<text class="h1-head-base">远程控制</text>
<text class="h1-head-base">指令汇总</text>
</div>
<div class="list-right-base">
<el-tabs v-model="activeDataName" @tab-click="handleDataClick">
<el-tab-pane label="可读" name="data-first">
<el-tab-pane label="全部指令" name="data-first">
<readable-index
ref="readable"
:deviceCode="queryForm.deviceCode"
></readable-index>
</el-tab-pane>
<el-tab-pane label="只写" name="data-second">
<el-tab-pane label="下发控制" name="data-second">
<only-index
ref="only"
:deviceCode="queryForm.deviceCode"

View File

@ -25,7 +25,7 @@
<el-table-column label="操作" align="center">
<template #default="{ row }">
<el-button
v-if="row.readWrite == '写' && isBtnPerm('/deviceSensor/write')"
v-if="row.readWrite == '写' && isBtnPerm('/deviceSensor/write')"
type="text"
@click="distribute(row)"
>

View File

@ -23,15 +23,7 @@
</el-table-column>
<el-table-column prop="unit" label="单位" align="center"></el-table-column>
<el-table-column label="操作" align="center">
<template #default="{ row }">
<el-button
v-if="row.readWrite == '读写' && isBtnPerm('/deviceSensor/write')"
type="text"
@click="distribute(row)"
>
下发指令
</el-button>
</template>
<template #default="{ row }"></template>
</el-table-column>
</el-table>
<el-pagination