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.

237 lines
6.7 KiB

3 weeks ago
  1. @{
  2. ViewBag.Title = "Form";
  3. Layout = "~/Views/Shared/_Form.cshtml";
  4. }
  5. <link href="~/Content/css/bootstrap/bootstrap-select.css" rel="stylesheet" />
  6. <link href="~/Content/css/toastr.min.css" rel="stylesheet" />
  7. <script src="~/Content/js/datepicker/WdatePicker.js"></script>
  8. <script src="~/Content/js/bootstrap/bootstrap-select.min.js"></script>
  9. <script src="~/Content/js/toastr.min.js"></script>
  10. <script src="~/Content/js/parseForm.js"></script>
  11. <style>
  12. .u-file-btn {
  13. position: relative;
  14. direction: ltr;
  15. height: 23px;
  16. overflow: hidden;
  17. line-height: 23px;
  18. margin-right: 10px;
  19. padding: 3px 0;
  20. text-align: center;
  21. width: 105px;
  22. color: black;
  23. background: #D0EEFF;
  24. border: 1px solid #1281c1;
  25. border-radius: 4px;
  26. color: #fff;
  27. background-color: #1281c1;
  28. border-color: #1281c1;
  29. }
  30. .u-file-btn-input {
  31. cursor: pointer;
  32. text-align: right;
  33. z-index: 10;
  34. font-size: 118px; /* font-size: 118px 工作正常 */
  35. position: absolute;
  36. top: 0px;
  37. right: 0px;
  38. opacity: 0;
  39. filter: Alpha(opacity:0);
  40. }
  41. </style>
  42. <script type="text/javascript">
  43. toastr.options.positionClass = 'toast-center-center';
  44. </script>
  45. <script>
  46. function btn_ExportCurrentStock() {
  47. $.modalOpen({
  48. id: "InitialWarehouse",
  49. title: "选择仓库",
  50. url: "/WMS/HomeWork/InitialWarehouse?" + Math.random(),
  51. width: "450px",
  52. height: "400px",
  53. callBack: function (iframeId) {
  54. top.frames[iframeId].submitForm();
  55. }
  56. });
  57. }
  58. $(".u-file-btn").on("change", "input[type='file']", function () {
  59. var filePath = $(this).val();
  60. if (filePath.indexOf("xls") != -1 || filePath.indexOf("xlsx") != -1) {
  61. var arr = filePath.split('\\');
  62. var fileName = arr[arr.length - 1];
  63. document.getElementById("showFileName").innerText = fileName;
  64. } else {
  65. document.getElementById("showFileName").innerText = "";
  66. alert("您未上传文件,或者您上传文件类型有误!");
  67. return false
  68. }
  69. })
  70. $(function () {
  71. var day = new Date();
  72. day.setTime(day.getTime());
  73. var Year = day.getFullYear();
  74. document.getElementById("txt_Year").value = Year;
  75. });
  76. function Upload()
  77. {
  78. var form = new FormData(document.getElementById("form1"));
  79. $.ajax({
  80. url: "/DHAY/ICSAccessoriesMOApply/UploadFile?" + Math.random(),
  81. type: "post",
  82. data: form,
  83. contentType: false,
  84. processData: false,
  85. success: function (data) {
  86. if (data == "true" || data == true) {
  87. //alert("上传成功");
  88. //layer.msg("上传成功");
  89. $.modalAlertNew("WMS00014");
  90. window.setTimeout(function () {
  91. $.modalClose();
  92. }, 2500);
  93. $.currentWindow().$("#gridList").trigger("reloadGrid");
  94. }
  95. else {
  96. //alert("上传失败:" + data);
  97. $.modalAlertNew("WMS00016", data);
  98. }
  99. },
  100. error: function (aa) {
  101. $.modalAlertNew("WMS00016", aa);
  102. }
  103. });
  104. }
  105. function LotNoUpload() {
  106. $("#LotNoUpload").prop("disabled", true);
  107. var form = new FormData(document.getElementById("form1"));
  108. $.ajax({
  109. url: "/WMS/HomeWork/LotNoUploadFile?" + Math.random(),
  110. type: "post",
  111. data: form,
  112. contentType: false,
  113. processData: false,
  114. success: function (data) {
  115. if (data == "true" || data == true) {
  116. //alert("上传成功");
  117. //layer.msg("上传成功");
  118. $.modalAlertNew("WMS00014");
  119. window.setTimeout(function () {
  120. $.modalClose();
  121. }, 2500);
  122. $("#LotNoUpload").prop("disabled", false);
  123. $.currentWindow().$("#gridList").trigger("reloadGrid");
  124. }
  125. else {
  126. //alert("上传失败:" + data);
  127. $("#LotNoUpload").prop("disabled", false);
  128. $.modalAlertNew("WMS00016", data);
  129. }
  130. },
  131. error: function (aa) {
  132. $("#LotNoUpload").prop("disabled", false);
  133. $.modalAlertNew("WMS00016", aa);
  134. }
  135. });
  136. }
  137. </script>
  138. <form id="form1">
  139. <div style="padding-top: 20px; ">
  140. <table class="form" style="text-align:left">
  141. <tr>
  142. <td class="formValue" colspan="2">
  143. <a href="~/File/Stack/辅料出库导入模板.xlsx" id="NF-IntroductionMould" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_IntroductionMould()"><i class="fa fa-file-excel-o"></i>导入模板下载</a>
  144. </td>
  145. </tr>
  146. <tr>
  147. <td class="formValue" colspan="2">
  148. <div class="btn-group" style="width:35px">
  149. <label>年份:</label>
  150. </div>
  151. <div class="btn-group">
  152. <input type="text" name="txt_Year" id="txt_Year" class="form-control" style="width:70px" />
  153. </div>
  154. </td>
  155. <td>
  156. <label id="showFileName"></label>
  157. </td>
  158. </tr>
  159. <tr>
  160. <td class="formValue" style="width:125px">
  161. <div id="u-file-c" class="u-file-btn">
  162. <input type="file" class="u-file-btn-input" name="files" accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" style="width:350px" />选择上传文件
  163. </div>
  164. </td>
  165. <td class="formValue">
  166. <a id="NF-ExportCurrentStock" authorize="yes" class="btn btn-primary dropdown-text" onclick="Upload()"><i class="fa fa-download"></i>导入数据</a>
  167. </td>
  168. </tr>
  169. <tr>
  170. <td class="formValue">
  171. <label class="radio-inline">
  172. <input type="text" name="UPLoadType" id="UPLoadType" class="form-control" value="NCR数量" style="display:none;visibility:hidden" />
  173. </label>
  174. </td>
  175. </tr>
  176. </table>
  177. </div>
  178. </form>