269 lines
11 KiB
Plaintext
269 lines
11 KiB
Plaintext
@using WX.CRM.WebHelper;
|
||
@{
|
||
ViewBag.Title = "待办事项";
|
||
Layout = "~/Views/Shared/_Index_Layout2.cshtml";
|
||
}
|
||
<script type="text/javascript">
|
||
$(function () {
|
||
|
||
$('#tablist').tablegrid({
|
||
url: '/Csvr/ToDoItem/GetImportantHtmlList',
|
||
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)
|
||
</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>@Html.Action("UserSSOComBox", "Control", new { currentRight = WX.CRM.WebHelper.InitRights.CONST_公共权限 })</li>
|
||
<li>客户ID:<input name="txt_resid" type="text" style="width:150px;" placeholder="客户ID" autocomplete="off" /></li>
|
||
@*<li>姓名:<input name="txt_cname" type="text" style="width:150px;" placeholder="姓名" autocomplete="off" /></li>*@
|
||
<li>
|
||
大类:
|
||
<select id="slt_eventid" name="slt_eventid" onchange="eventid_changed(this)">
|
||
</select>
|
||
</li>
|
||
<li>
|
||
小类:
|
||
<select id="slt_eventtypename" name="slt_eventtypename">
|
||
</select>
|
||
</li>
|
||
@*<li>重要线索内容:<input name="txt_eventmemo" type="text" style="width:150px;" placeholder="重要线索内容" autocomplete="off" /></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>
|
||
是否已读:
|
||
<select id="slt_isread" name="slt_isread">
|
||
<option value="">不限</option>
|
||
<option value="1">已读</option>
|
||
<option value="0">未读</option>
|
||
</select>
|
||
</li>
|
||
<li>已读时间:@Html.WdatePickerText("txt_readtimestart", "")~@Html.WdatePickerText("txt_readtimeend", "")</li>
|
||
</ul>
|
||
</div>
|
||
|
||
@Html.Raw(ViewBag.List)
|
||
</div>
|
||
<script type="text/javascript">
|
||
function onLoadSucced() {
|
||
init_select(function(){
|
||
$('#tablist').tablegrid("Search");
|
||
});
|
||
}
|
||
function GetIframeHtml(src) {
|
||
return "<iframe width='100%' height='98%' scrolling='auto' 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;
|
||
}
|
||
|
||
function init_select(next) {
|
||
$.ajax({
|
||
url: '/Csvr/ToDoItem/GetEventTypeSelect',
|
||
type: 'POST',
|
||
data: "",
|
||
dataType: 'json',
|
||
success: function (data) {
|
||
var sb = '';
|
||
sb += '<option value="">全部</option>';
|
||
if (data.data && data.data.length > 0) {
|
||
for (var i = 0; i < data.data.length; i++) {
|
||
var item = data.data[i];
|
||
sb += '<option value="' + item.Value + '">' + item.Key + '</option>';
|
||
}
|
||
}
|
||
$('#slt_eventid').html(sb);
|
||
$('#slt_eventtypename').html('<option value="">全部</option>');
|
||
next && next()
|
||
},
|
||
fail: function (e) {
|
||
console.log(e);
|
||
$('#slt_eventid').html('<option value="">全部</option>');
|
||
$('#slt_eventtypename').html('<option value="">全部</option>');
|
||
next && next()
|
||
}
|
||
});
|
||
}
|
||
|
||
function eventid_changed(sender) {
|
||
var eventid = $(sender).val();
|
||
if (!eventid) {
|
||
$('#slt_eventtypename').html('<option value="">全部</option>');
|
||
return;
|
||
}
|
||
$.ajax({
|
||
url: '/Csvr/ToDoItem/GetEventTypeSelect',
|
||
type: 'POST',
|
||
data: "eventid=" + (eventid ? eventid:''),
|
||
dataType: 'json',
|
||
success: function (data) {
|
||
var sb = '';
|
||
sb += '<option value="">全部</option>';
|
||
if (data.data && data.data.length > 0) {
|
||
for (var i = 0; i < data.data.length; i++) {
|
||
var item = data.data[i];
|
||
sb += '<option value="' + item.Value + '">' + item.Key + '</option>';
|
||
}
|
||
}
|
||
$('#slt_eventtypename').html(sb);
|
||
},
|
||
fail: function (e) {
|
||
console.log(e);
|
||
$('#slt_eventtypename').html('<option value="">全部</option>');
|
||
}
|
||
});
|
||
}
|
||
|
||
function show_detail(sender, id, resid, appid, appuserid, isread) {
|
||
$("#modalwindow").html(GetIframeHtml("@(ViewBag.Host)/?appid=" + appid + "&appuserid=" + appuserid));
|
||
$("#modalwindow").window({ title: '重要线索', width: 400, height: 650, iconCls: 'icon-add' }).window('open');
|
||
edit_read(sender, id, isread);
|
||
}
|
||
|
||
function show_user(sender, id, resid, isread) {
|
||
parent.ChildAddTab('客户详细', '/Csvr/CustomerInfo/CustomerDetail?resid=' + resid, '');
|
||
edit_read(sender, id, isread);
|
||
}
|
||
|
||
function edit_read(sender, id, isread) {
|
||
$.ajax({
|
||
url: '/Csvr/ToDoItem/EditRead',
|
||
type: 'POST',
|
||
data: "id=" + id,
|
||
dataType: 'json',
|
||
success: function (data) {
|
||
if (data && sender && isread != '1') {
|
||
$(sender.parentNode.parentNode).find('td[field=isread]').html('已读');
|
||
$(sender.parentNode.parentNode).find('td[field=readtime]').html(format_time());
|
||
//$('#tablist').tablegrid("Search");
|
||
}
|
||
},
|
||
fail: function (e) {
|
||
console.log(e);
|
||
}
|
||
});
|
||
}
|
||
|
||
function format_time(dt, format) {
|
||
if (!dt) {
|
||
dt = new Date();
|
||
}
|
||
if (!format) {
|
||
format = 'yyyy-MM-dd HH:mm:ss';
|
||
}
|
||
format = format.replace(/yyyy/, dt.getFullYear());
|
||
format = format.replace(/MM/, (dt.getMonth() + 1).toString().padStart(2, '0'));
|
||
format = format.replace(/dd/, dt.getDate().toString().padStart(2, '0'));
|
||
format = format.replace(/HH/, dt.getHours().toString().padStart(2, '0'));
|
||
format = format.replace(/mm/, dt.getMinutes().toString().padStart(2, '0'));
|
||
format = format.replace(/ss/, dt.getSeconds().toString().padStart(2, '0'));
|
||
return format;
|
||
}
|
||
</script> |