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

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