From 861fe71f0e0d26a2aa060f5ac25183847607eb65 Mon Sep 17 00:00:00 2001 From: ray Date: Sat, 25 Mar 2023 00:54:56 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E9=8B=BC=E6=9D=BF=E9=87=8F=E6=B8=AC?= =?UTF-8?q?=E7=B6=AD=E8=AD=B7=E8=AA=BF=E6=95=B4=202.=20=E8=A8=AD=E5=82=99?= =?UTF-8?q?=E5=9F=BA=E6=9C=AC=E6=95=B8=E6=93=9A=E7=B6=AD=E8=AD=B7=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=9C=89=E6=95=88=E6=9C=9F=E9=99=90=E6=AC=84=E4=BD=8D?= =?UTF-8?q?=203.=20=E8=A8=AD=E5=82=99=E8=A6=8F=E6=A0=BC=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=20=E6=8E=A1=E8=B3=BC=E7=B7=A8=E8=99=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/JIGController.cs | 8 +- .../Controllers/PCBController.cs | 29 +++- AMESCoreStudio.Web/Views/JIG/JIG002.cshtml | 10 +- AMESCoreStudio.Web/Views/JIG/JIG002C.cshtml | 6 +- AMESCoreStudio.Web/Views/JIG/JIG002U.cshtml | 4 + AMESCoreStudio.Web/Views/JIG/JIG004.cshtml | 12 +- AMESCoreStudio.Web/Views/JIG/JIG004C.cshtml | 23 ++- AMESCoreStudio.Web/Views/JIG/JIG004U.cshtml | 155 +++++++++--------- AMESCoreStudio.Web/Views/PCB/PCB013.cshtml | 4 +- AMESCoreStudio.Web/Views/PCB/PCB013A.cshtml | 2 +- AMESCoreStudio.Web/Views/PCB/PCB013V.cshtml | 13 +- .../AMES/OutfitVarityInfoesController.cs | 2 + AMESCoreStudio.WebApi/Enums/EnumPCB.cs | 13 +- .../Models/AMES/OutfitInfo.cs | 5 +- .../Models/AMES/OutfitVarityInfo.cs | 10 +- 15 files changed, 174 insertions(+), 122 deletions(-) diff --git a/AMESCoreStudio.Web/Controllers/JIGController.cs b/AMESCoreStudio.Web/Controllers/JIGController.cs index d93a38b4..de343e6a 100644 --- a/AMESCoreStudio.Web/Controllers/JIGController.cs +++ b/AMESCoreStudio.Web/Controllers/JIGController.cs @@ -437,13 +437,13 @@ namespace AMESCoreStudio.Web.Controllers return Json(new Table() { count = 0, data = null }); } - public async Task GetOutfitVarityInfoesByQueryAsync(int TypeFlag, int CommodityID, string Status) + public async Task GetOutfitVarityInfoesByQueryAsync(int TypeFlag, int CommodityID, string Status , int page = 0, int limit = 10) { var result = await _jigApi.GetOutfitVarityInfoesByQuery(TypeFlag, CommodityID, Status); if (result.Count > 0) { - return Json(new Table() { code = 0, msg = "", data = result, count = result.Count }); + return Json(new Table() { code = 0, msg = "", data = result.Skip((page - 1) * limit).Take(limit), count = result.Count }); } return Json(new Table() { count = 0, data = null }); @@ -869,7 +869,7 @@ namespace AMESCoreStudio.Web.Controllers return Json(new Table() { count = 0, data = null }); } - public async Task GetOutfitInfoesByQueryAsync(int TypeFlag, int CommodityID, int VarityID, string Status, string QANo, string PartNo, string UseStatus) + public async Task GetOutfitInfoesByQueryAsync(int TypeFlag, int CommodityID, int VarityID, string Status, string QANo, string PartNo, string UseStatus, int page = 0, int limit = 10) { @@ -882,7 +882,7 @@ namespace AMESCoreStudio.Web.Controllers if (result.Count > 0) { - return Json(new Table() { code = 0, msg = "", data = result, count = result.Count }); + return Json(new Table() { code = 0, msg = "", data = result.Skip((page - 1) * limit).Take(limit), count = result.Count }); } return Json(new Table() { count = 0, data = null }); diff --git a/AMESCoreStudio.Web/Controllers/PCBController.cs b/AMESCoreStudio.Web/Controllers/PCBController.cs index a84dbc0e..f0951a80 100644 --- a/AMESCoreStudio.Web/Controllers/PCBController.cs +++ b/AMESCoreStudio.Web/Controllers/PCBController.cs @@ -34,12 +34,14 @@ namespace AMESCoreStudio.Web.Controllers public readonly IPCB _pcbApi; private readonly IWebHostEnvironment _env; public readonly IPCS _pcsApi; - public PCBController(ILogger logger, IPCB pcbApi, IWebHostEnvironment env, IPCS pcsApi) + public readonly IBLL _bllApi; + public PCBController(ILogger logger, IPCB pcbApi, IWebHostEnvironment env, IPCS pcsApi, IBLL bllApi) { _logger = logger; _pcbApi = pcbApi; _env = env; _pcsApi = pcsApi; + _bllApi = bllApi; } //#region 下拉選單 @@ -158,8 +160,21 @@ namespace AMESCoreStudio.Web.Controllers { IResultModel result; + // 量測基準 35 小於通知寄信 + if (double.Parse(model.Tension1) < 35 || double.Parse(model.Tension2) < 35 || double.Parse(model.Tension3) < 35 || + double.Parse(model.Tension4) < 35 || double.Parse(model.Tension5) < 35) + { + model.MeasureResult = "F"; + //string Subject = $"FQC自動派送發信 FQC單號:{inhouseNo} 料號:{Material}"; + //string Body = $@"FQC單號:{inhouseNo} 料號:{Material}
+ // 檢驗結果為:{Result}"; - model.MeasureResult = "P"; + //await _bllApi.PostToMail(Subject, Body, string.Join(',', MailGroup), "", false, path); + } + else + { + model.MeasureResult = "P"; + } model.CreateUserID = GetLogInUserID(); model.CreateDate = DateTime.Now; model.UpdateUserID = GetLogInUserID(); @@ -249,9 +264,15 @@ namespace AMESCoreStudio.Web.Controllers [HttpPost] public async Task PCB014Async(SolderPasteInfo model) { - if (ModelState.IsValid) + // 日期判斷 + if (model.EffectiveDate < model.ManufactoringDate) + { + ModelState.AddModelError("error", "有效日期不能小於製造日期"); + } + else if (ModelState.IsValid) { IResultModel result; + if (model.SolderPasteID == 0) { model.CreateUserID = GetLogInUserID(); @@ -274,11 +295,11 @@ namespace AMESCoreStudio.Web.Controllers } else { - ModelState.AddModelError("error", result.Msg); } } + if (model.SolderPasteID == 0) { return View("PCB014C", model); diff --git a/AMESCoreStudio.Web/Views/JIG/JIG002.cshtml b/AMESCoreStudio.Web/Views/JIG/JIG002.cshtml index 26dfcc10..adb60234 100644 --- a/AMESCoreStudio.Web/Views/JIG/JIG002.cshtml +++ b/AMESCoreStudio.Web/Views/JIG/JIG002.cshtml @@ -105,7 +105,7 @@ //通过行tool编辑,lay-event="edit" function edit(obj) { if (obj.data.varityID) { - hg.open('修改設備規格', '/JIG/JIG002U/' + obj.data.varityID, 640,320); + hg.open('修改設備規格', '/JIG/JIG002U/' + obj.data.varityID, 640,550); } } @@ -117,7 +117,7 @@ else status = "啟用"; if (obj.data.varityID) { - hg.confirm("設備規格:" + obj.data.varityName + ",确定要" + status +"吗?", function () { + hg.confirm("設備規格:" + obj.data.varityName + ",確定要" + status +"嗎?", function () { $.ajax({ url: '/JIG/JIG002D', data: { id: obj.data.varityID }, @@ -143,7 +143,7 @@ layuiicon: '', class: 'layui-btn-normal', handler: function () { - hg.open('新增設備規格', '/JIG/JIG002C', 640, 320); + hg.open('新增設備規格', '/JIG/JIG002C', 640, 550); // hg.open('修改設備規格', '/JIG/JIG002R', 640, 320); } @@ -153,7 +153,7 @@ ////搜索 $('#querysubmit').click(function () { - hg.msghide("刷新数据!"); + hg.msghide("刷新查詢!"); tt(); }); @@ -224,7 +224,7 @@ //var itemNo = $("#itemNo").val(); //var itemNo = $("#itemNo").val(); //if (itemNo) { - hg.msghide("刷新数据!"); + hg.msghide("刷新查詢!"); tt(); //} //else { diff --git a/AMESCoreStudio.Web/Views/JIG/JIG002C.cshtml b/AMESCoreStudio.Web/Views/JIG/JIG002C.cshtml index 6f4b5734..e7430dc8 100644 --- a/AMESCoreStudio.Web/Views/JIG/JIG002C.cshtml +++ b/AMESCoreStudio.Web/Views/JIG/JIG002C.cshtml @@ -39,6 +39,10 @@ +
+ + +
@@ -62,7 +66,7 @@
*@ - +
@Html.ValidationMessage("error") diff --git a/AMESCoreStudio.Web/Views/JIG/JIG002U.cshtml b/AMESCoreStudio.Web/Views/JIG/JIG002U.cshtml index d09b1a16..bd005eb3 100644 --- a/AMESCoreStudio.Web/Views/JIG/JIG002U.cshtml +++ b/AMESCoreStudio.Web/Views/JIG/JIG002U.cshtml @@ -39,6 +39,10 @@
+
+ + +
diff --git a/AMESCoreStudio.Web/Views/JIG/JIG004.cshtml b/AMESCoreStudio.Web/Views/JIG/JIG004.cshtml index 420c6bfb..6d5a4c4e 100644 --- a/AMESCoreStudio.Web/Views/JIG/JIG004.cshtml +++ b/AMESCoreStudio.Web/Views/JIG/JIG004.cshtml @@ -151,7 +151,7 @@ //通过行tool编辑,lay-event="edit" function edit(obj) { if (obj.data.outfitID) { - hg.open('修改設備基本資料', '/JIG/JIG004U/' + obj.data.outfitID, 640,320); + hg.open('修改設備基本資料', '/JIG/JIG004U/' + obj.data.outfitID, 640,550); } } @@ -166,8 +166,8 @@ if (obj.data.outfitID) { - hg.confirm("設備:" + obj.data.outfitNo + ",确定要" + status + "吗?", function () { - hg.open('停用啟用基本設備', '/JIG/JIG004D/' + obj.data.outfitID, 640, 320); + hg.confirm("設備:" + obj.data.outfitNo + ",確定要" + status + "嗎?", function () { + hg.open('停用啟用基本設備', '/JIG/JIG004D/' + obj.data.outfitID, 640, 550); // $.ajax({ // url: '/JIG/JIG004D', // data: { id: obj.data.outfitID }, @@ -193,7 +193,7 @@ layuiicon: '', class: 'layui-btn-normal', handler: function () { - hg.open('新增設備基本資料', '/JIG/JIG004C', 640, 320); + hg.open('新增設備基本資料', '/JIG/JIG004C', 640, 550); } } @@ -202,7 +202,7 @@ ////搜索 $('#querysubmit').click(function () { - hg.msghide("刷新数据!"); + hg.msghide("刷新查詢!"); tt(); }); @@ -290,7 +290,7 @@ }; ////搜索 $('#querysubmit').click(function () { - hg.msghide("刷新数据!"); + hg.msghide("刷新查詢!"); tt(); }); diff --git a/AMESCoreStudio.Web/Views/JIG/JIG004C.cshtml b/AMESCoreStudio.Web/Views/JIG/JIG004C.cshtml index 377c2b9b..49c0d656 100644 --- a/AMESCoreStudio.Web/Views/JIG/JIG004C.cshtml +++ b/AMESCoreStudio.Web/Views/JIG/JIG004C.cshtml @@ -86,6 +86,11 @@
+
+ + + +
@@ -112,15 +117,15 @@
@*
- - - -
-
- - - -
*@ + + + +
+
+ + + +
*@
diff --git a/AMESCoreStudio.Web/Views/JIG/JIG004U.cshtml b/AMESCoreStudio.Web/Views/JIG/JIG004U.cshtml index 9e0eb32e..491d46d0 100644 --- a/AMESCoreStudio.Web/Views/JIG/JIG004U.cshtml +++ b/AMESCoreStudio.Web/Views/JIG/JIG004U.cshtml @@ -72,83 +72,88 @@ @* yiru 2022-10-11 *@
-
- - - -
-
- - - -
-
- - - -
-
- - - -
-
- - - -
-
- - - -
-
- - - +
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+ @*
+ + +
- - - -
- @*
- - - -
-
- - - -
*@ -
- - - -
-
- - - -
-
- - - -
- @Html.ValidationMessage("error") -
- -
- - + + + +
*@ +
+ + + +
+
+ + + +
+
+ + + +
+ @Html.ValidationMessage("error") +
+ +
+ + diff --git a/AMESCoreStudio.Web/Views/PCB/PCB013.cshtml b/AMESCoreStudio.Web/Views/PCB/PCB013.cshtml index 47ec39fd..381c8238 100644 --- a/AMESCoreStudio.Web/Views/PCB/PCB013.cshtml +++ b/AMESCoreStudio.Web/Views/PCB/PCB013.cshtml @@ -210,13 +210,13 @@ function detail(obj) { if (obj.data.steelPlateID) { - hg.open('新增量測記錄', '/PCB/PCB013A?steelPlateID=' + obj.data.steelPlateID + '&steelPlateNo=' + obj.data.steelPlateNo, 700, 500); + hg.open('新增量測記錄', '/PCB/PCB013A?steelPlateID=' + obj.data.steelPlateID + '&steelPlateNo=' + obj.data.steelPlateNo, 700, 550); } } function View(obj) { if (obj.data.steelPlateID) { - hg.open('檢視量測記錄', '/PCB/PCB013V?steelPlateID=' + obj.data.steelPlateID + '&steelPlateNo=' + obj.data.steelPlateNo, 1000, 500); + hg.open('檢視量測記錄', '/PCB/PCB013V?steelPlateID=' + obj.data.steelPlateID + '&steelPlateNo=' + obj.data.steelPlateNo, 1000, 550); } } diff --git a/AMESCoreStudio.Web/Views/PCB/PCB013A.cshtml b/AMESCoreStudio.Web/Views/PCB/PCB013A.cshtml index 9a546321..8f9ab42d 100644 --- a/AMESCoreStudio.Web/Views/PCB/PCB013A.cshtml +++ b/AMESCoreStudio.Web/Views/PCB/PCB013A.cshtml @@ -17,7 +17,7 @@
- +
diff --git a/AMESCoreStudio.Web/Views/PCB/PCB013V.cshtml b/AMESCoreStudio.Web/Views/PCB/PCB013V.cshtml index 031a9440..efbd6533 100644 --- a/AMESCoreStudio.Web/Views/PCB/PCB013V.cshtml +++ b/AMESCoreStudio.Web/Views/PCB/PCB013V.cshtml @@ -21,12 +21,18 @@ { field: 'status', title: '量測狀態', - sort: true }, { field: 'measureResult', title: '結果', - sort: true + templet: function (d) { + var btn; + if (d.measureResult == "P") + btn = 'OK'; + else + btn = 'NG'; + return btn; + } }, { field: 'tension1', @@ -56,7 +62,6 @@ { field: 'remark', title: '備註', - sort: true }, { field: 'createUserName', @@ -75,4 +80,6 @@ //基本数据表格 var table = hg.table.datatable('test', '鋼板量測紀錄', '/PCB/PCB013VQuery?steelPlateID=' + steelPlateID.value + '&steelPlateNo=' + steelPlateNo.value, {}, tableCols, toolbar, true, 'full-100', ['filter', 'print', 'exports']); + + } \ No newline at end of file diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/OutfitVarityInfoesController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/OutfitVarityInfoesController.cs index 424c670f..5e20f575 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/OutfitVarityInfoesController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/OutfitVarityInfoesController.cs @@ -70,6 +70,8 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES if (Status != "*") q = q.Where(p => p.Status.Equals(Status)); + + var OutfitVarityInfo = await q.ToListAsync(); if (OutfitVarityInfo == null) diff --git a/AMESCoreStudio.WebApi/Enums/EnumPCB.cs b/AMESCoreStudio.WebApi/Enums/EnumPCB.cs index 8139c80a..e88774ab 100644 --- a/AMESCoreStudio.WebApi/Enums/EnumPCB.cs +++ b/AMESCoreStudio.WebApi/Enums/EnumPCB.cs @@ -19,22 +19,17 @@ namespace AMESCoreStudio.WebApi.Enum public enum EnumSteelPlateStatus { /// - /// 上線前 + /// 拿取 /// - [Display(Name = "上線前")] + [Display(Name = "拿取")] A = 1, /// - /// 清洗後 + /// 歸還 /// - [Display(Name = "清洗後")] + [Display(Name = "歸還")] B = 2, - /// - /// 每周點檢 - /// - [Display(Name = "每周點檢")] - C = 3 } /// diff --git a/AMESCoreStudio.WebApi/Models/AMES/OutfitInfo.cs b/AMESCoreStudio.WebApi/Models/AMES/OutfitInfo.cs index befeac89..6b08f868 100644 --- a/AMESCoreStudio.WebApi/Models/AMES/OutfitInfo.cs +++ b/AMESCoreStudio.WebApi/Models/AMES/OutfitInfo.cs @@ -191,11 +191,11 @@ namespace AMESCoreStudio.WebApi.Models.AMES public int? UnitPrice { get; set; } = 0; /// - /// 質保日期 + /// 有效日期 /// [Column("QUALITY_DATE")] [DataMember] - [Display(Name = "質保日期")] + [Display(Name = "有效日期")] public DateTime? QualityDate { get; set; } /// @@ -394,5 +394,6 @@ namespace AMESCoreStudio.WebApi.Models.AMES [Display(Name = "變更狀態備註(啟用/停用)")] public string UseStatusRemark { get; set; } + } } diff --git a/AMESCoreStudio.WebApi/Models/AMES/OutfitVarityInfo.cs b/AMESCoreStudio.WebApi/Models/AMES/OutfitVarityInfo.cs index 0a1ab5f2..08324d77 100644 --- a/AMESCoreStudio.WebApi/Models/AMES/OutfitVarityInfo.cs +++ b/AMESCoreStudio.WebApi/Models/AMES/OutfitVarityInfo.cs @@ -89,7 +89,15 @@ namespace AMESCoreStudio.WebApi.Models.AMES [Required] [Display(Name = "預警提前次數")] public int AlertForeDays { get; set; } = 0; - + + /// + /// 採購編號 + /// + [Column("PURCHASE_NO")] + [DataMember] + [Display(Name = "採購編號")] + public string PurchaseNo { get; set; } + /// /// 創建者ID