入库操作修改
This commit is contained in:
1 parent
2097bffabb
commit
8de4bc26cd
8 files changed
+348
-25
No files matched your search
@@ -5,7 +5,8 @@
|
||||
<el-col :span="16">
|
||||
<el-form-item label="散料盒编码">
|
||||
<el-input v-model="form.code"
|
||||
placeholder="请扫描散料盒编码">
|
||||
placeholder="请扫描散料盒编码"
|
||||
@@change="scanBox">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -28,12 +29,19 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="唯一码" prop="uniqueCode">
|
||||
<el-input v-model="form.uniqueCode"
|
||||
@@change="scanUniqueCode"
|
||||
ref="uniqueCode">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-col :span="16">
|
||||
<el-form-item label="唯一码" prop="uniqueCode">
|
||||
<el-input v-model="form.uniqueCode"
|
||||
@@change="scanUniqueCode"
|
||||
ref="uniqueCode">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="满盘">
|
||||
<el-switch v-model="form.isFull"></el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-table :data="bindingData" stripe max-height="450" border style="width: 100%">
|
||||
<el-table-column fixed="left" label="操作" width="120" align="center">
|
||||
<template slot-scope="scope">
|
||||
@@ -72,6 +80,7 @@
|
||||
<el-form-item style="float: right">
|
||||
<el-button type="primary" @@click="onSubmit">绑定</el-button>
|
||||
<el-button @@click="resetForm('form')">重置</el-button>
|
||||
<el-button type="primary" @@click="back">回库</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
@@ -86,6 +95,7 @@
|
||||
code: "",
|
||||
size: "",
|
||||
uniqueCode: "",
|
||||
isFull: false
|
||||
},
|
||||
boxSize: [
|
||||
{ label: "8mm", value: "8" },
|
||||
@@ -114,6 +124,7 @@
|
||||
// });
|
||||
},
|
||||
methods: {
|
||||
// 呼叫料箱
|
||||
callBox() {
|
||||
var _this = this;
|
||||
$.ajax({
|
||||
@@ -144,10 +155,40 @@
|
||||
},
|
||||
});
|
||||
},
|
||||
// 扫描散料箱
|
||||
scanBox(data) {
|
||||
var _this = this;
|
||||
$.ajax({
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: { boxCode: _this.form.code },
|
||||
url: "/receipt/ReceiptSLIn/ScanBox",
|
||||
success: function (json) {
|
||||
if (json.Code != 200) {
|
||||
_this.$message({
|
||||
message: "扫描失败!" + json.Msg,
|
||||
type: "warning",
|
||||
duration: "10000",
|
||||
});
|
||||
}
|
||||
else {
|
||||
_this.$refs.uniqueCode.focus();
|
||||
}
|
||||
},
|
||||
error: function (json) {
|
||||
_this.$message({
|
||||
message: "扫描失败!",
|
||||
type: "error",
|
||||
duration: "10000",
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
sizeFormatter(row) {
|
||||
var rr = this.boxSize.filter((item) => item.value == row.size)[0].label;
|
||||
return rr;
|
||||
},
|
||||
// 绑定
|
||||
onSubmit() {
|
||||
var _this = this;
|
||||
console.log("submit!");
|
||||
@@ -158,13 +199,13 @@
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: { data: _this.bindingData },
|
||||
url: "/receipt/ReceiptIn/BindingData",
|
||||
url: "/receipt/ReceiptSLIn/BindingData",
|
||||
success: function (json) {
|
||||
if (json.Success) {
|
||||
if (json.Code == 200) {
|
||||
_this.$message({
|
||||
message: "绑定成功!",
|
||||
});
|
||||
_this.resetForm("form");
|
||||
_this.bindingData = [];
|
||||
} else {
|
||||
_this.$message({
|
||||
message: "绑定失败!",
|
||||
@@ -182,15 +223,12 @@
|
||||
},
|
||||
});
|
||||
},
|
||||
// 重置
|
||||
resetForm(formName) {
|
||||
this.$refs[formName].resetFields();
|
||||
this.boxSize = [];
|
||||
this.bindingData = [];
|
||||
},
|
||||
// 扫描散料箱
|
||||
scanBox(data) {
|
||||
this.$refs.uniqueCode.focus();
|
||||
},
|
||||
// 选择尺寸后
|
||||
changeSize() {
|
||||
this.$refs.uniqueCode.focus();
|
||||
@@ -227,13 +265,14 @@
|
||||
success: function (json) {
|
||||
if (json.Code != 200) {
|
||||
_this.$message({
|
||||
message: "扫描失败!" + json.Msg,
|
||||
message: json.Msg,
|
||||
type: "warning",
|
||||
duration: "10000",
|
||||
});
|
||||
} else {
|
||||
// 3.已扫描增加
|
||||
_this.bindingData.push({
|
||||
receiptCode: json.Data.ReceiptHeaderId,
|
||||
boxCode: _this.form.code,
|
||||
uniqueCode: data,
|
||||
qty: json.Data.Qty - json.Data.CompletedQty,
|
||||
@@ -271,6 +310,46 @@
|
||||
this.bindingData[index].bindQty = row.qty;
|
||||
}
|
||||
},
|
||||
// 回库
|
||||
back() {
|
||||
var _this = this;
|
||||
// 创建回库任务
|
||||
if (_this.code == "") {
|
||||
_this.$message({
|
||||
message: "箱号为空,不能创建回库任务!",
|
||||
type: "error",
|
||||
duration: "1000",
|
||||
});
|
||||
return;
|
||||
}
|
||||
$.ajax({
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: { boxCode: _this.form.code, isFull: _this.form.isFull },
|
||||
url: "/receipt/ReceiptSLIn/BoxBack",
|
||||
success: function (json) {
|
||||
if (json.Code != 200) {
|
||||
_this.$message({
|
||||
message: "回库任务创建失败!" + json.Msg,
|
||||
type: "warning",
|
||||
duration: "10000",
|
||||
});
|
||||
} else {
|
||||
_this.$message({
|
||||
message: "回库任务创建成功!"
|
||||
});
|
||||
_this.resetForm('form');
|
||||
}
|
||||
},
|
||||
error: function (json) {
|
||||
_this.$message({
|
||||
message: "回库任务创建失败!",
|
||||
type: "error",
|
||||
duration: "10000",
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
</script>
|
||||
Reference in new issue
Block a user