From 57dd5b25ee5f1dc88bd59b2ae326cdd3c443e3ef Mon Sep 17 00:00:00 2001 From: ray Date: Mon, 2 May 2022 19:38:29 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BF=AE=E6=AD=A3=E9=81=8E=E7=AB=99?= =?UTF-8?q?=E5=B7=A5=E7=A8=8B=E8=B3=87=E8=A8=8A=E9=95=B7=E5=BA=A6=202.=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B7=A5=E5=96=AE=E6=9F=A5=E8=A9=A2-(?= =?UTF-8?q?=E4=BF=AE=E6=94=B9)=E5=B7=A5=E7=A8=8B=E8=B3=87=E8=A8=8A?= =?UTF-8?q?=E5=8F=8A=E6=9D=BF=E5=8D=A1=E8=B3=87=E8=A8=8A=20=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E5=88=A4=E6=96=B7=EF=BC=8C=E5=87=BA=E8=B2=A8=E5=BA=8F?= =?UTF-8?q?=E8=99=9F=E5=8A=A0=E5=85=A5=E6=8C=89=E9=88=95=E7=94=A2=E7=94=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/PCSController.cs | 147 ++++++++++++++---- AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs | 5 + AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml | 3 +- AMESCoreStudio.Web/Views/PCS/PCS003.cshtml | 60 ++++++- AMESCoreStudio.Web/Views/PCS/PCS021.cshtml | 2 +- .../Models/AMES/WipSystem.cs | 2 + 6 files changed, 187 insertions(+), 32 deletions(-) diff --git a/AMESCoreStudio.Web/Controllers/PCSController.cs b/AMESCoreStudio.Web/Controllers/PCSController.cs index 250439ae..c4c71b6f 100644 --- a/AMESCoreStudio.Web/Controllers/PCSController.cs +++ b/AMESCoreStudio.Web/Controllers/PCSController.cs @@ -117,34 +117,68 @@ namespace AMESCoreStudio.Web.Controllers return Msg; } + /// + /// 工單工程 保存判斷 + /// + /// + /// public string CheckWipInfoInsert_WipSystem(WipSystem model) { string Msg = string.Empty; - // 判斷預設值是否更改過,如果有就判斷必填欄位 - if (!string.IsNullOrWhiteSpace(model.BiTemperature) || - !string.IsNullOrWhiteSpace(model.BiTime) || + // 當工單-工程資訊有填寫任何一個欄位,就要把必填欄位都填寫 + if (!string.IsNullOrWhiteSpace(model.Engineer) || + !string.IsNullOrWhiteSpace(model.PowerMode) || !string.IsNullOrWhiteSpace(model.BiMemo) || + !string.IsNullOrWhiteSpace(model.BiTime) || + !string.IsNullOrWhiteSpace(model.BiTemperature) || + model.BiRatio != 0 || !string.IsNullOrWhiteSpace(model.Checksum) || - !string.IsNullOrWhiteSpace(model.Bios)) - { - if (string.IsNullOrWhiteSpace(model.BiTemperature)) - Msg += model.GetAttributeFrom(nameof(model.BiTemperature)).Name + ","; + !string.IsNullOrWhiteSpace(model.Bios) || + !string.IsNullOrWhiteSpace(model.BiosVer) || + !string.IsNullOrWhiteSpace(model.Cpu) || + !string.IsNullOrWhiteSpace(model.DmiBi) || + !string.IsNullOrWhiteSpace(model.Ram) || + !string.IsNullOrWhiteSpace(model.Fw) || + !string.IsNullOrWhiteSpace(model.Fw1) || + !string.IsNullOrWhiteSpace(model.Fw2) || + !string.IsNullOrWhiteSpace(model.Ec) || + !string.IsNullOrWhiteSpace(model.OsVer) || + !string.IsNullOrWhiteSpace(model.Jumper) || + !string.IsNullOrWhiteSpace(model.Memo)) + { + + // 判斷預設值是否更改過,如果有就判斷必填欄位 + if (!string.IsNullOrWhiteSpace(model.BiTemperature) || + !string.IsNullOrWhiteSpace(model.BiTime) || + !string.IsNullOrWhiteSpace(model.BiMemo) || + model.BiRatio == 0 || + !string.IsNullOrWhiteSpace(model.Checksum) || + !string.IsNullOrWhiteSpace(model.Bios) || + !string.IsNullOrWhiteSpace(model.BiosVer)) + { + if (string.IsNullOrWhiteSpace(model.BiTemperature)) + Msg += model.GetAttributeFrom(nameof(model.BiTemperature)).Name + ","; - if (string.IsNullOrWhiteSpace(model.BiTime)) - Msg += model.GetAttributeFrom(nameof(model.BiTime)).Name + ","; + if (string.IsNullOrWhiteSpace(model.BiTime)) + Msg += model.GetAttributeFrom(nameof(model.BiTime)).Name + ","; - if (string.IsNullOrWhiteSpace(model.BiTime)) - Msg += model.GetAttributeFrom(nameof(model.BiMemo)).Name + ","; + if (string.IsNullOrWhiteSpace(model.BiTime)) + Msg += model.GetAttributeFrom(nameof(model.BiMemo)).Name + ","; - if (string.IsNullOrWhiteSpace(model.Checksum)) - Msg += model.GetAttributeFrom(nameof(model.Checksum)).Name + ","; + if (string.IsNullOrWhiteSpace(model.Checksum)) + Msg += model.GetAttributeFrom(nameof(model.Checksum)).Name + ","; - if (string.IsNullOrWhiteSpace(model.Bios)) - Msg += model.GetAttributeFrom(nameof(model.Bios)).Name + ","; + if (string.IsNullOrWhiteSpace(model.Bios)) + Msg += model.GetAttributeFrom(nameof(model.Bios)).Name + ","; - } + if (string.IsNullOrWhiteSpace(model.BiosVer)) + Msg += model.GetAttributeFrom(nameof(model.BiosVer)).Name + ","; + if (model.BiRatio == 0) + Msg += model.GetAttributeFrom(nameof(model.BiRatio)).Name + ","; + } + } return Msg; } @@ -152,30 +186,63 @@ namespace AMESCoreStudio.Web.Controllers { string Msg = string.Empty; - // 判斷預設值是否更改過,如果有就判斷必填欄位 + // 當工單-板卡資訊有填寫任何一個欄位,就要把必填欄位都填寫 if (model.BiRatio != 0 || + !string.IsNullOrWhiteSpace(model.BiosRemarks) || + !string.IsNullOrWhiteSpace(model.BiTemperature) || + !string.IsNullOrWhiteSpace(model.BiTime) || + !string.IsNullOrWhiteSpace(model.BiosRemarks) || + !string.IsNullOrWhiteSpace(model.BiosVer) || + !string.IsNullOrWhiteSpace(model.BiRemarks) || + !string.IsNullOrWhiteSpace(model.BurnLocation) || + !string.IsNullOrWhiteSpace(model.BurnRemarks) || + !string.IsNullOrWhiteSpace(model.Checksum) || + !string.IsNullOrWhiteSpace(model.CsRemarks) || + !string.IsNullOrWhiteSpace(model.Engineer) || + !string.IsNullOrWhiteSpace(model.PartsBakeRemarks) || model.PartsBakeTime != 0 || model.PcbBake != 0 || + !string.IsNullOrWhiteSpace(model.PcbBakeRemarks) || + !string.IsNullOrWhiteSpace(model.PcbProcessingRemarks)) + { + + // 判斷預設值是否更改過,如果有就判斷必填欄位 + if (model.BiRatio == 0 || + model.PartsBakeTime == 0 || + model.PcbBake == 0 || !string.IsNullOrWhiteSpace(model.BiosVer) || !string.IsNullOrWhiteSpace(model.BiTemperature) || !string.IsNullOrWhiteSpace(model.BiTime) || !string.IsNullOrWhiteSpace(model.Checksum) || !string.IsNullOrWhiteSpace(model.BurnLocation)) - { - if (string.IsNullOrWhiteSpace(model.BiTemperature)) - Msg += model.GetAttributeFrom(nameof(model.BiTemperature)).Name + ","; + { + if (model.BiRatio == 0) + Msg += model.GetAttributeFrom(nameof(model.BiRatio)).Name + ","; - if (string.IsNullOrWhiteSpace(model.BiTime)) - Msg += model.GetAttributeFrom(nameof(model.BiTime)).Name + ","; + if (model.PartsBakeTime == 0) + Msg += model.GetAttributeFrom(nameof(model.PartsBakeTime)).Name + ","; - if (string.IsNullOrWhiteSpace(model.Checksum)) - Msg += model.GetAttributeFrom(nameof(model.Checksum)).Name + ","; + if (model.PcbBake == 0) + Msg += model.GetAttributeFrom(nameof(model.PcbBake)).Name + ","; - if (string.IsNullOrWhiteSpace(model.BurnLocation)) - Msg += model.GetAttributeFrom(nameof(model.BurnLocation)).Name + ","; + if (string.IsNullOrWhiteSpace(model.BiosVer)) + Msg += model.GetAttributeFrom(nameof(model.BiosVer)).Name + ","; - } + if (string.IsNullOrWhiteSpace(model.BiTemperature)) + Msg += model.GetAttributeFrom(nameof(model.BiTemperature)).Name + ","; + + if (string.IsNullOrWhiteSpace(model.BiTime)) + Msg += model.GetAttributeFrom(nameof(model.BiTime)).Name + ","; + + if (string.IsNullOrWhiteSpace(model.Checksum)) + Msg += model.GetAttributeFrom(nameof(model.Checksum)).Name + ","; + + if (string.IsNullOrWhiteSpace(model.BurnLocation)) + Msg += model.GetAttributeFrom(nameof(model.BurnLocation)).Name + ","; + + } + } return Msg; } #endregion @@ -1213,6 +1280,30 @@ namespace AMESCoreStudio.Web.Controllers ViewBag.RuleStationByWipNoUnitNoList = items; return Json(new { data = items }); } + + + /// + /// 取出貨序號 + /// + /// 料號 + /// 生產序號 + /// 生產數量 + /// RuleStation + [HttpPost] + public async Task GetBarcodeOther(string itemNo, string lotNo, int num) + { + var result = await _pcsApi.GetSerialRuleByQurey(itemNo, lotNo.Trim().ToUpper(), num); + string StartNO = ""; + string EndNO = ""; + + if (result.Success) + { + StartNO = result.Msg.Split('~')[0]; + EndNO = result.Msg.Split('~')[1] ?? result.Msg.Split('~')[0]; + } + + return Json(new Result() { success = result.Success, msg = result.Msg, data = new { StartNO, EndNO } }); + } #endregion [ResponseCache(Duration = 0)] @@ -1943,7 +2034,7 @@ namespace AMESCoreStudio.Web.Controllers } } - + result = await _pcsApi.PutWipInfo(JsonConvert.SerializeObject(model.wipInfo)); if (result.Success) { diff --git a/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs b/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs index ed8763aa..38172066 100644 --- a/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs +++ b/AMESCoreStudio.Web/HttpApis/AMES/IPCS.cs @@ -1095,5 +1095,10 @@ namespace AMESCoreStudio.Web ITask> GetOutfitCommodityInfo(); #endregion + #region 取出貨序號 + [WebApiClient.Attributes.HttpGet("api/SerialRules/ByQurey/{itemNo}/{lotNo}/{num}")] + ITask> GetSerialRuleByQurey(string itemNo,string lotNo ,int num); + #endregion + } } diff --git a/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml index 56301636..e95e8d71 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml @@ -784,7 +784,8 @@
- + +
diff --git a/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml index 30e2da5b..7ebf2110 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml @@ -285,6 +285,15 @@
+
+ +
+ +
+
+ +
+
@@ -858,7 +867,7 @@
- +
@@ -1105,6 +1114,12 @@ $("#board").show(); } + // DIV 出貨序號 + if ($('#wipBarcodeOther_StartNO').val() != "" && $('#wipBarcodeOther_EndNO').val() != "") { + $("#barcodeOtherDiv").hide(); + } + + // DIV MAC if ($('#wipMAC_StartNO').val() != "" && $('#wipMAC_EndNO').val() != "") { $("#GetMAC").hide(); } @@ -1128,6 +1143,47 @@ }); + // 產生出貨序號 + $("#GetBarcodeOther").click(function (event) { + var itemNo = $('#wipAtt_ItemNO').val(); + var planQTY = $('#wipInfo_PlanQTY').val(); + var lotNo = $('#lotNo').val(); + if (itemNo == '' || !itemNo) { + parent.hg.msg("請輸入料號"); + return; + } + if (planQTY == '' || !planQTY || planQTY == 0) { + parent.hg.msg("請確認計畫數量"); + return; + } + if (lotNo == '' || !lotNo) { + parent.hg.msg("請確認lotNo"); + return; + } + + $.ajax({ + url: '@Url.Action("GetBarcodeOther", "PCS")', + dataType: 'json', + data: { "itemNo": itemNo, "lotNo": lotNo, "num": planQTY }, + cache: false, + type: "POST", + success: function (result) { + // 錯誤訊息 + if (!result.success) { + parent.hg.msg(result.msg); + } + else { + $("#wipBarcodeOther_StartNO").val(result.data.startNO); + $("#wipBarcodeOther_EndNO").val(result.data.endNO); + $("#barcodeOtherDiv").hide(); + } + }, + error: function (jqXHR, textStatus, errorThrown) { + alert("Found error when using Ajax!!"); + } + }); + }); + // 產生MAC $("#GetMAC").click(function (event) { var wipNO = $('#wipAtt_ItemNO').val(); @@ -1269,7 +1325,7 @@ $("#wipInfo_LineID").empty();//清空下拉框的值 $.each(result.data, function (index, item) { $("#wipInfo_LineID").append($("