var commonGridObj_do; var jsonCacheObj; function $(id){ return document.getElementById(id); } function createGrid(){ //header var headerArgs_do = new Array("币别","金额","入账账户"); //width var widthArgs_do = new Array("70","80","400"); //column align var colAlignArgs_do = new Array("center","center","center"); //column sort var colSortArgs_do = new Array("str","str","str"); //column type var colTypeArgs_do = new Array("ro","ro","co"); commonGridObj_do = new TGridCommon("mygrid_container_do","form1",headerArgs_do,widthArgs_do,colAlignArgs_do,colSortArgs_do,colTypeArgs_do); commonGridObj_do.setResponseUrl("SettlementGridSourceApp.aspx"); //var _billno = $("billno").value; commonGridObj_do.setRequest("SettlementGridSourceApp.aspx?handle=billlist&billno="+1); commonGridObj_do.setSourceType("json"); commonGridObj_do.setSkin("xp"); commonGridObj_do.setImageUrl("../images/"); commonGridObj_do.initGrid(); commonGridObj_do.bind(); setTimeout(function(){ if($("h_settleinfo").value != ""){ var tempSettleInfo = $("h_settleinfo").value; jsonSettleObj = eval('(' + tempSettleInfo + ')'); var isRun = false; for(var i=0;i < commonGridObj_do.getGridObj().getRowsNum();i++){ var rowId = commonGridObj_do.getGridObj().getRowId(i); var rowIndex = commonGridObj_do.getGridObj().getRowIndex(rowId); for(var j = 0;j 0){ for(var i=0;i 0){ if(reportObj.reports[0].compid != ""){ companyID = reportObj.reports[0].compid; } if(reportObj.reports[0].sourceid != ""){ dbSourceID = reportObj.reports[0].sourceid; } if(reportObj.reports[0].compid != ""){ userID = reportObj.reports[0].userid; } printUrl = "print://?comp="+companyID+"&type="+typeName+"&dbid="+dbSourceID+"&uid="+userID;//alert(printUrl); window.location.href = window.location.href; location.href = printUrl; } }else{ alert("没有要打印的报表"); return; } }else{ alert("费用未结算不能打印"); return; } } String.prototype.trim = function() { return this.replace(/(^\s*)|(\s*$)/g,""); } function closeAction() { window.parent.opener.location.href = window.parent.opener.location.href; window.close(); } function refresh() { closeAction(); } function cwvouchersadd(gid) { var url = "../CW/CwVouchersChFeeSettlementListGridSource.aspx?handle=isvouchers&gids=" + gid + "&uid=" + newGuid(); var loader = dhtmlxAjax.getSync(url); var jsVal = loader.xmlDoc.responseText; if (jsVal.trim() != "") { alert(jsVal); //"有已生成的凭证,不能重复生成!" return; } // var url = "../CW/CwVouchersAddDoGridSource.aspx?read=isvouchers&gids=" + gid + "&uid=" + newGuid(); var loader = dhtmlxAjax.getSync(url); var jsVal = loader.xmlDoc.responseText; if (jsVal.trim() == "") { alert("生成凭证失败!"); //"有已生成的凭证,不能重复生成!" return; } // var feature = "height=500, width=1000, toolbar=no, menubar=no,scrollbars=no, resizable=0,location=no, status=no,Top= " + (screen.height / 2 - 300) + ",Left= " + (screen.width / 2 - 500); var URLs = "../CW/CwVouchersAddDo.aspx?ordno=" + jsVal; window.open(URLs, "生成结算凭证信息", feature); } function newGuid() { var guid = ""; for (var i = 1; i <= 32; i++) { var n = Math.floor(Math.random() * 16.0).toString(16); guid += n; if ((i == 8) || (i == 12) || (i == 16) || (i == 20)) guid += "-"; } return guid.toUpperCase(); }