From 2561a63220932117a768bf1ef532148839669184 Mon Sep 17 00:00:00 2001 From: ray Date: Sun, 27 Mar 2022 01:25:13 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BF=AE=E6=AD=A3=E5=B7=A5=E5=96=AE?= =?UTF-8?q?=E5=9F=BA=E6=9C=AC=E8=B3=87=E6=96=99=20=E5=B7=A5=E7=A8=8B?= =?UTF-8?q?=E7=B6=AD=E8=AD=B7=E4=BA=BA=E5=93=A1=20=E5=82=99=E8=A8=BB=202.?= =?UTF-8?q?=20=E4=BE=9B=E5=96=AE=E9=96=8B=E6=94=B6=E7=B7=9A=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E9=A1=AF=E7=A4=BA=E7=82=BA=E4=B8=AD=E6=96=87=203.=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=8E=96=E5=AE=9A=E6=A2=9D=E7=A2=BC=E6=9F=A5?= =?UTF-8?q?=E8=A9=A2=20=E6=AC=84=E4=BD=8D=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/PCSController.cs | 16 + .../Controllers/SYSController.cs | 17 + AMESCoreStudio.Web/HttpApis/ISYS.cs | 10 +- AMESCoreStudio.Web/Views/PCS/PCS001.cshtml | 544 +++++++++--------- AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml | 516 ++++++++--------- AMESCoreStudio.Web/Views/PCS/PCS003.cshtml | 43 +- AMESCoreStudio.Web/Views/PCS/PCS006.cshtml | 4 +- AMESCoreStudio.Web/Views/PCS/PCS015.cshtml | 2 +- .../Controllers/AMES/WipBoardController.cs | 1 + .../Controllers/AMES/WipSystemController.cs | 1 + .../Controllers/SYS/UserInfoesController.cs | 14 + AMESCoreStudio.WebApi/Models/AMES/WipBoard.cs | 3 +- .../Models/AMES/WipSystem.cs | 3 +- 13 files changed, 635 insertions(+), 539 deletions(-) diff --git a/AMESCoreStudio.Web/Controllers/PCSController.cs b/AMESCoreStudio.Web/Controllers/PCSController.cs index 4b2427bb..8c0bffa8 100644 --- a/AMESCoreStudio.Web/Controllers/PCSController.cs +++ b/AMESCoreStudio.Web/Controllers/PCSController.cs @@ -1527,8 +1527,16 @@ namespace AMESCoreStudio.Web.Controllers model.materialSops = q1.Data; model.wipBoard = await _pcsApi.GetWipBoard(model.wipInfo.WipNO); + if (model.wipBoard != null) + { + model.wipBoard.Engineer_Name = _sysApi.GetUserInfoByUserNo(model.wipBoard.Engineer).InvokeAsync().Result.UserName; + } model.wipSystem = await _pcsApi.GetWipSystem(model.wipInfo.WipNO); + if (model.wipSystem != null) + { + model.wipSystem.Engineer_Name = _sysApi.GetUserInfoByUserNo(model.wipSystem.Engineer).InvokeAsync().Result.UserName; + } model.wipMAC = await _pcsApi.GetWipMAC(model.wipInfo.WipNO); @@ -1597,8 +1605,16 @@ namespace AMESCoreStudio.Web.Controllers //var q1 = await _pcsApi.GetMaterialSopQuery(itemNo: model.wipAtt.ItemNO); //model.materialSops = q1.Data; model.wipBoard = await _pcsApi.GetWipBoard(model.wipInfo.WipNO); + if (model.wipBoard != null) + { + model.wipBoard.Engineer_Name = _sysApi.GetUserInfoByUserNo(model.wipBoard.Engineer).InvokeAsync().Result.UserName; + } model.wipSystem = await _pcsApi.GetWipSystem(model.wipInfo.WipNO); + if (model.wipSystem != null) + { + model.wipSystem.Engineer_Name = _sysApi.GetUserInfoByUserNo(model.wipSystem.Engineer).InvokeAsync().Result.UserName; + } model.wipMAC = await _pcsApi.GetWipMAC(model.wipInfo.WipNO); diff --git a/AMESCoreStudio.Web/Controllers/SYSController.cs b/AMESCoreStudio.Web/Controllers/SYSController.cs index c59ca1f1..0b9d7a36 100644 --- a/AMESCoreStudio.Web/Controllers/SYSController.cs +++ b/AMESCoreStudio.Web/Controllers/SYSController.cs @@ -133,6 +133,23 @@ namespace AMESCoreStudio.Web.Controllers return Json(new { data = item }); } + /// + /// 回傳UserName + /// + /// UserNo + /// + [HttpPost] + public async Task getUserName(string userNo) + { + var result = await _sysApi.GetUserInfoByUserNo(userNo); + //将数据Json化并传到前台视图 + if (result == null) + return Json(new { data = "" }); + else + + return Json(new { data = result.UserName }); + } + #region SYS001系统资料维护相关 public IActionResult SYS001() diff --git a/AMESCoreStudio.Web/HttpApis/ISYS.cs b/AMESCoreStudio.Web/HttpApis/ISYS.cs index cd5d50bb..1200b578 100644 --- a/AMESCoreStudio.Web/HttpApis/ISYS.cs +++ b/AMESCoreStudio.Web/HttpApis/ISYS.cs @@ -9,7 +9,7 @@ using AMESCoreStudio.CommonTools.Result; namespace AMESCoreStudio.Web { [JsonReturn] - public interface ISYS:IHttpApi + public interface ISYS : IHttpApi { #region SYS001系統資料維護相關 @@ -349,6 +349,14 @@ namespace AMESCoreStudio.Web [WebApiClient.Attributes.HttpGet("api/UserInfoes")] ITask> GetUserInfoes(int page = 0, int limit = 10); + /// + /// 用UserNo 查詢 + /// + /// UserNo + /// + [WebApiClient.Attributes.HttpGet("api/UserInfoes/ByUserNo/{id}")] + ITask GetUserInfoByUserNo(string id); + #endregion #region SYS009用户角色資料維護相關 diff --git a/AMESCoreStudio.Web/Views/PCS/PCS001.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS001.cshtml index 54dfce20..197c0382 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS001.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS001.cshtml @@ -296,351 +296,346 @@ @* 板卡-工程資訊sheet *@ -
-
-
- -
- - -
+
+
+
+ +
+ +
- -
- - -
+ +
+
+
-
-
- -
- -
+
+
+ +
+
+
-
-
- -
- -
- - +
+
+ +
+
+ +
+
-
-
- -
- -
-
- -
- -
+
+
+ +
+ +
+
+ +
+
-
+
+
-
-
- -
- -
+
+
+ +
+
-
- -
- - -
+
+
+ +
+ +
+
-
-
- -
- -
+
+
+ +
+
-
- -
- -
+
+
+ +
+
+
-
-
- -
- -
+
+
+ +
+
+
-
-
-
- -
- - -
+
+
+
+ +
+ +
-
- -
- - -
+
+
+ +
+ +
-
- -
- - -
+
+
+ +
+ +
+
-
-
- -
- - -
- -
- - -
+
+
+ +
+ + +
+ +
+ +
+
@* 系統-工程資訊sheet *@ -
-
-
- -
- - -
+
+
+
+ +
+ +
- -
- - -
+ +
+
+
- -
-
- -
- -
-
- -
+
+
+ +
+ +
+
+
+
-
- -
- -
+
+ +
+
+
-
-
-
- -
- -
-
-
- -
- -
+
+
+
+ +
+
-
- -
- -
+
+
+ +
+
- -
- +
+
+ +
+
+ +
+ +
+
-
-
- -
- -
-
- -
-
- -
- -
- -
- -
- -
+
+
+ +
+ +
+
+ +
+
+ +
+ +
+ +
+ +
+
+
-
-
- -
- -
-
- -
-
- -
+
+
+ +
+ +
+
+ +
+
+
+
-
-
- -
- -
-
- -
-
- -
+
+
+ +
+ +
+
+ +
+
+
+
-
-
- -
- -
-
- -
-
- -
+
+
+ +
+ +
+
+ +
+
+
+
-
-
- -
- -
-
- -
-
- -
+
+
+ +
+ +
+
+ +
+
+
+
-
-
- -
- -
-
- -
-
- -
+
+
+ +
+ +
+
+ +
+
+
+
-
-
- -
- -
- -
- -
+
+
+ +
+ +
+ +
+
+
-
-
- -
- -
+
+
+ +
+
+
-
-
- -
- -
+
+
+ +
+
+
-
-
- -
- -
+
+
+ +
+
+
-
- -
- -
+
+ +
+
+
@* 治具組合sheet *@
@@ -736,6 +731,10 @@ $("#board").show(); } + if ($('#wipAtt_ItemNO').val() != "" && $('#wipInfo_PlanQTY').val() != "") { + $("#GetMAC").hide(); + } + var error = '@Html.ValidationMessage("error")'; if ($(error).text() != '') { parent.hg.msg(error); @@ -1156,6 +1155,25 @@ ''; $('#OutfitTable').append(contactdiv); }); - } + } + + //UserName + function getUserName(val) { + $.ajax( + { + url: "@Url.Action("getUserName", "SYS")", + dataType: 'json', + data: { "userNo": val.value}, + type: 'post', + success: function (result) + { + $(val).closest('div.layui-inline').find('input[id*=' + val.id + '_Name]').val(result.data); + }, + error: function (result) + { + alert(result); + } + }); + }; } diff --git a/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml index e2fea220..8d63be60 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml @@ -437,297 +437,299 @@
@* 板卡-工程資訊sheet *@ -
-
- -
- -
+
+
+
+ +
+ +
- -
- + +
+ +
+
-
-
-
- -
- +
+
+ +
+ +
-
-
-
- -
- +
+
+ +
+ +
+ +
- -
-
-
-
- -
- -
-
- -
- +
+
+ +
+ +
+
+ +
+ +
-
+
-
-
-
- -
- +
+
+ +
+ +
-
-
- -
- +
+ +
+ +
-
-
-
- -
- +
+
+ +
+ +
-
-
- -
- +
+ +
+ +
-
-
-
- -
- +
+
+ +
+ +
-
-
-
-
- -
- +
+
+
+ +
+ +
-
-
- -
- +
+ +
+ +
-
-
- -
- +
+ +
+ +
-
-
-
- -
- - -
- -
- - +
+
+ +
+ + +
+ +
+ + +
-
@* 系統-工程資訊sheet *@ -
-
-
- -
- -
+
+
+
+ +
+ +
- -
- + +
+ +
-
-
-
- -
- -
-
- +
+
+ +
+ +
+
+ +
-
-
- -
- +
+ +
+ +
-
-
-
-
- -
- +
+
+
+ +
+ +
-
-
- -
- +
+ +
+ +
-
-
- -
- +
+ +
+ +
+
+ +
+
-
- -
-
-
-
-
- -
- -
+
+
+ +
+ +
- -
- + +
+ +
-
-
-
- -
- -
- -
- -
- -
- +
+
+ +
+ +
+ +
+ +
+ +
+ +
-
-
-
- -
- +
+
+ +
+ +
-
-
-
- -
- +
+
+ +
+ +
-
-
-
- -
- +
+
+ +
+ +
-
-
-
- -
- +
+
+ +
+ +
-
-
-
- -
- +
+
+ +
+ +
-
-
-
- -
- +
+
+ +
+ +
-
-
-
- -
- +
+
+ +
+ +
-
-
- -
- +
+ +
+ +
-
@* 標籤選項sheet *@
@@ -766,41 +768,41 @@
@* SOP文件 sheet *@ -
-
- - @{ int l = 0;} - - - - - - - - - - @foreach (var index in Model.WipSops) - { - - - - - - - l++; - } - -
SOP文件敘述檔案路徑SOP類型生產單位
- - @index.SOPName - - @index.SOPPath - - @index.SOPTypeName - - @index.UnitNoName -
-
+
+
+ + @{ int l = 0;} + + + + + + + + + + @foreach (var index in Model.WipSops) + { + + + + + + + l++; + } + +
SOP文件敘述檔案路徑SOP類型生產單位
+ + @index.SOPName + + @index.SOPPath + + @index.SOPTypeName + + @index.UnitNoName +
+
@@ -813,18 +815,18 @@ $(document).ready(function () { if ($("#unitNo").val() == "B" || $("#unitNo").val() == "P" || $("#unitNo").val() == "T") { - $("#system").show(); - $("#board").hide(); - } - else { - $("#system").hide(); - $("#board").show(); - } - - $(":input").attr("disabled", "disabled"); - }); - - layui.use(['form', 'laydate', 'element','table'], function () { + $("#system").show(); + $("#board").hide(); + } + else { + $("#system").hide(); + $("#board").show(); + } + + $(":input").attr("disabled", "disabled"); + }); + + layui.use(['form', 'laydate', 'element', 'table'], function () { var form = layui.form, laydate = layui.laydate, layer = layui.layer, diff --git a/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml index 32e0934a..5627f9b8 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml @@ -417,15 +417,17 @@ @* 板卡-工程資訊sheet *@
-
- -
- -
+
+
+ +
+ +
- -
- + +
+ +
@@ -550,12 +552,12 @@
- +
- +
@@ -747,7 +749,7 @@
- +
@@ -1043,6 +1045,25 @@ }); }; + //UserName + function getUserName(val) { + $.ajax( + { + url: "@Url.Action("getUserName", "SYS")", + dataType: 'json', + data: { "userNo": val.value}, + type: 'post', + success: function (result) + { + $(val).closest('div.layui-inline').find('input[id*=' + val.id + '_Name]').val(result.data); + }, + error: function (result) + { + alert(result); + } + }); + }; + // RuleStation function RuleStation(NewID) { if (NewID == null) { diff --git a/AMESCoreStudio.Web/Views/PCS/PCS006.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS006.cshtml index b4c5fd49..b6a73560 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS006.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS006.cshtml @@ -98,7 +98,7 @@ wipID = strSplit[0]; else wipID = -1; - var confirmMsg = confirm('Are You Sure Change WorkOrder ?'); + var confirmMsg = confirm('確定要變更該工單的開線或是收線狀態?'); if (confirmMsg) { $.ajax({ @@ -132,7 +132,7 @@ else statusNO = "S" - var confirmMsg = confirm('Are You Sure Active Or Stop This Line ?'); + var confirmMsg = confirm('確定要啟動或停止此生產線?'); if (confirmMsg) { $.ajax({ diff --git a/AMESCoreStudio.Web/Views/PCS/PCS015.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS015.cshtml index 013a4212..1ae724c6 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS015.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS015.cshtml @@ -42,7 +42,7 @@
- +
diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/WipBoardController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/WipBoardController.cs index 0ec381ef..acb38723 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/WipBoardController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/WipBoardController.cs @@ -104,6 +104,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES getWipBoard.PcbBake = wipBoard.PcbBake; getWipBoard.Smd = wipBoard.Smd; getWipBoard.SolderPaste = wipBoard.SolderPaste; + getWipBoard.Engineer = wipBoard.Engineer; getWipBoard.UpdateDate = DateTime.Now; getWipBoard.UpdateUserID = 0; } diff --git a/AMESCoreStudio.WebApi/Controllers/AMES/WipSystemController.cs b/AMESCoreStudio.WebApi/Controllers/AMES/WipSystemController.cs index e1d69792..3f7c0f65 100644 --- a/AMESCoreStudio.WebApi/Controllers/AMES/WipSystemController.cs +++ b/AMESCoreStudio.WebApi/Controllers/AMES/WipSystemController.cs @@ -102,6 +102,7 @@ namespace AMESCoreStudio.WebApi.Controllers.AMES getwipSystem.OsVer = wipSystem.OsVer; getwipSystem.PowerMode = wipSystem.PowerMode; getwipSystem.Ram = wipSystem.Ram; + getwipSystem.Engineer = wipSystem.Engineer; getwipSystem.UpdateDate = DateTime.Now; getwipSystem.UpdateUserID = 0; } diff --git a/AMESCoreStudio.WebApi/Controllers/SYS/UserInfoesController.cs b/AMESCoreStudio.WebApi/Controllers/SYS/UserInfoesController.cs index a0e14ff4..bbdd826f 100644 --- a/AMESCoreStudio.WebApi/Controllers/SYS/UserInfoesController.cs +++ b/AMESCoreStudio.WebApi/Controllers/SYS/UserInfoesController.cs @@ -71,6 +71,20 @@ namespace AMESCoreStudio.WebApi.Controllers.SYS return userInfo; } + /// + /// UserInfo By UserNo + /// + /// + /// + // GET: api/UserInfoes/5 + [HttpGet("ByUserNo/{id}")] + public async Task> GetUserInfoByUserNo(string id) + { + IQueryable q = _context.UserInfoes.Where(w => w.UserNo.ToUpper() == id.ToUpper()); + var userInfo = await q.FirstOrDefaultAsync(); + return userInfo; + } + /// /// /// diff --git a/AMESCoreStudio.WebApi/Models/AMES/WipBoard.cs b/AMESCoreStudio.WebApi/Models/AMES/WipBoard.cs index 08c589e2..7944adf6 100644 --- a/AMESCoreStudio.WebApi/Models/AMES/WipBoard.cs +++ b/AMESCoreStudio.WebApi/Models/AMES/WipBoard.cs @@ -224,8 +224,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES /// [NotMapped] [DataMember] - [ForeignKey("Engineer")] - public SYS.UserInfo GetUserInfo { get; set; } + public string Engineer_Name { get; set; } } } diff --git a/AMESCoreStudio.WebApi/Models/AMES/WipSystem.cs b/AMESCoreStudio.WebApi/Models/AMES/WipSystem.cs index 4b4e3dec..cf1f7a5c 100644 --- a/AMESCoreStudio.WebApi/Models/AMES/WipSystem.cs +++ b/AMESCoreStudio.WebApi/Models/AMES/WipSystem.cs @@ -349,7 +349,6 @@ namespace AMESCoreStudio.WebApi.Models.AMES /// [NotMapped] [DataMember] - [ForeignKey("Engineer")] - public SYS.UserInfo GetUserInfo { get; } + public string Engineer_Name { get; set; } } }