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.

164 lines
6.5 KiB

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