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.

257 lines
10 KiB

  1. @{
  2. ViewBag.Title = "Index";
  3. Layout = "~/Views/Shared/_Form.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. var ID = $.request("ID");
  14. var BoxNumber = $.request("BoxNumber");
  15. //var WarehouseName = decodeURI($.getUrlParam("WarehouseName"));
  16. var Type = $.request("Type");
  17. var Version = $.request("Version");
  18. var BoxName = decodeURI($.request("BoxName"));
  19. var Specification = $.request("Specification");
  20. var Describe = $.request("Describe");
  21. var FirstCleanCycle = $.request("FirstCleanCycle");
  22. var SecondCleanCycle = $.request("SecondCleanCycle");
  23. var ThirdCleanCycle = $.request("ThirdCleanCycle");
  24. //var expArrivalDate = $
  25. $(function () {
  26. debugger;
  27. InitControl();
  28. if (ID != "") {
  29. $("#sel_Type").val([Type]).trigger("change");
  30. $("#BoxNumber").val(BoxNumber);
  31. $("#BoxName").val(BoxName);
  32. $("#Version").val(Version);
  33. $("#Specification").val(Specification);
  34. $("#Describe").val(Describe);
  35. $("#FirstCleanCycle").val(FirstCleanCycle);
  36. $("#SecondCleanCycle").val(SecondCleanCycle);
  37. $("#ThirdCleanCycle").val(ThirdCleanCycle);
  38. }
  39. });
  40. $.getUrlParam = function (name) {
  41. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  42. var r = window.location.search.substr(1).match(reg);
  43. if (r != null) return unescape(r[2]); return null;
  44. }
  45. ;
  46. function InitControl() {
  47. debugger;
  48. var $VenCode = $("#sel_Type");
  49. $VenCode.select2({
  50. allowClear: true,
  51. escapeMarkup: function (m) {
  52. return m;
  53. }
  54. });
  55. $.ajax({
  56. url: "/Boxes/BasicSettings/GetType?tableName=" + "ICSWorkingCapitalBox" + "&" + Math.random(),
  57. dataType: "json",
  58. async: false,
  59. success: function (data) {
  60. $.each(data, function (index, item) {
  61. $VenCode.append("<option value='" + item.Type + "'>" + item.Type + "</option>");
  62. });
  63. }
  64. });
  65. }
  66. //新增条码
  67. function btnCreate() {
  68. var STNO = $("#STNO").text();
  69. Vendor = $("#sel_VenCode").find("option:selected").val();
  70. if (STNO == "") {
  71. $.modalAlertNew("WMS00059");
  72. return;
  73. }
  74. var expArrivalDate = $("#ExpArivalDate").val();
  75. if (expArrivalDate == '' || expArrivalDate == null) {
  76. $.modalAlertNew("WMS00060");
  77. return;
  78. }
  79. $.modalOpen2({
  80. id: "Form",
  81. title: "条码信息",
  82. url: "/SRM/ASNSelect/Index?STNO=" + STNO + "&Vendor=" + Vendor + "&" + Math.random(),
  83. width: "800px",
  84. height: "500px",
  85. callBack: function (iframeId) {
  86. top.frames[iframeId].submitForm();
  87. }
  88. });
  89. }
  90. //新增箱号
  91. function btnAddCartonNo() {
  92. var STNO = $("#STNO").text();
  93. Vendor = $("#sel_VenCode").find("option:selected").val();
  94. if (STNO == "") {
  95. $.modalAlertNew("WMS00059");
  96. return;
  97. }
  98. var expArrivalDate = $("#ExpArivalDate").val();
  99. if (expArrivalDate == '' || expArrivalDate == null) {
  100. $.modalAlertNew("WMS00060");
  101. return;
  102. }
  103. $.modalOpen2({
  104. id: "Form",
  105. title: "箱号信息",
  106. url: "/SRM/ASNCartonSelect/Index?STNO=" + STNO + "&Vendor=" + Vendor + "&" + Math.random(),
  107. width: "800px",
  108. height: "500px",
  109. callBack: function (iframeId) {
  110. top.frames[iframeId].submitForm();
  111. }
  112. });
  113. }
  114. //刷新
  115. function reloadData() {
  116. STNO = $("#STNO").text();
  117. var queryJson = {
  118. STNO: STNO,
  119. }
  120. $("#gridList").jqGrid('setGridParam', {
  121. postData: { queryJson: JSON.stringify(queryJson) },
  122. }).trigger('reloadGrid');
  123. }
  124. //删除条码
  125. function btn_delete() {
  126. var objArr = "";
  127. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  128. if (objList.length == 0) {
  129. $.modalAlertNew("WMS00061");
  130. return;
  131. }
  132. for (var i = 0; i < objList.length; i++) {
  133. var rowId = objList[i];
  134. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  135. objArr += "'" + rowData.ASNDETAILID + "',";
  136. }
  137. $.deleteForm({
  138. url: "/SRM/ASNAdd/DeleteInfo" + "?" + Math.random(),
  139. param: { keyValue: JSON.stringify(objArr) },
  140. success: function () {
  141. reloadData();
  142. }
  143. })
  144. }
  145. //新增周转箱
  146. function submitForm() {
  147. debugger;
  148. var BoxNumber = $("#BoxNumber").val();
  149. var BoxName = $("#BoxName").val();
  150. var Type = $("#sel_Type").find("option:selected").text();
  151. var Version = $("#Version").val();
  152. var Specification = $("#Specification").val();
  153. var Describe = $("#Describe").val();
  154. var FirstCleanCycle = $("#FirstCleanCycle").val();
  155. var SecondCleanCycle = $("#SecondCleanCycle").val();
  156. var ThirdCleanCycle = $("#ThirdCleanCycle").val();
  157. if (BoxNumber == "" || BoxName == "" || Type == "" || Specification == "" || FirstCleanCycle == "" || SecondCleanCycle == "" || ThirdCleanCycle == "") {
  158. $.modalAlertNew("WMS00062");
  159. return;
  160. }
  161. var objArr = {
  162. ID:ID,
  163. BoxNumber: $("#BoxNumber").val(),
  164. BoxName: decodeURI($("#BoxName").val()),
  165. Type: $("#sel_Type").find("option:selected").text(),
  166. Version: $("#Version").val(),
  167. Specification: $("#Specification").val(),
  168. Describe: $("#Describe").val(),
  169. FirstCleanCycle: $("#FirstCleanCycle").val(),
  170. SecondCleanCycle: $("#SecondCleanCycle").val(),
  171. ThirdCleanCycle: $("#ThirdCleanCycle").val(),
  172. Type: $("#sel_Type").find("option:selected").text(),
  173. }
  174. if (ID != "") {
  175. $.submitForm({
  176. url: "/Boxes/BasicSettings/UpdateBoxes" + "?" + Math.random(),
  177. param: { keyValue: JSON.stringify(objArr) },
  178. success: function () {
  179. $.currentWindow().$("#gridList").trigger("reloadGrid");
  180. }
  181. })
  182. } else {
  183. $.submitForm({
  184. url: "/Boxes/BasicSettings/InsertBoxes" + "?" + Math.random(),
  185. param: { keyValue: JSON.stringify(objArr) },
  186. success: function () {
  187. $.currentWindow().$("#gridList").trigger("reloadGrid");
  188. }
  189. })
  190. }
  191. }
  192. </script>
  193. <form id="form1">
  194. <div style="padding-top: 50px; margin-right: 50px;">
  195. <table class="form">
  196. <tr>
  197. <th class="formTitle"><span style="color: red;">*</span>周转箱编码:</th>
  198. <td class="formValue">
  199. <input id="BoxNumber" name="BoxNumber" type="text" class="form-control required" style="width: 150px;" maxlength="10" placeholder="周转箱编码" required />
  200. </td>
  201. <th class="formTitle"><span style="color: red;">*</span>名称:</th>
  202. <td class="formValue">
  203. <input id="BoxName" name="BoxName" type="text" class="form-control required" style="width: 160px; " maxlength="10" placeholder="名称" required/>
  204. </tr>
  205. <tr>
  206. <th class="formTitle"><span style="color: red;">*</span>型号:</th>
  207. <td class="formValue">
  208. <input id="Version" name="Version" type="text" class="form-control required" style="width: 150px;" maxlength="10" placeholder="型号" required/>
  209. </td>
  210. <th class="formTitle"><span style="color: red;">*</span>类型:</th>
  211. <td style="width:150px">
  212. <select id="sel_Type" name="sel_Type" class="form-control select2 required" style="width: 135px; height: 25px;" placeholder="类型"></select>
  213. <input type="hidden" id="hidetext" />
  214. </td>
  215. </tr>
  216. <tr>
  217. <th class="formTitle"><span style="color: red;">*</span>第一次清洗周期:</th>
  218. <td class="formValue">
  219. <input id="FirstCleanCycle" name="FirstCleanCycle" type="text" ,class="form-control required" style="width: 150px; height: 25px; " placeholder="/次" required/>
  220. </td>
  221. <th class="formTitle">描述:</th>
  222. <td class="formValue">
  223. <input id="Describe" name="Describe" type="text" class="form-control required" style="width: 160px; " maxlength="10" placeholder="描述" />
  224. </tr>
  225. <tr>
  226. <th class="formTitle"><span style="color: red;">*</span>第二次清洗周期:</th>
  227. <td class="formValue">
  228. <input id="SecondCleanCycle" name="SecondCleanCycle" type="text" class="form-control required" style="width: 150px; " maxlength="10" placeholder="/次" required />
  229. </td>
  230. <th class="formTitle"><span style="color: red;">*</span>规格:</th>
  231. <td class="formValue">
  232. <input id="Specification" name="Specification" type="text" class="form-control required" style="width: 160px; " maxlength="10" placeholder="规格" required/>
  233. </tr>
  234. <tr>
  235. <th class="formTitle"><span style="color: red;">*</span>第三次清洗周期:</th>
  236. <td class="formValue">
  237. <input id="ThirdCleanCycle" name="ThirdCleanCycle" type="text" class="form-control required" style="width: 150px;" maxlength="10" placeholder="/次" />
  238. </tr>
  239. </table>
  240. </div>
  241. </form>