拣货页面修改,

从点击选择物料,改为扫描唯一码自动拣货
This commit is contained in:
zhougf committed 2024-03-25 19:58:42 +08:00
1 parent 265b4a1f3f
commit 9f6f95828c
4 files changed
+42 -6

No files matched your search

@@ -70,7 +70,7 @@ var app = new Vue({
app.tableData = json.Data; app.tableData = json.Data;
}, },
error: function (json) { error: function (json) {
console.log("加载失败"); alert("加载失败");
} }
}); });
this.$nextTick(() => { this.$nextTick(() => {
@@ -26,7 +26,8 @@
</el-row> </el-row>
<el-row v-show="showTable"> <el-row v-show="showTable">
<el-divider></el-divider> <el-divider></el-divider>
<el-table :data="invTable" height="200" stripe border @@row-click="selectdata" <el-table :data="invTable" height="200" stripe border
@@row-click="selectdata"
style="width: 100%"> style="width: 100%">
<el-table-column label="唯一码" width="220" align="center" prop="UniqueCode"></el-table-column> <el-table-column label="唯一码" width="220" align="center" prop="UniqueCode"></el-table-column>
<el-table-column label="编码" align="center" prop="MaterialCode"></el-table-column> <el-table-column label="编码" align="center" prop="MaterialCode"></el-table-column>
@@ -39,7 +40,7 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="24"> <el-col :span="24">
<el-form-item label="唯一码" prop="uniqueCode"> <el-form-item label="唯一码" prop="uniqueCode">
<el-input v-model="form.uniqueCode" ref="uniqueCode" readonly></el-input> <el-input v-model="form.uniqueCode" ref="uniqueCode" @@change="scanUnique"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@@ -90,7 +91,7 @@
taskType: [ taskType: [
{ label: "散料站台", value: "slbox" }, { label: "散料站台", value: "slbox" },
{ label: "料塔周转箱", value: "lt" }, { label: "料塔周转箱", value: "lt" },
{ label: "唯一码", value: "uniqueCode" }, // { label: "唯一码", value: "uniqueCode" },
], ],
invTable:[], invTable:[],
showTable: false, showTable: false,
@@ -106,6 +107,41 @@
this.form.batch = data.Batch; this.form.batch = data.Batch;
this.form.qty = data.Qty; this.form.qty = data.Qty;
}, },
// 扫描二维码
scanUnique(data) {
if (this.invTable.length == 0) {
this.$message({
message: "待拣物料列表为空!",
type: "error",
duration: "10000",
});
this.form.uniqueCode = "";
return;
}
var _this = this;
var t = _this.invTable.findIndex(function (value, index, arr) {
return value.UniqueCode == data;
});
if (t == -1) {
_this.$message({
message: "扫描失败 " + data + " 不存在!",
type: "error",
duration: "10000",
});
} else {
var value = _this.invTable[t];
_this.form.uniqueCode = value.UniqueCode;
_this.form.materialCode = value.MaterialCode;
_this.form.materialSpec = value.MaterialSpec;
_this.form.batch = value.Batch;
_this.form.qty = value.Qty;
_this.onSubmit();
}
},
select(data) { select(data) {
this.form.code = ""; this.form.code = "";
this.form.type = data; this.form.type = data;
@@ -62,7 +62,7 @@
app.tableData = json.Data; app.tableData = json.Data;
}, },
error: function (json) { error: function (json) {
console.log("加载失败"); alert.log("加载失败");
} }
}); });
}, },
@@ -45,7 +45,7 @@
app.tableData = json.Data; app.tableData = json.Data;
}, },
error: function (json) { error: function (json) {
console.log("加载失败"); alert.log("加载失败");
} }
}); });
}, },