var u = "";
var w = "";
var gid = "";
var BillNo = "";
var pageCount = 20; //每页计数
var UrlParam = "";
var cacheKey = "";
var gid = "";
var search = "";
var au = "";
var companyid = "";
var pageTotalCount = 0;
var totalCount = 0;
var url = "";
var rdoAuditing = "";
var pageNum = 0;
var settlementClient = "";
var winWidth = 0;
var winHeight = 0;
var itemContainHeight = 0;
var bsno = "";
var optReturn = false;
var optAuditing = false;
var showBgParam = -1;
var auditingoverrule = false;
var isAuditing = false;
var billNo = ""; //申请单号
var billStatus = 0; //状态
var statusName = ""; //状态名称
var customerName = ""; //结算单位
var amountRMB = ""; //RMB
var amountUSD = ""; //USD
var applyTime = ""; //申请日期
var applicantName = ""; //申请人
var payableTime = ""; //支付日期
var invno = ""; //发票号
$(function () {
$.ajaxSetup({ async: false });
winWidth = document.documentElement.clientWidth;
winHeight = document.documentElement.clientHeight;
itemContainHeight = winHeight / 16 - 5.625;
var imgWidth = 218 * winWidth / 1080;
var imgHeight = imgWidth * 99 / 218;
$("[rel='confirm']").css("width", imgWidth / 16 + "em");
$("[rel='confirm']").css("height", imgHeight / 16 + "em");
$("#txtReason").val("请添加备注信息或者驳回原因");
$("#txtReason").width($("#laybg").width() - 2);
$(".itemContain").css("height", itemContainHeight + "em");
if ($("#txtReason").val() == "请添加备注信息或者驳回原因") {
$("#txtReason").css("color", "#acacac");
}
else {
$("#txtReason").css("color", "#303030");
}
$("[rel='auditingButton']").css("display", "none");
$("#btnPassDisenable").css("display", "inline-block");
$("#btnRejectDisenable").css("display", "inline-block");
gid = UrlParm.parm("id");
u = UrlParm.parm("u");
w = UrlParm.parm("w");
fnBaseInfo(gid);
fnPaymentDetailInfo(BillNo);
//fnShowBaseInfo(); //$("#baseInfo").css("display", "block")
$("#txtReason").focus(function () {
$("#txtReason").css("color", "#303030");
$("#txtReason").select();
});
$("#txtReason").blur(function () {
if ($("#txtReason").val() == "请添加备注信息或者驳回原因") {
$("#txtReason").css("color", "#acacac");
}
else {
$("#txtReason").css("color", "#303030");
}
});
});
function fnReason() {
$("#txtReason").css("display", "block");
$("#historyList").css("display", "none");
}
function fnHistory() {
$("#txtReason").css("display", "none");
$("#historyList").css("display", "block");
}
function fnBaseInfo(gid) {
$.ajaxSetup({ async: false });
var strInfo = "";
UrlParam = "&i=" + jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), gid) ; //" + PageIndex + "
url = "../../Handler/Payment.ashx?action=1" + UrlParam;
$.ajax({
type: "post",
dataType: "json",
data: UrlParam,
url: url,
cache: false,
success: function (msg) {
strInfo = "";
$.each(msg, function (i, item) {
if (item.GID != "" && item.GID != "undefined" && item.GID != "null") {
billNo = item.BILLNO; //申请单号
BillNo = item.BILLNO;
billStatus = parseInt(item.BILLSTATUS); //状态
customerName = item.CUSTOMERNAME; //结算单位
settlementClient = item.CUSTOMERNAME;
amountRMB = new Number(item.AMOUNTRMB);
amountUSD = item.AMOUNTUSD; //USD
amountUSD = new Number(item.AMOUNTUSD);
applyTime = item.APPLYTIME; //申请日期
/*applyTime = applyTime.substring(0, 8);*/
applyTime = applyTime.replace(/\//g, "-");
applicantName = item.APPLICANTNAME; //申请人
payableTime = item.PAYABLETIME; //支付日期
/*payableTime = payableTime.substring(0, 8);
payableTime = payableTime.replace(/\//g, "-");*/
invno = item.INVNO; //发票号
switch (billStatus) {
case 0:
statusName = "已审核";
break;
case 1:
statusName = "未审核";
break;
case 2:
statusName = "未审核";
break;
case 6:
statusName = "已驳回";
break
default:
statusName = "未审核";
break;
}
strInfo += "
状 态:" + statusName + "";
//strInfo += "申请单号:" + billNo + "";
strInfo += "结算单位:" + customerName + "";
strInfo += "申请金额:¥ " + amountRMB.toFixed(2) + "";
strInfo += " $ " + amountUSD.toFixed(2) + "";
strInfo += "申请日期:" + applyTime + "";
strInfo += "申 请 人:" + applicantName + "";
strInfo += "申请支付日期:" + payableTime + "";
//strInfo += "发 票 号:" + invno + "";////////////////////////////////////
}
});
if (strInfo != "") {
$("#basicUL").html(strInfo);
}
}
});
}
function fnPaymentDetailInfo(billno) {
$.ajaxSetup({ async: false });
var strInfo = "";
var custno = ""; //委托编号
var mblno = ""; //主提单号
var customerName = ""; //委托单位
var etd = ""; //开船日期
var bsSource = ""; //业务来源
var feeName = ""; //费用名称
var feeType = 0; //收付类型
var typeName = "";
var amount = ""; //核销金额
var origCurrency = ""; //原始币别
var origAmount = ""; //原始金额
var invoiceSettleNo = ""; //发票号
var sale = ""; //揽货人
var feeTypeRef = ""; //收付类型
var currency = ""; //币别
var amount = ""; //金额
var num = 0;
var detailHeight = 0;
var iCount = 0;
UrlParam = "&b=" + jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), billno); //" + PageIndex + "
url = "../../Handler/Payment.ashx?action=2" + UrlParam;
$.ajax({
type: "post",
dataType: "json",
data: UrlParam,
url: url,
cache: false,
success: function (msg) {
strInfo = "";
$.each(msg, function (i, item) {
if (item.FEEID != "" && item.FEEID != undefined && item.FEEID != null) {
iCount++;
custno = item.CUSTNO; //委托编号
mblno = item.MBLNO; //主提单号
//customerName = item.CUSTOMERNAME; //委托单位
bsno = item.BSNO;
etd = item.ETD; //开船日期
//etd = etd.substring(0, 8);
//etd = etd.replace(/\//g, "-");
//bsSource = item.BSSOURCE; //业务来源
feeName = item.FEENAME; //费用名称
feeType = parseInt(item.FEETYPE); //收付类型
if (feeType == 1) { typeName = "收"; }
else { typeName = "付"; }
amount = new Number(item.AMOUNT);
origCurrency = item.ORIGCURRENCY; //原始币别
origAmount = new Number(item.ORIGAMOUNT);
feeTypeRef = item.FEETYPEREF; //收付类型
currency = item.CURRENCY; //币别
amount = new Number(item.AMOUNT);
//invoiceSettleNo = item.INVOICESETTLENO; //发票号
//sale = item.SALE; //揽货人
/*strInfo += "";
strInfo += "";
strInfo += "- " + iCount + " " + settlementClient + " " + feeName + "
";
strInfo += "- " + iCount + " " + settlementClient + " " + feeName + "
";
strInfo += "
";
strInfo += "";
strInfo += "- 委托编号:" + custno + "
";
strInfo += "- 主提单号:" + mblno + "
";
strInfo += "- 委托单位:" + settlementClient + "
"; //
strInfo += "- 开船日期:" + etd + "
";
strInfo += "- 业务来源:" + bsSource + "
";
strInfo += "- 费用名称:" + feeName + "
";
strInfo += "- 收付类型:" + typeName + "
";
strInfo += "- 原始币别:" + origCurrency + "
";
strInfo += "- 原始金额:" + origAmount.toFixed(2) + "
";
strInfo += "- 揽 货 人:" + sale + "
";
strInfo += "- 收付类型:" + feeTypeRef + "
";
strInfo += "- 币 别:" + currency + "
";
strInfo += "- 金 额:" + amount.toFixed(2) + "
";
strInfo += "
";
strInfo += "";*/
/*
- 货物信息2
- 业务锁定:
- 业务锁定:
- 业务锁定:
- 业务锁定:
- 业务锁定:
- 业务锁定:
- 业务锁定:
- 货物信息3
- 业务锁定:
- 业务锁定:
- 业务锁定:
- 业务锁定:
- 业务锁定:
- 业务锁定:
- 业务锁定:
*/
if (billStatus == 0) {
$("[rel='auditingButton']").css("display", "none");
$("#btnPassDisenable").css("display", "inline-block");
$("#btnRejectDisenable").css("display", "inline-block");
}
/*else {
$("[rel='auditingButton']").css("display", "none");
$("#btnPassEnable").css("display", "inline-block");
$("#btnRejectEnable").css("display", "inline-block");
}*/
strInfo += "";
strInfo += ""; //提单号、开船日期、金额、币别
strInfo += "- " + mblno + " " + etd + " " + amount.toFixed(2) + " " + currency + "
";
strInfo += "
";
strInfo += "";
strInfo += "- 委托编号:" + custno + "
";
strInfo += "- 主提单号:" + mblno + "
";
strInfo += "- 委托单位:" + settlementClient + "
"; //
strInfo += "- 开船日期:" + etd + "
";
strInfo += "- 业务来源:" + bsSource + "
";
strInfo += "- 费用名称:" + feeName + "
";
strInfo += "- 收付类型:" + typeName + "
";
strInfo += "- 原始币别:" + origCurrency + "
";
strInfo += "- 原始金额:" + origAmount.toFixed(2) + "
";
strInfo += "- 揽 货 人:" + sale + "
";
strInfo += "- 收付类型:" + feeTypeRef + "
";
strInfo += "- 币 别:" + currency + "
";
strInfo += "- 金 额:" + amount.toFixed(2) + "
";
strInfo += "
";
strInfo += "";
num++;
}
});
if (strInfo != "") {
$("#detailUL").html(strInfo);
}
}
});
}
function fnItemSelect(id, containID) {
$("[rel='item']").removeClass("itemTitleLIHover");
$("[rel='item']").addClass("itemTitleLI");
$("#" + containID).removeClass("itemTitleLI");
$("#" + containID).addClass("itemTitleLIHover");
$("[rel='UL']").css("display", "none");
$("#" + id + "UL").css("display", "block");
$("[rel='auditingButton']").css("display", "none");
$("#btnPassDisenable").css("display", "inline-block");
$("#btnRejectDisenable").css("display", "inline-block");
if (id == "detail" && billStatus != 0 && billStatus != 6) {
$("[rel='auditingButton']").css("display", "none");
$("#btnPassEnable").css("display", "inline-block");
$("#btnRejectEnable").css("display", "inline-block");
}
}
function fnItemSelect2(id, containID) {
if ($("#" + id + "UL").css("display") == "none") {
$("[rel='item1']").removeClass("itemLIChild");
$("[rel='item1']").addClass("itemTitleLI");
$("#" + containID).removeClass("itemTitleLI");
$("#" + containID).addClass("itemLIChild");
$("[rel='UL1']").css("display", "none");
$("#" + id + "UL").css("display", "block");
}
else {
$("[rel='item1']").removeClass("itemLIChild");
$("[rel='item1']").addClass("itemTitleLI");
$("[rel='UL1']").css("display", "none");
}
}
function fnAuditing() {
var uid = "";
auditingoverrule = false;
var txtReason = $("#txtReason").val();
if (txtReason == "请添加备注信息或者驳回原因") { txtReason = ""; }
$.ajax({
type: "post",
dataType: "json",
//url: "../../Handler/Payment.ashx?action=4&r=" + jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), txtReason) + "&bo=" + escape(bsno) + "&id=" + jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), uid) + "&b=" + jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), BillNo) + "&w=" + jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), "FeeSettleAudit"),
url: "../../Handler/Payment.ashx?action=4&gid=" + jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), gid),
cache: false,
success: function (msg) {
//fnPaymentAuditingList();/**/
//optAuditing = true;
//showBg("1", "审核已通过!");
//$("#txtReason").val("请添加备注信息或者驳回原因");
showBg("1", "已完成审核");
//window.location.href = "/MPayment/PaymentList?u=" + escape(u) + "&w=" + escape(w);
}
});
isAuditing = true;
$("[rel='auditingButton']").css("display", "none");
$("#btnPassDisenable").css("display", "inline-block");
$("#btnRejectDisenable").css("display", "inline-block");
closeBg();
}
function fnAuditingOverrule() {
var uid = "";
auditingoverrule = true;
var txtReason = $("#txtReason").val();
$.ajax({
type: "post",
dataType: "json",
url: "../../Handler/Payment.ashx?action=5&gid=" + jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), gid),
cache: false,
success: function (msg) {/**/
//$("#txtReason").val("请添加备注信息或者驳回原因");
showBg("1", "已完成驳回");
//window.location.href = "/MPayment/PaymentList?u=" + escape(u) + "&w=" + escape(w);
}
});
isAuditing = true;
$("[rel='auditingButton']").css("display", "none");
$("#btnPassDisenable").css("display", "inline-block");
$("#btnRejectDisenable").css("display", "inline-block");
closeBg();
}
function fnIndex() {
window.location.href = "/Home/Index?u=" + escape(decrypt(u, decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"))) + "&w=" + escape(decrypt(w, decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs")));
}
function fnReturn() {
//window.location.href = "/MPayment/PaymentList?u=" + escape(u) + "&w=" + escape(w);
history.back();
}
function fnAuditingJudgement(param) {
if (param == "1") {
showBg("2", "是否确定批准支付");
}
else if (param == "0") {
fnAuditingOverrule();
}
}
//显示灰色 jQuery 遮罩层
function showBg(param, msg) {
$.ajaxSetup({ async: false });
var layTitleWidth;
var layTitleHeight;
layTitleWidth = ($("#laybg").width() + 2) / 16;
layTitleHeight = (layTitleWidth * 280) / 800;
if (param == "0") {
optReturn = false;
$("[rel='optLay']").css("display", "none");
$("#optAuditing").css("display", "block");
showBgParam = 0;
}
else if (param == "1") {
optReturn = true;
$("[rel='optLay']").css("display", "none");
$("#optReturn").css("display", "block");
$(".auditingMsg").html(msg);
showBgParam = 1;
}
else if (param == "2") {
optReturn = true;
$("[rel='optLay']").css("display", "none");
$("#optReturn").css("display", "block");
$(".auditingMsg").html(msg);
showBgParam = 2;
}
$("#layUserInfo").css("height", (($("#laybg").height() - 35) / 16) - layTitleHeight + "em");
$("#maskUser").width(winWidth);
$("#maskUser").height(winHeight);
$("#maskUser").css("display", "block");
$("#laybg").css("display", "block");
$("#laybg").css("min-height", $("#laybg").height() / 16 + "em");
}
//关闭灰色 jQuery 遮罩
function closeBg() {
$("#maskUser").css("display", "none");
$("#laybg").css("display", "none");
}