diff --git a/HHWMS.Web/Areas/XWMS/Controllers/ReceiptHeader2Controller.cs b/HHWMS.Web/Areas/XWMS/Controllers/ReceiptHeader2Controller.cs new file mode 100644 index 0000000..70572db --- /dev/null +++ b/HHWMS.Web/Areas/XWMS/Controllers/ReceiptHeader2Controller.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.xwms.ViewModels.ReceiptHeader2VMs; + +namespace HHWMS.Web.Controllers +{ + [Area("xwms")] + [ActionDescription("入库单")] + public partial class ReceiptHeader2Controller : BaseController + { + private readonly IUnitWork _unitwork; + + public ReceiptHeader2Controller(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(ReceiptHeader2Searcher 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(ReceiptHeader2VM 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(ReceiptHeader2VM 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(ReceiptHeader2BatchVM 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(ReceiptHeader2BatchVM 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(ReceiptHeader2ImportVM 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(ReceiptHeader2ListVM vm) + { + return vm.GetExportData(); + } + #endregion + + } +} diff --git a/HHWMS.Web/Areas/XWMS/Controllers/XWMSPOHController.cs b/HHWMS.Web/Areas/XWMS/Controllers/XWMSPOHController.cs index a1b5e4e..41457f6 100644 --- a/HHWMS.Web/Areas/XWMS/Controllers/XWMSPOHController.cs +++ b/HHWMS.Web/Areas/XWMS/Controllers/XWMSPOHController.cs @@ -94,9 +94,42 @@ public class XWMSPOHController : BaseController var _unitwork = new UnitWork(Wtm); var receipt = new ReceiptHeader2(); - receipt.Code = "12345"; + receipt.Code = _unitwork.GetSerialNumber("CGR"); + receipt.SourceCode = data.FirstOrDefault().POHNUM_0; + receipt.SupplierCode = data.FirstOrDefault().BPSNUM_0; + receipt.SupplierName = data.FirstOrDefault().BPRNAM_0; + receipt.Type = "CGR"; + receipt.FirstStatus = 0; + receipt.AppointmentTime = data.FirstOrDefault().ORDDAT_0; + receipt.UserDef2 = data.FirstOrDefault().POHFCY_0; + _unitwork.Add(receipt); + var detailList = new List(); + foreach(var item in data) + { + var detail = new ReceiptDetail2(); + detail.ZoneCode = "L"; + detail.ReceiptId = receipt.ID; + detail.ReceiptCode = receipt.Code; + 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.Qty = item.THISQTYSTU; + detail.Unit = item.STU_0; + detail.PurchasQty = item.THISQTYUOM; + detail.PurchasUnits = item.UOM_0; + detail.Coefficient = item.UOMSTUCOE_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); + } + _unitwork.BatchAdd(detailList.ToArray()); + return JsonMore(null); } } diff --git a/HHWMS.Web/Areas/XWMS/ViewModels/ReceiptHeader2VMs/ReceiptHeader2BatchVM.cs b/HHWMS.Web/Areas/XWMS/ViewModels/ReceiptHeader2VMs/ReceiptHeader2BatchVM.cs new file mode 100644 index 0000000..d06be12 --- /dev/null +++ b/HHWMS.Web/Areas/XWMS/ViewModels/ReceiptHeader2VMs/ReceiptHeader2BatchVM.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.xwms.ViewModels.ReceiptHeader2VMs +{ + public partial class ReceiptHeader2BatchVM : BaseBatchVM + { + public ReceiptHeader2BatchVM() + { + ListVM = new ReceiptHeader2ListVM(); + LinkedVM = new ReceiptHeader2_BatchEdit(); + } + + } + + /// + /// Class to define batch edit fields + /// + public class ReceiptHeader2_BatchEdit : BaseVM + { + + protected override void InitVM() + { + } + + } + +} diff --git a/HHWMS.Web/Areas/XWMS/ViewModels/ReceiptHeader2VMs/ReceiptHeader2ImportVM.cs b/HHWMS.Web/Areas/XWMS/ViewModels/ReceiptHeader2VMs/ReceiptHeader2ImportVM.cs new file mode 100644 index 0000000..cf62dd6 --- /dev/null +++ b/HHWMS.Web/Areas/XWMS/ViewModels/ReceiptHeader2VMs/ReceiptHeader2ImportVM.cs @@ -0,0 +1,53 @@ +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.xwms.ViewModels.ReceiptHeader2VMs +{ + public partial class ReceiptHeader2TemplateVM : BaseTemplateVM + { + public ExcelPropety Code_Excel = ExcelPropety.CreateProperty(x => x.Code); + public ExcelPropety CompanyId_Excel = ExcelPropety.CreateProperty(x => x.CompanyId); + public ExcelPropety CompanyCode_Excel = ExcelPropety.CreateProperty(x => x.CompanyCode); + public ExcelPropety Type_Excel = ExcelPropety.CreateProperty(x => x.Type); + public ExcelPropety SourceCode_Excel = ExcelPropety.CreateProperty(x => x.SourceCode); + public ExcelPropety SourcePlatform_Excel = ExcelPropety.CreateProperty(x => x.SourcePlatform); + public ExcelPropety SupplierId_Excel = ExcelPropety.CreateProperty(x => x.SupplierId); + public ExcelPropety SupplierCode_Excel = ExcelPropety.CreateProperty(x => x.SupplierCode); + public ExcelPropety SupplierName_Excel = ExcelPropety.CreateProperty(x => x.SupplierName); + public ExcelPropety TotalQty_Excel = ExcelPropety.CreateProperty(x => x.TotalQty); + public ExcelPropety TotalLines_Excel = ExcelPropety.CreateProperty(x => x.TotalLines); + public ExcelPropety FreeScan_Excel = ExcelPropety.CreateProperty(x => x.FreeScan); + public ExcelPropety Remark_Excel = ExcelPropety.CreateProperty(x => x.Remark); + public ExcelPropety UploadStatus_Excel = ExcelPropety.CreateProperty(x => x.UploadStatus); + public ExcelPropety Uploadremark_Excel = ExcelPropety.CreateProperty(x => x.Uploadremark); + public ExcelPropety UploadTime_Excel = ExcelPropety.CreateProperty(x => x.UploadTime); + public ExcelPropety AppointmentTime_Excel = ExcelPropety.CreateProperty(x => x.AppointmentTime); + public ExcelPropety FirstStatus_Excel = ExcelPropety.CreateProperty(x => x.FirstStatus); + public ExcelPropety LastStatus_Excel = ExcelPropety.CreateProperty(x => x.LastStatus); + public ExcelPropety Enable_Excel = ExcelPropety.CreateProperty(x => x.Enable); + public ExcelPropety Deleted_Excel = ExcelPropety.CreateProperty(x => x.Deleted); + public ExcelPropety Scanid_Excel = ExcelPropety.CreateProperty(x => x.Scanid); + 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); + + protected override void InitVM() + { + } + + } + + public class ReceiptHeader2ImportVM : BaseImportVM + { + + } + +} diff --git a/HHWMS.Web/Areas/XWMS/ViewModels/ReceiptHeader2VMs/ReceiptHeader2ListVM.cs b/HHWMS.Web/Areas/XWMS/ViewModels/ReceiptHeader2VMs/ReceiptHeader2ListVM.cs new file mode 100644 index 0000000..6291668 --- /dev/null +++ b/HHWMS.Web/Areas/XWMS/ViewModels/ReceiptHeader2VMs/ReceiptHeader2ListVM.cs @@ -0,0 +1,107 @@ +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.xwms.ViewModels.ReceiptHeader2VMs +{ + public partial class ReceiptHeader2ListVM : BasePagedListVM + { + protected override List InitGridAction() + { + return new List + { + this.MakeStandardAction("ReceiptHeader2", GridActionStandardTypesEnum.Create, Localizer["Sys.Create"],"xwms", dialogWidth: 800), + 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), + this.MakeStandardAction("ReceiptHeader2", GridActionStandardTypesEnum.BatchEdit, Localizer["Sys.BatchEdit"], "xwms", dialogWidth: 800), + this.MakeStandardAction("ReceiptHeader2", GridActionStandardTypesEnum.BatchDelete, Localizer["Sys.BatchDelete"], "xwms", dialogWidth: 800), + this.MakeStandardAction("ReceiptHeader2", GridActionStandardTypesEnum.Import, Localizer["Sys.Import"], "xwms", dialogWidth: 800), + this.MakeStandardAction("ReceiptHeader2", GridActionStandardTypesEnum.ExportExcel, Localizer["Sys.Export"], "xwms"), + }; + } + + + protected override IEnumerable> InitGridHeader() + { + return new List>{ + this.MakeGridHeader(x => x.Code), + this.MakeGridHeader(x => x.CompanyId), + this.MakeGridHeader(x => x.CompanyCode), + 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.TotalLines), + this.MakeGridHeader(x => x.FreeScan), + this.MakeGridHeader(x => x.Remark), + this.MakeGridHeader(x => x.UploadStatus), + this.MakeGridHeader(x => x.Uploadremark), + this.MakeGridHeader(x => x.UploadTime), + this.MakeGridHeader(x => x.AppointmentTime), + 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.Station), + this.MakeGridHeaderAction(width: 200) + }; + } + + public override IOrderedQueryable GetSearchQuery() + { + var query = DC.Set() + .Select(x => new ReceiptHeader2_View + { + ID = x.ID, + Code = x.Code, + CompanyId = x.CompanyId, + CompanyCode = x.CompanyCode, + Type = x.Type, + SourceCode = x.SourceCode, + SourcePlatform = x.SourcePlatform, + SupplierId = x.SupplierId, + SupplierCode = x.SupplierCode, + SupplierName = x.SupplierName, + TotalQty = x.TotalQty, + TotalLines = x.TotalLines, + FreeScan = x.FreeScan, + Remark = x.Remark, + UploadStatus = x.UploadStatus, + Uploadremark = x.Uploadremark, + UploadTime = x.UploadTime, + AppointmentTime = x.AppointmentTime, + FirstStatus = x.FirstStatus, + LastStatus = x.LastStatus, + Enable = x.Enable, + Deleted = x.Deleted, + Scanid = x.Scanid, + UserDef1 = x.UserDef1, + UserDef2 = x.UserDef2, + UserDef3 = x.UserDef3, + Station = x.Station, + }) + .OrderBy(x => x.ID); + return query; + } + + } + + public class ReceiptHeader2_View : ReceiptHeader2{ + + } +} diff --git a/HHWMS.Web/Areas/XWMS/ViewModels/ReceiptHeader2VMs/ReceiptHeader2Searcher.cs b/HHWMS.Web/Areas/XWMS/ViewModels/ReceiptHeader2VMs/ReceiptHeader2Searcher.cs new file mode 100644 index 0000000..4c34c24 --- /dev/null +++ b/HHWMS.Web/Areas/XWMS/ViewModels/ReceiptHeader2VMs/ReceiptHeader2Searcher.cs @@ -0,0 +1,21 @@ +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.xwms.ViewModels.ReceiptHeader2VMs +{ + public partial class ReceiptHeader2Searcher : BaseSearcher + { + + protected override void InitVM() + { + } + + } +} diff --git a/HHWMS.Web/Areas/XWMS/ViewModels/ReceiptHeader2VMs/ReceiptHeader2VM.cs b/HHWMS.Web/Areas/XWMS/ViewModels/ReceiptHeader2VMs/ReceiptHeader2VM.cs new file mode 100644 index 0000000..84ebfbd --- /dev/null +++ b/HHWMS.Web/Areas/XWMS/ViewModels/ReceiptHeader2VMs/ReceiptHeader2VM.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.xwms.ViewModels.ReceiptHeader2VMs +{ + public partial class ReceiptHeader2VM : BaseCRUDVM + { + + public ReceiptHeader2VM() + { + } + + 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/Views/ReceiptHeader2/BatchDelete.cshtml b/HHWMS.Web/Areas/XWMS/Views/ReceiptHeader2/BatchDelete.cshtml new file mode 100644 index 0000000..976669b --- /dev/null +++ b/HHWMS.Web/Areas/XWMS/Views/ReceiptHeader2/BatchDelete.cshtml @@ -0,0 +1,12 @@ +@model HHWMS.Web.xwms.ViewModels.ReceiptHeader2VMs.ReceiptHeader2BatchVM +@inject IStringLocalizer Localizer; + + + @Localizer["Sys.BatchDeleteConfirm"] + + + + + + + diff --git a/HHWMS.Web/Areas/XWMS/Views/ReceiptHeader2/BatchEdit.cshtml b/HHWMS.Web/Areas/XWMS/Views/ReceiptHeader2/BatchEdit.cshtml new file mode 100644 index 0000000..68ba09f --- /dev/null +++ b/HHWMS.Web/Areas/XWMS/Views/ReceiptHeader2/BatchEdit.cshtml @@ -0,0 +1,14 @@ +@model HHWMS.Web.xwms.ViewModels.ReceiptHeader2VMs.ReceiptHeader2BatchVM +@inject IStringLocalizer Localizer; + + +
@Localizer["Sys.BatchEditConfirm"]
+ + + + + + + + +
diff --git a/HHWMS.Web/Areas/XWMS/Views/ReceiptHeader2/Create.cshtml b/HHWMS.Web/Areas/XWMS/Views/ReceiptHeader2/Create.cshtml new file mode 100644 index 0000000..c632cf4 --- /dev/null +++ b/HHWMS.Web/Areas/XWMS/Views/ReceiptHeader2/Create.cshtml @@ -0,0 +1,37 @@ +@model HHWMS.Web.xwms.ViewModels.ReceiptHeader2VMs.ReceiptHeader2VM +@inject IStringLocalizer Localizer; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HHWMS.Web/Areas/XWMS/Views/ReceiptHeader2/Delete.cshtml b/HHWMS.Web/Areas/XWMS/Views/ReceiptHeader2/Delete.cshtml new file mode 100644 index 0000000..b355371 --- /dev/null +++ b/HHWMS.Web/Areas/XWMS/Views/ReceiptHeader2/Delete.cshtml @@ -0,0 +1,39 @@ +@model HHWMS.Web.xwms.ViewModels.ReceiptHeader2VMs.ReceiptHeader2VM +@inject IStringLocalizer Localizer; + + + @Localizer["Sys.DeleteConfirm"] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HHWMS.Web/Areas/XWMS/Views/ReceiptHeader2/Details.cshtml b/HHWMS.Web/Areas/XWMS/Views/ReceiptHeader2/Details.cshtml new file mode 100644 index 0000000..0739926 --- /dev/null +++ b/HHWMS.Web/Areas/XWMS/Views/ReceiptHeader2/Details.cshtml @@ -0,0 +1,36 @@ +@model HHWMS.Web.xwms.ViewModels.ReceiptHeader2VMs.ReceiptHeader2VM +@inject IStringLocalizer Localizer; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HHWMS.Web/Areas/XWMS/Views/ReceiptHeader2/Edit.cshtml b/HHWMS.Web/Areas/XWMS/Views/ReceiptHeader2/Edit.cshtml new file mode 100644 index 0000000..ef77f80 --- /dev/null +++ b/HHWMS.Web/Areas/XWMS/Views/ReceiptHeader2/Edit.cshtml @@ -0,0 +1,38 @@ +@model HHWMS.Web.xwms.ViewModels.ReceiptHeader2VMs.ReceiptHeader2VM +@inject IStringLocalizer Localizer; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HHWMS.Web/Areas/XWMS/Views/ReceiptHeader2/Import.cshtml b/HHWMS.Web/Areas/XWMS/Views/ReceiptHeader2/Import.cshtml new file mode 100644 index 0000000..7796bad --- /dev/null +++ b/HHWMS.Web/Areas/XWMS/Views/ReceiptHeader2/Import.cshtml @@ -0,0 +1,14 @@ +@model HHWMS.Web.xwms.ViewModels.ReceiptHeader2VMs.ReceiptHeader2ImportVM +@inject IStringLocalizer Localizer; + + + + + + + + + + + + diff --git a/HHWMS.Web/Areas/XWMS/Views/ReceiptHeader2/Index.cshtml b/HHWMS.Web/Areas/XWMS/Views/ReceiptHeader2/Index.cshtml new file mode 100644 index 0000000..2bdbec8 --- /dev/null +++ b/HHWMS.Web/Areas/XWMS/Views/ReceiptHeader2/Index.cshtml @@ -0,0 +1,8 @@ +@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 7b08a3c..903845b 100644 --- a/HHWMS.Web/Areas/XWMS/Views/XWMSPOH/Index.cshtml +++ b/HHWMS.Web/Areas/XWMS/Views/XWMSPOH/Index.cshtml @@ -196,6 +196,8 @@ height="650" stripe border style="width: 100%" size="small" + ref="tableData" + v-loading="loading" @@cell-mouse-enter="handleCellEnter" @@cell-mouse-leave="handleCellLeave" @@selection-change="handleSelectionChange"> @@ -293,6 +295,7 @@ value: 'R', label: 'R' }], + loading: false, tableData: [], currentPage: 1, // 当前页码 total: 20, // 总条数 @@ -340,6 +343,26 @@ cell.querySelector('.item__input').style.display = 'none' cell.querySelector('.item__txt').style.display = 'block' } + if (property == "THISQTYSTU") { + // 库存单位除以系数 + if (row.THISQTYSTU > row.QTYSTU_0) { + row.THISQTYSTU = row.QTYSTU_0; + this.$message.error("不能超出单据数量"); + } + else { + row.THISQTYUOM = row.THISQTYSTU / row.UOMSTUCOE_0; + } + } + if (property == "THISQTYUOM") { + // 采购单位 乘 系数 + if (row.THISQTYUOM > row.QTYUOM_0) { + row.THISQTYUOM = row.QTYUOM_0; + this.$message.error("不能超出单据数量"); + } + else { + row.THISQTYSTU = row.THISQTYUOM * row.UOMSTUCOE_0; + } + } }, //每页条数改变时触发 选择一页显示多少行 handleSizeChange(val) { @@ -354,7 +377,8 @@ this.multipleSelection = val; }, search() { - var _this = this; + var _this = this; + _this.loading = true; $.ajax({ type: "post", dataType: "json", @@ -366,34 +390,60 @@ }, url: "/xwms/XWMSPOH/Search", success: function (json) { - app.tableData = json.Data; + _this.tableData = json.Data; + _this.loading = false; }, error: function (json) { - alert("加载失败"); + this.$message.error("加载失败"); } }); }, create() { var _this = this; - $.ajax({ - type: "post", - dataType: "json", - data: { - data: _this.multipleSelection - }, - url: "/xwms/XWMSPOH/Create", - success: function (json) { - if (json.Code == 200) { - _this.$message({ - message: "创建成功!" - }); - _this.$refs.multipleTable.clearSelection(); + _this.$confirm('注意:您确认要对此单据进行创建采购入库吗?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + //加校验 + if (_this.verify(_this.multipleSelection)) { + _this.$message.error("请选择同一张采购单!"); + } else { + + + $.ajax({ + type: "post", + dataType: "json", + data: { + data: _this.multipleSelection + }, + url: "/xwms/XWMSPOH/Create", + success: function (json) { + if (json.Code == 200) { + _this.$message("创建成功!"); + _this.$refs.tableData.clearSelection(); + } + else{ + _this.$message.error("创建失败!" + json.Msg); + } + }, + error: function (json) { + _this.$message.error("创建失败!"); } - }, - error: function (json) { - alert("加载失败"); + }); } + }).catch(() => { + this.$message({ + type: 'info', + message: '已取消!' + }); }); + + }, + verify(array) { + const tmp = new Set(); + array.forEach(x => tmp.add(x.POHNUM_0)); + return tmp.size > 1 ? true : false; } }, }); diff --git a/HHWMS.Web/Areas/XWMS/Views/XWMSSHIP/Index.cshtml b/HHWMS.Web/Areas/XWMS/Views/XWMSSHIP/Index.cshtml index e7d37de..5c8408c 100644 --- a/HHWMS.Web/Areas/XWMS/Views/XWMSSHIP/Index.cshtml +++ b/HHWMS.Web/Areas/XWMS/Views/XWMSSHIP/Index.cshtml @@ -189,6 +189,7 @@ }, create() { var _this = this; + $.ajax({ type: "post", dataType: "json", @@ -208,6 +209,19 @@ alert("加载失败"); } }); + }, + hasDuplicate(array) { + const seen = new Set(); + + for(let i = 0; i options) : base(options) { } - - public DbSet ReceiptHeader2s { get; set; } - public DbSet ReceiptDetail2s { get; set; } - - } - - -} diff --git a/HHWMS.Web/Models/XWMS/ReceiptDetail.cs b/HHWMS.Web/Models/XWMS/ReceiptDetail.cs index 953c91c..53868d2 100644 --- a/HHWMS.Web/Models/XWMS/ReceiptDetail.cs +++ b/HHWMS.Web/Models/XWMS/ReceiptDetail.cs @@ -14,156 +14,205 @@ namespace HHWMS.Web.Models [Key] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public new int ID { get; set; } + /// /// 库区 /// [Column("zoneCode")] public string ZoneCode { get; set; } + /// /// 货主id /// [Column("companyId")] public int? CompanyId { get; set; } + /// /// 货主编码 /// [Column("companyCode")] public string CompanyCode { get; set; } + /// /// 上游系统单号 /// [Column("sourceCode")] public string SourceCode { get; set; } + /// /// 供应商编码 /// [Column("supplierCode")] public string SupplierCode { get; set; } + /// /// 供应商名称 /// [Column("supplierName")] public string SupplierName { get; set; } + /// /// 订单号 /// [Column("cPoCode")] public string CPoCode { get; set; } + /// /// 工作令号 /// [Column("moCode")] public string MoCode { get; set; } + /// /// 上游系统行号 /// [Column("sourceLine")] public string SourceLine { get; set; } + /// /// 入库单id /// [Column("receiptId")] public int? ReceiptId { get; set; } + /// /// 入库单编码 /// [Column("receiptCode")] public string ReceiptCode { get; set; } + /// /// 物料Id /// [Column("materialId")] public int? MaterialId { get; set; } + /// /// 物料编码 /// [Column("materialCode")] public string MaterialCode { get; set; } + /// /// 物料名称 /// [Column("materialName")] public string MaterialName { get; set; } + /// /// 批次 /// [Column("batch")] public string Batch { get; set; } + /// /// 批号---规格 /// [Column("lot")] public string Lot { get; set; } + /// /// SN:铁损值 /// [Column("sn")] public string Sn { get; set; } + /// /// 项目号:二维码 /// [Column("project")] public string Project { get; set; } + /// /// 生产日期 /// [Column("manufactureDate")] public System.DateTime? ManufactureDate { get; set; } + /// /// 失效日期 /// [Column("expirationDate")] public System.DateTime? ExpirationDate { get; set; } + /// /// 物料状态:0:存货编码;1:批次;2:序列号 /// [Column("inventoryStatus")] public string InventoryStatus { get; set; } + /// /// 系统数量 /// [Column("qty")] public decimal? Qty { get; set; } + /// /// 收货数量 /// [Column("qtyCompleted")] public decimal? QtyCompleted { get; set; } + /// /// 单位 /// [Column("unit")] public string Unit { get; set; } + + /// + /// 采购数量 + /// + [Column("purchasQty")] + public decimal? PurchasQty { get; set; } + + /// + /// 采购单位 + /// + [Column("purchasUnits")] + public string PurchasUnits { get; set; } + + /// + /// 系数:库存单位/采购单位 + /// + [Column("coefficient")] + public decimal? Coefficient { get; set; } + /// /// 单价 /// [Column("price")] public decimal? Price { get; set; } + /// /// 状态 /// [Column("status")] public int? Status { get; set; } + /// - /// + /// /// [Column("deleted")] public bool? Deleted { get; set; } + /// - /// + /// /// [Column("autoId")] public int? AutoId { get; set; } + /// /// 宽度 /// [Column("userDef1")] public string UserDef1 { get; set; } + /// /// 片厚 /// [Column("userDef2")] public string UserDef2 { get; set; } + /// /// 直径 /// @@ -175,6 +224,7 @@ namespace HHWMS.Web.Models /// [Column("station")] public string Station { get; set; } + /// /// 已分配数量 /// diff --git a/HHWMS.Web/Models/XWMS/ReceiptHeader.cs b/HHWMS.Web/Models/XWMS/ReceiptHeader.cs index a51974c..0b76920 100644 --- a/HHWMS.Web/Models/XWMS/ReceiptHeader.cs +++ b/HHWMS.Web/Models/XWMS/ReceiptHeader.cs @@ -20,126 +20,151 @@ namespace HHWMS.Web.Models /// [Column("code")] public string Code { get; set; } + /// /// 货主id /// [Column("companyId")] public int? CompanyId { get; set; } + /// /// 货主编码 /// [Column("companyCode")] public string CompanyCode { get; set; } + /// /// 入库类型 /// [Column("type")] public string Type { get; set; } + /// /// 上游系统单号 /// [Column("sourceCode")] public string SourceCode { get; set; } + /// /// 上游平台:单据ID /// [Column("sourcePlatform")] public string SourcePlatform { get; set; } + /// /// 供应商id /// [Column("supplierId")] public int? SupplierId { get; set; } + /// /// 供应商编码 /// [Column("supplierCode")] public string SupplierCode { get; set; } + /// /// 供应商名称 /// [Column("supplierName")] public string SupplierName { get; set; } + /// /// 总数量 /// [Column("totalQty")] public decimal? TotalQty { get; set; } + /// /// 总行数 /// [Column("totalLines")] public int? TotalLines { get; set; } + /// /// 扫码绑定标记 /// [Column("freeScan")] public int? FreeScan { get; set; } + /// /// 入库单备注 /// [Column("remark")] public string Remark { get; set; } + /// /// upload状态 /// [Column("uploadStatus")] public int? UploadStatus { get; set; } + /// /// 上传备注 /// [Column("uploadremark")] public string Uploadremark { get; set; } + /// /// 上传时间 /// [Column("uploadTime")] public System.DateTime? UploadTime { get; set; } + /// /// 入库预约时间 /// [Column("appointmentTime")] public System.DateTime? AppointmentTime { get; set; } + /// /// 单据头状态 /// [Column("firstStatus")] public int? FirstStatus { get; set; } + /// /// 单据尾状态 /// [Column("lastStatus")] public int? LastStatus { get; set; } + /// - /// + /// /// [Column("enable")] public bool? Enable { get; set; } + /// - /// + /// /// [Column("deleted")] public bool? Deleted { get; set; } + /// /// 扫描标识 /// [Column("scanid")] public string Scanid { 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/Models/XWMS/XWMSPOH.cs b/HHWMS.Web/Models/XWMS/XWMSPOH.cs index f0f4b71..663f056 100644 --- a/HHWMS.Web/Models/XWMS/XWMSPOH.cs +++ b/HHWMS.Web/Models/XWMS/XWMSPOH.cs @@ -17,7 +17,7 @@ namespace HHWMS.Web.Models /// /// 订单日期 /// - public DateOnly ORDDAT_0 { get; set; } + public DateTime ORDDAT_0 { get; set; } /// /// 供应商