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

163 lines
6.5 KiB

3 years 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. }).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: "Forms",
  81. title: "修改折扣率",
  82. url: "/ProductManage/DiscountRate/Forms?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_print() {
  100. //$.deleteForm({
  101. // url: "/Handler1.ashx",
  102. // param: { keyValue: $("#gridList").jqGridRowValue().F_Id },
  103. // success: function () {
  104. // $.currentWindow().$("#gridList").trigger("reloadGrid");
  105. // }
  106. var keyValue = $("#gridList").jqGridRowValue().F_Id;
  107. window.open("/Handler1.ashx?keyValue=" + keyValue, "");
  108. }
  109. var strPrintData = '';
  110. function GetStrPrintData() {
  111. $.ajax({
  112. url: "/ChulingHandler.ashx?action=GetUrlPath",
  113. data: { keyValue: keyValue },
  114. dataType: "json",
  115. async: false,
  116. success: function (data) {
  117. $("#form1").formSerialize(data);
  118. }
  119. });
  120. }
  121. </script>
  122. <div class="topPanel">
  123. <div class="toolbar">
  124. <div class="btn-group">
  125. <a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
  126. </div>
  127. <div class="btn-group">
  128. <a id="NF-add" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_add()"><i class="fa fa-plus"></i>新建折扣率</a>
  129. </div>
  130. <div class="operate">
  131. <ul class="nav nav-pills">
  132. <li class="first">已选中<span>1</span>项</li>
  133. <li><a id="NF-edit" authorize="yes" onclick="btn_edit()"><i class="fa fa-pencil-square-o"></i>修改折扣率</a></li>
  134. <li><a id="NF-delete" authorize="yes" onclick="btn_delete()"><i class="fa fa-trash-o"></i>删除折扣率</a></li>
  135. <li><a id="NF-Details" authorize="yes" onclick="btn_print()"><i class="fa fa-search-plus"></i>grid++打印</a></li>
  136. <li><a id="NF-chulingprint" authorize="yes" onclick="btn_chulingprint()"><i class="fa fa-search-plus"></i>chuling打印</a></li>
  137. </ul>
  138. <a href="javascript:;" class="close"></a>
  139. </div>
  140. <script>$('.toolbar').authorizeButton()</script>
  141. </div>
  142. <div class="search">
  143. <table>
  144. <tr>
  145. <td>
  146. <div class="input-group">
  147. <input id="txt_keyword" type="text" class="form-control" placeholder="CusCode" style="width: 100px;">
  148. <span class="input-group-btn">
  149. <button id="btn_search" type="button" class="btn btn-primary"><i class="fa fa-search"></i></button>
  150. </span>
  151. </div>
  152. </td>
  153. </tr>
  154. </table>
  155. </div>
  156. </div>
  157. <div class="gridPanel">
  158. <table id="gridList"></table>
  159. <div id="gridPager"></div>
  160. </div>