TG.WXCRM.V4/WEB/Views/Csvr/ToDoItem/Index.cshtml

194 lines
8.5 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@using WX.CRM.WebHelper;
@{
ViewBag.Title = "待办事项";
Layout = "~/Views/Shared/_Index_Layout2.cshtml";
}
<script type="text/javascript">
$(function () {
$('#tablist').tablegrid({
url: '/Csvr/ToDoItem/GetHtmlList',
height: $(window).height() - 110,
loadNow: false,
isCheckMore: true
//data: GetControlValue
});
//function GetControlValue() {
// return { groupId: user.getGroups(), userId: user.getUser() };
//}
function GetControlValue() {
return { saleDeptId: $("#nb1_uc_org_depts").val(), groupId: $("#nb1_uc_org_groups").val(), userId: $("#nb1_uc_org_ids").val() };
}
//$('#tablist').tablegrid("Load");
$(window).resize(function () {//自动适应大小
$('#tablist').tablegrid('resize', {
height: $(window).height() - 110
});
});
$("#btnQuery").click(function () {
$('#tablist').tablegrid("Search");
});
});
//ifram 返回
function frameReturnByClose() {
$("#modalwindow").window('close');
}
function frameReturnByReload(flag) {
$("#tablist").tablegrid("Load");
}
function frameReturnByMes(mes) {
$.messageBox5s('提示', mes);
}
</script>
<div class="mvctool">
@Html.ToolButton("btnQuery", "icon-search", "查询", true)
@Html.Action("ToolBar", "Control", ViewBag.ToolBar as ToolBar)
@Html.ToolButton("btnExport", "icon-export", "导出", "Export_Click", true)
</div>
<div class="bas_datagrid">
<div id="tb" style="padding:5px;height:auto" class="grid_toolbar">
<ul class="toolBar_ul">
@*<li>@Html.Action("UserComBoxByRole", "Control", new { onLoadSucced = "onLoadSucced()", controlName = "nb1", roleCodes = ViewBag.roleCodes, saledeptid = ViewBag.saleDeptId, salegroupid = ViewBag.userGroupId, iseid = "0", inneruserid = ViewBag.inneruserid })</li>*@
<li>客户ID<input name="txt_resid" type="text" style="width:150px;" placeholder="客户ID" autocomplete="off" /></li>
<li>@Html.Action("UserSSOComBox", "Control", new { currentRight = WX.CRM.WebHelper.InitRights.CONST_公共权限 })</li>
<li>
完成状态: @Html.DropDownList("slt_status", new List<SelectListItem>() {
new SelectListItem(){ Text="未完成",Value="0"},
new SelectListItem(){ Text="已完成",Value="1"},
new SelectListItem(){ Text="所有",Value=""}
})&nbsp;
</li>
<li>
@*1 点击
2 报名
6 登录
7 关注
8 取关
12 加好友
17 听课
20 聊天
31 体验*@
事件:
<select name="slt_resourcetag">
<option value="">全部</option>
<option value="softlogin" @{ if (Request.QueryString["resourcetag"] == "softlogin") { @Html.Raw("selected=\"selected\"") } }>登录</option>
@*<option value="liveInteractive" @{ if (Request.QueryString["resourcetag"] == "liveInteractive") { @Html.Raw("selected=\"selected\"") } }>直播</option>*@
<option value="RFM" @{ if (Request.QueryString["resourcetag"] == "RFM") { @Html.Raw("selected=\"selected\"") } }>标签</option>
<option value="web">报名</option>
<option value="UserCenterEvent7">关注</option>
<option value="UserCenterEvent8">取消关注</option>
<option value="UserCenterEvent20">聊天信息</option>
<option value="UserCenterEvent31">体验到期</option>
<option value="UserCenterEvent17">听课</option>
<option value="UserCenterEvent1">点击</option>
<option value="UserCenterEvent12">加好友</option>
<option value="UserCenterEvent45">互动精选</option>
<option value="other">其他</option>
</select>
</li>
<li>提醒时间:@Html.WdatePickerText("txt_ctime", DateTime.Now.AddMonths(-1).ToString("yyyy-MM-dd"))~@Html.WdatePickerText("txt_etime", DateTime.Now.ToString("yyyy-MM-dd"))</li>
<li>待办事项:<input name="txt_memo" type="text" style="width:150px;" placeholder="待办事项" autocomplete="off" /></li>
<li>活动备注:<input name="txt_activity" type="text" style="width:150px;" placeholder="活动备注" autocomplete="off" /></li>
<li>
@{ List<WX.CRM.Model.Entity.BAS_BUSINESSLINES> list = ViewBag.deptList; }
事业部:
<select name="slt_deptlineid">
<option value="">全部</option>
@foreach (var item in list)
{
<option value="@item.BUSINESSID">@item.BUSINESSNAME</option>
}
</select>
</li>
</ul>
</div>
@Html.Raw(ViewBag.List)
</div>
<script type="text/javascript">
function onLoadSucced() {
$('#tablist').tablegrid("Search");
}
function GetIframeHtml(src) {
return "<iframe width='100%' height='98%' scrolling='no' frameborder='0'' src='" + src + "'></iframe>";
}
function Create_Click() {
$("#modalwindow").html(GetIframeHtml("/Csvr/ToDoItem/Add"));
$("#modalwindow").window({ title: '新增', width: 700, height: 400, iconCls: 'icon-add' }).window('open');
}
function Edit_Click() {
var row = $('#tablist').tablegrid('getSelected');
if (row != null) {
$("#modalwindow").html(GetIframeHtml("/Csvr/ToDoItem/Add?id=" + row.pkid));
$("#modalwindow").window({ title: '编辑', width: 700, height: 430, iconCls: 'icon-edit' }).window('open');
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
}
function Complete_Click() {
var row = $('#tablist').tablegrid('getSelections');
if (row.length == 0) {
$.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords');
return;
}
console.log(row);
var ids = "";
$(row).each(function (a,b) {
ids += "["+b.pkid+"]";
});
if (row != null) {
$.messager.confirm('提示', '您确定要完成此待办事项吗?', function (r) {
if (r) {
$.r_post("/Csvr/ToDoItem/Complete?allid=" + ids, function (data) {
if (data.type == 1) {
$('#tablist').tablegrid("Load");
$.messageBox5s('提示', data.message);
}
else {
$.messageBox5s('提示', data.message);
}
}, "json");
}
});
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
}
function gotoComplete(title, url, id) {
if (url != '') {
window.parent.ChildAddTab(title, url, '');
}
$.r_post("/Csvr/ToDoItem/Complete?allid=" + id, function (data) {
if (data.type == 1) {
$('#tablist').tablegrid("Load");
}
}, "json");
}
$(function () {
$("#tb .toolBar_ul").append("<li><a href=\"javascript:ShowTag()\" style='padding-left:10px;'>标签说明</a></li>")
});
function ShowTag() {
$("#modalwindow").html(GetIframeHtml("/tag.html"));
$("#modalwindow").window({ title: '标签说明', width: 700, height: 520, iconCls: 'icon-edit' }).window('open');
}
function Export_Click() {
var ctime= $("#txt_ctime").val();
var etime = $("#txt_etime").val();
if (ctime && etime) {
$("#modalwindow").html(GetIframeHtml("/Control/ExcelExport?Query=" + encodeURIComponent("/Csvr/ToDoItem/ExportAll?" + GetQueryStr())));
$("#modalwindow").window({ title: '导出', width: 480, height: 300, iconCls: 'icon-export' }).window('open');
} else {
alert("请选择提醒时间段在导出!");
}
}
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");
return columns;
}
</script>