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

171 lines
5.2 KiB

3 years ago
  1. @{
  2. ViewBag.Title = "Index";
  3. Layout = "~/Views/Shared/_Index.cshtml";
  4. }
  5. <style>
  6. #ISO {
  7. width: 10px;
  8. }
  9. </style>
  10. <link href="~/Content/js/select2/select2.min.css" rel="stylesheet" />
  11. <script src="~/Content/js/select2/select2.min.js"></script>
  12. <script>
  13. debugger;
  14. $(function () {
  15. debugger;
  16. InitControl();
  17. InitControl2();
  18. InitControl3();
  19. });
  20. //物料
  21. function InitControl() {
  22. debugger;
  23. var $InvCode = $("#sel_InvCode");
  24. $InvCode.select2({
  25. allowClear: true,
  26. escapeMarkup: function (m) {
  27. return m;
  28. }
  29. });
  30. $.ajax({
  31. url: "/WMS/BasicSettings/GetInvCode" + "?" + Math.random(),
  32. dataType: "json",
  33. async: false,
  34. success: function (data) {
  35. $.each(data, function (index, item) {
  36. $InvCode.append("<option value='" + item.InvCode + "'>" + item.InvName + "</option>");
  37. });
  38. }
  39. });
  40. }
  41. //不良代码
  42. function InitControl2() {
  43. debugger;
  44. var $BCGroupID = $("#sel_BCGroupID");
  45. $BCGroupID.select2({
  46. allowClear: true,
  47. escapeMarkup: function (m) {
  48. return m;
  49. }
  50. });
  51. $.ajax({
  52. url: "/WMS/BasicSettings/GetBCGroup" + "?" + Math.random(),
  53. dataType: "json",
  54. async: false,
  55. success: function (data) {
  56. $.each(data, function (index, item) {
  57. $BCGroupID.append("<option value='" + item.ID + "'>" + item.BCGDesc + "</option>");
  58. });
  59. }
  60. });
  61. }
  62. //不良原因
  63. function InitControl3() {
  64. debugger;
  65. var $BRGroupID = $("#sel_BRGroupID");
  66. $BRGroupID.select2({
  67. allowClear: true,
  68. escapeMarkup: function (m) {
  69. return m;
  70. }
  71. });
  72. $.ajax({
  73. url: "/WMS/BasicSettings/BRGroupID" + "?" + Math.random(),
  74. dataType: "json",
  75. async: false,
  76. success: function (data) {
  77. $.each(data, function (index, item) {
  78. $BRGroupID.append("<option value='" + item.ID + "'>" + item.BRGDesc + "</option>");
  79. });
  80. }
  81. });
  82. }
  83. function submitForm() {
  84. debugger;
  85. var InvCode = $("#sel_InvCode").val();
  86. var BCGroupID = $("#sel_BCGroupID").val();
  87. var BRGroupID = $("#sel_BRGroupID").val();
  88. var Enable = $('input[name="State"]:checked').val();
  89. if (InvCode == "") {
  90. $.modalAlert("请选择物料!");
  91. }
  92. if (BCGroupID == "") {
  93. $.modalAlert("请选择不良代码!");
  94. }
  95. if (BRGroupID == "") {
  96. $.modalAlert("请选择不良原因!");
  97. }
  98. var objArr = {
  99. InvCode: InvCode,
  100. BCGroupID: BCGroupID,
  101. BRGroupID:BRGroupID,
  102. Enable: Enable
  103. }
  104. $.submitForm({
  105. url: "/WMS/BasicSettings/InsertInventoryBadGroup" + "?" + Math.random(),
  106. param: { keyValue: JSON.stringify(objArr) },
  107. success: function () {
  108. $.currentWindow().$("#gridList").trigger("reloadGrid");
  109. }
  110. })
  111. }
  112. </script>
  113. <form id="form1">
  114. <div style="padding-top: 55px; margin-right: 130px;">
  115. <table class="form">
  116. <tr>
  117. <th class="formTitle">料品编码:</th>
  118. <td style="width:100px">
  119. <select id="sel_InvCode" name="sel_InvCode" class="form-control select2" style="width: 500px" placeholder="料品编码"></select>
  120. <input type="hidden" id="hidetext" />
  121. </td>
  122. </tr>
  123. <tr style="height:20px"></tr>
  124. <tr>
  125. <th class="formTitle">不良代码:</th>
  126. <td style="width:100px">
  127. <select id="sel_BCGroupID" name="sel_BCGroupID" class="form-control select2" style="width: 500px" placeholder="料品编码"></select>
  128. <input type="hidden" id="hidetext" />
  129. </td>
  130. </tr>
  131. <tr style="height:20px"></tr>
  132. <tr>
  133. <th class="formTitle">不良原因:</th>
  134. <td style="width:100px">
  135. <select id="sel_BRGroupID" name="sel_BRGroupID" class="form-control select2" style="width: 500px" placeholder="料品编码"></select>
  136. <input type="hidden" id="hidetext" />
  137. </td>
  138. </tr>
  139. <tr style="height:20px"></tr>
  140. <tr>
  141. <th class="formTitle">是否启用:</th>
  142. <td>
  143. <div class="input-group" id="changechaeckbox">
  144. <input type="radio" name="State" value="1" id="cb-StatusYes" style="width:30px" /><label for="cb-NoQuotedPrice">是</label>
  145. <input type="radio" name="State" value="0" id="cb-StatusNo" style="width:30px" /><label for="cb-QuotedPrice">否</label>
  146. </div>
  147. </td>
  148. </tr>
  149. </table>
  150. </div>
  151. </form>