159 lines
6.0 KiB
Plaintext
159 lines
6.0 KiB
Plaintext
@using WX.CRM.WebHelper;
|
||
@{
|
||
ViewBag.Title = "WeixinFriendList";
|
||
Layout = "~/Views/Shared/_Index_Layout2.cshtml";
|
||
}
|
||
<style>
|
||
.redColor {
|
||
color: red;
|
||
}
|
||
</style>
|
||
<script src="~/Scripts/op/tablegrid.sort.js"></script>
|
||
<script type="text/javascript">
|
||
$(function () {
|
||
|
||
$('#tablist').tablegrid({
|
||
url: '/Res/WX/GetWeixinFriendHtmlList',
|
||
height: $(window).height() - 110,
|
||
loadNow: true
|
||
});
|
||
$(window).resize(function () {//自动适应大小
|
||
$('#tablist').tablegrid('resize', {
|
||
height: $(window).height() - 110
|
||
});
|
||
});
|
||
$("#btnQuery").click(function () {
|
||
var txt = $("#txt_eID").val();
|
||
$(".redColor").each(function (i, n) {
|
||
$(this).after($(this).attr("ntitle"));
|
||
$(this).remove();
|
||
});
|
||
var xx = 0;
|
||
$("#tablist td[field='EM']").each(function () {
|
||
var html = $(this).html();
|
||
if (html.indexOf(txt) > -1) {
|
||
xx++;
|
||
html = html.replace(txt, "<b id=\"mubiao" + txt + "\" name=\"" + txt + "\" ntitle=\"" + txt + "\" class=\"redColor\">" + txt + "</b>");
|
||
$(this).html(html);
|
||
//var url = window.location.href;
|
||
//url = url.substring(0, url.indexOf("#"));
|
||
//window.location.href = url + "#" + txt;
|
||
var container = $('.grid_table'), scrollTo = $('#mubiao' + txt);
|
||
container.scrollTop(
|
||
scrollTo.offset().top - container.offset().top + container.scrollTop()
|
||
);
|
||
|
||
// Or you can animate the scrolling:
|
||
//container.animate({
|
||
// scrollTop: scrollTo.offset().top - container.offset().top + container.scrollTop()
|
||
//});
|
||
|
||
return false;
|
||
}
|
||
});
|
||
if (xx == 0)
|
||
alert("列表中没找到对应工号!");
|
||
});
|
||
});
|
||
//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)
|
||
</div>
|
||
<div class="bas_datagrid">
|
||
<div id="tb" style="padding:5px;height:auto" class="grid_toolbar">
|
||
<ul class="toolBar_ul">
|
||
<li>工号:<input type="text" id="txt_eID" name="txt_eID" /> </li>
|
||
<li><span style="color:red">提示:点数范围20~180,默认100</span></li>
|
||
<li><input type="hidden" id="txt_type" name="txt_type" value="@Request["type"]" /> </li>
|
||
</ul>
|
||
|
||
</div>
|
||
@Html.Raw(ViewBag.gridTable)
|
||
</div>
|
||
@*ToolBar事件处理*@
|
||
<script type="text/javascript">
|
||
|
||
function GetIframeHtml(src) {
|
||
return "<iframe width='100%' height='98%' scrolling='no' frameborder='0'' src='" + src + "'></iframe>";
|
||
}
|
||
|
||
function getDataGridHeader() {
|
||
var columns = $('#tablist').tablegrid("getHead");
|
||
return columns;
|
||
}
|
||
|
||
function Export_Click() {
|
||
$("#modalwindow").html(GetIframeHtml("/Control/ExcelExport?Query=" + encodeURIComponent("/Res/WX/WeixinFriendExport?" + GetQueryStr())));
|
||
$("#modalwindow").window({ title: '导出', width: 480, height: 300, iconCls: 'icon-export' }).window('open');
|
||
}
|
||
function Save_Click() {
|
||
$.messager.confirm('提示', '你确定要更新保存吗?', function (r) {
|
||
if (r) {
|
||
var eids = "";
|
||
var points = "";
|
||
var flag = true;
|
||
var message = "";
|
||
$("[eid]").each(function () {
|
||
if (isNaN($(this).val())) {
|
||
message = "点数只能是数字";
|
||
//$.messageBox5s('错误', '点数只能是数字');
|
||
flag = false;
|
||
return false;
|
||
}
|
||
var nvalue = $(this).val();
|
||
if ($(this).attr("oldvalue") != nvalue && nvalue != '0') {//只获取以改变的数据
|
||
if (parseInt(nvalue) > 180 || parseInt(nvalue) < 20) {
|
||
message = "点数范围20~180";
|
||
//$.messageBox5s('错误', '点数范围20~180');
|
||
flag = false;
|
||
return false;
|
||
}
|
||
eids += $(this).attr("eid") + ",";
|
||
points += $(this).val() + ",";
|
||
}
|
||
|
||
});
|
||
if (flag == false) {
|
||
$.messageBox5s('错误', message);
|
||
return;
|
||
}
|
||
if (eids.length > 0) {
|
||
eids = eids.substr(0, eids.length - 1);
|
||
} else {
|
||
$.messageBox5s('错误', '您还没有改动数据!');
|
||
return;
|
||
}
|
||
if (points.length > 0) {
|
||
points = points.substr(0, points.length - 1);
|
||
}
|
||
$.r_post("/Res/WX/SavePoint?eids=" + eids + "&points=" + points+"&type=@Request["type"]", function (data) {
|
||
if (data.type == 1) {
|
||
$("#tablist").tablegrid('Load');
|
||
}
|
||
$.messageBox5s('提示', data.message);
|
||
}, "json");
|
||
}
|
||
});
|
||
}
|
||
function Set_Click() {
|
||
var row = $('#tablist').tablegrid('getSelected');
|
||
if (row != null) {
|
||
|
||
parent.ChildAddTab('待审工作微信', '/Weixin/WorkAccountInit/AuditIndex?eid=' + row.eid, '')
|
||
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
|
||
|
||
}
|
||
|
||
</script>
|