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.

219 lines
11 KiB
JavaScript

var commonGridObj_fee;
var commonGridObj_settlement;//结算信息
var commonGridObj_invoiceapp;//发票申请
var commonGridObj_invoicemake;//开出发票
var commonGridObj_invoiceverify;//发票核销
var commonGridObj_feemodify;//费用修改
function $(id){
return document.getElementById(id);
}
function createFee(){
//header
var headerArgs_fee = new Array("类型","费用状态","应收费用名称","结算单位","计费标准","单价","数量","金额","币别","汇率");
//width
var widthArgs_fee = new Array("40","100","100","100","70","70","50","70","60","60");
//column align
var colAlignArgs_fee = new Array("center","center","center","center","center","center","center","center","center","center");
//column sort
var colSortArgs_fee = new Array("str","str","str","str","str","str","str","str","str","str");
//column type
var colTypeArgs_fee = new Array("ro","ro","ro","ro","ro","ro","ro","ro","ro","ro");
commonGridObj_fee = new TGridCommon("mygrid_container_fee","form1",headerArgs_fee,widthArgs_fee,colAlignArgs_fee,colSortArgs_fee,colTypeArgs_fee);
commonGridObj_fee.setResponseUrl("FeeHistoryGridSource.aspx");
var bsno = $("h_bsno").value;
var feetype = $("h_feetype").value;
commonGridObj_fee.setRequest("FeeHistoryGridSource.aspx?handle=feelist&bsno="+bsno+"&feetype="+feetype);
commonGridObj_fee.setSourceType("json");
commonGridObj_fee.setSkin("xp");
commonGridObj_fee.setImageUrl("../images/");
commonGridObj_fee.initGrid();
commonGridObj_fee.bind();
commonGridObj_fee.getGridObj().attachEvent("onSelectStateChanged", function(id){
//初始化commonGridObj_settlement
createSettlement();
commonGridObj_settlement.setRequest("FeeHistoryGridSource.aspx?handle=settlelist&feeid="+id);
commonGridObj_settlement.bind();
});
}
function createSettlement(){//初始化commonGridObj_settlement
//header
var headerArgs_settle = new Array("费用名称","客户名称","结算币别","结算金额","原始金额","业务编号","结算日期","结算方式","结算人");
//width
var widthArgs_settle = new Array("100","100","70","100","100","120","120","70","100");
//column align
var colAlignArgs_settle = new Array("center","center","center","center","center","center","center","center","center");
//column sort
var colSortArgs_settle = new Array("str","str","str","str","str","str","str","str","str");
//column type
var colTypeArgs_settle = new Array("ro","ro","ro","ro","ro","ro","ro","ro","ro");
commonGridObj_settlement = new TGridCommon("mygrid_container_settlement","form1",headerArgs_settle,widthArgs_settle,colAlignArgs_settle,colSortArgs_settle,colTypeArgs_settle);
commonGridObj_settlement.setResponseUrl("FeeHistoryGridSource.aspx");
commonGridObj_settlement.setRequest("FeeHistoryGridSource.aspx");
commonGridObj_settlement.setSourceType("json");
commonGridObj_settlement.setSkin("xp");
commonGridObj_settlement.setImageUrl("../images/");
commonGridObj_settlement.initGrid();
//commonGridObj_fee.bind();
}
function createInvoiceApp(){//初始化发票申请commonGridObj_invoiceapp
//header
var headerArgs_app = new Array("费用名称","结算单位","开票币别","开票金额","原始金额","申请编号","发票号码","申请日期","申请人");
//width
var widthArgs_app = new Array("100","100","70","100","100","120","120","70","100");
//column align
var colAlignArgs_app = new Array("center","center","center","center","center","center","center","center","center");
//column sort
var colSortArgs_app = new Array("str","str","str","str","str","str","str","str","str");
//column type
var colTypeArgs_app = new Array("ro","ro","ro","ro","ro","ro","ro","ro","ro");
commonGridObj_invoiceapp = new TGridCommon("mygrid_container_invoiceapp","form1",headerArgs_app,widthArgs_app,colAlignArgs_app,colSortArgs_app,colTypeArgs_app);
commonGridObj_invoiceapp.setResponseUrl("FeeHistoryGridSource.aspx");
commonGridObj_invoiceapp.setRequest("FeeHistoryGridSource.aspx");
commonGridObj_invoiceapp.setSourceType("json");
commonGridObj_invoiceapp.setSkin("xp");
commonGridObj_invoiceapp.setImageUrl("../images/");
commonGridObj_invoiceapp.initGrid();
//commonGridObj_fee.bind();
}
function createInvoiceMake(){//初始化开出发票commonGridObj_invoicemake
//header
var headerArgs_makeout = new Array("费用名称","结算单位","开票币别","开票金额","原始金额","申请编号","发票号码","开票日期","制单人");
//width
var widthArgs_makeout = new Array("100","100","70","100","100","120","120","70","100");
//column align
var colAlignArgs_makeout = new Array("center","center","center","center","center","center","center","center","center");
//column sort
var colSortArgs_makeout = new Array("str","str","str","str","str","str","str","str","str");
//column type
var colTypeArgs_makeout = new Array("ro","ro","ro","ro","ro","ro","ro","ro","ro");
commonGridObj_invoicemake = new TGridCommon("mygrid_container_invoicemake","form1",headerArgs_makeout,widthArgs_makeout,colAlignArgs_makeout,colSortArgs_makeout,colTypeArgs_makeout);
commonGridObj_invoicemake.setResponseUrl("FeeHistoryGridSource.aspx");
commonGridObj_invoicemake.setRequest("FeeHistoryGridSource.aspx");
commonGridObj_invoicemake.setSourceType("json");
commonGridObj_invoicemake.setSkin("xp");
commonGridObj_invoicemake.setImageUrl("../images/");
commonGridObj_invoicemake.initGrid();
//commonGridObj_fee.bind();
}
function createInvoiceVerify(){//初始化commonGridObj_invoiceverify
var headerArgs_verify = new Array("费用名称","结算单位","开票币别","开票金额","原始金额","核销编号","发票号码","核销日期","核销人");
//width
var widthArgs_verify = new Array("100","100","70","100","100","120","120","70","100");
//column align
var colAlignArgs_verify = new Array("center","center","center","center","center","center","center","center","center");
//column sort
var colSortArgs_verify = new Array("str","str","str","str","str","str","str","str","str");
//column type
var colTypeArgs_verify = new Array("ro","ro","ro","ro","ro","ro","ro","ro","ro");
commonGridObj_invoiceverify = new TGridCommon("mygrid_container_invoiceverify","form1",headerArgs_verify,widthArgs_verify,colAlignArgs_verify,colSortArgs_verify,colTypeArgs_verify);
commonGridObj_invoiceverify.setResponseUrl("FeeHistoryGridSource.aspx");
commonGridObj_invoiceverify.setRequest("FeeHistoryGridSource.aspx");
commonGridObj_invoiceverify.setSourceType("json");
commonGridObj_invoiceverify.setSkin("xp");
commonGridObj_invoiceverify.setImageUrl("../images/");
commonGridObj_invoiceverify.initGrid();
}
//查看修改
function createFeeModify(){//初始化commonGridObj_feemodify
var headerArgs_modify = new Array("申请类型","费用名称","结算单位","计费标准","单价","数量","金额","币别","汇率","费用原因","申请人","申请日期","审核人","审核日期");
//width
var widthArgs_modify = new Array("100","100","70","100","100","120","120","70","100","100","120","120","70","100");
//column align
var colAlignArgs_modify = new Array("center","center","center","center","center","center","center","center","center","center","center","center","center","center");
//column sort
var colSortArgs_modify = new Array("str","str","str","str","str","str","str","str","str","str","str","str","str","str");
//column type
var colTypeArgs_modify = new Array("ro","ro","ro","ro","ro","ro","ro","ro","ro","ro","ro","ro","ro","ro");
commonGridObj_feemodify = new TGridCommon("mygrid_container_feemodify","form1",headerArgs_modify,widthArgs_modify,colAlignArgs_modify,colSortArgs_modify,colTypeArgs_modify);
commonGridObj_feemodify.setResponseUrl("FeeHistoryGridSource.aspx");
commonGridObj_feemodify.setRequest("FeeHistoryGridSource.aspx");
commonGridObj_feemodify.setSourceType("json");
commonGridObj_feemodify.setSkin("xp");
commonGridObj_feemodify.setImageUrl("../images/");
commonGridObj_feemodify.initGrid();
}
function checkBtnClick(val){
var checkType = parseInt(val);
switch(checkType){
case 1://查看费用结算信息
createSettlement();
$("dvSettlement").style.display = "";
$("dvInvoice").style.display = "none";
$("dvFeeModify").style.display = "none";
// commonGridObj_fee.getGridObj().attachEvent("onSelectStateChanged", function (id) {
// //初始化commonGridObj_settlement
// createSettlement();
// commonGridObj_settlement.setRequest("FeeHistoryGridSource.aspx?handle=settlelist&feeid=" + id);
// commonGridObj_settlement.bind();
// });
break;
case 2://查看费用发票信息
createInvoiceMake();
createInvoiceApp();
createInvoiceVerify();
$("dvSettlement").style.display = "none";
$("dvInvoice").style.display = "";
$("dvFeeModify").style.display = "none";
commonGridObj_fee.getGridObj().attachEvent("onSelectStateChanged", function(id){
createInvoiceMake();
createInvoiceApp();
createInvoiceVerify();
commonGridObj_invoicemake.setRequest("FeeHistoryGridSource.aspx?handle=invoicemake&feeid="+id);
commonGridObj_invoicemake.bind();
commonGridObj_invoiceapp.setRequest("FeeHistoryGridSource.aspx?handle=invoicapp&feeid="+id);
commonGridObj_invoiceapp.bind();
});
break;
case 3://查看费用修改信息
createFeeModify();
$("dvSettlement").style.display = "none";
$("dvInvoice").style.display = "none";
$("dvFeeModify").style.display = "";
commonGridObj_fee.getGridObj().attachEvent("onSelectStateChanged", function(id){
createFeeModify();
commonGridObj_feemodify.setRequest("FeeHistoryGridSource.aspx?handle=modifylist&feeid="+id);
commonGridObj_feemodify.bind();
});
break;
}
}