diff --git a/AMESCoreStudio.Web/Controllers/PCSController.cs b/AMESCoreStudio.Web/Controllers/PCSController.cs index b9a30ca9..a44b4f43 100644 --- a/AMESCoreStudio.Web/Controllers/PCSController.cs +++ b/AMESCoreStudio.Web/Controllers/PCSController.cs @@ -1413,7 +1413,7 @@ namespace AMESCoreStudio.Web.Controllers /// 預計開工日 /// RuleStation [HttpPost] - public async Task GetBarcodeOther(string itemNo, string lotNo, int num, string wipNo , string wipShcDate) + public async Task GetBarcodeOther(string itemNo, string lotNo, int num, string wipNo, string wipShcDate) { var result = await _pcsApi.GetSerialRuleByQurey(itemNo, lotNo.Trim().ToUpper(), num, wipShcDate); string StartNO = ""; @@ -2668,7 +2668,7 @@ namespace AMESCoreStudio.Web.Controllers if (!string.IsNullOrWhiteSpace(Msg)) { if (Msg.StartsWith(",")) - Msg = Msg.Substring(1, Msg.Length-1); + Msg = Msg.Substring(1, Msg.Length - 1); ModelState.AddModelError("error", Msg); return View("PCS003", model); @@ -3908,11 +3908,12 @@ namespace AMESCoreStudio.Web.Controllers , wipno: wipNo , itemno: itemNo , page: page - , limit: limit); + , limit: limit + , statusNo: "N"); if (result.Data != null) { - return Json(new Table() { code = 0, msg = "", data = result.Data.Where(w => w.statusNo != 'C' && w.statusNo != 'E'), count = result.DataTotal }); + return Json(new Table() { code = 0, msg = "", data = result.Data, count = result.DataTotal }); } return Json(new Table() { count = 0, data = null }); } @@ -4222,7 +4223,7 @@ namespace AMESCoreStudio.Web.Controllers /// 料號 /// 廠別 /// - public async Task PCS005QueryAsync(string unitNo, string wipNo, string itemNo, string factoryNo, int page = 0, int limit = 10) + public async Task PCS005QueryAsync(string unitNo, string wipNo, string itemNo, string factoryNo, string statusNo, int page = 0, int limit = 10) { string[] param = Request.Path.ToString().Replace("/PCS/PCS005Query/", "").Split('_'); if (param[0] != null && param[0] != "") @@ -4251,7 +4252,8 @@ namespace AMESCoreStudio.Web.Controllers , itemno: itemNo , factoryno: factoryNo , page: page - , limit: limit); + , limit: limit + , statusNo: statusNo); if (result.Data != null) { diff --git a/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs b/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs index 851e31e2..a2b95aeb 100644 --- a/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs +++ b/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs @@ -90,7 +90,7 @@ namespace AMESCoreStudio.Web [WebApiClient.Attributes.HttpGet("api/WipInfos/GetWipInfoSelectParameter")] //ITask> GetWipInfoSelectParameter(string unitno = null, string wipno = null); ITask> GetWipInfoSelectParameter(string unitno = null, string wipno = null, int lineid = 0 - , string itemno = null, DateTime? date_str = null, DateTime? date_end = null, string wipType = null, string factoryno = null, int page = 0, int limit = 10); + , string itemno = null, DateTime? date_str = null, DateTime? date_end = null, string wipType = null, string factoryno = null, int page = 0, int limit = 10 , string statusNo = null); /// /// 查詢工單基本資料+是否已過站 diff --git a/AMESCoreStudio.Web/Views/PCS/PCS002.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS002.cshtml index e92e7ac5..047377c5 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS002.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS002.cshtml @@ -24,7 +24,7 @@
-
+
@@ -32,7 +32,7 @@
-
+
@@ -40,7 +40,7 @@
-
+
@@ -48,10 +48,6 @@
-
-
-
-
@@ -142,12 +138,12 @@ templet: '
{{ layui.util.toDateString(d.wipDueDate, "yyyy/MM/dd") }}
' }, { - field: 'a', + field: 'fqcDate', title: '檢驗完成日' }, { field: 'right', - width: 200, + width: 150, title: '操作', fixed: 'right', templet: function (d) { diff --git a/AMESCoreStudio.Web/Views/PCS/PCS005.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS005.cshtml index df160942..a45dc450 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS005.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS005.cshtml @@ -6,11 +6,11 @@ @inject IHtmlLocalizer sharedLocalizer
@@ -26,15 +26,15 @@
- -
+ +
- +
@@ -42,8 +42,8 @@
- -
+ +
@@ -52,12 +52,24 @@
-
+
+ +
+ +
+
+
+
@@ -80,6 +92,15 @@ //table && table.reload(); }); + form.on('select(statusNo)', function (data) { + //roleName = data.elem[data.elem.selectedIndex].text; + var qs = $('button[lay-filter="querysubmit"]'); + qs.click(); + + //hg.msghide("刷新数据!"); + //table && table.reload(); + }); + var table = layui.table; table.on('tool(query)', function (obj) { @@ -89,6 +110,8 @@ } } }); + + }); //监听表单提交事件 @@ -152,7 +175,12 @@ templet: '
{{ layui.util.toDateString(d.wipDueDate, "yyyy/MM/dd") }}
' }, { - field: 'a', + field: 'statusNo', + title: '工單狀態', + templet: '#statusNoName' + }, + { + field: 'fqcDate', title: '檢驗完成日' }, { @@ -162,10 +190,6 @@ fixed: 'right', templet: function (d) { return '檢視' - - //return '修改\ - // 檢視\ - // 删除' } } ] @@ -175,7 +199,7 @@ //通过行tool檢視,lay-event="detail" function detail(obj) { if (obj.data.wipID) { - hg.open('檢視工單資料', '/PCS/PCS001R/' + obj.data.wipID,'', '',true); + hg.open('檢視工單資料', '/PCS/PCS001R/' + obj.data.wipID, '', '', true); } } @@ -244,4 +268,13 @@ table._tableTrCurrr.find('[lay-event="' + elem.attr('lay-event') + '"]').children("i").first().click(); }); + } \ No newline at end of file diff --git a/AMESCoreStudio.Web/Views/PCS/PCS012.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS012.cshtml index 411bcc4d..a76af2a9 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS012.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS012.cshtml @@ -63,7 +63,7 @@
-
+
@@ -73,7 +73,7 @@
-
+
@@ -87,7 +87,7 @@
-
+
@@ -95,7 +95,7 @@
-
+
@@ -103,11 +103,11 @@
-
+
-
+
diff --git a/AMESCoreStudio.Web/Views/PCS/PCS015.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS015.cshtml index 1ae724c6..7dbd16c2 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS015.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS015.cshtml @@ -38,7 +38,7 @@
-
+
@@ -47,7 +47,7 @@
-
+
@@ -55,7 +55,7 @@
-
+
@@ -67,10 +67,10 @@
-
+
-
+
-
-
-
-
@@ -151,7 +147,7 @@ templet: '
{{ layui.util.toDateString(d.wipDueDate, "yyyy/MM/dd") }}
' }, { - field: 'a', + field: 'fqcDate', title: '檢驗完成日' }, { diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/BarcodeLockController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/BarcodeLockController.cs index 956ca720..2b9ca2ec 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/BarcodeLockController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/BarcodeLockController.cs @@ -81,19 +81,42 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES public async Task> GetBarcodeLockQuery(string barCodeNo, string wipNo, string lockStatus , string itemNo, string date_Str = null, string date_End = null, int page = 0, int limit = 10) { - IQueryable q = _context.BarcodeLocks; + IQueryable q = from s in _context.BarcodeLocks + join q2 in _context.UserInfoes on s.LockUserID equals q2.UserID into cp2 + from q2 in cp2.DefaultIfEmpty() + join q3 in _context.UserInfoes on s.UnLockUserID equals q3.UserID into cp3 + from q3 in cp3.DefaultIfEmpty() + select new BarcodeLockDto + { + BarCodeLockID = s.BarcodeLockID, + BarCodeNo = s.GetBarcodeInfo.BarcodeNo, + WipNO = s.GetBarcodeInfo.GetWipInfo.WipNO, + ItemNO = s.GetBarcodeInfo.GetWipInfo.GetWipAtt.ItemNO, + LockDate = s.LockDate, + UnLockDate = s.UnLockDate, + LockUserID = s.LockUserID, + LockUserName = q2.UserName, + LockReason = s.LockReason, + LockStatus = s.LockStatus == 0 ? "鎖定" : "解鎖", + UnLockUserID = s.UnLockUserID, + UnLockUserName = q3.UserName, + UnLockReason = s.UnLockReason + }; + if (!string.IsNullOrWhiteSpace(barCodeNo)) - q = q.Where(w => w.GetBarcodeInfo.BarcodeNo == barCodeNo); + q = q.Where(w => w.BarCodeNo == barCodeNo); if (!string.IsNullOrWhiteSpace(wipNo)) - q = q.Where(w => w.GetBarcodeInfo.GetWipInfo.WipNO == wipNo); + q = q.Where(w => w.WipNO == wipNo); if (!string.IsNullOrWhiteSpace(lockStatus)) - q = q.Where(w => w.LockStatus == int.Parse(lockStatus)); - + { + var LockStatusName = lockStatus == "0" ? "鎖定" : "解鎖"; + q = q.Where(w => w.LockStatus == LockStatusName); + } if (!string.IsNullOrWhiteSpace(itemNo)) - q = q.Where(w => w.GetBarcodeInfo.GetWipInfo.GetWipAtt.ItemNO == itemNo); + q = q.Where(w => w.ItemNO == itemNo); if (DateTime.TryParse(date_Str, out _)) { @@ -116,21 +139,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES q = q.Skip((page - 1) * limit).Take(limit); } - result.Data = await q.Select(s => new BarcodeLockDto - { - BarCodeLockID = s.BarcodeLockID, - BarCodeNo = s.GetBarcodeInfo.BarcodeNo, - WipNO = s.GetBarcodeInfo.GetWipInfo.WipNO, - ItemNO = s.GetBarcodeInfo.GetWipInfo.GetWipAtt.ItemNO, - LockDate = s.LockDate, - UnLockDate = s.UnLockDate, - LockUserID = s.LockUserID, - LockReason = s.LockReason, - LockStatus = s.LockStatus == 0 ? "鎖定" : "解鎖", - UnLockUserID = s.UnLockUserID, - UnLockReason = s.UnLockReason - }).ToListAsync(); - + result.Data = await q.ToListAsync(); return result; } @@ -159,7 +168,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES return result; } - + [HttpPost] public async Task> PostBarcodeLock(BarcodeLock barcodeLock) { diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/WipInfosController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/WipInfosController.cs index 2d079be6..fb021b0e 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/WipInfosController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/WipInfosController.cs @@ -913,6 +913,15 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES { q = q.Where(w => w.factoryNo == value.factoryno); } + + if (!string.IsNullOrWhiteSpace(value.statusNo)) + { + if (value.statusNo == "N") + q = q.Where(w => w.statusNo != "E" && w.statusNo != "C"); + else + q = q.Where(w => w.statusNo == value.statusNo); + } + q.Take(1000); // 紀錄筆數 result.DataTotal = q.Count(); @@ -934,6 +943,15 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES item.workDate = workDate == null ? "" : workDate.CreateDate.ToString("yyyy/MM/dd"); } + // 塞檢驗完成日期 + foreach (var item in qq) + { + var fqcDate = _context.FqcResultMasters.Where(w => w.WipNo == item.wipNo) + .OrderBy(s => s.EndTime) + .FirstOrDefault(); + item.fqcDate = fqcDate == null ? "" : fqcDate.EndTime.ToString("yyyy/MM/dd"); + } + result.Data = qq; if (result == null) diff --git a/AMESCoreStudio.WebApi/DTO/AMES/BarcodeLockDto.cs b/AMESCoreStudio.WebApi/DTO/AMES/BarcodeLockDto.cs index 48170bd3..5bb34e74 100644 --- a/AMESCoreStudio.WebApi/DTO/AMES/BarcodeLockDto.cs +++ b/AMESCoreStudio.WebApi/DTO/AMES/BarcodeLockDto.cs @@ -46,11 +46,15 @@ namespace AMESCoreStudio.WebApi.DTO.AMES ///
public string UnLockReason { get; set; } + /// + /// 鎖定人員ID + /// + public int LockUserID { get; set; } /// - /// 鎖定人員 + /// 鎖定人員名稱 /// - public decimal LockUserID { get; set; } + public string LockUserName { get; set; } /// /// 鎖定日期 @@ -60,7 +64,12 @@ namespace AMESCoreStudio.WebApi.DTO.AMES /// /// 解鎖人員 /// - public decimal? UnLockUserID { get; set; } + public int? UnLockUserID { get; set; } + + /// + /// 解鎖人員名稱 + /// + public string UnLockUserName { get; set; } /// /// 解鎖日期 diff --git a/AMESCoreStudio.WebApi/DTO/AMES/WipInfoDto.cs b/AMESCoreStudio.WebApi/DTO/AMES/WipInfoDto.cs index 658df04a..1f721c7e 100644 --- a/AMESCoreStudio.WebApi/DTO/AMES/WipInfoDto.cs +++ b/AMESCoreStudio.WebApi/DTO/AMES/WipInfoDto.cs @@ -49,5 +49,10 @@ namespace AMESCoreStudio.WebApi.DTO.AMES /// 工單廠別 /// public string factoryno { get; set; } + + /// + /// 工單狀態 + /// + public string statusNo { get; set; } } }