var commonGridObj_invoice; function $(id) { return document.getElementById(id); } function checkAll() { if (commonGridObj_invoice != null) { for (var i = 0; i < commonGridObj_invoice.getGridObj().getRowsNum(); i++) { var rowId = commonGridObj_invoice.getGridObj().getRowId(i); var rowIndex = commonGridObj_invoice.getGridObj().getRowIndex(rowId); if ($("ck_all").checked) { commonGridObj_invoice.getGridObj().cellByIndex(rowIndex, 0).setValue(1); } else { commonGridObj_invoice.getGridObj().cellByIndex(rowIndex, 0).setValue(0); } } } } function createGrid(){ //header var headerArgs_invoice = new Array("","申请编号","申请状态","发票号码","客户名称","发票抬头","申请金额","币别","申请人","申请时间","开出人","开出时间"); //width var widthArgs_invoice = new Array("40","150","120","120","150","200","100","70","100","150","100","150"); //column align var colAlignArgs_invoice = new Array("center","center","center","center","center","center","center","center","center","center","center","center"); //column sort var colSortArgs_invoice = new Array("na","str","str","str","str","str","str","str","str","str","str","str"); //column type var colTypeArgs_invoice = new Array("ch","ro","ro","ro","ro","ro","ro","ro","ro","ro","ro","ro"); commonGridObj_invoice = new TGridCommon("mygrid_container_invoice","form1",headerArgs_invoice,widthArgs_invoice,colAlignArgs_invoice,colSortArgs_invoice,colTypeArgs_invoice); commonGridObj_invoice.setResponseUrl("InvoiceApplicationGridSource.aspx"); commonGridObj_invoice.setRequest("InvoiceApplicationGridSource.aspx?handle=makeoutapp"); commonGridObj_invoice.setSourceType("json"); commonGridObj_invoice.setSkin("xp"); commonGridObj_invoice.setImageUrl("../images/"); commonGridObj_invoice.initGrid(); commonGridObj_invoice.bind(); // commonGridObj_invoice.getGridObj().attachEvent("onEditCell",function(stage,rId,cInd,nValue,oValue){ // if(stage == 0){ // return false; // } // }); // commonGridObj_invoice.getGridObj().attachEvent("onRowDblClicked", function(rId,cInd){ // var rId = commonGridObj_invoice.getGridObj().getSelectedRowId(); // var openSet = "height=270, width=500, toolbar=no, menubar=no,scrollbars=no, resizable=1,location=no, status=no,Top= " +(screen.height-710)/2 + ",Left= "+(screen.width-800)/2 // var openType = "_blank"; // // var openUrl = "Edit.aspx?flowid="+rId+"&handle=edit"; // window.open (openUrl,openType,openSet); // }); } //开出发票 function makeOutInvoice(){ var iCount = 0; var selRowID = ""; if(commonGridObj_invoice != null){ for(var i = 0;i 1){ alert("每次只能处理一条开票申请,请重新选择"); selRowID = ""; return; }else if(iCount > 0){ var openSet = "height=490, width=820, toolbar=no, menubar=no,scrollbars=no, resizable=no,location=no, status=no,Top= " +(screen.height-490)/2 + ",Left= "+(screen.width-820)/2 var openType = "_blank"; var openUrl = "InvoiceMakeOutModify.aspx?handle=makeout&id="+selRowID; window.open (openUrl,openType,openSet); }else{ alert("您没有选择要开票的申请"); } } //驳回发票申请 function rejectApplication(){ var iCount = 0; if(commonGridObj_invoice != null){ for(var i = 0;i