148 lines
5.4 KiB
Plaintext
148 lines
5.4 KiB
Plaintext
@using WX.CRM.WebHelper;
|
||
@{
|
||
ViewBag.Title = "短信查询";
|
||
Layout = "~/Views/Shared/_Index_Layout2.cshtml";
|
||
}
|
||
<div class="mvctool">
|
||
@Html.ToolButton("btnQuery", "icon-search", "查询", true)
|
||
@Html.Action("ToolBar", "Control", ViewBag.ToolBar as ToolBar)
|
||
</div>
|
||
<div class="bas_datagrid">
|
||
<div id="tb" style="padding:5px;height:auto" class="grid_toolbar">
|
||
<ul class="toolBar_ul">
|
||
<li>开始时间:@Html.WdatePickerText("txt_stime", DateTime.Now.ToString("yyyy-MM-dd 00:00:00"), true, "style='width:180px;'") </li>
|
||
<li>结束时间:@Html.WdatePickerText("txt_etime", DateTime.Now.ToString("yyyy-MM-dd 23:59:59"), true, "style='width:180px;'") </li>
|
||
@*<li class="LiUserComBoxByRole">
|
||
@Html.Action("UserComBoxByRole", "Control", new { controlName = "nb1", roleCodes = ViewBag.roleCodes, saledeptid = "", salegroupid = ViewBag.userGroupId, iseid = "0", inneruserid = ViewBag.inneruserid, currentRight = WX.CRM.WebHelper.InitRights.CONST_短信查询 })
|
||
</li>*@
|
||
<li>@Html.Action("UserComBox", "Control")</li>
|
||
<li class="LiUserComBoxByRole">短信类型: @Html.DropDownList("slt_msgtypeId", ViewBag.messageType as IEnumerable<SelectListItem>)</li>
|
||
<li>客户ID:<input type="text" name="txt_ResId" style="width:150px;" /> </li>
|
||
|
||
<li>
|
||
@*@Html.ToolButtonPlain("btnQuery" , "icon-search", "查询", false, "")*@
|
||
</li>
|
||
</ul>
|
||
</div>
|
||
@Html.Raw(ViewBag.gridTable)
|
||
</div>
|
||
<script type="text/javascript">
|
||
var IsUser = 0;
|
||
$(function () {
|
||
$('#tablist').tablegrid({
|
||
url: '/Sms/SmsMessage/GetSmsMessageHtml',
|
||
height: $(window).height() - 110,
|
||
loadNow: false,
|
||
//data: GetControlValue
|
||
});
|
||
function GetControlValue() {
|
||
return { saleDeptId: $("#nb1_uc_org_depts").val(), groupId: $("#nb1_uc_org_groups").val(), userId: $("#nb1_uc_org_ids").val() };
|
||
}
|
||
$("#btnQuery").click(function () {//搜索按钮点击事件
|
||
IsUser = 0;
|
||
//var checkdtime = DateDiff();
|
||
//if (checkdtime == 0) {
|
||
// return;
|
||
//}
|
||
|
||
$(".LiUserComBoxByRole").show();
|
||
$('#tablist').tablegrid({
|
||
url: '/Sms/SmsMessage/GetSmsMessageHtml',
|
||
height: $(window).height() - 110,
|
||
loadNow: true,
|
||
data: GetControlValue
|
||
});
|
||
});
|
||
|
||
|
||
|
||
$(window).resize(function () {//自动适应大小
|
||
$('#tablist').tablegrid('resize', {
|
||
height: $(window).height() - 110
|
||
});
|
||
});
|
||
});
|
||
|
||
function onLoadSucced() {
|
||
$('#tablist').tablegrid("Search");
|
||
}
|
||
|
||
//导出订单列表
|
||
function btnexport_Click() {
|
||
var checkdtime = DateDiff();
|
||
if (checkdtime == 0) {
|
||
return;
|
||
}
|
||
|
||
if (IsUser == 1)
|
||
{
|
||
$("#modalwindow").html(GetIframeHtml("/Control/ExcelExport?Query=" + encodeURIComponent("/Sms/SmsMessage/ListExport?" + GetQueryStr() + "&userId=1" + "&" + getPageOptions("tablist"))));
|
||
} else
|
||
{
|
||
$("#modalwindow").html(GetIframeHtml("/Control/ExcelExport?Query=" + encodeURIComponent("/Sms/SmsMessage/ListExport?" + GetQueryStr() + "&" + getPageOptions("tablist"))));
|
||
}
|
||
|
||
|
||
$("#modalwindow").window({ title: '导出', width: 480, height: 300, iconCls: 'icon-export' }).window('open');
|
||
};
|
||
|
||
|
||
//用户查询
|
||
function btnUserQuery_Click() {
|
||
IsUser = 1;
|
||
//var checkdtime = DateDiff();
|
||
//if (checkdtime == 0) {
|
||
// return;
|
||
//}
|
||
$(".LiUserComBoxByRole").hide();
|
||
$('#tablist').tablegrid({
|
||
url: '/Sms/SmsMessage/GetSmsMessageHtml',
|
||
height: $(window).height() - 110,
|
||
loadNow: true,
|
||
data: { userId: 1 }
|
||
});
|
||
};
|
||
|
||
function DateDiff() {
|
||
end_str = $("#txt_stime").val().replace(/-/g, "/");//一般得到的时间的格式都是:yyyy-MM-dd hh24:mi:ss,所以我就用了这个做例子,是/的格式,就不用replace了。
|
||
var end_date = new Date(end_str);//将字符串转化为时间
|
||
//开始时间
|
||
|
||
var sta_date = new Date();
|
||
var num = (sta_date - end_date) / (1000 * 3600 * 24);//求出两个时间的时间差,这个是天数
|
||
var days = parseInt(Math.ceil(num));//转化为整天(小于零的话剧不用转了)
|
||
if (days > 30) {
|
||
$.messager.alert("提示", "开始时间距离今天不能超过30天!");
|
||
return 0;
|
||
}
|
||
else {
|
||
return 1;
|
||
}
|
||
|
||
}
|
||
|
||
function GetIframeHtml(src) {
|
||
return "<iframe width='100%' height='98%' scrolling='auto' frameborder='0'' src='" + src + "'></iframe>";
|
||
}
|
||
function frameReturnByClose() {
|
||
$("#modalwindow").window('close');
|
||
}
|
||
function frameReturnByReload(flag) {
|
||
$("#tablist").tablegrid("Load");
|
||
}
|
||
|
||
function getPageOptions(gridID) {
|
||
var option = $("#tablist").tablepage('getPagination');
|
||
var str = "rows=" + option.rows + "&page=" + option.page + "&order=" + option.order + "&sort=" + option.sort;
|
||
return str;
|
||
}
|
||
//获取datagrid头部及字段
|
||
function getDataGridHeader() {
|
||
var columns = $('#tablist').tablegrid("getHead");
|
||
var list = eval(columns);
|
||
list.splice(1, 4);
|
||
return list;
|
||
}
|
||
|
||
</script>
|