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

138 lines
4.8 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/MaterialsDeliveredRTM/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: 'IssueCode', 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: 'IssueNegQuantity', width: 100, align: 'left' },
  35. { label: '数量2', name: 'Quantity', hidden: true },
  36. { label: '辅计量数量', name: 'Amount', width: 100, align: 'left' },
  37. { label: '自由项ID', name: 'ExtensionID', width: 100, align: 'left' },
  38. ],
  39. pager: "#gridPager",
  40. sortorder: "desc",
  41. sortname: 'InvCode',
  42. viewrecords: true,
  43. multiselect: true,
  44. gridComplete: function () {
  45. }
  46. })
  47. };
  48. function submitForm() {
  49. var rows = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  50. if (rows.length != 1) {
  51. $.modalAlert("只能选择一条数据!");
  52. return;
  53. }
  54. var rowdata = $("#gridList").jqGrid("getRowData", rows[0]);
  55. var obj = {
  56. ID: ID,
  57. TLZID:TLZID,
  58. ZJID: rowdata.ZJID,
  59. InvCode: rowdata.InvCode,
  60. INVNAME: rowdata.INVNAME,
  61. InvStd: rowdata.InvStd,
  62. InvUnit: rowdata.InvUnit,
  63. Quantity: rowdata.Quantity,
  64. IssueNegQuantity: rowdata.IssueNegQuantity,
  65. Amount: rowdata.Amount,
  66. ExtensionID: rowdata.ExtensionID,
  67. }
  68. var obj1 = JSON.stringify(obj);
  69. if (Type=='1') {
  70. $.ajax({
  71. url: "/WMS/MaterialsDeliveredRTM/UpdateMOApplyNegTemp?json=" + obj1 + "&" + Math.random(),
  72. async: false,
  73. success: function (data) {
  74. $.currentWindow().$("#gridList").trigger("reloadGrid");
  75. layer.msg(data.message);
  76. $.modalClose();
  77. },
  78. });
  79. }
  80. else {
  81. $.ajax({
  82. url: "/WMS/MaterialsDeliveredRTM/AddMOApplyNegTemp?json=" + obj1 + "&" + Math.random(),
  83. async: false,
  84. success: function (data) {
  85. $.currentWindow().$("#gridList").trigger("reloadGrid");
  86. layer.msg(data.message);
  87. $.modalClose();
  88. },
  89. });
  90. }
  91. };
  92. function Close() {
  93. $.modalClose();
  94. }
  95. function reloadData() {
  96. }
  97. </script>
  98. <div class="topPanel" style="height:50px">
  99. <div class="search">
  100. <table>
  101. <tr>
  102. <td>
  103. <label>料品编码:</label>
  104. </td>
  105. <td>
  106. <div class="input-group">
  107. <input id="txt_Invcode" type="text" class="form-control" placeholder="料品编码" style="width: 120px;">
  108. </div>
  109. </td>
  110. <td>
  111. <a id="Search" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="Init()"><i class="fa fa-pencil-square-o"></i>查询</a>
  112. </td>
  113. </tr>
  114. <tr></tr>
  115. </table>
  116. </div>
  117. </div>
  118. <div class="gridPanel" id="gridPanel">
  119. <table id="gridList"></table>
  120. <div id="gridPager"></div>
  121. </div>