APPIndex.cshtml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. 
  2. @{
  3. ViewBag.Title = "APPIndex";
  4. Layout = "~/Views/Shared/_MainLayoutPage.cshtml";
  5. }
  6. <!DOCTYPE html>
  7. <head>
  8. <meta name="viewport" content="width=device-width" />
  9. <title>Index</title>
  10. <script src="~/ViewModels/NoticeManager.js?r=1"></script>
  11. </head>
  12. <div class="easyui-layout" fit="true">
  13. <div data-options="region:'center',title:'App图片公告'" id="center">
  14. <!--功能按钮和查询-->
  15. <div class="btn_func" id="btn_func" style="border-top:0px">
  16. <a href="#" id="btn_add" class="easyui-linkbutton" data-options="iconCls:'fa fa-plus color_blue',plain:true">新建</a>
  17. @*<a href="#" id="btn_edit" class="easyui-linkbutton" data-options="iconCls:'fa fa-edit color_blue',plain:true">修改</a>*@
  18. <a href="#" id="btn_del" class="easyui-linkbutton" data-options="iconCls:'fa fa-remove color_blue',plain:true">删除</a>
  19. <a href="#" id="btn_status" class="easyui-linkbutton" data-options="iconCls:'fa fa-edit color_blue',plain:true">启用/停用</a>
  20. <a href="#" id="btn_refresh" class="easyui-linkbutton" data-options="iconCls:'fa fa-refresh color_blue',plain:true">刷新</a>
  21. </div>
  22. <!--公告详细信息-->
  23. <table class="easyui-datagrid" id="AppPush"></table>
  24. </div>
  25. </div>
  26. <script type="text/javascript">
  27. var model = new viewModel();
  28. model.APPInit();
  29. //新建
  30. $("#btn_add").bind("click", function () {
  31. top.ZLPMS.OpenNewWindow("新建APP图片公告", "/Notice/App_Window", "800px", "450px", function () {
  32. $("#AppPush").datagrid("load")
  33. })
  34. })
  35. //删除
  36. $("#btn_del").bind("click", function () {
  37. var data = $("#AppPush").datagrid("getSelected");
  38. if (data == null) {
  39. top.ZLPMS.Msg("请选择一行记录!!");
  40. return
  41. }
  42. top.ZLPMS.Confirm("确认删除该记录?", 3, function () {
  43. $.get("/Notice/Del_AppNotice/" + data["ID"], function (data) {
  44. if (data == 1) {
  45. top.ZLPMS.Msg("删除成功!", 1);
  46. $("#AppPush").datagrid("reload");
  47. }
  48. })
  49. })
  50. })
  51. //刷新
  52. $("#btn_refresh").bind("click", function () {
  53. $("#AppPush").datagrid("reload");
  54. })
  55. //启用
  56. $("#btn_status").bind("click", function () {
  57. var data = $("#AppPush").datagrid("getSelected");
  58. if (data == null) {
  59. top.ZLPMS.Msg("请选择一行记录!!");
  60. return
  61. }
  62. $.ajax({
  63. url: "/Notice/AppNoticeStatus/" + data["ID"],
  64. success: function (data) {
  65. if(data==1)
  66. {
  67. top.ZLPMS.Msg("启用成功!", 1);
  68. $("#AppPush").datagrid("reload");
  69. }
  70. else if(data==0)
  71. {
  72. top.ZLPMS.Msg("停用成功!", 1);
  73. $("#AppPush").datagrid("reload");
  74. }
  75. else {
  76. top.ZLPMS.Msg("只能同时允许6条公告启用!", 2);
  77. }
  78. }
  79. })
  80. })
  81. </script>