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

287 lines
10 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
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. var ID = $.request("ID");
  14. var Warehouse = $.request("Warehouse");
  15. var WarehouseName = decodeURI($.request("WarehouseName"));
  16. //var WarehouseName = decodeURI($.getUrlParam("WarehouseName"));
  17. var LocationCode = $.request("LocationCode");
  18. var LocationName = decodeURI($.request("LocationName"));
  19. //var expArrivalDate = $
  20. $(function () {
  21. debugger;
  22. InitControl();
  23. if (ID != "") {
  24. //$("#sel_Warehouse").children('option:selected').val(WarehouseName)
  25. $("#sel_Warehouse").val([WarehouseName]).trigger("change");
  26. $("#WarehouseName").val(WarehouseName);
  27. var s = LocationName;
  28. var str = LocationCode.split('-');
  29. for (var i = 1; i <= str.length; i++) {
  30. if (i == 1)
  31. $("#Qu").val(str[1]);
  32. if (i == 2)
  33. $("#Pai").val(str[2]);
  34. if (i == 3)
  35. $("#Jia").val(str[3]);
  36. if (i == 4)
  37. $("#Ceng").val(str[4]);
  38. if (i == 5)
  39. $("#Ge").val(str[5]);
  40. }
  41. }
  42. $("#sel_Warehouse").change(function () {
  43. debugger;
  44. var Was = $("#sel_Warehouse").children('option:selected').val();
  45. $("#WarehouseName").val(Was);
  46. //var VenCode = $("#sel_VenCode").children('option:selected').val();
  47. });
  48. });
  49. $.getUrlParam = function (name) {
  50. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  51. var r = window.location.search.substr(1).match(reg);
  52. if (r != null) return unescape(r[2]); return null;
  53. }
  54. ;
  55. function InitControl() {
  56. debugger;
  57. var $VenCode = $("#sel_Warehouse");
  58. $VenCode.select2({
  59. allowClear: true,
  60. escapeMarkup: function (m) {
  61. return m;
  62. }
  63. });
  64. $.ajax({
  65. url: "/WMS/BasicSettings/GetWarehouse" + "?" + Math.random(),
  66. dataType: "json",
  67. async: false,
  68. success: function (data) {
  69. $.each(data, function (index, item) {
  70. $VenCode.append("<option value='" + item.WarehouseName + "'>" + item.WarehouseCode + "</option>");
  71. });
  72. }
  73. });
  74. }
  75. //新增条码
  76. function btnCreate() {
  77. var STNO = $("#STNO").text();
  78. Vendor = $("#sel_VenCode").find("option:selected").val();
  79. if (STNO == "") {
  80. $.modalAlertNew("WMS00059");
  81. return;
  82. }
  83. var expArrivalDate = $("#ExpArivalDate").val();
  84. if (expArrivalDate == '' || expArrivalDate == null) {
  85. $.modalAlertNew("WMS00060");
  86. return;
  87. }
  88. $.modalOpen2({
  89. id: "Form",
  90. title: "条码信息",
  91. url: "/SRM/ASNSelect/Index?STNO=" + STNO + "&Vendor=" + Vendor + "&" + Math.random(),
  92. width: "800px",
  93. height: "500px",
  94. callBack: function (iframeId) {
  95. top.frames[iframeId].submitForm();
  96. }
  97. });
  98. }
  99. //新增箱号
  100. function btnAddCartonNo() {
  101. var STNO = $("#STNO").text();
  102. Vendor = $("#sel_VenCode").find("option:selected").val();
  103. if (STNO == "") {
  104. $.modalAlertNew("WMS00059");
  105. return;
  106. }
  107. var expArrivalDate = $("#ExpArivalDate").val();
  108. if (expArrivalDate == '' || expArrivalDate == null) {
  109. $.modalAlertNew("WMS00060");
  110. return;
  111. }
  112. $.modalOpen2({
  113. id: "Form",
  114. title: "箱号信息",
  115. url: "/SRM/ASNCartonSelect/Index?STNO=" + STNO + "&Vendor=" + Vendor + "&" + Math.random(),
  116. width: "800px",
  117. height: "500px",
  118. callBack: function (iframeId) {
  119. top.frames[iframeId].submitForm();
  120. }
  121. });
  122. }
  123. //刷新
  124. function reloadData() {
  125. STNO = $("#STNO").text();
  126. var queryJson = {
  127. STNO: STNO,
  128. }
  129. $("#gridList").jqGrid('setGridParam', {
  130. postData: { queryJson: JSON.stringify(queryJson) },
  131. }).trigger('reloadGrid');
  132. }
  133. //删除条码
  134. function btn_delete() {
  135. var objArr = "";
  136. var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
  137. if (objList.length == 0) {
  138. $.modalAlertNew("WMS00061");
  139. return;
  140. }
  141. for (var i = 0; i < objList.length; i++) {
  142. var rowId = objList[i];
  143. var rowData = $("#gridList").jqGrid('getRowData', rowId);
  144. objArr += "'" + rowData.ASNDETAILID + "',";
  145. }
  146. $.deleteForm({
  147. url: "/SRM/ASNAdd/DeleteInfo" + "?" + Math.random(),
  148. param: { keyValue: JSON.stringify(objArr) },
  149. success: function () {
  150. reloadData();
  151. }
  152. })
  153. }
  154. //新增库位
  155. function submitForm() {
  156. debugger;
  157. var StackCode = "";
  158. var StackName = "";
  159. var Warehouse = "";
  160. var WarehouseName = "";
  161. var Qu = $("#Qu").val();
  162. var Pai = $("#Pai").val();
  163. var Jia = $("#Jia").val();
  164. var Ceng = $("#Ceng").val();
  165. var Ge = $("#Ge").val();
  166. if (Qu == "" && Pai == "" && Jia == "" && Ceng == "" && Ge == "") {
  167. $.modalAlertNew("WMS00062");
  168. return;
  169. }
  170. StackCode = $("#sel_Warehouse").find("option:selected").text();
  171. StackName = $("#sel_Warehouse").find("option:selected").text() + "仓库";
  172. if (Qu!="") {
  173. StackCode += "-" + Qu;
  174. StackName += Qu + "区域";
  175. }
  176. if (Pai!="") {
  177. StackCode += "-" + Pai;
  178. StackName += Pai + "区";
  179. }
  180. if (Jia!="") {
  181. StackCode += "-" + Jia;
  182. StackName += Jia + "货架";
  183. }
  184. if (Ceng!="") {
  185. StackCode += "-" + Ceng;
  186. StackName += Ceng + "层";
  187. }
  188. if (Ge!="") {
  189. StackCode += "-" + Ge;
  190. StackName += Ge + "列";
  191. }
  192. var objArr = {
  193. ID:ID,
  194. StackCode:StackCode,
  195. StackName: StackName,
  196. Qu : $("#Qu").val(),
  197. Pai : $("#Pai").val(),
  198. Jia : $("#Jia").val(),
  199. Ceng : $("#Ceng").val(),
  200. Ge : $("#Ge").val(),
  201. Warehouse:$("#sel_Warehouse").find("option:selected").text(),
  202. WarehouseName:$("#WarehouseName").val()
  203. }
  204. if (ID != "") {
  205. $.submitForm({
  206. url: "/WMS/BasicSettings/UpdateStack" + "?" + Math.random(),
  207. param: { keyValue: JSON.stringify(objArr) },
  208. success: function () {
  209. $.currentWindow().$("#gridList").trigger("reloadGrid");
  210. }
  211. })
  212. } else {
  213. $.submitForm({
  214. url: "/WMS/BasicSettings/InsertStack" + "?" + Math.random(),
  215. param: { keyValue: JSON.stringify(objArr) },
  216. success: function () {
  217. $.currentWindow().$("#gridList").trigger("reloadGrid");
  218. }
  219. })
  220. }
  221. }
  222. </script>
  223. <form id="form1">
  224. <div style="padding-top: 20px; margin-right: 20px;">
  225. <table class="form">
  226. <tr>
  227. <th class="formTitle">库房编号:</th>
  228. <td style="width:100px">
  229. <select id="sel_Warehouse" name="sel_Warehouse" class="form-control select2" style="width: 500px" placeholder="库房编号"></select>
  230. <input type="hidden" id="hidetext" />
  231. </td>
  232. </tr>
  233. <tr>
  234. <th class="formTitle">库房名称:</th>
  235. <td class="formValue">
  236. <input id="WarehouseName" name="WarehouseName" type="text" class="form-control required" style="width: 300px;" maxlength="10" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })" placeholder="库房名称" />
  237. </td>
  238. </tr>
  239. <tr>
  240. <th class="formTitle">库位编号:</th>
  241. <td class="formValue">
  242. <input id="Qu" name="Qu" type="text" class="form-control required" style="width:80px;" maxlength="10" placeholder="区域" />
  243. </td>
  244. @*<td id="ISO">-</td>*@
  245. <td class="formValue">
  246. <input id="Pai" name="Pai" type="text" class="form-control required" style="width: 80px;" maxlength="10" placeholder="区" />
  247. </td>
  248. @*<td style="width:30px">-</td>*@
  249. <td class="formValue">
  250. <input id="Jia" name="Jia" type="text" class="form-control required" style="width: 80px;" maxlength="10" placeholder="货架" />
  251. </td>
  252. @*<td style="width:30px">-</td>*@
  253. <td class="formValue">
  254. <input id="Ceng" name="Ceng" type="text" class="form-control required" style="width: 80px;" maxlength="10" placeholder="层" />
  255. </td>
  256. @*<td style="width:30px">-</td>*@
  257. <td class="formValue">
  258. <input id="Ge" name="Ge" type="text" class="form-control required" style="width: 80px;" maxlength="10" placeholder="列" />
  259. </td>
  260. </tr>
  261. <tr>
  262. <th class="formTitle">格式:</th>
  263. <td class="formValue">
  264. <span>&nbsp;区域</span>
  265. </td>
  266. <td class="formValue">
  267. <span>&nbsp;区</span>
  268. </td>
  269. <td class="formValue">
  270. <span>&nbsp;货架</span>
  271. </td>
  272. <td class="formValue">
  273. <span>&nbsp;层</span>
  274. </td>
  275. <td class="formValue">
  276. <span>&nbsp;列</span>
  277. </td>
  278. </tr>
  279. </table>
  280. </div>
  281. </form>