var commonGridObj_invoiceedit; var comboCustomer;//委托单位 var comboBank;//开户银行 var comboAccount;//银行账户 var comboCurrency;//币别 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_invoiceedit = new Array("","收/付","费用名称","结算单位","计费标准","单价","数量","金额","币别","汇率","开票金额","未开票金额"); //width var widthArgs_invoiceedit = new Array("40","40","120","120","70","80","80","80","70","70","80","80"); //column align var colAlignArgs_invoiceedit = new Array("center","center","center","center","center","center","center","center","center","center","center","center"); //column sort var colSortArgs_invoiceedit = new Array("na","str","str","str","str","str","str","str","str","str","str","str"); //column type var colTypeArgs_invoiceedit = new Array("ch","ro","ro","ro","ro","ro","ro","ro","ro","ro","ro","ro"); commonGridObj_invoiceedit = new TGridCommon("mygrid_container_fee","form1",headerArgs_invoiceedit,widthArgs_invoiceedit,colAlignArgs_invoiceedit,colSortArgs_invoiceedit,colTypeArgs_invoiceedit); commonGridObj_invoiceedit.setResponseUrl("InvoiceApplicationGridSource.aspx"); var invoiceGID = $("h_invoiceid").value; var invoiceBSNO = $("h_bsno").value; commonGridObj_invoiceedit.setRequest("InvoiceApplicationGridSource.aspx?handle=invoiceeditfee&invoiceid="+invoiceGID+"&bsno="+invoiceBSNO); commonGridObj_invoiceedit.setSourceType("json"); commonGridObj_invoiceedit.setSkin("xp"); commonGridObj_invoiceedit.setImageUrl("../images/"); commonGridObj_invoiceedit.initGrid(); commonGridObj_invoiceedit.bind(); commonGridObj_invoiceedit.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 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 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($("h_invoicecus").value.trim() != ""){ comboCustomer.setComboText($("h_invoicecus").value); comboCustomer.disable(true); } } String.prototype.trim = function() { return this.replace(/(^\s*)|(\s*$)/g,""); } //生成税控 function invoiceAdapter(){ var strInvoiceID = ""; var typeName = ""; strInvoiceID = $("h_invoiceid").value; var printUrl = ""; var companyID = ""; var typeName = "QDSK"; var dbSourceID = ""; var userID = ""; var url = ""; url = "../Reports/ReportService.aspx?handle=printinvoice&invoiceid="+strInvoiceID+"&val="+newGuid(); 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 = "qdsk://?comp="+companyID+"&type="+typeName+"&dbid="+strInvoiceID+"&uid="+userID;//alert(printUrl); window.location.href = window.location.href; location.href = printUrl; } }else{ alert("没有要打印的报表"); return; } } //发票明细打印 function printInvoiceDetail(){ var strBillNO = ""; var typeName = ""; strBillNO = $("h_billno").value; if(strBillNO.trim() != ""){ var printUrl = ""; var companyID = ""; var typeName = "INVOICEDETAIL"; var dbSourceID = ""; var userID = ""; var url = ""; url = "../Reports/ReportService.aspx?handle=printinvoicedetail&billno="+strBillNO+"&val="+newGuid(); typeName = "INVOICEDETAIL"; 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; } } //获取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(); } var docEle = function() { return document.getElementById(arguments[0]) || false; } function openNewDiv(_id) { var m = "mask"; if (docEle(_id)) document.removeChild(docEle(_id)); if (docEle(m)) document.removeChild(docEle(m)); // 新激活图层 var newDiv = document.createElement("div"); newDiv.id = _id; newDiv.style.position = "absolute"; newDiv.style.zIndex = "9999"; newDiv.style.width = "400px"; newDiv.style.height = "120px"; newDiv.style.top = "100px"; newDiv.style.left = (parseInt(document.body.scrollWidth) - 300) / 2 + "px"; // 屏幕居中 newDiv.style.background = "#EFEFEF"; newDiv.style.border = "1px solid #860001"; newDiv.style.padding = "5px"; var urlVal = "../feecodes/CurrencyAdapter.aspx?handle=drate&val="+newGuid(); var loader = dhtmlxAjax.getSync(urlVal); var loadVal = loader.xmlDoc.responseText; loader = null; var jsonCacheObj; var rmbRate = 0.0; var usdRate = 0.0; if(loadVal.length > 0){ jsonCacheObj = eval('(' + loadVal + ')'); if(jsonCacheObj != null){ for(var i = 0;i
币别汇率转换
1 RMB =
" + "
  USD
1 USD =
" + "
  RMB
"; document.body.appendChild(newDiv); // mask图层 var newMask = document.createElement("div"); newMask.id = m; newMask.style.position = "absolute"; newMask.style.zIndex = "1"; newMask.style.width = document.body.scrollWidth + "px"; newMask.style.height = document.body.scrollHeight + "px"; newMask.style.top = "0px"; newMask.style.left = "0px"; newMask.style.background = "#000"; newMask.style.filter = "alpha(opacity=40)"; newMask.style.opacity = "0.40"; document.body.appendChild(newMask); } function fomatFloat(src,pos){ return Math.round(src*Math.pow(10, pos))/Math.pow(10, pos); } //汇率设置取消 function rateCancel(){ document.body.removeChild(docEle("dvRate")); document.body.removeChild(docEle("mask")); } function exchangeCovert(sourceObj,targetObj,type){ //RMB换算成USD if(type == 1){ var rmbVal = clearNoNum(sourceObj.value); if(rmbVal.trim() == ""){ rmbVal = 1; } var usdVal = clearNoNum(targetObj.value); if(rmbVal == 0.0){ //sourceObj.value = rmbVal; //targetObj.value = 0;//$("h_oldexusd").value; return; } targetObj.value = fomatFloat(1/(usdVal*rmbVal),5); }else if(type == 2){ //USD换算成RMB var usdVal = sourceObj.value; if(usdVal.trim() == ""){ usdVal = 0; } var rmbVal = targetObj.value; targetObj.value = fomatFloat(1/usdVal,5); } }