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

210 lines
7.0 KiB

3 years ago
  1. 
  2. @{
  3. ViewBag.Title = "SeachInventory";
  4. Layout = "~/Views/Shared/_Index.cshtml";
  5. }
  6. <link href="~/Content/js/select2/select2.min.css" rel="stylesheet" />
  7. <link href="~/Content/js/dialog/dialog.css" rel="stylesheet" />
  8. <script src="~/Content/js/datepicker/WdatePicker.js"></script>
  9. <script src="~/Content/js/select2/select2.min.js"></script>
  10. <script>
  11. debugger;
  12. $(function () {
  13. Init();
  14. });
  15. function Init() {
  16. document.getElementById("gridPanel").innerHTML = ' <span><strong>详细信息</strong></span> <table id="gridList"></table> ';//重置grid
  17. var LotNo = $("#txt_LotNo").val();
  18. $("#gridList").dataGrid({
  19. url: "/WMS/ICSMTDOC/GetRepertory" + "?LotNo=" + LotNo + "&" + Math.random(),
  20. height: $(window).height() - 20,
  21. width: $(window).width() - 300,
  22. colModel: [
  23. { label: '主键', name: 'ID', hidden: true, key: true },
  24. { label: '仓库', name: 'WarehouseCode', width: 100, align: 'left' },
  25. { label: '条码', name: 'LotNo', width: 100, align: 'left' },
  26. { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  27. { label: '料品名称', name: 'InvName', width: 100, align: 'left' },
  28. { label: '料品描述', name: 'InvDesc', width: 100, align: 'left' },
  29. { label: '规格型号', name: 'InvStd', width: 100, align: 'left' },
  30. { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  31. { label: '总数量', name: 'Quantity', width: 100, align: 'left' },
  32. { label: '辅计量数量', name: 'AmountRate', width: 100, align: 'left' },
  33. ],
  34. shrinkToFit: false,//宽度自适应
  35. autowidth: true,
  36. gridComplete: function () {
  37. },
  38. rowNum: 10000,
  39. autoScroll: true,
  40. sortname: 'LotNO',
  41. sortorder: "desc",
  42. viewrecords: true,
  43. multiselect: true,
  44. })
  45. };
  46. function submitForm() {
  47. var rows = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  48. if (rows.length <= 0) {
  49. $.modalAlert("请选择至少一条数据,进行形态转换!");
  50. return;
  51. }
  52. var InvCode = $("#txtInvCode").val();
  53. var ExtensionID = $("#txtExtensionID").val();
  54. var Memo = $("#txtMemo").val();
  55. var ICSMTDOC = [];
  56. for (var i = 0; i < rows.length; i++) {
  57. var rowData = $("#gridList").jqGrid('getRowData', rows[i]);
  58. if (rowData.AmountRate=='') {
  59. var Amounts = 0;
  60. } else {
  61. var Amounts = rowData.AmountRate;
  62. }
  63. var obj = {
  64. WHCode: rowData.WarehouseCode,//仓库
  65. LotNo: rowData.LotNo,//条码
  66. Quantity: rowData.Quantity,//数量
  67. Amount: Amounts,//辅计量数量
  68. MTDOCQuantity: rowData.Quantity,//已转换数量
  69. }
  70. ICSMTDOC.push(obj);
  71. }
  72. $.modalConfirm("确定保存吗?", function (r) {
  73. if (r) {
  74. $.submitForm({
  75. url: "/WMS/ICSMTDOC/CreateICSMTDOC?InvCode=" + InvCode + "&ExtensionID=" + ExtensionID + "&Memo=" + Memo + "&" + Math.random(),
  76. param: { ICSMTDOC: JSON.stringify(ICSMTDOC) },
  77. success: function () {
  78. $.currentWindow().$("#gridList").trigger("reloadGrid");
  79. }
  80. })
  81. }
  82. });
  83. };
  84. //监听Check事件
  85. function OncheckBox1() {
  86. if ($("#InvCodebox").is(':checked')) {
  87. $('#txtInvCode').attr("disabled", false);
  88. } else {
  89. $("#txtInvCode").attr("disabled", "disabled");
  90. }
  91. }
  92. function OncheckBox2() {
  93. if ($("#BatchCodebox").is(':checked')) {
  94. $('#txtBatchCode').attr("disabled", false);
  95. } else {
  96. $("#txtBatchCode").attr("disabled", "disabled");
  97. }
  98. }
  99. function GetInventory() {
  100. $.modalOpen({
  101. id: "GetICSInventory",
  102. title: "形态转换",
  103. url: "/WMS/ICSMTDOC/GetICSInventory?"+ Math.random(),
  104. width: "1000px",
  105. height: "1000px",
  106. callBack: function (iframeId) {
  107. var obj = top.frames[iframeId].submitForm();
  108. $("#txtInvCode").val(obj.InvCode);
  109. top.frames[iframeId].Close();
  110. }
  111. })
  112. }
  113. function GetBatchCode() {
  114. $.modalOpen({
  115. id: "GetBatchCode",
  116. title: "形态转换",
  117. url: "/WMS/ICSMTDOC/GetBatchCode?" + Math.random(),
  118. width: "1000px",
  119. height: "1000px",
  120. callBack: function (iframeId) {
  121. var obj = top.frames[iframeId].submitForm();
  122. $("#txtBatchCode").val(obj.BatchCode);
  123. $("#txtExtensionID").val(obj.ZYID);
  124. top.frames[iframeId].Close();
  125. }
  126. })
  127. }
  128. function Close() {
  129. $.modalClose();
  130. }
  131. function reloadData() {
  132. }
  133. </script>
  134. <div class="topPanel" style="height:50px">
  135. <div class="search">
  136. <table>
  137. <tr>
  138. <td>
  139. <label>条码:</label>
  140. </td>
  141. <td>
  142. <div class="input-group">
  143. <input id="txt_LotNo" type="text" class="form-control" placeholder="条码" style="width: 120px;">
  144. </div>
  145. </td>
  146. <td>
  147. <a id="Search" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="Init()"><i class="fa fa-pencil-square-o"></i>查询</a>
  148. </td>
  149. </tr>
  150. <tr></tr>
  151. </table>
  152. </div>
  153. </div>
  154. <div style="margin-right: 20px;">
  155. <table class="form">
  156. <thead>选择转换料品</thead>
  157. <tr>
  158. <th class="formTitle">料品编码:</th>
  159. <td class="formValue">
  160. <input id="txtInvCode" type="text" disabled="disabled" class="form-control" onclick="GetInventory()" autocomplete="off" />
  161. </td>
  162. <td >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  163. <input id="InvCodebox" type="checkbox" onclick="OncheckBox1(this)">
  164. </td>
  165. <th class="formTitle">批次:</th>
  166. <td class="formValue">
  167. <input id="txtBatchCode" type="text" disabled="disabled" class="form-control" onclick="GetBatchCode()" autocomplete="off" />
  168. <input id="txtExtensionID" type="text" style="display:none" class="form-control" />
  169. </td>
  170. <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  171. <input id="BatchCodebox" type="checkbox" onclick="OncheckBox2(this)">
  172. </td>
  173. <th class="formTitle">转换原因:</th>
  174. <td class="formValue">
  175. <input id="txtMemo" type="text" class="form-control" />
  176. </td>
  177. </tr>
  178. </table>
  179. </div>
  180. <div class="gridPanel" id="gridPanel">
  181. <table id="gridList"></table>
  182. <div id="gridPager"></div>
  183. </div>