var u = "";
var w = "";
var pageCount = 20; //每页计数
var UrlParam = "";
var cacheKey = "";
var gid = "";
var companyid = "";
var pageTotalCount = 0;
var url = "";
var rdoAuditing = "";
var pageNum = 0;
var chkBSChecked = false;
var chkAccChecked = false;
var chkETDChecked = false;
var isEnteringDate = false;
var strSearchDate = "";
var symbol = "null";
var auditingStatusIsAll = "1";
var expenseStatusIsAll = "1";
var strBFDate = "";
var strBTDate = "";
var strAFDate = "";
var strATDate = "";
var strEFDate = "";
var strETDate = "";
var strParam = "";
$(function () {
$.ajaxSetup({ async: false });
var winWidth = document.documentElement.clientWidth;
var winHeight = document.documentElement.clientHeight;
$("#txtBSFromDate").datepicker();
$("#txtBSToDate").datepicker();
$("#txtETDFromDate").datepicker();
$("#txtETDToDate").datepicker();
$("#txtACCFromDate").datepicker();
$("#txtACCToDate").datepicker();
$('.jqtransform').jqTransform();
u = UrlParm.parm("u");
w = UrlParm.parm("w");
//document.body.scroll = "no";
$(".listCollection").height(winHeight);
//marginBottom表示滚动条离底部的距离,0表示滚动到最底部才加载,可以根据需要修改
new NeuF.ScrollPage(window, { delay: 1000, marginBottom: 0 }, function (offset) {
if (offset > 0) {
//$("#Loadding").show(); //加载提示
setTimeout(function () {
//这里就是异步获取内容的地方,这里简化成一句话,可以根据需要修改
//$("#divContainer").append($("
第“" + ($(".content").size() + 1) + "”页内容
"));
var searchKey = "";
if (strSearchDate != "") { // symbol != "null" && symbol != ","
searchKey = $("#txtSearch").val() + symbol + strSearchDate;
}
else {
searchKey = $("#txtSearch").val();
}
pageNum++;
UrlParam = "&id=" + jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), gid) + "&p=" + escape(jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), companyid)) + "&s=" + jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), searchKey) + "&i=" + pageNum + "&c=" + pageCount; //" + PageIndex + "
url = "../../Handler/Profit.ashx?action=0" + strParam + "&k=" + jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), cacheKey) + "&u=" + jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), decrypt(u, decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"))) + "&w=" + jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), decrypt(w, decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"))) + UrlParam;
fnBillList(pageTotalCount, url);
}, 1000);
}
});
$("#txtSearch").keydown(function () {
$("#txtSearch").css("color", "#7d7d7d");
});
/*$("#txtSearch").focus(function () {
//$("#txtSearch").val("");
if ($("#txtSearch").val() == "请输入提单号或者流水号") { $("#txtSearch").val(""); }
});*/
$("#txtSearch").focus(function () {
$("#txtSearch").val("");
});
$("#txtSearch").blur(function () {
var txtSearchText = $("#txtSearch").val();
var strSearchText = new Array(); //定义一维数组
var result = "";
if ($("#txtSearch").val() == "") {
//$("#txtSearch").css("color", "#acacac");
$("#txtSearch").val("请输入提单号或者流水号");
}
else {
$("#txtSearch").css("color", "#7d7d7d");
}
if (txtSearchText.indexOf(",") != -1) {
strSearchText = txtSearchText.split(",");
symbol = ",";
}
else if (txtSearchText.indexOf(";") != -1) {
strSearchText = txtSearchText.split(";");
symbol = ";";
}
else if (txtSearchText.indexOf("\\") != -1) {
strSearchText = txtSearchText.split("\\");
symbol = "\\";
}
else if (txtSearchText.indexOf("/") != -1) {
strSearchText = txtSearchText.split("/");
symbol = "/";
}
result = "";
if (strSearchText.length > 0) {
for (var iCount = 0; iCount < strSearchText.length; iCount++) {
if (!isDate(strSearchText[iCount])) {
result += strSearchText[iCount] + symbol;
}
}
}
result = result.substring(0, result.length - 1);
if (result != "") {
$("#txtSearch").val(result);
}
});
fnProfitAuditingBillList();
var itemContainHeight = winHeight - 5.625 * 16;
$("#listItemContain").height(itemContainHeight);
});
function isDate(dateString) {
if (dateString.trim() == "") return true;
var r = dateString.match(/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/);
if (r == null) {
//alert("请输入格式正确的日期\n\r日期格式:yyyy-mm-dd\n\r例 如:2008-08-08\n\r");
return false;
}
else {
return true;
}
}
function fnComfirm() {
if ($("#txtBSFromDate").val() != "") { strBFDate = $("#txtBSFromDate").val(); }
if ($("#txtBSToDate").val() != "") { strBTDate = $("#txtBSToDate").val(); }
if ($("#txtACCFromDate").val() != "") { strAFDate = $("#txtACCFromDate").val(); }
if ($("#txtACCToDate").val() != "") { strATDate = $("#txtACCToDate").val(); }
if ($("#txtETDFromDate").val() != "") { strEFDate = $("#txtETDFromDate").val(); }
if ($("#txtETDToDate").val() != "") { strETDate = $("#txtETDToDate").val(); }
$("#inquireParameter").css("display", "none");
}
function fnClose() {
fnComfirm();
}
function fnParam() {
var _leftDatumPoint = 0;
var _topDatumPoint = 0;
var _scrollWidth = 0;
var _scrollHeight = 0;
_scrollWidth = Math.max(document.body.scrollWidth, document.documentElement.scrollWidth);
_scrollHeight = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
_leftDatumPoint = document.body.scrollLeft + document.body.clientWidth / 2 - 130;
_topDatumPoint = 96; //document.body.scrollTop + document.body.clientHeight / 2 - 160;
$(".dateMask").width(_scrollWidth);
$(".dateMask").height(_scrollHeight);
$(".dateContain").css("left", _leftDatumPoint / 16 + "em");
$(".dateContain").css("top", _topDatumPoint / 16 + "em");
$("#inquireParameter").css("display", "block");
}
function fnProfitAuditingBillList() {
$.ajaxSetup({ async: false });
var pageTotalCount = 0;
var searchKey = "";
if ($("#chkAuditingStatus").attr("checked") == true) {
auditingStatusIsAll = "1";
}
else {
auditingStatusIsAll = "0";
}
searchKey = fnSearchParam();
if (!$("#chkAuditingStatus").attr("checked")) {
auditingStatusIsAll = "0"; //显示全部
}
else {
auditingStatusIsAll = "1"; //显示仅需审核业务
}
if (!$("#chkExpenseStatus").attr("checked")) {
expenseStatusIsAll = "0"; //显示全部
}
else {
expenseStatusIsAll = "1"; //费用明细仅显示待审核
}
strParam = "";
if (strBFDate != "") { strParam = "&bf=" + jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), strBFDate); }
else { strParam = "&bf="; }
if (strBTDate != "") { strParam += "&bt=" + jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), strBTDate); }
else { strParam += "&bt="; }
if (strAFDate != "") { strParam += "&af=" + jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), strAFDate); }
else { strParam += "&af="; }
if (strATDate != "") { strParam += "&at=" + jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), strATDate); }
else { strParam += "&at="; }
if (strEFDate != "") { strParam += "&ef=" + jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), strEFDate); }
else { strParam += "&ef="; }
if (strETDate != "") { strParam += "&et=" + jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), strETDate); }
else { strParam += "&et="; }
UrlParam = strParam + "&isall=" + auditingStatusIsAll + "&s=" + jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), searchKey) +"&t=1&l=10"; //" + PageIndex +
url = "../../Handler/Profit.ashx?action=0" + UrlParam;
fnBillList(pageTotalCount, url);
}
function fnBillList(pageTotalCount, url) {
var strInfo = "";
var customerName = "";
var bsno = "";
var mblno = "";
var oplb = "";
$.ajax({
type: "post",
dataType: "json",
data: UrlParam,
url: url,
cache: false,
success: function (msg) {
strInfo = "";
$.each(msg, function (i, item) {
if (item.BSNO != "" && item.BSNO != undefined && item.BSNO != null) {
mblno = item.MBLNO;
customerName = item.CUSTOMERNAME;
bsno = item.BSNO;
oplb = item.OPLB;
if ($("#chkExpenseStatus").attr("checked") == true) {
expenseStatusIsAll = "1";
}
else {
expenseStatusIsAll = "0";
}
strInfo += "";
strInfo += "
";
strInfo += "
";
strInfo += "
";
pageTotalCount++;
}
});
$("#listItemContain").html(strInfo);
}
});
}
function fnSearchParam() {
var strSearch = "";
var searchValue = $("#txtSearch").val();
if (searchValue != "请输入提单号或者流水号") {
if (searchValue.indexOf(",") != -1)
{
var arrsearchValue = searchValue.split(',');
for (var i = 0; i < arrsearchValue.length; i++) {
if (i == 0)
{
strSearch += "(MBLNO like '%" + arrsearchValue[i].toString() + "%' or HBLNO like '%" + arrsearchValue[i].toString() + "%' OR CUSTNO like '%" + arrsearchValue[i].toString() + "%' OR DOC like '%" + arrsearchValue[i].toString() + "%' OR PORTDISCHARGE like '%" + arrsearchValue[i].toString() + "%' OR CUSTOMERNAME='" + arrsearchValue[i].toString() + "' OR SALE='" + arrsearchValue[i].toString() + "' OR OP='" + arrsearchValue[i].toString() + "' OR CARRIER like '%" + arrsearchValue[i].toString() + "%' OR VESSEL like '%" + arrsearchValue[i].toString() + "%' OR VOYNO like '%" + arrsearchValue[i].toString() + "%' OR GOODSNAME like '%" + arrsearchValue[i].toString() + "%' ";
}
else if (i < arrsearchValue.length - 1)
{
strSearch += "or MBLNO like '%" + arrsearchValue[i].toString() + "%' or HBLNO like '%" + arrsearchValue[i].toString() + "%' OR CUSTNO like '%" + arrsearchValue[i].toString() + "%' OR DOC like '%" + arrsearchValue[i].toString() + "%' OR PORTDISCHARGE like '%" + arrsearchValue[i].toString() + "%' OR CUSTOMERNAME='" + arrsearchValue[i].toString() + "' OR SALE='" + arrsearchValue[i].toString() + "' OR OP='" + arrsearchValue[i].toString() + "' OR CARRIER like '%" + arrsearchValue[i].toString() + "%' OR VESSEL like '%" + arrsearchValue[i].toString() + "%' OR VOYNO like '%" + arrsearchValue[i].toString() + "%' OR GOODSNAME like '%" + arrsearchValue[i].toString() + "%' ";
}
else if (i == arrsearchValue.length - 1)
{
strSearch += "or MBLNO like '%" + arrsearchValue[i].toString() + "%' or HBLNO like '%" + arrsearchValue[i].toString() + "%' OR CUSTNO like '%" + arrsearchValue[i].toString() + "%' OR DOC like '%" + arrsearchValue[i].toString() + "%' OR PORTDISCHARGE like '%" + arrsearchValue[i].toString() + "%' OR CUSTOMERNAME='" + arrsearchValue[i].toString() + "' OR SALE='" + arrsearchValue[i].toString() + "' OR OP='" + arrsearchValue[i].toString() + "' OR CARRIER like '%" + arrsearchValue[i].toString() + "%' OR VESSEL like '%" + arrsearchValue[i].toString() + "%' OR VOYNO like '%" + arrsearchValue[i].toString() + "%' OR GOODSNAME like '%" + arrsearchValue[i].toString() + "%') ";
}
}
}
else if (searchValue.indexOf(";") != -1)
{
var arrsearchValue = searchValue.split(';');
for (var i = 0; i < arrsearchValue.length; i++)
{
if (i == 0)
{
strSearch += "(MBLNO like '%" + arrsearchValue[i].toString() + "%' or HBLNO like '%" + arrsearchValue[i].toString() + "%' OR CUSTNO like '%" + arrsearchValue[i].toString() + "%' OR DOC like '%" + arrsearchValue[i].toString() + "%' OR PORTDISCHARGE like '%" + arrsearchValue[i].toString() + "%' OR CUSTOMERNAME='" + arrsearchValue[i].toString() + "' OR SALE='" + arrsearchValue[i].toString() + "' OR OP='" + arrsearchValue[i].toString() + "' OR CARRIER like '%" + arrsearchValue[i].toString() + "%' OR VESSEL like '%" + arrsearchValue[i].toString() + "%' OR VOYNO like '%" + arrsearchValue[i].toString() + "%' OR GOODSNAME like '%" + arrsearchValue[i].toString() + "%' ";
}
else if (i < arrsearchValue.length - 1)
{
strSearch += "or MBLNO like '%" + arrsearchValue[i].toString() + "%' or HBLNO like '%" + arrsearchValue[i].toString() + "%' OR CUSTNO like '%" + arrsearchValue[i].toString() + "%' OR DOC like '%" + arrsearchValue[i].toString() + "%' OR PORTDISCHARGE like '%" + arrsearchValue[i].toString() + "%' OR CUSTOMERNAME='" + arrsearchValue[i].toString() + "' OR SALE='" + arrsearchValue[i].toString() + "' OR OP='" + arrsearchValue[i].toString() + "' OR CARRIER like '%" + arrsearchValue[i].toString() + "%' OR VESSEL like '%" + arrsearchValue[i].toString() + "%' OR VOYNO like '%" + arrsearchValue[i].toString() + "%' OR GOODSNAME like '%" + arrsearchValue[i].toString() + "%' ";
}
else if (i == arrsearchValue.length - 1)
{
strSearch += "or MBLNO like '%" + arrsearchValue[i].toString() + "%' or HBLNO like '%" + arrsearchValue[i].toString() + "%' OR CUSTNO like '%" + arrsearchValue[i].toString() + "%' OR DOC like '%" + arrsearchValue[i].toString() + "%' OR PORTDISCHARGE like '%" + arrsearchValue[i].toString() + "%' OR CUSTOMERNAME='" + arrsearchValue[i].toString() + "' OR SALE='" + arrsearchValue[i].toString() + "' OR OP='" + arrsearchValue[i].toString() + "' OR CARRIER like '%" + arrsearchValue[i].toString() + "%' OR VESSEL like '%" + arrsearchValue[i].toString() + "%' OR VOYNO like '%" + arrsearchValue[i].toString() + "%' OR GOODSNAME like '%" + arrsearchValue[i].toString() + "%') ";
}
}
}
else if (searchValue.indexOf("\\") != -1)
{
var arrsearchValue = searchValue.split('\\');
for (var i = 0; i < arrsearchValue.length; i++)
{
if (i == 0)
{
strSearch += "(MBLNO like '%" + arrsearchValue[i].toString() + "%' or HBLNO like '%" + arrsearchValue[i].toString() + "%' OR CUSTNO like '%" + arrsearchValue[i].toString() + "%' OR DOC like '%" + arrsearchValue[i].toString() + "%' OR PORTDISCHARGE like '%" + arrsearchValue[i].toString() + "%' OR CUSTOMERNAME='" + arrsearchValue[i].toString() + "' OR SALE='" + arrsearchValue[i].toString() + "' OR OP='" + arrsearchValue[i].toString() + "' OR CARRIER like '%" + arrsearchValue[i].toString() + "%' OR VESSEL like '%" + arrsearchValue[i].toString() + "%' OR VOYNO like '%" + arrsearchValue[i].toString() + "%' OR GOODSNAME like '%" + arrsearchValue[i].toString() + "%' ";
}
else if (i < arrsearchValue.length - 1)
{
strSearch += "or MBLNO like '%" + arrsearchValue[i].toString() + "%' or HBLNO like '%" + arrsearchValue[i].toString() + "%' OR CUSTNO like '%" + arrsearchValue[i].toString() + "%' OR DOC like '%" + arrsearchValue[i].toString() + "%' OR PORTDISCHARGE like '%" + arrsearchValue[i].toString() + "%' OR CUSTOMERNAME='" + arrsearchValue[i].toString() + "' OR SALE='" + arrsearchValue[i].toString() + "' OR OP='" + arrsearchValue[i].toString() + "' OR CARRIER like '%" + arrsearchValue[i].toString() + "%' OR VESSEL like '%" + arrsearchValue[i].toString() + "%' OR VOYNO like '%" + arrsearchValue[i].toString() + "%' OR GOODSNAME like '%" + arrsearchValue[i].toString() + "%' ";
}
else if (i == arrsearchValue.length - 1)
{
strSearch += "or MBLNO like '%" + arrsearchValue[i].toString() + "%' or HBLNO like '%" + arrsearchValue[i].toString() + "%' OR CUSTNO like '%" + arrsearchValue[i].toString() + "%' OR DOC like '%" + arrsearchValue[i].toString() + "%' OR PORTDISCHARGE like '%" + arrsearchValue[i].toString() + "%' OR CUSTOMERNAME='" + arrsearchValue[i].toString() + "' OR SALE='" + arrsearchValue[i].toString() + "' OR OP='" + arrsearchValue[i].toString() + "' OR CARRIER like '%" + arrsearchValue[i].toString() + "%' OR VESSEL like '%" + arrsearchValue[i].toString() + "%' OR VOYNO like '%" + arrsearchValue[i].toString() + "%' OR GOODSNAME like '%" + arrsearchValue[i].toString() + "%') ";
}
}
}
else if (searchValue.indexOf("/") != -1)
{
var arrsearchValue = searchValue.split('/');
for (var i = 0; i < arrsearchValue.length; i++)
{
if (i == 0)
{
strSearch += "(MBLNO like '%" + arrsearchValue[i].toString() + "%' or HBLNO like '%" + arrsearchValue[i].toString() + "%' OR CUSTNO like '%" + arrsearchValue[i].toString() + "%' OR DOC like '%" + arrsearchValue[i].toString() + "%' OR PORTDISCHARGE like '%" + arrsearchValue[i].toString() + "%' OR CUSTOMERNAME='" + arrsearchValue[i].toString() + "' OR SALE='" + arrsearchValue[i].toString() + "' OR OP='" + arrsearchValue[i].toString() + "' OR CARRIER like '%" + arrsearchValue[i].toString() + "%' OR VESSEL like '%" + arrsearchValue[i].toString() + "%' OR VOYNO like '%" + arrsearchValue[i].toString() + "%' OR GOODSNAME like '%" + arrsearchValue[i].toString() + "%' ";
}
else if (i < arrsearchValue.length - 1)
{
strSearch += "or MBLNO like '%" + arrsearchValue[i].toString() + "%' or HBLNO like '%" + arrsearchValue[i].toString() + "%' OR CUSTNO like '%" + arrsearchValue[i].toString() + "%' OR DOC like '%" + arrsearchValue[i].toString() + "%' OR PORTDISCHARGE like '%" + arrsearchValue[i].toString() + "%' OR CUSTOMERNAME='" + arrsearchValue[i].toString() + "' OR SALE='" + arrsearchValue[i].toString() + "' OR OP='" + arrsearchValue[i].toString() + "' OR CARRIER like '%" + arrsearchValue[i].toString() + "%' OR VESSEL like '%" + arrsearchValue[i].toString() + "%' OR VOYNO like '%" + arrsearchValue[i].toString() + "%' OR GOODSNAME like '%" + arrsearchValue[i].toString() + "%' ";
}
else if (i == arrsearchValue.length - 1)
{
strSearch += "or MBLNO like '%" + arrsearchValue[i].toString() + "%' or HBLNO like '%" + arrsearchValue[i].toString() + "%' OR CUSTNO like '%" + arrsearchValue[i].toString() + "%' OR DOC like '%" + arrsearchValue[i].toString() + "%' OR PORTDISCHARGE like '%" + arrsearchValue[i].toString() + "%' OR CUSTOMERNAME='" + arrsearchValue[i].toString() + "' OR SALE='" + arrsearchValue[i].toString() + "' OR OP='" + arrsearchValue[i].toString() + "' OR CARRIER like '%" + arrsearchValue[i].toString() + "%' OR VESSEL like '%" + arrsearchValue[i].toString() + "%' OR VOYNO like '%" + arrsearchValue[i].toString() + "%' OR GOODSNAME like '%" + arrsearchValue[i].toString() + "%') ";
}
}
}
else if (searchValue != "") {
strSearch = "(MBLNO like '%" + searchValue + "%' or HBLNO like '%" + searchValue + "%' or CUSTNO like '%" + searchValue + "%' or DOC like '%" + searchValue + "%' or PORTDISCHARGE like '%" + searchValue + "%'OR CUSTOMERNAME='" + searchValue + "' OR SALE='" + searchValue + "' OR OP='" + searchValue + "' OR CARRIER='" + searchValue + "' OR VESSEL like '%" + searchValue + "%' OR VOYNO like '%" + searchValue + "%' OR GOODSNAME like '%" + searchValue + "%') ";
}
}
return strSearch;
}
function fnIndex() {
window.location.href = "/Home/Index?u=" + escape(u) + "&w=" + escape(w); //encrypt(_mobile, _encrypt)
}
function fnReturn() {
window.location.href = "/Home/Index?u=" + escape(u) + "&w=" + escape(w);
}