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.

149 lines
5.8 KiB

4 days 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: "/ProductManage/RapaPort/GetGridJson",
  13. height: $(window).height() - 96,
  14. colModel: [
  15. { label: "主键", name: "F_Id", hidden: true, key: true },
  16. { label: 'RapaPort', name: 'CusCode', width: 80, align: 'left' },
  17. {
  18. label: '最小值', name: 'StartValue', width: 80, align: 'left',
  19. formatter: "number", formatoptions: { thousandsSeparator: ',', defaulValue: '', decimalPlaces: 2 }
  20. },
  21. {
  22. label: '最大值', name: 'EndValue', width: 80, align: 'left',
  23. formatter: "number", formatoptions: { thousandsSeparator: ',', defaulValue: '', decimalPlaces: 2 }
  24. },
  25. {
  26. label: '国际报价', name: 'Discount', width: 80, align: 'left',
  27. formatter: "number", formatoptions: { thousandsSeparator: ',', defaulValue: '', decimalPlaces: 2 }
  28. },
  29. {
  30. label: '仓库', name: 'WHType', width: 80, align: 'left',
  31. formatter: function (cellvalue) {
  32. if (cellvalue == "10") {
  33. return "成品仓";
  34. } else if (cellvalue == "12") {
  35. return "评估仓";
  36. }
  37. else { return ""; }
  38. }
  39. },
  40. {
  41. label: '修改人', name: 'F_LastModifyUserId', width: 90, align: 'left',
  42. formatter: function (cellvalue, options, rowObject) {
  43. return top.clients.user[cellvalue] == null ? "" : top.clients.user[cellvalue].realname;
  44. }
  45. },
  46. {
  47. label: '修改时间', name: 'F_LastModifyTime', width: 100, align: 'left',
  48. formatter: "date", formatoptions: { srcformat: 'Y-m-d H:i', newformat: 'Y-m-d H:i' }
  49. }
  50. ],
  51. pager: "#gridPager",
  52. sortname: 'CusCode asc,StartValue asc',
  53. viewrecords: true
  54. });
  55. $("#btn_search").click(function () {
  56. var queryJson = {
  57. keyword: $("#txt_keyword").val(),
  58. }
  59. $gridList.jqGrid('setGridParam', {
  60. postData: { queryJson: JSON.stringify(queryJson) },
  61. page: 1
  62. }).trigger('reloadGrid');
  63. });
  64. }
  65. function btn_add() {
  66. $.modalOpen({
  67. id: "Form",
  68. title: "新建折扣率",
  69. url: "/ProductManage/DiscountRate/Form",
  70. width: "300px",
  71. height: "400px",
  72. callBack: function (iframeId) {
  73. top.frames[iframeId].submitForm();
  74. }
  75. });
  76. }
  77. function btn_edit() {
  78. var keyValue = $("#gridList").jqGridRowValue().F_Id;
  79. $.modalOpen({
  80. id: "Form",
  81. title: "修改国际报价",
  82. url: "/ProductManage/RapaPort/Form?keyValue=" + keyValue,
  83. width: "300px",
  84. height: "350px",
  85. callBack: function (iframeId) {
  86. top.frames[iframeId].submitForm();
  87. }
  88. });
  89. }
  90. function btn_delete() {
  91. $.deleteForm({
  92. url: "/ProductManage/DiscountRate/DeleteForm",
  93. param: { keyValue: $("#gridList").jqGridRowValue().F_Id },
  94. success: function () {
  95. $.currentWindow().$("#gridList").trigger("reloadGrid");
  96. }
  97. })
  98. }
  99. function btn_details() {
  100. var keyValue = $("#gridList").jqGridRowValue().F_Id;
  101. $.modalOpen({
  102. id: "Details",
  103. title: "查看",
  104. url: "/ProductManage/DiscountRate/Details?keyValue=" + keyValue,
  105. width: "550px",
  106. height: "390px",
  107. btn: null,
  108. });
  109. }
  110. </script>
  111. <div class="topPanel">
  112. <div class="toolbar">
  113. <div class="btn-group">
  114. <a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
  115. </div>
  116. @*<div class="btn-group">
  117. <a id="NF-add" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_add()"><i class="fa fa-plus"></i>新建折扣率</a>
  118. </div>*@
  119. <div class="operate">
  120. <ul class="nav nav-pills">
  121. <li class="first">已选中<span>1</span>项</li>
  122. <li><a id="NF-edit" authorize="yes" onclick="btn_edit()"><i class="fa fa-pencil-square-o"></i>修改折扣率</a></li>
  123. @*<li><a id="NF-delete" authorize="yes" onclick="btn_delete()"><i class="fa fa-trash-o"></i>删除折扣率</a></li>
  124. <li><a id="NF-Details" authorize="yes" onclick="btn_details()"><i class="fa fa-search-plus"></i>查看折扣率</a></li>*@
  125. </ul>
  126. <a href="javascript:;" class="close"></a>
  127. </div>
  128. <script>$('.toolbar').authorizeButton()</script>
  129. </div>
  130. @*<div class="search">
  131. <table>
  132. <tr>
  133. <td>
  134. <div class="input-group">
  135. <input id="txt_keyword" type="text" class="form-control" placeholder="CusCode" style="width: 100px;">
  136. <span class="input-group-btn">
  137. <button id="btn_search" type="button" class="btn btn-primary"><i class="fa fa-search"></i></button>
  138. </span>
  139. </div>
  140. </td>
  141. </tr>
  142. </table>
  143. </div>*@
  144. </div>
  145. <div class="gridPanel">
  146. <table id="gridList"></table>
  147. <div id="gridPager"></div>
  148. </div>