diff --git a/AMESCoreStudio.Web/Controllers/PCBController.cs b/AMESCoreStudio.Web/Controllers/PCBController.cs index 67269de2..a84dbc0e 100644 --- a/AMESCoreStudio.Web/Controllers/PCBController.cs +++ b/AMESCoreStudio.Web/Controllers/PCBController.cs @@ -220,16 +220,14 @@ namespace AMESCoreStudio.Web.Controllers return View(); } - public async Task PCB014QueryAsync(string steelPlateNo, string pcbPartNo - , string side, string status, int page = 0, int limit = 10) + public async Task PCB014QueryAsync(string solderPasteNo, string status, int page = 0, int limit = 10) { - //IResultModel result = await _pcbApi.GetSolderPasteInfoQuery(steelPlateNo: steelPlateNo, pcbPartNo: pcbPartNo - //, side: side, status: status, page: page, limit: limit); + IResultModel result = await _pcbApi.GetSolderPasteInfoQuery(solderPasteNo: solderPasteNo, status: status, page: page, limit: limit); - //if (result.Data.Count() != 0) - //{ - // return Json(new Table() { code = 0, msg = "", data = result.Data, count = result.DataTotal }); - //} + if (result.Data.Count() != 0) + { + return Json(new Table() { code = 0, msg = "", data = result.Data, count = result.DataTotal }); + } return Json(new Table() { count = 0, data = null }); } @@ -249,12 +247,12 @@ namespace AMESCoreStudio.Web.Controllers //頁面提交,id=0 添加,id>0 修改 [HttpPost] - public async Task PCB014Async(SteelPlateInfo model) + public async Task PCB014Async(SolderPasteInfo model) { if (ModelState.IsValid) { IResultModel result; - if (model.SteelPlateID == 0) + if (model.SolderPasteID == 0) { model.CreateUserID = GetLogInUserID(); model.CreateDate = DateTime.Now; @@ -271,7 +269,7 @@ namespace AMESCoreStudio.Web.Controllers if (result.Success) { - var _msg = model.SteelPlateID == 0 ? "新增成功!" : "修改成功!"; + var _msg = model.SolderPasteID == 0 ? "新增成功!" : "修改成功!"; return RedirectToAction("Refresh", "Home", new { msg = _msg }); } else @@ -281,7 +279,7 @@ namespace AMESCoreStudio.Web.Controllers } } - if (model.SteelPlateID == 0) + if (model.SolderPasteID == 0) { return View("PCB014C", model); } diff --git a/AMESCoreStudio.Web/HttpApis/AMES/IPCB.cs b/AMESCoreStudio.Web/HttpApis/AMES/IPCB.cs index f14bc8ec..24a5c77e 100644 --- a/AMESCoreStudio.Web/HttpApis/AMES/IPCB.cs +++ b/AMESCoreStudio.Web/HttpApis/AMES/IPCB.cs @@ -516,42 +516,40 @@ namespace AMESCoreStudio.Web #region PCB014 錫膏使用管控 /// - /// 鋼板資料查詢 + /// 錫膏資料查詢 /// - /// 鋼板編號 - /// PCB板號 - /// 正背面 + /// 錫膏編號 /// 狀態 /// 頁數 /// 筆數 /// [WebApiClient.Attributes.HttpGet("api/SolderPasteInfo/SolderPasteInfoQuery")] - ITask> GetSolderPasteInfoQuery(string steelPlateNo = null, string pcbPartNo = null + ITask> GetSolderPasteInfoQuery(string solderPasteNo = null, string pcbPartNo = null , string side = null, string status = null, int page = 0, int limit = 10); /// - /// 新增鋼板資料 + /// 新增錫膏資料 /// /// [WebApiClient.Attributes.HttpPost("api/SolderPasteInfo")] ITask> PostSolderPasteInfo([FromBody, RawJsonContent] string model); /// - /// 更新鋼板資料 + /// 更新錫膏資料 /// /// [WebApiClient.Attributes.HttpPut("api/SolderPasteInfo")] ITask> PutSolderPasteInfo([FromBody, RawJsonContent] string model); /// - /// 查詢鋼板資料 ID + /// 查詢錫膏資料 ID /// /// [WebApiClient.Attributes.HttpGet("api/SolderPasteInfo/{id}")] ITask GetSolderPasteInfo(int id); /// - /// 查詢鋼板資料 By No + /// 查詢錫膏資料 By No /// /// [WebApiClient.Attributes.HttpGet("api/SolderPasteInfo/ByNo/{id}")] diff --git a/AMESCoreStudio.Web/Views/PCB/PCB014.cshtml b/AMESCoreStudio.Web/Views/PCB/PCB014.cshtml index e5994c44..2cfcc7b6 100644 --- a/AMESCoreStudio.Web/Views/PCB/PCB014.cshtml +++ b/AMESCoreStudio.Web/Views/PCB/PCB014.cshtml @@ -45,29 +45,9 @@
- +
- -
-
-
-
-
- -
- -
-
-
-
-
- -
- +
@@ -148,17 +128,20 @@ { field: 'receiptDate', title: '收貨日期', - sort: true + sort: true, + templet: '
{{ layui.util.toDateString(d.receiptDate, "yyyy/MM/dd") }}
' }, { field: 'manufactoringDate', title: '製造日期', - sort: true + sort: true, + templet: '
{{ layui.util.toDateString(d.manufactoringDate, "yyyy/MM/dd") }}
' }, { field: 'effectiveDate', title: '有效日期', - sort: true + sort: true, + templet: '
{{ layui.util.toDateString(d.effectiveDate, "yyyy/MM/dd") }}
' }, { field: 'statusName', @@ -176,8 +159,8 @@ ]]; //通过行tool编辑,lay-event="edit" function edit(obj) { - if (obj.data.steelPlateID) { - hg.open('修改錫膏基本資料', '/PCB/PCB014U?id=' + obj.data.steelPlateID, 700, 500); + if (obj.data.solderPasteID) { + hg.open('修改錫膏基本資料', '/PCB/PCB014U?id=' + obj.data.solderPasteID, 700, 500); } } diff --git a/AMESCoreStudio.Web/Views/PCB/PCB014C.cshtml b/AMESCoreStudio.Web/Views/PCB/PCB014C.cshtml index a0e582be..1fb81e40 100644 --- a/AMESCoreStudio.Web/Views/PCB/PCB014C.cshtml +++ b/AMESCoreStudio.Web/Views/PCB/PCB014C.cshtml @@ -1,7 +1,9 @@ @model AMESCoreStudio.WebApi.Models.AMES.SolderPasteInfo -@{ Layout = "~/Views/Shared/_AMESLayout.cshtml"; } +@{ + Layout = "~/Views/Shared/_AMESLayout.cshtml"; +}
-
-
-
-
- -
- -
- - -
+
+ +
+ +
+ +
+ +
+
-
- -
- - -
+
+ +
+ +
+
-
- -
- - -
+
+ +
+
+
-
- -
- - -
+
+ +
+
+
-
- -
- - -
+
+ +
+
+
-
- -
- - -
+
+ +
+ +
+
-
- -
- -
+
+ +
+
+
- @Html.ValidationMessage("error") -
-
- -
+ @Html.ValidationMessage("error") +
+
+
- -
+
+
@section Scripts { - @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); - await Html.RenderPartialAsync("_FileinputScriptsPartial"); } + @{ + await Html.RenderPartialAsync("_ValidationScriptsPartial"); + await Html.RenderPartialAsync("_FileinputScriptsPartial"); + } diff --git a/AMESCoreStudio.Web/Views/PCB/PCB014U.cshtml b/AMESCoreStudio.Web/Views/PCB/PCB014U.cshtml index fc256f3b..9ef47fdb 100644 --- a/AMESCoreStudio.Web/Views/PCB/PCB014U.cshtml +++ b/AMESCoreStudio.Web/Views/PCB/PCB014U.cshtml @@ -19,7 +19,7 @@
- +
@@ -87,9 +87,9 @@ await Html.RenderPartialAsync("_FileinputScriptsPartial"); } diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/SolderPasteInfoController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/SolderPasteInfoController.cs index cf8393e5..820c7846 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/SolderPasteInfoController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/SolderPasteInfoController.cs @@ -51,15 +51,12 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES /// 錫膏資料查詢 /// /// 錫膏編號 - /// PCB板號 - /// 正背面 /// 狀態 /// 頁數 /// 筆數 /// [HttpGet("SolderPasteInfoQuery")] - public async Task> GetSolderPasteInfo(string solderPasteNo, string pcbPartNo, string side - , string status, int page = 0, int limit = 10) + public async Task> GetSolderPasteInfo(string solderPasteNo , string status, int page = 0, int limit = 10) { var q = await _context.SolderPasteInfos.ToListAsync(); diff --git a/AMESCoreStudio.WebApi/Models/AMES/SolderPasteInfo.cs b/AMESCoreStudio.WebApi/Models/AMES/SolderPasteInfo.cs index d6d62dfd..5135d0f3 100644 --- a/AMESCoreStudio.WebApi/Models/AMES/SolderPasteInfo.cs +++ b/AMESCoreStudio.WebApi/Models/AMES/SolderPasteInfo.cs @@ -13,6 +13,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES /// 錫膏基本資料檔 /// [Table("SOLDER_PASTE_INFO", Schema = "JHAMES")] + [DataContract] public partial class SolderPasteInfo { /// @@ -48,7 +49,10 @@ namespace AMESCoreStudio.WebApi.Models.AMES /// [DataMember] [Display(Name = "收貨日期")] - [Column("RECEIPT_DATE", TypeName = "DATE")] + [Column("RECEIPT_DATE")] + [Required(ErrorMessage = "{0},不能空白")] + [DataType(DataType.Text), DisplayFormat(DataFormatString = "{0:yyyy/MM/dd}", ApplyFormatInEditMode = true)] + public DateTime ReceiptDate { get; set; } /// @@ -56,7 +60,9 @@ namespace AMESCoreStudio.WebApi.Models.AMES /// [DataMember] [Display(Name = "製造日期")] - [Column("MANUFACTORING_DATE", TypeName = "DATE")] + [Column("MANUFACTORING_DATE")] + [Required(ErrorMessage = "{0},不能空白")] + [DataType(DataType.Text), DisplayFormat(DataFormatString = "{0:yyyy/MM/dd}", ApplyFormatInEditMode = true)] public DateTime ManufactoringDate { get; set; } /// @@ -64,7 +70,9 @@ namespace AMESCoreStudio.WebApi.Models.AMES /// [DataMember] [Display(Name = "有效日期")] - [Column("EFFECTIVE_DATE", TypeName = "DATE")] + [Column("EFFECTIVE_DATE")] + [Required(ErrorMessage = "{0},不能空白")] + [DataType(DataType.Text), DisplayFormat(DataFormatString = "{0:yyyy/MM/dd}", ApplyFormatInEditMode = true)] public DateTime EffectiveDate { get; set; } ///