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

126 lines
4.9 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. url: "/SystemManage/Duty/GetGridJson",
  13. height: $(window).height() - 96,
  14. colModel: [
  15. { label: "主键", name: "F_Id", hidden: true, key: true },
  16. { label: '岗位名称', name: 'F_FullName', width: 150, align: 'left' },
  17. { label: '岗位编号', name: 'F_EnCode', width: 150, align: 'left' },
  18. {
  19. label: '归属机构', name: 'F_OrganizeId', width: 150, align: 'left',
  20. formatter: function (cellvalue, options, rowObject) {
  21. return top.clients.organize[cellvalue] == null ? "" : top.clients.organize[cellvalue].fullname;
  22. }
  23. },
  24. {
  25. label: '创建时间', name: 'F_CreatorTime', width: 80, align: 'left',
  26. formatter: "date", formatoptions: { srcformat: 'Y-m-d', newformat: 'Y-m-d' }
  27. },
  28. {
  29. label: "有效", name: "F_EnabledMark", width: 60, align: "center",
  30. formatter: function (cellvalue) {
  31. return cellvalue == 1 ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  32. }
  33. },
  34. { label: '备注', name: 'F_Description', width: 300, align: 'left' }
  35. ]
  36. });
  37. $("#btn_search").click(function () {
  38. $gridList.jqGrid('setGridParam', {
  39. postData: { keyword: $("#txt_keyword").val() },
  40. }).trigger('reloadGrid');
  41. });
  42. }
  43. function btn_add() {
  44. $.modalOpen({
  45. id: "Form",
  46. title: "新增岗位",
  47. url: "/SystemManage/Duty/Form",
  48. width: "450px",
  49. height: "380px",
  50. callBack: function (iframeId) {
  51. top.frames[iframeId].submitForm();
  52. }
  53. });
  54. }
  55. function btn_edit() {
  56. var keyValue = $("#gridList").jqGridRowValue().F_Id;
  57. $.modalOpen({
  58. id: "Form",
  59. title: "修改岗位",
  60. url: "/SystemManage/Duty/Form?keyValue=" + keyValue,
  61. width: "450px",
  62. height: "380px",
  63. callBack: function (iframeId) {
  64. top.frames[iframeId].submitForm();
  65. }
  66. });
  67. }
  68. function btn_delete() {
  69. $.deleteForm({
  70. url: "/SystemManage/Duty/DeleteForm",
  71. param: { keyValue: $("#gridList").jqGridRowValue().F_Id },
  72. success: function () {
  73. $.currentWindow().$("#gridList").trigger("reloadGrid");
  74. }
  75. })
  76. }
  77. function btn_details() {
  78. var keyValue = $("#gridList").jqGridRowValue().F_Id;
  79. $.modalOpen({
  80. id: "Details",
  81. title: "查看岗位",
  82. url: "/SystemManage/Duty/Details?keyValue=" + keyValue,
  83. width: "450px",
  84. height: "500px",
  85. btn: null,
  86. });
  87. }
  88. </script>
  89. <div class="topPanel">
  90. <div class="toolbar">
  91. <div class="btn-group">
  92. <a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
  93. </div>
  94. <div class="btn-group">
  95. <a id="NF-add" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_add()"><i class="fa fa-plus"></i>新建岗位</a>
  96. </div>
  97. <div class="operate">
  98. <ul class="nav nav-pills">
  99. <li class="first">已选中<span>1</span>项</li>
  100. <li><a id="NF-edit" authorize="yes" onclick="btn_edit()"><i class="fa fa-pencil-square-o"></i>修改岗位</a></li>
  101. <li><a id="NF-delete" authorize="yes" onclick="btn_delete()"><i class="fa fa-trash-o"></i>删除岗位</a></li>
  102. <li><a id="NF-Details" authorize="yes" onclick="btn_details()"><i class="fa fa-search-plus"></i>查看岗位</a></li>
  103. </ul>
  104. <a href="javascript:;" class="close"></a>
  105. </div>
  106. <script>$('.toolbar').authorizeButton()</script>
  107. </div>
  108. <div class="search">
  109. <table>
  110. <tr>
  111. <td>
  112. <div class="input-group">
  113. <input id="txt_keyword" type="text" class="form-control" placeholder="岗位名称/岗位编号" style="width: 200px;">
  114. <span class="input-group-btn">
  115. <button id="btn_search" type="button" class="btn btn-primary"><i class="fa fa-search"></i></button>
  116. </span>
  117. </div>
  118. </td>
  119. </tr>
  120. </table>
  121. </div>
  122. </div>
  123. <div class="gridPanel">
  124. <table id="gridList"></table>
  125. </div>