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

222 lines
9.5 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: "/ProductManage/OrderManage/GetGridJson",
  13. height: $(window).height() - 96,
  14. colModel: [
  15. { label: "主键", name: "F_Id", hidden: true, key: true },
  16. { label: "CustomerId", name: "CustomerId", hidden: true },
  17. { label: 'Order No', name: 'PreSellNo', width: 120, align: 'left' },
  18. {
  19. label: 'Customer Name', name: 'CustomerName', width: 100, align: 'left'
  20. //formatter: function (cellvalue, options, rowObject) {
  21. // return top.clients.user[cellvalue] == null ? "" : top.clients.user[cellvalue].realname;
  22. //}
  23. },
  24. {
  25. label: "Confirmation State", name: "IsConfirm", width: 110, align: "left",
  26. formatter: function (cellvalue) {
  27. return cellvalue == 1 ? "Confirmed" : "Unconfirmed";
  28. }
  29. },
  30. {
  31. label: 'Creator User', name: 'F_CreatorUserId', width: 100, align: 'left',
  32. formatter: function (cellvalue, options, rowObject) {
  33. return top.clients.user[cellvalue] == null ? "" : top.clients.user[cellvalue].realname;
  34. }
  35. },
  36. {
  37. label: 'Creator Time', name: 'F_CreatorTime', width: 100, align: 'left',
  38. formatter: "date", formatoptions: { srcformat: 'Y-m-d H:i', newformat: 'Y-m-d H:i' }
  39. },
  40. {
  41. label: 'Modify User', name: 'F_LastModifyUserId', width: 100, 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: 'Modify Time', 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. label: 'SalesMan', name: 'F_CreatorUserId', width: 100, align: 'left',
  52. formatter: function (cellvalue, options, rowObject) {
  53. return top.clients.user[cellvalue] == null ? "" : top.clients.user[cellvalue].realname;
  54. }
  55. }
  56. ],
  57. pager: "#gridPager",
  58. sortname: 'F_CreatorTime desc,PreSellNo asc',
  59. multiselect: true,
  60. viewrecords: true
  61. });
  62. $("#btn_search").click(function () {
  63. $gridList.jqGrid('setGridParam', {
  64. postData: { keyword: $("#txt_keyword").val(), keyword2: $("#txt_keyword2").val() },
  65. }).trigger('reloadGrid');
  66. });
  67. }
  68. function btn_edit() {
  69. var keyValue = $("#gridList").jqGridRowValue().F_Id;
  70. var ids = $('#gridList').jqGrid('getGridParam', 'selarrrow');
  71. var keyValues = "";
  72. for (var i = 0; i < ids.length; i++) {
  73. if (i == 0)
  74. keyValues += ids[i];
  75. else
  76. keyValues += "," + ids[i];
  77. }
  78. $.modalConfirm("Note: are you sure you want to confirm the order?", function (r) {
  79. if (r) {
  80. $.submitForm({
  81. url: "/ProductManage/OrderManage/ConfirmOrders",
  82. param: { keyValue: keyValues },
  83. success: function () {
  84. $.currentWindow().$("#gridList").trigger("reloadGrid");
  85. }
  86. })
  87. }
  88. });
  89. }
  90. function btn_cancel() {
  91. var keyValue = $("#gridList").jqGridRowValue().F_Id;
  92. var ids = $('#gridList').jqGrid('getGridParam', 'selarrrow');
  93. var keyValues = "";
  94. for (var i = 0; i < ids.length; i++) {
  95. if (i == 0)
  96. keyValues += ids[i];
  97. else
  98. keyValues += "," + ids[i];
  99. }
  100. $.modalConfirm("Note: are you sure you want to cancel confirm the order?", function (r) {
  101. if (r) {
  102. $.submitForm({
  103. url: "/ProductManage/OrderManage/CancelConfirmOrders",
  104. param: { keyValue: keyValues },
  105. success: function () {
  106. $.currentWindow().$("#gridList").trigger("reloadGrid");
  107. }
  108. })
  109. }
  110. });
  111. }
  112. function btn_details() {
  113. var keyValue = $("#gridList").jqGrid('getGridParam', 'selrow');
  114. $.modalOpen({
  115. id: "Details",
  116. title: "Look",
  117. url: "/ProductManage/OrderManage/Details?keyValue=" + keyValue,
  118. width: "880px",
  119. height: "450px",
  120. btn: null,
  121. });
  122. }
  123. function download(options) {
  124. var defaults = {
  125. method: "GET",
  126. url: "",
  127. param: []
  128. };
  129. var options = $.extend(defaults, options);
  130. if (options.url && options.param) {
  131. var $form = $('<form action="' + options.url + '" method="' + (options.method || 'post') + '"></form>');
  132. for (var key in options.param) {
  133. var $input = $('<input type="hidden" data-back="backdw" />').attr('name', key).val(options.param[key]);
  134. $form.append($input);
  135. }
  136. $form.appendTo('body').submit().remove();
  137. };
  138. }
  139. function download(options) {
  140. var defaults = {
  141. method: "GET",
  142. url: "",
  143. param: []
  144. };
  145. var options = $.extend(defaults, options);
  146. if (options.url && options.param) {
  147. var $form = $('<form action="' + options.url + '" method="' + (options.method || 'post') + '"></form>');
  148. for (var key in options.param) {
  149. var $input = $('<input type="hidden" data-back="backdw" />').attr('name', key).val(options.param[key]);
  150. $form.append($input);
  151. }
  152. $form.appendTo('body').submit().remove();
  153. };
  154. }
  155. function btn_export() {
  156. var keyValue = $("#gridList").jqGrid('getGridParam', 'selrow');
  157. if (keyValue == null || keyValue == "") {
  158. alert("没有可导出的数据.");
  159. return false;
  160. }
  161. download({
  162. method: "POST",
  163. url: '/ProductManage/OrderManage/Export',
  164. param: {
  165. keyValue: keyValue
  166. }
  167. });
  168. }
  169. </script>
  170. <div class="topPanel">
  171. <div class="toolbar">
  172. <div class="btn-group">
  173. <a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
  174. <a id="NF-Export" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_export()"><i class="fa fa-search-plus"></i>Export</a>
  175. <a id="NF-Details" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_details()"><i class="fa fa-search-plus"></i>Look Details</a>
  176. <a id="NF-edit" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_edit()"><i class="fa fa-pencil-square-o"></i>Order Confirmation</a>
  177. <a id="NF-cancel" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_cancel()"><i class="fa fa-pencil-square-o"></i>Cancel Confirmation</a>
  178. </div>
  179. @*<div class="btn-group">
  180. <a id="NF-add" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_add()"><i class="fa fa-plus"></i>新建产品</a>
  181. </div>*@
  182. @*<div class="operate">
  183. <ul class="nav nav-pills">
  184. <li class="first">Already Selected<span>1</span>Item</li>
  185. <li><a id="NF-Details" authorize="yes" onclick="btn_details()"><i class="fa fa-search-plus"></i>Look Details</a></li>
  186. <li><a id="NF-edit" authorize="yes" onclick="btn_edit()"><i class="fa fa-pencil-square-o"></i>Order Confirmation</a></li>
  187. </ul>
  188. <a href="javascript:;" class="close"></a>
  189. </div>*@
  190. <script>$('.toolbar').authorizeButton()</script>
  191. </div>
  192. <div class="search">
  193. <table>
  194. <tr>
  195. <td>
  196. <div class="input-group">
  197. <input id="txt_keyword" type="text" class="form-control" placeholder="Order No" style="width: 100px;">
  198. <input id="txt_keyword2" type="text" class="form-control" placeholder="Customer Name" style="width: 100px;margin-left:10px;">
  199. @*<input id="txt_TO" type="text" class="form-control txttotxt" value="TO" style="width:20px;border:0;color:white;background-color:#1ABC9C;padding:1px 3px;font-size:14px;" />
  200. <input id="txt_keyword2" type="text" class="form-control" placeholder="ProductSN" style="width: 100px;">*@
  201. <span class="input-group-btn">
  202. <button id="btn_search" type="button" style="margin-left:10px;" class="btn btn-primary"><i class="fa fa-search"></i></button>
  203. </span>
  204. </div>
  205. </td>
  206. </tr>
  207. </table>
  208. </div>
  209. </div>
  210. <div class="gridPanel">
  211. <table id="gridList"></table>
  212. <div id="gridPager"></div>
  213. </div>