diff --git a/HHWMS.Web/Areas/Api/IWCSController.cs b/HHWMS.Web/Areas/Api/IWCSController.cs index 311ea1c..12d8563 100644 --- a/HHWMS.Web/Areas/Api/IWCSController.cs +++ b/HHWMS.Web/Areas/Api/IWCSController.cs @@ -201,21 +201,27 @@ namespace HHWMS.Web if (task.Station == "1") { // 下发盘料出库 - var plrTask = _unitwork.Find(x => x.TaskType.Equals(TaskTypeEnum.盘料出库) - && x.ContainerCode.Contains(task.ContainerCode)) - .Include(x => x.TaskDetails).FirstOrDefault(); - if (plrTask != null) + var plcTaskList = _unitwork.Find(x => x.TaskType.Equals(TaskTypeEnum.盘料出库) + && x.ContainerCode.Contains(task.ContainerCode)) + .Include(x => x.TaskDetails) + .ToList(); + if (plcTaskList.Any()) { - var details = plrTask.TaskDetails.Where(x => !string.IsNullOrEmpty(x.ContainerCode) - && x.ContainerCode.Equals(task.ContainerCode) - && !string.IsNullOrEmpty(x.ToLocation)); - foreach (var detail in details) + foreach (var plcTask in plcTaskList) { - detail.Status = TaskStatusEnum.待下发; - detail.UpdateTime = DateTime.Now; + var details = plcTask.TaskDetails.Where(x => + !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") diff --git a/HHWMS.Web/Areas/Configs/ViewModels/LocationVMs/LocationListVM.cs b/HHWMS.Web/Areas/Configs/ViewModels/LocationVMs/LocationListVM.cs index b69dc67..647b5ff 100644 --- a/HHWMS.Web/Areas/Configs/ViewModels/LocationVMs/LocationListVM.cs +++ b/HHWMS.Web/Areas/Configs/ViewModels/LocationVMs/LocationListVM.cs @@ -50,13 +50,13 @@ namespace HHWMS.Web return data?.Text ?? a.ZoneCode; }), this.MakeGridHeader(x => x.Code, 120), - this.MakeGridHeader(x => x.Type) + this.MakeGridHeader(x => x.Type,120) .SetFormat((a, b) => { var data = Types.FirstOrDefault(x => x.Value.ToString() == a.Type); return data?.Text ?? a.Type; }), - this.MakeGridHeader(x => x.Status) + this.MakeGridHeader(x => x.Status,120) .SetFormat((a, b) => { var data = LocationStatus.FirstOrDefault(x => x.Value.ToString() == a.Status); diff --git a/HHWMS.Web/Areas/Configs/ViewModels/LocationVMs/LocationSearcher.cs b/HHWMS.Web/Areas/Configs/ViewModels/LocationVMs/LocationSearcher.cs index 6eb7d2e..7e709f5 100644 --- a/HHWMS.Web/Areas/Configs/ViewModels/LocationVMs/LocationSearcher.cs +++ b/HHWMS.Web/Areas/Configs/ViewModels/LocationVMs/LocationSearcher.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using WalkingTec.Mvvm.Core; @@ -10,7 +11,7 @@ namespace HHWMS.Web public String Code { get; set; } [Display(Name = "Location.Type")] - public String Type { get; set; } + public List Type { get; set; } [Display(Name = "Location.Status")] public String Status { get; set; } diff --git a/HHWMS.Web/Areas/Configs/Views/Location/Details.cshtml b/HHWMS.Web/Areas/Configs/Views/Location/Details.cshtml index 5c72f80..5117071 100644 --- a/HHWMS.Web/Areas/Configs/Views/Location/Details.cshtml +++ b/HHWMS.Web/Areas/Configs/Views/Location/Details.cshtml @@ -19,7 +19,7 @@ *@ - + diff --git a/HHWMS.Web/Areas/Configs/Views/Location/Index.cshtml b/HHWMS.Web/Areas/Configs/Views/Location/Index.cshtml index 0b53a0c..c7eeecc 100644 --- a/HHWMS.Web/Areas/Configs/Views/Location/Index.cshtml +++ b/HHWMS.Web/Areas/Configs/Views/Location/Index.cshtml @@ -5,7 +5,8 @@ -@* + +@* diff --git a/HHWMS.Web/Areas/Inventory/ViewModels/InventoryTransactionVMs/InventoryTransactionListVM.cs b/HHWMS.Web/Areas/Inventory/ViewModels/InventoryTransactionVMs/InventoryTransactionListVM.cs index a17c810..e959495 100644 --- a/HHWMS.Web/Areas/Inventory/ViewModels/InventoryTransactionVMs/InventoryTransactionListVM.cs +++ b/HHWMS.Web/Areas/Inventory/ViewModels/InventoryTransactionVMs/InventoryTransactionListVM.cs @@ -26,27 +26,28 @@ namespace HHWMS.Web protected override IEnumerable> InitGridHeader() { return new List>{ - this.MakeGridHeader(x => x.ZoneCode), - this.MakeGridHeader(x => x.Type), - this.MakeGridHeader(x => x.ContainerCode), - this.MakeGridHeader(x => x.LocationCode), - this.MakeGridHeader(x => x.MaterialCode), - this.MakeGridHeader(x => x.MaterialType), - this.MakeGridHeader(x => x.MaterialName), - this.MakeGridHeader(x => x.MaterialSpec), - this.MakeGridHeader(x => x.MaterialUnit), - this.MakeGridHeader(x => x.Batch), + this.MakeGridHeader(x => x.ZoneCode,120), + this.MakeGridHeader(x => x.BillType,120), + this.MakeGridHeader(x => x.Type,230), + this.MakeGridHeader(x => x.ContainerCode).SetHide(), + this.MakeGridHeader(x => x.LocationCode,150), + this.MakeGridHeader(x => x.MaterialCode,120), + this.MakeGridHeader(x => x.MaterialType,120), + this.MakeGridHeader(x => x.MaterialName,120), + this.MakeGridHeader(x => x.MaterialSpec,120), + this.MakeGridHeader(x => x.MaterialUnit,120), + this.MakeGridHeader(x => x.Batch,120), this.MakeGridHeader(x => x.Lot), - this.MakeGridHeader(x => x.ManufactureDate), - this.MakeGridHeader(x => x.ExpirationDate), - this.MakeGridHeader(x => x.CompanyCode), + this.MakeGridHeader(x => x.ManufactureDate).SetHide(), + this.MakeGridHeader(x => x.ExpirationDate).SetHide(), + this.MakeGridHeader(x => x.CompanyCode).SetHide(), this.MakeGridHeader(x => x.SupplierCode), this.MakeGridHeader(x => x.Qty), - this.MakeGridHeader(x => x.BillType), this.MakeGridHeader(x => x.SourceCode), this.MakeGridHeader(x => x.BillCode), 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) }; } @@ -93,6 +94,7 @@ namespace HHWMS.Web BillCode = x.BillCode, BillDetailId = x.BillDetailId, Status = x.Status, + CreateTime = x.CreateTime }) .OrderBy(x => x.ID); return query; diff --git a/HHWMS.Web/Areas/Inventory/ViewModels/InventoryTransactionVMs/InventoryTransactionSearcher.cs b/HHWMS.Web/Areas/Inventory/ViewModels/InventoryTransactionVMs/InventoryTransactionSearcher.cs index 53c293c..da82e90 100644 --- a/HHWMS.Web/Areas/Inventory/ViewModels/InventoryTransactionVMs/InventoryTransactionSearcher.cs +++ b/HHWMS.Web/Areas/Inventory/ViewModels/InventoryTransactionVMs/InventoryTransactionSearcher.cs @@ -14,7 +14,7 @@ namespace HHWMS.Web { [Display(Name = "Task.ZoneCode")] public String ZoneCode { get; set; } - [Display(Name = "InventoryTransaction.Type")] + [Display(Name = "Inventory.UniqueCode")] public String Type { get; set; } [Display(Name = "Task.ContainerCode")] public String ContainerCode { get; set; } diff --git a/HHWMS.Web/Areas/Inventory/ViewModels/InventoryVMs/InventoryListVM.cs b/HHWMS.Web/Areas/Inventory/ViewModels/InventoryVMs/InventoryListVM.cs index 226060f..5a8594e 100644 --- a/HHWMS.Web/Areas/Inventory/ViewModels/InventoryVMs/InventoryListVM.cs +++ b/HHWMS.Web/Areas/Inventory/ViewModels/InventoryVMs/InventoryListVM.cs @@ -57,30 +57,31 @@ namespace HHWMS.Web }), this.MakeGridHeader(x => x.UniqueCode).SetWidth(230), this.MakeGridHeader(x => x.ContainerCode).SetHide(), - this.MakeGridHeader(x => x.LocationCode), - this.MakeGridHeader(x => x.MaterialCode), - this.MakeGridHeader(x => x.MaterialType), - this.MakeGridHeader(x => x.MaterialName), - this.MakeGridHeader(x => x.MaterialSpec), + this.MakeGridHeader(x => x.LocationCode,150), + this.MakeGridHeader(x => x.MaterialCode,120), + this.MakeGridHeader(x => x.MaterialType,120), + this.MakeGridHeader(x => x.MaterialName,120), + this.MakeGridHeader(x => x.MaterialSpec,120), this.MakeGridHeader(x => x.MaterialUnit), - this.MakeGridHeader(x => x.Batch), - this.MakeGridHeader(x => x.Lot), + this.MakeGridHeader(x => x.Batch,120), + this.MakeGridHeader(x => x.Lot,80), //this.MakeGridHeader(x => x.ManufactureDate), //this.MakeGridHeader(x => x.ExpirationDate), //this.MakeGridHeader(x => x.CompanyCode), //this.MakeGridHeader(x => x.SupplierCode), 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.ReceiptCode), //this.MakeGridHeader(x => x.ReceiptDetailId), //this.MakeGridHeader(x => x.Status), - this.MakeGridHeader(x => x.TaskStatus) + this.MakeGridHeader(x => x.TaskStatus,120) .SetFormat((a, b) => { var data = InventoryTaskStatus.FirstOrDefault(x => x.Value.ToString() == a.TaskStatus); return data?.Text ?? a.TaskStatus; }), + this.MakeGridHeader(x => x.CreateTime,220), this.MakeGridHeaderAction(width: 200) }; } @@ -122,7 +123,7 @@ namespace HHWMS.Web .CheckContain(Searcher.Lot, x => x.Lot) .CheckContain(Searcher.SourceCode, x => x.SourceCode) .CheckContain(Searcher.ReceiptCode, x => x.ReceiptCode) - .CheckContain(Searcher.Status, x => x.Status) + .CheckContain(Searcher.TaskStatus, x => x.Status) .Select(x => new Inventory_View { ID = x.ID, @@ -148,6 +149,7 @@ namespace HHWMS.Web ReceiptDetailId = x.ReceiptDetailId, Status = x.Status, TaskStatus = x.TaskStatus, + CreateTime = x.CreateTime, }) .OrderBy(x => x.ID); return query; diff --git a/HHWMS.Web/Areas/Inventory/ViewModels/InventoryVMs/InventorySearcher.cs b/HHWMS.Web/Areas/Inventory/ViewModels/InventoryVMs/InventorySearcher.cs index 364671b..53d6db7 100644 --- a/HHWMS.Web/Areas/Inventory/ViewModels/InventoryVMs/InventorySearcher.cs +++ b/HHWMS.Web/Areas/Inventory/ViewModels/InventoryVMs/InventorySearcher.cs @@ -6,6 +6,7 @@ using System.Threading.Tasks; using WalkingTec.Mvvm.Core; using WalkingTec.Mvvm.Core.Extensions; using HHWMS.Web; +using HHWMS.Web.Models; namespace HHWMS.Web @@ -14,8 +15,10 @@ namespace HHWMS.Web { [Display(Name = "Task.ZoneCode")] public String ZoneCode { get; set; } - [Display(Name = "Inventory.LocationCode")] + [Display(Name = "Container.LocationCode")] public String LocationCode { get; set; } + [Display(Name = "Inventory.TaskStatus", Description = "任务状态")] + public string TaskStatus { get; set; } [Display(Name = "Inventory.UniqueCode")] public String UniqueCode { get; set; } [Display(Name = "Inventory.MaterialCode")] diff --git a/HHWMS.Web/Areas/Inventory/Views/Inventory/Index.cshtml b/HHWMS.Web/Areas/Inventory/Views/Inventory/Index.cshtml index 91867e1..00fbb9e 100644 --- a/HHWMS.Web/Areas/Inventory/Views/Inventory/Index.cshtml +++ b/HHWMS.Web/Areas/Inventory/Views/Inventory/Index.cshtml @@ -6,7 +6,9 @@ - + + + @* diff --git a/HHWMS.Web/Areas/Receipt/Controllers/ReceiptInController.cs b/HHWMS.Web/Areas/Receipt/Controllers/ReceiptInController.cs index c2d2919..e4e4bb3 100644 --- a/HHWMS.Web/Areas/Receipt/Controllers/ReceiptInController.cs +++ b/HHWMS.Web/Areas/Receipt/Controllers/ReceiptInController.cs @@ -142,6 +142,19 @@ namespace HHWMS.Web.Controllers { try { + var errDetails = _unitWork.Find(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(x => data.Select(x => x.ReceiptCode).ToList().Contains(x.Code)) .Include(x => x.ReceiptDetails).ToList(); diff --git a/HHWMS.Web/Areas/Receipt/Controllers/ReceiptSLInController.cs b/HHWMS.Web/Areas/Receipt/Controllers/ReceiptSLInController.cs index ded9a2c..5dea503 100644 --- a/HHWMS.Web/Areas/Receipt/Controllers/ReceiptSLInController.cs +++ b/HHWMS.Web/Areas/Receipt/Controllers/ReceiptSLInController.cs @@ -159,12 +159,26 @@ public class ReceiptSLInController : BaseController { try { + var errDetails = _unitWork.Find(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)) { // 更新入库单明细状态 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.Status == ReceiptStatusEnum.收完) continue; diff --git a/HHWMS.Web/Areas/Receipt/Controllers/ReceiptShelfInController.cs b/HHWMS.Web/Areas/Receipt/Controllers/ReceiptShelfInController.cs index 1ce7479..4befa50 100644 --- a/HHWMS.Web/Areas/Receipt/Controllers/ReceiptShelfInController.cs +++ b/HHWMS.Web/Areas/Receipt/Controllers/ReceiptShelfInController.cs @@ -2,6 +2,8 @@ using System; using System.Collections.Generic; using System.Linq; using System.Reflection.Emit; +using System.Threading; +using System.Threading.Tasks; using HHWMS.Web.Models; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; @@ -71,12 +73,27 @@ public class ReceiptShelfInController : BaseController { try { + var errDetails = _unitWork.Find(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)) { // 更新入库单明细状态 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) { receipt.Status = ReceiptStatusEnum.收完; @@ -88,7 +105,7 @@ public class ReceiptShelfInController : BaseController } 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.无任务, CreateBy = Wtm.LoginUserInfo.ITCode, 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, - Type = inv.UniqueCode, - MaterialCode = inv.MaterialCode, - MaterialName = inv.MaterialName, - MaterialSpec = inv.MaterialSpec, - MaterialUnit = inv.MaterialUnit, - MaterialType = inv.MaterialType, - Batch = inv.Batch, - Lot = inv.Lot, - CompanyCode = inv.CompanyCode, - LocationCode = inv.LocationCode, - SupplierCode = inv.SupplierCode, - Qty = inv.Qty, - CreateTime = DateTime.Now - }); - } + BillType = "in", + ZoneCode = inv.ZoneCode, + Type = inv.UniqueCode, + MaterialCode = inv.MaterialCode, + MaterialName = inv.MaterialName, + MaterialSpec = inv.MaterialSpec, + MaterialUnit = inv.MaterialUnit, + MaterialType = inv.MaterialType, + Batch = inv.Batch, + Lot = inv.Lot, + CompanyCode = inv.CompanyCode, + LocationCode = inv.LocationCode, + SupplierCode = inv.SupplierCode, + Qty = inv.Qty, + CreateTime = DateTime.Now + }); } _unitWork.BatchAdd(invList.ToArray()); _unitWork.BatchAdd(listInvtran.ToArray()); diff --git a/HHWMS.Web/Areas/Receipt/Views/ReceiptIn/Index.cshtml b/HHWMS.Web/Areas/Receipt/Views/ReceiptIn/Index.cshtml index e578c11..3f2e158 100644 --- a/HHWMS.Web/Areas/Receipt/Views/ReceiptIn/Index.cshtml +++ b/HHWMS.Web/Areas/Receipt/Views/ReceiptIn/Index.cshtml @@ -66,7 +66,7 @@ - 绑定入库 + 绑定入库 重置 @* 启动入库 *@ @@ -107,7 +107,8 @@ boxCode: [ { validator: validatePass, trigger: 'blur' } ] - } + }, + disabledButton : false } }, mounted: function () { @@ -132,7 +133,16 @@ //绑定单据 onSubmit() { 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({ type: "post", @@ -140,6 +150,8 @@ data: { data: _this.bindingData }, url: "/receipt/ReceiptIn/BindingData", success: function (json) { + layer.close(loadIndex); + _this.disabledButton = false; if (json.Code == 200) { _this.$message({ message: '入库成功!', @@ -149,12 +161,14 @@ } else { _this.$message({ - message: '入库失败!', + message: '入库失败!'+json.Msg, type: 'warning' }); } }, error: function (json) { + layer.close(loadIndex); + _this.disabledButton = false; _this.$message({ message: '入库失败!', type: 'error' diff --git a/HHWMS.Web/Areas/Receipt/Views/ReceiptSLIn/Index.cshtml b/HHWMS.Web/Areas/Receipt/Views/ReceiptSLIn/Index.cshtml index a85a025..f7b32b3 100644 --- a/HHWMS.Web/Areas/Receipt/Views/ReceiptSLIn/Index.cshtml +++ b/HHWMS.Web/Areas/Receipt/Views/ReceiptSLIn/Index.cshtml @@ -83,7 +83,7 @@ - 绑定 + 绑定 重置 回库 @@ -102,6 +102,7 @@ uniqueCode: "", isFull: false }, + disabledButton : false, disabledbackbutton: true,// true不可回库,false可回库 boxSize: [ { label: "8mm", value: "8" }, @@ -223,7 +224,16 @@ // 绑定 onSubmit() { 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({ type: "post", @@ -231,6 +241,8 @@ data: { data: _this.bindingData }, url: "/receipt/ReceiptSLIn/BindingData", success: function (json) { + layer.close(loadIndex); + _this.disabledButton = false; if (json.Code == 200) { _this.$message({ message: "绑定成功!", @@ -249,6 +261,8 @@ } }, error: function (json) { + layer.close(loadIndex); + _this.disabledButton = false; _this.$message({ message: "绑定失败!", type: "error", diff --git a/HHWMS.Web/Areas/Receipt/Views/ReceiptShelfIn/Index.cshtml b/HHWMS.Web/Areas/Receipt/Views/ReceiptShelfIn/Index.cshtml index 1ee1680..4f6a46d 100644 --- a/HHWMS.Web/Areas/Receipt/Views/ReceiptShelfIn/Index.cshtml +++ b/HHWMS.Web/Areas/Receipt/Views/ReceiptShelfIn/Index.cshtml @@ -58,7 +58,7 @@ - 入库 + 入库 重置 @@ -74,7 +74,8 @@ uniqueCode: "", locationCode: "" }, - bindingData: [] + bindingData: [], + disabledButton : false }; }, mounted: function () { @@ -97,7 +98,16 @@ // 绑定 onSubmit() { 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({ type: "post", @@ -105,6 +115,8 @@ data: { data: _this.bindingData }, url: "/receipt/ReceiptShelfIn/BindingData", success: function (json) { + layer.close(loadIndex); + _this.disabledButton = false; if (json.Code == 200) { _this.$message({ message: "入库成功!", @@ -112,13 +124,15 @@ _this.bindingData = []; } else { _this.$message({ - message: "入库失败!", + message: "入库失败!"+json.Msg, type: "warning", duration: "10000", }); } }, error: function (json) { + layer.close(loadIndex); + _this.disabledButton = false; _this.$message({ message: "入库失败!", type: "error", @@ -135,7 +149,14 @@ // 扫描唯一码 scanUniqueCode(data) { var _this = this; - + if (_this.form.locationCode == ""){ + _this.$message({ + message: "位置不能为空!", + type: "warning", + duration: "1000", + }); + return false; + } //1. 判断唯一码是否合理,调用后台,并返回唯一码对应的数量 var isExit = this.bindingData.findIndex(function (value) { return value.uniqueCode == data; diff --git a/HHWMS.Web/Areas/TaskManage/ViewModels/TaskDetailHistoryVMs/TaskDetailHistorySearcher.cs b/HHWMS.Web/Areas/TaskManage/ViewModels/TaskDetailHistoryVMs/TaskDetailHistorySearcher.cs index 847737c..19977cf 100644 --- a/HHWMS.Web/Areas/TaskManage/ViewModels/TaskDetailHistoryVMs/TaskDetailHistorySearcher.cs +++ b/HHWMS.Web/Areas/TaskManage/ViewModels/TaskDetailHistoryVMs/TaskDetailHistorySearcher.cs @@ -12,7 +12,9 @@ namespace HHWMS.Web { public partial class TaskDetailHistorySearcher : BaseSearcher { + [Display(Name = "Task.TaskNo")] public List AllTaskHeaders { get; set; } + [Display(Name = "Task.TaskNo")] public int? TaskHeaderId { get; set; } [Display(Name = "Inventory.UniqueCode")] public String UniqueCode { get; set; } diff --git a/HHWMS.Web/Areas/TaskManage/ViewModels/TaskDetailVMs/TaskDetailListVM.cs b/HHWMS.Web/Areas/TaskManage/ViewModels/TaskDetailVMs/TaskDetailListVM.cs index c7bdffb..9660b48 100644 --- a/HHWMS.Web/Areas/TaskManage/ViewModels/TaskDetailVMs/TaskDetailListVM.cs +++ b/HHWMS.Web/Areas/TaskManage/ViewModels/TaskDetailVMs/TaskDetailListVM.cs @@ -55,6 +55,7 @@ namespace HHWMS.Web public override IOrderedQueryable GetSearchQuery() { var query = DC.Set() + .CheckEqual(Searcher.TaskHeaderId,x => x.TaskHeaderId) .CheckContain(Searcher.UniqueCode, x=>x.UniqueCode) .CheckContain(Searcher.MaterialCode, x=>x.MaterialCode) .CheckContain(Searcher.FromLocation, x=>x.FromLocation) diff --git a/HHWMS.Web/Areas/TaskManage/ViewModels/TaskDetailVMs/TaskDetailSearcher.cs b/HHWMS.Web/Areas/TaskManage/ViewModels/TaskDetailVMs/TaskDetailSearcher.cs index c931c15..83c85bb 100644 --- a/HHWMS.Web/Areas/TaskManage/ViewModels/TaskDetailVMs/TaskDetailSearcher.cs +++ b/HHWMS.Web/Areas/TaskManage/ViewModels/TaskDetailVMs/TaskDetailSearcher.cs @@ -12,6 +12,8 @@ namespace HHWMS.Web { public partial class TaskDetailSearcher : BaseSearcher { + [Display(Name = "Task.TaskNo")] + public List AllTaskHeaders { get; set; } [Display(Name = "Inventory.UniqueCode")] public String UniqueCode { get; set; } @@ -24,10 +26,10 @@ namespace HHWMS.Web public String FromLocation { get; set; } [Display(Name = "Task.ToLocation")] public String ToLocation { get; set; } - + protected override void InitVM() { + AllTaskHeaders = DC.Set().GetSelectListItems(Wtm, y => y.TaskNo); } - } } diff --git a/HHWMS.Web/Areas/TaskManage/ViewModels/TaskHeaderHistoryVMs/TaskHeaderHistoryListVM.cs b/HHWMS.Web/Areas/TaskManage/ViewModels/TaskHeaderHistoryVMs/TaskHeaderHistoryListVM.cs index f816488..128ea0d 100644 --- a/HHWMS.Web/Areas/TaskManage/ViewModels/TaskHeaderHistoryVMs/TaskHeaderHistoryListVM.cs +++ b/HHWMS.Web/Areas/TaskManage/ViewModels/TaskHeaderHistoryVMs/TaskHeaderHistoryListVM.cs @@ -33,16 +33,17 @@ namespace HHWMS.Web { return new List>{ this.MakeGridHeader(x => x.ZoneCode), - this.MakeGridHeader(x => x.TaskNo), - this.MakeGridHeader(x => x.TaskType), - this.MakeGridHeader(x => x.FromLocation), - this.MakeGridHeader(x => x.ToLocation), + this.MakeGridHeader(x => x.TaskNo).SetWidth(220), + this.MakeGridHeader(x => x.TaskType,150), + this.MakeGridHeader(x => x.FromLocation,150), + this.MakeGridHeader(x => x.ToLocation,150), 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.Priority).SetHide(), - this.MakeGridHeader(x => x.Status), + this.MakeGridHeader(x => x.Status,150), this.MakeGridHeader(x => x.ErrorMsg), + this.MakeGridHeader(x => x.CreateTime,220), this.MakeGridHeaderAction(width: 200) }; } @@ -72,6 +73,7 @@ namespace HHWMS.Web Priority = x.Priority, Status = x.Status, ErrorMsg = x.ErrorMsg, + CreateTime = x.CreateTime }) .OrderBy(x => x.ID); return query; diff --git a/HHWMS.Web/Areas/TaskManage/ViewModels/TaskHeaderVMs/TaskHeaderListVM.cs b/HHWMS.Web/Areas/TaskManage/ViewModels/TaskHeaderVMs/TaskHeaderListVM.cs index 614ce16..1a1360b 100644 --- a/HHWMS.Web/Areas/TaskManage/ViewModels/TaskHeaderVMs/TaskHeaderListVM.cs +++ b/HHWMS.Web/Areas/TaskManage/ViewModels/TaskHeaderVMs/TaskHeaderListVM.cs @@ -68,6 +68,7 @@ namespace HHWMS.Web this.MakeGridHeader(x => x.Status, 150), this.MakeGridHeader(x => x.CreateTime, 150).SetHide(), this.MakeGridHeader(x => x.ErrorMsg, 150).SetHide(), + this.MakeGridHeader(x => x.CreateTime,220), this.MakeGridHeaderAction(width: 200) }; } @@ -97,6 +98,7 @@ namespace HHWMS.Web Priority = x.Priority, Status = x.Status, ErrorMsg = x.ErrorMsg, + CreateTime = x.CreateTime }) .OrderByDescending(x => x.ID); return query; diff --git a/HHWMS.Web/Areas/TaskManage/Views/TaskDetail/Index.cshtml b/HHWMS.Web/Areas/TaskManage/Views/TaskDetail/Index.cshtml index ca77368..025ad00 100644 --- a/HHWMS.Web/Areas/TaskManage/Views/TaskDetail/Index.cshtml +++ b/HHWMS.Web/Areas/TaskManage/Views/TaskDetail/Index.cshtml @@ -2,11 +2,13 @@ @inject IStringLocalizer Localizer; - - - - - - + + + + + + + + diff --git a/HHWMS.Web/DataContext.cs b/HHWMS.Web/DataContext.cs index af4365c..0b8d47b 100644 --- a/HHWMS.Web/DataContext.cs +++ b/HHWMS.Web/DataContext.cs @@ -95,7 +95,7 @@ namespace HHWMS.Web protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); - + // ef生成表 添加字段注释,只有本项目的表才添加,需要在DisplayAttribute,添加Description var ddd = modelBuilder.Model.GetEntityTypes(); ddd = ddd.Where(x => x.ClrType.FullName.Contains("HHWMS.Web")).ToList(); diff --git a/HHWMS.Web/Models/Inventory/Inventory.cs b/HHWMS.Web/Models/Inventory/Inventory.cs index 4bd3458..9b789de 100644 --- a/HHWMS.Web/Models/Inventory/Inventory.cs +++ b/HHWMS.Web/Models/Inventory/Inventory.cs @@ -1,6 +1,7 @@ using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Internal; using WalkingTec.Mvvm.Core; @@ -24,7 +25,7 @@ namespace HHWMS.Web.Models [Display(Name = "Container.LocationCode", Description = "库位编码")] [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")] public string LocationCode { get; set; } - + [Display(Name = "Inventory.UniqueCode", Description = "唯一编码")] [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")] public string UniqueCode { get; set; } diff --git a/HHWMS.Web/Models/Inventory/InventoryTransaction.cs b/HHWMS.Web/Models/Inventory/InventoryTransaction.cs index 5e84dc9..53069b5 100644 --- a/HHWMS.Web/Models/Inventory/InventoryTransaction.cs +++ b/HHWMS.Web/Models/Inventory/InventoryTransaction.cs @@ -17,7 +17,7 @@ namespace HHWMS.Web.Models [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")] public string ZoneCode { get; set; } - [Display(Name = "InventoryTransaction.Type", Description = "交易类型")] + [Display(Name = "Inventory.UniqueCode")] [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")] public string Type { get; set; } diff --git a/HHWMS.Web/appsettings.json b/HHWMS.Web/appsettings.json index 170fe01..c58d986 100644 --- a/HHWMS.Web/appsettings.json +++ b/HHWMS.Web/appsettings.json @@ -22,17 +22,17 @@ }, "Connections": [ - //{ - // "Key": "default", - // "Value": "Server=127.0.0.1;Port=3306;Database=8357wms;Uid=root;Password=abc123*;Character Set=utf8mb4;", - // "DBType": "mysql" - //} { "Key": "default", - "Value": "Data Source=.;Initial Catalog=8357wms;User=sa;Password=abc123*;Persist Security Info=True", - "DbContext": "DataContext", - "DBType": "sqlserver" //DataBase, you can choose mysql,sqlserver,pgsql,sqlite,oracle + "Value": "Server=127.0.0.1;Port=3306;Database=8wms;Uid=root;Password=abc123*;Character Set=utf8mb4;", + "DBType": "mysql" } +// { +// "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", // "Value": "Data Source=10.18.106.4;Initial Catalog=8357wms;User=wms;Password=abc123*;Persist Security Info=True",