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.

292 lines
13 KiB
JavaScript

11 months ago
var u = "";
var w = "";
var pageCount = 20; //每页计数
var UrlParam = "";
var cacheKey = "";
var gid = "";
var companyid = "";
var pageTotalCount = 0;
var totalCount = 0;
var url = "";
var rdoAuditing = "";
var pageNum = 0;
var auditingFlow = "FeeSettleAudit";
var chkBSChecked = false;
var chkAccChecked = false;
var chkETDChecked = false;
var isEnteringDate = false;
var strSearchDate = "";
var symbol = "null";
var strEFDate = "";
var strETDate = "";
var strAFDate = "";
var strATDate = "";
var strParam = "";
$(function () {
$.ajaxSetup({ async: false });
var winWidth = document.documentElement.clientWidth;
var winHeight = document.documentElement.clientHeight;
$("#txtETDFromDate").datepicker();
$("#txtETDToDate").datepicker();
$("#txtACCFromDate").datepicker();
$("#txtACCToDate").datepicker();
$('.jqtransform').jqTransform();
u = UrlParm.parm("u");
w = UrlParm.parm("w");
/*if ((winWidth <= 320)) { // && (winHeight == 985)
$("#css").attr("href", "lib/css/list960.css");
}
else if ((winWidth >= 360)) { // && (winHeight == 673)
$("#css").attr("href", "lib/css/list1080.css");
}*/
//marginBottom表示滚动条离底部的距离0表示滚动到最底部才加载可以根据需要修改
new NeuF.ScrollPage(window, { delay: 1000, marginBottom: 0 }, function (offset) {
if (offset > 0) {
//$("#Loadding").show(); //加载提示
setTimeout(function () {
//这里就是异步获取内容的地方,这里简化成一句话,可以根据需要修改
//$("#divContainer").append($("<div class='content'>第“" + ($(".content").size() + 1) + "”页内容</div>"));
pageNum++;
var searchKey = "";
if (symbol != "null") {
searchKey = $("#txtSearch").val() + symbol + strSearchDate;
}
else {
searchKey = $("#txtSearch").val();
}
/*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/Consignation.ashx?action=0&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;
fnList(pageTotalCount, url);*/
}, 1000);
}
});
$("#txtSearch").focus(function () {
$("#txtSearch").val("");
});
$("#txtSearch").blur(function () {
var txtSearchText = $("#txtSearch").val();
var strSearchText = new Array(); //定义一维数组
var result = "";
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);
}
});
fnConsignationList();
var itemContainHeight = winHeight - 5.625 * 16;
$("#listItemContain").height(itemContainHeight);
});
function fnComfirm() {
if ($("#txtETDFromDate").val() != "") { strEFDate = $("#txtETDFromDate").val(); }
if ($("#txtETDToDate").val() != "") { strETDate = $("#txtETDToDate").val(); }
if ($("#txtACCFromDate").val() != "") {
strAFDate = $("#txtACCFromDate").val();
}
if ($("#txtACCToDate").val() != "") {
strATDate = $("#txtACCToDate").val();
}
$("#inquireParameter").css("display", "none");
}
function fnClose() {
fnComfirm();
}
function fnParam() {
var _leftDatumPoint = 0;
var _topDatumPoint = 0;
var _scrollWidth = 0;
var _scrollHeight = 0;
var myDate = new Date();
var _year = myDate.getFullYear(); //获取完整的年份(4位,1970-????)
var _month = parseInt(myDate.getMonth()) + 1; //获取当前月份(0-11,0代表1月)
var _day = myDate.getDate(); //获取当前日(1-31)
_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; //96;
$(".dateMask").width(_scrollWidth);
$(".dateMask").height(_scrollHeight);
$(".dateContain").css("left", _leftDatumPoint / 16 + "em");
$(".dateContain").css("top", _topDatumPoint / 16 + "em");
$("#inquireParameter").css("display", "block");
}
function fnConsignationList() {
$.ajaxSetup({ async: false });
var searchKey = "";
searchKey = fnSearchParam();
pageTotalCount = 0;
strParam = "";
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="; }
pageNum++;
UrlParam = strParam + "&s=" + jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), searchKey) + "&t=" + pageNum + "&l=" + pageCount; //" + PageIndex + "
url = "../../Handler/Consignation.ashx?action=0&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;
fnList(pageTotalCount, url);
}
function fnList(pageTotalCount, url) {
var strInfo = "";
var customerName = "";
var custNo = "";
var bsno = "";
var imgName = ""; //0-已审批1-未提交2-已提交
$.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) {
custNo = item.CUSTNO;
customerName = item.CUSTOMERNAME;
bsno = item.BSNO;
strInfo += "<div class=\"listContain\">";
strInfo += "<div class=\"listImg\"><img src=\"../../Images/img03.png\" style=\"width:1.7917em;height:1.5em;\" /></div>";
strInfo += "<div class=\"listItem\"><a href=\"/Consignation/ConsignationInfo?u=" + escape(u) + "&w=" + escape(w) + "&b=" + escape(bsno) + "\" class=\"listText\">" + custNo + "&nbsp;" + customerName + "</a></div>";
strInfo += "</div>";
pageTotalCount++;
}
});
if (strInfo != "") {
//$("#listItemContain").css("height", 3.1875 * pageTotalCount + "em");
$("#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 CUSTNO like '%" + arrsearchValue[i].toString() + "%' or CUSTOMERNAME like '%" + arrsearchValue[i].toString() + "%' ";
}
else if (i < arrsearchValue.length - 1) {
strSearch += "MBLNO like '%" + arrsearchValue[i].toString() + "%' or or CUSTNO like '%" + arrsearchValue[i].toString() + "%' or CUSTOMERNAME like '%" + arrsearchValue[i].toString() + "%' ";
}
else if (i == arrsearchValue.length - 1) {
strSearch += "MBLNO like '%" + arrsearchValue[i].toString() + "%' or or CUSTNO like '%" + arrsearchValue[i].toString() + "%' or CUSTOMERNAME 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 CUSTNO like '%" + arrsearchValue[i].toString() + "%' or CUSTOMERNAME like '%" + arrsearchValue[i].toString() + "%' ";
}
else if (i < arrsearchValue.length - 1) {
strSearch += "MBLNO like '%" + arrsearchValue[i].toString() + "%' or or CUSTNO like '%" + arrsearchValue[i].toString() + "%' or CUSTOMERNAME like '%" + arrsearchValue[i].toString() + "%' ";
}
else if (i == arrsearchValue.length - 1) {
strSearch += "MBLNO like '%" + arrsearchValue[i].toString() + "%' or or CUSTNO like '%" + arrsearchValue[i].toString() + "%' or CUSTOMERNAME 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 CUSTNO like '%" + arrsearchValue[i].toString() + "%' or CUSTOMERNAME like '%" + arrsearchValue[i].toString() + "%' ";
}
else if (i < arrsearchValue.length - 1) {
strSearch += "MBLNO like '%" + arrsearchValue[i].toString() + "%' or or CUSTNO like '%" + arrsearchValue[i].toString() + "%' or CUSTOMERNAME like '%" + arrsearchValue[i].toString() + "%' ";
}
else if (i == arrsearchValue.length - 1) {
strSearch += "MBLNO like '%" + arrsearchValue[i].toString() + "%' or or CUSTNO like '%" + arrsearchValue[i].toString() + "%' or CUSTOMERNAME 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 CUSTNO like '%" + arrsearchValue[i].toString() + "%' or CUSTOMERNAME like '%" + arrsearchValue[i].toString() + "%' ";
}
else if (i < arrsearchValue.length - 1) {
strSearch += "MBLNO like '%" + arrsearchValue[i].toString() + "%' or or CUSTNO like '%" + arrsearchValue[i].toString() + "%' or CUSTOMERNAME like '%" + arrsearchValue[i].toString() + "%' ";
}
else if (i == arrsearchValue.length - 1) {
strSearch += "MBLNO like '%" + arrsearchValue[i].toString() + "%' or or CUSTNO like '%" + arrsearchValue[i].toString() + "%' or CUSTOMERNAME like '%" + arrsearchValue[i].toString() + "%' ) ";
}
}
}
else if (searchValue != "") {
strSearch = "(MBLNO like '%" + searchValue + "%' or CUSTNO like '%" + searchValue + "%' or CUSTOMERNAME 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);
}