You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DS7/DSWeb/js/RecvSettlementApplicationEd...

165 lines
5.7 KiB
JavaScript

2 years ago
var commonGridObj_settlementedit;
var comboCustomer;//委托单位
var comboSettleType;//结算方式
var bsno;
function $(id){
return document.getElementById(id);
}
function getObj(strClassName){
var tagArgs=document.getElementsByTagName("div");
var resultObj = null;
for(var i = 0;i<tagArgs.length;i++){
if(tagArgs[i].className == strClassName){
resultObj = tagArgs[i];
break;
}
}
return resultObj;
}
function createInfo(){
initComboCustomer();
initComboSettleType();
createComboCustomer();
createComboSettleType();
createOrder();
}
function initComboCustomer(){
comboCustomer = dhtmlXComboFromSelect("sel_customer");
}
function initComboSettleType(){
comboSettleType = dhtmlXComboFromSelect("sel_settletype");
}
function createComboCustomer(){
if($("h_customer").value.trim() != ""){
comboCustomer.setComboText($("h_customer").value);
comboCustomer.disable(true);
}
}
function createComboSettleType(){
if($("h_settletype").value.trim() != ""){
comboSettleType.setComboValue($("h_settletype").value);
comboSettleType.disable(true);
}
}
String.prototype.trim = function() { return this.replace(/(^\s*)|(\s*$)/g,""); }
function printApplication(){
var strBillNO = "";
var typeName = "";
strBillNO = $("h_billno").value;
if(strBillNO.trim() != ""){
var printUrl = "";
var companyID = "";
var typeName = "RECVAPPSETTLE";
var dbSourceID = "";
var userID = "";
var url = "";
//alert(strBillNO);
url = "../Reports/ReportService.aspx?handle=printrecvappsettle&billno=" + strBillNO + "&val=" + newGuid();
typeName = "RECVAPPSETTLE";
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();
}
function createOrder(){
previous_id = "";
var headerArgs_order = new Array("", "委托单位", "委托编号", "主提单号", "分提单号", "报关单号", "备案清单号");
var widthArgs_order = new Array("40", "100", "120", "100", "100", "100", "100");
var colAlignArgs_order = new Array("center","center","center","center","center","center","center");
var colSortArgs_order = new Array("na","str","str","str","str","str","str");
var colTypeArgs_order = new Array("ch","ro","ro","ro","ro","ro","ro");
commonGridObj_order = new TGridCommon("mygrid_container_order","form1",headerArgs_order,widthArgs_order,colAlignArgs_order,colSortArgs_order,colTypeArgs_order);
commonGridObj_order.setResponseUrl("RecvSettleApplicationGridSource.aspx");
var paySettleAppID = $("h_paysettleappid").value;
commonGridObj_order.setRequest("RecvSettleApplicationGridSource.aspx?handle=recvappopseaelist&paysettleappid="+paySettleAppID);
commonGridObj_order.setSourceType("json");
commonGridObj_order.setSkin("xp");
commonGridObj_order.setImageUrl("../images/");
commonGridObj_order.initGrid();
commonGridObj_order.bind();
commonGridObj_order.getGridObj().attachEvent("onSelectStateChanged", function(id){
bsno = id;
createFeeList();
});
}
function createFeeList(){
var headerArgs_order = new Array("<input type=\"checkbox\" id=\"ck_allfee\" onclick=\"checkAll(commonGridObj_fee)\" />","收/付","费用名称","结算单位","计费标准","单价","数量","金额","币别","汇率","申请金额","未申请金额");
var widthArgs_order = new Array("40","25","120","70","70","70","70","70","70","70","70","70");
var colAlignArgs_order = new Array("center","center","center","center","center","center","center","center","center","center","center","center");
var colSortArgs_order = new Array("na","str","str","str","str","str","str","str","str","str","str","str");
var colTypeArgs_order = new Array("ch","ro","ro","ro","ro","ro","ro","ro","ro","ro","ro","ro");
commonGridObj_fee = new TGridCommon("mygrid_container_fee","form1",headerArgs_order,widthArgs_order,colAlignArgs_order,colSortArgs_order,colTypeArgs_order);
commonGridObj_fee.setResponseUrl("RecvSettleApplicationGridSource.aspx");
var paySettleAppID = $("h_paysettleappid").value;
commonGridObj_fee.setRequest("RecvSettleApplicationGridSource.aspx?handle=recvappfeelist&paysettleappid="+paySettleAppID+"&bsno="+bsno);
commonGridObj_fee.setSourceType("json");
commonGridObj_fee.setSkin("xp");
commonGridObj_fee.setImageUrl("../images/");
commonGridObj_fee.initGrid();
commonGridObj_fee.bind();
}