From 663769f80e2c3a018258422b3ffc85a096ecd0c6 Mon Sep 17 00:00:00 2001 From: zgf Date: Wed, 3 Jan 2024 02:04:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A5=E5=BA=93=E5=8D=95=E6=96=B0=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../XWMS/Controllers/Material2Controller.cs | 231 ++++++++++++++++ .../Controllers/ReceiptDetail2Controller.cs | 247 ++++++++++++++++++ .../Controllers/ReceiptHeader2Controller.cs | 17 ++ .../XWMS/Controllers/XWMSMFMController.cs | 7 +- .../XWMS/Controllers/XWMSPOHController.cs | 8 +- .../XWMS/Controllers/XWMSPTHController.cs | 6 +- .../XWMS/Controllers/XWMSSHIPController.cs | 13 +- .../XWMS/Controllers/XWMSSOHController.cs | 6 +- .../Material2VMs/Material2BatchVM.cs | 35 +++ .../Material2VMs/Material2ImportVM.cs | 68 +++++ .../Material2VMs/Material2ListVM.cs | 110 ++++++++ .../Material2VMs/Material2Searcher.cs | 62 +++++ .../ViewModels/Material2VMs/Material2VM.cs | 39 +++ .../ReceiptDetail2BatchVM.cs | 35 +++ .../ReceiptDetail2ImportVM.cs | 65 +++++ .../ReceiptDetail2VMs/ReceiptDetail2ListVM.cs | 122 +++++++++ .../ReceiptDetail2Searcher.cs | 58 ++++ .../ReceiptDetail2VMs/ReceiptDetail2VM.cs | 45 ++++ .../ReceiptHeader2VMs/ReceiptHeader2ListVM.cs | 50 ++-- .../ReceiptHeader2VMs/ReceiptHeader2VM.cs | 32 ++- .../XWMS/Views/Material2/BatchDelete.cshtml | 12 + .../XWMS/Views/Material2/BatchEdit.cshtml | 14 + .../Areas/XWMS/Views/Material2/Create.cshtml | 52 ++++ .../Areas/XWMS/Views/Material2/Delete.cshtml | 54 ++++ .../Areas/XWMS/Views/Material2/Details.cshtml | 51 ++++ .../Areas/XWMS/Views/Material2/Edit.cshtml | 53 ++++ .../Areas/XWMS/Views/Material2/Import.cshtml | 14 + .../Areas/XWMS/Views/Material2/Index.cshtml | 8 + .../Views/ReceiptDetail2/BatchDelete.cshtml | 12 + .../Views/ReceiptDetail2/BatchEdit.cshtml | 14 + .../XWMS/Views/ReceiptDetail2/Create.cshtml | 28 ++ .../XWMS/Views/ReceiptDetail2/Delete.cshtml | 51 ++++ .../XWMS/Views/ReceiptDetail2/Details.cshtml | 48 ++++ .../XWMS/Views/ReceiptDetail2/Edit.cshtml | 50 ++++ .../XWMS/Views/ReceiptDetail2/Import.cshtml | 14 + .../XWMS/Views/ReceiptDetail2/Index.cshtml | 8 + .../XWMS/Views/ReceiptHeader2/Create.cshtml | 33 +-- .../XWMS/Views/ReceiptHeader2/Index.cshtml | 25 +- .../Areas/XWMS/Views/XWMSPOH/Index.cshtml | 11 +- .../Areas/XWMS/Views/XWMSPTH/Index.cshtml | 9 +- .../Areas/XWMS/Views/XWMSSHIP/Index.cshtml | 29 +- .../Areas/XWMS/Views/XWMSSOH/Index.cshtml | 9 +- HHWMS.Web/DataContext.cs | 3 + HHWMS.Web/Models/XWMS/Material.cs | 223 ++++++++++++++++ HHWMS.Web/Models/XWMS/ReceiptDetail.cs | 11 + HHWMS.Web/Models/XWMS/ReceiptHeader.cs | 23 ++ HHWMS.Web/Models/XWMS/ShipmentDetail.cs | 11 + HHWMS.Web/Models/XWMS/ShipmentHeader.cs | 17 ++ HHWMS.Web/Models/XWMS/Supplier.cs | 113 ++++++++ HHWMS.Web/appsettings.json | 2 +- 50 files changed, 2164 insertions(+), 94 deletions(-) create mode 100644 HHWMS.Web/Areas/XWMS/Controllers/Material2Controller.cs create mode 100644 HHWMS.Web/Areas/XWMS/Controllers/ReceiptDetail2Controller.cs create mode 100644 HHWMS.Web/Areas/XWMS/ViewModels/Material2VMs/Material2BatchVM.cs create mode 100644 HHWMS.Web/Areas/XWMS/ViewModels/Material2VMs/Material2ImportVM.cs create mode 100644 HHWMS.Web/Areas/XWMS/ViewModels/Material2VMs/Material2ListVM.cs create mode 100644 HHWMS.Web/Areas/XWMS/ViewModels/Material2VMs/Material2Searcher.cs create mode 100644 HHWMS.Web/Areas/XWMS/ViewModels/Material2VMs/Material2VM.cs create mode 100644 HHWMS.Web/Areas/XWMS/ViewModels/ReceiptDetail2VMs/ReceiptDetail2BatchVM.cs create mode 100644 HHWMS.Web/Areas/XWMS/ViewModels/ReceiptDetail2VMs/ReceiptDetail2ImportVM.cs create mode 100644 HHWMS.Web/Areas/XWMS/ViewModels/ReceiptDetail2VMs/ReceiptDetail2ListVM.cs create mode 100644 HHWMS.Web/Areas/XWMS/ViewModels/ReceiptDetail2VMs/ReceiptDetail2Searcher.cs create mode 100644 HHWMS.Web/Areas/XWMS/ViewModels/ReceiptDetail2VMs/ReceiptDetail2VM.cs create mode 100644 HHWMS.Web/Areas/XWMS/Views/Material2/BatchDelete.cshtml create mode 100644 HHWMS.Web/Areas/XWMS/Views/Material2/BatchEdit.cshtml create mode 100644 HHWMS.Web/Areas/XWMS/Views/Material2/Create.cshtml create mode 100644 HHWMS.Web/Areas/XWMS/Views/Material2/Delete.cshtml create mode 100644 HHWMS.Web/Areas/XWMS/Views/Material2/Details.cshtml create mode 100644 HHWMS.Web/Areas/XWMS/Views/Material2/Edit.cshtml create mode 100644 HHWMS.Web/Areas/XWMS/Views/Material2/Import.cshtml create mode 100644 HHWMS.Web/Areas/XWMS/Views/Material2/Index.cshtml create mode 100644 HHWMS.Web/Areas/XWMS/Views/ReceiptDetail2/BatchDelete.cshtml create mode 100644 HHWMS.Web/Areas/XWMS/Views/ReceiptDetail2/BatchEdit.cshtml create mode 100644 HHWMS.Web/Areas/XWMS/Views/ReceiptDetail2/Create.cshtml create mode 100644 HHWMS.Web/Areas/XWMS/Views/ReceiptDetail2/Delete.cshtml create mode 100644 HHWMS.Web/Areas/XWMS/Views/ReceiptDetail2/Details.cshtml create mode 100644 HHWMS.Web/Areas/XWMS/Views/ReceiptDetail2/Edit.cshtml create mode 100644 HHWMS.Web/Areas/XWMS/Views/ReceiptDetail2/Import.cshtml create mode 100644 HHWMS.Web/Areas/XWMS/Views/ReceiptDetail2/Index.cshtml create mode 100644 HHWMS.Web/Models/XWMS/Material.cs create mode 100644 HHWMS.Web/Models/XWMS/Supplier.cs diff --git a/HHWMS.Web/Areas/XWMS/Controllers/Material2Controller.cs b/HHWMS.Web/Areas/XWMS/Controllers/Material2Controller.cs new file mode 100644 index 0000000..0df51b3 --- /dev/null +++ b/HHWMS.Web/Areas/XWMS/Controllers/Material2Controller.cs @@ -0,0 +1,231 @@ +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using System; +using WalkingTec.Mvvm.Core; +using WalkingTec.Mvvm.Mvc; +using WalkingTec.Mvvm.Core.Extensions; +using HHWMS.Web; + +namespace HHWMS.Web.Controllers +{ + [Area("xwms")] + [ActionDescription("物料基础信息")] + public partial class Material2Controller : BaseController + { + private readonly IUnitWork _unitwork; + + public Material2Controller(IUnitWork unitwork) + { + _unitwork = unitwork; + } + + #region Search + [ActionDescription("Sys.Search")] + public ActionResult Index() + { + var vm = Wtm.CreateVM(); + return PartialView(vm); + } + + [ActionDescription("Sys.Search")] + [HttpPost] + [FixConnection(CsName = "hangyong")] + public string Search(Material2Searcher searcher) + { + var dc = Wtm.CreateDC(cskey: "hangyong"); + Wtm.DC = dc; + var vm = Wtm.CreateVM(passInit: true); + if (ModelState.IsValid) + { + vm.Searcher = searcher; + return vm.GetJson(false); + } + else + { + return vm.GetError(); + } + } + + #endregion + + #region Create + [ActionDescription("Sys.Create")] + public ActionResult Create() + { + var vm = Wtm.CreateVM(); + return PartialView(vm); + } + + [HttpPost] + [ActionDescription("Sys.Create")] + public ActionResult Create(Material2VM vm) + { + if (!ModelState.IsValid) + { + return PartialView(vm); + } + else + { + vm.DoAdd(); + if (!ModelState.IsValid) + { + vm.DoReInit(); + return PartialView(vm); + } + else + { + return FFResult().CloseDialog().RefreshGrid(); + } + } + } + #endregion + + #region Edit + [ActionDescription("Sys.Edit")] + public ActionResult Edit(string id) + { + var vm = Wtm.CreateVM(id); + return PartialView(vm); + } + + [ActionDescription("Sys.Edit")] + [HttpPost] + [ValidateFormItemOnly] + public ActionResult Edit(Material2VM vm) + { + if (!ModelState.IsValid) + { + return PartialView(vm); + } + else + { + vm.DoEdit(); + if (!ModelState.IsValid) + { + vm.DoReInit(); + return PartialView(vm); + } + else + { + return FFResult().CloseDialog().RefreshGridRow(vm.Entity.ID); + } + } + } + #endregion + + #region Delete + [ActionDescription("Sys.Delete")] + public ActionResult Delete(string id) + { + var vm = Wtm.CreateVM(id); + return PartialView(vm); + } + + [ActionDescription("Sys.Delete")] + [HttpPost] + public ActionResult Delete(string id, IFormCollection nouse) + { + var vm = Wtm.CreateVM(id); + vm.DoDelete(); + if (!ModelState.IsValid) + { + return PartialView(vm); + } + else + { + return FFResult().CloseDialog().RefreshGrid(); + } + } + #endregion + + #region Details + [ActionDescription("Sys.Details")] + public ActionResult Details(string id) + { + var vm = Wtm.CreateVM(id); + return PartialView(vm); + } + #endregion + + #region BatchEdit + [HttpPost] + [ActionDescription("Sys.BatchEdit")] + public ActionResult BatchEdit(string[] IDs) + { + var vm = Wtm.CreateVM(Ids: IDs); + return PartialView(vm); + } + + [HttpPost] + [ActionDescription("Sys.BatchEdit")] + public ActionResult DoBatchEdit(Material2BatchVM vm, IFormCollection nouse) + { + if (!ModelState.IsValid || !vm.DoBatchEdit()) + { + return PartialView("BatchEdit",vm); + } + else + { + return FFResult().CloseDialog().RefreshGrid().Alert(Localizer["Sys.BatchEditSuccess", vm.Ids.Length]); + } + } + #endregion + + #region BatchDelete + [HttpPost] + [ActionDescription("Sys.BatchDelete")] + public ActionResult BatchDelete(string[] IDs) + { + var vm = Wtm.CreateVM(Ids: IDs); + return PartialView(vm); + } + + [HttpPost] + [ActionDescription("Sys.BatchDelete")] + public ActionResult DoBatchDelete(Material2BatchVM vm, IFormCollection nouse) + { + if (!ModelState.IsValid || !vm.DoBatchDelete()) + { + return PartialView("BatchDelete",vm); + } + else + { + return FFResult().CloseDialog().RefreshGrid().Alert(Localizer["Sys.BatchDeleteSuccess", vm.Ids.Length]); + } + } + #endregion + + #region Import + [ActionDescription("Sys.Import")] + public ActionResult Import() + { + var vm = Wtm.CreateVM(); + return PartialView(vm); + } + + [HttpPost] + [ActionDescription("Sys.Import")] + public ActionResult Import(Material2ImportVM vm, IFormCollection nouse) + { + if (vm.ErrorListVM.EntityList.Count > 0 || !vm.BatchSaveData()) + { + return PartialView(vm); + } + else + { + return FFResult().CloseDialog().RefreshGrid().Alert(Localizer["Sys.ImportSuccess", vm.EntityList.Count.ToString()]); + } + } + #endregion + + #region Export + [ActionDescription("Sys.Export")] + [HttpPost] + public IActionResult ExportExcel(Material2ListVM vm) + { + return vm.GetExportData(); + } + #endregion + + } +} diff --git a/HHWMS.Web/Areas/XWMS/Controllers/ReceiptDetail2Controller.cs b/HHWMS.Web/Areas/XWMS/Controllers/ReceiptDetail2Controller.cs new file mode 100644 index 0000000..de91068 --- /dev/null +++ b/HHWMS.Web/Areas/XWMS/Controllers/ReceiptDetail2Controller.cs @@ -0,0 +1,247 @@ +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using System; +using WalkingTec.Mvvm.Core; +using WalkingTec.Mvvm.Mvc; +using WalkingTec.Mvvm.Core.Extensions; +using HHWMS.Web; +using HHWMS.Web.Models; + +namespace HHWMS.Web.Controllers +{ + [Area("xwms")] + [ActionDescription("入库明细")] + public partial class ReceiptDetail2Controller : BaseController + { + private readonly IUnitWork _unitwork; + + public ReceiptDetail2Controller(IUnitWork unitwork) + { + _unitwork = unitwork; + } + + #region Search + [ActionDescription("Sys.Search")] + public ActionResult Index() + { + var vm = Wtm.CreateVM(); + return PartialView(vm); + } + + [ActionDescription("Sys.Search")] + [HttpPost] + [FixConnection(CsName = "hangyong")] + public string Search(ReceiptDetail2Searcher searcher) + { + var dc = Wtm.CreateDC(cskey: "hangyong"); + Wtm.DC = dc; + var vm = Wtm.CreateVM(passInit: true); + if (ModelState.IsValid) + { + vm.Searcher = searcher; + return vm.GetJson(false); + } + else + { + return vm.GetError(); + } + } + + [ActionDescription("Sys.Search")] + [HttpPost] + [FixConnection(CsName = "hangyong")] + public string Search2(ReceiptDetail2ListVM vm) + { + var dc = Wtm.CreateDC(cskey: "hangyong"); + Wtm.DC = dc; + vm.Searcher.Page = vm.FC.GetValue("Page"); + vm.Searcher.Limit = vm.FC.GetValue("Limit"); + return vm.GetJson(false); + } + #endregion + + #region Create + [ActionDescription("Sys.Create")] + public ActionResult Create(int id) + { + var vm = Wtm.CreateVM(); + vm.Entity.ReceiptId = id; + return PartialView(vm); + } + + [HttpPost] + [ActionDescription("Sys.Create")] + [FixConnection(CsName = "hangyong")] + public ActionResult Create(ReceiptDetail2VM vm) + { + var dc = Wtm.CreateDC(cskey: "hangyong"); + Wtm.DC = dc; + if (!ModelState.IsValid) + { + return PartialView(vm); + } + else + { + vm.DoAdd(); + if (!ModelState.IsValid) + { + vm.DoReInit(); + return PartialView(vm); + } + else + { + return FFResult().CloseDialog().RefreshGrid(index: 1); + } + } + } + #endregion + + #region Edit + [ActionDescription("Sys.Edit")] + public ActionResult Edit(string id) + { + var vm = Wtm.CreateVM(id); + return PartialView(vm); + } + + [ActionDescription("Sys.Edit")] + [HttpPost] + [ValidateFormItemOnly] + public ActionResult Edit(ReceiptDetail2VM vm) + { + if (!ModelState.IsValid) + { + return PartialView(vm); + } + else + { + vm.DoEdit(); + if (!ModelState.IsValid) + { + vm.DoReInit(); + return PartialView(vm); + } + else + { + return FFResult().CloseDialog().RefreshGridRow(vm.Entity.ID); + } + } + } + #endregion + + #region Delete + [ActionDescription("Sys.Delete")] + public ActionResult Delete(string id) + { + var vm = Wtm.CreateVM(id); + return PartialView(vm); + } + + [ActionDescription("Sys.Delete")] + [HttpPost] + public ActionResult Delete(string id, IFormCollection nouse) + { + var vm = Wtm.CreateVM(id); + vm.DoDelete(); + if (!ModelState.IsValid) + { + return PartialView(vm); + } + else + { + return FFResult().CloseDialog().RefreshGrid(); + } + } + #endregion + + #region Details + [ActionDescription("Sys.Details")] + public ActionResult Details(string id) + { + var vm = Wtm.CreateVM(id); + return PartialView(vm); + } + #endregion + + #region BatchEdit + [HttpPost] + [ActionDescription("Sys.BatchEdit")] + public ActionResult BatchEdit(string[] IDs) + { + var vm = Wtm.CreateVM(Ids: IDs); + return PartialView(vm); + } + + [HttpPost] + [ActionDescription("Sys.BatchEdit")] + public ActionResult DoBatchEdit(ReceiptDetail2BatchVM vm, IFormCollection nouse) + { + if (!ModelState.IsValid || !vm.DoBatchEdit()) + { + return PartialView("BatchEdit",vm); + } + else + { + return FFResult().CloseDialog().RefreshGrid().Alert(Localizer["Sys.BatchEditSuccess", vm.Ids.Length]); + } + } + #endregion + + #region BatchDelete + [HttpPost] + [ActionDescription("Sys.BatchDelete")] + public ActionResult BatchDelete(string[] IDs) + { + var vm = Wtm.CreateVM(Ids: IDs); + return PartialView(vm); + } + + [HttpPost] + [ActionDescription("Sys.BatchDelete")] + public ActionResult DoBatchDelete(ReceiptDetail2BatchVM vm, IFormCollection nouse) + { + if (!ModelState.IsValid || !vm.DoBatchDelete()) + { + return PartialView("BatchDelete",vm); + } + else + { + return FFResult().CloseDialog().RefreshGrid().Alert(Localizer["Sys.BatchDeleteSuccess", vm.Ids.Length]); + } + } + #endregion + + #region Import + [ActionDescription("Sys.Import")] + public ActionResult Import() + { + var vm = Wtm.CreateVM(); + return PartialView(vm); + } + + [HttpPost] + [ActionDescription("Sys.Import")] + public ActionResult Import(ReceiptDetail2ImportVM vm, IFormCollection nouse) + { + if (vm.ErrorListVM.EntityList.Count > 0 || !vm.BatchSaveData()) + { + return PartialView(vm); + } + else + { + return FFResult().CloseDialog().RefreshGrid().Alert(Localizer["Sys.ImportSuccess", vm.EntityList.Count.ToString()]); + } + } + #endregion + + #region Export + [ActionDescription("Sys.Export")] + [HttpPost] + public IActionResult ExportExcel(ReceiptDetail2ListVM vm) + { + return vm.GetExportData(); + } + #endregion + + } +} diff --git a/HHWMS.Web/Areas/XWMS/Controllers/ReceiptHeader2Controller.cs b/HHWMS.Web/Areas/XWMS/Controllers/ReceiptHeader2Controller.cs index 70572db..c2a6cb5 100644 --- a/HHWMS.Web/Areas/XWMS/Controllers/ReceiptHeader2Controller.cs +++ b/HHWMS.Web/Areas/XWMS/Controllers/ReceiptHeader2Controller.cs @@ -5,6 +5,8 @@ using WalkingTec.Mvvm.Core; using WalkingTec.Mvvm.Mvc; using WalkingTec.Mvvm.Core.Extensions; using HHWMS.Web.xwms.ViewModels.ReceiptHeader2VMs; +using HHWMS.Web.Models; +using System.Linq; namespace HHWMS.Web.Controllers { @@ -53,13 +55,28 @@ namespace HHWMS.Web.Controllers public ActionResult Create() { var vm = Wtm.CreateVM(); + vm.Entity.Type = "QTR"; + vm.Entity.UserDef2 = "HYB"; return PartialView(vm); } [HttpPost] [ActionDescription("Sys.Create")] + [FixConnection(CsName = "hangyong")] public ActionResult Create(ReceiptHeader2VM vm) { + var warehouseId = Wtm.LoginUserInfo.Groups.FirstOrDefault().GroupCode; + vm.Entity.WarehouseId = int.Parse(warehouseId); + vm.Entity.Code = _unitwork.GetSerialNumber("QTR"); + vm.Entity.FirstStatus = 0; + vm.Entity.LastStatus = 0; + vm.Entity.TotalLines = 0; + vm.Entity.TotalQty = 0; + var dc = Wtm.CreateDC(cskey: "hangyong"); + Wtm.DC = dc; + vm.Entity.SupplierName = dc.Set() + .FirstOrDefault(x => x.Code == vm.Entity.SupplierCode) + ?.Name; if (!ModelState.IsValid) { return PartialView(vm); diff --git a/HHWMS.Web/Areas/XWMS/Controllers/XWMSMFMController.cs b/HHWMS.Web/Areas/XWMS/Controllers/XWMSMFMController.cs index efba034..a2d45d8 100644 --- a/HHWMS.Web/Areas/XWMS/Controllers/XWMSMFMController.cs +++ b/HHWMS.Web/Areas/XWMS/Controllers/XWMSMFMController.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Data; using System.Linq; +using System.Web; using HHWMS.Web.Models; using MESTOWMSService; using Microsoft.AspNetCore.Mvc; @@ -99,6 +100,8 @@ public class XWMSMFMController : BaseController var shipment = new ShipmentHeader2(); shipment.Code = _unitwork.GetSerialNumber("SCC"); + shipment.SourceCode = data.FirstOrDefault().MFGNUM_0; + shipment.UserDef2 = data.FirstOrDefault().MFGLIN_0.ToString(); shipment.Type = "SCC"; shipment.FirstStatus = 0; shipment.UserDef1 = data.FirstOrDefault().MFGFCY_0; @@ -115,8 +118,8 @@ public class XWMSMFMController : BaseController detail.SourceCode = item.MFGNUM_0; detail.SourceLine = item.MFGLIN_0.ToString(); detail.MaterialCode = item.ITMREF_0; - detail.MaterialName = item.ITMDES1_0; - detail.Lot = item.ITMDES2_0; + detail.MaterialName = HttpUtility.HtmlDecode(item.ITMDES1_0); + detail.Lot = HttpUtility.HtmlDecode(item.ITMDES2_0); detail.Qty = item.THISQTYSTU; detail.Unit = item.BOMSEQ_0.ToString(); //detail.PurchasQty = item.THISQTYUOM; diff --git a/HHWMS.Web/Areas/XWMS/Controllers/XWMSPOHController.cs b/HHWMS.Web/Areas/XWMS/Controllers/XWMSPOHController.cs index 41457f6..37ff364 100644 --- a/HHWMS.Web/Areas/XWMS/Controllers/XWMSPOHController.cs +++ b/HHWMS.Web/Areas/XWMS/Controllers/XWMSPOHController.cs @@ -2,12 +2,15 @@ using System; using System.Collections.Generic; using System.Data; using System.Linq; +using System.Threading.Tasks; +using System.Web; using HHWMS.Web.Models; using MESTOWMSService; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using Newtonsoft.Json; using ServiceReference1; +using SixLabors.ImageSharp.Drawing; using WalkingTec.Mvvm.Core; using WalkingTec.Mvvm.Mvc; @@ -88,6 +91,7 @@ public class XWMSPOHController : BaseController #endregion Search [HttpPost] + [ActionDescription("Sys.Create")] [FixConnection(CsName = "hangyong")] public ActionResult Create(List data) { @@ -115,8 +119,8 @@ public class XWMSPOHController : BaseController detail.SourceCode = item.POHNUM_0; detail.SourceLine = item.POPLIN_0.ToString(); detail.MaterialCode = item.ITMREF_0; - detail.MaterialName = item.ITMDES1_0; - detail.Lot = item.ITMDES2_0; + detail.MaterialName = HttpUtility.HtmlDecode(item.ITMDES1_0); + detail.Lot = HttpUtility.HtmlDecode(item.ITMDES2_0); detail.Qty = item.THISQTYSTU; detail.Unit = item.STU_0; detail.PurchasQty = item.THISQTYUOM; diff --git a/HHWMS.Web/Areas/XWMS/Controllers/XWMSPTHController.cs b/HHWMS.Web/Areas/XWMS/Controllers/XWMSPTHController.cs index b25b6f2..dabbff5 100644 --- a/HHWMS.Web/Areas/XWMS/Controllers/XWMSPTHController.cs +++ b/HHWMS.Web/Areas/XWMS/Controllers/XWMSPTHController.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Data; using System.Linq; +using System.Web; using HHWMS.Web.Models; using MESTOWMSService; using Microsoft.AspNetCore.Mvc; @@ -118,14 +119,13 @@ public class XWMSPTHController : BaseController detail.SourceCode = item.PTHNUM_0; detail.SourceLine = item.PTDLIN_0.ToString(); detail.MaterialCode = item.ITMREF_0; - detail.MaterialName = item.ITMDES1_0; - detail.Lot = item.ITMDES2_0; + detail.MaterialName = HttpUtility.HtmlDecode(item.ITMDES1_0); + detail.Lot = HttpUtility.HtmlDecode(item.ITMDES2_0); detail.Qty = item.THISQTYSTU; detail.Unit = item.STU_0; detail.PurchasQty = item.THISQTYUOM; detail.PurchasUnits = item.UOM_0; detail.InventoryStatus = item.STA_0; - detail.Batch = _unitwork.GetSerialNumber("HYB", 5).Remove(3, 2); detail.Status = 0; detail.CreateTime = DateTime.Now; detailList.Add(detail); diff --git a/HHWMS.Web/Areas/XWMS/Controllers/XWMSSHIPController.cs b/HHWMS.Web/Areas/XWMS/Controllers/XWMSSHIPController.cs index 049302d..13a3dde 100644 --- a/HHWMS.Web/Areas/XWMS/Controllers/XWMSSHIPController.cs +++ b/HHWMS.Web/Areas/XWMS/Controllers/XWMSSHIPController.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Data; using System.Linq; +using System.Web; using HHWMS.Web.Models; using MESTOWMSService; using Microsoft.AspNetCore.Mvc; @@ -86,8 +87,8 @@ public class XWMSSHIPController : BaseController var _unitwork = new UnitWork(Wtm); var receipt = new ReceiptHeader2(); - receipt.Code = _unitwork.GetSerialNumber("CGR"); - receipt.SourceCode = data.FirstOrDefault().POHNUM_0; + receipt.Code = _unitwork.GetSerialNumber("DDS"); + receipt.SourceCode = data.FirstOrDefault().SDHNUM_0; receipt.SupplierCode = data.FirstOrDefault().STOFCY_0; receipt.SupplierName = data.FirstOrDefault().BPRNAM_0; receipt.Type = "DDS"; @@ -107,8 +108,8 @@ public class XWMSSHIPController : BaseController detail.SourceCode = item.SDHNUM_0; detail.SourceLine = item.SDDLIN_0.ToString(); detail.MaterialCode = item.ITMREF_0; - detail.MaterialName = item.ITMDES1_0; - detail.Lot = item.ITMDES2_0; + detail.MaterialName = HttpUtility.HtmlDecode(item.ITMDES1_0); + detail.Lot = HttpUtility.HtmlDecode(item.ITMDES2_0); detail.Qty = item.QTYSTU_0; detail.Unit = item.SAU_0; detail.PurchasQty = item.QTY_0; @@ -121,6 +122,10 @@ public class XWMSSHIPController : BaseController } _unitwork.BatchAdd(detailList.ToArray()); + receipt.TotalLines = detailList.Count(); + receipt.TotalQty = detailList.Sum(x => x.Qty); + _unitwork.Update(receipt); + return JsonMore(null); } } diff --git a/HHWMS.Web/Areas/XWMS/Controllers/XWMSSOHController.cs b/HHWMS.Web/Areas/XWMS/Controllers/XWMSSOHController.cs index ddf11c6..3c35354 100644 --- a/HHWMS.Web/Areas/XWMS/Controllers/XWMSSOHController.cs +++ b/HHWMS.Web/Areas/XWMS/Controllers/XWMSSOHController.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Data; using System.Linq; +using System.Web; using HHWMS.Web.Models; using MESTOWMSService; using Microsoft.AspNetCore.Mvc; @@ -88,6 +89,7 @@ public class XWMSSOHController : BaseController var shipment = new ShipmentHeader2(); shipment.Code = _unitwork.GetSerialNumber("XSC"); shipment.Type = "XSC"; + shipment.SourceCode = data.FirstOrDefault().SOHNUM_0; shipment.ShipTo = data.FirstOrDefault().BPCORD_0; shipment.FirstStatus = 0; shipment.AppointmentTime = data.FirstOrDefault().ORDDAT_0; @@ -106,8 +108,8 @@ public class XWMSSOHController : BaseController detail.SourceCode = item.SOHNUM_0; detail.SourceLine = item.SOPLIN_0.ToString(); detail.MaterialCode = item.ITMREF_0; - detail.MaterialName = item.ITMDES1_0; - detail.Lot = item.ITMDES2_0; + detail.MaterialName = HttpUtility.HtmlDecode(item.ITMDES1_0); + detail.Lot = HttpUtility.HtmlDecode(item.ITMDES2_0); detail.Qty = item.THISQTYSTU; detail.Unit = item.STU_0; //detail.PurchasQty = item.THISQTYUOM; diff --git a/HHWMS.Web/Areas/XWMS/ViewModels/Material2VMs/Material2BatchVM.cs b/HHWMS.Web/Areas/XWMS/ViewModels/Material2VMs/Material2BatchVM.cs new file mode 100644 index 0000000..e33abbf --- /dev/null +++ b/HHWMS.Web/Areas/XWMS/ViewModels/Material2VMs/Material2BatchVM.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Threading.Tasks; +using WalkingTec.Mvvm.Core; +using WalkingTec.Mvvm.Core.Extensions; +using HHWMS.Web.Models; + + +namespace HHWMS.Web +{ + public partial class Material2BatchVM : BaseBatchVM + { + public Material2BatchVM() + { + ListVM = new Material2ListVM(); + LinkedVM = new Material2_BatchEdit(); + } + + } + + /// + /// Class to define batch edit fields + /// + public class Material2_BatchEdit : BaseVM + { + + protected override void InitVM() + { + } + + } + +} diff --git a/HHWMS.Web/Areas/XWMS/ViewModels/Material2VMs/Material2ImportVM.cs b/HHWMS.Web/Areas/XWMS/ViewModels/Material2VMs/Material2ImportVM.cs new file mode 100644 index 0000000..ef79196 --- /dev/null +++ b/HHWMS.Web/Areas/XWMS/ViewModels/Material2VMs/Material2ImportVM.cs @@ -0,0 +1,68 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Threading.Tasks; +using WalkingTec.Mvvm.Core; +using WalkingTec.Mvvm.Core.Extensions; +using HHWMS.Web.Models; + + +namespace HHWMS.Web +{ + public partial class Material2TemplateVM : BaseTemplateVM + { + public ExcelPropety WarehouseId_Excel = ExcelPropety.CreateProperty(x => x.WarehouseId); + public ExcelPropety WarehouseCode_Excel = ExcelPropety.CreateProperty(x => x.WarehouseCode); + public ExcelPropety CompanyId_Excel = ExcelPropety.CreateProperty(x => x.CompanyId); + public ExcelPropety CompanyCode_Excel = ExcelPropety.CreateProperty(x => x.CompanyCode); + public ExcelPropety Code_Excel = ExcelPropety.CreateProperty(x => x.Code); + public ExcelPropety Type_Excel = ExcelPropety.CreateProperty(x => x.Type); + public ExcelPropety Name_Excel = ExcelPropety.CreateProperty(x => x.Name); + public ExcelPropety Barcode_Excel = ExcelPropety.CreateProperty(x => x.Barcode); + public ExcelPropety Barcode2_Excel = ExcelPropety.CreateProperty(x => x.Barcode2); + public ExcelPropety Barcode3_Excel = ExcelPropety.CreateProperty(x => x.Barcode3); + public ExcelPropety Barcode4_Excel = ExcelPropety.CreateProperty(x => x.Barcode4); + public ExcelPropety ClassA_Excel = ExcelPropety.CreateProperty(x => x.ClassA); + public ExcelPropety ClassB_Excel = ExcelPropety.CreateProperty(x => x.ClassB); + public ExcelPropety ClassC_Excel = ExcelPropety.CreateProperty(x => x.ClassC); + public ExcelPropety Specification_Excel = ExcelPropety.CreateProperty(x => x.Specification); + public ExcelPropety Brand_Excel = ExcelPropety.CreateProperty(x => x.Brand); + public ExcelPropety Size_Excel = ExcelPropety.CreateProperty(x => x.Size); + public ExcelPropety Color_Excel = ExcelPropety.CreateProperty(x => x.Color); + public ExcelPropety PlaceOfOrigin_Excel = ExcelPropety.CreateProperty(x => x.PlaceOfOrigin); + public ExcelPropety DaysToExpire_Excel = ExcelPropety.CreateProperty(x => x.DaysToExpire); + public ExcelPropety ExpiringDays_Excel = ExcelPropety.CreateProperty(x => x.ExpiringDays); + public ExcelPropety MinShelfLifeDays_Excel = ExcelPropety.CreateProperty(x => x.MinShelfLifeDays); + public ExcelPropety CostPrice_Excel = ExcelPropety.CreateProperty(x => x.CostPrice); + public ExcelPropety ListPrice_Excel = ExcelPropety.CreateProperty(x => x.ListPrice); + public ExcelPropety NetPrice_Excel = ExcelPropety.CreateProperty(x => x.NetPrice); + public ExcelPropety MasterUnit_Excel = ExcelPropety.CreateProperty(x => x.MasterUnit); + public ExcelPropety AssistUnit_Excel = ExcelPropety.CreateProperty(x => x.AssistUnit); + public ExcelPropety ConvertRate_Excel = ExcelPropety.CreateProperty(x => x.ConvertRate); + public ExcelPropety ManufactureDate_Excel = ExcelPropety.CreateProperty(x => x.ManufactureDate); + public ExcelPropety ReceiptDate_Excel = ExcelPropety.CreateProperty(x => x.ReceiptDate); + public ExcelPropety Enable_Excel = ExcelPropety.CreateProperty(x => x.Enable); + public ExcelPropety Deleted_Excel = ExcelPropety.CreateProperty(x => x.Deleted); + public ExcelPropety UserDef1_Excel = ExcelPropety.CreateProperty(x => x.UserDef1); + public ExcelPropety UserDef2_Excel = ExcelPropety.CreateProperty(x => x.UserDef2); + public ExcelPropety UserDef3_Excel = ExcelPropety.CreateProperty(x => x.UserDef3); + public ExcelPropety UserDef4_Excel = ExcelPropety.CreateProperty(x => x.UserDef4); + public ExcelPropety UserDef5_Excel = ExcelPropety.CreateProperty(x => x.UserDef5); + public ExcelPropety UserDef6_Excel = ExcelPropety.CreateProperty(x => x.UserDef6); + public ExcelPropety UserDef7_Excel = ExcelPropety.CreateProperty(x => x.UserDef7); + public ExcelPropety UserDef8_Excel = ExcelPropety.CreateProperty(x => x.UserDef8); + public ExcelPropety ZoneCode_Excel = ExcelPropety.CreateProperty(x => x.ZoneCode); + + protected override void InitVM() + { + } + + } + + public class Material2ImportVM : BaseImportVM + { + + } + +} diff --git a/HHWMS.Web/Areas/XWMS/ViewModels/Material2VMs/Material2ListVM.cs b/HHWMS.Web/Areas/XWMS/ViewModels/Material2VMs/Material2ListVM.cs new file mode 100644 index 0000000..d885519 --- /dev/null +++ b/HHWMS.Web/Areas/XWMS/ViewModels/Material2VMs/Material2ListVM.cs @@ -0,0 +1,110 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using WalkingTec.Mvvm.Core; +using WalkingTec.Mvvm.Core.Extensions; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using HHWMS.Web.Models; + + +namespace HHWMS.Web +{ + public partial class Material2ListVM : BasePagedListVM + { + protected override List InitGridAction() + { + return new List + { + this.MakeStandardAction("Material2", GridActionStandardTypesEnum.Create, Localizer["Sys.Create"],"xwms", dialogWidth: 800), + this.MakeStandardAction("Material2", GridActionStandardTypesEnum.Edit, Localizer["Sys.Edit"], "xwms", dialogWidth: 800), + this.MakeStandardAction("Material2", GridActionStandardTypesEnum.Delete, Localizer["Sys.Delete"], "xwms", dialogWidth: 800), + this.MakeStandardAction("Material2", GridActionStandardTypesEnum.Details, Localizer["Sys.Details"], "xwms", dialogWidth: 800), + this.MakeStandardAction("Material2", GridActionStandardTypesEnum.BatchEdit, Localizer["Sys.BatchEdit"], "xwms", dialogWidth: 800), + this.MakeStandardAction("Material2", GridActionStandardTypesEnum.BatchDelete, Localizer["Sys.BatchDelete"], "xwms", dialogWidth: 800), + this.MakeStandardAction("Material2", GridActionStandardTypesEnum.Import, Localizer["Sys.Import"], "xwms", dialogWidth: 800), + this.MakeStandardAction("Material2", GridActionStandardTypesEnum.ExportExcel, Localizer["Sys.Export"], "xwms"), + }; + } + + + protected override IEnumerable> InitGridHeader() + { + return new List>{ + this.MakeGridHeader(x => x.Code), + this.MakeGridHeader(x => x.Type), + this.MakeGridHeader(x => x.Name), + this.MakeGridHeader(x => x.MasterUnit), + this.MakeGridHeader(x => x.AssistUnit), + this.MakeGridHeader(x => x.WarehouseId), + this.MakeGridHeader(x => x.WarehouseCode), + this.MakeGridHeader(x => x.CompanyId), + this.MakeGridHeader(x => x.CompanyCode), + this.MakeGridHeader(x => x.Barcode), + this.MakeGridHeaderAction(width: 200) + }; + } + + public override IOrderedQueryable GetSearchQuery() + { + var dc2 = Wtm.CreateDC(cskey: "hangyong"); + var query = dc2.Set() + .CheckContain(Searcher.Code, x => x.Code) + .CheckContain(Searcher.Name, x => x.Name) + .CheckContain(Searcher.Type, x => x.Type) + .Select(x => new Material2_View + { + ID = x.ID, + WarehouseId = x.WarehouseId, + WarehouseCode = x.WarehouseCode, + CompanyId = x.CompanyId, + CompanyCode = x.CompanyCode, + Code = x.Code, + Type = x.Type, + Name = x.Name, + Barcode = x.Barcode, + Barcode2 = x.Barcode2, + Barcode3 = x.Barcode3, + Barcode4 = x.Barcode4, + ClassA = x.ClassA, + ClassB = x.ClassB, + ClassC = x.ClassC, + Specification = x.Specification, + Brand = x.Brand, + Size = x.Size, + Color = x.Color, + PlaceOfOrigin = x.PlaceOfOrigin, + DaysToExpire = x.DaysToExpire, + ExpiringDays = x.ExpiringDays, + MinShelfLifeDays = x.MinShelfLifeDays, + CostPrice = x.CostPrice, + ListPrice = x.ListPrice, + NetPrice = x.NetPrice, + MasterUnit = x.MasterUnit, + AssistUnit = x.AssistUnit, + ConvertRate = x.ConvertRate, + ManufactureDate = x.ManufactureDate, + ReceiptDate = x.ReceiptDate, + Enable = x.Enable, + Deleted = x.Deleted, + UserDef1 = x.UserDef1, + UserDef2 = x.UserDef2, + UserDef3 = x.UserDef3, + UserDef4 = x.UserDef4, + UserDef5 = x.UserDef5, + UserDef6 = x.UserDef6, + UserDef7 = x.UserDef7, + UserDef8 = x.UserDef8, + ZoneCode = x.ZoneCode, + }) + .OrderBy(x => x.ID); + return query; + } + + } + + public class Material2_View : Material2{ + + } +} diff --git a/HHWMS.Web/Areas/XWMS/ViewModels/Material2VMs/Material2Searcher.cs b/HHWMS.Web/Areas/XWMS/ViewModels/Material2VMs/Material2Searcher.cs new file mode 100644 index 0000000..0398234 --- /dev/null +++ b/HHWMS.Web/Areas/XWMS/ViewModels/Material2VMs/Material2Searcher.cs @@ -0,0 +1,62 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Threading.Tasks; +using WalkingTec.Mvvm.Core; +using WalkingTec.Mvvm.Core.Extensions; +using HHWMS.Web.Models; + + +namespace HHWMS.Web +{ + public partial class Material2Searcher : BaseSearcher + { + public Int32? WarehouseId { get; set; } + public String WarehouseCode { get; set; } + public Int32? CompanyId { get; set; } + public String CompanyCode { get; set; } + public String Code { get; set; } + public String Type { get; set; } + public String Name { get; set; } + public String Barcode { get; set; } + public String Barcode2 { get; set; } + public String Barcode3 { get; set; } + public String Barcode4 { get; set; } + public String ClassA { get; set; } + public String ClassB { get; set; } + public String ClassC { get; set; } + public String Specification { get; set; } + public String Brand { get; set; } + public String Size { get; set; } + public String Color { get; set; } + public String PlaceOfOrigin { get; set; } + public Int32? DaysToExpire { get; set; } + public Int32? ExpiringDays { get; set; } + public Int32? MinShelfLifeDays { get; set; } + public Decimal? CostPrice { get; set; } + public Decimal? ListPrice { get; set; } + public Decimal? NetPrice { get; set; } + public String MasterUnit { get; set; } + public String AssistUnit { get; set; } + public Single? ConvertRate { get; set; } + public Boolean? ManufactureDate { get; set; } + public Boolean? ReceiptDate { get; set; } + public Boolean? Enable { get; set; } + public Boolean? Deleted { get; set; } + public String UserDef1 { get; set; } + public String UserDef2 { get; set; } + public String UserDef3 { get; set; } + public String UserDef4 { get; set; } + public String UserDef5 { get; set; } + public String UserDef6 { get; set; } + public String UserDef7 { get; set; } + public String UserDef8 { get; set; } + public String ZoneCode { get; set; } + + protected override void InitVM() + { + } + + } +} diff --git a/HHWMS.Web/Areas/XWMS/ViewModels/Material2VMs/Material2VM.cs b/HHWMS.Web/Areas/XWMS/ViewModels/Material2VMs/Material2VM.cs new file mode 100644 index 0000000..d49980b --- /dev/null +++ b/HHWMS.Web/Areas/XWMS/ViewModels/Material2VMs/Material2VM.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.ComponentModel.DataAnnotations; +using WalkingTec.Mvvm.Core; +using WalkingTec.Mvvm.Core.Extensions; +using HHWMS.Web.Models; + + +namespace HHWMS.Web +{ + public partial class Material2VM : BaseCRUDVM + { + + public Material2VM() + { + } + + protected override void InitVM() + { + } + + public override void DoAdd() + { + base.DoAdd(); + } + + public override void DoEdit(bool updateAllFields = false) + { + base.DoEdit(updateAllFields); + } + + public override void DoDelete() + { + base.DoDelete(); + } + } +} diff --git a/HHWMS.Web/Areas/XWMS/ViewModels/ReceiptDetail2VMs/ReceiptDetail2BatchVM.cs b/HHWMS.Web/Areas/XWMS/ViewModels/ReceiptDetail2VMs/ReceiptDetail2BatchVM.cs new file mode 100644 index 0000000..823a9b5 --- /dev/null +++ b/HHWMS.Web/Areas/XWMS/ViewModels/ReceiptDetail2VMs/ReceiptDetail2BatchVM.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Threading.Tasks; +using WalkingTec.Mvvm.Core; +using WalkingTec.Mvvm.Core.Extensions; +using HHWMS.Web.Models; + + +namespace HHWMS.Web +{ + public partial class ReceiptDetail2BatchVM : BaseBatchVM + { + public ReceiptDetail2BatchVM() + { + ListVM = new ReceiptDetail2ListVM(); + LinkedVM = new ReceiptDetail2_BatchEdit(); + } + + } + + /// + /// Class to define batch edit fields + /// + public class ReceiptDetail2_BatchEdit : BaseVM + { + + protected override void InitVM() + { + } + + } + +} diff --git a/HHWMS.Web/Areas/XWMS/ViewModels/ReceiptDetail2VMs/ReceiptDetail2ImportVM.cs b/HHWMS.Web/Areas/XWMS/ViewModels/ReceiptDetail2VMs/ReceiptDetail2ImportVM.cs new file mode 100644 index 0000000..de7b6ab --- /dev/null +++ b/HHWMS.Web/Areas/XWMS/ViewModels/ReceiptDetail2VMs/ReceiptDetail2ImportVM.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Threading.Tasks; +using WalkingTec.Mvvm.Core; +using WalkingTec.Mvvm.Core.Extensions; +using HHWMS.Web.Models; + + +namespace HHWMS.Web +{ + public partial class ReceiptDetail2TemplateVM : BaseTemplateVM + { + public ExcelPropety WarehouseId_Excel = ExcelPropety.CreateProperty(x => x.WarehouseId); + public ExcelPropety WarehouseCode_Excel = ExcelPropety.CreateProperty(x => x.WarehouseCode); + public ExcelPropety ZoneCode_Excel = ExcelPropety.CreateProperty(x => x.ZoneCode); + public ExcelPropety CompanyId_Excel = ExcelPropety.CreateProperty(x => x.CompanyId); + public ExcelPropety CompanyCode_Excel = ExcelPropety.CreateProperty(x => x.CompanyCode); + public ExcelPropety SourceCode_Excel = ExcelPropety.CreateProperty(x => x.SourceCode); + public ExcelPropety SupplierCode_Excel = ExcelPropety.CreateProperty(x => x.SupplierCode); + public ExcelPropety SupplierName_Excel = ExcelPropety.CreateProperty(x => x.SupplierName); + public ExcelPropety CPoCode_Excel = ExcelPropety.CreateProperty(x => x.CPoCode); + public ExcelPropety MoCode_Excel = ExcelPropety.CreateProperty(x => x.MoCode); + public ExcelPropety SourceLine_Excel = ExcelPropety.CreateProperty(x => x.SourceLine); + public ExcelPropety ReceiptId_Excel = ExcelPropety.CreateProperty(x => x.ReceiptId); + public ExcelPropety ReceiptCode_Excel = ExcelPropety.CreateProperty(x => x.ReceiptCode); + public ExcelPropety MaterialId_Excel = ExcelPropety.CreateProperty(x => x.MaterialId); + public ExcelPropety MaterialCode_Excel = ExcelPropety.CreateProperty(x => x.MaterialCode); + public ExcelPropety MaterialName_Excel = ExcelPropety.CreateProperty(x => x.MaterialName); + public ExcelPropety Batch_Excel = ExcelPropety.CreateProperty(x => x.Batch); + public ExcelPropety Lot_Excel = ExcelPropety.CreateProperty(x => x.Lot); + public ExcelPropety Sn_Excel = ExcelPropety.CreateProperty(x => x.Sn); + public ExcelPropety Project_Excel = ExcelPropety.CreateProperty(x => x.Project); + public ExcelPropety ManufactureDate_Excel = ExcelPropety.CreateProperty(x => x.ManufactureDate); + public ExcelPropety ExpirationDate_Excel = ExcelPropety.CreateProperty(x => x.ExpirationDate); + public ExcelPropety InventoryStatus_Excel = ExcelPropety.CreateProperty(x => x.InventoryStatus); + public ExcelPropety Qty_Excel = ExcelPropety.CreateProperty(x => x.Qty); + public ExcelPropety QtyCompleted_Excel = ExcelPropety.CreateProperty(x => x.QtyCompleted); + public ExcelPropety Unit_Excel = ExcelPropety.CreateProperty(x => x.Unit); + public ExcelPropety PurchasQty_Excel = ExcelPropety.CreateProperty(x => x.PurchasQty); + public ExcelPropety PurchasUnits_Excel = ExcelPropety.CreateProperty(x => x.PurchasUnits); + public ExcelPropety Coefficient_Excel = ExcelPropety.CreateProperty(x => x.Coefficient); + public ExcelPropety Price_Excel = ExcelPropety.CreateProperty(x => x.Price); + public ExcelPropety Status_Excel = ExcelPropety.CreateProperty(x => x.Status); + public ExcelPropety Deleted_Excel = ExcelPropety.CreateProperty(x => x.Deleted); + public ExcelPropety AutoId_Excel = ExcelPropety.CreateProperty(x => x.AutoId); + public ExcelPropety UserDef1_Excel = ExcelPropety.CreateProperty(x => x.UserDef1); + public ExcelPropety UserDef2_Excel = ExcelPropety.CreateProperty(x => x.UserDef2); + public ExcelPropety UserDef3_Excel = ExcelPropety.CreateProperty(x => x.UserDef3); + public ExcelPropety Station_Excel = ExcelPropety.CreateProperty(x => x.Station); + public ExcelPropety QtyDivided_Excel = ExcelPropety.CreateProperty(x => x.QtyDivided); + + protected override void InitVM() + { + } + + } + + public class ReceiptDetail2ImportVM : BaseImportVM + { + + } + +} diff --git a/HHWMS.Web/Areas/XWMS/ViewModels/ReceiptDetail2VMs/ReceiptDetail2ListVM.cs b/HHWMS.Web/Areas/XWMS/ViewModels/ReceiptDetail2VMs/ReceiptDetail2ListVM.cs new file mode 100644 index 0000000..e623c65 --- /dev/null +++ b/HHWMS.Web/Areas/XWMS/ViewModels/ReceiptDetail2VMs/ReceiptDetail2ListVM.cs @@ -0,0 +1,122 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using WalkingTec.Mvvm.Core; +using WalkingTec.Mvvm.Core.Extensions; +using Microsoft.EntityFrameworkCore; +using System.ComponentModel.DataAnnotations; +using HHWMS.Web.Models; + + +namespace HHWMS.Web +{ + public partial class ReceiptDetail2ListVM : BasePagedListVM + { + public List InventoryStatus { get; set; } + + protected override void InitVM() + { + var vm = Wtm.CreateVM(); + InventoryStatus = vm.InventoryStatus; + } + protected override List InitGridAction() + { + return new List + { + this.MakeAction("ReceiptDetail2","Create",Localizer["Sys.Create"],Localizer["Sys.Create"],GridActionParameterTypesEnum.NoId,"xwms").SetOnClickScript("CreateDetail"), + this.MakeStandardAction("ReceiptDetail2", GridActionStandardTypesEnum.Edit, Localizer["Sys.Edit"], "xwms", dialogWidth: 800), + this.MakeStandardAction("ReceiptDetail2", GridActionStandardTypesEnum.Delete, Localizer["Sys.Delete"], "xwms", dialogWidth: 800), + this.MakeStandardAction("ReceiptDetail2", GridActionStandardTypesEnum.Details, Localizer["Sys.Details"], "xwms", dialogWidth: 800), + this.MakeStandardAction("ReceiptDetail2", GridActionStandardTypesEnum.BatchEdit, Localizer["Sys.BatchEdit"], "xwms", dialogWidth: 800), + this.MakeStandardAction("ReceiptDetail2", GridActionStandardTypesEnum.BatchDelete, Localizer["Sys.BatchDelete"], "xwms", dialogWidth: 800), + this.MakeStandardAction("ReceiptDetail2", GridActionStandardTypesEnum.Import, Localizer["Sys.Import"], "xwms", dialogWidth: 800), + this.MakeStandardAction("ReceiptDetail2", GridActionStandardTypesEnum.ExportExcel, Localizer["Sys.Export"], "xwms"), + }; + } + + + protected override IEnumerable> InitGridHeader() + { + InitVM(); + return new List>{ + this.MakeGridHeader(x => x.ReceiptCode).SetWidth(150), + this.MakeGridHeader(x => x.SourceLine), + this.MakeGridHeader(x => x.MaterialCode).SetWidth(150), + this.MakeGridHeader(x => x.MaterialName).SetWidth(150), + this.MakeGridHeader(x => x.Lot), + this.MakeGridHeader(x => x.Batch).SetWidth(150), + this.MakeGridHeader(x => x.InventoryStatus), + this.MakeGridHeader(x => x.Qty) + .SetFormat((a,b) => + { + return a.Qty.ToString().TrimEnd('0').TrimEnd('.'); + }), + + this.MakeGridHeader(x => x.Unit), + this.MakeGridHeader(x => x.QtyCompleted) + .SetFormat((a,b) => + { + return a.QtyCompleted.ToString().TrimEnd('0').TrimEnd('.'); + }), + this.MakeGridHeader(x => x.Status), + this.MakeGridHeaderAction(width: 200) + }; + } + + public override IOrderedQueryable GetSearchQuery() + { + var query = DC.Set() + .Where(x => x.ReceiptId == Searcher.ReceiptId) + .Select(x => new ReceiptDetail2_View + { + ID = x.ID, + WarehouseId = x.WarehouseId, + WarehouseCode = x.WarehouseCode, + ZoneCode = x.ZoneCode, + CompanyId = x.CompanyId, + CompanyCode = x.CompanyCode, + SourceCode = x.SourceCode, + SupplierCode = x.SupplierCode, + SupplierName = x.SupplierName, + CPoCode = x.CPoCode, + MoCode = x.MoCode, + SourceLine = x.SourceLine, + ReceiptId = x.ReceiptId, + ReceiptCode = x.ReceiptCode, + MaterialId = x.MaterialId, + MaterialCode = x.MaterialCode, + MaterialName = x.MaterialName, + Batch = x.Batch, + Lot = x.Lot, + Sn = x.Sn, + Project = x.Project, + ManufactureDate = x.ManufactureDate, + ExpirationDate = x.ExpirationDate, + InventoryStatus = x.InventoryStatus, + Qty = x.Qty, + QtyCompleted = x.QtyCompleted, + Unit = x.Unit, + PurchasQty = x.PurchasQty, + PurchasUnits = x.PurchasUnits, + Coefficient = x.Coefficient, + Price = x.Price, + Status = x.Status, + Deleted = x.Deleted, + AutoId = x.AutoId, + UserDef1 = x.UserDef1, + UserDef2 = x.UserDef2, + UserDef3 = x.UserDef3, + Station = x.Station, + QtyDivided = x.QtyDivided, + }) + .OrderBy(x => x.ID); + return query; + } + + } + + public class ReceiptDetail2_View : ReceiptDetail2{ + + } +} diff --git a/HHWMS.Web/Areas/XWMS/ViewModels/ReceiptDetail2VMs/ReceiptDetail2Searcher.cs b/HHWMS.Web/Areas/XWMS/ViewModels/ReceiptDetail2VMs/ReceiptDetail2Searcher.cs new file mode 100644 index 0000000..10c68ec --- /dev/null +++ b/HHWMS.Web/Areas/XWMS/ViewModels/ReceiptDetail2VMs/ReceiptDetail2Searcher.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Threading.Tasks; +using WalkingTec.Mvvm.Core; +using WalkingTec.Mvvm.Core.Extensions; +using HHWMS.Web.Models; + + +namespace HHWMS.Web +{ + public partial class ReceiptDetail2Searcher : BaseSearcher + { + public Int32? WarehouseId { get; set; } + public String WarehouseCode { get; set; } + public String ZoneCode { get; set; } + public Int32? CompanyId { get; set; } + public String CompanyCode { get; set; } + public String SourceCode { get; set; } + public String SupplierCode { get; set; } + public String SupplierName { get; set; } + public String CPoCode { get; set; } + public String MoCode { get; set; } + public String SourceLine { get; set; } + public Int32? ReceiptId { get; set; } + public String ReceiptCode { get; set; } + public Int32? MaterialId { get; set; } + public String MaterialCode { get; set; } + public String MaterialName { get; set; } + public String Batch { get; set; } + public String Lot { get; set; } + public String Sn { get; set; } + public String Project { get; set; } + public DateRange ManufactureDate { get; set; } + public DateRange ExpirationDate { get; set; } + public String InventoryStatus { get; set; } + public Decimal? Qty { get; set; } + public Decimal? QtyCompleted { get; set; } + public String Unit { get; set; } + public Decimal? PurchasQty { get; set; } + public String PurchasUnits { get; set; } + public Decimal? Coefficient { get; set; } + public Decimal? Price { get; set; } + public Int32? Status { get; set; } + public Boolean? Deleted { get; set; } + public Int32? AutoId { get; set; } + public String UserDef1 { get; set; } + public String UserDef2 { get; set; } + public String UserDef3 { get; set; } + public String Station { get; set; } + public Decimal? QtyDivided { get; set; } + protected override void InitVM() + { + } + + } +} diff --git a/HHWMS.Web/Areas/XWMS/ViewModels/ReceiptDetail2VMs/ReceiptDetail2VM.cs b/HHWMS.Web/Areas/XWMS/ViewModels/ReceiptDetail2VMs/ReceiptDetail2VM.cs new file mode 100644 index 0000000..64d3cf0 --- /dev/null +++ b/HHWMS.Web/Areas/XWMS/ViewModels/ReceiptDetail2VMs/ReceiptDetail2VM.cs @@ -0,0 +1,45 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using HHWMS.Web.Models; +using WalkingTec.Mvvm.Core; +using WalkingTec.Mvvm.Core.Extensions; + + +namespace HHWMS.Web +{ + public partial class ReceiptDetail2VM : BaseCRUDVM + { + public Material2ListVM MaterialList { get; set; } + public List InventoryStatus { get; set; } + public ReceiptDetail2VM() + { + //MaterialList = new Material2ListVM(); + } + + protected override void InitVM() + { + var CurrentCulture = Wtm.CurrentCulture; + var dc = Wtm.CreateDC(cskey: "default"); + var dictDatas = dc.Set().ToList(); + InventoryStatus = dictDatas.Where(x => x.DictType == "InventoryStatus") + .ToList() + .ToListItems(x => CurrentCulture == "zh" ? x.DictLabel : x.DictLabelUs, x => x.DictValue); + } + + public override void DoAdd() + { + base.DoAdd(); + } + + public override void DoEdit(bool updateAllFields = false) + { + base.DoEdit(updateAllFields); + } + + public override void DoDelete() + { + base.DoDelete(); + } + } +} diff --git a/HHWMS.Web/Areas/XWMS/ViewModels/ReceiptHeader2VMs/ReceiptHeader2ListVM.cs b/HHWMS.Web/Areas/XWMS/ViewModels/ReceiptHeader2VMs/ReceiptHeader2ListVM.cs index 6291668..d22de52 100644 --- a/HHWMS.Web/Areas/XWMS/ViewModels/ReceiptHeader2VMs/ReceiptHeader2ListVM.cs +++ b/HHWMS.Web/Areas/XWMS/ViewModels/ReceiptHeader2VMs/ReceiptHeader2ListVM.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; @@ -13,11 +13,18 @@ namespace HHWMS.Web.xwms.ViewModels.ReceiptHeader2VMs { public partial class ReceiptHeader2ListVM : BasePagedListVM { + public ReceiptDetail2ListVM ReceiptDetails { get; set; } = new ReceiptDetail2ListVM(); + + protected override void InitVM() + { + ReceiptDetails.CopyContext(this); + } + protected override List InitGridAction() { return new List { - this.MakeStandardAction("ReceiptHeader2", GridActionStandardTypesEnum.Create, Localizer["Sys.Create"],"xwms", dialogWidth: 800), + this.MakeStandardAction("ReceiptHeader2", GridActionStandardTypesEnum.Create, Localizer["Sys.Create"],"xwms", dialogWidth: 800,600), this.MakeStandardAction("ReceiptHeader2", GridActionStandardTypesEnum.Edit, Localizer["Sys.Edit"], "xwms", dialogWidth: 800), this.MakeStandardAction("ReceiptHeader2", GridActionStandardTypesEnum.Delete, Localizer["Sys.Delete"], "xwms", dialogWidth: 800), this.MakeStandardAction("ReceiptHeader2", GridActionStandardTypesEnum.Details, Localizer["Sys.Details"], "xwms", dialogWidth: 800), @@ -31,32 +38,33 @@ namespace HHWMS.Web.xwms.ViewModels.ReceiptHeader2VMs protected override IEnumerable> InitGridHeader() { + InitVM(); return new List>{ - this.MakeGridHeader(x => x.Code), - this.MakeGridHeader(x => x.CompanyId), - this.MakeGridHeader(x => x.CompanyCode), + this.MakeGridHeader(x => x.Code).SetFormat((a,b) => + { + string rv = UIService.MakeScriptButton(ButtonTypesEnum.Link,a.Code,$"details('{a.ID}')"); + return rv; + }).SetWidth(150), this.MakeGridHeader(x => x.Type), - this.MakeGridHeader(x => x.SourceCode), - this.MakeGridHeader(x => x.SourcePlatform), - this.MakeGridHeader(x => x.SupplierId), - this.MakeGridHeader(x => x.SupplierCode), - this.MakeGridHeader(x => x.SupplierName), - this.MakeGridHeader(x => x.TotalQty), + this.MakeGridHeader(x => x.SourceCode).SetWidth(150), + this.MakeGridHeader(x => x.SupplierCode).SetHide(), + this.MakeGridHeader(x => x.SupplierName).SetWidth(200), + this.MakeGridHeader(x => x.TotalQty) + .SetFormat((a,b) => + { + return a.TotalQty.ToString().TrimEnd('0').TrimEnd('.'); + }), this.MakeGridHeader(x => x.TotalLines), - this.MakeGridHeader(x => x.FreeScan), - this.MakeGridHeader(x => x.Remark), + this.MakeGridHeader(x => x.Remark).SetHide(), this.MakeGridHeader(x => x.UploadStatus), this.MakeGridHeader(x => x.Uploadremark), - this.MakeGridHeader(x => x.UploadTime), - this.MakeGridHeader(x => x.AppointmentTime), + this.MakeGridHeader(x => x.UploadTime).SetHide(), + this.MakeGridHeader(x => x.AppointmentTime).SetHide(), this.MakeGridHeader(x => x.FirstStatus), this.MakeGridHeader(x => x.LastStatus), - this.MakeGridHeader(x => x.Enable), - this.MakeGridHeader(x => x.Deleted), - this.MakeGridHeader(x => x.Scanid), - this.MakeGridHeader(x => x.UserDef1), - this.MakeGridHeader(x => x.UserDef2), - this.MakeGridHeader(x => x.UserDef3), + this.MakeGridHeader(x => x.UserDef1).SetHide(), + this.MakeGridHeader(x => x.UserDef2).SetHide(), + this.MakeGridHeader(x => x.UserDef3).SetHide(), this.MakeGridHeader(x => x.Station), this.MakeGridHeaderAction(width: 200) }; diff --git a/HHWMS.Web/Areas/XWMS/ViewModels/ReceiptHeader2VMs/ReceiptHeader2VM.cs b/HHWMS.Web/Areas/XWMS/ViewModels/ReceiptHeader2VMs/ReceiptHeader2VM.cs index 84ebfbd..847fd28 100644 --- a/HHWMS.Web/Areas/XWMS/ViewModels/ReceiptHeader2VMs/ReceiptHeader2VM.cs +++ b/HHWMS.Web/Areas/XWMS/ViewModels/ReceiptHeader2VMs/ReceiptHeader2VM.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; @@ -12,13 +12,41 @@ namespace HHWMS.Web.xwms.ViewModels.ReceiptHeader2VMs { public partial class ReceiptHeader2VM : BaseCRUDVM { - + public List ReceiptTypes { get; set; } + public List Trs { get; set; } + public List Addresses { get; set; } + public List SupplyNames { get; set; } public ReceiptHeader2VM() { } protected override void InitVM() { + var CurrentCulture = Wtm.CurrentCulture; + var dictDatas = DC.Set().ToList(); + ReceiptTypes = dictDatas.Where(x => x.DictType == "ReceiptType2").Select(x => new ComboSelectListItem + { + Text = CurrentCulture == "zh" ? x.DictLabel : x.DictLabelUs, + Value = x.DictValue + }).ToList(); + Trs = dictDatas.Where(x => x.DictType == "Trs").Select(x => new ComboSelectListItem + { + Text = CurrentCulture == "zh" ? x.DictLabel : x.DictLabelUs, + Value = x.DictValue + }).ToList(); + Addresses = dictDatas.Where(x => x.DictType == "Addresses").Select(x => new ComboSelectListItem + { + Text = CurrentCulture == "zh" ? x.DictLabel : x.DictLabelUs, + Value = x.DictValue + }).ToList(); + + var dc2 = Wtm.CreateDC(cskey: "hangyong"); + SupplyNames = dc2.Set().Select(x => new ComboSelectListItem + { + Text = x.Name, + Value = x.Code + }).ToList(); + } public override void DoAdd() diff --git a/HHWMS.Web/Areas/XWMS/Views/Material2/BatchDelete.cshtml b/HHWMS.Web/Areas/XWMS/Views/Material2/BatchDelete.cshtml new file mode 100644 index 0000000..4ad9d45 --- /dev/null +++ b/HHWMS.Web/Areas/XWMS/Views/Material2/BatchDelete.cshtml @@ -0,0 +1,12 @@ +@model HHWMS.Web.Material2BatchVM +@inject IStringLocalizer Localizer; + + + @Localizer["Sys.BatchDeleteConfirm"] + + + + + + + diff --git a/HHWMS.Web/Areas/XWMS/Views/Material2/BatchEdit.cshtml b/HHWMS.Web/Areas/XWMS/Views/Material2/BatchEdit.cshtml new file mode 100644 index 0000000..56389c7 --- /dev/null +++ b/HHWMS.Web/Areas/XWMS/Views/Material2/BatchEdit.cshtml @@ -0,0 +1,14 @@ +@model HHWMS.Web.Material2BatchVM +@inject IStringLocalizer Localizer; + + +
@Localizer["Sys.BatchEditConfirm"]
+ + + + + + + + +
diff --git a/HHWMS.Web/Areas/XWMS/Views/Material2/Create.cshtml b/HHWMS.Web/Areas/XWMS/Views/Material2/Create.cshtml new file mode 100644 index 0000000..eefc3e5 --- /dev/null +++ b/HHWMS.Web/Areas/XWMS/Views/Material2/Create.cshtml @@ -0,0 +1,52 @@ +@model HHWMS.Web.Material2VM +@inject IStringLocalizer Localizer; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HHWMS.Web/Areas/XWMS/Views/Material2/Delete.cshtml b/HHWMS.Web/Areas/XWMS/Views/Material2/Delete.cshtml new file mode 100644 index 0000000..1d13226 --- /dev/null +++ b/HHWMS.Web/Areas/XWMS/Views/Material2/Delete.cshtml @@ -0,0 +1,54 @@ +@model HHWMS.Web.Material2VM +@inject IStringLocalizer Localizer; + + + @Localizer["Sys.DeleteConfirm"] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HHWMS.Web/Areas/XWMS/Views/Material2/Details.cshtml b/HHWMS.Web/Areas/XWMS/Views/Material2/Details.cshtml new file mode 100644 index 0000000..7cd986b --- /dev/null +++ b/HHWMS.Web/Areas/XWMS/Views/Material2/Details.cshtml @@ -0,0 +1,51 @@ +@model HHWMS.Web.Material2VM +@inject IStringLocalizer Localizer; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HHWMS.Web/Areas/XWMS/Views/Material2/Edit.cshtml b/HHWMS.Web/Areas/XWMS/Views/Material2/Edit.cshtml new file mode 100644 index 0000000..78a16fb --- /dev/null +++ b/HHWMS.Web/Areas/XWMS/Views/Material2/Edit.cshtml @@ -0,0 +1,53 @@ +@model HHWMS.Web.Material2VM +@inject IStringLocalizer Localizer; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HHWMS.Web/Areas/XWMS/Views/Material2/Import.cshtml b/HHWMS.Web/Areas/XWMS/Views/Material2/Import.cshtml new file mode 100644 index 0000000..5a40dd1 --- /dev/null +++ b/HHWMS.Web/Areas/XWMS/Views/Material2/Import.cshtml @@ -0,0 +1,14 @@ +@model HHWMS.Web.Material2ImportVM +@inject IStringLocalizer Localizer; + + + + + + + + + + + + diff --git a/HHWMS.Web/Areas/XWMS/Views/Material2/Index.cshtml b/HHWMS.Web/Areas/XWMS/Views/Material2/Index.cshtml new file mode 100644 index 0000000..71bcd92 --- /dev/null +++ b/HHWMS.Web/Areas/XWMS/Views/Material2/Index.cshtml @@ -0,0 +1,8 @@ +@model HHWMS.Web.Material2ListVM +@inject IStringLocalizer Localizer; + + + + + + diff --git a/HHWMS.Web/Areas/XWMS/Views/ReceiptDetail2/BatchDelete.cshtml b/HHWMS.Web/Areas/XWMS/Views/ReceiptDetail2/BatchDelete.cshtml new file mode 100644 index 0000000..747aee1 --- /dev/null +++ b/HHWMS.Web/Areas/XWMS/Views/ReceiptDetail2/BatchDelete.cshtml @@ -0,0 +1,12 @@ +@model HHWMS.Web.ReceiptDetail2BatchVM +@inject IStringLocalizer Localizer; + + + @Localizer["Sys.BatchDeleteConfirm"] + + + + + + + diff --git a/HHWMS.Web/Areas/XWMS/Views/ReceiptDetail2/BatchEdit.cshtml b/HHWMS.Web/Areas/XWMS/Views/ReceiptDetail2/BatchEdit.cshtml new file mode 100644 index 0000000..913369e --- /dev/null +++ b/HHWMS.Web/Areas/XWMS/Views/ReceiptDetail2/BatchEdit.cshtml @@ -0,0 +1,14 @@ +@model HHWMS.Web.ReceiptDetail2BatchVM +@inject IStringLocalizer Localizer; + + +
@Localizer["Sys.BatchEditConfirm"]
+ + + + + + + + +
diff --git a/HHWMS.Web/Areas/XWMS/Views/ReceiptDetail2/Create.cshtml b/HHWMS.Web/Areas/XWMS/Views/ReceiptDetail2/Create.cshtml new file mode 100644 index 0000000..350f33d --- /dev/null +++ b/HHWMS.Web/Areas/XWMS/Views/ReceiptDetail2/Create.cshtml @@ -0,0 +1,28 @@ +@model HHWMS.Web.ReceiptDetail2VM +@inject IStringLocalizer Localizer; + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HHWMS.Web/Areas/XWMS/Views/ReceiptDetail2/Delete.cshtml b/HHWMS.Web/Areas/XWMS/Views/ReceiptDetail2/Delete.cshtml new file mode 100644 index 0000000..d1d7ac7 --- /dev/null +++ b/HHWMS.Web/Areas/XWMS/Views/ReceiptDetail2/Delete.cshtml @@ -0,0 +1,51 @@ +@model HHWMS.Web.ReceiptDetail2VM +@inject IStringLocalizer Localizer; + + + @Localizer["Sys.DeleteConfirm"] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HHWMS.Web/Areas/XWMS/Views/ReceiptDetail2/Details.cshtml b/HHWMS.Web/Areas/XWMS/Views/ReceiptDetail2/Details.cshtml new file mode 100644 index 0000000..7e2c3aa --- /dev/null +++ b/HHWMS.Web/Areas/XWMS/Views/ReceiptDetail2/Details.cshtml @@ -0,0 +1,48 @@ +@model HHWMS.Web.ReceiptDetail2VM +@inject IStringLocalizer Localizer; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HHWMS.Web/Areas/XWMS/Views/ReceiptDetail2/Edit.cshtml b/HHWMS.Web/Areas/XWMS/Views/ReceiptDetail2/Edit.cshtml new file mode 100644 index 0000000..2ba811c --- /dev/null +++ b/HHWMS.Web/Areas/XWMS/Views/ReceiptDetail2/Edit.cshtml @@ -0,0 +1,50 @@ +@model HHWMS.Web.ReceiptDetail2VM +@inject IStringLocalizer Localizer; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HHWMS.Web/Areas/XWMS/Views/ReceiptDetail2/Import.cshtml b/HHWMS.Web/Areas/XWMS/Views/ReceiptDetail2/Import.cshtml new file mode 100644 index 0000000..f4e21b9 --- /dev/null +++ b/HHWMS.Web/Areas/XWMS/Views/ReceiptDetail2/Import.cshtml @@ -0,0 +1,14 @@ +@model HHWMS.Web.ReceiptDetail2ImportVM +@inject IStringLocalizer Localizer; + + + + + + + + + + + + diff --git a/HHWMS.Web/Areas/XWMS/Views/ReceiptDetail2/Index.cshtml b/HHWMS.Web/Areas/XWMS/Views/ReceiptDetail2/Index.cshtml new file mode 100644 index 0000000..3687a0a --- /dev/null +++ b/HHWMS.Web/Areas/XWMS/Views/ReceiptDetail2/Index.cshtml @@ -0,0 +1,8 @@ +@model HHWMS.Web.ReceiptDetail2ListVM +@inject IStringLocalizer Localizer; + + + + + + diff --git a/HHWMS.Web/Areas/XWMS/Views/ReceiptHeader2/Create.cshtml b/HHWMS.Web/Areas/XWMS/Views/ReceiptHeader2/Create.cshtml index c632cf4..1f6d916 100644 --- a/HHWMS.Web/Areas/XWMS/Views/ReceiptHeader2/Create.cshtml +++ b/HHWMS.Web/Areas/XWMS/Views/ReceiptHeader2/Create.cshtml @@ -1,34 +1,13 @@ -@model HHWMS.Web.xwms.ViewModels.ReceiptHeader2VMs.ReceiptHeader2VM +@model HHWMS.Web.xwms.ViewModels.ReceiptHeader2VMs.ReceiptHeader2VM @inject IStringLocalizer Localizer; - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - - diff --git a/HHWMS.Web/Areas/XWMS/Views/ReceiptHeader2/Index.cshtml b/HHWMS.Web/Areas/XWMS/Views/ReceiptHeader2/Index.cshtml index 2bdbec8..adcd7fe 100644 --- a/HHWMS.Web/Areas/XWMS/Views/ReceiptHeader2/Index.cshtml +++ b/HHWMS.Web/Areas/XWMS/Views/ReceiptHeader2/Index.cshtml @@ -1,8 +1,27 @@ -@model HHWMS.Web.xwms.ViewModels.ReceiptHeader2VMs.ReceiptHeader2ListVM +@model HHWMS.Web.xwms.ViewModels.ReceiptHeader2VMs.ReceiptHeader2ListVM @inject IStringLocalizer Localizer; - + - + + + diff --git a/HHWMS.Web/Areas/XWMS/Views/XWMSPOH/Index.cshtml b/HHWMS.Web/Areas/XWMS/Views/XWMSPOH/Index.cshtml index 38b1044..d71b0f2 100644 --- a/HHWMS.Web/Areas/XWMS/Views/XWMSPOH/Index.cshtml +++ b/HHWMS.Web/Areas/XWMS/Views/XWMSPOH/Index.cshtml @@ -273,17 +273,14 @@ data() { return { form: { - address: '', + address: 'HYB', billno: '', supply: '', materialcode: '' }, addressList: [{ - value: 'QCT', - label: 'QCT' - }, { - value: 'SBD', - label: 'SBD' + value: 'HYB', + label: 'HYB' }], options: [{ value: 'A', @@ -306,6 +303,8 @@ }; }, mounted: function () { + var t = localStorage.getItem("WareHouseId"); + console.log(t); // 获取所有单据编码 // $.ajax({ // type: "post", diff --git a/HHWMS.Web/Areas/XWMS/Views/XWMSPTH/Index.cshtml b/HHWMS.Web/Areas/XWMS/Views/XWMSPTH/Index.cshtml index 29611b6..4136f97 100644 --- a/HHWMS.Web/Areas/XWMS/Views/XWMSPTH/Index.cshtml +++ b/HHWMS.Web/Areas/XWMS/Views/XWMSPTH/Index.cshtml @@ -113,18 +113,15 @@ data() { return { form: { - address: '', + address: 'HYB', billno: '', supply: '', materialcode: '', cgsh: '' }, addressList: [{ - value: 'QCT', - label: 'QCT' - }, { - value: 'SBD', - label: 'SBD' + value: 'HYB', + label: 'HYB' }], loading: false, tableData: [], diff --git a/HHWMS.Web/Areas/XWMS/Views/XWMSSHIP/Index.cshtml b/HHWMS.Web/Areas/XWMS/Views/XWMSSHIP/Index.cshtml index 9df0470..d378e5b 100644 --- a/HHWMS.Web/Areas/XWMS/Views/XWMSSHIP/Index.cshtml +++ b/HHWMS.Web/Areas/XWMS/Views/XWMSSHIP/Index.cshtml @@ -37,7 +37,7 @@ - + @@ -108,17 +108,14 @@ data() { return { form: { - address: '', + address: 'HYB', billno: '', sbill: '', materialcode: '' }, addressList: [{ - value: 'QCT', - label: 'QCT' - }, { - value: 'SBD', - label: 'SBD' + value: 'HYB', + label: 'HYB' }], options: [{ value: 'A', @@ -228,9 +225,23 @@ return; } if (_this.verify(_this.multipleSelection)) { - _this.$message.error("请选择同一张采购单!"); + _this.$message.error("请选择同一张单据!"); return; } + //收货单要完整收完 + var SDHNUM_0 = _this.multipleSelection[0].SDHNUM_0; + var tmp = []; + _this.tableData.forEach(function (x) { + if (x.SDHNUM_0 == SDHNUM_0) { + tmp.push(x.SDHNUM_0) + } + }); + console.log(tmp, _this.multipleSelection) + if (tmp.length != _this.multipleSelection.length) { + _this.$message.error("一张收货单必须全部收完!"); + return; + } + $.ajax({ type: "post", dataType: "json", @@ -261,7 +272,7 @@ }, verify(array) { const tmp = new Set(); - array.forEach(x => tmp.add(x.POHNUM_0)); + array.forEach(x => tmp.add(x.SDHNUM_0)); return tmp.size > 1 ? true : false; } }, diff --git a/HHWMS.Web/Areas/XWMS/Views/XWMSSOH/Index.cshtml b/HHWMS.Web/Areas/XWMS/Views/XWMSSOH/Index.cshtml index 996fccb..09f5deb 100644 --- a/HHWMS.Web/Areas/XWMS/Views/XWMSSOH/Index.cshtml +++ b/HHWMS.Web/Areas/XWMS/Views/XWMSSOH/Index.cshtml @@ -101,17 +101,14 @@ data() { return { form: { - address: '', + address: 'HYB', billno: '', cust: '', materialcode: '' }, addressList: [{ - value: 'QCT', - label: 'QCT' - }, { - value: 'SBD', - label: 'SBD' + value: 'HYB', + label: 'HYB' }], loading: false, tableData: [], diff --git a/HHWMS.Web/DataContext.cs b/HHWMS.Web/DataContext.cs index 978df7e..de5da67 100644 --- a/HHWMS.Web/DataContext.cs +++ b/HHWMS.Web/DataContext.cs @@ -60,6 +60,9 @@ namespace HHWMS.Web public DbSet ShipmentHeader2s { get; set; } public DbSet ShipmentDetail2s { get; set; } + + public DbSet Suppliers { get; set; } + public DbSet Material2s { get; set; } public override async Task DataInit(object allModules, bool IsSpa) { var state = await base.DataInit(allModules, IsSpa); diff --git a/HHWMS.Web/Models/XWMS/Material.cs b/HHWMS.Web/Models/XWMS/Material.cs new file mode 100644 index 0000000..078bdde --- /dev/null +++ b/HHWMS.Web/Models/XWMS/Material.cs @@ -0,0 +1,223 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using WalkingTec.Mvvm.Core; + +namespace HHWMS.Web.Models +{ + /// + /// 供应商 + /// + [Table("material")] + public partial class Material2 : BasePoco + { + [Key] + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public new int ID { get; set; } + /// + /// 仓库Id + /// + [Column("warehouseId")] + public int? WarehouseId { get; set; } + /// + /// 仓库编码 + /// + [Column("warehouseCode")] + public string WarehouseCode { get; set; } + /// + /// 货主id + /// + [Column("companyId")] + public int? CompanyId { get; set; } + /// + /// 货主编码 + /// + [Column("companyCode")] + public string CompanyCode { get; set; } + /// + /// 物料编码 + /// + [Column("code")] + public string Code { get; set; } + /// + /// 物料类别 + /// + [Column("type")] + public string Type { get; set; } + /// + /// 名称 + /// + [Column("name")] + public string Name { get; set; } + /// + /// 条码 + /// + [Column("barcode")] + public string Barcode { get; set; } + /// + /// 条码2 + /// + [Column("barcode2")] + public string Barcode2 { get; set; } + /// + /// 条码3 + /// + [Column("barcode3")] + public string Barcode3 { get; set; } + /// + /// 条码4 + /// + [Column("barcode4")] + public string Barcode4 { get; set; } + /// + /// 类别A + /// + [Column("classA")] + public string ClassA { get; set; } + /// + /// 类别B + /// + [Column("classB")] + public string ClassB { get; set; } + /// + /// 类别C + /// + [Column("classC")] + public string ClassC { get; set; } + /// + /// 规格 + /// + [Column("specification")] + public string Specification { get; set; } + /// + /// 品牌 + /// + [Column("brand")] + public string Brand { get; set; } + /// + /// 尺码 + /// + [Column("size")] + public string Size { get; set; } + /// + /// 颜色 + /// + [Column("color")] + public string Color { get; set; } + /// + /// 产地 + /// + [Column("placeOfOrigin")] + public string PlaceOfOrigin { get; set; } + /// + /// 保质期(天) + /// + [Column("daysToExpire")] + public int? DaysToExpire { get; set; } + /// + /// 临期预警天数 + /// + [Column("expiringDays")] + public int? ExpiringDays { get; set; } + /// + /// 收货预警天数 + /// + [Column("minShelfLifeDays")] + public int? MinShelfLifeDays { get; set; } + /// + /// 成本 + /// + [Column("costPrice")] + public decimal? CostPrice { get; set; } + /// + /// 标价 + /// + [Column("listPrice")] + public decimal? ListPrice { get; set; } + /// + /// 净价 + /// + [Column("netPrice")] + public decimal? NetPrice { get; set; } + /// + /// 主计量单位 + /// + [Column("masterUnit")] + public string MasterUnit { get; set; } + /// + /// 辅计量单位 + /// + [Column("assistUnit")] + public string AssistUnit { get; set; } + /// + /// 计量换算率 + /// + [Column("convertRate")] + public float? ConvertRate { get; set; } + /// + /// + /// + [Column("manufactureDate")] + public bool? ManufactureDate { get; set; } + /// + /// + /// + [Column("receiptDate")] + public bool? ReceiptDate { get; set; } + /// + /// + /// + [Column("enable")] + public bool? Enable { get; set; } + /// + /// + /// + [Column("deleted")] + public bool? Deleted { get; set; } + /// + /// 自定义字段1 + /// + [Column("userDef1")] + public string UserDef1 { get; set; } + /// + /// 自定义字段2 + /// + [Column("userDef2")] + public string UserDef2 { get; set; } + /// + /// 自定义字段3 + /// + [Column("userDef3")] + public string UserDef3 { get; set; } + /// + /// 自定义字段4 + /// + [Column("userDef4")] + public string UserDef4 { get; set; } + /// + /// 自定义字段5 + /// + [Column("userDef5")] + public string UserDef5 { get; set; } + /// + /// 自定义字段6 + /// + [Column("userDef6")] + public string UserDef6 { get; set; } + /// + /// 自定义字段7 + /// + [Column("userDef7")] + public string UserDef7 { get; set; } + /// + /// 自定义字段8 + /// + [Column("userDef8")] + public string UserDef8 { get; set; } + /// + /// 库区编码 + /// + [Column("zoneCode")] + public string ZoneCode { get; set; } + } +} diff --git a/HHWMS.Web/Models/XWMS/ReceiptDetail.cs b/HHWMS.Web/Models/XWMS/ReceiptDetail.cs index 53868d2..93b64fd 100644 --- a/HHWMS.Web/Models/XWMS/ReceiptDetail.cs +++ b/HHWMS.Web/Models/XWMS/ReceiptDetail.cs @@ -15,6 +15,17 @@ namespace HHWMS.Web.Models [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public new int ID { get; set; } + /// + /// 仓库Id + /// + [Column("warehouseId")] + public int? WarehouseId { get; set; } + /// + /// 仓库编码 + /// + [Column("warehouseCode")] + public string WarehouseCode { get; set; } + /// /// 库区 /// diff --git a/HHWMS.Web/Models/XWMS/ReceiptHeader.cs b/HHWMS.Web/Models/XWMS/ReceiptHeader.cs index 0b76920..478a4bc 100644 --- a/HHWMS.Web/Models/XWMS/ReceiptHeader.cs +++ b/HHWMS.Web/Models/XWMS/ReceiptHeader.cs @@ -15,6 +15,17 @@ namespace HHWMS.Web.Models [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public new int ID { get; set; } + /// + /// 仓库Id + /// + [Column("warehouseId")] + public int? WarehouseId { get; set; } + /// + /// 仓库编码 + /// + [Column("warehouseCode")] + public string WarehouseCode { get; set; } + /// /// 入库单号 /// @@ -170,5 +181,17 @@ namespace HHWMS.Web.Models /// [Column("station")] public string Station { get; set; } + + /// + /// 回传单号 + /// + [Column("userDef4")] + public string UserDef4 { get; set; } + + /// + /// 交易组 + /// + [Column("userDef5")] + public string UserDef5 { get; set; } } } diff --git a/HHWMS.Web/Models/XWMS/ShipmentDetail.cs b/HHWMS.Web/Models/XWMS/ShipmentDetail.cs index e9a6da5..18c2140 100644 --- a/HHWMS.Web/Models/XWMS/ShipmentDetail.cs +++ b/HHWMS.Web/Models/XWMS/ShipmentDetail.cs @@ -15,6 +15,17 @@ namespace HHWMS.Web.Models [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public new int ID { get; set; } + /// + /// 仓库Id + /// + [Column("warehouseId")] + public int? WarehouseId { get; set; } + /// + /// 仓库编码 + /// + [Column("warehouseCode")] + public string WarehouseCode { get; set; } + /// /// 库区 /// diff --git a/HHWMS.Web/Models/XWMS/ShipmentHeader.cs b/HHWMS.Web/Models/XWMS/ShipmentHeader.cs index 7219720..cf04b6f 100644 --- a/HHWMS.Web/Models/XWMS/ShipmentHeader.cs +++ b/HHWMS.Web/Models/XWMS/ShipmentHeader.cs @@ -15,6 +15,17 @@ namespace HHWMS.Web.Models [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public new int ID { get; set; } + /// + /// 仓库Id + /// + [Column("warehouseId")] + public int? WarehouseId { get; set; } + /// + /// 仓库编码 + /// + [Column("warehouseCode")] + public string WarehouseCode { get; set; } + /// /// 出库单号 /// @@ -152,5 +163,11 @@ namespace HHWMS.Web.Models /// [Column("userDef3")] public string UserDef3 { get; set; } + + /// + /// 交易组 + /// + [Column("userDef4")] + public string UserDef4 { get; set; } } } diff --git a/HHWMS.Web/Models/XWMS/Supplier.cs b/HHWMS.Web/Models/XWMS/Supplier.cs new file mode 100644 index 0000000..8fccd74 --- /dev/null +++ b/HHWMS.Web/Models/XWMS/Supplier.cs @@ -0,0 +1,113 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using WalkingTec.Mvvm.Core; + +namespace HHWMS.Web.Models +{ + /// + /// 供应商 + /// + [Table("supplier")] + public partial class Supplier : BasePoco + { + [Key] + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public new int ID { get; set; } + /// + /// 编码 + /// + [Column("code")] + public string Code { get; set; } + /// + /// 编码2 + /// + [Column("code2")] + public string Code2 { get; set; } + /// + /// 名称 + /// + [Column("name")] + public string Name { get; set; } + /// + /// 地址1 + /// + [Column("address1")] + public string Address1 { get; set; } + /// + /// 地址2 + /// + [Column("address2")] + public string Address2 { get; set; } + /// + /// 城市 + /// + [Column("city")] + public string City { get; set; } + /// + /// 省份 + /// + [Column("province")] + public string Province { get; set; } + /// + /// 国家 + /// + [Column("country")] + public string Country { get; set; } + /// + /// 邮编 + /// + [Column("postalCode")] + public string PostalCode { get; set; } + /// + /// 联系人 + /// + [Column("attentionTo")] + public string AttentionTo { get; set; } + /// + /// 电话 + /// + [Column("phoneNum")] + public string PhoneNum { get; set; } + /// + /// 手机 + /// + [Column("mobile")] + public string Mobile { get; set; } + /// + /// 传真 + /// + [Column("faxNum")] + public string FaxNum { get; set; } + /// + /// E-mail + /// + [Column("email")] + public string Email { get; set; } + /// + /// + /// + [Column("enable")] + public bool? Enable { get; set; } + /// + /// + /// + [Column("deleted")] + public bool? Deleted { get; set; } + /// + /// 自定义字段1 + /// + [Column("userDef1")] + public string UserDef1 { get; set; } + /// + /// 自定义字段2 + /// + [Column("userDef2")] + public string UserDef2 { get; set; } + /// + /// 自定义字段3 + /// + [Column("userDef3")] + public string UserDef3 { get; set; } + } +} diff --git a/HHWMS.Web/appsettings.json b/HHWMS.Web/appsettings.json index 5afc6b0..5c77b4a 100644 --- a/HHWMS.Web/appsettings.json +++ b/HHWMS.Web/appsettings.json @@ -30,7 +30,7 @@ }, { "Key": "hangyong", - "Value": "Server=127.0.0.1;Port=3306;Database=hangyongwms;Uid=root;Password=abc123*;Character Set=utf8mb4;", + "Value": "Server=127.0.0.1;Port=3306;Database=hangtongwms2;Uid=root;Password=abc123*;Character Set=utf8mb4;", "DbContext": "DataContext", "DBType": "mysql" }