var commonGridObj_total; var commonGridObj_recv; var commonGridObj_pay; var searchCondition = ""; var strBSNO = ""; var SelectRowOplb="";//选中行的业务类别 function $(id){ return document.getElementById(id); } function createGrid(){ //header var headerArgs_total = new Array("","业务类别","委托编号","费用状态","主提单号","分提单号","委托单位","船名航次","开船日期","会计期间","目的港"); //width var widthArgs_total = new Array("20","60","100","150","100","100","100","100","150","150","150"); //column align var colAlignArgs_total = new Array("center","center","center","center","center","center","center","center","center","center","center"); //column sort var colSortArgs_total = new Array("na","str","str","str","str","str","str","str","str","str","str"); //column type var colTypeArgs_total = new Array("ch","ro","ro","ro","ro","ro","ro","ro","ro","ro","ro"); commonGridObj_total = new TGridCommon("mygrid_container_total","form1",headerArgs_total,widthArgs_total,colAlignArgs_total,colSortArgs_total,colTypeArgs_total); commonGridObj_total.setResponseUrl("FeeAuditGridSource.aspx"); commonGridObj_total.setRequest("FeeAuditGridSource.aspx?handle=list&type=1&init=1&uid="+commonGridObj_total.newGuid()); commonGridObj_total.setSourceType("json"); commonGridObj_total.setSkin("xp"); commonGridObj_total.setImageUrl("../images/"); commonGridObj_total.initGrid(); commonGridObj_total.bind(); var headerArgs_recv = new Array("","费用状态","应收费用名称","结算单位","计费标准","单价","数量","佣金比例","金额","币别","汇率","FRT","费用备注","是否垫付"); var widthArgs_recv = new Array("20","100","150","100","100","80","50","60","70","70","70","70","70","80"); var colAlignArgs_recv = new Array("center","center","center","center","center","center","center","center","center","center","center","center","center","center"); var colSortArgs_recv = new Array("na","str","str","str","str","str","str","str","str","str","str","str","str","str"); var colTypeArgs_recv = new Array("ch","ro","ro","ro","ro","ro","ro","ro","ro","ro","ro","ro","ro","ch"); commonGridObj_recv = new TGridCommon("mygrid_container_recv","form1",headerArgs_recv,widthArgs_recv,colAlignArgs_recv,colSortArgs_recv,colTypeArgs_recv); commonGridObj_recv.setResponseUrl("FeeAuditGridSource.aspx"); commonGridObj_recv.setSourceType("json"); commonGridObj_recv.setSkin("xp"); commonGridObj_recv.setImageUrl("../images/"); commonGridObj_recv.initGrid(); var headerArgs_pay = new Array("","费用状态","应付费用名称","结算单位","计费标准","单价","数量","佣金比例","金额","币别","汇率","FRT","费用备注","是否垫付"); var widthArgs_pay = new Array("20","100","150","100","100","80","50","60","70","70","70","70","70","80"); var colAlignArgs_pay = new Array("center","center","center","center","center","center","center","center","center","center","center","center","center","center"); var colSortArgs_pay = new Array("na","str","str","str","str","str","str","str","str","str","str","str","str","str"); var colTypeArgs_pay = new Array("ch","ro","ro","ro","ro","ro","ro","ro","ro","ro","ro","ro","ro","ch"); commonGridObj_pay = new TGridCommon("mygrid_container_pay","form1",headerArgs_pay,widthArgs_pay,colAlignArgs_pay,colSortArgs_pay,colTypeArgs_pay); commonGridObj_pay.setResponseUrl("FeeAuditGridSource.aspx"); commonGridObj_pay.setSourceType("json"); commonGridObj_pay.setSkin("xp"); commonGridObj_pay.setImageUrl("../images/"); commonGridObj_pay.initGrid(); commonGridObj_total.getGridObj().enableEditEvents(true,false,true); commonGridObj_total.getGridObj().enableKeyboardSupport(true); commonGridObj_total.getGridObj().enableMultiselect(true); commonGridObj_total.getGridObj().attachEvent("onRowDblClicked", function (rId, cInd) { var rowIndex = commonGridObj_total.getGridObj().getRowIndex(rId); var oplb = commonGridObj_total.getGridObj().cellByIndex(rowIndex, 1).getValue(); var openSet = "height=700, width=1024, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + (screen.height - 750) / 2 + ",Left= " + (screen.width - 1100) / 2 var openType = "_blank"; var openUrl; if (oplb == "海运出口") { SelectRowOplb = "op_Seae"; openUrl = "../baseinfo/opseaebaseinfo.aspx?handle=check&bsno=" + rId; } else if (oplb == "海运进口") { SelectRowOplb = "op_Seai"; openUrl = "../baseinfo/opseaibaseinfo.aspx?handle=check&bsno=" + rId; } else if (oplb == "内贸海运") { SelectRowOplb = "op_Sean"; openUrl = "../baseinfo/opseaibaseinfo.aspx?handle=check&bsno="+rId; } else if (oplb == "报关业务") { SelectRowOplb = "op_Apply"; openUrl = "../MvcShipping/MsOpApply/ApplyFeeView?handle=check&bsno=" + rId; } else if (oplb == "大宗散货") { SelectRowOplb = "op_Bulk"; openUrl = "../MvcShipping/MsOpBulk/BulkFeeView?handle=check&bsno=" + rId; } else if (oplb == "散杂运输") { SelectRowOplb = "op_Other"; openUrl = "../MvcShipping/MsOpOther/OtherFeeView?handle=check&bsno=" + rId; } window.open(openUrl, openType, openSet); }); commonGridObj_total.getGridObj().attachEvent("onSelectStateChanged", function (id) { strBSNO = id; var rowIndex = commonGridObj_total.getGridObj().getRowIndex(id); var oplb = commonGridObj_total.getGridObj().cellByIndex(rowIndex, 1).getValue(); if (oplb == "海运出口") { SelectRowOplb = "op_Seae"; } else if (oplb == "海运进口") { SelectRowOplb = "op_Seai"; } else if (oplb == "内贸海运") { SelectRowOplb = "op_Sean"; } else if (oplb == "报关业务") { SelectRowOplb = "op_Apply"; } else if (oplb == "大宗散货") { SelectRowOplb = "op_Bulk"; } else if (oplb == "散杂运输") { SelectRowOplb = "op_Other"; } commonGridObj_recv.loadafter = true; commonGridObj_recv.after = function () { markStatusColor(commonGridObj_recv.getGridObj()); } commonGridObj_recv.initGrid(); commonGridObj_recv.setRequest("FeeAuditGridSource.aspx?handle=" + SelectRowOplb + "&type=2&bsno=" + id); commonGridObj_recv.bind(); commonGridObj_recv.enableMultiselect(true); commonGridObj_pay.loadafter = true; commonGridObj_pay.after = function () { markStatusColor(commonGridObj_pay.getGridObj()); } commonGridObj_pay.initGrid(); commonGridObj_pay.setRequest("FeeAuditGridSource.aspx?handle=" + SelectRowOplb + "&type=3&bsno=" + id); commonGridObj_pay.bind(); commonGridObj_pay.enableMultiselect(true); getFeeProfit(id); commonGridObj_recv.getGridObj().attachEvent("onEditCell", function (stage, rId, cInd, nValue, oValue) { if (stage == 0) { if (cInd != 0) { return false; } else { return true; } } if (stage == 1) { if (cInd == 0) { return true; } else { return false; } } }); commonGridObj_pay.getGridObj().attachEvent("onEditCell", function (stage, rId, cInd, nValue, oValue) { if (stage == 0) { if (cInd != 0) { return false; } else { return true; } } if (stage == 1) { if (cInd == 0) { return true; } else { return false; } } }); // setTimeout(function(){ // //checkAll("recv",1); // markStatusColor(commonGridObj_recv.getGridObj()); // },200); // // setTimeout(function(){ // //checkAll("pay",1); // markStatusColor(commonGridObj_pay.getGridObj()); // },300); $("ck_all_recv").checked = 1; $("ck_all_pay").checked = 1; }); } function markStatusColor(gridObj){ var count = gridObj.getRowsNum(); for(var i = 0;i 0){ if(window.confirm("您确定批准通过所选应收费用")){ for(var j = 0;j= 0 ){ auditCount++; if(auditCount == 1){ postBillNO = selectGroup[j]; } var rowIndex = commonGridObj_recv.getGridObj().getRowIndex(selectGroup[j]); //markSimpleStatusColor(commonGridObj_recv.getGridObj(),selectGroup[j],loadVal,rowIndex); if(loadVal == 0){ commonGridObj_recv.getGridObj().setRowColor(selectGroup[j],"#7FDF00"); commonGridObj_recv.getGridObj().cellByIndex(rowIndex,1).setValue("审核通过"); }else if(loadVal == 1){ commonGridObj_recv.getGridObj().setRowColor(selectGroup[j],"#ebf48a"); commonGridObj_recv.getGridObj().cellByIndex(rowIndex,1).setValue("提交审核"); }else if(loadVal == 6 || loadVal == 7){ commonGridObj_recv.getGridObj().setRowColor(rowId,"#f53939"); commonGridObj_recv.getGridObj().cellByIndex(rowIndex,1).setValue("驳回提交"); } } } // //commonGridObj_recv.setRequest("FeeAuditGridSource.aspx?handle=list&type=2&init=2&bsno="+id); // commonGridObj_recv.setRequest("FeeAuditGridSource.aspx?handle=list&type=2&init=2&bsno="+strBSNO); // commonGridObj_recv.loadafter = true; // commonGridObj_recv.after = function(){ // markStatusColor(commonGridObj_recv.getGridObj()); // } // commonGridObj_recv.reload(); // commonGridObj_recv.initGrid(); // commonGridObj_recv.bind(); // commonGridObj_recv.enableMultiselect(true); // // setTimeout(function(){ // markStatusColor(commonGridObj_recv.getGridObj()); // markStatusColor(commonGridObj_pay.getGridObj()); // },300); if(auditCount > 0){ //向审核人发送申请消息 var postUrlVal = "../message/messageservice.aspx?billno="+postBillNO+"&type=7&oplb="+SelectRowOplb+"&handle=postmessage"+"&uid="+commonGridObj_recv.newGuid();; var loader = dhtmlxAjax.getSync(postUrlVal); var loadVal = loader.xmlDoc.responseText; alert("审核成功"); } //createGrid(); //setRefresh(); } } else{ if(unauditCount == 0){ alert("您没有选择要审核的费用内容"); } } } //应付费用审核通过 function AuditingPayAllAccepted(){ var selectCount = 0; var auditCount = 0; var unauditCount = 0; var postBillNO = ""; var selectGroup = new Array(); for(var i = 0;i 0){ if(window.confirm("您确定批准通过所选应付费用")){ for(var j = 0;j= 0 ){ auditCount++; if(auditCount == 1){ postBillNO = selectGroup[j]; } var rowIndex = commonGridObj_pay.getGridObj().getRowIndex(selectGroup[j]); if(loadVal == 0){ commonGridObj_pay.getGridObj().setRowColor(selectGroup[j],"#7FDF00"); commonGridObj_pay.getGridObj().cellByIndex(rowIndex,1).setValue("审核通过"); }else if(loadVal == 1){ commonGridObj_pay.getGridObj().setRowColor(selectGroup[j],"#ebf48a"); commonGridObj_pay.getGridObj().cellByIndex(rowIndex,1).setValue("提交审核"); }else if(loadVal == 6 || loadVal == 7){ commonGridObj_pay.getGridObj().setRowColor(rowId,"#f53939"); commonGridObj_pay.getGridObj().cellByIndex(rowIndex,1).setValue("驳回提交"); } } } // commonGridObj_pay.initGrid(); // commonGridObj_pay.bind(); // commonGridObj_pay.enableMultiselect(true); // // setTimeout(function(){ // markStatusColor(commonGridObj_recv.getGridObj()); // markStatusColor(commonGridObj_pay.getGridObj()); // },300); // commonGridObj_pay.setRequest("FeeAuditGridSource.aspx?handle=list&type=3&init=2&bsno="+strBSNO); // commonGridObj_pay.loadafter = true; // commonGridObj_pay.after = function(){ // markStatusColor(commonGridObj_pay.getGridObj()); // } // commonGridObj_pay.reload(); // if(auditCount > 0){ var postUrlVal = "../message/messageservice.aspx?billno="+postBillNO+"&type=7&oplb="+SelectRowOplb+"&handle=postmessage"+"&uid="+commonGridObj_recv.newGuid();; var loader = dhtmlxAjax.getSync(postUrlVal); var loadVal = loader.xmlDoc.responseText; alert("审核成功"); } //createGrid(); //setRefresh(); } } else{ if(unauditCount == 0){ alert("您没有选择要审核的费用内容"); } } } //刷新应收应付列表信息 function setRefresh() { var id = commonGridObj_total.getGridObj().getSelectedRowId(); var rowIndex = commonGridObj_total.getGridObj().getRowIndex(id); var oplb = commonGridObj_total.getGridObj().cellByIndex(rowIndex, 1).getValue(); if (oplb == "海运出口") { SelectRowOplb = "op_Seae"; } else if (oplb == "海运进口") { SelectRowOplb = "op_Seai"; } else if (oplb == "内贸海运") { SelectRowOplb = "op_Sean"; } else if (oplb == "报关业务") { SelectRowOplb = "op_Apply"; } else if (oplb == "大宗散货") { SelectRowOplb = "op_Bulk"; } else if (oplb == "散杂运输") { SelectRowOplb = "op_Other"; } commonGridObj_recv.loadafter = true; commonGridObj_recv.after = function () { markStatusColor(commonGridObj_recv.getGridObj()); } commonGridObj_recv.initGrid(); commonGridObj_recv.setRequest("FeeAuditGridSource.aspx?handle=" + SelectRowOplb + "&type=2&bsno=" + id); commonGridObj_recv.bind(); commonGridObj_recv.enableMultiselect(true); commonGridObj_pay.loadafter = true; commonGridObj_pay.after = function () { markStatusColor(commonGridObj_pay.getGridObj()); } commonGridObj_pay.initGrid(); commonGridObj_pay.setRequest("FeeAuditGridSource.aspx?handle=" + SelectRowOplb + "&type=3&bsno=" + id); commonGridObj_pay.bind(); commonGridObj_pay.enableMultiselect(true); getFeeProfit(id); commonGridObj_recv.getGridObj().attachEvent("onEditCell", function (stage, rId, cInd, nValue, oValue) { if (stage == 0) { if (cInd != 0) { return false; } else { return true; } } if (stage == 1) { if (cInd == 0) { return true; } else { return false; } } }); commonGridObj_pay.getGridObj().attachEvent("onEditCell", function (stage, rId, cInd, nValue, oValue) { if (stage == 0) { if (cInd != 0) { return false; } else { return true; } } if (stage == 1) { if (cInd == 0) { return true; } else { return false; } } }); } //获取利润信息 function getFeeProfit(strBSNO){ if(strBSNO.trim() != ""){ var urlVal = "FeeAuditGridSource.aspx?handle="+SelectRowOplb+"&type=4&bsno="+strBSNO+"&val="+commonGridObj_recv.newGuid(); var loader = ""; loader = dhtmlxAjax.getSync(urlVal); var loadVal = loader.xmlDoc.responseText; var jsonProfitObj = loadVal; if(commonGridObj_total.IsNum(jsonProfitObj)){ jsonPageObj = null; commonGridObj_total.$("dvRecvRMBVal").innerHTML = ""; commonGridObj_total.$("dvPayRMBVal").innerHTML = ""; commonGridObj_total.$("dvRMBProfitVal").innerHTML = ""; commonGridObj_total.$("dvUSRecvVal").innerHTML = ""; commonGridObj_total.$("dvUSPayVal").innerHTML = ""; commonGridObj_total.$("dvUSProfitVal").innerHTML = ""; commonGridObj_total.$("dvOtherCurrencyRecvVal").innerHTML = ""; commonGridObj_total.$("dvOtherCurrencyPayVal").innerHTML = ""; commonGridObj_total.$("dvOtherCurrencyProfitVal").innerHTML = ""; commonGridObj_total.$("dvRecvTotalVal").innerHTML = ""; commonGridObj_total.$("dvPaySumVal").innerHTML = ""; commonGridObj_total.$("dvProfitTotalVal").innerHTML = ""; commonGridObj_total.$("dvProfitRateVal").innerHTML = ""; }else{ jsonProfitObj = eval('(' + loadVal + ')'); commonGridObj_total.$("dvRecvRMBVal").innerHTML = jsonProfitObj.columns[0].rmbdr; commonGridObj_total.$("dvPayRMBVal").innerHTML = jsonProfitObj.columns[0].rmbcr; commonGridObj_total.$("dvRMBProfitVal").innerHTML = jsonProfitObj.columns[0].rmbprofit; commonGridObj_total.$("dvUSRecvVal").innerHTML = jsonProfitObj.columns[0].usddr; commonGridObj_total.$("dvUSPayVal").innerHTML = jsonProfitObj.columns[0].usdcr; commonGridObj_total.$("dvUSProfitVal").innerHTML = jsonProfitObj.columns[0].usdprofit; commonGridObj_total.$("dvOtherCurrencyRecvVal").innerHTML = jsonProfitObj.columns[0].otdr; commonGridObj_total.$("dvOtherCurrencyPayVal").innerHTML = jsonProfitObj.columns[0].otcr; commonGridObj_total.$("dvOtherCurrencyProfitVal").innerHTML = jsonProfitObj.columns[0].otprofit; commonGridObj_total.$("dvRecvTotalVal").innerHTML = jsonProfitObj.columns[0].drttl; commonGridObj_total.$("dvPaySumVal").innerHTML = jsonProfitObj.columns[0].crttl; commonGridObj_total.$("dvProfitTotalVal").innerHTML = jsonProfitObj.columns[0].ttlprofit; commonGridObj_total.$("dvProfitRateVal").innerHTML = jsonProfitObj.columns[0].profitrate; } }else{ commonGridObj_total.$("dvRecvRMBVal").innerHTML = ""; commonGridObj_total.$("dvPayRMBVal").innerHTML = ""; commonGridObj_total.$("dvRMBProfitVal").innerHTML = ""; commonGridObj_total.$("dvUSRecvVal").innerHTML = ""; commonGridObj_total.$("dvUSPayVal").innerHTML = ""; commonGridObj_total.$("dvUSProfitVal").innerHTML = ""; commonGridObj_total.$("dvOtherCurrencyRecvVal").innerHTML = ""; commonGridObj_total.$("dvOtherCurrencyPayVal").innerHTML = ""; commonGridObj_total.$("dvOtherCurrencyProfitVal").innerHTML = ""; commonGridObj_total.$("dvRecvTotalVal").innerHTML = ""; commonGridObj_total.$("dvPaySumVal").innerHTML = ""; commonGridObj_total.$("dvProfitTotalVal").innerHTML = ""; commonGridObj_total.$("dvProfitRateVal").innerHTML = ""; } } //驳回应收费用提交 function RejectRecvApply(){ var selectCount = 0; var auditCount = 0; var unauditCount = 0; var auditSuccess = 0; var runCount = 0; var noPower = 0; var errorCount = 0; var selectGroup = new Array(); var postBillNO = ""; for(var i = 0;i 0){ if(window.confirm("您确定批准通过所选应收费用")){ for(var j = 0;j= 0 ){ auditCount++; if(auditCount == 1){ postBillNO = selectGroup[j]; } var rowIndex = commonGridObj_recv.getGridObj().getRowIndex(selectGroup[j]); //commonGridObj_recv.getGridObj().cellByIndex(rowIndex,1).setValue("驳回提交"); if(loadVal == 0){ commonGridObj_recv.getGridObj().setRowColor(selectGroup[j],"#7FDF00"); commonGridObj_recv.getGridObj().cellByIndex(rowIndex,1).setValue("审核通过"); }else if(loadVal == 1){ commonGridObj_recv.getGridObj().setRowColor(selectGroup[j],"#ebf48a"); commonGridObj_recv.getGridObj().cellByIndex(rowIndex,1).setValue("提交审核"); }else if(loadVal == 6 || loadVal == 7){ commonGridObj_recv.getGridObj().setRowColor(rowId,"#f53939"); commonGridObj_recv.getGridObj().cellByIndex(rowIndex,1).setValue("驳回提交"); } }else{ if(loadVal == -6){ runCount++; }else if(loadVal == -3){ noPower++; }else{ errorCount++; } } } // commonGridObj_recv.initGrid(); // commonGridObj_recv.bind(); // commonGridObj_recv.enableMultiselect(true); // setTimeout(function(){ // markStatusColor(commonGridObj_recv.getGridObj()); // markStatusColor(commonGridObj_pay.getGridObj()); // },300); //alert("审核 共计"+selectCount+"条 成功"+auditCount+"条 没有权限审核 "+noPower+"条 异常错误 "+errorCount+"条 费用已进行结算不能审核 "+runCount+" 条"); if(auditCount > 0){ //向审核人发送申请消息 var postUrlVal = "../message/messageservice.aspx?billno="+postBillNO+"&type=8&oplb="+SelectRowOplb+"&handle=postmessage"+"&uid="+commonGridObj_recv.newGuid();; var loader = dhtmlxAjax.getSync(postUrlVal); var loadVal = loader.xmlDoc.responseText; alert("驳回完成"); } } } else{ if(unauditCount == 0){ alert("您没有选择要审核的费用内容"); } } //createGrid(); //setRefresh(); } //驳回应付费用提交 function RejectPayApply(){ var selectCount = 0; var auditCount = 0; var unauditCount = 0; var auditSuccess = 0; var runCount = 0; var noPower = 0; var errorCount = 0; var postBillNO = ""; var selectGroup = new Array(); for(var i = 0;i 0){ if (window.confirm("您确定操作所选应付费用")) {//批准通过 var iError = 0; for(var j = 0;j= 0 ){ auditCount++; if(auditCount == 1){ postBillNO = selectGroup[j]; } var rowIndex = commonGridObj_pay.getGridObj().getRowIndex(selectGroup[j]); //commonGridObj_pay.getGridObj().cellByIndex(rowIndex,1).setValue("驳回提交"); if(loadVal == 0){ commonGridObj_pay.getGridObj().setRowColor(selectGroup[j],"#7FDF00"); commonGridObj_pay.getGridObj().cellByIndex(rowIndex,1).setValue("审核通过"); }else if(loadVal == 1){ commonGridObj_pay.getGridObj().setRowColor(selectGroup[j],"#ebf48a"); commonGridObj_pay.getGridObj().cellByIndex(rowIndex,1).setValue("提交审核"); }else if(loadVal == 6 || loadVal == 7){ commonGridObj_pay.getGridObj().setRowColor(rowId,"#f53939"); commonGridObj_pay.getGridObj().cellByIndex(rowIndex,1).setValue("驳回提交"); } }else{ if(loadVal == -6){ runCount++; }else if(loadVal == -3){ noPower++; }else if(loadVal == -10){ iError++; }else{ errorCount++; } } } // if (iError > 0) { alert("注意:已经做收付费申请或发票申请的费用,不允许驳回申请!"); } // if(auditCount > 0){ //向审核人发送申请消息 var postUrlVal = "../message/messageservice.aspx?billno="+postBillNO+"&type=8&oplb="+SelectRowOplb+"&handle=postmessage"+"&uid="+commonGridObj_recv.newGuid();; var loader = dhtmlxAjax.getSync(postUrlVal); var loadVal = loader.xmlDoc.responseText; alert("操作完成");//驳回完成 } } } else{ if(unauditCount == 0){ alert("您没有选择要审核的费用内容"); } } //createGrid(); //setRefresh(); } function orderRecvModify(){//应收费用“禁开发票” } function orderRecvAudit(){//应收费用解禁发票 } function query(){ openNewDiv("kl"); } function applyRecvHistory(){ var iCount = 0; var recvArg = new Array(); var bsno = ""; for(var i=0;i 0){ var exsitHistory = 0; var url = "AuditService.aspx?id="+recvArg[0]+"&handle=history&uid="+commonGridObj_recv.newGuid(); var loader = dhtmlxAjax.getSync(url); var exsitHistory = loader.xmlDoc.responseText; // if(status.trim() == "申请修改" || status.trim() == "驳回申请" || status.trim() == "申请通过"){ if(exsitHistory > 0){ var openUrl = "../Shipping/FeeModify.aspx?id="+recvArg[0]+"&oplb="+SelectRowOplb+"&type=1&bsno="+bsno+"&handle=3"; window.open (openUrl, "_blank", "height=470, width=900, toolbar=no, menubar=no,scrollbars=no, resizable=no,location=no, status=no,Top= " +(screen.height-470)/2 + ",Left= "+(screen.width-900)/2); }else{ alert("没有申请历史记录"); } } }else if(iCount > 1){ alert("每次只能查看一条费用历史记录,请重新选择要查看的费用"); }else{ alert("未选中要操作的费用项"); } } function applyPayHistory(){ var iCount = 0; var recvArg = new Array(); var bsno = ""; for(var i=0;i 0){ var exsitHistory = 0; var url = "AuditService.aspx?id="+recvArg[0]+"&handle=history&uid="+commonGridObj_pay.newGuid(); var loader = dhtmlxAjax.getSync(url); var exsitHistory = loader.xmlDoc.responseText; //if(status.trim() == "申请修改" || status.trim() == "驳回申请" || status.trim() == "申请通过"){ if(exsitHistory > 0){ var openUrl = "../Shipping/FeeModify.aspx?id="+recvArg[0]+"&oplb"+SelectRowOplb+"&type=2&bsno="+bsno+"&handle=3"; window.open (openUrl, "_blank", "height=470, width=900, toolbar=no, menubar=no,scrollbars=no, resizable=no,location=no, status=no,Top= " +(screen.height-470)/2 + ",Left= "+(screen.width-900)/2); }else{ alert("没有申请历史记录"); } } }else if(iCount > 1){ alert("每次只能查看一条费用历史记录,请重新选择要查看的费用"); }else{ alert("未选中要操作的费用项"); } } function search(){ var selCustNo = $("sel_custno").value.trim(); var txtCustNo = $("txt_custno").value.trim(); var selMblno = $("sel_mblno").value.trim(); var txtMblno = $("txt_mblno").value.trim(); var selHblno = $("sel_hblno").value.trim(); var txtHblno = $("txt_hblno").value.trim(); var selCustname = $("sel_custname").value.trim(); var txtCustname = $("txt_custname").value.trim(); var selVessel = $("sel_vessel").value.trim(); var txtVessel = $("txt_vessel").value.trim(); var selDestination = $("sel_destination").value.trim(); var txtDestination = $("txt_destination").value.trim(); var txtBeginEtd = $("txt_beginetd").value.trim(); var txtEndEtd = $("txt_endetd").value.trim(); var txtBeginAcc = $("txt_beginacc").value.trim(); var txtEndAcc = $("txt_endacc").value.trim(); var searchJson = ""; //begin searchJson +="{"; searchJson += "["; searchJson += "\"cusno\":\""+ txtCustNo +"\","; searchJson += "\"cusno2\":\""+ selCustNo +"\","; searchJson += "\"mblno\":\""+ txtMblno +"\","; searchJson += "\"mblno2\":\""+ selMblno +"\","; searchJson += "\"hblno\":\""+ txtHblno +"\","; searchJson += "\"hblno2\":\""+ selHblno +"\","; searchJson += "\"cus\":\""+ txtCustname +"\","; searchJson += "\"cus2\":\""+ selCustname +"\","; searchJson += "\"vessel\":\""+ txtVessel +"\","; searchJson += "\"vessel2\":\""+ selVessel +"\","; searchJson += "\"dest\":\""+ txtDestination +"\","; searchJson += "\"dest2\":\""+ selDestination +"\","; searchJson += "\"etdb\":\""+ txtBeginEtd +"\","; searchJson += "\"etde\":\""+ txtEndEtd +"\","; searchJson += "\"accb\":\""+ txtBeginAcc +"\","; searchJson += "\"acce\":\""+ txtEndAcc +"\""; searchJson += "]"; searchJson +="}"; searchCondition = searchJson; commonGridObj_total.setRequest("FeeAuditGridSource.aspx?handle=list&type=1&init=2&search="+escape(searchJson)+"&uid="+commonGridObj_total.newGuid()); // commonGridObj_total.setRequest("FeeAuditGridSource.aspx?handle=list&type=1&init=1&search="+escape(searchJson)+"&uid="+commonGridObj_total.newGuid()); commonGridObj_total.initGrid(); commonGridObj_total.bind(); commonGridObj_pay.initGrid(); commonGridObj_recv.initGrid(); commonGridObj_total.getGridObj().attachEvent("onRowDblClicked", function (rId, cInd) { var openSet = "height=700, width=1024, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + (screen.height - 750) / 2 + ",Left= " + (screen.width - 1100) / 2 var openType = "_blank"; var openUrl = ""; var rowIndex = commonGridObj_total.getGridObj().getRowIndex(rId); var oplb = commonGridObj_total.getGridObj().cellByIndex(rowIndex, 1).getValue(); if (oplb == "海运出口") { SelectRowOplb = "op_Seae"; openUrl = "../baseinfo/opseaebaseinfo.aspx?handle=check&bsno=" + rId; } else if (oplb == "海运进口") { SelectRowOplb = "op_Seai"; //openUrl = "../baseinfo/opseaibaseinfo.aspx?handle=check&bsno=" + rId; openUrl = "../MvcShipping/MsOpOther/OtherFeeView?handle=check&bsno=" + rId; } else if (oplb == "内贸海运") { SelectRowOplb = "op_Sean"; openUrl = "../baseinfo/opseaibaseinfo.aspx?handle=check&bsno="+rId; } else if (oplb == "报关业务") { SelectRowOplb = "op_Apply"; openUrl = "../MvcShipping/MsOpApply/ApplyFeeView?handle=check&bsno=" + rId; } else if (oplb == "大宗散货") { SelectRowOplb = "op_Bulk"; openUrl = "../MvcShipping/MsOpBulk/BulkFeeView?handle=check&bsno=" + rId; } else if (oplb == "散杂运输") { SelectRowOplb = "op_Other"; openUrl = "../MvcShipping/MsOpOther/OtherFeeView?handle=check&bsno=" + rId; } window.open(openUrl, openType, openSet); }); commonGridObj_total.getGridObj().attachEvent("onSelectStateChanged", function (id) { var rowIndex = commonGridObj_total.getGridObj().getRowIndex(id); var oplb = commonGridObj_total.getGridObj().cellByIndex(rowIndex, 1).getValue(); if (oplb == "海运出口") { SelectRowOplb = "op_Seae"; } else if (oplb == "海运进口") { SelectRowOplb = "op_Seai"; } else if (oplb == "内贸海运") { SelectRowOplb = "op_Sean"; } else if (oplb == "报关业务") { SelectRowOplb = "op_Apply"; } else if (oplb == "大宗散货") { SelectRowOplb = "op_Bulk"; } else if (oplb == "散杂运输") { SelectRowOplb = "op_Other"; } commonGridObj_recv.loadafter = true; commonGridObj_recv.after = function () { markStatusColor(commonGridObj_recv.getGridObj()); } commonGridObj_recv.initGrid(); commonGridObj_recv.setRequest("FeeAuditGridSource.aspx?handle=" + SelectRowOplb + "&type=2&init=2&bsno=" + id); commonGridObj_recv.bind(); commonGridObj_recv.enableMultiselect(true); commonGridObj_pay.loadafter = true; commonGridObj_pay.after = function () { markStatusColor(commonGridObj_pay.getGridObj()); } commonGridObj_pay.initGrid(); commonGridObj_pay.setRequest("FeeAuditGridSource.aspx?handle=" + SelectRowOplb + "&type=3&init=2&bsno=" + id); commonGridObj_pay.bind(); commonGridObj_pay.enableMultiselect(true); getFeeProfit(id); commonGridObj_recv.getGridObj().attachEvent("onEditCell", function (stage, rId, cInd, nValue, oValue) { if (cInd == 0) { return true; } else { return false; } if (stage == 1) { if (cInd == 0) { return true; } else { return false; } } }); commonGridObj_pay.getGridObj().attachEvent("onEditCell", function (stage, rId, cInd, nValue, oValue) { if (stage == 0) { if (cInd == 0) { return true; } else { return false; } } if (stage == 1) { if (cInd == 0) { return true; } else { return false; } } }); setTimeout(function () { markStatusColor(commonGridObj_recv.getGridObj()); markStatusColor(commonGridObj_pay.getGridObj()); }, 100); // checkAll("recv",1); // checkAll("pay",1); $("ck_all_recv").checked = 1; $("ck_all_pay").checked = 1; }); getFeeProfit("");//清空利润信息 closeSearch("kl"); } function closeSearch(id){ document.body.removeChild(docEle(id)); document.body.removeChild(docEle("mask")); } 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 = "500px"; newDiv.style.height = "200px"; newDiv.style.top = "100px"; newDiv.style.left = (parseInt(document.body.scrollWidth) - 600) / 2 + "px"; // 屏幕居中 newDiv.style.background = "#EFEFEF"; newDiv.style.border = "1px solid #860001"; newDiv.style.padding = "5px"; newDiv.innerHTML = "
信息检索
" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" + "
委托编号:
主提单号:
分提单号:
委托单位:
船名航次:
目的港:
开船日期:
" +"
" +"
会计期间
" +"
" + "
" +"
" +"    
" +"
"; 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); // 关闭mask和新图层 // var saveButton = document.createElement("a"); // saveButton.href = "#"; // saveButton.innerHTML = "确定"; // saveButton.className="regular"; // saveButton.onclick = function() { // // //document.body.removeChild(docEle(_id)); // //document.body.removeChild(docEle(m)); // //return false; // } // newDiv.appendChild(saveButton); // // //newDiv.innerHTML += "      "; // // var cancelButton = document.createElement("a"); // cancelButton.href = "#"; // cancelButton.innerHTML = "取消"; // cancelButton.className="regular"; // cancelButton.onclick = function() { // document.body.removeChild(docEle(_id)); // document.body.removeChild(docEle(m)); // // return false; // } // newDiv.appendChild(cancelButton); } function refreshList(){ createGrid(); commonGridObj_total.$("dvRecvRMBVal").innerHTML = ""; commonGridObj_total.$("dvPayRMBVal").innerHTML = ""; commonGridObj_total.$("dvRMBProfitVal").innerHTML = ""; commonGridObj_total.$("dvUSRecvVal").innerHTML = ""; commonGridObj_total.$("dvUSPayVal").innerHTML = ""; commonGridObj_total.$("dvUSProfitVal").innerHTML = ""; commonGridObj_total.$("dvOtherCurrencyRecvVal").innerHTML = ""; commonGridObj_total.$("dvOtherCurrencyPayVal").innerHTML = ""; commonGridObj_total.$("dvOtherCurrencyProfitVal").innerHTML = ""; commonGridObj_total.$("dvRecvTotalVal").innerHTML = ""; commonGridObj_total.$("dvPaySumVal").innerHTML = ""; commonGridObj_total.$("dvProfitTotalVal").innerHTML = ""; commonGridObj_total.$("dvProfitRateVal").innerHTML = ""; } function checkAll(objName,iType){ if(objName == "recv"){ if(commonGridObj_recv != null){ if(commonGridObj_recv.getGridObj().getRowsNum() > 0){ if(iType != null){ for(var i = 0;i 0){ if(iType != null){ for(var i = 0;i 0){ if(iType != null){ for(var i = 0;i 0){ if(window.confirm("您确定批准通过所选委托业务内所有待审核的费用")){ for(var j = 0;j=1){ alert("批量审核成功!"); createGrid(); } } } else { if(unauditCount == 0||unauditCount==1){ alert("您没有选择要审核的费用内容"); } } } //批量加锁 function batchtLock(){ var selectCount = 0; var auditCount = 0; var unauditCount = 0; var unfinishfee = 0; var selectGroup = new Array(); var selectGroupoplb = new Array(); for(var i = 0;i 0){ if(window.confirm("您确定批准通过所选委托业务内所有待审核的费用")){ for(var j = 0;j 0){ alert("批量加锁 共 "+selectCount+" 条 成功加锁 "+auditCount+" 条 未能完成加锁 "+unauditCount+" 条 错误原因:存在未审核的费用信息无法锁定"); }else{ alert("批量加锁 共 "+selectCount+" 条 成功加锁 "+auditCount+" 条 未能完成加锁 "+unauditCount+" 条"); } } } else{ if(unauditCount == 0){ alert("您没有选择要审核的费用内容"); } } } //解锁 function batchUnlock(){ var selectCount = 0; var auditCount = 0; var unauditCount = 0; var selectGroup = new Array(); var selectGroupoplb = new Array(); for(var i = 0;i 0){ if(window.confirm("您确定批准通过所选委托业务内所有待审核的费用")){ for(var j = 0;j