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

137 lines
5.9 KiB

3 years ago
  1. @{
  2. ViewBag.Title = "Index";
  3. Layout = "~/Views/Shared/_Index.cshtml";
  4. }
  5. <script>
  6. var keyValue = $.request("keyValue");
  7. $(function () {
  8. gridList();
  9. })
  10. function gridList() {
  11. var $gridList = $("#gridList");
  12. $gridList.dataGrid({
  13. url: "/ProductManage/OrderManage/GetGridJsonMX?keyValue=" + keyValue,
  14. height: $(window).height() - 96,
  15. colModel: [
  16. //{ label: "主键", name: "F_Id", hidden: true, key: true },
  17. //{ label: '产品ID', name: 'Product_Id', hidden: true },
  18. //{ label: 'Product SN', name: 'Product_SN', width: 150, align: 'left' },
  19. //{
  20. // label: 'Schedule Time', name: 'PreSellTime', width: 80, align: 'left',
  21. // formatter: "date", formatoptions: { srcformat: 'Y-m-d', newformat: 'Y-m-d' }
  22. //}
  23. { label: "主键", name: "F_Id", hidden: true, key: true },
  24. { label: '产品ID', name: 'Product_Id', hidden: true },
  25. { label: 'Product No', name: 'ProductSN', width: 70, align: 'left' },
  26. { label: 'Measurement', name: 'Measurement', width: 80, align: 'left' },//尺寸
  27. {
  28. label: 'Schedule Time', name: 'PreSellTime', width: 80, align: 'left',
  29. formatter: "date", formatoptions: { srcformat: 'Y-m-d', newformat: 'Y-m-d' }
  30. },
  31. //{ label: 'Weight', name: 'Weight', width: 60, align: 'left' },//重量
  32. {
  33. label: 'FinishedWeight', name: 'Weight', width: 80, align: 'left',
  34. formatter: "number", formatoptions: { thousandsSeparator: ',', defaulValue: '', decimalPlaces: 3 }
  35. },
  36. {
  37. label: 'RoughWeight', name: 'GrossWeight', width: 80, align: 'left',
  38. formatter: "number", formatoptions: { thousandsSeparator: ',', defaulValue: '', decimalPlaces: 3 }
  39. },
  40. { label: 'Shape', name: 'Shape', width: 60, align: 'left' },//形状
  41. { label: 'Certificate No', name: 'CertificateNo', width: 90, align: 'left' },//证书号码
  42. {
  43. label: 'RapaPrice', name: 'RapaPrice', width: 100, align: 'left',
  44. formatter: "number", formatoptions: { thousandsSeparator: ',', defaulValue: '', decimalPlaces: 3 }
  45. },//国际钻石单价
  46. {
  47. label: 'Price', name: 'Price', width: 100, align: 'left',
  48. formatter: "number", formatoptions: { thousandsSeparator: ',', defaulValue: '', decimalPlaces: 3 }
  49. },//销售价
  50. { label: 'Discount', name: 'Discount', width: 80, align: 'left' },//折扣率
  51. {
  52. label: 'Amount', name: 'Amount', width: 100, align: 'left',
  53. formatter: "number", formatoptions: { thousandsSeparator: ',', defaulValue: '', decimalPlaces: 3 }
  54. },//实际成交价
  55. { label: 'WH', name: 'WHCodes', width: 50, align: 'left' },
  56. { label: 'Sort', name: 'Other', width: 50, align: 'left' },
  57. { label: 'Location', name: 'Location', width: 140, align: 'left' }
  58. ],
  59. pager: "#gridPager",
  60. sortname: 'PreSellTime desc,ProductSN asc',
  61. viewrecords: true
  62. });
  63. $("#btn_search").click(function () {
  64. $gridList.jqGrid('setGridParam', {
  65. postData: { keyword: $("#txt_keyword").val() },
  66. }).trigger('reloadGrid');
  67. });
  68. }
  69. function btn_details() {
  70. var keyValue = $("#gridList").jqGridRowValue().F_Id;
  71. $.modalOpen({
  72. id: "Details",
  73. title: "Look",
  74. url: "/ProductManage/Maintain/Details?keyValue=" + keyValue,
  75. width: "550px",
  76. height: "390px",
  77. btn: null,
  78. });
  79. }
  80. function download(options) {
  81. var defaults = {
  82. method: "GET",
  83. url: "",
  84. param: []
  85. };
  86. var options = $.extend(defaults, options);
  87. if (options.url && options.param) {
  88. var $form = $('<form action="' + options.url + '" method="' + (options.method || 'post') + '"></form>');
  89. for (var key in options.param) {
  90. var $input = $('<input type="hidden" data-back="backdw" />').attr('name', key).val(options.param[key]);
  91. $form.append($input);
  92. }
  93. $form.appendTo('body').submit().remove();
  94. };
  95. }
  96. function btn_export() {
  97. debugger;
  98. var $gridList = $("#gridList");
  99. download({
  100. method: "POST",
  101. url: "/ProductManage/OrderManage/Export",
  102. param: { keyValue: keyValue }
  103. });
  104. }
  105. </script>
  106. <div class="topPanel">
  107. <div class="toolbar">
  108. <div class="btn-group">
  109. <a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
  110. </div>
  111. @*<div class="btn-group">
  112. <a id="NF-Export" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_export()"><i class="fa fa-search-plus"></i>导出</a>
  113. </div>*@
  114. <script>$('.toolbar').authorizeButton()</script>
  115. </div>
  116. <div class="search">
  117. <table>
  118. <tr>
  119. <td>
  120. <div class="input-group">
  121. <input id="txt_keyword" type="text" class="form-control" placeholder="ProductSN" style="width: 100px;">
  122. <span class="input-group-btn">
  123. <button id="btn_search" type="button" class="btn btn-primary"><i class="fa fa-search"></i></button>
  124. </span>
  125. </div>
  126. </td>
  127. </tr>
  128. </table>
  129. </div>
  130. </div>
  131. <div class="gridPanel">
  132. <table id="gridList"></table>
  133. @*<div id="gridPager"></div>*@
  134. </div>