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.

205 lines
6.5 KiB

3 weeks ago
  1. 
  2. @{
  3. ViewBag.Title = "Index";
  4. Layout = "~/Views/Shared/_Index.cshtml";
  5. }
  6. <link href="~/Content/js/select2/select2.min.css" rel="stylesheet" />
  7. <script src="~/Content/js/datepicker/WdatePicker.js"></script>
  8. <script src="~/Content/js/select2/select2.min.js"></script>
  9. <style>
  10. #Additem {
  11. margin-left: 45%;
  12. }
  13. #AddTemitem {
  14. margin-right: 45%;
  15. }
  16. </style>
  17. <script>
  18. var _Clos = new Array();
  19. var InvName = decodeURI($.request("InvName"));
  20. var RCVCode = $.request("RCVCode");
  21. var Sequence = $.request("Sequence");
  22. var ProductionCode = $.request("ProductionCode");
  23. var Quantity = $.request("Quantity");
  24. var InvCode = $.request("InvCode");
  25. var WHCode = $.request("WHCode");
  26. var BoundQuantity = $.request("BoundQuantity");
  27. debugger;
  28. $(function(){
  29. SetCols();
  30. $("#txtInvName").val(InvName);
  31. $("#txtRCVCode").val(RCVCode);
  32. $("#txtSequence").val(Sequence);
  33. $("#txtProductionCode").val(ProductionCode);
  34. $("#txtQuantity").val(Quantity);
  35. $("#txtInvCode").val(InvCode);
  36. reloadData();
  37. })
  38. function SetCols() {
  39. var cols = new Array();
  40. var collast = { label: '主键', name: 'ID', width: 150, align: 'left', hidden: true, key: true };
  41. cols.push(collast);
  42. var collast = { label: 'ID', name: 'ID', width: 150, align: 'left', hidden: true };
  43. cols.push(collast);
  44. var collast = { label: '生成订单号', name: 'ProductionCode', width: 150, align: 'left' };
  45. cols.push(collast);
  46. var collast = { label: '料品代码', name: 'InvCode', width: 100, align: 'left' };
  47. cols.push(collast);
  48. var collast = { label: '料品名称', name: 'InvName', width: 100, align: 'left' };
  49. cols.push(collast);
  50. var collast = { label: '规格型号', name: 'InvStd', width: 100, align: 'left' };
  51. cols.push(collast);
  52. var collast = { label: '入库条码', name: 'LotNo', width: 100, align: 'left' };
  53. cols.push(collast);
  54. var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
  55. cols.push(collast);
  56. var collast = { label: '操作人', name: 'MUSERName', width: 150, align: 'left' };
  57. cols.push(collast);
  58. var collast = { label: '操作时间', name: 'MTIME', width: 150, align: 'left'};
  59. cols.push(collast);
  60. _Clos = cols;
  61. }
  62. function reloadData() {
  63. var $gridList = $("#gridList");
  64. $("#gridList").dataGrid({
  65. url: "/KBSWMS/ICSManufactureReceive/GetManufactureReceiveLot?" + "ProductionCode=" + ProductionCode + "&WHCode=" + WHCode + "&InvCode=" + InvCode+ "&" + Math.random(),
  66. //postData: { rfqno: $("#RFQNO").val() },
  67. height: $(window).height() - 200,
  68. width: $(window).width(),
  69. cellEdit: true,
  70. colModel: _Clos,
  71. cellsubmit: "clientArray",
  72. gridComplete: function () {
  73. },
  74. width: "100%",
  75. autowidth: true,
  76. rownumbers: true,
  77. rowNum: 10000,
  78. viewrecords: true,
  79. multiselect: true
  80. });
  81. }
  82. function guid() {
  83. return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
  84. var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
  85. return v.toString(16);
  86. });
  87. }
  88. function submitForm() {
  89. debugger;
  90. var rowIds_vendor = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  91. var ids = new Array();
  92. var quantity = 0;
  93. if (rowIds_vendor.length < 1)
  94. {
  95. $.modalAlertNew("WMS00003");
  96. return;
  97. }
  98. for (var i = 0; i < rowIds_vendor.length; i++) {
  99. var vendorRowData = $("#gridList").getRowData(rowIds_vendor[i]);
  100. var LotQuantity = Number(vendorRowData.Quantity);
  101. var ID = vendorRowData.ID
  102. quantity += LotQuantity;
  103. ids += "'" + ID + "',";
  104. }
  105. if (quantity > (Quantity - BoundQuantity))
  106. {
  107. $.modalAlertNew("WMS00124");
  108. return;
  109. }
  110. var ICSASN = {
  111. RCVCode: $("#txtRCVCode").val(),
  112. RCVSequence: $("#txtSequence").val(),
  113. IDs:ids
  114. }
  115. $.submitForm({
  116. url: "/KBSWMS/ICSManufactureReceive/BindingLot?" + Math.random(),
  117. param: { ICSASN: JSON.stringify(ICSASN) },
  118. success: function (data) {
  119. if (data.state == "error")
  120. {
  121. alert(data.message);
  122. return;
  123. }
  124. $.currentWindow().$("#gridList").trigger("reloadGrid");
  125. }
  126. })
  127. }
  128. </script>
  129. <form id="form1">
  130. <div class="topPanel" style="height:10px">
  131. <div class="btn-group">
  132. </div>
  133. </div>
  134. <div style="margin-right: 20px;">
  135. <table class="form">
  136. <tr>
  137. <th class="formTitle">入库单号:</th>
  138. <td class="formValue">
  139. <input type="text" id="txtRCVCode" readonly="readonly" class="form-control" />
  140. </td>
  141. <th class="formTitle">生产订单号:</th>
  142. <td class="formValue">
  143. <input type="text" id="txtProductionCode" readonly="readonly" class="form-control" />
  144. </td>
  145. <th class="formTitle">入库数量:</th>
  146. <td class="formValue">
  147. <input id="txtQuantity" type="text" readonly="readonly" class="form-control" />
  148. </td>
  149. </tr>
  150. <tr>
  151. <th class="formTitle">入库单行号:</th>
  152. <td class="formValue">
  153. <input id="txtSequence" type="text" readonly="readonly" class="form-control" />
  154. </td>
  155. <th class="formTitle">物料编码:</th>
  156. <td class="formValue">
  157. <input id="txtInvCode" type="text" readonly="readonly" class="form-control" />
  158. </td>
  159. <th class="formTitle">物料名称:</th>
  160. <td class="formValue">
  161. <input id="txtInvName" type="text" readonly="readonly" class="form-control" />
  162. </td>
  163. </tr>
  164. </table>
  165. </div>
  166. <div class="gridPanel" style="margin-left:10px">
  167. <table id="gridList"></table>
  168. </div>
  169. </form>