From 8b7df7e329d5588e57d38a006db608f161ef1dc8 Mon Sep 17 00:00:00 2001 From: "BB.Wang" Date: Tue, 29 Nov 2022 08:52:36 +0800 Subject: [PATCH] =?UTF-8?q?Yiru=20=E4=BF=AE=E6=AD=A3=E6=A8=99=E5=B7=A5?= =?UTF-8?q?=E3=80=81IPQC(=E5=B7=A1=E6=AA=A2=E8=A1=A8=E5=96=AE)=E3=80=81AP?= =?UTF-8?q?=E7=A8=8B=E5=BC=8F(=E5=8C=85=E8=A3=9D=E3=80=81=E6=8B=89?= =?UTF-8?q?=E5=85=A5=E5=BA=AB=E5=96=AE)=E7=A8=8B=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/SPCController.cs | 78 ++++++++-- AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs | 4 +- AMESCoreStudio.Web/HttpApis/AMES/ISPC.cs | 4 +- AMESCoreStudio.Web/Views/JIG/JIG014.cshtml | 4 + AMESCoreStudio.Web/Views/SPC/SPC004.cshtml | 88 +++++++++--- AMESCoreStudio.Web/Views/SPC/SPC004U.cshtml | 12 +- AMESCoreStudio.Web/Views/SPC/SPC005.cshtml | 30 ++++ AMESCoreStudio.Web/Views/SPC/SPC005C.cshtml | 127 ++++++++++++---- AMESCoreStudio.Web/Views/WHS/WHS003C.cshtml | 2 +- AMESCoreStudio.Web/Views/WHS/WHS006.cshtml | 30 ++-- AMESCoreStudio.Web/Views/WHS/WHS018C.cshtml | 6 +- AMESCoreStudio.Web/Views/WHS/WHS018U.cshtml | 10 +- AMESCoreStudio.Web/Views/WHS/WHS019C.cshtml | 6 +- AMESCoreStudio.Web/Views/WHS/WHS019U.cshtml | 7 +- .../AMES/InspectionItemsController.cs | 22 +++ .../AMES/InspectionResultDetailsController.cs | 5 +- .../AMES/InspectionResultMastersController.cs | 26 +++- .../Controllers/AMES/WipBoxController.cs | 136 ++++++++++-------- .../DTO/AMES/InspectionResultDetailDto.cs | 5 +- .../Models/AMES/OutfitCommodityInfo.cs | 4 +- .../Models/AMES/OutfitVarityInfo.cs | 6 +- .../Models/AMES/StandardWorkTime.cs | 2 +- .../buildTransitive/netcoreapp3.1/_._ | 0 23 files changed, 460 insertions(+), 154 deletions(-) create mode 100644 其他專案資料/AMES_AP 2.0/packages/System.CodeDom.6.0.0/buildTransitive/netcoreapp3.1/_._ diff --git a/AMESCoreStudio.Web/Controllers/SPCController.cs b/AMESCoreStudio.Web/Controllers/SPCController.cs index 88546f86..7cde4d79 100644 --- a/AMESCoreStudio.Web/Controllers/SPCController.cs +++ b/AMESCoreStudio.Web/Controllers/SPCController.cs @@ -272,6 +272,30 @@ namespace AMESCoreStudio.Web.Controllers ViewBag.UserName = user; } + private async Task GetStationList1() + { + var result = await _basApi.GetStationses(); + + var StationItems = new List(); + StationItems.Add(new SelectListItem("N/A", "0")); + for (int i = 0; i < result.Count; i++) + { + StationItems.Add(new SelectListItem(result[i].StationName, result[i].StationName)); + } + ViewBag.StationList = StationItems; + } + private async Task GetLineList1() + { + var result = await _basApi.GetLineInfoes(); + + var LineItems = new List(); + LineItems.Add(new SelectListItem("N/A", "0")); + for (int i = 0; i < result.Count; i++) + { + LineItems.Add(new SelectListItem(result[i].LineDesc, result[i].LineDesc)); + } + ViewBag.LineList = LineItems; + } #endregion #region SPC001 巡檢類別維護相關 @@ -629,9 +653,10 @@ namespace AMESCoreStudio.Web.Controllers { var result = await _spcApi.GetInspectionItemsByFormID(id); - if (result.Count > 0) + if (result.Count() != 0) { return Json(new Table() { code = 0, msg = "", data = result, count = result.Count }); + } return Json(new Table() { count = 0, data = null }); @@ -641,8 +666,11 @@ namespace AMESCoreStudio.Web.Controllers #region SPC004巡檢結果維護相關 - public IActionResult SPC004() + // public IActionResult SPC004() + public async Task SPC004() { + await GetStationList1(); + await GetLineList1(); return View(); } //修改页面 @@ -711,6 +739,8 @@ namespace AMESCoreStudio.Web.Controllers ItemNo = " "; if (string.IsNullOrWhiteSpace(BarcodeNo)) BarcodeNo = " "; + + var result = await _spcApi.GetInspectionResultMastersByQuery(WipNo, ItemNo, BarcodeNo, "C"); @@ -721,11 +751,16 @@ namespace AMESCoreStudio.Web.Controllers return Json(new Table() { count = 0, data = null }); } - public async Task GetInspectionResultDetailQueryAsync(int id) + public async Task GetInspectionResultDetailQueryAsync(int id ,string Line,string RuleStation) { var result = await _spcApi.GetInspectionResultDetailQuery(id); + if (Line != "0") + result = result.Where(w => w.Line == Line).ToList(); + if (RuleStation != "0") + result = result.Where(w => w.RuleStation == RuleStation).ToList(); + if (result.Count > 0) { return Json(new Table() { code = 0, msg = "", data = result, count = result.Count }); @@ -1059,8 +1094,9 @@ namespace AMESCoreStudio.Web.Controllers return Json(new Table() { count = 0, data = null }); } - public async Task GetInspectionResultMastersByQueryAllAsync(int id, string WipNo, string ItemNo, string BarcodeNo, string StatusNo, string sdate, string edate) + public async Task GetInspectionResultMastersByQueryAllAsync(int id, string WipNo, string ItemNo, string BarcodeNo, string StatusNo, string sdate, string edate, int page = 0, int limit = 10) { + //yiru 2022-11-17 //if (id == 0) // return Json(new Table() { count = 0, data = null }); if (string.IsNullOrEmpty(WipNo)) @@ -1077,12 +1113,15 @@ namespace AMESCoreStudio.Web.Controllers sdate = "*"; if (string.IsNullOrEmpty(edate)) edate = "*"; + - var result = await _spcApi.GetInspectionResultMastersByQueryAll( id, WipNo, ItemNo, BarcodeNo, StatusNo, sdate, edate); + var result = await _spcApi.GetInspectionResultMastersByQueryAll( id, WipNo, ItemNo, BarcodeNo, StatusNo, sdate, edate, page , limit ); + - if (result.Count > 0) + if (result.DataTotal > 0) { - return Json(new Table() { code = 0, msg = "", data = result, count = result.Count }); + + return Json(new Table() { code = 0, msg = "", data = result.Data, count = result.DataTotal }); } return Json(new Table() { count = 0, data = null }); @@ -1094,6 +1133,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() { count = 0, data = null }); @@ -1112,9 +1152,31 @@ namespace AMESCoreStudio.Web.Controllers return Json(new Table() { count = 0, data = null }); } - #endregion + public async Task CheckBarcodeNOAsync(string BarcodeNo, string WipNo) + { + // var result_WipNo = await _pcsApi.GetWipBarcode(WipNo); + var BarcodeInfo = await _pcsApi.GetBarcodeInfoesByNo(BarcodeNo); + var wipInfo = await _pcsApi.GetWipInfoByWipNO(WipNo); + if (BarcodeInfo.Count > 0 && wipInfo.Count > 0) + { + var BarcodeWip = await _pcsApi.GetBarcodeWipByTwoKey(BarcodeInfo.Select(s => s.BarcodeID).FirstOrDefault(), wipInfo.Select(s => s.WipID).FirstOrDefault()); + + if (BarcodeWip != null) + { + return Json(new Table() { code = 0, msg = "", data = BarcodeWip, count = 1 }); + } + + } + return Json(new Table() { count = 0,msg = "生產序號不在工單區間內", data = null }); + } + #endregion + + } + + + } diff --git a/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs b/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs index 916a8d37..d2414b79 100644 --- a/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs +++ b/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs @@ -439,7 +439,7 @@ namespace AMESCoreStudio.Web #region BarcodeWip 檔案用途 條碼工單資料檔 PCS021 [WebApiClient.Attributes.HttpGet("api/BarcodeWip/{id}/{wipid}")] - ITask GetBarcodeWipByTwoKey(string id, string wipid); + ITask GetBarcodeWipByTwoKey(int id, int wipid); [WebApiClient.Attributes.HttpPost("api/BarcodeWip")] ITask PostBarcodeWip([FromBody, RawJsonContent] string model); @@ -870,7 +870,7 @@ namespace AMESCoreStudio.Web /// /// [WebApiClient.Attributes.HttpGet("api/BarcodeItems/Unit/{id}/Str/{str}")] - ITask> GetBItemByStr(string id, string str); + ITask> GetBarcodeItemByStr(string id, string str); /// /// BarCodeInfo By BarCodeNo diff --git a/AMESCoreStudio.Web/HttpApis/AMES/ISPC.cs b/AMESCoreStudio.Web/HttpApis/AMES/ISPC.cs index 416d762b..3c9db36b 100644 --- a/AMESCoreStudio.Web/HttpApis/AMES/ISPC.cs +++ b/AMESCoreStudio.Web/HttpApis/AMES/ISPC.cs @@ -226,8 +226,8 @@ namespace AMESCoreStudio.Web /// /// [WebApiClient.Attributes.HttpGet("api/InspectionResultMasters/QueryAll/{id}/{WipNo}/{ItemNo}/{BarcodeNo}/{StatusNo}/{sdate}/{edate}")] - ITask> GetInspectionResultMastersByQueryAll(int id, string WipNo, string ItemNo, string BarcodeNo, string StatusNo, string sdate, string edate); - + ITask> GetInspectionResultMastersByQueryAll(int id, string WipNo, string ItemNo, string BarcodeNo, string StatusNo, string sdate, string edate, int page = 0, int limit = 10); + /// /// 獲取MASTER ID diff --git a/AMESCoreStudio.Web/Views/JIG/JIG014.cshtml b/AMESCoreStudio.Web/Views/JIG/JIG014.cshtml index 388b532f..cf16e1c3 100644 --- a/AMESCoreStudio.Web/Views/JIG/JIG014.cshtml +++ b/AMESCoreStudio.Web/Views/JIG/JIG014.cshtml @@ -115,6 +115,10 @@ field: 'useTimes', title: '使用次數' }, + { + field: 'totalTimes', + title: '累積次數' + }, { field: 'locationNo', title: '儲位' diff --git a/AMESCoreStudio.Web/Views/SPC/SPC004.cshtml b/AMESCoreStudio.Web/Views/SPC/SPC004.cshtml index dc1de143..658e7fbc 100644 --- a/AMESCoreStudio.Web/Views/SPC/SPC004.cshtml +++ b/AMESCoreStudio.Web/Views/SPC/SPC004.cshtml @@ -34,6 +34,27 @@ +
+
+ +
+ +
+
+
+ + +
+
+ +
+ +
+
+
+
+ + +
- -
- - + -@section Scripts{ - -} \ No newline at end of file + + } diff --git a/AMESCoreStudio.Web/Views/SPC/SPC004U.cshtml b/AMESCoreStudio.Web/Views/SPC/SPC004U.cshtml index f134eebe..5a52e3b6 100644 --- a/AMESCoreStudio.Web/Views/SPC/SPC004U.cshtml +++ b/AMESCoreStudio.Web/Views/SPC/SPC004U.cshtml @@ -13,7 +13,7 @@
-
+
@@ -39,16 +39,20 @@
+
- +
+
- - + +
+ +
diff --git a/AMESCoreStudio.Web/Views/SPC/SPC005.cshtml b/AMESCoreStudio.Web/Views/SPC/SPC005.cshtml index 661f62be..95420d24 100644 --- a/AMESCoreStudio.Web/Views/SPC/SPC005.cshtml +++ b/AMESCoreStudio.Web/Views/SPC/SPC005.cshtml @@ -180,6 +180,15 @@ } }); }; + + $("#BarcodeNo").change(function () { + + var BarcodeNo = $("#BarcodeNo").val(); + var WipNo = $("#WipNo").val(); + if (BarcodeNo != "" && WipNo != "") { + CheckBarcodeNo(BarcodeNo, WipNo); + } + }); ////搜索 $('#querysubmit').click(function () { @@ -237,6 +246,8 @@ } ]]; + + //通过行tool编辑,lay-event="edit" function edit(obj) { if (obj.data.inspectionID) { @@ -322,6 +333,25 @@ + '&edate=' + edate , {}, tableCols, toolbar, true, 'full-100', ['filter', 'print', 'exports']); }; + + function CheckBarcodeNo(BarcodeNo, WipNo) { + $.ajax({ + url: '/SPC/CheckBarcodeNO?BarcodeNo=' + BarcodeNo + '&WipNo=' + WipNo, + dataType: 'json', + contentType: "application/json", + type: 'get', + success: function (result) { + if (!result.data) { + alert("生產序號不在工單區間內"); + } + + } + }); + }; + + + + } \ No newline at end of file diff --git a/AMESCoreStudio.Web/Views/SPC/SPC005C.cshtml b/AMESCoreStudio.Web/Views/SPC/SPC005C.cshtml index bb133beb..34a9df9a 100644 --- a/AMESCoreStudio.Web/Views/SPC/SPC005C.cshtml +++ b/AMESCoreStudio.Web/Views/SPC/SPC005C.cshtml @@ -46,7 +46,7 @@
- +
@@ -56,7 +56,7 @@
- +
@@ -345,10 +345,76 @@ }); //BarcodeNo - $("#WipNo").keypress(function (e) { + //$("#WipNo").keypress(function (e) { + + // if (e.keyCode == 13) { + + // var data = $("#WipNo").val(); + // if (data) { + // console.log("data=" + data); + // $.ajax({ + // url: "/SPC/GetWipAtt", + // dataType: 'json', + // data: { id: data }, + // contentType: "application/json", + // type: 'get', + // success: function (result) { + // if (result.data) { + // alert("11"); + // //console.info(result.data);//確認itemNO/modelNO + // $("#ItemNo").val(result.data.itemNO); + // $("#ModelNo").val(result.data.modelNO); + // //BarcodeNo + // $('#BarcodeNo').focus(); + // event.preventDefault(); + // return false; + // } + // else { + // alert("查無資料,請確認工單是否正確!"); + // $("#WipNo").val(""); + // //$('#WipNo').focus(); + // return false; + // } + // }, + // error: function () { + // alert("查無資料,請確認工單是否正確!"); + // $("#WipNo").val(""); + // //$('#WipNo').focus(); + // return false; + // } + // }); + // } else { + // alert("請填寫工單!"); + // return false; + // } + + // } + + //}); + + $("#ItemNo").keypress(function (e) { if (code == 13) { + var data = $("#WipNo").val(); + if (data) { + $('#BarcodeNo').focus(); + + } else { + alert("請填寫工單!"); + $('#WipNo').focus(); + return false; + } + + } + + }); + + + function WipNOinput(e) { + + if (e.keyCode == 13) { + var data = $("#WipNo").val(); if (data) { console.log("data=" + data); @@ -365,6 +431,9 @@ $("#ModelNo").val(result.data.modelNO); //BarcodeNo $('#BarcodeNo').focus(); + event.preventDefault(); + + return false; } else { alert("查無資料,請確認工單是否正確!"); @@ -387,40 +456,26 @@ } - }); - - $("#ItemNo").keypress(function (e) { - - if (code == 13) { - + } + + function input(e) { + if (e.keyCode == 13 ) { var data = $("#WipNo").val(); - if (data) { - $('#BarcodeNo').focus(); - - } else { + if (!data) { alert("請填寫工單!"); $('#WipNo').focus(); return false; } - - } - - }); - - $("#BarcodeNo").keypress(function (e) { - - if (code == 13) { - - var data = $("#WipNo").val(); - if (!data) { - alert("請填寫工單!"); - $('#WipNo').focus(); + else { + var Barcode = $("#BarcodeNo").val(); + CheckBarcodeNo(Barcode, data); + event.preventDefault(); return false; } } - - }); + }; + layui.use(['form', 'layer', 'table', 'laytpl', 'laydate'], function () { var layer = layui.layer, @@ -537,6 +592,22 @@ }); + + function CheckBarcodeNo(BarcodeNo, WipNo) { + + $.ajax({ + url: '/SPC/CheckBarcodeNO?BarcodeNo=' + BarcodeNo + '&WipNo=' + WipNo, + dataType: 'json', + contentType: "application/json", + type: 'get', + success: function (result) { + if (!result.data) { + alert("生產序號不在工單區間內"); + } + + } + }); + }; // PLM_ECN $("#GetPLMECN").on("click", function () { diff --git a/AMESCoreStudio.Web/Views/WHS/WHS003C.cshtml b/AMESCoreStudio.Web/Views/WHS/WHS003C.cshtml index 7bdd8483..fc7120fc 100644 --- a/AMESCoreStudio.Web/Views/WHS/WHS003C.cshtml +++ b/AMESCoreStudio.Web/Views/WHS/WHS003C.cshtml @@ -29,7 +29,7 @@
- +
diff --git a/AMESCoreStudio.Web/Views/WHS/WHS006.cshtml b/AMESCoreStudio.Web/Views/WHS/WHS006.cshtml index 1795b634..9f65bb81 100644 --- a/AMESCoreStudio.Web/Views/WHS/WHS006.cshtml +++ b/AMESCoreStudio.Web/Views/WHS/WHS006.cshtml @@ -77,9 +77,9 @@
@**@ - +
-
@@ -107,7 +107,7 @@
-
+ @*
@@ -120,7 +120,7 @@
-
+
*@
@@ -208,9 +208,9 @@ }); //监听表单提交事件 hg.form.onsubmit('querysubmit', function (data) { - //hg.msghide("重新載入資料.."); + hg.msghide("重新載入資料.."); - //table && table.reload(data); + table && table.reload(data); }); ////搜索 $('#querysubmit').click(function () { @@ -237,7 +237,7 @@ title: '#', sort: true }, - { + @* { field: 'u', width: 100, title: '部門', @@ -276,6 +276,12 @@ } return tt } + },*@ + { + field: 'unitNo', + title: '制程代碼', + width: 100, + sort: true }, { field: 'userNo', @@ -391,17 +397,17 @@ fNO = $("#factoryNo").val(); if ($("#check_unitNo").prop("checked")) uNO = $("#unitNo").val(); - if ($("#check_lineid").prop("checked")) + if ($("#check_lineID").prop("checked")) lID = $("#lineID").val(); - if ($("#check_classID").prop("checked")) - cID = $("#classID").val(); + if ($("#check_classNo").prop("checked")) + cID = $("#classNo").val(); if ($("#check_stationID").prop("checked")) sID = $("#stationID").val(); if ($("#check_userNo").prop("checked")) usNO = $("#userNo").val(); if ($("#check_deptID").prop("checked")) - dID = $("#deptID").val(); - + dID = lID; + table = hg.table.datatable('query', '每日工時資料維護', '/WHS/GetWorkManPowersByQuery?' + 'fid=' + fNO + '&uid=' + uNO + '&lid=' + lID + '&cID=' + cID + '&sID=' + sID + '&uNo=' + usNO + '&sd='+ $("#dateStr").val() + '&ed='+ $("#dateEnd").val() // + 'factoryid=' + fNO + '&unitid=' + uNO + '&lineid=' + lID + '&classID=' + cID + '&stationID=' + sID + '&userNo=' + usNO + '&sd=' + $("#dateStr").val() + '&edate=' + $("#dateEnd").val() diff --git a/AMESCoreStudio.Web/Views/WHS/WHS018C.cshtml b/AMESCoreStudio.Web/Views/WHS/WHS018C.cshtml index cad72963..23a973a4 100644 --- a/AMESCoreStudio.Web/Views/WHS/WHS018C.cshtml +++ b/AMESCoreStudio.Web/Views/WHS/WHS018C.cshtml @@ -63,11 +63,14 @@
+
- +
+ +
- + - +
@@ -63,11 +63,14 @@
+
- +
+ +
+
- +
+ + +
- + - +
@@ -65,9 +65,10 @@
- +
+