纽威
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

140 lines
5.5 KiB

3 years ago
  1. @{
  2. ViewBag.Title = "Index";
  3. Layout = "~/Views/Shared/_Index.cshtml";
  4. }
  5. <script>
  6. $(function () {
  7. gridList();
  8. })
  9. function gridList() {
  10. var $gridList = $("#gridList");
  11. $gridList.dataGrid({
  12. treeGrid: true,
  13. treeGridModel: "adjacency",
  14. ExpandColumn: "F_EnCode",
  15. url: "/SystemManage/Organize/GetTreeGridJson",
  16. height: $(window).height() - 96,
  17. colModel: [
  18. { label: "主键", name: "F_Id", hidden: true, key: true },
  19. { label: '名称', name: 'F_FullName', width: 200, align: 'left' },
  20. { label: '编号', name: 'F_EnCode', width: 150, align: 'left' },
  21. {
  22. label: '分类', name: 'F_CategoryId', width: 80, align: 'left'
  23. //,
  24. //formatter: function (cellvalue) {
  25. // if (cellvalue == "Group") {
  26. // return "集团";
  27. // } else if (cellvalue == "Company") {
  28. // return "公司";
  29. // } else if (cellvalue == "Department") {
  30. // return "部门";
  31. // } else if (cellvalue == "WorkGroup") {
  32. // return "小组";
  33. // }
  34. //}
  35. },
  36. { label: '负责人', name: 'F_CategoryId', width: 90, align: 'left' },
  37. {
  38. label: '创建时间', name: 'F_CreatorTime', width: 80, align: 'left',
  39. formatter: "date", formatoptions: { srcformat: 'Y-m-d', newformat: 'Y-m-d' }
  40. },
  41. {
  42. label: "有效", name: "F_EnabledMark", width: 60, align: "center",
  43. formatter: function (cellvalue) {
  44. return cellvalue == 1 ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  45. }
  46. },
  47. { label: '备注', name: 'F_Description', width: 300, align: 'left' }
  48. ]
  49. });
  50. $("#btn_search").click(function () {
  51. $gridList.jqGrid('setGridParam', {
  52. postData: { keyword: $("#txt_keyword").val() },
  53. }).trigger('reloadGrid');
  54. });
  55. }
  56. function btn_add() {
  57. $.modalOpen({
  58. id: "Form",
  59. title: "新增机构",
  60. url: "/SystemManage/Organize/Form",
  61. width: "700px",
  62. height: "520px",
  63. callBack: function (iframeId) {
  64. top.frames[iframeId].submitForm();
  65. }
  66. });
  67. }
  68. function btn_edit() {
  69. var keyValue = $("#gridList").jqGridRowValue().F_Id;
  70. $.modalOpen({
  71. id: "Form",
  72. title: "修改机构",
  73. url: "/SystemManage/Organize/Form?keyValue=" + keyValue,
  74. width: "700px",
  75. height: "520px",
  76. callBack: function (iframeId) {
  77. top.frames[iframeId].submitForm();
  78. }
  79. });
  80. }
  81. function btn_delete() {
  82. $.deleteForm({
  83. url: "/SystemManage/Organize/DeleteForm",
  84. param: { keyValue: $("#gridList").jqGridRowValue().F_Id },
  85. success: function () {
  86. $.currentWindow().$("#gridList").resetSelection();
  87. $.currentWindow().$("#gridList").trigger("reloadGrid");
  88. }
  89. })
  90. }
  91. function btn_details() {
  92. var keyValue = $("#gridList").jqGridRowValue().F_Id;
  93. $.modalOpen({
  94. id: "Details",
  95. title: "查看机构",
  96. url: "/SystemManage/Organize/Details?keyValue=" + keyValue,
  97. width: "700px",
  98. height: "560px",
  99. btn: null,
  100. });
  101. }
  102. </script>
  103. <div class="topPanel">
  104. <div class="toolbar">
  105. <div class="btn-group">
  106. <a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
  107. </div>
  108. <div class="btn-group">
  109. <a id="NF-add" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_add()"><i class="fa fa-plus"></i>新建机构</a>
  110. </div>
  111. <div class="operate">
  112. <ul class="nav nav-pills">
  113. <li class="first">已选中<span>1</span>项</li>
  114. <li><a id="NF-edit" authorize="yes" onclick="btn_edit()"><i class="fa fa-pencil-square-o"></i>修改机构</a></li>
  115. <li><a id="NF-delete" authorize="yes" onclick="btn_delete()"><i class="fa fa-trash-o"></i>删除机构</a></li>
  116. <li><a id="NF-Details" authorize="yes" onclick="btn_details()"><i class="fa fa-search-plus"></i>查看机构</a></li>
  117. </ul>
  118. <a href="javascript:;" class="close"></a>
  119. </div>
  120. <script>$('.toolbar').authorizeButton()</script>
  121. </div>
  122. <div class="search">
  123. <table>
  124. <tr>
  125. <td>
  126. <div class="input-group">
  127. <input id="txt_keyword" type="text" class="form-control" placeholder="请输入要查询关键字" style="width: 200px;">
  128. <span class="input-group-btn">
  129. <button id="btn_search" type="button" class="btn btn-primary"><i class="fa fa-search"></i></button>
  130. </span>
  131. </div>
  132. </td>
  133. </tr>
  134. </table>
  135. </div>
  136. </div>
  137. <div class="gridPanel">
  138. <table id="gridList"></table>
  139. </div>