库存回传
入库扫描逻辑
添加物料二维码和唯一码对应表
This commit is contained in:
zgf committed 2023-11-09 17:17:05 +08:00
1 parent f9bf7be066
commit da78422528
19 files changed
+1684 -115

No files matched your search

@@ -5,6 +5,7 @@ using WalkingTec.Mvvm.Mvc;
using WalkingTec.Mvvm.Core.Extensions;
using HHWMS.Web.Models;
using System.Collections.Generic;
using System;
namespace HHWMS.Web.Controllers
{
@@ -141,7 +142,7 @@ namespace HHWMS.Web.Controllers
{
UniqueCode = item,
Status = 0,
MaterialType = "PL",
ZoneCode = ZoneCodeEnum.盘料库,
ReceiptHeaderId = vm.Entity.ReceiptHeaderId
});
}
@@ -154,12 +155,29 @@ namespace HHWMS.Web.Controllers
detailList.Add(new ReceiptDetail
{
UniqueCode = item,
MaterialType = "SL",
ZoneCode = ZoneCodeEnum.散料库,
Status = 0,
ReceiptHeaderId = vm.Entity.ReceiptHeaderId
});
}
}
// 补充物料明细
foreach(var item in detailList)
{
var materialqr = _unitwork.FindSingle<MaterialQr>(x => x.UniqueCode.Equals(item.UniqueCode));
var material = _unitwork.FindSingle<Material>(x => x.QRCode.Equals(materialqr.QRCode));
item.MaterialCode = material.MaterialCode;
item.MaterialName = material.MaterialName;
item.MaterialSpec = material.MaterialSpec;
item.MaterialType = material.MaterialType;
item.MaterialUnit = material.MaterialUnit;
item.Batch = material.Batch;
item.Qty = material.Qty;
item.SupplierCode = material.SupplierCode;
item.CreateBy = Wtm.LoginUserInfo.ITCode;
item.CreateTime = DateTime.Now;
}
_unitwork.BatchAdd(detailList.ToArray());
return FFResult().CloseDialog().RefreshGrid(index: 1);
}
@@ -35,15 +35,15 @@ namespace HHWMS.Web
this.MakeGridHeader(x => x.UniqueCode).SetWidth(230),
this.MakeGridHeader(x => x.MaterialCode),
//this.MakeGridHeader(x => x.MaterialType),
//this.MakeGridHeader(x => x.MaterialName),
this.MakeGridHeader(x => x.MaterialName),
//this.MakeGridHeader(x => x.MaterialSpec),
//this.MakeGridHeader(x => x.MaterialUnit),
this.MakeGridHeader(x => x.MaterialUnit),
this.MakeGridHeader(x => x.Batch),
//this.MakeGridHeader(x => x.Lot).SetHide(),
//this.MakeGridHeader(x => x.ManufactureDate),
//this.MakeGridHeader(x => x.ExpirationDate),
//this.MakeGridHeader(x => x.CompanyCode),
//this.MakeGridHeader(x => x.SupplierCode),
this.MakeGridHeader(x => x.SupplierCode),
this.MakeGridHeader(x => x.CompletedQty),
this.MakeGridHeader(x => x.Qty),
//this.MakeGridHeader(x => x.InventoryStatus),
@@ -201,36 +201,29 @@
var _this = this;
_this.form.size = '';
_this.form.boxSize = [];
if (Box == "L02") {
_this.form.boxSize = [{ label: "24mm", value: "24" }, { label: "16mm", value: "16" }, { label: "10mm", value: "10" }]
_this.dataIndex = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
}
else if (Box == "L01") {
_this.form.boxSize = [{ label: "8mm", value: "8" }];
_this.form.size = _this.form.boxSize[0].value;
_this.dataIndex = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20];
}
else {
_this.$message({
message: '输入周转箱编码不正确!',
if (this.form.code == '') {
this.$message({
message: '请先选择单据!',
type: 'warning'
});
return;
}
console.log(Box);
$.ajax({
type: "post",
dataType: "json",
data: { boxCode: Box },
url: "/receipt/ReceiptIn/ScanBox",
success: function (json) {
console.log(json);
if (json.Code != 200) {
_this.$message({
message: "扫描失败!" + json.Msg,
type: "warning",
duration: "10000",
});
_this.form.boxCode = "";
return false;
}
else {
_this.$message({
@@ -239,6 +232,23 @@
duration: "10000",
});
_this.$refs.uniqueCode.focus();
if (Box == "L02") {
_this.form.boxSize = [{ label: "24mm", value: "24" }, { label: "16mm", value: "16" }, { label: "10mm", value: "10" }]
_this.dataIndex = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
}
else if (Box == "L01") {
_this.form.boxSize = [{ label: "8mm", value: "8" }];
_this.form.size = _this.form.boxSize[0].value;
_this.dataIndex = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20];
}
else {
_this.$message({
message: '输入周转箱编码不正确!',
type: 'warning'
});
return;
}
}
},
error: function (json) {
@@ -250,6 +260,8 @@
return;
},
});
// 重新扫描箱号后,待绑定列表清空
_this.bindingData = [];
_this.changeselect(_this.value);
@@ -262,6 +274,13 @@
},
// 扫描唯一码
scanUniqueCode(data) {
if (this.form.code == '') {
this.$message({
message: '请先选择单据!',
type: 'warning'
});
return;
}
if (this.dataIndex.length == 0) {
this.$message({
message: '该周转箱已放满!',
@@ -55,50 +55,23 @@
},
methods: {
handleSelectionChange(val) {
console.log(22);
val.forEach(row => {
if (row.station == '') {
this.$refs.multipleTable.toggleRowSelection(row);
this.$message({
message: "此周转箱没有选择站台!",
type: "warning",
duration: "5000",
});
}
});
this.selectData = val;
let names = this.selectData.map(item => item["station"]);
let nameSet = new Set(names);
if (nameSet.size != names.length) {
this.$message({
message: "站台不能重复!",
type: "warning",
duration: "5000",
});
this.$refs.multipleTable.clearSelection();
this.selectData = [];
}
console.log(this.selectData);
},
// 启动入库
inOperation() {
console.log(this.tableData)
var _this = this;
for (var i = 0; i < _this.tableData.length; i++) {
if (_this.tableData[i].station == null || _this.tableData[i].station == "") {
this.$message({
message: "必须全部选择!",
type: "warning",
duration: "5000",
});
return;
}
if (_this.selectData.length < 1) {
this.$message({
message: "至少选择一个站台!",
type: "warning",
duration: "5000",
});
return;
}
$.ajax({
type: "post",
dataType: "json",
data: { data: _this.tableData },
data: { data: _this.selectData },
url: "/receipt/ReceiptInOperation/InOperation",
success: function (json) {
if (json.Code == 200) {
@@ -107,6 +80,13 @@
type: "success",
});
}
else {
_this.$message({
message: json.Msg,
type: "warning",
duration: "1000",
});
}
},
error: function (json) {
alert("加载失败");