diff --git a/AMESCoreStudio.Web/Views/SPC/SPC005C.cshtml b/AMESCoreStudio.Web/Views/SPC/SPC005C.cshtml index 68310c8e..df9b8b89 100644 --- a/AMESCoreStudio.Web/Views/SPC/SPC005C.cshtml +++ b/AMESCoreStudio.Web/Views/SPC/SPC005C.cshtml @@ -121,15 +121,12 @@ var ItemNo = $("#ItemNo").val(); var BarcodeNo = $("#BarcodeNo").val(); if (!WipNo) { - alert('請填寫工單!!'); return false; } else if (!ItemNo) { - alert('請填寫料號!!'); return false; } else if (!BarcodeNo) { - alert('請填寫生產序號!!'); return false; } else @@ -141,15 +138,12 @@ var ItemNo = $("#ItemNo").val(); var BarcodeNo = $("#BarcodeNo").val(); if (!WipNo) { - alert('請填寫工單!!'); return false; } else if (!ItemNo) { - alert('請填寫料號!!'); return false; } else if (!BarcodeNo) { - alert('請填寫生產序號!!'); return false; } else @@ -302,33 +296,109 @@ } } } - $('#WipNo').focusout(function () { - var data = $("#WipNo").val(); - if (data) { - $.ajax({ - url: "/SPC/GetWipAtt", - dataType: 'json', - data: { id: data }, - contentType: "application/json", - type: 'get', - success: function (result) { - if (result.data) { - //console.info(result.data);//確認itemNO/modelNO - $("#ItemNo").val(result.data.itemNO); - } - else { + //$('#WipNo').focusout(function () { + + // var data = $("#WipNo").val(); + // if (data) { + // $.ajax({ + // url: "/SPC/GetWipAtt", + // dataType: 'json', + // data: { id: data }, + // contentType: "application/json", + // type: 'get', + // success: function (result) { + // if (result.data) { + // //console.info(result.data);//確認itemNO/modelNO + // $("#ItemNo").val(result.data.itemNO); + // } + // else { + // alert("查無資料,請確認工單是否正確!"); + // } + // }, + // error: function () { + // alert("查無資料,請確認工單是否正確!"); + // } + // }); + // } else { + // alert("請填寫工單!"); + // } + // + //}); + //BarcodeNo + $("#WipNo").keypress(function (e) { + + if (code == 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) { + //console.info(result.data);//確認itemNO/modelNO + $("#ItemNo").val(result.data.itemNO); + //BarcodeNo + $('#BarcodeNo').focus(); + } + else { + alert("查無資料,請確認工單是否正確!"); + $("#WipNo").val(""); + $('#WipNo').focus(); + return false; + } + }, + error: function () { alert("查無資料,請確認工單是否正確!"); + return false; } - }, - error: function () { - alert("查無資料,請確認工單是否正確!"); - } - }); - } else { - alert("請填寫工單!"); + }); + } 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; + } + + } + + }); + + $("#BarcodeNo").keypress(function (e) { + + if (code == 13) { + + var data = $("#WipNo").val(); + if (!data) { + alert("請填寫工單!"); + $('#WipNo').focus(); + return false; + } + + } + + }); + layui.use(['form', 'layer', 'table', 'laytpl', 'laydate'], function () { var layer = layui.layer, $ = layui.jquery, diff --git a/AMESCoreStudio.Web/Views/SPC/SPC005U.cshtml b/AMESCoreStudio.Web/Views/SPC/SPC005U.cshtml index 55900896..796325c3 100644 --- a/AMESCoreStudio.Web/Views/SPC/SPC005U.cshtml +++ b/AMESCoreStudio.Web/Views/SPC/SPC005U.cshtml @@ -108,15 +108,12 @@ var ItemNo = $("#ItemNo").val(); var BarcodeNo = $("#BarcodeNo").val(); if (!WipNo) { - alert('請填寫工單!!'); return false; } else if (!ItemNo) { - alert('請填寫料號!!'); return false; } else if (!BarcodeNo) { - alert('請填寫生產序號!!'); return false; } else @@ -129,15 +126,12 @@ var BarcodeNo = $("#BarcodeNo").val(); if (!WipNo) { - alert('請填寫工單!!'); return false; } else if (!ItemNo) { - alert('請填寫料號!!'); return false; } else if (!BarcodeNo) { - alert('請填寫生產序號!!'); return false; } else @@ -280,29 +274,7 @@ } } } - //$('#WipNo').focusout(function () { - // var data = $("#WipNo").val(); - // if (data) { - // $.ajax({ - // url: "/WHS/GetWipAtt", - // dataType: 'json', - // data: { id: data }, - // contentType: "application/json", - // type: 'get', - // success: function (result) { - // if (result.data) { - // $("#ItemNo").val(result.data.modelNO); - // } - // else { - // alert("查無資料,請確認工單是否正確!"); - // } - // } - // }); - // } else { - // alert("請填寫工單!"); - // } - // - //}); + layui.use(['form', 'layer', 'table', 'laytpl', 'laydate'], function () { var layer = layui.layer, $ = layui.jquery, diff --git a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.Views.dll b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.Views.dll index 4ca6e427..8239f44b 100644 Binary files a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.Views.dll and b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.Views.dll differ diff --git a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.Views.pdb b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.Views.pdb index 6154f658..370dd91a 100644 Binary files a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.Views.pdb and b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.Views.pdb differ diff --git a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.dll b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.dll index 91d2a7e9..b5d93113 100644 Binary files a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.dll and b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.dll differ diff --git a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.pdb b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.pdb index 359fc6da..996837eb 100644 Binary files a/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.pdb and b/AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.pdb differ