From 6c769144c1afb638513573e1f1154242c07fff2c Mon Sep 17 00:00:00 2001 From: "BB.Wang" Date: Tue, 11 Oct 2022 11:22:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=94=E5=8A=A9Yiru=E4=B8=8A=E5=82=B3?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3Rita=E6=89=80=E6=8F=90=E4=B9=8BBug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/JIGController.cs | 59 ++++- .../Controllers/KCSController.cs | 2 +- .../Controllers/WHSController.cs | 131 ++++++++-- AMESCoreStudio.Web/Views/JIG/JIG004.cshtml | 42 ++-- AMESCoreStudio.Web/Views/JIG/JIG004C.cshtml | 2 +- AMESCoreStudio.Web/Views/JIG/JIG004D.cshtml | 100 ++++++++ AMESCoreStudio.Web/Views/JIG/JIG004R.cshtml | 161 ++++++++++++ AMESCoreStudio.Web/Views/JIG/JIG005.cshtml | 7 +- AMESCoreStudio.Web/Views/JIG/JIG006.cshtml | 14 +- AMESCoreStudio.Web/Views/KCS/KCS005.cshtml | 2 +- AMESCoreStudio.Web/Views/SPC/SPC005.cshtml | 2 +- AMESCoreStudio.Web/Views/WHS/WHS005.cshtml | 2 +- AMESCoreStudio.Web/Views/WHS/WHS008C.cshtml | 7 +- AMESCoreStudio.Web/Views/WHS/WHS009.cshtml | 8 +- AMESCoreStudio.Web/Views/WHS/WHS009C.cshtml | 231 ++++++++++++++++-- AMESCoreStudio.Web/Views/WHS/WHS009U.cshtml | 228 +++++++++++++++-- .../Models/AMES/ExceptionWorktime.cs | 5 +- .../Models/AMES/OutfitInfo.cs | 9 + .../Models/AMES/SupportUser.cs | 7 + .../Models/AMES/WorkGroup.cs | 2 +- .../Models/AMES/WorkManPower.cs | 2 + 21 files changed, 933 insertions(+), 90 deletions(-) create mode 100644 AMESCoreStudio.Web/Views/JIG/JIG004D.cshtml create mode 100644 AMESCoreStudio.Web/Views/JIG/JIG004R.cshtml diff --git a/AMESCoreStudio.Web/Controllers/JIGController.cs b/AMESCoreStudio.Web/Controllers/JIGController.cs index 5df08f07..a7e14e1b 100644 --- a/AMESCoreStudio.Web/Controllers/JIGController.cs +++ b/AMESCoreStudio.Web/Controllers/JIGController.cs @@ -585,10 +585,22 @@ namespace AMESCoreStudio.Web.Controllers return View(result[0]); } - public async Task JIG004DAsync(int id) + + + public async Task JIG004D(int id ) { - var result = await _jigApi.DeleteOutfitInfo(id); - return Json(new Result() { success = true, msg = "" }); + var result = await _jigApi.GetOutfitInfo(id); + + if (result.Count == 0) + { + return View(); + } + else + { + return View(result[0]); + } + + } [HttpPost] public async Task JIG004CSaveAsync(OutfitInfo model) @@ -794,6 +806,43 @@ namespace AMESCoreStudio.Web.Controllers // GetUserID(); return View(); } + + public async Task JIG004DSaveAsync(OutfitInfo model) + { + var msg = ""; + if (ModelState.IsValid) + { + string Status = string.Empty; + IResultModel result; + if (model.StatusNo == "A") + { + model.StatusNo = "S"; + Status = "停用"; + } + else + { + model.StatusNo = "A"; + Status = "啟用"; + } + + result = await _jigApi.PutOutfitInfo(model.OutfitID, JsonConvert.SerializeObject(model)); + + if (result.Success) + { + var _msg = Status +"成功!"; + return RedirectToAction("Refresh", "Home", new { msg = _msg }); + } + else + { + + msg = result.Msg; + + } + } + if (msg == "") msg = "缺少必填資料"; + ModelState.AddModelError("error", msg); + return View("JIG004D", model); + } // YIRU ADD @@ -1039,7 +1088,7 @@ namespace AMESCoreStudio.Web.Controllers IResultModel result1; var OutfitInfo = await _jigApi.GetOutfitInfo(model.OutfitID); var modi = OutfitInfo[0]; - modi.UseStatusNo = "S"; + modi.UseStatusNo = "C"; modi.StatusNo = "S"; modi.Custondian = model.StatusUserID; result1 = await _jigApi.PutOutfitInfo(model.OutfitID, JsonConvert.SerializeObject(modi)); @@ -1078,7 +1127,7 @@ namespace AMESCoreStudio.Web.Controllers IResultModel result1; var OutfitInfo = await _jigApi.GetOutfitInfo(model.OutfitID); var modi = OutfitInfo[0]; - modi.UseStatusNo = "F"; + modi.UseStatusNo = "S"; modi.Custondian = model.StatusUserID; result1 = await _jigApi.PutOutfitInfo(model.OutfitID, JsonConvert.SerializeObject(modi)); if (result1.Success) diff --git a/AMESCoreStudio.Web/Controllers/KCSController.cs b/AMESCoreStudio.Web/Controllers/KCSController.cs index 446684d6..b48fd946 100644 --- a/AMESCoreStudio.Web/Controllers/KCSController.cs +++ b/AMESCoreStudio.Web/Controllers/KCSController.cs @@ -702,7 +702,7 @@ namespace AMESCoreStudio.Web.Controllers return View(); } [HttpPost] - public async Task KCS005SaveAsync(InspectionResultBlob model, IFormFile formFile) + public async Task KCS005SaveAsync(KPLink model, IFormFile formFile) { IResultModel result; var tt = await _kcsApi.GetKPLink(""); diff --git a/AMESCoreStudio.Web/Controllers/WHSController.cs b/AMESCoreStudio.Web/Controllers/WHSController.cs index 90016638..0d639c8c 100644 --- a/AMESCoreStudio.Web/Controllers/WHSController.cs +++ b/AMESCoreStudio.Web/Controllers/WHSController.cs @@ -241,7 +241,31 @@ namespace AMESCoreStudio.Web.Controllers ViewBag.StationList = StationItems; } + private async Task GetExceptionReasonList() + { + var result = await _whsApi.GetExceptionReasons(); + + var GetExceptionReasons = new List(); + for (int i = 0; i < result.Count; i++) + { + GetExceptionReasons.Add(new SelectListItem(result[i].ReasonDescCH, result[i].ReasonNo)); + } + + ViewBag.ExceptionReasons = GetExceptionReasons; + } + + private async Task GetUserInfo() + { + var result = await _sysApi.GetUserInfoes(); + + var UserItems = new List(); + foreach (var item in result.Data) + { + UserItems.Add(new SelectListItem(item.UserName, item.UserID.ToString())); + } + ViewBag.UserList = UserItems; + } #endregion #region WHS001工作群組維護相關 @@ -571,8 +595,9 @@ namespace AMESCoreStudio.Web.Controllers if (l == 0) //yiru modify 2022-10-04 l = -99; // return Json(new Table() { count = 0, data = null }); - if (string.IsNullOrEmpty(i)) - i = "Null"; + if (string.IsNullOrEmpty(i)) //若沒輸入料號查詢 就不帶出資料 + return Json(new Table() { count = 0, data = null }); + //i = "Null"; if (string.IsNullOrEmpty(u)) u = "Null"; if (u=="0") @@ -851,28 +876,76 @@ namespace AMESCoreStudio.Web.Controllers { if (ModelState.IsValid) { - IResultModel result; + var Msg = string.Empty; + if (model.UnitNoI != "0") + { + if (model.StationIDI == -1) + { + Msg += "請選擇援入站別\r\n"; + } + if (model.LineIDI == 0) + { + Msg += "請選擇援入線別\r\n"; + } + + } + else + { + if (model.OtherDeptI == "0") + { + Msg += "請選擇援入其他部門\r\n"; + } - result = await _whsApi.PostSupportUser(JsonConvert.SerializeObject(model)); + } - - if (result.Success) + if (model.UnitNoO != "0") { - var _msg = "添加成功!"; - return RedirectToAction("Refresh", "Home", new { msg = _msg }); + if (model.StationIDO == -1) + { + Msg += "請選擇援出站別\r\n"; + } + if (model.LineIDO == 0) + { + Msg += "請選擇援出線別\r\n"; + } + } else { - if (result.Errors.Count > 0) + if (model.OtherDeptO == "0") { - ModelState.AddModelError(result.Errors[0].Id, result.Errors[0].Msg); + Msg += "請選擇援出其他部門\r\n"; + } + } + + if (Msg != null) + { + ModelState.AddModelError("error", Msg); + } + else + { + IResultModel result; + result = await _whsApi.PostSupportUser(JsonConvert.SerializeObject(model)); + + + if (result.Success) + { + var _msg = "添加成功!"; + return RedirectToAction("Refresh", "Home", new { msg = _msg }); } else { - ModelState.AddModelError("error", result.Msg); + if (result.Errors.Count > 0) + { + ModelState.AddModelError(result.Errors[0].Id, result.Errors[0].Msg); + } + else + { + ModelState.AddModelError("error", result.Msg); + } } - } } + } return View("WHS008C", model); } public async Task WHS008USaveAsync(SupportUser model) @@ -966,6 +1039,7 @@ namespace AMESCoreStudio.Web.Controllers //內部/外部 //EXCEPTION_Class //EXCEPTION_CODE + await GetExceptionReasonList(); return View(); } @@ -990,6 +1064,11 @@ namespace AMESCoreStudio.Web.Controllers await GetExceptionCodesList(); + await GetExceptionReasonList(); + + await GetUserInfo(); + + var result = await _whsApi.GetExceptionWorktime(id); var result2 = await _whsApi.GetExceptionCode(result[0].ExceptionNo); ViewBag.ClassNo = result2[0].ExceptionClassNo; @@ -997,6 +1076,7 @@ namespace AMESCoreStudio.Web.Controllers ViewBag.GroupNo = result3[0].ExceptionGroupNo; + if (result.Count == 0) { return View(); @@ -1014,8 +1094,18 @@ namespace AMESCoreStudio.Web.Controllers if (ModelState.IsValid) { IResultModel result; + if (model.PersonNo != null) + { + var Reasons = await _whsApi.GetExceptionReason(model.PersonNo); + model.ReasonNameCh = Reasons[0].ReasonDescCH; + } + if (model.Measure != null) + { + model.MeasureDate = System.DateTime.Now; + } + - result = await _whsApi.PostExceptionWorktime(JsonConvert.SerializeObject(model)); + result = await _whsApi.PostExceptionWorktime(JsonConvert.SerializeObject(model)); //yiru modify 2022-10-04 if (result.Success) @@ -1074,7 +1164,8 @@ namespace AMESCoreStudio.Web.Controllers { if (factoryNo == null) { - factoryNo = "*"; + //factoryNo = "*"; + return Json(new Table() { count = 0, data = null }); } if (unitNo == null) { @@ -1202,6 +1293,18 @@ namespace AMESCoreStudio.Web.Controllers } + + public async Task GetExceptionReasonsByExceptionNoAsync(string id) + { + var result = await _whsApi.GetExceptionReason(id); + + if (result.Count > 0) + { + return Json(new Table() { code = 0, msg = "", data = result, count = result.Count }); + } + + return Json(new Table() { count = 0, data = null }); + } #endregion #region WHS011重工標準工時維護相關 diff --git a/AMESCoreStudio.Web/Views/JIG/JIG004.cshtml b/AMESCoreStudio.Web/Views/JIG/JIG004.cshtml index aca3477f..420c6bfb 100644 --- a/AMESCoreStudio.Web/Views/JIG/JIG004.cshtml +++ b/AMESCoreStudio.Web/Views/JIG/JIG004.cshtml @@ -154,7 +154,7 @@ hg.open('修改設備基本資料', '/JIG/JIG004U/' + obj.data.outfitID, 640,320); } } - + //通过行tool删除,lay-event="del" function del(obj) { var status; @@ -165,24 +165,26 @@ status = "啟用"; if (obj.data.outfitID) { - hg.confirm("設備:" + obj.data.outfitNo + ",确定要" + status +"吗?", function () { - $.ajax({ - url: '/JIG/JIG004D', - data: { id: obj.data.outfitID }, - type: 'POST', - success: function (data) { - if (data.success) { - obj.del(); //只删本地数据 - hg.msghide(status+"成功!"); - } - else { - hg.msg(data.msg); - } - }, - error: function () { - hg.msg("网络请求失败!"); - } - }); + + hg.confirm("設備:" + obj.data.outfitNo + ",确定要" + status + "吗?", function () { + hg.open('停用啟用基本設備', '/JIG/JIG004D/' + obj.data.outfitID, 640, 320); + // $.ajax({ + // url: '/JIG/JIG004D', + // data: { id: obj.data.outfitID }, + // type: 'POST', + // success: function (data) { + // if (data.success) { + // obj.del(); //只删本地数据 + // hg.msghide(status+"成功!"); + // } + // else { + // hg.msg(data.msg); + // } + // }, + // error: function () { + // hg.msg("网络请求失败!"); + // } + // }); }); } } @@ -196,7 +198,7 @@ } } ]; - + ////搜索 $('#querysubmit').click(function () { diff --git a/AMESCoreStudio.Web/Views/JIG/JIG004C.cshtml b/AMESCoreStudio.Web/Views/JIG/JIG004C.cshtml index 5a318eb2..584c3109 100644 --- a/AMESCoreStudio.Web/Views/JIG/JIG004C.cshtml +++ b/AMESCoreStudio.Web/Views/JIG/JIG004C.cshtml @@ -129,8 +129,8 @@
diff --git a/AMESCoreStudio.Web/Views/JIG/JIG004D.cshtml b/AMESCoreStudio.Web/Views/JIG/JIG004D.cshtml new file mode 100644 index 00000000..4560266a --- /dev/null +++ b/AMESCoreStudio.Web/Views/JIG/JIG004D.cshtml @@ -0,0 +1,100 @@ +@model AMESCoreStudio.WebApi.Models.AMES.OutfitInfo + + +@{ ViewData["Title"] = "JIG004D"; + Layout = "~/Views/Shared/_FormLayout.cshtml"; } + + + + +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+
+ + + +
+ + @Html.ValidationMessage("error") +
+ +
+ +
+
+
+ +@section Scripts { + @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); + await Html.RenderPartialAsync("_FileinputScriptsPartial"); } + + + + +} + diff --git a/AMESCoreStudio.Web/Views/JIG/JIG004R.cshtml b/AMESCoreStudio.Web/Views/JIG/JIG004R.cshtml new file mode 100644 index 00000000..7ac046aa --- /dev/null +++ b/AMESCoreStudio.Web/Views/JIG/JIG004R.cshtml @@ -0,0 +1,161 @@ +@model AMESCoreStudio.WebApi.Models.AMES.OutfitInfoBlob + + + +@{ ViewData["Title"] = "JIG004R"; + Layout = "~/Views/Shared/_AMESLayout.cshtml"; } + + + +
+
+
+
+ + +
+
+ + +
+
+
+
+ @Html.ValidationMessage("error") + @* *@ +
+
+
+ @* SOP文件 sheet *@ +
+ +
+
+ +@section Scripts { + @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); + await Html.RenderPartialAsync("_FileinputScriptsPartial"); } + + + + +} + diff --git a/AMESCoreStudio.Web/Views/JIG/JIG005.cshtml b/AMESCoreStudio.Web/Views/JIG/JIG005.cshtml index 355e0633..7569acdd 100644 --- a/AMESCoreStudio.Web/Views/JIG/JIG005.cshtml +++ b/AMESCoreStudio.Web/Views/JIG/JIG005.cshtml @@ -99,7 +99,10 @@ else if (d.useStatusNo == "R") str = '歸還'; else if (d.useStatusNo == "S") + str = '送修'; + else if (d.useStatusNo == "C") str = '報廢'; + return str //return '修改 删除' } @@ -119,9 +122,9 @@ fixed: 'right', templet: function (d) { var btn = '檢視'; - if (d.useStatusNo == "B") + if (d.useStatusNo == "B" || d.useStatusNo == "S") btn += ' 歸還'; - else + else if (d.useStatusNo == "N" || d.useStatusNo == "R") btn += ' 領用'; return btn } diff --git a/AMESCoreStudio.Web/Views/JIG/JIG006.cshtml b/AMESCoreStudio.Web/Views/JIG/JIG006.cshtml index 60687438..efccbf44 100644 --- a/AMESCoreStudio.Web/Views/JIG/JIG006.cshtml +++ b/AMESCoreStudio.Web/Views/JIG/JIG006.cshtml @@ -109,9 +109,10 @@ else if (d.useStatusNo == "R") str = '歸還'; else if (d.useStatusNo == "S") - str = '報廢'; - else if (d.useStatusNo == "F") str = '送修'; + else if (d.useStatusNo == "C") + str = '報廢'; + return str } }, @@ -134,10 +135,14 @@ if (d.statusNo == "A") { if (d.useStatusNo == "N" || d.useStatusNo == "R") { btn += ' 送修'; - btn += ' 報廢'; } - else + if (d.useStatusNo == "S" || d.useStatusNo == "B") { btn += ' 歸還'; + } + if (d.useStatusNo == "N" || d.useStatusNo == "R" || d.useStatusNo == "B" || d.useStatusNo == "S") { + btn += ' 報廢'; + } + } return btn @@ -234,6 +239,7 @@ }); //基本数据表格 function tt() { + table = hg.table.datatable('test', '設備送修/領用', '/JIG/GetOutfitInfoesByQuery?TypeFlag=' + $("#TypeFlag").val() + '&CommodityID=' + $("#Commodity").val() + '&VarityID=-99&Status=' + $("#Status").val() + '&QANo=' + $("#QANo").val() + '&PartNo=*&UseStatus=*' , {}, tableCols, toolbar, true, 'full-100', ['filter', 'print', 'exports']); diff --git a/AMESCoreStudio.Web/Views/KCS/KCS005.cshtml b/AMESCoreStudio.Web/Views/KCS/KCS005.cshtml index a7d2c048..0b6cb01a 100644 --- a/AMESCoreStudio.Web/Views/KCS/KCS005.cshtml +++ b/AMESCoreStudio.Web/Views/KCS/KCS005.cshtml @@ -131,7 +131,7 @@ }); function tt() { //基本数据表格 - table = hg.table.datatable('sop', '巡檢上傳文件', '/SPC/GetInspectionResultBlobsByQuery?id=' + @ViewBag.MasterID +'&itemID=' + @ViewBag.ItemID, {}, tableCols, false, 'full-100'); + table = hg.table.datatable('sop', '組件料號序號文件', '/KCS/GetInspectionResultBlobsByQuery?id=' + @ViewBag.MasterID +'&itemID=' + @ViewBag.ItemID, {}, tableCols, false, 'full-100'); }; $(document).ready(function () { diff --git a/AMESCoreStudio.Web/Views/SPC/SPC005.cshtml b/AMESCoreStudio.Web/Views/SPC/SPC005.cshtml index c939e396..661f62be 100644 --- a/AMESCoreStudio.Web/Views/SPC/SPC005.cshtml +++ b/AMESCoreStudio.Web/Views/SPC/SPC005.cshtml @@ -279,7 +279,7 @@ class: 'layui-btn-normal', handler: function () { var form = $("#Form").val(); - if (form) { + if (form != -99) { hg.open('新增巡檢結果', '/SPC/SPC005C/' + form, '', '', true); } else { diff --git a/AMESCoreStudio.Web/Views/WHS/WHS005.cshtml b/AMESCoreStudio.Web/Views/WHS/WHS005.cshtml index 9c2e55eb..aaa87b5c 100644 --- a/AMESCoreStudio.Web/Views/WHS/WHS005.cshtml +++ b/AMESCoreStudio.Web/Views/WHS/WHS005.cshtml @@ -39,7 +39,7 @@
- +
diff --git a/AMESCoreStudio.Web/Views/WHS/WHS008C.cshtml b/AMESCoreStudio.Web/Views/WHS/WHS008C.cshtml index 504ead40..2ae1bc29 100644 --- a/AMESCoreStudio.Web/Views/WHS/WHS008C.cshtml +++ b/AMESCoreStudio.Web/Views/WHS/WHS008C.cshtml @@ -155,7 +155,7 @@ } }); - $("#UserNo").blur(function () { + $("#UserNo").change(function () { var data = $("#UserNo").val(); console.log(data); @@ -233,16 +233,19 @@ success: function (result) { if (result.data) { console.info(result.data); + var name = ""; var count = 0; $.each(result.data, function (index, item) { if (item.userNo == data) { name = item.userName; count = count + 1; + } }); if (count == 1) { - $("#UserName").val(name); + + $("#UserNane").val(name); } else { alert('請確認工號是否正確!!!'); diff --git a/AMESCoreStudio.Web/Views/WHS/WHS009.cshtml b/AMESCoreStudio.Web/Views/WHS/WHS009.cshtml index c24e9be8..c8c6bbd1 100644 --- a/AMESCoreStudio.Web/Views/WHS/WHS009.cshtml +++ b/AMESCoreStudio.Web/Views/WHS/WHS009.cshtml @@ -182,7 +182,7 @@ sort: true }, { - field: 'personNameCh', + field: 'reasonNameCh', title: '判定描述(中文)', width: 100, }, @@ -250,9 +250,9 @@ //基本数据表格 //var table = hg.table.datatable('query', '異常工時資料維護', '/WHS/GetExceptionWorktimeByQuery', {}, tableCols, toolbar, true, 'full-100', ['filter', 'print', 'exports']); var table; - //$(function () { - // tt(); - //}); + $(function () { + tt(); + }); function tt() { //基本数据表格 var fNO = "", uNO = "", lID = "", dID = ""; diff --git a/AMESCoreStudio.Web/Views/WHS/WHS009C.cshtml b/AMESCoreStudio.Web/Views/WHS/WHS009C.cshtml index 59e130ec..49fb01f7 100644 --- a/AMESCoreStudio.Web/Views/WHS/WHS009C.cshtml +++ b/AMESCoreStudio.Web/Views/WHS/WHS009C.cshtml @@ -17,6 +17,7 @@ +
@@ -96,11 +97,26 @@
+
+ + +
+ + + +
+ +
+ + + +
+
@@ -135,14 +151,40 @@
+
- - - + + +
+ +
+ + + +
+ + + + +
+ + + +
+ + +
+ + + +
+ + +
- +
@@ -185,11 +227,7 @@ //console.info(data); getExceptionNo(data); }); - $("#DecideDept").change(function () { - var data = $("#DecideDept").val(); - //console.info(data); - getUserInfoes(data); - }); + $('#searchItemNo').click(function () { var data = $("#WipNo").val(); if (data) { @@ -248,8 +286,35 @@ getLines(data); getStations(data); }); + $("#ExceptionNo").change(function () { + + var data = $("#ExceptionNo").val(); + getExceptionReasonNO(data); + }); + + + $("#DecideDept").change(function () { + var data = $("#DecideDept").val(); + //console.info(data); + getDecideUser(data); + }); + $("#DutyDept").change(function () { + var data = $("#DutyDept").val(); + //console.info(data); + getDutyUser(data); + }); + $("#DecidDeptID").change(function () { + var data = $("#DecidDeptID").val(); + //console.info(data); + getDecidUserID(data); + }); + $("#DutyDeptID").change(function () { + var data = $("#DutyDeptID").val(); + //console.info(data); + getDutyUserID(data); + }); - function getUserInfoes(data) { + function getDecideUser(data) { $.ajax({ url: "/SYS/GetUserInfoes", dataType: 'json', @@ -279,6 +344,105 @@ } }); }; + + + function getDutyUser(data) { + $.ajax({ + url: "/SYS/GetUserInfoes", + dataType: 'json', + contentType: "application/json", + type: 'get', + success: function (result) { + if (result.data) { + $("#DutyUser").empty(); + $('#DutyUser').append(new Option("請選擇", "")); + var count = 0; + $.each(result.data, function (index, item) { + if (item.deptID == data) { + $('#DutyUser').append(new Option(item.userName, item.userID)); + count = count + 1; + } + }); + if (count == 0) { + $("#DutyUser").empty(); + $('#DutyUser').append(new Option("無選項", "")); + } + } + else { + $("#DutyUser").empty(); + $('#DutyUser').append(new Option("無選項", "")); + } + layui.form.render("select"); + } + }); + }; + + + function getDecidUserID(data) { + $.ajax({ + url: "/SYS/GetUserInfoes", + dataType: 'json', + contentType: "application/json", + type: 'get', + success: function (result) { + if (result.data) { + $("#DecidUserID").empty(); + $('#DecidUserID').append(new Option("請選擇", "")); + var count = 0; + $.each(result.data, function (index, item) { + if (item.deptID == data) { + $('#DecidUserID').append(new Option(item.userName, item.userID)); + count = count + 1; + } + }); + if (count == 0) { + $("#DecidUserID").empty(); + $('#DecidUserID').append(new Option("無選項", "")); + } + } + else { + $("#DecidUserID").empty(); + $('#DecidUserID').append(new Option("無選項", "")); + } + layui.form.render("select"); + } + }); + }; + + + function getDutyUserID(data) { + $.ajax({ + url: "/SYS/GetUserInfoes", + dataType: 'json', + contentType: "application/json", + type: 'get', + success: function (result) { + if (result.data) { + $("#DutyUserID").empty(); + $('#DutyUserID').append(new Option("請選擇", "")); + var count = 0; + $.each(result.data, function (index, item) { + if (item.deptID == data) { + $('#DutyUserID').append(new Option(item.userName, item.userID)); + count = count + 1; + } + }); + if (count == 0) { + $("#DutyUserID").empty(); + $('#DutyUserID').append(new Option("無選項", "")); + } + } + else { + $("#DutyUserID").empty(); + $('#DutyUserID').append(new Option("無選項", "")); + } + layui.form.render("select"); + } + }); + }; + + + function getExceptionClass(data) { $.ajax({ url: "/WHS/GetExceptionClasses", @@ -325,22 +489,23 @@ if (result.data) { $("#ExceptionNo").empty(); - $('#ExceptionNo').append(new Option("請選擇", "")); + $("#ExceptionNo").append(new Option("請選擇", "")); var count = 0; $.each(result.data, function (index, item) { + if (item.exceptionClassNo == data) { //修改等號 - $('#ExceptionNo').append(new Option(item.exceptionDescCH, item.exceptionNo));//修改參數 + $("#ExceptionNo").append(new Option(item.exceptionDescCH, item.exceptionNo));//修改參數 count = count + 1; } }); if (count == 0) { $("#ExceptionNo").empty(); - $('#ExceptionNo').append(new Option("無選項", "")) + $("#ExceptionNo").append(new Option("無選項", "")) } } else { $("#ExceptionNo").empty(); - $('#ExceptionNo').append(new Option("無選項", "")); + $("#ExceptionNo").append(new Option("無選項", "")); } layui.form.render("select"); } @@ -406,6 +571,42 @@ } }); }; + function getExceptionReasonNO(data) { + + $.ajax({ + url: "/WHS/GetExceptionReasonsByQuery", + dataType: 'json', + data: { id: data }, + contentType: "application/json", + type: 'get', + success: function (result) { + if (result.data) { + + $("#PersonNo").empty(); + $("#PersonNo").append(new Option("請選擇", "")); + var count = 0; + $.each(result.data, function (index, item) { + + if (item.exceptionNo == data) { //修改等號 + + $("#PersonNo").append(new Option(item.reasonDescCH, item.reasonNo));//修改參數 + count = count + 1; + } + }); + if (count == 0) { + $("#PersonNo").empty(); + $("#PersonNo").append(new Option("無選項", "")) + } + } + else { + $("#PersonNo").empty(); + $("#PersonNo").append(new Option("無選項", "")); + } + + layui.form.render("select"); + } + }); + }; layui.use(['laydate'], function () { //form = layui.form; @@ -432,6 +633,8 @@ // getLineInfoes(data); //}); + + }); diff --git a/AMESCoreStudio.Web/Views/WHS/WHS009U.cshtml b/AMESCoreStudio.Web/Views/WHS/WHS009U.cshtml index 9c3b7760..f33a6297 100644 --- a/AMESCoreStudio.Web/Views/WHS/WHS009U.cshtml +++ b/AMESCoreStudio.Web/Views/WHS/WHS009U.cshtml @@ -10,7 +10,7 @@
-
+
@@ -60,7 +60,7 @@
- + +
- @@ -97,9 +97,23 @@
- +
+ +
+ + + +
+ +
+ + + +
+ +
@@ -132,16 +146,40 @@
- +
+ +
- - - + + + +
+ +
+ + + +
+ + + +
+ + +
+ + +
+ + + +
+
- +
@@ -189,11 +227,7 @@ //console.info(data); getExceptionNo(data); }); - $("#DecideDept").change(function () { - var data = $("#DecideDept").val(); - //console.info(data); - getUserInfoes(data); - }); + $('#searchItemNo').click(function () { var data = $("#WipNo").val(); if (data) { @@ -246,7 +280,35 @@ }); - function getUserInfoes(data) { + $("#ExceptionNo").change(function () { + var data = $("#ExceptionNo").val(); + //console.info(data); + getExceptionReasonNO(data); + }); + + + $("#DecideDept").change(function () { + var data = $("#DecideDept").val(); + //console.info(data); + getDecideUser(data); + }); + $("#DutyDept").change(function () { + var data = $("#DutyDept").val(); + //console.info(data); + getDutyUser(data); + }); + $("#DecidDeptID").change(function () { + var data = $("#DecidDeptID").val(); + //console.info(data); + getDecidUserID(data); + }); + $("#DutyDeptID").change(function () { + var data = $("#DutyDeptID").val(); + //console.info(data); + getDutyUserID(data); + }); + + function getDecideUser(data) { $.ajax({ url: "/SYS/GetUserInfoes", dataType: 'json', @@ -275,7 +337,105 @@ layui.form.render("select"); } }); - }; + }; + + + function getDutyUser(data) { + $.ajax({ + url: "/SYS/GetUserInfoes", + dataType: 'json', + contentType: "application/json", + type: 'get', + success: function (result) { + if (result.data) { + $("#DutyUser").empty(); + $('#DutyUser').append(new Option("請選擇", "")); + var count = 0; + $.each(result.data, function (index, item) { + if (item.deptID == data) { + $('#DutyUser').append(new Option(item.userName, item.userID)); + count = count + 1; + } + }); + if (count == 0) { + $("#DutyUser").empty(); + $('#DutyUser').append(new Option("無選項", "")); + } + } + else { + $("#DutyUser").empty(); + $('#DutyUser').append(new Option("無選項", "")); + } + layui.form.render("select"); + } + }); + }; + + + function getDecidUserID(data) { + $.ajax({ + url: "/SYS/GetUserInfoes", + dataType: 'json', + contentType: "application/json", + type: 'get', + success: function (result) { + if (result.data) { + $("#DecidUserID").empty(); + $('#DecidUserID').append(new Option("請選擇", "")); + var count = 0; + $.each(result.data, function (index, item) { + if (item.deptID == data) { + $('#DecidUserID').append(new Option(item.userName, item.userID)); + count = count + 1; + } + }); + if (count == 0) { + $("#DecidUserID").empty(); + $('#DecidUserID').append(new Option("無選項", "")); + } + } + else { + $("#DecidUserID").empty(); + $('#DecidUserID').append(new Option("無選項", "")); + } + layui.form.render("select"); + } + }); + }; + + + function getDutyUserID(data) { + $.ajax({ + url: "/SYS/GetUserInfoes", + dataType: 'json', + contentType: "application/json", + type: 'get', + success: function (result) { + if (result.data) { + $("#DutyUserID").empty(); + $('#DutyUserID').append(new Option("請選擇", "")); + var count = 0; + $.each(result.data, function (index, item) { + if (item.deptID == data) { + $('#DutyUserID').append(new Option(item.userName, item.userID)); + count = count + 1; + } + }); + if (count == 0) { + $("#DutyUserID").empty(); + $('#DutyUserID').append(new Option("無選項", "")); + } + } + else { + $("#DutyUserID").empty(); + $('#DutyUserID').append(new Option("無選項", "")); + } + layui.form.render("select"); + } + }); + }; + + function getExceptionClass(data) { $.ajax({ url: "/WHS/GetExceptionClasses", @@ -343,7 +503,41 @@ } }); }; + function getExceptionReasonNO(data) { + $.ajax({ + url: "/WHS/GetExceptionReasonsByQuery", + dataType: 'json', + data: { id: data }, + contentType: "application/json", + type: 'get', + success: function (result) { + if (result.data) { + + $("#PersonNo").empty(); + $("#PersonNo").append(new Option("請選擇", "")); + var count = 0; + $.each(result.data, function (index, item) { + + if (item.exceptionNo == data) { //修改等號 + $("#PersonNo").append(new Option(item.reasonDescCH, item.reasonNo));//修改參數 + count = count + 1; + } + }); + if (count == 0) { + $("#PersonNo").empty(); + $("#PersonNo").append(new Option("無選項", "")) + } + } + else { + $("#PersonNo").empty(); + $("#PersonNo").append(new Option("無選項", "")); + } + + layui.form.render("select"); + } + }); + }; diff --git a/AMESCoreStudio.WebApi/Models/AMES/ExceptionWorktime.cs b/AMESCoreStudio.WebApi/Models/AMES/ExceptionWorktime.cs index 4ef6791c..bb027af2 100644 --- a/AMESCoreStudio.WebApi/Models/AMES/ExceptionWorktime.cs +++ b/AMESCoreStudio.WebApi/Models/AMES/ExceptionWorktime.cs @@ -9,7 +9,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES /// 異常工時資料 /// [Table("EXCEPTION_WORKTIME", Schema = "JHAMES")] - [DataContract] + public class ExceptionWorktime { /// @@ -179,7 +179,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES /// [Column("REASON_NAME_CH")] [Display(Name = "回覆: 判定描述")] - public string PersonNameCh { get; set; } + public string ReasonNameCh { get; set; } /// ///回覆: 判定類別 @@ -213,6 +213,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES /// 判定負責人ID /// [Column("DECIDE_USER_ID")] + [Display(Name = "判定負責人ID")] public int DecidUserID { get; set; } /// diff --git a/AMESCoreStudio.WebApi/Models/AMES/OutfitInfo.cs b/AMESCoreStudio.WebApi/Models/AMES/OutfitInfo.cs index 8ba66d53..befeac89 100644 --- a/AMESCoreStudio.WebApi/Models/AMES/OutfitInfo.cs +++ b/AMESCoreStudio.WebApi/Models/AMES/OutfitInfo.cs @@ -385,5 +385,14 @@ namespace AMESCoreStudio.WebApi.Models.AMES [Column("UPDATE_DATE", TypeName = "DATE")] [DataMember] public DateTime UpdateDate { get; set; } = System.DateTime.Now; + + /// + /// 變更狀態備註(啟用/停用) + /// + [Column("USE_STATUS_REMARK")] + [StringLength(200)] + [Display(Name = "變更狀態備註(啟用/停用)")] + public string UseStatusRemark { get; set; } + } } diff --git a/AMESCoreStudio.WebApi/Models/AMES/SupportUser.cs b/AMESCoreStudio.WebApi/Models/AMES/SupportUser.cs index 91685879..0092dd4e 100644 --- a/AMESCoreStudio.WebApi/Models/AMES/SupportUser.cs +++ b/AMESCoreStudio.WebApi/Models/AMES/SupportUser.cs @@ -53,6 +53,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES /// [Column("UNIT_NO_I")] [DataMember] + [Required(ErrorMessage = "{0},不能空白")] [Display(Name = "援入單位")] public string UnitNoI { get; set; } @@ -69,6 +70,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES /// [Column("UNIT_NO_O")] [DataMember] + [Required(ErrorMessage = "{0},不能空白")] [Display(Name = "援出單位")] public string UnitNoO { get; set; } @@ -93,6 +95,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES /// [Column("LINE_ID_I")] [DataMember] + [Required(ErrorMessage = "{0},不能空白")] [Display(Name = "援入線別")] public int LineIDI { get; set; } @@ -101,6 +104,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES /// [Column("STATION_ID_I")] [DataMember] + [Required(ErrorMessage = "{0},不能空白")] [Display(Name = "援入站別")] public int StationIDI { get; set; } @@ -109,6 +113,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES /// [Column("LINE_ID_O")] [DataMember] + [Required(ErrorMessage = "{0},不能空白")] [Display(Name = "援出線別")] public int LineIDO { get; set; } @@ -117,6 +122,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES /// [Column("STATION_ID_O")] [DataMember] + [Required(ErrorMessage = "{0},不能空白")] [Display(Name = "援出站別")] public int StationIDO { get; set; } @@ -141,6 +147,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES /// [Column("CLASS_NO")] [DataMember] + [Required(ErrorMessage = "{0},不能空白")] [Display(Name = "班別")] public string ClassNo { get; set; } diff --git a/AMESCoreStudio.WebApi/Models/AMES/WorkGroup.cs b/AMESCoreStudio.WebApi/Models/AMES/WorkGroup.cs index d06bab4b..cf91bf4e 100644 --- a/AMESCoreStudio.WebApi/Models/AMES/WorkGroup.cs +++ b/AMESCoreStudio.WebApi/Models/AMES/WorkGroup.cs @@ -27,7 +27,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES [DataMember] [Display(Name = "工作群組名稱")] [Required(ErrorMessage = "{0},不能空白")] - [StringLength(5, ErrorMessage = "{0},不能大于{1}")] + [StringLength(20, ErrorMessage = "{0},不能大于{1}")] public string GroupName { get; set; } /// diff --git a/AMESCoreStudio.WebApi/Models/AMES/WorkManPower.cs b/AMESCoreStudio.WebApi/Models/AMES/WorkManPower.cs index 23fad5bf..dda4f5d7 100644 --- a/AMESCoreStudio.WebApi/Models/AMES/WorkManPower.cs +++ b/AMESCoreStudio.WebApi/Models/AMES/WorkManPower.cs @@ -53,6 +53,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES /// [Column("UNIT_NO")] [DataMember] + [Required(ErrorMessage = "{0},不能空白")] [Display(Name = "制程代碼")] public string UnitNo { get; set; } @@ -125,6 +126,7 @@ namespace AMESCoreStudio.WebApi.Models.AMES /// [Column("WERKS")] [DataMember] + [Required(ErrorMessage = "{0},不能空白")] [Display(Name = "廠別")] public string Werks { get; set; }