打印页面可移除编码

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

No files matched your search

@@ -17,11 +17,29 @@
</el-row> </el-row>
<div style="margin: 20px 0;"></div> <div style="margin: 20px 0;"></div>
@* 富文本 *@ @* 富文本 *@
<el-input type="textarea" @* <el-input type="textarea"
:autosize="{ minRows: 4}" :autosize="{ minRows: 4}"
readonly readonly
v-model="gendCode"> 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-button style="float: right" type="primary" @@click="print">打印</el-button>
</el-row> </el-row>
@@ -30,6 +48,7 @@
el: "#print", el: "#print",
data() { data() {
return { return {
invTable:[],
printData:[], printData:[],
gendCode: '', gendCode: '',
qrcode: '', qrcode: '',
@@ -70,6 +89,10 @@
} }
}, },
methods: { methods: {
// 删除已绑定行
deleteRow(index, rows) {
rows.splice(index, 1);
},
scanCode() { scanCode() {
var _this = this; var _this = this;
// 调用后台方法,判断是否在物料表内 // 调用后台方法,判断是否在物料表内
@@ -137,8 +160,12 @@
else{ else{
// console.log(json); // console.log(json);
json.Data.forEach(function (item) { json.Data.forEach(function (item) {
_this.gendCode += item.UniqueCode + '\n'; // _this.gendCode += item.UniqueCode + '\n';
_this.gendCode += item.Batch + '\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.UniqueCode });
_this.printData.push({ uniqueCode: item.Batch }); _this.printData.push({ uniqueCode: item.Batch });
}); });
@@ -157,6 +184,11 @@
}, },
print() { print() {
var _this = this; var _this = this;
_this.printData = [];
this.invTable.forEach(function (item) {
_this.printData.push({ uniqueCode: item.UniqueCode });
_this.printData.push({ uniqueCode: item.Batch });
});;
// _this.gendCode = ""; // _this.gendCode = "";
hiprint.init(); hiprint.init();
var hiprintTemplate = new hiprint.PrintTemplate({ var hiprintTemplate = new hiprint.PrintTemplate({
@@ -195,7 +195,8 @@
"uniqueCode": item.UniqueCode, "uniqueCode": item.UniqueCode,
"qty": item.Qty, "qty": item.Qty,
"bindQty": item.Qty, "bindQty": item.Qty,
"size": item.Flag "size": item.Flag,
"band":1
}) })
}); });
@@ -232,6 +233,9 @@
message: "绑定成功!", message: "绑定成功!",
}); });
// _this.bindingData = []; // _this.bindingData = [];
_this.bindingData.forEach(function (item) {
item.band = 1;
})
_this.disabledbackbutton = false; _this.disabledbackbutton = false;
} else { } else {
_this.$message({ _this.$message({
@@ -325,7 +329,17 @@
}, },
// 删除已绑定行 // 删除已绑定行
deleteRow(index, rows) { deleteRow(index, rows) {
if (rows[index].band == 1) {
this.$message({
message: "已绑定物料不能移除!",
type: "warning",
duration: "1000",
});
return;
}
else {
rows.splice(index, 1); rows.splice(index, 1);
}
}, },
handleEdit(index, row) { handleEdit(index, row) {
// console.log(index, row, this.bindingData); // console.log(index, row, this.bindingData);
+8 -8
View File
@@ -22,17 +22,17 @@
}, },
"Connections": [ "Connections": [
{
"Key": "default",
"Value": "Server=127.0.0.1;Port=3306;Database=8357wms;Uid=root;Password=abc123*;Character Set=utf8mb4;",
"DBType": "mysql"
}
//{ //{
// "Key": "default", // "Key": "default",
// "Value": "Data Source=.;Initial Catalog=8357wms;User=sa;Password=abc123*;Persist Security Info=True", // "Value": "Server=127.0.0.1;Port=3306;Database=8357wms;Uid=root;Password=abc123*;Character Set=utf8mb4;",
// "DbContext": "DataContext", // "DBType": "mysql"
// "DBType": "sqlserver" //DataBase, you can choose mysql,sqlserver,pgsql,sqlite,oracle
//} //}
{
"Key": "default",
"Value": "Data Source=.;Initial Catalog=8357wms;User=sa;Password=abc123*;Persist Security Info=True",
"DbContext": "DataContext",
"DBType": "sqlserver" //DataBase, you can choose mysql,sqlserver,pgsql,sqlite,oracle
}
//{ //{
// "Key": "default", // "Key": "default",
// "Value": "Data Source=10.18.106.4;Initial Catalog=8357wms;User=wms;Password=abc123*;Persist Security Info=True", // "Value": "Data Source=10.18.106.4;Initial Catalog=8357wms;User=wms;Password=abc123*;Persist Security Info=True",