bindBox.jsp 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <%@ page contentType="text/html;charset=UTF-8"%>
  2. <%@ include file="/WEB-INF/include/taglibs.jsp"%>
  3. <!DOCTYPE html>
  4. <html>
  5. <head>
  6. <title></title>
  7. <%@ include file="/WEB-INF/include/common.jsp"%>
  8. <script type="text/javascript">
  9. $(function() {
  10. var $inputNum = $("#inputNum");
  11. var $orderId = $("#orderId");
  12. var $tagId = $("#tagId");
  13. var $boxNo = $("#boxNo");
  14. $inputNum.focus();
  15. $inputNum.keydown(function(event) {
  16. var keyCode = event.keyCode;
  17. if (keyCode == "13") {
  18. var tempValue = $inputNum.val().trim();
  19. if( tempValue.length > 3 ){
  20. var prex1 = tempValue.substring(0,1);
  21. var prex2 = tempValue.substring(0,2);
  22. var prex3 = tempValue.substring(0,3);
  23. if( prex1=="O"){
  24. jQuery.ajax({
  25. type:'post',
  26. contentType: "application/x-www-form-urlencoded; charset=utf-8",
  27. async:false,
  28. dataType: "json",
  29. url:WEBROOT + '/PickList/loadOrder.action?orderId=' + tempValue,
  30. success:function(response){
  31. if (response.code == 'success')
  32. {
  33. $("#orderId").val(tempValue);
  34. if (response.data == 1)
  35. {
  36. $("#tagId").val("T" + tempValue);
  37. }
  38. }
  39. else
  40. {
  41. setTimeout(function(){
  42. alertMsg("提示", response.errorDesc, "error",function(){
  43. $inputNum.focus();
  44. });
  45. }, 10)
  46. return;
  47. }
  48. }
  49. });
  50. }else if(prex2 =="TO"){
  51. $("#tagId").val(tempValue);
  52. }else if( prex3=="XJT"){
  53. $("#boxNo").val(tempValue);
  54. }else{
  55. showMsg('错误','输入值号不匹配!');
  56. $inputNum.val("");
  57. $inputNum.focus();
  58. return ;
  59. }
  60. var orderId = $orderId.val().trim();
  61. var tagId = $tagId.val().trim();
  62. var boxNo = $boxNo.val().trim();
  63. if( !$.isEmpty(orderId) && !$.isEmpty(tagId) && !$.isEmpty(boxNo) ){
  64. if( tagId != ("T"+orderId) ) {
  65. showMsg('错误','订单号与标签号不匹配!');
  66. $("#orderId").val("");
  67. $("#tagId").val("");
  68. $("#inputNum").val("");
  69. $inputNum.focus();
  70. return ;
  71. }
  72. var url =WEBROOT+"/PickList/doBindBox.action";
  73. ajaxRequest(url, {orderId:orderId,tagId:tagId,boxNo:boxNo}, function(response){
  74. if( response.code=="fail"){
  75. showMsg('错误',response.errorDesc);
  76. }else{
  77. showMsg('信息',response.data);
  78. }
  79. $("#orderId").val("");
  80. $("#tagId").val("");
  81. $("#boxNo").val("");
  82. $("#inputNum").val("");
  83. $inputNum.focus();
  84. });
  85. }else{
  86. $("#inputNum").val("");
  87. $inputNum.focus();
  88. }
  89. }else{
  90. $inputNum.val("");
  91. $inputNum.focus();
  92. }
  93. }
  94. });
  95. });
  96. </script>
  97. </head>
  98. <body style="overflow-y: hidden" fit="true" scroll="no">
  99. <div class="easyui-panel" fit="true"
  100. style="padding: 50px; background: #fafafa;">
  101. <table style="width: 100%">
  102. <tr>
  103. <td align="right">输入:</td>
  104. <td><input class="easyui-validatebox" id="inputNum"
  105. name="inputNum" style="width: 300px" />
  106. </td>
  107. </tr>
  108. <tr>
  109. <td colspan="6">
  110. <hr>
  111. </td>
  112. </tr>
  113. <tr>
  114. <td align="right">订单号:</td>
  115. <td><input class="easyui-validatebox" id="orderId"
  116. name="pickListId" style="width: 300px" disabled="disabled" />
  117. </td>
  118. </tr>
  119. <tr>
  120. <td align="right">标签号:</td>
  121. <td><input class="easyui-validatebox" id="tagId" name="tagId"
  122. style="width: 300px" disabled="disabled" />
  123. </td>
  124. </tr>
  125. <tr>
  126. <td align="right">箱号:</td>
  127. <td><input class="easyui-validatebox" id="boxNo" name="boxNo"
  128. style="width: 300px" disabled="disabled" />
  129. </td>
  130. </tr>
  131. </table>
  132. </div>
  133. </body>
  134. </html>