") ; } //悠訂單狀態 function changeStatus(orid){ var status = $('#status' orid).val(); if(status==null || status==undefined){ alert("狀態資訊不能為空!"); return; } $.post("DetailChange", { etype : 11, orid : orid, status : status orid : orid, status : status }, function (data) { if(parseInt(data) > 0) alert("狀態悠成功"); else alert("修改失敗"); }); } //用於檢查訂單詳情 function findOrderDetail(orid){ var urls = "FindOrderDetail.jsp?orid=" orid; window.open(urls,Detail.jsp?orid=" orid; window.open(urls,'newwindow' ,'height=400,width=600,top=100,left=200,toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no, status=no'); } //填入表格資料 function writeContent(data){ // alert(data); var content = data.Orders; $('#contentList').empty(); $('#contentList').append("
" "
購買編號
" "
經手人
" "
訂單日期
" "
備註
" "
狀態
" "
操作1
" "
操作2
" "
"); $.each(content,function(idx, item) { var tdc = "
" "
" String(item.orid) "
" "
" String(item.wname) "" "
" String(item.date) "
" "
" String(item.remark) "
" "
" "
" "
" "
"; // alert( tdc); $('#contentList').append(tdc); }); } //用於頁頁跳轉 function findPage(pageId){ var curstatus = $('#orderstatus').val(); $.post("AllCheckAction", { executetype : 5, page : pageId, orderstatus : curstatus, pagerows :1 }, function(data) { var contents = data.ContentBody; $.each(contents,function(id, ite) { var curpage = ite. page; var wholePages = ite.wholepage; con = ite.searchtext; $.post("AllCheckAction", { executetype : 6, scondition : con } ,function(data2){ writeContent(data2); },"json"); writePageList(curpage,wholePages); }); }, "json");
} //查詢按鈕呼叫 function firstFindPage(pageId){ findPage(pageId); } //用於頁面跳轉回應邏輯處理,即直接由輸入頁進地跳轉 function gotoPage(){ var ppage = $('#ppage').val(); var maxpage = $('#wholepages').innerHTML ; //numint()函數判斷是否為數字 if(ppage == null || ppage == undefined || (!numint(ppage))){ alert("無效的頁碼! "); return; } if(parseInt(ppage)>parseInt(maxpage) || parseInt(ppage)alert("請求頁不存在頁碼!") ; return; } findPage(ppage); }; //判斷是否為整數 function numint(value) { var p = "0123456789" ; for ( var i = 0; i var num = p.indexOf(value.charAt(i)); if (num return false; } } return true; }