盘料入库页面,层号排序后再分配

添加货架库扫码捡货动作
添加异常出库单据清理任务
This commit is contained in:
Mac mini git server 2024-05-09 18:28:40 +08:00
parent 9bfee8930c
commit caab84071c
5 changed files with 111 additions and 65 deletions

View File

@ -266,11 +266,11 @@
},
});
// 重新扫描箱号后,待绑定列表清空
_this.bindingData = [];
_this.changeselect(_this.value);
// _this.$refs.uniqueCode.focus();
},
// 选择尺寸后
@ -323,7 +323,7 @@
this.bindingData.push({
receiptCode: this.form.code,
boxCode: this.form.boxCode,
index: this.dataIndex.shift(),
index: this.dataIndex.sort(function(a,b){return a-b}).shift(),
uniqueCode: data,
size: this.form.size
})

View File

@ -89,12 +89,14 @@ public class ShipOutController : BaseController
[HttpPost]
public ActionResult Pick(string uniqueCode, decimal qty,string station)
{
var shipment = _unitWork.Find<ShipmentDetail>(x => x.UniqueCode.Equals(uniqueCode))
.FirstOrDefault();
using (var tran = Wtm.DC.Database.BeginTransaction())
{
try
{
var shipment = _unitWork.Find<ShipmentDetail>(x => x.UniqueCode.Equals(uniqueCode)
&& x.Status != ShipStatusEnum.拣货完成)
.FirstOrDefault();
if (shipment == null)
{
return JsonMore(null, 500, "未找到该出库单!");
@ -105,23 +107,11 @@ public class ShipOutController : BaseController
shipment.UpdateBy = Wtm.LoginUserInfo?.ITCode??"WMS";
_unitWork.Update(shipment);
var header = _unitWork.Find<ShipmentHeader>(x => x.ID.Equals(shipment.ShipmentHeaderId))
.FirstOrDefault();
var details = _unitWork.Find<ShipmentDetail>(x => x.ShipmentHeaderId == shipment.ShipmentHeaderId)
.ToList();
if (details.All(x => x.Status == ShipStatusEnum.拣货完成))
{
header.FirstStatus = ShipStatusEnum.拣货完成;
}
else
{
header.FirstStatus = ShipStatusEnum.拣货中;
}
header.UpdateTime = DateTime.Now;
header.UpdateBy = Wtm.LoginUserInfo?.ITCode??"WMS";
_unitWork.Update(header);
var inv = _unitWork.FindSingle<Inventory>(x => x.UniqueCode.Equals(uniqueCode) && x.LocationCode == station);
if (inv == null && string.IsNullOrEmpty(station))
{
inv = _unitWork.FindSingle<Inventory>(x => x.UniqueCode.Equals(uniqueCode) && x.ZoneCode == ZoneCodeEnum.货架库);
}
if (inv != null)
{
//回传MES
@ -182,7 +172,7 @@ public class ShipOutController : BaseController
CompanyCode = inv.CompanyCode,
LocationCode = inv.LocationCode,
SupplierCode = inv.SupplierCode,
BillCode = header.Code,
BillCode = shipment.ShipmentHeaderId.ToString(),
BillDetailId = shipment.ID,
ContainerCode = inv.ContainerCode,
Qty = inv.Qty,
@ -214,6 +204,23 @@ public class ShipOutController : BaseController
}
}
// 更新单据状态
var header = _unitWork.Find<ShipmentHeader>(x => x.ID.Equals(shipment.ShipmentHeaderId))
.FirstOrDefault();
var details = _unitWork.Find<ShipmentDetail>(x => x.ShipmentHeaderId == shipment.ShipmentHeaderId)
.ToList();
if (details.All(x => x.Status == ShipStatusEnum.拣货完成))
{
header.FirstStatus = ShipStatusEnum.拣货完成;
}
else
{
header.FirstStatus = ShipStatusEnum.拣货中;
}
header.UpdateTime = DateTime.Now;
header.UpdateBy = Wtm.LoginUserInfo?.ITCode??"WMS";
_unitWork.Update(header);
// Wtm.DoLog("", ActionLogTypesEnum.Normal, "mes", request: JsonConvert.SerializeObject(request), result: "success");
tran.Commit();
return JsonMore(null);

View File

@ -291,6 +291,7 @@ namespace HHWMS.Web.Controllers
var invList = _unitwork.Find<Inventory>(x => x.ZoneCode.Equals(ZoneCodeEnum.货架库)
&& x.TaskStatus.Equals(InventoryTaskStatus.无任务)
&& details.Contains(x.UniqueCode))
.OrderBy(x => x.LocationCode)
.ToList();
//var details = data.ShipmentDetails.Where(x => invList.Contains(x.UniqueCode));
return JsonMore(invList);
@ -325,7 +326,7 @@ namespace HHWMS.Web.Controllers
_unitwork.Update(shipment);
var ids = data.Select(x => x.ID).ToList();
if(ids.Count > 0) {
if(ids.Count > 0) {
var invList = _unitwork.Find<Inventory>(x => ids.Contains(x.ID))
.ToList();

View File

@ -2,7 +2,7 @@
<el-card class="box-card" :span="16">
<el-form ref="form" :model="form" label-width="100px">
<el-row>
<el-col :span="4">
<el-col :span="6">
<el-form-item label="类型" prop="type">
<el-select v-model="form.type"
placeholder="请选择类型"
@ -91,7 +91,7 @@
taskType: [
{ label: "散料站台", value: "slbox" },
{ label: "料塔周转箱", value: "lt" },
// { label: "唯一码", value: "uniqueCode" },
{ label: "货架库", value: "pk" },
],
invTable:[],
showTable: false,
@ -109,6 +109,11 @@
},
// 扫描二维码
scanUnique(data) {
if (this.form.type == "pk") {
this.form.uniqueCode = data;
this.onSubmit();
}
else{
if (this.invTable.length == 0) {
this.$message({
message: "待拣物料列表为空!",
@ -141,6 +146,7 @@
_this.onSubmit();
}
}
},
select(data) {
@ -166,51 +172,54 @@
return;
}
let url = "";
if (_this.form.type == "uniqueCode") {
url = "/shipment/ShipOut/ScanUniqueCode"
if (_this.form.type == "pk") {
// url = "/shipment/ShipOut/ScanUniqueCode"
// _this.form.uniqueCode = data;
//this.onSubmit();
}
else{
url = "/shipment/ShipOut/ScanBox"
}
$.ajax({
type: "post",
dataType: "json",
data: { code: _this.form.code, type: _this.form.type },
url: url,
success: function (json) {
if (json.Code != 200) {
_this.$message({
message: "扫描失败!" + json.Msg,
type: "warning",
duration: "10000",
});
_this.form.code = "";
} else {
if (_this.form.type == "uniqueCode") {
_this.form.uniqueCode = json.Data.UniqueCode;
_this.form.materialCode = json.Data.MaterialCode;
_this.form.materialSpec = json.Data.MaterialSpec;
_this.form.batch = json.Data.Batch;
_this.form.qty = json.Data.Qty;
$.ajax({
type: "post",
dataType: "json",
data: { code: _this.form.code, type: _this.form.type },
url: url,
success: function (json) {
if (json.Code != 200) {
_this.$message({
message: "扫描失败!" + json.Msg,
type: "warning",
duration: "10000",
});
_this.form.code = "";
} else {
_this.showTable = true;
_this.invTable = json.Data;
if (_this.invTable.length == 0
&& _this.form.type == "slbox"
&& _this.form.code.startsWith("C")) {
_this.showBack = true;
if (_this.form.type == "uniqueCode") {
_this.form.uniqueCode = json.Data.UniqueCode;
_this.form.materialCode = json.Data.MaterialCode;
_this.form.materialSpec = json.Data.MaterialSpec;
_this.form.batch = json.Data.Batch;
_this.form.qty = json.Data.Qty;
} else {
_this.showTable = true;
_this.invTable = json.Data;
if (_this.invTable.length == 0
&& _this.form.type == "slbox"
&& _this.form.code.startsWith("C")) {
_this.showBack = true;
}
}
}
}
},
error: function (json) {
_this.$message({
message: "扫描失败!",
type: "error",
duration: "10000",
});
},
});
},
error: function (json) {
_this.$message({
message: "扫描失败!",
type: "error",
duration: "10000",
});
},
});
}
},
// 拣货
onSubmit() {
@ -245,8 +254,9 @@
&& _this.form.code.startsWith("C")) {
_this.showBack = true;
}
if (_this.form.code == "uniqueCode") {
if (_this.form.type == "pk") {
_this.form.code = "";
_this.form.uniqueCode = "";
}
// 清空下面表单 不清空code
_this.form.uniqueCode = "";
@ -261,6 +271,10 @@
type: "warning",
duration: "10000",
});
if (_this.form.type == "pk"){
_this.form.code = "";
_this.form.uniqueCode = "";
}
}
},
error: function (json) {

View File

@ -2,6 +2,7 @@ using System;
using System.Linq;
using System.Threading.Tasks;
using HHWMS.Web.Models;
using Microsoft.EntityFrameworkCore;
using Quartz;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
@ -28,6 +29,29 @@ namespace HHWMS.Web
{
_unitwork.BatchDelete<ShipmentHeader>(x => x.FirstStatus == ShipStatusEnum.拣货完成);
}
// 清理当前之前的状态不正确的出库单
var errorShip = _unitwork.Find<ShipmentHeader>(x =>
x.FirstStatus < ShipStatusEnum.拣货完成
&& x.FirstStatus > ShipStatusEnum.新建
&& x.CreateTime < DateTime.Now.AddDays(-1))
.Include(u => u.ShipmentDetails)
.ToList();
foreach (var ship in errorShip)
{
if (ship.ShipmentDetails.All(x => x.Status != ShipStatusEnum.新建))
{
var invs = _unitwork.Find<Inventory>(x =>
ship.ShipmentDetails.Select(y => y.UniqueCode).ToList()
.Contains(x.UniqueCode))
.Count();
if (invs == 0)
{
_unitwork.Delete(errorShip);
}
}
}
Wtm.DoLog("清理过期单据", ActionLogTypesEnum.Job, "TestJob");
#region 更新时间