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

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