100 lines
3.3 KiB
JavaScript
100 lines
3.3 KiB
JavaScript
|
|
function ChangeDateFormat(time) {
|
|
if (time != null) {
|
|
var date = new Date(parseInt(time.replace("/Date(", "").replace(")/", ""), 10));
|
|
var month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
|
|
var currentDate = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
|
|
return date.getFullYear() + "-" + month + "-" + currentDate;
|
|
}
|
|
return "";
|
|
}
|
|
//ifram 返回
|
|
function frameReturnByClose() {
|
|
$("#modalwindow").window('close');
|
|
}
|
|
function frameReturnByReload(flag) {
|
|
if (flag)
|
|
$("#List").datagrid('load');
|
|
else
|
|
$("#List").datagrid('reload');
|
|
}
|
|
function frameReturnByMes(mes) {
|
|
$.messageBox5s('提示', mes);
|
|
}
|
|
|
|
//获取参数返回 url
|
|
function GetQueryStr() {
|
|
var str = "";
|
|
//自动遍历读取 搜索栏目的text文本框
|
|
$(".toolBar_ul li [name^='txt_']").each(function () {
|
|
if ($(this).val() != "")
|
|
str += $(this).attr("name").replace("txt_", "") + "=" + encodeURI($.trim($(this).val())) + "&";
|
|
|
|
});
|
|
//下拉框
|
|
$(".toolBar_ul li [name^='slt_']").each(function () {
|
|
str += $(this).attr("name").replace("slt_", "") + "=" + encodeURI($(this).val()) + "&";
|
|
});
|
|
//单选框
|
|
$(".toolBar_ul li [name^='rdo_']:checked").each(function () {
|
|
str += $(this).attr("name").replace("rdo_", "") + "=" + encodeURI($(this).val()) + "&";
|
|
});
|
|
//复选框
|
|
var name = "";
|
|
$(".toolBar_ul li [name^='ckb_']:checked").each(function () {
|
|
if (name != "" && name != $(this).attr("name"))
|
|
str += "&";
|
|
if (name != $(this).attr("name"))
|
|
str += ($(this).attr("name").replace("ckb_", "") + "=" + encodeURI($(this).val()) + "");
|
|
else
|
|
str += ("," + $(this).val());//多选 用逗号隔开
|
|
name = $(this).attr("name");
|
|
});
|
|
|
|
if (name != "")
|
|
str += "&";
|
|
if (str.length > 0)
|
|
str = str.substr(0, str.length - 1);
|
|
return str;
|
|
}
|
|
//获取数据返回 params对象
|
|
function GetParams() {
|
|
var params = {};
|
|
//自动遍历读取 搜索栏目的text文本框
|
|
$(".toolBar_ul li [name^='txt_']").each(function () {
|
|
if ($(this).val() != "") {
|
|
params[$(this).attr("Name").replace("txt_", "")] = $.trim($(this).val());
|
|
}
|
|
});
|
|
//下拉框
|
|
$(".toolBar_ul li [name^='slt_']").each(function () {
|
|
params[$(this).attr("Name").replace("slt_", "")] = $(this).val();
|
|
});
|
|
//单选框
|
|
$(".toolBar_ul li [name^='rdo_']:checked").each(function () {
|
|
params[$(this).attr("Name").replace("rdo_", "")] = $(this).val();
|
|
});
|
|
//原始输出
|
|
$(".toolBar_ul li [name^='org_']").each(function () {
|
|
params[$(this).attr("Name")] = $(this).val();
|
|
});
|
|
//复选框
|
|
var nname = "";
|
|
var nvalue = "";
|
|
$(".toolBar_ul li [name^='ckb_']:checked").each(function () {
|
|
if (nname != "" && nname !== $(this).attr("Name").replace("ckb_", "")) {
|
|
var options = { nname: nvalue };
|
|
params[nname] = nvalue;
|
|
nvalue = $(this).val();
|
|
}
|
|
else
|
|
nvalue += ("," + $(this).val());//多选 用逗号隔开
|
|
nname = $(this).attr("Name").replace("ckb_", "");
|
|
});
|
|
if (nname != "") {
|
|
params[nname] = nvalue;
|
|
}
|
|
|
|
return params;
|
|
}
|