打印页面可移除编码

散料入移除限制
This commit is contained in:
zgf committed 2024-02-02 11:39:14 +08:00
1 parent 9872a308f7
commit 0ced05961b
3 files changed
+60 -14

No files matched your search

@@ -17,11 +17,29 @@
</el-row>
<div style="margin: 20px 0;"></div>
@* 富文本 *@
<el-input type="textarea"
@* <el-input type="textarea"
:autosize="{ minRows: 4}"
readonly
v-model="gendCode">
</el-input>
</el-input> *@
<el-divider></el-divider>
<el-table :data="invTable" max-height="400" stripe border
style="width: 100%">
<el-table-column fixed="left"
label="操作"
width="120"
align="center">
<template slot-scope="scope">
<el-button @@click.native.prevent="deleteRow(scope.$index, invTable)"
type="text"
size="small">
移除
</el-button>
</template>
</el-table-column>
<el-table-column label="唯一码" width="220" align="center" prop="UniqueCode"></el-table-column>
<el-table-column label="批次" width="220" align="center" prop="Batch"></el-table-column>
</el-table>
<el-button style="float: right" type="primary" @@click="print">打印</el-button>
</el-row>
@@ -30,6 +48,7 @@
el: "#print",
data() {
return {
invTable:[],
printData:[],
gendCode: '',
qrcode: '',
@@ -70,6 +89,10 @@
}
},
methods: {
// 删除已绑定行
deleteRow(index, rows) {
rows.splice(index, 1);
},
scanCode() {
var _this = this;
// 调用后台方法,判断是否在物料表内
@@ -137,8 +160,12 @@
else{
// console.log(json);
json.Data.forEach(function (item) {
_this.gendCode += item.UniqueCode + '\n';
_this.gendCode += item.Batch + '\n';
// _this.gendCode += item.UniqueCode + '\n';
// _this.gendCode += item.Batch + '\n';
_this.invTable.push({
"UniqueCode": item.UniqueCode,
"Batch": item.Batch
});
_this.printData.push({ uniqueCode: item.UniqueCode });
_this.printData.push({ uniqueCode: item.Batch });
});
@@ -157,6 +184,11 @@
},
print() {
var _this = this;
_this.printData = [];
this.invTable.forEach(function (item) {
_this.printData.push({ uniqueCode: item.UniqueCode });
_this.printData.push({ uniqueCode: item.Batch });
});;
// _this.gendCode = "";
hiprint.init();
var hiprintTemplate = new hiprint.PrintTemplate({