Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- $(document).ready(function () {
- $("#TxtBarcode").keypress(function (event) {
- if (event.keyCode == 13) {
- var DeliveryRegion = $('#DeliveryRegion').combobox('getValue');
- if (!DeliveryRegion) {
- alert("收貨地需指定!");
- // focus 指定到條碼輸入 input
- document.getElementById("TxtBarcode").focus();
- return;
- }
- var t = '';
- var Barcode = $('input[name="TxtBarcode"]').val().toUpperCase();
- // 上傳到Server更改狀態後回傳JSON
- if (Barcode) {
- $.ajax({
- type: "POST",
- url: '../handler/jqDataHandle.ashx?RemoteName=s_bf_carm_zslz.CARM_ZSLZ',
- data: "mode=method&method=" + "SetDeliveryData" + "¶meters=" + DeliveryRegion + ";" + Barcode,
- cache: false, async: false,
- success: function (data) {
- t = data;
- }
- });
- }
- $('input[name="TxtBarcode"]').val("");
- if (t == "NotConfirm") {
- alert("輸入的條碼(" + Barcode + ")未車載,不可對碰!");
- $('input[name="TxtBarcode"]').val("");
- // focus 指定到條碼輸入 input
- document.getElementById("TxtBarcode").focus();
- return false;
- }
- if (t == "NoData") {
- alert("輸入的條碼(" + Barcode + ")找不到對應的資料!");
- $('input[name="TxtBarcode"]').val("");
- // focus 指定到條碼輸入 input
- document.getElementById("TxtBarcode").focus();
- return false;
- }
- if (t == "Duplicate") {
- alert("輸入的條碼(" + Barcode + ")已經對碰過!");
- $('input[name="TxtBarcode"]').val("");
- // focus 指定到條碼輸入 input
- document.getElementById("TxtBarcode").focus();
- return false;
- }
- query('#dataGridMaster');
- // focus 指定到條碼輸入 input
- document.getElementById("TxtBarcode").focus();
- return true;
- }
- });
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement