Browse Source

修改IPQC表單新增時輸入框Enter後邏輯順序

PTD
Shani 3 years ago
parent
commit
592034f205
  1. 126
      AMESCoreStudio.Web/Views/SPC/SPC005C.cshtml
  2. 30
      AMESCoreStudio.Web/Views/SPC/SPC005U.cshtml
  3. BIN
      AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.Views.dll
  4. BIN
      AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.Views.pdb
  5. BIN
      AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.dll
  6. BIN
      AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.pdb

126
AMESCoreStudio.Web/Views/SPC/SPC005C.cshtml

@ -121,15 +121,12 @@
var ItemNo = $("#ItemNo").val(); var ItemNo = $("#ItemNo").val();
var BarcodeNo = $("#BarcodeNo").val(); var BarcodeNo = $("#BarcodeNo").val();
if (!WipNo) { if (!WipNo) {
alert('請填寫工單!!');
return false; return false;
} }
else if (!ItemNo) { else if (!ItemNo) {
alert('請填寫料號!!');
return false; return false;
} }
else if (!BarcodeNo) { else if (!BarcodeNo) {
alert('請填寫生產序號!!');
return false; return false;
} }
else else
@ -141,15 +138,12 @@
var ItemNo = $("#ItemNo").val(); var ItemNo = $("#ItemNo").val();
var BarcodeNo = $("#BarcodeNo").val(); var BarcodeNo = $("#BarcodeNo").val();
if (!WipNo) { if (!WipNo) {
alert('請填寫工單!!');
return false; return false;
} }
else if (!ItemNo) { else if (!ItemNo) {
alert('請填寫料號!!');
return false; return false;
} }
else if (!BarcodeNo) { else if (!BarcodeNo) {
alert('請填寫生產序號!!');
return false; return false;
} }
else else
@ -302,33 +296,109 @@
} }
} }
} }
$('#WipNo').focusout(function () { //$('#WipNo').focusout(function () {
var data = $("#WipNo").val();
if (data) { // var data = $("#WipNo").val();
$.ajax({ // if (data) {
url: "/SPC/GetWipAtt", // $.ajax({
dataType: 'json', // url: "/SPC/GetWipAtt",
data: { id: data }, // dataType: 'json',
contentType: "application/json", // data: { id: data },
type: 'get', // contentType: "application/json",
success: function (result) { // type: 'get',
if (result.data) { // success: function (result) {
//console.info(result.data);//確認itemNO/modelNO // if (result.data) {
$("#ItemNo").val(result.data.itemNO); // //console.info(result.data);//確認itemNO/modelNO
} // $("#ItemNo").val(result.data.itemNO);
else { // }
// 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("查無資料,請確認工單是否正確!"); alert("查無資料,請確認工單是否正確!");
return false;
} }
}, });
error: function () { } else {
alert("查無資料,請確認工單是否正確!"); alert("請填寫工單!");
} return false;
}); }
} else {
alert("請填寫工單!");
} }
}); });
$("#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 () { layui.use(['form', 'layer', 'table', 'laytpl', 'laydate'], function () {
var layer = layui.layer, var layer = layui.layer,
$ = layui.jquery, $ = layui.jquery,

30
AMESCoreStudio.Web/Views/SPC/SPC005U.cshtml

@ -108,15 +108,12 @@
var ItemNo = $("#ItemNo").val(); var ItemNo = $("#ItemNo").val();
var BarcodeNo = $("#BarcodeNo").val(); var BarcodeNo = $("#BarcodeNo").val();
if (!WipNo) { if (!WipNo) {
alert('請填寫工單!!');
return false; return false;
} }
else if (!ItemNo) { else if (!ItemNo) {
alert('請填寫料號!!');
return false; return false;
} }
else if (!BarcodeNo) { else if (!BarcodeNo) {
alert('請填寫生產序號!!');
return false; return false;
} }
else else
@ -129,15 +126,12 @@
var BarcodeNo = $("#BarcodeNo").val(); var BarcodeNo = $("#BarcodeNo").val();
if (!WipNo) { if (!WipNo) {
alert('請填寫工單!!');
return false; return false;
} }
else if (!ItemNo) { else if (!ItemNo) {
alert('請填寫料號!!');
return false; return false;
} }
else if (!BarcodeNo) { else if (!BarcodeNo) {
alert('請填寫生產序號!!');
return false; return false;
} }
else 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 () { layui.use(['form', 'layer', 'table', 'laytpl', 'laydate'], function () {
var layer = layui.layer, var layer = layui.layer,
$ = layui.jquery, $ = layui.jquery,

BIN
AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.Views.dll

Binary file not shown.

BIN
AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.Views.pdb

Binary file not shown.

BIN
AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.dll

Binary file not shown.

BIN
AMESCoreStudio.Web/bin/Debug/netcoreapp3.1/AMESCoreStudio.Web.pdb

Binary file not shown.
Loading…
Cancel
Save