纽威
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
5.0 KiB

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