调整了部分页面的查询条件

入库明细状态增加校验,
前端增加loading,禁用按钮,空提交检测
This commit is contained in:
zhougf committed 2024-05-29 00:19:43 +08:00
1 parent 40a6810713
commit 6897508f8d
26 files changed
+227 -106

No files matched your search

+18 -12
View File
@@ -201,21 +201,27 @@ namespace HHWMS.Web
if (task.Station == "1") if (task.Station == "1")
{ {
// 下发盘料出库 // 下发盘料出库
var plrTask = _unitwork.Find<TaskHeader>(x => x.TaskType.Equals(TaskTypeEnum.盘料出库) var plcTaskList = _unitwork.Find<TaskHeader>(x => x.TaskType.Equals(TaskTypeEnum.盘料出库)
&& x.ContainerCode.Contains(task.ContainerCode)) && x.ContainerCode.Contains(task.ContainerCode))
.Include(x => x.TaskDetails).FirstOrDefault(); .Include(x => x.TaskDetails)
if (plrTask != null) .ToList();
if (plcTaskList.Any())
{ {
var details = plrTask.TaskDetails.Where(x => !string.IsNullOrEmpty(x.ContainerCode) foreach (var plcTask in plcTaskList)
&& x.ContainerCode.Equals(task.ContainerCode)
&& !string.IsNullOrEmpty(x.ToLocation));
foreach (var detail in details)
{ {
detail.Status = TaskStatusEnum.待下发; var details = plcTask.TaskDetails.Where(x =>
detail.UpdateTime = DateTime.Now; !string.IsNullOrEmpty(x.ContainerCode)
&& x.ContainerCode.Equals(task.ContainerCode)
&& !string.IsNullOrEmpty(x.ToLocation));
foreach (var detail in details)
{
detail.Status = TaskStatusEnum.待下发;
detail.UpdateTime = DateTime.Now;
}
plcTask.Status = TaskStatusEnum.待下发;
_unitwork.Update(plcTask);
} }
plrTask.Status = TaskStatusEnum.待下发;
_unitwork.Update(plrTask);
} }
} }
else if (task.Station == "2") else if (task.Station == "2")
@@ -50,13 +50,13 @@ namespace HHWMS.Web
return data?.Text ?? a.ZoneCode; return data?.Text ?? a.ZoneCode;
}), }),
this.MakeGridHeader(x => x.Code, 120), this.MakeGridHeader(x => x.Code, 120),
this.MakeGridHeader(x => x.Type) this.MakeGridHeader(x => x.Type,120)
.SetFormat((a, b) => .SetFormat((a, b) =>
{ {
var data = Types.FirstOrDefault(x => x.Value.ToString() == a.Type); var data = Types.FirstOrDefault(x => x.Value.ToString() == a.Type);
return data?.Text ?? a.Type; return data?.Text ?? a.Type;
}), }),
this.MakeGridHeader(x => x.Status) this.MakeGridHeader(x => x.Status,120)
.SetFormat((a, b) => .SetFormat((a, b) =>
{ {
var data = LocationStatus.FirstOrDefault(x => x.Value.ToString() == a.Status); var data = LocationStatus.FirstOrDefault(x => x.Value.ToString() == a.Status);
@@ -1,4 +1,5 @@
using System; using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using WalkingTec.Mvvm.Core; using WalkingTec.Mvvm.Core;
@@ -10,7 +11,7 @@ namespace HHWMS.Web
public String Code { get; set; } public String Code { get; set; }
[Display(Name = "Location.Type")] [Display(Name = "Location.Type")]
public String Type { get; set; } public List<string> Type { get; set; }
[Display(Name = "Location.Status")] [Display(Name = "Location.Status")]
public String Status { get; set; } public String Status { get; set; }
@@ -19,7 +19,7 @@
<wt:display field="Entity.ContiguousCode" /> *@ <wt:display field="Entity.ContiguousCode" /> *@
</wt:row> </wt:row>
<wt:grid vm="@Model.Inventorys" height="300" hidden-checkbox="true" hidden-grid-index="true" use-local-data="true" hidden-panel="true"/> <wt:grid vm="@Model.Inventorys" height="300" hidden-checkbox="true" use-local-data="true" hidden-panel="true"/>
<wt:row align="AlignEnum.Right"> <wt:row align="AlignEnum.Right">
<wt:closebutton /> <wt:closebutton />
@@ -5,7 +5,8 @@
<wt:row items-per-row="ItemsPerRowEnum.Three"> <wt:row items-per-row="ItemsPerRowEnum.Three">
<wt:combobox field="Searcher.ZoneCode" items="ZoneCodes" /> <wt:combobox field="Searcher.ZoneCode" items="ZoneCodes" />
<wt:textbox field="Searcher.Code" /> <wt:textbox field="Searcher.Code" />
@* <wt:combobox field="Searcher.Type" items="Types" /> <wt:combobox field="Searcher.Type" items="Types" multi-select="true"/>
@*
<wt:combobox field="Searcher.Status" items="LocationStatus" /> <wt:combobox field="Searcher.Status" items="LocationStatus" />
<wt:textbox field="Searcher.Row" /> <wt:textbox field="Searcher.Row" />
<wt:textbox field="Searcher.Line" /> <wt:textbox field="Searcher.Line" />
@@ -26,27 +26,28 @@ namespace HHWMS.Web
protected override IEnumerable<IGridColumn<InventoryTransaction_View>> InitGridHeader() protected override IEnumerable<IGridColumn<InventoryTransaction_View>> InitGridHeader()
{ {
return new List<GridColumn<InventoryTransaction_View>>{ return new List<GridColumn<InventoryTransaction_View>>{
this.MakeGridHeader(x => x.ZoneCode), this.MakeGridHeader(x => x.ZoneCode,120),
this.MakeGridHeader(x => x.Type), this.MakeGridHeader(x => x.BillType,120),
this.MakeGridHeader(x => x.ContainerCode), this.MakeGridHeader(x => x.Type,230),
this.MakeGridHeader(x => x.LocationCode), this.MakeGridHeader(x => x.ContainerCode).SetHide(),
this.MakeGridHeader(x => x.MaterialCode), this.MakeGridHeader(x => x.LocationCode,150),
this.MakeGridHeader(x => x.MaterialType), this.MakeGridHeader(x => x.MaterialCode,120),
this.MakeGridHeader(x => x.MaterialName), this.MakeGridHeader(x => x.MaterialType,120),
this.MakeGridHeader(x => x.MaterialSpec), this.MakeGridHeader(x => x.MaterialName,120),
this.MakeGridHeader(x => x.MaterialUnit), this.MakeGridHeader(x => x.MaterialSpec,120),
this.MakeGridHeader(x => x.Batch), this.MakeGridHeader(x => x.MaterialUnit,120),
this.MakeGridHeader(x => x.Batch,120),
this.MakeGridHeader(x => x.Lot), this.MakeGridHeader(x => x.Lot),
this.MakeGridHeader(x => x.ManufactureDate), this.MakeGridHeader(x => x.ManufactureDate).SetHide(),
this.MakeGridHeader(x => x.ExpirationDate), this.MakeGridHeader(x => x.ExpirationDate).SetHide(),
this.MakeGridHeader(x => x.CompanyCode), this.MakeGridHeader(x => x.CompanyCode).SetHide(),
this.MakeGridHeader(x => x.SupplierCode), this.MakeGridHeader(x => x.SupplierCode),
this.MakeGridHeader(x => x.Qty), this.MakeGridHeader(x => x.Qty),
this.MakeGridHeader(x => x.BillType),
this.MakeGridHeader(x => x.SourceCode), this.MakeGridHeader(x => x.SourceCode),
this.MakeGridHeader(x => x.BillCode), this.MakeGridHeader(x => x.BillCode),
this.MakeGridHeader(x => x.BillDetailId), this.MakeGridHeader(x => x.BillDetailId),
this.MakeGridHeader(x => x.Status), this.MakeGridHeader(x => x.Status).SetHide(),
this.MakeGridHeader(x => x.CreateTime,200),
this.MakeGridHeaderAction(width: 200) this.MakeGridHeaderAction(width: 200)
}; };
} }
@@ -93,6 +94,7 @@ namespace HHWMS.Web
BillCode = x.BillCode, BillCode = x.BillCode,
BillDetailId = x.BillDetailId, BillDetailId = x.BillDetailId,
Status = x.Status, Status = x.Status,
CreateTime = x.CreateTime
}) })
.OrderBy(x => x.ID); .OrderBy(x => x.ID);
return query; return query;
@@ -14,7 +14,7 @@ namespace HHWMS.Web
{ {
[Display(Name = "Task.ZoneCode")] [Display(Name = "Task.ZoneCode")]
public String ZoneCode { get; set; } public String ZoneCode { get; set; }
[Display(Name = "InventoryTransaction.Type")] [Display(Name = "Inventory.UniqueCode")]
public String Type { get; set; } public String Type { get; set; }
[Display(Name = "Task.ContainerCode")] [Display(Name = "Task.ContainerCode")]
public String ContainerCode { get; set; } public String ContainerCode { get; set; }
@@ -57,30 +57,31 @@ namespace HHWMS.Web
}), }),
this.MakeGridHeader(x => x.UniqueCode).SetWidth(230), this.MakeGridHeader(x => x.UniqueCode).SetWidth(230),
this.MakeGridHeader(x => x.ContainerCode).SetHide(), this.MakeGridHeader(x => x.ContainerCode).SetHide(),
this.MakeGridHeader(x => x.LocationCode), this.MakeGridHeader(x => x.LocationCode,150),
this.MakeGridHeader(x => x.MaterialCode), this.MakeGridHeader(x => x.MaterialCode,120),
this.MakeGridHeader(x => x.MaterialType), this.MakeGridHeader(x => x.MaterialType,120),
this.MakeGridHeader(x => x.MaterialName), this.MakeGridHeader(x => x.MaterialName,120),
this.MakeGridHeader(x => x.MaterialSpec), this.MakeGridHeader(x => x.MaterialSpec,120),
this.MakeGridHeader(x => x.MaterialUnit), this.MakeGridHeader(x => x.MaterialUnit),
this.MakeGridHeader(x => x.Batch), this.MakeGridHeader(x => x.Batch,120),
this.MakeGridHeader(x => x.Lot), this.MakeGridHeader(x => x.Lot,80),
//this.MakeGridHeader(x => x.ManufactureDate), //this.MakeGridHeader(x => x.ManufactureDate),
//this.MakeGridHeader(x => x.ExpirationDate), //this.MakeGridHeader(x => x.ExpirationDate),
//this.MakeGridHeader(x => x.CompanyCode), //this.MakeGridHeader(x => x.CompanyCode),
//this.MakeGridHeader(x => x.SupplierCode), //this.MakeGridHeader(x => x.SupplierCode),
this.MakeGridHeader(x => x.TaskQty).SetHide(), this.MakeGridHeader(x => x.TaskQty).SetHide(),
this.MakeGridHeader(x => x.Qty), this.MakeGridHeader(x => x.Qty,80),
//this.MakeGridHeader(x => x.SourceCode), //this.MakeGridHeader(x => x.SourceCode),
//this.MakeGridHeader(x => x.ReceiptCode), //this.MakeGridHeader(x => x.ReceiptCode),
//this.MakeGridHeader(x => x.ReceiptDetailId), //this.MakeGridHeader(x => x.ReceiptDetailId),
//this.MakeGridHeader(x => x.Status), //this.MakeGridHeader(x => x.Status),
this.MakeGridHeader(x => x.TaskStatus) this.MakeGridHeader(x => x.TaskStatus,120)
.SetFormat((a, b) => .SetFormat((a, b) =>
{ {
var data = InventoryTaskStatus.FirstOrDefault(x => x.Value.ToString() == a.TaskStatus); var data = InventoryTaskStatus.FirstOrDefault(x => x.Value.ToString() == a.TaskStatus);
return data?.Text ?? a.TaskStatus; return data?.Text ?? a.TaskStatus;
}), }),
this.MakeGridHeader(x => x.CreateTime,220),
this.MakeGridHeaderAction(width: 200) this.MakeGridHeaderAction(width: 200)
}; };
} }
@@ -122,7 +123,7 @@ namespace HHWMS.Web
.CheckContain(Searcher.Lot, x => x.Lot) .CheckContain(Searcher.Lot, x => x.Lot)
.CheckContain(Searcher.SourceCode, x => x.SourceCode) .CheckContain(Searcher.SourceCode, x => x.SourceCode)
.CheckContain(Searcher.ReceiptCode, x => x.ReceiptCode) .CheckContain(Searcher.ReceiptCode, x => x.ReceiptCode)
.CheckContain(Searcher.Status, x => x.Status) .CheckContain(Searcher.TaskStatus, x => x.Status)
.Select(x => new Inventory_View .Select(x => new Inventory_View
{ {
ID = x.ID, ID = x.ID,
@@ -148,6 +149,7 @@ namespace HHWMS.Web
ReceiptDetailId = x.ReceiptDetailId, ReceiptDetailId = x.ReceiptDetailId,
Status = x.Status, Status = x.Status,
TaskStatus = x.TaskStatus, TaskStatus = x.TaskStatus,
CreateTime = x.CreateTime,
}) })
.OrderBy(x => x.ID); .OrderBy(x => x.ID);
return query; return query;
@@ -6,6 +6,7 @@ using System.Threading.Tasks;
using WalkingTec.Mvvm.Core; using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions; using WalkingTec.Mvvm.Core.Extensions;
using HHWMS.Web; using HHWMS.Web;
using HHWMS.Web.Models;
namespace HHWMS.Web namespace HHWMS.Web
@@ -14,8 +15,10 @@ namespace HHWMS.Web
{ {
[Display(Name = "Task.ZoneCode")] [Display(Name = "Task.ZoneCode")]
public String ZoneCode { get; set; } public String ZoneCode { get; set; }
[Display(Name = "Inventory.LocationCode")] [Display(Name = "Container.LocationCode")]
public String LocationCode { get; set; } public String LocationCode { get; set; }
[Display(Name = "Inventory.TaskStatus", Description = "任务状态")]
public string TaskStatus { get; set; }
[Display(Name = "Inventory.UniqueCode")] [Display(Name = "Inventory.UniqueCode")]
public String UniqueCode { get; set; } public String UniqueCode { get; set; }
[Display(Name = "Inventory.MaterialCode")] [Display(Name = "Inventory.MaterialCode")]
@@ -6,7 +6,9 @@
<wt:combobox field="Searcher.ZoneCode" items="ZoneCodes" /> <wt:combobox field="Searcher.ZoneCode" items="ZoneCodes" />
<wt:textbox field="Searcher.UniqueCode" /> <wt:textbox field="Searcher.UniqueCode" />
<wt:textbox field="Searcher.MaterialCode" /> <wt:textbox field="Searcher.MaterialCode" />
<wt:textbox field="Searcher.Batch" /> <wt:textbox field="Searcher.Batch" />
<wt:combobox field="Searcher.TaskStatus" items="InventoryTaskStatus" />
<wt:textbox field="Searcher.LocationCode" />
@*<wt:textbox field="Searcher.MaterialType" /> @*<wt:textbox field="Searcher.MaterialType" />
<wt:textbox field="Searcher.MaterialName" /> <wt:textbox field="Searcher.MaterialName" />
<wt:textbox field="Searcher.MaterialSpec" /> <wt:textbox field="Searcher.MaterialSpec" />
@@ -142,6 +142,19 @@ namespace HHWMS.Web.Controllers
{ {
try try
{ {
var errDetails = _unitWork.Find<ReceiptDetail>(x => data.Select(x => x.UniqueCode).ToList()
.Contains(x.UniqueCode)
&& x.Status != ReceiptStatusEnum.新建).ToList();
if (errDetails.Any())
{
var msg = "以下明细不是新建状态:\n";
foreach (var errDetail in errDetails)
{
msg += $"{errDetail.UniqueCode}\n";
}
return JsonMore(null, 500, msg);
}
var receiptHeaderList = _unitWork.Find<ReceiptHeader>(x => var receiptHeaderList = _unitWork.Find<ReceiptHeader>(x =>
data.Select(x => x.ReceiptCode).ToList().Contains(x.Code)) data.Select(x => x.ReceiptCode).ToList().Contains(x.Code))
.Include(x => x.ReceiptDetails).ToList(); .Include(x => x.ReceiptDetails).ToList();
@@ -159,12 +159,26 @@ public class ReceiptSLInController : BaseController
{ {
try try
{ {
var errDetails = _unitWork.Find<ReceiptDetail>(x => data.Select(x => x.UniqueCode).ToList()
.Contains(x.UniqueCode)
&& x.Status != ReceiptStatusEnum.新建).ToList();
if (errDetails.Any())
{
var msg = "以下明细不是新建状态:\n";
foreach (var errDetail in errDetails)
{
msg += $"{errDetail.UniqueCode}\n";
}
return JsonMore(null, 500, msg);
}
// 查找明细,修改对应状态,并且 绑定物料周转箱 // 查找明细,修改对应状态,并且 绑定物料周转箱
foreach (Binding item in data.OrderBy(x => x.ReceiptCode)) foreach (Binding item in data.OrderBy(x => x.ReceiptCode))
{ {
// 更新入库单明细状态 // 更新入库单明细状态
var header = receiptHeaderList.Find(x => x.ID.ToString().Equals(item.ReceiptCode)); var header = receiptHeaderList.Find(x => x.ID.ToString().Equals(item.ReceiptCode));
var receipt = header.ReceiptDetails.FirstOrDefault(x => x.UniqueCode.Equals(item.UniqueCode)); var receipt = header.ReceiptDetails.FirstOrDefault(x => x.UniqueCode.Equals(item.UniqueCode)
&& x.Status == ReceiptStatusEnum.新建);
if (receipt != null) if (receipt != null)
{ {
if (receipt.Status == ReceiptStatusEnum.收完) continue; if (receipt.Status == ReceiptStatusEnum.收完) continue;
@@ -2,6 +2,8 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Reflection.Emit; using System.Reflection.Emit;
using System.Threading;
using System.Threading.Tasks;
using HHWMS.Web.Models; using HHWMS.Web.Models;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
@@ -71,12 +73,27 @@ public class ReceiptShelfInController : BaseController
{ {
try try
{ {
var errDetails = _unitWork.Find<ReceiptDetail>(x => data.Select(x => x.UniqueCode).ToList()
.Contains(x.UniqueCode)
&& x.Status != ReceiptStatusEnum.新建).ToList();
if (errDetails.Any())
{
var msg = "以下明细不是新建状态:\n";
foreach (var errDetail in errDetails)
{
msg += $"{errDetail.UniqueCode}\n";
}
return JsonMore(null, 500, msg);
}
// 查找明细,修改对应状态,并且 绑定物料周转箱 // 查找明细,修改对应状态,并且 绑定物料周转箱
foreach (Binding item in data.OrderBy(x => x.ReceiptCode)) foreach (Binding item in data.OrderBy(x => x.ReceiptCode))
{ {
// 更新入库单明细状态 // 更新入库单明细状态
var header = receiptHeaderList.Find(x => x.ID.ToString().Equals(item.ReceiptCode)); var header = receiptHeaderList.Find(x => x.ID.ToString().Equals(item.ReceiptCode));
var receipt = header.ReceiptDetails.FirstOrDefault(x => x.UniqueCode.Equals(item.UniqueCode)); var receipt = header.ReceiptDetails.FirstOrDefault(x => x.UniqueCode.Equals(item.UniqueCode)
&& x.Status == ReceiptStatusEnum.新建
);
if (receipt != null) if (receipt != null)
{ {
receipt.Status = ReceiptStatusEnum.收完; receipt.Status = ReceiptStatusEnum.收完;
@@ -88,7 +105,7 @@ public class ReceiptShelfInController : BaseController
} }
else else
{ {
throw new Exception($"入库单{item.ReceiptCode}不存在{item.UniqueCode}的明细!"); throw new Exception($"入库单{item.ReceiptCode}不存在{item.UniqueCode}的新建状态明细!");
} }
// 新建库存 // 新建库存
@@ -110,29 +127,28 @@ public class ReceiptShelfInController : BaseController
TaskStatus = InventoryTaskStatus.无任务, TaskStatus = InventoryTaskStatus.无任务,
CreateBy = Wtm.LoginUserInfo.ITCode, CreateBy = Wtm.LoginUserInfo.ITCode,
CreateTime = DateTime.Now CreateTime = DateTime.Now
}); ; });
}
foreach (var inv in invList) foreach (var inv in invList)
{
listInvtran.Add(new InventoryTransaction
{ {
listInvtran.Add(new InventoryTransaction BillType = "in",
{ ZoneCode = inv.ZoneCode,
BillType = "in", Type = inv.UniqueCode,
ZoneCode = inv.ZoneCode, MaterialCode = inv.MaterialCode,
Type = inv.UniqueCode, MaterialName = inv.MaterialName,
MaterialCode = inv.MaterialCode, MaterialSpec = inv.MaterialSpec,
MaterialName = inv.MaterialName, MaterialUnit = inv.MaterialUnit,
MaterialSpec = inv.MaterialSpec, MaterialType = inv.MaterialType,
MaterialUnit = inv.MaterialUnit, Batch = inv.Batch,
MaterialType = inv.MaterialType, Lot = inv.Lot,
Batch = inv.Batch, CompanyCode = inv.CompanyCode,
Lot = inv.Lot, LocationCode = inv.LocationCode,
CompanyCode = inv.CompanyCode, SupplierCode = inv.SupplierCode,
LocationCode = inv.LocationCode, Qty = inv.Qty,
SupplierCode = inv.SupplierCode, CreateTime = DateTime.Now
Qty = inv.Qty, });
CreateTime = DateTime.Now
});
}
} }
_unitWork.BatchAdd(invList.ToArray()); _unitWork.BatchAdd(invList.ToArray());
_unitWork.BatchAdd(listInvtran.ToArray()); _unitWork.BatchAdd(listInvtran.ToArray());
@@ -66,7 +66,7 @@
<el-table-column label="料盘尺寸" align="center" prop="size" :formatter="sizeFormatter"></el-table-column> <el-table-column label="料盘尺寸" align="center" prop="size" :formatter="sizeFormatter"></el-table-column>
</el-table> </el-table>
<el-form-item style="float:right"> <el-form-item style="float:right">
<el-button type="primary" @@click="onSubmit">绑定入库</el-button> <el-button type="primary" @@click="onSubmit" :disabled="disabledButton">绑定入库</el-button>
<el-button @@click="resetForm('form')">重置</el-button> <el-button @@click="resetForm('form')">重置</el-button>
@* <el-button type="primary" @@click="inOperation">启动入库</el-button> *@ @* <el-button type="primary" @@click="inOperation">启动入库</el-button> *@
</el-form-item> </el-form-item>
@@ -107,7 +107,8 @@
boxCode: [ boxCode: [
{ validator: validatePass, trigger: 'blur' } { validator: validatePass, trigger: 'blur' }
] ]
} },
disabledButton : false
} }
}, },
mounted: function () { mounted: function () {
@@ -132,7 +133,16 @@
//绑定单据 //绑定单据
onSubmit() { onSubmit() {
var _this = this; var _this = this;
if (_this.bindingData.length == 0){
_this.$message({
message: "待入库清单为空!",
type: "warning",
duration: "10000",
});
return false;
}
var loadIndex = layer.load(1);
_this.disabledButton = true;
// 提交已绑定数据 // 提交已绑定数据
$.ajax({ $.ajax({
type: "post", type: "post",
@@ -140,6 +150,8 @@
data: { data: _this.bindingData }, data: { data: _this.bindingData },
url: "/receipt/ReceiptIn/BindingData", url: "/receipt/ReceiptIn/BindingData",
success: function (json) { success: function (json) {
layer.close(loadIndex);
_this.disabledButton = false;
if (json.Code == 200) { if (json.Code == 200) {
_this.$message({ _this.$message({
message: '入库成功!', message: '入库成功!',
@@ -149,12 +161,14 @@
} }
else { else {
_this.$message({ _this.$message({
message: '入库失败!', message: '入库失败!'+json.Msg,
type: 'warning' type: 'warning'
}); });
} }
}, },
error: function (json) { error: function (json) {
layer.close(loadIndex);
_this.disabledButton = false;
_this.$message({ _this.$message({
message: '入库失败!', message: '入库失败!',
type: 'error' type: 'error'
@@ -83,7 +83,7 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-form-item style="float: right"> <el-form-item style="float: right">
<el-button type="primary" @@click="onSubmit">绑定</el-button> <el-button type="primary" @@click="onSubmit" :disabled="disabledButton">绑定</el-button>
<el-button @@click="resetForm('form')">重置</el-button> <el-button @@click="resetForm('form')">重置</el-button>
<el-button type="success" @@click="back" :disabled="disabledbackbutton">回库</el-button> <el-button type="success" @@click="back" :disabled="disabledbackbutton">回库</el-button>
</el-form-item> </el-form-item>
@@ -102,6 +102,7 @@
uniqueCode: "", uniqueCode: "",
isFull: false isFull: false
}, },
disabledButton : false,
disabledbackbutton: true,// true不可回库,false可回库 disabledbackbutton: true,// true不可回库,false可回库
boxSize: [ boxSize: [
{ label: "8mm", value: "8" }, { label: "8mm", value: "8" },
@@ -223,7 +224,16 @@
// 绑定 // 绑定
onSubmit() { onSubmit() {
var _this = this; var _this = this;
if (_this.bindingData.length == 0){
_this.$message({
message: "待入库清单为空!",
type: "warning",
duration: "10000",
});
return false;
}
var loadIndex = layer.load(1);
_this.disabledButton = true;
// 提交已绑定数据 // 提交已绑定数据
$.ajax({ $.ajax({
type: "post", type: "post",
@@ -231,6 +241,8 @@
data: { data: _this.bindingData }, data: { data: _this.bindingData },
url: "/receipt/ReceiptSLIn/BindingData", url: "/receipt/ReceiptSLIn/BindingData",
success: function (json) { success: function (json) {
layer.close(loadIndex);
_this.disabledButton = false;
if (json.Code == 200) { if (json.Code == 200) {
_this.$message({ _this.$message({
message: "绑定成功!", message: "绑定成功!",
@@ -249,6 +261,8 @@
} }
}, },
error: function (json) { error: function (json) {
layer.close(loadIndex);
_this.disabledButton = false;
_this.$message({ _this.$message({
message: "绑定失败!", message: "绑定失败!",
type: "error", type: "error",
@@ -58,7 +58,7 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-form-item style="float: right"> <el-form-item style="float: right">
<el-button type="primary" @@click="onSubmit">入库</el-button> <el-button type="primary" @@click="onSubmit" :disabled="disabledButton">入库</el-button>
<el-button @@click="resetForm('form')">重置</el-button> <el-button @@click="resetForm('form')">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
@@ -74,7 +74,8 @@
uniqueCode: "", uniqueCode: "",
locationCode: "" locationCode: ""
}, },
bindingData: [] bindingData: [],
disabledButton : false
}; };
}, },
mounted: function () { mounted: function () {
@@ -97,7 +98,16 @@
// 绑定 // 绑定
onSubmit() { onSubmit() {
var _this = this; var _this = this;
if (_this.bindingData.length == 0){
_this.$message({
message: "待入库清单为空!",
type: "warning",
duration: "10000",
});
return false;
}
var loadIndex = layer.load(1);
_this.disabledButton = true;
// 提交已绑定数据 // 提交已绑定数据
$.ajax({ $.ajax({
type: "post", type: "post",
@@ -105,6 +115,8 @@
data: { data: _this.bindingData }, data: { data: _this.bindingData },
url: "/receipt/ReceiptShelfIn/BindingData", url: "/receipt/ReceiptShelfIn/BindingData",
success: function (json) { success: function (json) {
layer.close(loadIndex);
_this.disabledButton = false;
if (json.Code == 200) { if (json.Code == 200) {
_this.$message({ _this.$message({
message: "入库成功!", message: "入库成功!",
@@ -112,13 +124,15 @@
_this.bindingData = []; _this.bindingData = [];
} else { } else {
_this.$message({ _this.$message({
message: "入库失败!", message: "入库失败!"+json.Msg,
type: "warning", type: "warning",
duration: "10000", duration: "10000",
}); });
} }
}, },
error: function (json) { error: function (json) {
layer.close(loadIndex);
_this.disabledButton = false;
_this.$message({ _this.$message({
message: "入库失败!", message: "入库失败!",
type: "error", type: "error",
@@ -135,7 +149,14 @@
// 扫描唯一码 // 扫描唯一码
scanUniqueCode(data) { scanUniqueCode(data) {
var _this = this; var _this = this;
if (_this.form.locationCode == ""){
_this.$message({
message: "位置不能为空!",
type: "warning",
duration: "1000",
});
return false;
}
//1. 判断唯一码是否合理,调用后台,并返回唯一码对应的数量 //1. 判断唯一码是否合理,调用后台,并返回唯一码对应的数量
var isExit = this.bindingData.findIndex(function (value) { var isExit = this.bindingData.findIndex(function (value) {
return value.uniqueCode == data; return value.uniqueCode == data;
@@ -12,7 +12,9 @@ namespace HHWMS.Web
{ {
public partial class TaskDetailHistorySearcher : BaseSearcher public partial class TaskDetailHistorySearcher : BaseSearcher
{ {
[Display(Name = "Task.TaskNo")]
public List<ComboSelectListItem> AllTaskHeaders { get; set; } public List<ComboSelectListItem> AllTaskHeaders { get; set; }
[Display(Name = "Task.TaskNo")]
public int? TaskHeaderId { get; set; } public int? TaskHeaderId { get; set; }
[Display(Name = "Inventory.UniqueCode")] [Display(Name = "Inventory.UniqueCode")]
public String UniqueCode { get; set; } public String UniqueCode { get; set; }
@@ -55,6 +55,7 @@ namespace HHWMS.Web
public override IOrderedQueryable<TaskDetail_View> GetSearchQuery() public override IOrderedQueryable<TaskDetail_View> GetSearchQuery()
{ {
var query = DC.Set<TaskDetail>() var query = DC.Set<TaskDetail>()
.CheckEqual(Searcher.TaskHeaderId,x => x.TaskHeaderId)
.CheckContain(Searcher.UniqueCode, x=>x.UniqueCode) .CheckContain(Searcher.UniqueCode, x=>x.UniqueCode)
.CheckContain(Searcher.MaterialCode, x=>x.MaterialCode) .CheckContain(Searcher.MaterialCode, x=>x.MaterialCode)
.CheckContain(Searcher.FromLocation, x=>x.FromLocation) .CheckContain(Searcher.FromLocation, x=>x.FromLocation)
@@ -12,6 +12,8 @@ namespace HHWMS.Web
{ {
public partial class TaskDetailSearcher : BaseSearcher public partial class TaskDetailSearcher : BaseSearcher
{ {
[Display(Name = "Task.TaskNo")]
public List<ComboSelectListItem> AllTaskHeaders { get; set; }
[Display(Name = "Inventory.UniqueCode")] [Display(Name = "Inventory.UniqueCode")]
public String UniqueCode { get; set; } public String UniqueCode { get; set; }
@@ -24,10 +26,10 @@ namespace HHWMS.Web
public String FromLocation { get; set; } public String FromLocation { get; set; }
[Display(Name = "Task.ToLocation")] [Display(Name = "Task.ToLocation")]
public String ToLocation { get; set; } public String ToLocation { get; set; }
protected override void InitVM() protected override void InitVM()
{ {
AllTaskHeaders = DC.Set<TaskHeader>().GetSelectListItems(Wtm, y => y.TaskNo);
} }
} }
} }
@@ -33,16 +33,17 @@ namespace HHWMS.Web
{ {
return new List<GridColumn<TaskHeaderHistory_View>>{ return new List<GridColumn<TaskHeaderHistory_View>>{
this.MakeGridHeader(x => x.ZoneCode), this.MakeGridHeader(x => x.ZoneCode),
this.MakeGridHeader(x => x.TaskNo), this.MakeGridHeader(x => x.TaskNo).SetWidth(220),
this.MakeGridHeader(x => x.TaskType), this.MakeGridHeader(x => x.TaskType,150),
this.MakeGridHeader(x => x.FromLocation), this.MakeGridHeader(x => x.FromLocation,150),
this.MakeGridHeader(x => x.ToLocation), this.MakeGridHeader(x => x.ToLocation,150),
this.MakeGridHeader(x => x.Station), this.MakeGridHeader(x => x.Station),
this.MakeGridHeader(x => x.ContainerCode), this.MakeGridHeader(x => x.ContainerCode,150),
this.MakeGridHeader(x => x.RoadWay).SetHide(), this.MakeGridHeader(x => x.RoadWay).SetHide(),
this.MakeGridHeader(x => x.Priority).SetHide(), this.MakeGridHeader(x => x.Priority).SetHide(),
this.MakeGridHeader(x => x.Status), this.MakeGridHeader(x => x.Status,150),
this.MakeGridHeader(x => x.ErrorMsg), this.MakeGridHeader(x => x.ErrorMsg),
this.MakeGridHeader(x => x.CreateTime,220),
this.MakeGridHeaderAction(width: 200) this.MakeGridHeaderAction(width: 200)
}; };
} }
@@ -72,6 +73,7 @@ namespace HHWMS.Web
Priority = x.Priority, Priority = x.Priority,
Status = x.Status, Status = x.Status,
ErrorMsg = x.ErrorMsg, ErrorMsg = x.ErrorMsg,
CreateTime = x.CreateTime
}) })
.OrderBy(x => x.ID); .OrderBy(x => x.ID);
return query; return query;
@@ -68,6 +68,7 @@ namespace HHWMS.Web
this.MakeGridHeader(x => x.Status, 150), this.MakeGridHeader(x => x.Status, 150),
this.MakeGridHeader(x => x.CreateTime, 150).SetHide(), this.MakeGridHeader(x => x.CreateTime, 150).SetHide(),
this.MakeGridHeader(x => x.ErrorMsg, 150).SetHide(), this.MakeGridHeader(x => x.ErrorMsg, 150).SetHide(),
this.MakeGridHeader(x => x.CreateTime,220),
this.MakeGridHeaderAction(width: 200) this.MakeGridHeaderAction(width: 200)
}; };
} }
@@ -97,6 +98,7 @@ namespace HHWMS.Web
Priority = x.Priority, Priority = x.Priority,
Status = x.Status, Status = x.Status,
ErrorMsg = x.ErrorMsg, ErrorMsg = x.ErrorMsg,
CreateTime = x.CreateTime
}) })
.OrderByDescending(x => x.ID); .OrderByDescending(x => x.ID);
return query; return query;
@@ -2,11 +2,13 @@
@inject IStringLocalizer<Program> Localizer; @inject IStringLocalizer<Program> Localizer;
<wt:searchpanel vm="@Model" reset-btn="true"> <wt:searchpanel vm="@Model" reset-btn="true">
<wt:row items-per-row="ItemsPerRowEnum.Three"> <wt:row items-per-row="ItemsPerRowEnum.Three">
<wt:textbox field="Searcher.UniqueCode" /> <wt:combobox field="Searcher.TaskHeaderId" items="Searcher.AllTaskHeaders" empty-text="@Localizer["Sys.All"]" />
<wt:textbox field="Searcher.MaterialCode" />
<wt:textbox field="Searcher.FromLocation" /> <wt:textbox field="Searcher.UniqueCode"/>
<wt:textbox field="Searcher.ToLocation" /> <wt:textbox field="Searcher.MaterialCode"/>
</wt:row> <wt:textbox field="Searcher.FromLocation"/>
<wt:textbox field="Searcher.ToLocation"/>
</wt:row>
</wt:searchpanel> </wt:searchpanel>
<wt:grid vm="@Model" url="/taskManage/TaskDetail/Search"/> <wt:grid vm="@Model" url="/taskManage/TaskDetail/Search"/>
+1 -1
View File
@@ -95,7 +95,7 @@ namespace HHWMS.Web
protected override void OnModelCreating(ModelBuilder modelBuilder) protected override void OnModelCreating(ModelBuilder modelBuilder)
{ {
base.OnModelCreating(modelBuilder); base.OnModelCreating(modelBuilder);
// ef生成表 添加字段注释,只有本项目的表才添加,需要在DisplayAttribute,添加Description // ef生成表 添加字段注释,只有本项目的表才添加,需要在DisplayAttribute,添加Description
var ddd = modelBuilder.Model.GetEntityTypes(); var ddd = modelBuilder.Model.GetEntityTypes();
ddd = ddd.Where(x => x.ClrType.FullName.Contains("HHWMS.Web")).ToList(); ddd = ddd.Where(x => x.ClrType.FullName.Contains("HHWMS.Web")).ToList();
+2 -1
View File
@@ -1,6 +1,7 @@
using System; using System;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Internal; using Microsoft.EntityFrameworkCore.Metadata.Internal;
using WalkingTec.Mvvm.Core; using WalkingTec.Mvvm.Core;
@@ -24,7 +25,7 @@ namespace HHWMS.Web.Models
[Display(Name = "Container.LocationCode", Description = "库位编码")] [Display(Name = "Container.LocationCode", Description = "库位编码")]
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")] [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
public string LocationCode { get; set; } public string LocationCode { get; set; }
[Display(Name = "Inventory.UniqueCode", Description = "唯一编码")] [Display(Name = "Inventory.UniqueCode", Description = "唯一编码")]
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")] [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
public string UniqueCode { get; set; } public string UniqueCode { get; set; }
@@ -17,7 +17,7 @@ namespace HHWMS.Web.Models
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")] [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
public string ZoneCode { get; set; } public string ZoneCode { get; set; }
[Display(Name = "InventoryTransaction.Type", Description = "交易类型")] [Display(Name = "Inventory.UniqueCode")]
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")] [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
public string Type { get; set; } public string Type { get; set; }
+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=8wms;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=8wms;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",