TG.WXCRM.V4/WEB/Views/Sms/SmsAccount/Index.cshtml

84 lines
3.0 KiB
Plaintext

@using WX.CRM.WebHelper;
@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_Index_Layout2.cshtml";
}
<script type="text/javascript">
$(function () {
$('#tablist').tablegrid({
url: '/Sms/SmsAccount/GetHtmlList',
height: $(window).height() - 110,
loadNow: true
});
$(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.Action("ToolBar", "Control", ViewBag.ToolBar as ToolBar)
</div>
<div class="bas_datagrid">
@Html.Raw(ViewBag.List)
</div>
@*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("/Sms/SmsAccount/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("/Sms/SmsAccount/Edit?code=" + row.CLIENTCODE));
$("#modalwindow").window({ title: '编辑', width: 600, height: 450, iconCls: 'icon-edit' }).window('open');
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
}
function Details_Click() {
var row = $('#tablist').tablegrid('getSelected');
if (row != null) {
$("#modalwindow").html(GetIframeHtml("/Sms/SmsAccount/Details?code=" + row.CLIENTCODE));
$("#modalwindow").window({ title: '详细', width: 500, height: 380, iconCls: 'icon-details' }).window('open');
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
}
function Delete_Click() {
var row = $('#tablist').tablegrid('getSelected');
if (row != null) {
$.messager.confirm('提示', '@Suggestion.YouWantToDeleteTheSelectedRecords', function (r) {
if (r) {
$.r_post("/Sms/SmsAccount/Delete?code=" + row.CLIENTCODE, function (data) {
if (data.type == 1) {
$("#tablist").tablegrid('Load');
}
$.messageBox5s('提示', data.message);
}, "json");
}
});
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
}
</script>