331 lines
15 KiB
Plaintext
331 lines
15 KiB
Plaintext
@using WX.CRM.WebHelper;
|
||
@{
|
||
ViewBag.Title = "Index";
|
||
Layout = "~/Views/Shared/_Index_Layout2.cshtml";
|
||
}
|
||
|
||
<div class="mvctool">
|
||
@Html.ToolButton("btnQuery", "icon-search", "查询", true)
|
||
@Html.Action("ToolBar", "Control", ViewBag.ToolBar as ToolBar)
|
||
|
||
@{
|
||
var roles = ViewBag.roleCodes;
|
||
@*if (roles.IndexOf("[ZJZL]") >= 0 || roles.IndexOf("[GLY]") >= 0 || roles.IndexOf("[BMZG]") >= 0)
|
||
{
|
||
@Html.ToolButton("btnExport", "icon-export", "导出", "Export_Click", true)
|
||
@Html.ToolButton("btnChange", "icon-settings", "收藏调整", true)
|
||
}
|
||
if (roles.IndexOf("[ZJZL]") >= 0 || roles.IndexOf("[GLY]") >= 0)
|
||
{
|
||
@Html.ToolButton("btnSetting", "icon-settings", "设置", true)
|
||
}*@
|
||
}
|
||
<span style="height:30px; line-height:25px; padding-left:20px;">
|
||
@{ var enableText = "已关闭"; var enableColor = "red"; var favCustomerEnableCanCall = ViewBag.FavCustomerEnableCanCall as string; if (favCustomerEnableCanCall == "false") { enableText = "已开启"; enableColor = "green"; } }
|
||
收藏客户禁止他人外呼:<span style="font-weight:bold; color:@enableColor">@enableText</span>
|
||
@if (roles.IndexOf("[ZJZL]") >= 0 || roles.IndexOf("[GLY]") >= 0)
|
||
{
|
||
<text>(点击设置按钮更改状态)</text>
|
||
}
|
||
</span>
|
||
</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()", isShowDismiss = "1", type = "0", controlName = "nb1", roleCodes = ViewBag.roleCodes, saledeptid = ViewBag.saleDeptId, salegroupid = ViewBag.userGroupId, iseid = "0", inneruserid = ViewBag.inneruserid })*@
|
||
@Html.Action("UserSSOComBox", "Control", new { currentRight = WX.CRM.WebHelper.InitRights.CONST_收藏客户列表 })
|
||
</li>
|
||
@{
|
||
if (roles.IndexOf("[ZJZL]") >= 0 || roles.IndexOf("[GLY]") >= 0 || roles.IndexOf("[BMZG]") >= 0)
|
||
{
|
||
<li>工号:@Html.TextBox("txt_eid")</li>
|
||
}
|
||
}
|
||
<li>收藏类型:@Html.DropDownList("slt_subcomgroupId", new WX.CRM.WEB.Handler.ControlResource().GetBas_subcomTypeList(0)) </li>
|
||
<li>创建时间:@Html.WdatePickerText("txt_STime", "")-@Html.WdatePickerText("txt_ETime", "")</li>
|
||
<li>备注:@Html.TextBox("txt_remark")</li>
|
||
<li>客户ID:@Html.TextBox("txt_resId")</li>
|
||
<li>是否成交:@Html.DropDownList("slt_hasorder", new List<SelectListItem>() { new SelectListItem() { Text = "全部", Value = "" }, new SelectListItem() { Text = "是", Value = "1" }, new SelectListItem() { Text = "否", Value = "0" } })</li>
|
||
<li>是否风险客户:@Html.DropDownList("slt_IsFx", new List<SelectListItem>() { new SelectListItem() { Text = "全部", Value = "" }, new SelectListItem() { Text = "是", Value = "1" }, new SelectListItem() { Text = "否", Value = "0" } })</li>
|
||
</ul>
|
||
</div>
|
||
@Html.Raw(ViewBag.List)
|
||
</div>
|
||
<div id="settingDiv" style="display:none;">
|
||
<ul>
|
||
<li style="height:35px; line-height:35px;">
|
||
状态:<select id="slt_cancall"><option value='false'>开启</option><option value='true'>关闭</option></select>
|
||
<input type="button" value="确定" id="Save" />
|
||
</li>
|
||
<li>
|
||
经理能否外呼自己部门的资源:<select id="slt_jlwh"><option value="true">能</option><option value="false">否</option></select>
|
||
<input type="button" value="确定" id="JlSave" />
|
||
</li>
|
||
<li>
|
||
组长能否外呼自己组别的资源:<select id="slt_zzwh"><option value="true">能</option><option value="false">否</option></select>
|
||
<input type="button" value="确定" id="zzSave" />
|
||
</li>
|
||
<li>
|
||
组员能否外呼同一组别的资源:<select id="slt_zywh"><option value="true">能</option><option value="false">否</option></select>
|
||
<input type="button" value="确定" id="zySave" />
|
||
</li>
|
||
<li>
|
||
组员能否外呼同一部门的资源:<select id="slt_bmwh"><option value="true">能</option><option value="false">否</option></select>
|
||
<input type="button" value="确定" id="bmSave" />
|
||
</li>
|
||
</ul>
|
||
</div>
|
||
<div id="favChangeDiv" style="display:none;">
|
||
<ul>
|
||
<li style="height:35px; line-height:35px;">转移到工号:<input id="input_eid" /></li>
|
||
<li>收藏类型:@Html.DropDownList("slt_parakey", new WX.CRM.WEB.Handler.ControlResource().GetBas_subcomTypeList(0)) (可不选,不选则保留原来的类型)</li>
|
||
<li><input type="button" value="确定" id="FavChangeSave" /></li>
|
||
</ul>
|
||
</div>
|
||
<script type="text/javascript">
|
||
$(function () {
|
||
$('#tablist').tablegrid({
|
||
url: '/Csvr/FavoriteCustomer/GetHtmlList',
|
||
height: $(window).height() - 110,
|
||
loadNow: false,
|
||
isCheckMore: true,
|
||
data: GetControlValue,
|
||
});
|
||
$(window).resize(function () {//自动适应大小
|
||
$('#tablist').tablegrid('resize', {
|
||
height: $(window).height() - 110
|
||
});
|
||
});
|
||
$("#btnQuery").click(function () {
|
||
$('#tablist').tablegrid("Search");
|
||
});
|
||
|
||
$("#Other2").click(function () {
|
||
$("#slt_cancall").val('@favCustomerEnableCanCall');
|
||
$("#slt_jlwh").val('@ViewBag.FavCustomerEnableCanCallManager');
|
||
$("#slt_zzwh").val('@ViewBag.FavCustomerEnableCanCallGrouper');
|
||
$("#slt_zywh").val('@ViewBag.FavCustomerEnableCanCallUser');
|
||
$("#slt_bmwh").val('@ViewBag.FavCustomerEnableCanCallDept');
|
||
|
||
|
||
$('#settingDiv').show().window({
|
||
title:' ', width: 350, height: 200, iconCls: 'icon-settings', shadow: true,
|
||
modal: true,
|
||
closed: true,
|
||
minimizable: false,
|
||
maximizable: false,
|
||
collapsible: false
|
||
}).window('open');
|
||
});
|
||
|
||
$("#Save").click(function () {
|
||
var enable = $("#slt_cancall").val();
|
||
$.r_post('/Csvr/FavoriteCustomer/FavCustomerEnableCanCall', { enable: enable }, function (msg) {
|
||
if (msg.type == 1) {
|
||
$.messager.alert("提醒", '设置成功!', "info", function () { window.location.reload(); });
|
||
}
|
||
else {
|
||
$.messager.alert("警告", '操作失败,请重试!', "error");
|
||
}
|
||
});
|
||
});
|
||
|
||
$("#JlSave").click(function () {
|
||
var enable = $("#slt_jlwh").val();
|
||
$.r_post('/Csvr/FavoriteCustomer/FavCustomerEnableCanCallManager', { enable: enable }, function (msg) {
|
||
if (msg.type == 1) {
|
||
$.messager.alert("提醒", '设置成功!', "info");
|
||
}
|
||
else {
|
||
$.messager.alert("警告", '操作失败,请重试!', "error");
|
||
}
|
||
});
|
||
});
|
||
|
||
$("#zzSave").click(function () {
|
||
var enable = $("#slt_zzwh").val();
|
||
$.r_post('/Csvr/FavoriteCustomer/FavCustomerEnableCanCallGrouper', { enable: enable }, function (msg) {
|
||
if (msg.type == 1) {
|
||
$.messager.alert("提醒", '设置成功!', "info");
|
||
}
|
||
else {
|
||
$.messager.alert("警告", '操作失败,请重试!', "error");
|
||
}
|
||
});
|
||
});
|
||
|
||
$("#zySave").click(function () {
|
||
var enable = $("#slt_zywh").val();
|
||
$.r_post('/Csvr/FavoriteCustomer/FavCustomerEnableCanCallUser', { enable: enable }, function (msg) {
|
||
if (msg.type == 1) {
|
||
$.messager.alert("提醒", '设置成功!', "info");
|
||
}
|
||
else {
|
||
$.messager.alert("警告", '操作失败,请重试!', "error");
|
||
}
|
||
});
|
||
});
|
||
|
||
$("#bmSave").click(function () {
|
||
var enable = $("#slt_bmwh").val();
|
||
$.r_post('/Csvr/FavoriteCustomer/FavCustomerEnableCanCallDept', { enable: enable }, function (msg) {
|
||
if (msg.type == 1) {
|
||
$.messager.alert("提醒", '设置成功!', "info");
|
||
}
|
||
else {
|
||
$.messager.alert("警告", '操作失败,请重试!', "error");
|
||
}
|
||
});
|
||
});
|
||
|
||
$("#Other1").click(function () {
|
||
var selects = $('#tablist').tablegrid('getSelections');
|
||
if (selects != "") {
|
||
//var users = $("#nb1_combox_user").find("option:selected").text();
|
||
////alert(users)
|
||
//if (users.indexOf('离职') < 0) {
|
||
// $.messager.alert("警告", '只能对离职员工进行操作!', "error");
|
||
// return false;
|
||
//}
|
||
//var index = users.indexOf('---');
|
||
//var lzEid = users.substring(0, index);
|
||
////alert(lzEid);
|
||
//var flag = true;
|
||
//$(selects).each(function (i, n) {
|
||
// if (i != 0) {
|
||
// var lsEid = n.SALESID.substring(0, n.SALESID.indexOf('-'));
|
||
// //alert(lsEid);
|
||
// if (lzEid != lsEid)
|
||
// flag = false;
|
||
// }
|
||
//});
|
||
|
||
//if (!flag) {
|
||
// $.messager.alert("警告", '只能对离职员工进行操作!', "error");
|
||
// return false;
|
||
//}
|
||
|
||
$('#favChangeDiv').show().window({
|
||
title: ' ', width: 350, height: 200, iconCls: 'icon-settings', shadow: true,
|
||
modal: true,
|
||
closed: true,
|
||
minimizable: false,
|
||
maximizable: false,
|
||
collapsible: false
|
||
}).window('open');
|
||
}
|
||
else {
|
||
$.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords');
|
||
}
|
||
});
|
||
|
||
$("#FavChangeSave").click(function () {
|
||
var selects = $('#tablist').tablegrid('getSelections');
|
||
var pkids = "";
|
||
var eid = $("#input_eid").val();
|
||
var paraKey = $("#slt_parakey").val();
|
||
if (paraKey == "0") {
|
||
paraKey = "";
|
||
}
|
||
if (selects != "") {
|
||
$(selects).each(function (i, n) {
|
||
if (n.PKID != undefined)
|
||
pkids += n.PKID + ",";
|
||
});
|
||
pkids = pkids.substring(0, pkids.length - 1);
|
||
if (pkids != "") {
|
||
if (eid == "") {
|
||
$.messager.alert('警告', '工号不能为空!', 'error');
|
||
return false;
|
||
}
|
||
$.r_post("/Csvr/FavoriteCustomer/Change", { id: pkids, eid: eid, paraKey: paraKey }, function (data) {
|
||
if (data.type == 1) {
|
||
$.messager.alert("提醒", '设置成功!', "info", function () { window.location.reload(); });
|
||
}
|
||
else {
|
||
$.messager.alert("警告", '操作失败,请重试!', "error");
|
||
}
|
||
}, "json");
|
||
}
|
||
}
|
||
else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
|
||
});
|
||
|
||
});
|
||
function GetControlValue() {
|
||
return { saleDeptId: $("#nb1_uc_org_depts").val(), groupId: $("#nb1_uc_org_groups").val(), userId: $("#nb1_uc_org_ids").val() };
|
||
}
|
||
function onLoadSucced() {
|
||
$('#tablist').tablegrid("Search");
|
||
}
|
||
//ifram 返回
|
||
function frameReturnByClose() {
|
||
$("#modalwindow").window('close');
|
||
}
|
||
function frameReturnByReload(flag) {
|
||
$("#tablist").tablegrid("Load");
|
||
}
|
||
function frameReturnByMes(mes) {
|
||
$.messageBox5s('提示', mes);
|
||
}
|
||
</script>
|
||
@*ToolBar事件处理*@
|
||
<script type="text/javascript">
|
||
function GetIframeHtml(src) {
|
||
return "<iframe width='100%' height='98%' scrolling='no' frameborder='0'' src='" + src + "'></iframe>";
|
||
}
|
||
function Create_Click() {
|
||
$("#modalwindow").html(GetIframeHtml("/Csvr/FavoriteCustomer/Edit"));
|
||
$("#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/FavoriteCustomer/Edit?resid=" + row.RESID));
|
||
$("#modalwindow").window({ title: '编辑', width: 700, height: 430, iconCls: 'icon-edit' }).window('open');
|
||
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
|
||
}
|
||
function Details_Click() {
|
||
var row = $('#tablist').tablegrid('getSelected');
|
||
if (row != null) {
|
||
$("#modalwindow").html(GetIframeHtml("/Csvr/FavoriteCustomer/Details?id=" + row.PKID));
|
||
$("#modalwindow").window({ title: '详细', width: 500, height: 300, iconCls: 'icon-details' }).window('open');
|
||
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
|
||
}
|
||
|
||
function Delete_Click() {
|
||
var selects = $('#tablist').tablegrid('getSelections');
|
||
var pkids = "";
|
||
if (selects != "") {
|
||
$(selects).each(function (i, n) {
|
||
if (n.PKID != undefined)
|
||
pkids += n.PKID + ",";
|
||
});
|
||
pkids = pkids.substring(0, pkids.length - 1);
|
||
if (pkids != "") {
|
||
$.messager.confirm('提示', '@Suggestion.YouWantToDeleteTheSelectedRecords', function (r) {
|
||
if (r) {
|
||
$.r_post("/Csvr/FavoriteCustomer/Delete?id=" + pkids, function (data) {
|
||
if (data.type == 1) {
|
||
$("#tablist").tablegrid('Load');
|
||
}
|
||
$.messageBox5s('提示', data.message);
|
||
}, "json");
|
||
}
|
||
});
|
||
}
|
||
}
|
||
else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
|
||
}
|
||
|
||
function ExportAll_Click() {
|
||
var qls = "&saleDeptId=" + $("#nb1_uc_org_depts").val() + "&groupId=" + $("#nb1_uc_org_groups").val() + "&userId=" + $("#nb1_uc_org_ids").val();
|
||
window.open("/csvr/FavoriteCustomer/ExportFavoriteCustomer?Ieguid=" + GetGuid() + qls + "&" + GetQueryStr());
|
||
}
|
||
|
||
function a() {
|
||
return;
|
||
}
|
||
|
||
</script> |