var commonGridObj_settlementedit; var comboCustomer;//委托单位 //var comboBank;//开户银行 //var comboAccount;//银行账户 //var comboCurrency;//币别 var comboSettleType;//结算方式 function $(id){ return document.getElementById(id); } function getObj(strClassName){ var tagArgs=document.getElementsByTagName("div"); var resultObj = null; for(var i = 0;i 0){ for(var i=0;i"; result += "
"; result += "
委托方式
"; result += "
主提单号
"; result += "
分提单号
"; result += "
委托编号
"; result += "
录入人
"; result += "
录入时间
"; var jsonCacheObj = null; var tempCache = ""; tempCache = $("h_opcache").value; //var dvOpSeae = getObj("row"); //var dvBottom = getObj("row lastrow"); var dvTable = getObj("table"); //var result = ""; //var bottomResult = ""; if(tempCache != null){ jsonCacheObj = eval('(' + tempCache + ')'); if(jsonCacheObj.opinfo.length){ if(jsonCacheObj.opinfo.length == 1){ result += "
" result += "
+
"; result += "
"+jsonCacheObj.opinfo[0].bsno+"
"; result += "
"+jsonCacheObj.opinfo[0].bsstatus+"
"; result += "
"+jsonCacheObj.opinfo[0].mblno+"
"; result += "
"+jsonCacheObj.opinfo[0].hblno+"
"; result += "
"+jsonCacheObj.opinfo[0].custno+"
"; result += "
"+jsonCacheObj.opinfo[0].inputby+"
"; result += "
"+jsonCacheObj.opinfo[0].ctime+"
"; result += "
"; // dvOpSeae.style.display = "none"; // dvBottom.innerHTML = bottomResult; }else{ for(var i = 0;i" result += "
+
"; result += "
"+jsonCacheObj.opinfo[i].bsno+"
"; result += "
"+jsonCacheObj.opinfo[i].bsstatus+"
"; result += "
"+jsonCacheObj.opinfo[i].mblno+"
"; result += "
"+jsonCacheObj.opinfo[i].hblno+"
"; result += "
"+jsonCacheObj.opinfo[i].custno+"
"; result += "
"+jsonCacheObj.opinfo[i].inputby+"
"; result += "
"+jsonCacheObj.opinfo[i].ctime+"
"; result += ""; }else{ result += "
" result += "
+
"; result += "
"+jsonCacheObj.opinfo[i].bsno+"
"; result += "
"+jsonCacheObj.opinfo[i].bsstatus+"
"; result += "
"+jsonCacheObj.opinfo[i].mblno+"
"; result += "
"+jsonCacheObj.opinfo[i].hblno+"
"; result += "
"+jsonCacheObj.opinfo[i].custno+"
"; result += "
"+jsonCacheObj.opinfo[i].inputby+"
"; result += "
"+jsonCacheObj.opinfo[i].ctime+"
"; result += "
"; } } //dvOpSeae.innerHTML = result; } //result += ""; dvTable.innerHTML = result; } } } function createGrid(){ //header var headerArgs_settlementedit = new Array("","收/付","费用名称","结算单位","计费标准","单价","数量","金额","币别","汇率","结算金额","未结算金额"); //width var widthArgs_settlementedit = new Array("40","40","120","120","70","80","80","80","70","70","80","80"); //column align var colAlignArgs_settlementedit = new Array("center","center","center","center","center","center","center","center","center","center","center","center"); //column sort var colSortArgs_settlementedit = new Array("na","str","str","str","str","str","str","str","str","str","str","str"); //column type var colTypeArgs_settlementedit = new Array("ch","ro","ro","ro","ro","ro","ro","ro","ro","ro","ro","ro"); commonGridObj_settlementedit = new TGridCommon("mygrid_container_fee","form1",headerArgs_settlementedit,widthArgs_settlementedit,colAlignArgs_settlementedit,colSortArgs_settlementedit,colTypeArgs_settlementedit); commonGridObj_settlementedit.setResponseUrl("SettlementGridSourceApp.aspx"); var settleGID = $("h_settlementid").value; var settleBSNO = $("h_bsno").value; commonGridObj_settlementedit.setRequest("SettlementGridSourceApp.aspx?handle=settleeditfee&settlementid="+settleGID+"&bsno="+settleBSNO); commonGridObj_settlementedit.setSourceType("json"); commonGridObj_settlementedit.setSkin("xp"); commonGridObj_settlementedit.setImageUrl("../images/"); commonGridObj_settlementedit.initGrid(); commonGridObj_settlementedit.bind(); commonGridObj_settlementedit.getGridObj().attachEvent("onEditCell",function(stage,rId,cInd,nValue,oValue){ if(stage == 0){ if(cInd == 2 || cInd == 3){ return false; }else{ return true; } } }); } function initComboCustomer(){ comboCustomer = dhtmlXComboFromSelect("sel_customer"); } //function initComboBank(){ // comboBank = dhtmlXComboFromSelect("sel_bank"); //} function initComboSettleType(){ comboSettleType = dhtmlXComboFromSelect("sel_settletype"); } //function initComboAccount(){ // comboAccount = dhtmlXComboFromSelect("sel_account"); //} //function initComboCurrency(){ // comboCurrency = dhtmlXComboFromSelect("sel_currency"); //} //function createComboCurrency(){ // if($("h_currency").value.trim() != ""){ // comboCurrency.setComboText($("h_currency").value); // comboCurrency.disable(true); // } //} function createComboSettleType(){ if($("h_settletype").value.trim() != ""){ comboSettleType.setComboValue($("h_settletype").value); comboSettleType.disable(true); } } //function createComboBank(){ // if($("h_bank").value.trim() != ""){ // comboBank.setComboText($("h_bank").value); // comboBank.disable(true); // } //} //function createComboAccount(){ // if($("h_account").value.trim() != ""){ // comboAccount.setComboText($("h_account").value); // comboAccount.disable(true); // } //} function createComboCustomer(){ if ($("txt_customerName").value.trim() != "") { comboCustomer.setComboText($("txt_customerName").value); comboCustomer.disable(true); } } function printSettlement(){ var strBillNO = ""; var typeName = ""; strBillNO = $("h_billno").value; if(strBillNO.trim() != ""){ var printUrl = ""; var companyID = ""; var typeName = "RECVSETTLE"; var dbSourceID = ""; var userID = ""; var url = ""; url = "../Reports/ReportService.aspx?handle=printrecvsettle&billno="+strBillNO+"&val="+newGuid(); typeName = "RECVSETTLE"; var loader = dhtmlxAjax.getSync(url); var reportVal = loader.xmlDoc.responseText; var reportObj = null; if(reportVal != ""){ reportObj = eval('(' + reportVal + ')'); if(reportObj.reports.length > 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,""); } //获取GUID 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(); } function cancelSettle(){ var strBillNO = ""; strBillNO = $("h_billno").value; if (strBillNO.trim() != "") { var url = "SettlementGridSourceApp.aspx?handle=cancelrecvsettle&billno="+strBillNO+"&uid="+newGuid(); var loader = dhtmlxAjax.getSync(url); var stateInfo = loader.xmlDoc.responseText; var state = parseInt(stateInfo); if (state == 1) { alert("收费结算撤销完成"); window.parent.opener.location.href = window.parent.opener.location.href; window.close(); } else if (state == -3) { alert("收费结算撤销已完成,不能重复操作"); window.parent.opener.location.href = window.parent.opener.location.href; window.close(); } else if (state == -4) { alert("收费结算信息不存在"); window.parent.opener.location.href = window.parent.opener.location.href; window.close(); } else if (state == -5) { alert("此“预付支资料”已使用,不允许操作!请先删除已使用的“预付支取用资料”!"); } else if (state == -6) { alert("已生成结算凭证,不允许操作!请先删除已生成的“结算凭证”!"); } } else { alert("费用未结算,不能进行撤销操作"); } } function saveRecvChange3() { if ($("h_isAccess").value.trim() == "1") { $("h_enter").value = "1"; var fhz = saveRecvChange2(); if (fhz > -1)// && $("recvContainer_2").value != "" { msgBox(); setTimeout(postEnter, 200); } } } function msgBox() { var dg = new dialog(); dg.html = "正在保存中,请稍等……"; //""; dg.width = 200; dg.height = 100; dg.title = ""; dg.show(); } 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); } }