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

139 lines
4.9 KiB

  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. var ID = $.request("ID");
  13. var Type = $.request("Type");
  14. var TLZID = $.request("TLZID");
  15. $(function(){
  16. Init();
  17. })
  18. function Init() {
  19. document.getElementById("gridPanel").innerHTML = ' <span><strong>详细信息</strong></span> <table id="gridList"></table> ';//重置grid
  20. var invcode = $("#txt_Invcode").val();
  21. $("#gridList").dataGrid({
  22. url: "/WMS/WWProductionRAFMR/GetINV" + "?invcode=" + invcode + "&" + Math.random(),
  23. height: $(window).height() - 20,
  24. width: $(window).width() - 300,
  25. colModel: [
  26. { label: '主键', name: 'ID', hidden: true, key: true },
  27. { label: '子件ID', name: 'ZJID', hidden: true },
  28. { label: '来源单据号', name: 'ApplyCode', width: 100, align: 'left' },
  29. { label: '来源单据行号', name: 'MuHang', width: 100, align: 'left' },
  30. { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
  31. { label: '料品名称', name: 'INVNAME', width: 100, align: 'left' },
  32. { label: '规格型号', name: 'InvStd', width: 100, align: 'left' },
  33. { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
  34. { label: '数量', name: 'Quantity', hidden: true },
  35. { label: '辅计量数量', name: 'Amount', width: 100, align: 'left' },
  36. { label: '已发数量', name: 'IssueQuantity', width: 100, align: 'left' },
  37. { label: '自由项ID', name: 'ExtensionID', width: 100, align: 'left' },
  38. { label: '已退数量', name: 'tuinum', width: 100, align: 'left' },
  39. ],
  40. pager: "#gridPager",
  41. sortorder: "desc",
  42. sortname: 'InvCode',
  43. viewrecords: true,
  44. multiselect: true,
  45. gridComplete: function () {
  46. }
  47. })
  48. };
  49. function submitForm() {
  50. var rows = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  51. if (rows.length != 1) {
  52. $.modalAlert("只能选择一条数据!");
  53. return;
  54. }
  55. var rowdata = $("#gridList").jqGrid("getRowData", rows[0]);
  56. var obj = {
  57. ID: ID,
  58. TLZID:TLZID,
  59. ZJID: rowdata.ZJID,
  60. InvCode: rowdata.InvCode,
  61. INVNAME: rowdata.INVNAME,
  62. InvStd: rowdata.InvStd,
  63. InvUnit: rowdata.InvUnit,
  64. Quantity: rowdata.Quantity,
  65. Amount: rowdata.Amount,
  66. IssueNegQuantity: rowdata.IssueQuantity,
  67. ExtensionID: rowdata.ExtensionID,
  68. tuinum: rowdata.tuinum,
  69. }
  70. var obj1 = JSON.stringify(obj);
  71. if (Type=='1') {
  72. $.ajax({
  73. url: "/WMS/WWProductionRAFMR/UpdateMOApplyNegTemp?json=" + obj1 + "&" + Math.random(),
  74. async: false,
  75. success: function (data) {
  76. $.currentWindow().$("#gridList").trigger("reloadGrid");
  77. layer.msg(data.message);
  78. $.modalClose();
  79. },
  80. });
  81. }
  82. else {
  83. $.ajax({
  84. url: "/WMS/WWProductionRAFMR/AddMOApplyNegTemp?json=" + obj1 + "&" + Math.random(),
  85. async: false,
  86. success: function (data) {
  87. $.currentWindow().$("#gridList").trigger("reloadGrid");
  88. layer.msg(data.message);
  89. $.modalClose();
  90. },
  91. });
  92. }
  93. };
  94. function Close() {
  95. $.modalClose();
  96. }
  97. function reloadData() {
  98. }
  99. </script>
  100. <div class="topPanel" style="height:50px">
  101. <div class="search">
  102. <table>
  103. <tr>
  104. <td>
  105. <label>料品编码:</label>
  106. </td>
  107. <td>
  108. <div class="input-group">
  109. <input id="txt_Invcode" type="text" class="form-control" placeholder="料品编码" style="width: 120px;">
  110. </div>
  111. </td>
  112. <td>
  113. <a id="Search" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="Init()"><i class="fa fa-pencil-square-o"></i>查询</a>
  114. </td>
  115. </tr>
  116. <tr></tr>
  117. </table>
  118. </div>
  119. </div>
  120. <div class="gridPanel" id="gridPanel">
  121. <table id="gridList"></table>
  122. <div id="gridPager"></div>
  123. </div>