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("100","100"); //column align var colAlignArgs_do = new Array("center","center"); //column sort var colSortArgs_do = new Array("str","str"); //column type var colTypeArgs_do = new Array("ro","ro"); commonGridObj_do = new TGridCommon("mygrid_container_payappdo","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(); commonGridObj_do.getGridObj().enableEditEvents(true,false,true); var totalCache = $("h_total").value; var totalObj = eval('(' + totalCache + ')'); if (totalObj.totals[0].totalrmb == 0 && totalObj.totals[0].totalusd == 0) { var newId = commonGridObj_do.newGuid(); var rowCount = commonGridObj_do.getGridObj().getRowsNum(); commonGridObj_do.getGridObj().addRow(newId, ["RMB", totalObj.totals[0].totalrmb], rowCount); } else { if (totalObj.totals[0].totalrmb != 0) { var newId = commonGridObj_do.newGuid(); var rowCount = commonGridObj_do.getGridObj().getRowsNum(); commonGridObj_do.getGridObj().addRow(newId, ["RMB", totalObj.totals[0].totalrmb], rowCount); } if (totalObj.totals[0].totalusd != 0) { var newId = commonGridObj_do.newGuid(); var rowCount = commonGridObj_do.getGridObj().getRowsNum(); commonGridObj_do.getGridObj().addRow(newId, ["USD", totalObj.totals[0].totalusd], rowCount); } } // var tempCache = $("h_feecache").value; // // //alert(tempCache); // jsonCacheObj = eval('(' + tempCache + ')'); // // var totalFee = 0.0; // // var totalRmbFee = 0.0;//RMB费用合计 // var totalUsdFee = 0.0;//USD费用合计 // var totalOtherFee = 0.0;//其他费用合计 // // var customerName = ""; // if(jsonCacheObj.caches.length > 0){ // // for(var i=0;i 0){ // totalFee += totalRmbFee; // } // commonGridObj_do.getGridObj().addRow(newId,["RMB",totalFee],0); // //commonGridObj_do.bind(); // // //// for(var k=0;k 0){ // totalFee += totalUsdFee; // } // //alert(totalFee); // commonGridObj_do.getGridObj().addRow(newId,["USD",totalFee],0); // //commonGridObj_do.bind(); // //// for(var k=0;k 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; } } function dialog() { this.width=450; this.height=360; this.title_height=20; this.html=''; this.title=''; var self = this; var bgObj,msgObj,titleObj; this.close=function() { document.body.removeChild(document.getElementById("bgDiv")); document.getElementById("msgDiv").removeChild(document.getElementById("msgTitle")); document.body.removeChild(document.getElementById("msgDiv")); } this.show=function() { var msgw,msgh,bordercolor; msgw=self.width; msgh=self.height; bordercolor="#336699"; titlecolor="#99CCFF"; var sWidth,sHeight; sWidth=document.body.offsetWidth; sHeight=screen.height; bgObj=document.createElement("div"); bgObj.setAttribute('id','bgDiv'); bgObj.style.position="absolute"; bgObj.style.top="0"; bgObj.style.background="#777"; bgObj.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=75"; bgObj.style.opacity="0.6"; bgObj.style.left="0"; bgObj.style.width=sWidth + "px"; bgObj.style.height=sHeight + "px"; bgObj.style.zIndex = "10000"; document.body.appendChild(bgObj); msgObj=document.createElement("div") msgObj.setAttribute("id","msgDiv"); msgObj.setAttribute("align","center"); msgObj.style.background="white"; msgObj.style.border="1px solid " + bordercolor; msgObj.style.position = "absolute"; msgObj.style.left = "50%"; msgObj.style.top = "30%"; msgObj.style.font="12px/1.6em Verdana, Geneva, Arial, Helvetica, sans-serif"; msgObj.style.marginLeft = "-225px" ; msgObj.style.marginTop = -75+document.documentElement.scrollTop+"px"; msgObj.style.width = msgw + "px"; msgObj.style.height =msgh + "px"; msgObj.style.textAlign = "center"; msgObj.style.lineHeight ="25px"; msgObj.style.zIndex = "10001"; titleObj=document.createElement("h4"); titleObj.setAttribute("id","msgTitle"); titleObj.setAttribute("align","center"); titleObj.style.margin="0"; titleObj.style.padding="3px"; titleObj.style.background=bordercolor; titleObj.style.filter="progid:DXImageTransform.Microsoft.Alpha(startX=20, startY=20, finishX=100, finishY=100,style=1,opacity=75,finishOpacity=100);"; titleObj.style.opacity="0.75"; titleObj.style.border="1px solid " + bordercolor; titleObj.style.height=self.title_height+"px"; titleObj.style.font="12px Verdana, Geneva, Arial, Helvetica, sans-serif"; titleObj.style.color="white"; titleObj.style.cursor="pointer"; titleObj.innerHTML=self.title; //titleObj.onclick=function(){self.close();} document.body.appendChild(msgObj); document.getElementById("msgDiv").appendChild(titleObj); var txt=document.createElement("div"); txt.style.margin="1em 0" txt.setAttribute("id","msgTxt"); txt.innerHTML=self.html; document.getElementById("msgDiv").appendChild(txt); } } function msgBox(){ var dg=new dialog(); dg.html="正在保存中,请稍等……";//""; dg.width=200; dg.height=100; dg.title=""; dg.show(); } function openAction(strGID) { window.parent.opener.location.href = window.parent.opener.location.href; // var openSet = "height=520, width=1100, toolbar=no, menubar=no,scrollbars=no, resizable=no,location=no, status=no,Top= " + (screen.height - 520) / 2 + ",Left= " + (screen.width - 1100) / 2 var openType = "_blank"; var checkType = 0; var openUrl = "PaySettleApplicationEdit.aspx?handle=edit&id=" + strGID + "&checktype=2"; window.open(openUrl, openType, openSet); // window.close(); } function closeAction() { window.parent.opener.location.href = window.parent.opener.location.href; window.close(); } function refresh() { closeAction(); }