纽威
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.

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