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

157 lines
4.8 KiB

3 years ago
  1. 
  2. @{
  3. ViewBag.Title = "Index";
  4. Layout = "~/Views/Shared/_Form.cshtml";
  5. }
  6. <style>
  7. .form {
  8. margin: 25px -30px;
  9. }
  10. </style>
  11. <script>
  12. var WorkPoints = '@NFine.Code.OperatorProvider.Provider.GetCurrent().Location'
  13. var User = '@NFine.Code.OperatorProvider.Provider.GetCurrent().UserCode'
  14. var Times = new Date();
  15. var Time = formatDate("YYYY-mm-dd HH:MM:SS", Times);
  16. $(function () {
  17. $("#minPackQty").keyup(function () {
  18. $(this).val($(this).val().replace(/[^0-9.]/g, ''));
  19. }).bind("paste", function () { //CTR+V事件处理
  20. $(this).val($(this).val().replace(/[^0-9.]/g, ''));
  21. }).css("ime-mode", "disabled"); //CSS设置输入法不可用
  22. $("#thisCreateQty").keyup(function () {
  23. $(this).val($(this).val().replace(/[^0-9.]/g, ''));
  24. }).bind("paste", function () { //CTR+V事件处理
  25. $(this).val($(this).val().replace(/[^0-9.]/g, ''));
  26. }).css("ime-mode", "disabled"); //CSS设置输入法不可用
  27. $("#cretePageCount").keyup(function () {
  28. $(this).val($(this).val().replace(/[^0-9.]/g, ''));
  29. }).bind("paste", function () { //CTR+V事件处理
  30. $(this).val($(this).val().replace(/[^0-9.]/g, ''));
  31. }).css("ime-mode", "disabled"); //CSS设置输入法不可用
  32. $("#txtMUSER").val(User);
  33. $("#txtMTIME").val(Time);
  34. $("#txtMUSER").attr("disabled", "disabled");
  35. $("#txtMTIME").attr("disabled", "disabled");
  36. InitControl();
  37. });
  38. function formatDate(fomatType, date) {
  39. let ret;
  40. let valueDate = date;
  41. if (!date) valueDate = new Date()
  42. let opt = {
  43. "Y+": valueDate.getFullYear().toString(), // 年
  44. "m+": (valueDate.getMonth() + 1).toString(), // 月
  45. "d+": valueDate.getDate().toString(), // 日
  46. "H+": valueDate.getHours().toString(), // 时
  47. "M+": valueDate.getMinutes().toString(), // 分
  48. "S+": valueDate.getSeconds().toString() // 秒
  49. };
  50. for (let k in opt) {
  51. ret = new RegExp("(" + k + ")").exec(fomatType);
  52. if (ret) {
  53. fomatType = fomatType.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0")))
  54. };
  55. };
  56. return fomatType;
  57. }
  58. function InitControl() {
  59. debugger;
  60. var $WHCode = $("#sel_WHCode");
  61. $WHCode.select2({
  62. allowClear: true,
  63. escapeMarkup: function (m) {
  64. return m;
  65. }
  66. });
  67. $.ajax({
  68. url: "/WMS/Blitem/GetWHCode?" + Math.random(),
  69. dataType: "json",
  70. async: false,
  71. success: function (data) {
  72. $.each(data, function (index, item) {
  73. $WHCode.append("<option value='" + item.WarehouseCode + "'>" + item.WarehouseName + "</option>");
  74. });
  75. }
  76. });
  77. }
  78. function submitForm() {
  79. debugger;
  80. if (!$('#form1').formValid()) {
  81. return false;
  82. }
  83. var WHCode = $("#sel_WHCode").val();
  84. if (WHCode=='') {
  85. $.modalAlert("请选择仓库!");
  86. return;
  87. }
  88. var Details = [];
  89. var obj = {
  90. WHCode: WHCode,
  91. };
  92. Details.push(obj);
  93. var Header = {
  94. User: User,
  95. MTIME: Time,
  96. WorkPoint: WorkPoints,
  97. Detail: Details,
  98. }
  99. var Parameter = [];
  100. Parameter.push(Header);
  101. $.submitForm({
  102. url: "/WMS/Blitem/AddICSCheck?" + Math.random(),
  103. param: { Parameter: JSON.stringify(Parameter) },
  104. success: function () {
  105. $.currentWindow().$("#gridList").trigger("reloadGrid");
  106. }
  107. })
  108. }
  109. </script>
  110. <form id="form1">
  111. <div style="padding-top: 20px; margin-right: 20px;">
  112. <table class="form">
  113. <tr>
  114. <th class="formTitle">&nbsp;盘点仓库:</th>
  115. <td style="width:100px">
  116. <select id="sel_WHCode" name="sel_WHCode" class="form-control select2" style="width: 500px" placeholder="料品条码"></select>
  117. <input type="hidden" id="hidetext" />
  118. </td>
  119. </tr>
  120. <tr>
  121. <th class="formTitle">维护人:</th>
  122. <td class="formValue">
  123. <input id="txtMUSER" name="txtMUSER" type="text" class="form-control " />
  124. </td>
  125. </tr>
  126. <tr>
  127. <th class="formTitle">维护日期:</th>
  128. <td class="formValue">
  129. <input id="txtMTIME" name="txtMTIME" type="text" class="form-control " />
  130. </td>
  131. </tr>
  132. </table>
  133. </div>
  134. </form>