diff --git a/AMESCoreStudio.Web/Controllers/PCSController.cs b/AMESCoreStudio.Web/Controllers/PCSController.cs index acc35079..b2e9da7a 100644 --- a/AMESCoreStudio.Web/Controllers/PCSController.cs +++ b/AMESCoreStudio.Web/Controllers/PCSController.cs @@ -135,13 +135,6 @@ namespace AMESCoreStudio.Web.Controllers } } - // 出貨序號 - if (string.IsNullOrWhiteSpace(model.wipBarcodeOther.StartNO) != string.IsNullOrWhiteSpace(model.wipBarcodeOther.EndNO)) - { - Msg += ",客戶序號未填完整"; - } - - if (!string.IsNullOrWhiteSpace(Msg)) Msg = "必填欄位未填寫:(" + Msg.Substring(0, (Msg.Length - 1)) + " )"; @@ -1757,13 +1750,9 @@ namespace AMESCoreStudio.Web.Controllers model.wipBarcodes = await _pcsApi.GetWipBarcode(model.wipInfo.WipNO); model.wipBarcode = model.wipBarcodes.FirstOrDefault(); model.ruleStations = await _pcsApi.GetRuleStationByWipNo(model.wipInfo.WipNO); - - - model.wipBarcodeOther = await _pcsApi.GetWipBarcodeOther(model.wipInfo.WipNO); - + model.wipBarcodeOthers = await _pcsApi.GetWipBarcodeOthers(model.wipInfo.WipNO); model.WipKps = await _pcsApi.GetWipKpByWipNo(model.wipInfo.WipNO); - await WipDataSelectAll(model.wipInfo.WipNO, UnitNo: model.wipInfo.UnitNO); TempData["request"] = JsonConvert.SerializeObject(model); return Redirect("PCS001N"); @@ -2262,18 +2251,18 @@ namespace AMESCoreStudio.Web.Controllers } // 出貨序號 - if (!string.IsNullOrWhiteSpace(model.wipBarcodeOther.StartNO) && !string.IsNullOrWhiteSpace(model.wipBarcodeOther.EndNO)) - { - var type_no = await _pcsApi.GetBarcodeTypeByTypeName("客戶條碼區間"); - if (type_no != null) - { - model.wipBarcodeOther.WipNO = model.wipInfo.WipNO; - model.wipBarcodeOther.TypeNO = type_no.TypeNo; - model.wipBarcodeOther.CreateUserID = UserID; - model.wipBarcodeOther.UpdateUserID = UserID; - result = await _pcsApi.PostWipBarcodeOther(JsonConvert.SerializeObject(model.wipBarcodeOther)); - } - } + //if (!string.IsNullOrWhiteSpace(model.wipBarcodeOther.StartNO) && !string.IsNullOrWhiteSpace(model.wipBarcodeOther.EndNO)) + //{ + // var type_no = await _pcsApi.GetBarcodeTypeByTypeName("客戶條碼區間"); + // if (type_no != null) + // { + // model.wipBarcodeOther.WipNO = model.wipInfo.WipNO; + // model.wipBarcodeOther.TypeNO = type_no.TypeNo; + // model.wipBarcodeOther.CreateUserID = UserID; + // model.wipBarcodeOther.UpdateUserID = UserID; + // result = await _pcsApi.PostWipBarcodeOther(JsonConvert.SerializeObject(model.wipBarcodeOther)); + // } + //} // 料號相關 var materialItem = await _pcsApi.GetMaterialItemByItemNO(model.wipAtt.ItemNO); @@ -2400,7 +2389,7 @@ namespace AMESCoreStudio.Web.Controllers model.wipLabel = await _pcsApi.GetWipLabel(model.wipInfo.WipNO); - model.wipBarcodeOther = await _pcsApi.GetWipBarcodeOther(model.wipInfo.WipNO); + model.wipBarcodeOthers = await _pcsApi.GetWipBarcodeOthers(model.wipInfo.WipNO); model.Outfits = await _pcsApi.GetMaterialOutfitByItemNo(model.wipAtt.ItemNO); @@ -2493,7 +2482,7 @@ namespace AMESCoreStudio.Web.Controllers model.wipLabel = await _pcsApi.GetWipLabel(model.wipInfo.WipNO); - model.wipBarcodeOther = await _pcsApi.GetWipBarcodeOther(model.wipInfo.WipNO); + model.wipBarcodeOthers = await _pcsApi.GetWipBarcodeOthers(model.wipInfo.WipNO); model.Outfits = await _pcsApi.GetMaterialOutfitByItemNo(model.wipAtt.ItemNO); @@ -2639,7 +2628,7 @@ namespace AMESCoreStudio.Web.Controllers model.wipLabel = await _pcsApi.GetWipLabel(model.wipInfo.WipNO); - model.wipBarcodeOther = await _pcsApi.GetWipBarcodeOther(model.wipInfo.WipNO); + model.wipBarcodeOthers = await _pcsApi.GetWipBarcodeOthers(model.wipInfo.WipNO); model.WipKps = await _pcsApi.GetWipKpByWipNo(model.wipInfo.WipNO); @@ -2724,7 +2713,6 @@ namespace AMESCoreStudio.Web.Controllers wipDataViewModel.wipInfo = model.wipInfo; wipDataViewModel.wipSystem = model.wipSystem; wipDataViewModel.wipBoard = model.wipBoard; - wipDataViewModel.wipBarcodeOther = model.wipBarcodeOther; var Msg = CheckWipInfoInsert(wipDataViewModel); // 判斷是否有開重複工單+生產單位 @@ -2828,6 +2816,7 @@ namespace AMESCoreStudio.Web.Controllers // 儲存後將最新資料都回前端 model.wipMACs = await _pcsApi.GetWipMAC(model.wipInfo.WipNO); model.wipInfoBlobs = await _pcsApi.GetWipInfoBlob(model.wipInfo.WipNO); + model.wipBarcodeOthers = await _pcsApi.GetWipBarcodeOthers(model.wipInfo.WipNO); var _msg = "修改成功!"; @@ -2985,7 +2974,7 @@ namespace AMESCoreStudio.Web.Controllers model.wipLabel = await _pcsApi.GetWipLabel(model.wipInfo.WipNO); - model.wipBarcodeOther = await _pcsApi.GetWipBarcodeOther(model.wipInfo.WipNO); + model.wipBarcodeOthers = await _pcsApi.GetWipBarcodeOthers(model.wipInfo.WipNO); model.WipKps = await _pcsApi.GetWipKpByWipNo(model.wipInfo.WipNO); @@ -3067,7 +3056,6 @@ namespace AMESCoreStudio.Web.Controllers wipDataViewModel.wipInfo = model.wipInfo; wipDataViewModel.wipSystem = model.wipSystem; wipDataViewModel.wipBoard = model.wipBoard; - wipDataViewModel.wipBarcodeOther = model.wipBarcodeOther; var Msg = CheckWipInfoInsert(wipDataViewModel); // 判斷WipKp 順序是否重複 @@ -3172,6 +3160,7 @@ namespace AMESCoreStudio.Web.Controllers // 儲存後將最新資料都回前端 model.wipMACs = await _pcsApi.GetWipMAC(model.wipInfo.WipNO); model.wipInfoBlobs = await _pcsApi.GetWipInfoBlob(model.wipInfo.WipNO); + model.wipBarcodeOthers = await _pcsApi.GetWipBarcodeOthers(model.wipInfo.WipNO); // 特殊需求 工程確認後 彈出工程通知完成 if (action == "工程確認") diff --git a/AMESCoreStudio.Web/ViewModels/PCS/WipViewModel.cs b/AMESCoreStudio.Web/ViewModels/PCS/WipViewModel.cs index 06d9d22f..c4259037 100644 --- a/AMESCoreStudio.Web/ViewModels/PCS/WipViewModel.cs +++ b/AMESCoreStudio.Web/ViewModels/PCS/WipViewModel.cs @@ -21,7 +21,7 @@ namespace AMESCoreStudio.Web.ViewModels.PCS WipOutfits = new List(); wipInfoBlobs = new List(); wipMACs = new List(); - wipBarcodeOther = new WipBarcodeOther(); + wipBarcodeOthers = new List(); wipLabel = new WipLabel(); } @@ -77,9 +77,9 @@ namespace AMESCoreStudio.Web.ViewModels.PCS public IEnumerable wipMACs { get; set; } /// - /// 條碼區間設定 + /// 出貨條碼區間設定 /// - public WipBarcodeOther wipBarcodeOther { get; set; } + public IEnumerable wipBarcodeOthers { get; set; } /// /// 工單圖檔資料 diff --git a/AMESCoreStudio.Web/Views/PCS/PCS001N.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS001N.cshtml index ccb253dd..7cee96ef 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS001N.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS001N.cshtml @@ -158,7 +158,7 @@
- +
@@ -189,11 +189,11 @@
- +
- +
@@ -249,14 +249,7 @@
-
- -
-
-
-
- -
-
+
@@ -265,35 +258,27 @@
-
-
-
-
- -
- -
- - + +
- @foreach (var index in Model.wipMACs) + @foreach (var index in Model.wipBarcodeOthers) { } @@ -301,15 +286,7 @@
- MAC區間起 + 出貨區間起起 - MAC區間迄 + 出貨區間起迄
- @index.Title@index.StartNO + @index.StartNO - @index.Title@index.EndNO + @index.EndNO
- -
- -
- -
-
- @* Keypart組合sheet *@
新增 @@ -432,7 +409,7 @@ } // DIV 出貨序號 - if ($('#wipBarcodeOther_StartNO').val() != "" && $('#wipBarcodeOther_EndNO').val() != "") { + if ($('#wipBarcodeOtherCount').val() != "0") { $("#barcodeOtherDiv").hide(); } @@ -455,17 +432,13 @@ }); - // 產生出貨序號 + // 產生出貨序號 $("#GetBarcodeOther").click(function (event) { var itemNo = $('#wipAtt_ItemNO').val(); var planQTY = $('#wipInfo_PlanQTY').val(); var lotNo = $('#lotNo').val(); - var wipNo = $('#wipInfo_WipNO').val(); var wipShcDate = $('#wipInfo_WipScheduleDate').val().replace(/\//g, '-'); - if (wipNo == '' || !wipNo) { - parent.hg.msg("請輸入工單號碼"); - return; - } + if (itemNo == '' || !itemNo) { parent.hg.msg("請輸入料號"); return; @@ -474,35 +447,39 @@ parent.hg.msg("請確認計畫數量"); return; } + if (wipShcDate == '') { parent.hg.msg("請確認預計開工日期有填寫"); return; } + + if (lotNo == '' || !lotNo) { lotNo = getLotNo(); } - $.ajax({ - url: '@Url.Action("GetBarcodeOther", "PCS")', - dataType: 'json', - data: { "itemNo": itemNo, "lotNo": lotNo, "num": planQTY, "wipNo": wipNo, "wipShcDate": wipShcDate }, - 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(); + + $.ajax({ + url: '@Url.Action("GetBarcodeOther", "PCS")', + dataType: 'json', + data: { "itemNo": itemNo, "lotNo": lotNo, "num": planQTY, "wipNo": $('#wipInfo_WipNO').val(), "wipShcDate": wipShcDate }, + cache: false, + type: "POST", + success: function (result) { + // 錯誤訊息 + if (!result.success) { + parent.hg.msg(result.msg); + } + else { + var contactdiv = `${result.data.startNO}${result.data.endNO}`; + $('#wipBarcodeOtherTable').append(contactdiv); + $("#barcodeOtherDiv").hide(); + } + }, + error: function (jqXHR, textStatus, errorThrown) { + alert("Found error when using Ajax!!"); } - }, - error: function (jqXHR, textStatus, errorThrown) { - alert("Found error when using Ajax!!"); - } - }); + }); }); // 產生MAC diff --git a/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml index b98c0c34..b3d6451d 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS001R.cshtml @@ -263,13 +263,32 @@
-
- -
-
-
-
- -
+ + + + + + + + + + @foreach (var index in Model.wipBarcodeOthers) + { + + + + + } + +
+ 出貨區間起起 + + 出貨區間起迄 +
+ @index.StartNO + + @index.EndNO +
diff --git a/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml index 48774c7e..3dd8f4ba 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS003.cshtml @@ -27,9 +27,6 @@ -
@@ -266,18 +263,7 @@
-
- -
-
-
-
- -
-
- -
- -
+
@@ -286,6 +272,32 @@
+ + + + + + + + + + @foreach (var index in Model.wipBarcodeOthers) + { + + + + + } + +
+ 出貨區間起起 + + 出貨區間起迄 +
+ @index.StartNO + + @index.EndNO +
@@ -507,18 +519,9 @@
- - - + + +
@@ -534,10 +537,7 @@
- +
@@ -558,10 +558,7 @@
- +
@@ -574,10 +571,7 @@
- +
@@ -593,10 +587,7 @@
- +
@@ -904,10 +895,7 @@
- +
@@ -1023,8 +1011,8 @@ SOP文件敘述 @* - 檔案路徑 - *@ + 檔案路徑 + *@ SOP類型 @@ -1048,8 +1036,8 @@ @* - - *@ + + *@ @@ -1219,12 +1207,9 @@ } // DIV 出貨序號 - if ($('#wipBarcodeOther_StartNO').val() != "" && $('#wipBarcodeOther_EndNO').val() != "") { - $("#divDeleteBarcodeOther").show(); + if ($('#wipBarcodeOtherCount').val() != "0") { + $("#barcodeOtherDiv").hide(); } - else - $("#divDeleteBarcodeOther").hide(); - // DIV keyPartsExcel @if (Model.wipInfo.WipNO.StartsWith("981")) @@ -1280,40 +1265,9 @@ if (lotNo == '' || !lotNo) { lotNo = getLotNo(); } - var StartNO = $("#wipBarcodeOther_StartNO").val(); - var EndNO = $("#wipBarcodeOther_EndNO").val(); - - if (StartNO != '' && EndNO != '') { - layer.confirm('已有出貨序號起訖,要重新取得新的出貨序號起訖?', { - btn: ['確定', '取消'] - }, function () { - layer.closeAll('dialog'); - $.ajax({ - url: '@Url.Action("GetBarcodeOther", "PCS")', - dataType: 'json', - data: { "itemNo": itemNo, "lotNo": lotNo, "num": planQTY, "wipNo": '@Model.wipInfo.WipNO', "wipShcDate": wipShcDate }, - 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); - $("#divDeleteBarcodeOther").show(); - } - }, - error: function (jqXHR, textStatus, errorThrown) { - alert("Found error when using Ajax!!"); - } - }); - return; - }) - } - else { - $.ajax({ + + + $.ajax({ url: '@Url.Action("GetBarcodeOther", "PCS")', dataType: 'json', data: { "itemNo": itemNo, "lotNo": lotNo, "num": planQTY, "wipNo": '@Model.wipInfo.WipNO', "wipShcDate": wipShcDate }, @@ -1325,47 +1279,15 @@ parent.hg.msg(result.msg); } else { - $("#wipBarcodeOther_StartNO").val(result.data.startNO); - $("#wipBarcodeOther_EndNO").val(result.data.endNO); - $("#divDeleteBarcodeOther").show(); + var contactdiv = `${result.data.startNO}${result.data.endNO}`; + $('#wipBarcodeOtherTable').append(contactdiv); + $("#barcodeOtherDiv").hide(); } }, error: function (jqXHR, textStatus, errorThrown) { alert("Found error when using Ajax!!"); } }); - return; - } - }); - - // 刪除出貨序號 - $("#DeleteBarcodeOther").click(function (event) { - layer.confirm('確定是否要刪除出貨序號?', { - btn: ['確定', '取消'] - }, function () { - layer.closeAll('dialog'); - $.ajax({ - url: '@Url.Action("DeleteBarcodeOtherByWipNo", "PCS")', - dataType: 'json', - data: { "wipNo": '@Model.wipInfo.WipNO' }, - cache: false, - type: "POST", - success: function (result) { - // 錯誤訊息 - if (!result.success) { - parent.hg.msg(result.msg); - } - else { - $("#wipBarcodeOther_StartNO").val(''); - $("#wipBarcodeOther_EndNO").val(''); - $("#divDeleteBarcodeOther").hide(); - } - }, - error: function (jqXHR, textStatus, errorThrown) { - alert("出貨序號刪除失敗,請洽系統管理員!!"); - } - }); - }) }); // 產生MAC diff --git a/AMESCoreStudio.Web/Views/PCS/PCS034.cshtml b/AMESCoreStudio.Web/Views/PCS/PCS034.cshtml index 127b32e6..7fc2cc27 100644 --- a/AMESCoreStudio.Web/Views/PCS/PCS034.cshtml +++ b/AMESCoreStudio.Web/Views/PCS/PCS034.cshtml @@ -30,9 +30,7 @@ - +
@@ -268,14 +266,7 @@
-
- -
-
-
-
- -
-
+
@@ -284,6 +275,32 @@
+ + + + + + + + + + @foreach (var index in Model.wipBarcodeOthers) + { + + + + + } + +
+ 出貨區間起起 + + 出貨區間起迄 +
+ @index.StartNO + + @index.EndNO +
@@ -1172,7 +1189,7 @@ } // DIV 出貨序號 - if ($('#wipBarcodeOther_StartNO').val() != "" && $('#wipBarcodeOther_EndNO').val() != "") { + if ($('#wipBarcodeOtherCount').val() != "0") { $("#barcodeOtherDiv").hide(); } @@ -1195,12 +1212,13 @@ }); - // 產生出貨序號 + // 產生出貨序號 $("#GetBarcodeOther").click(function (event) { var itemNo = $('#wipAtt_ItemNO').val(); var planQTY = $('#wipInfo_PlanQTY').val(); var lotNo = $('#lotNo').val(); var wipShcDate = $('#wipInfo_WipScheduleDate').val().replace(/\//g, '-'); + if (itemNo == '' || !itemNo) { parent.hg.msg("請輸入料號"); return; @@ -1209,35 +1227,39 @@ parent.hg.msg("請確認計畫數量"); return; } + if (wipShcDate == '') { parent.hg.msg("請確認預計開工日期有填寫"); return; } + + if (lotNo == '' || !lotNo) { lotNo = getLotNo(); } - $.ajax({ - url: '@Url.Action("GetBarcodeOther", "PCS")', - dataType: 'json', - data: { "itemNo": itemNo, "lotNo": lotNo, "num": planQTY, "wipNo": '@Model.wipInfo.WipNO', "wipShcDate": wipShcDate }, - 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(); + + $.ajax({ + url: '@Url.Action("GetBarcodeOther", "PCS")', + dataType: 'json', + data: { "itemNo": itemNo, "lotNo": lotNo, "num": planQTY, "wipNo": '@Model.wipInfo.WipNO', "wipShcDate": wipShcDate }, + cache: false, + type: "POST", + success: function (result) { + // 錯誤訊息 + if (!result.success) { + parent.hg.msg(result.msg); + } + else { + var contactdiv = `${result.data.startNO}${result.data.endNO}`; + $('#wipBarcodeOtherTable').append(contactdiv); + $("#barcodeOtherDiv").hide(); + } + }, + error: function (jqXHR, textStatus, errorThrown) { + alert("Found error when using Ajax!!"); } - }, - error: function (jqXHR, textStatus, errorThrown) { - alert("Found error when using Ajax!!"); - } - }); + }); }); // 產生MAC