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.

204 lines
7.5 KiB

3 weeks ago
  1. 
  2. @{
  3. ViewBag.Title = "Index";
  4. Layout = "~/Views/Shared/_Form.cshtml";
  5. }
  6. @*<link href="~/Content/js/select2/select2.min.css" rel="stylesheet" />
  7. <script src="~/Content/js/select2/select2.min.js"></script>*@
  8. <link href="~/Content/css/CommonReport/CommonReport.css" rel="stylesheet" />
  9. <script src="~/Content/js/CommonReport/CommonReport.js"></script>
  10. <link href="~/Content/css/bootstrap/bootstrap-select.css" rel="stylesheet" />
  11. <script src="~/Content/js/bootstrap/bootstrap-select.min.js"></script>
  12. <style>
  13. .form {
  14. margin: 25px 15px;
  15. }
  16. </style>
  17. <script>
  18. var subgridCang = 'gridList';
  19. var subgridQu = '';
  20. var subgridPai = '';
  21. var subgridHuo = '';
  22. var subgridCeng = '';
  23. var subgridGe = '';
  24. //var subgrid_table_id = '';
  25. var WorkPoints = '@NFine.Code.OperatorProvider.Provider.GetCurrent().Location'
  26. var User = '@NFine.Code.OperatorProvider.Provider.GetCurrent().UserCode'
  27. var Times = new Date();
  28. var Time = formatDate("YYYY-mm-dd HH:MM:SS", Times);
  29. var Lots = decodeURI($.request("Lots"));
  30. $(function () {
  31. $("#minPackQty").keyup(function () {
  32. $(this).val($(this).val().replace(/[^0-9.]/g, ''));
  33. }).bind("paste", function () { //CTR+V事件处理
  34. $(this).val($(this).val().replace(/[^0-9.]/g, ''));
  35. }).css("ime-mode", "disabled"); //CSS设置输入法不可用
  36. $("#thisCreateQty").keyup(function () {
  37. $(this).val($(this).val().replace(/[^0-9.]/g, ''));
  38. }).bind("paste", function () { //CTR+V事件处理
  39. $(this).val($(this).val().replace(/[^0-9.]/g, ''));
  40. }).css("ime-mode", "disabled"); //CSS设置输入法不可用
  41. $("#cretePageCount").keyup(function () {
  42. $(this).val($(this).val().replace(/[^0-9.]/g, ''));
  43. }).bind("paste", function () { //CTR+V事件处理
  44. $(this).val($(this).val().replace(/[^0-9.]/g, ''));
  45. }).css("ime-mode", "disabled"); //CSS设置输入法不可用
  46. gridList();
  47. $("#txtMUSER").val(User);
  48. $("#txtMTIME").val(Time);
  49. $("#txtMUSER").attr("disabled", "disabled");
  50. $("#txtMTIME").attr("disabled", "disabled");
  51. });
  52. function formatDate(fomatType, date) {
  53. let ret;
  54. let valueDate = date;
  55. if (!date) valueDate = new Date()
  56. let opt = {
  57. "Y+": valueDate.getFullYear().toString(), // 年
  58. "m+": (valueDate.getMonth() + 1).toString(), // 月
  59. "d+": valueDate.getDate().toString(), // 日
  60. "H+": valueDate.getHours().toString(), // 时
  61. "M+": valueDate.getMinutes().toString(), // 分
  62. "S+": valueDate.getSeconds().toString() // 秒
  63. };
  64. for (let k in opt) {
  65. ret = new RegExp("(" + k + ")").exec(fomatType);
  66. if (ret) {
  67. fomatType = fomatType.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0")))
  68. };
  69. };
  70. return fomatType;
  71. }
  72. // 仓库
  73. function gridList() {
  74. debugger;
  75. var $gridList = $("#gridList");
  76. // 初始化表格
  77. $gridList.dataGrid({
  78. url: "/HGWMS/ICSTransfer/GetLocationCode" + "?" + Math.random(),
  79. height: $(window).height() - 128,
  80. width: $(window).width() - 128,
  81. postData: {
  82. queryJson: JSON.stringify({
  83. WarehouseCode: $("#txt_WarehouseCode").val(),
  84. LocationCode: $("#txt_LocationCode").val()
  85. })
  86. },
  87. colModel: [
  88. { label: '主键', name: 'Id', hidden: true, key: true },
  89. { label: "ID", name: "ID", hidden: true },
  90. { label: '仓库编码', name: 'WarehouseCode', width: 120, align: 'left' }, // 修正了aligpager的错误
  91. { label: '仓库名称', name: 'WarehouseName', width: 120, align: 'left' },
  92. { label: '库位编码', name: 'LocationCode', width: 120, align: 'left' },
  93. { label: '库位名称', name: 'LocationName', width: 120, align: 'left' }
  94. ],
  95. pager: "#gridPager",
  96. sortname: 'WarehouseCode',
  97. sortorder: "desc",
  98. viewrecords: true,
  99. multiselect: true
  100. });
  101. // 搜索按钮点击事件
  102. $("#btn_search").click(function () {
  103. var queryJson = {
  104. WarehouseCode: $("#txt_WarehouseCode").val(),
  105. LocationCode: $("#txt_LocationCode").val()
  106. };
  107. // 重置表格参数并重新加载,同时确保显示第一页
  108. $gridList.jqGrid('setGridParam', {
  109. postData: {
  110. queryJson: JSON.stringify(queryJson)
  111. },
  112. page: 1 // 重置到第一页
  113. }).trigger('reloadGrid');
  114. });
  115. }
  116. function submitForm() {
  117. debugger;
  118. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  119. if (objList.length > 1) {
  120. $.modalAlertNew("WMS00079");
  121. return;
  122. }
  123. var rowId = objList[0];
  124. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  125. var Parameter = {
  126. User: User,
  127. Lots: Lots,
  128. LocationCode: rowData.LocationCode,
  129. WarehouseCode: rowData.WarehouseCode
  130. }
  131. $.submitForm({
  132. url: "/HGWMS/ICSTransfer/AddICSTransfer?" + Math.random(),
  133. param: { keyValue: JSON.stringify(Parameter) },
  134. success: function (data) {
  135. if (data.status == "sucess") {
  136. $.currentWindow().$("#gridList").trigger("reloadGrid");
  137. }
  138. else {
  139. alert(data.message);
  140. return;
  141. }
  142. }
  143. })
  144. }
  145. </script>
  146. <form id="form1">
  147. <div class="search" style="padding-top: 2px; margin-right: 20px;">
  148. @*<table class="form">*@
  149. <table class="form">
  150. <tr>
  151. <th class="formTitle">创建人:</th>
  152. <td class="formValue">
  153. <input id="txtMUSER" name="txtMUSER" type="text" class="form-control" style="width: 160px" />
  154. </td>
  155. <th class="formTitle">仓库编码:</th>
  156. <td class="formValue">
  157. <input type="text" name="txt_WarehouseCode" id="txt_WarehouseCode" class="form-control" placeholder="仓库编码" />
  158. </td>
  159. <th class="formTitle">库位编码:</th>
  160. <td class="formValue">
  161. <input type="text" name="txt_LocationCode" id="txt_LocationCode" class="form-control" placeholder="库位编码" />
  162. </td>
  163. <th class="formTitle">创建日期:</th>
  164. <td class="formValue">
  165. <input id="txtMTIME" name="txtMTIME" type="text" class="form-control " style="width: 160px" />
  166. </td>
  167. <td>
  168. <span class="input-group-btn" style="font-size: 12px" >
  169. <button id="btn_search" type="button" class="btn btn-primary" onclick="Selchange()"><i class="fa fa-search"></i></button>
  170. </span>
  171. </td>
  172. </tr>
  173. </table>
  174. </div>
  175. </form>
  176. <div class="gridPanel">
  177. <table id="gridList"></table>
  178. <div id="gridPager"></div>
  179. </div>