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

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