TG.WXCRM.V4/WEB/Views/Level2/L2Product/List.cshtml

123 lines
4.4 KiB
Plaintext

@using WX.CRM.WebHelper;
@{
ViewBag.Title = "免费产品管理";
Layout = "~/Views/Shared/_Index_Layout2.cshtml";
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>免费产品管理</title>
</head>
<body>
<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" name="txt_productname" style="width:150px" />&nbsp;</li>
</ul>
</div>
@Html.Raw(ViewBag.gridTable)
</div>
</body>
</html>
<script type="text/javascript">
var PID = '';
$(function () {
loadtablegrid();
$("#btnQuery").click(function () {
$('#tablist').tablegrid("Search");
});
});
function loadtablegrid() {
$('#tablist').tablegrid({
url: '/Level2/L2Product/GetHtmlList',
height: $(window).height() - 110,
loadNow: true,
isCheckMore: true,
onLoadSuccess: function () {
CheckRow(PID);
},
onLoadError: function () {
$.messager.alert("警告", "信息加载失败!", "error");
}
});
}
function Create_Click() {
$("#modalwindow").html(GetIframeHtml("/Level2/L2Product/Edit?ProductId=&Ieguid=" + GetGuid()));
$("#modalwindow").window({ title: '新增', width: 500, height: 400, iconCls: 'icon-add' }).window('open');
}
function Edit_Click() {
var row = $('#tablist').tablegrid('getSelected');
if (row != null) {
$("#modalwindow").html(GetIframeHtml("/Level2/L2Product/Edit?ProductId=" + row.ID + "&Ieguid=" + GetGuid()));
$("#modalwindow").window({ title: '编辑', width: 500, height: 400, iconCls: 'icon-edit' }).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("/Level2/L2Product/Delete?productId=" + row.ID, function (data) {
if (data.type == 1) {
$("#tablist").tablegrid('Load');
}
$.messageBox5s('提示', data.message);
}, "json");
}
});
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
}
function pre_Click() {
var row = $('#tablist').tablegrid('getSelected');
if (row != null) {
$.r_post("/Level2/L2Product/MoveProduct?PRODUCTID=" + row.ID + "&t=1", function (data) {
if (data.type == 1) {
frameReturnByReload(true);
PID = row.ID;
}
else {
$.messager.alert("警告", data.message, "error");
}
}, "json");
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
}
function next_Click() {
var row = $('#tablist').tablegrid('getSelected');
if (row != null) {
$.r_post("/Level2/L2Product/MoveProduct?PRODUCTID=" + row.ID + "&t=2", function (data) {
if (data.type == 1) {
frameReturnByReload(true);
PID = row.ID;
}
else {
$.messager.alert("警告", data.message, "error");
}
}, "json");
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
}
function CheckRow(ID) {
var f = true;
$("#tablist td[field='ID']").each(function (i, e) {
if ($(e).text() == ID && f) {
$(e).parent().click();
f = false;
}
});
}
function GetIframeHtml(src) {
return "<iframe width='100%' height='98%' scrolling='no' frameborder='0'' src='" + src + "'></iframe>";
}
function frameReturnByReload(flag) {
$("#tablist").tablegrid("Load");
}
</script>