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

132 lines
4.5 KiB

3 years ago
3 years ago
3 years ago
  1. 
  2. @{
  3. ViewBag.Title = "Index";
  4. Layout = "~/Views/Shared/_Index.cshtml";
  5. }
  6. <style>
  7. #ISO {
  8. width: 10px;
  9. }
  10. </style>
  11. <link href="~/Content/js/select2/select2.min.css" rel="stylesheet" />
  12. <script src="~/Content/js/select2/select2.min.js"></script>
  13. <script>
  14. var ID = $.request("ID");
  15. var ContainerID = $.request("ContainerID");
  16. var ContainerCODE = $.request("ContainerCODE");
  17. var ContainerName = decodeURI($.request("ContainerName"));
  18. var Memo = $.request("Memo");
  19. $(function () {
  20. InitControl();
  21. if (ID != "") {
  22. $("#sel_ContainerID").val([ContainerID]).trigger("change");
  23. $("#ContainerCODE").val(ContainerCODE);
  24. $("#ContainerName").val(ContainerName);
  25. $("#Memo").val(Memo);
  26. }
  27. });
  28. function InitControl() {
  29. var $VenCode = $("#sel_ContainerID");
  30. $VenCode.select2({
  31. allowClear: true,
  32. escapeMarkup: function (m) {
  33. return m;
  34. }
  35. });
  36. $.ajax({
  37. url: "/WMS/BasicSettings/GetContainerID" + "?" + Math.random(),
  38. dataType: "json",
  39. async: false,
  40. success: function (data) {
  41. $.each(data, function (index, item) {
  42. $VenCode.append("<option value='" + item.ID + "'>&nbsp;" + item.ContainerName + "</option>");
  43. });
  44. }
  45. });
  46. }
  47. function submitForm() {
  48. var ContainerID = $("#sel_ContainerID").val();
  49. var ContainerCODE = $("#ContainerCODE").val();
  50. var ContainerName = $("#ContainerName").val();
  51. var Memo = $("#Memo").val();
  52. //var Enable = $('input[name="State"]:checked').val();
  53. if (ContainerCODE == "" || ContainerCODE == undefined) {
  54. $.modalAlertNew("WMS00018");
  55. return;
  56. }
  57. if (ContainerName == "" || ContainerName == undefined) {
  58. $.modalAlertNew("WMS00019");
  59. return;
  60. }
  61. var objArr = {
  62. ID:ID,
  63. ContainerID: ContainerID,
  64. ContainerCODE: ContainerCODE,
  65. ContainerName: ContainerName,
  66. Memo: Memo
  67. }
  68. debugger;
  69. if (ID!="") {
  70. $.submitForm({
  71. url: "/WMS/BasicSettings/UpdateICSContainer" + "?" + Math.random(),
  72. param: { keyValue: JSON.stringify(objArr) },
  73. success: function () {
  74. $.currentWindow().$("#gridList").trigger("reloadGrid");
  75. }
  76. })
  77. } else {
  78. $.submitForm({
  79. url: "/WMS/BasicSettings/InsertICSContainer" + "?" + Math.random(),
  80. param: { keyValue: JSON.stringify(objArr) },
  81. success: function () {
  82. $.currentWindow().$("#gridList").trigger("reloadGrid");
  83. }
  84. })
  85. }
  86. }
  87. </script>
  88. <form id="form1">
  89. <div style="padding-top: 20px; margin-right: 20px;">
  90. <table class="form">
  91. <tr>
  92. <th class="formTitle">父容器ID:</th>
  93. <td class="formValue">
  94. <select id="sel_ContainerID" name="sel_ContainerID" class="form-control select2" style="width: 150px" placeholder="请选择父容器..."></select>
  95. <input type="hidden" id="hidetext" />
  96. </td>
  97. </tr>
  98. <tr>
  99. <th class="formTitle">容器代码:</th>
  100. <td class="formValue">
  101. <input id="ContainerCODE" name="ContainerCODE" type="text" class="form-control required" style="width: 359px;" maxlength="50" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })" placeholder="容器代码" />
  102. </td>
  103. </tr>
  104. <tr>
  105. <th class="formTitle">容器名称:</th>
  106. <td class="formValue">
  107. <input id="ContainerName" name="ContainerName" type="text" class="form-control required" style="width: 359px;" maxlength="50" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })" placeholder="容器名称" />
  108. </td>
  109. </tr>
  110. <tr>
  111. <th class="formTitle">备注:</th>
  112. <td class="formValue">
  113. <input id="Memo" name="Memo" type="text" class="form-control required" style="width: 359px;" maxlength="50" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })" placeholder="备注" />
  114. </td>
  115. </tr>
  116. </table>
  117. </div>
  118. </form>