赫艾后端
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.

149 lines
4.4 KiB

3 years ago
3 years ago
3 years ago
10 months ago
3 years ago
  1. var userId = $("#current_id").val();
  2. var userName = $("#current_username").val();
  3. var site = $("#current_site").val();
  4. var titleName = $("#current_titleName").val();
  5. var currentData = null;
  6. //页面初始化
  7. $(function(){
  8. if(titleName != null && titleName != ""){
  9. $("#titleName").text('通知单入库');
  10. }else {
  11. window.location.href="/login";
  12. }
  13. var workData = $.cookie("transFer");
  14. if(workData != null && workData !==""){
  15. if(titleName=='不要缓存') {
  16. currentData = null;
  17. layer.msg("保存成功!");
  18. }else if(titleName=='回退'){
  19. currentData = JSON.parse(workData);
  20. initVal();
  21. $.cookie("transFer", "");
  22. }else {
  23. $.cookie("transFer", "");
  24. }
  25. }
  26. // 初始化光标
  27. $("#orderNo_search").focus();
  28. });
  29. //为工具实例条码绑定一个失去焦点事件
  30. $("#orderNo_search").bind("keydown",function(event){
  31. if (event.keyCode == 13) {
  32. getOrderNoData();
  33. }
  34. });
  35. // 获取获取工具实例编码
  36. function getOrderNoData(){
  37. let orderNoSearch = $("#orderNo_search").val();
  38. if(orderNoSearch == null || orderNoSearch === ""){
  39. layer.msg("请输入入库通知单号!");
  40. return false
  41. }
  42. let jsonData = {
  43. transFerNo : orderNoSearch,
  44. status : 'Hunlian',
  45. }
  46. $.ajax({
  47. url: "/pdaOrder/getTransfer",
  48. contentType: 'application/json',
  49. type:"POST",
  50. data:JSON.stringify(jsonData),//你的formid
  51. dataType:"JSON",
  52. beforeSend: function(request) {
  53. request.setRequestHeader("token", $.cookie("token"));
  54. },
  55. success: function (data) {
  56. if(data.code===0) {
  57. if (data.row.orderNo != null && data.row.orderNo != "") {
  58. currentData = data.row;
  59. initVal();
  60. } else {
  61. layer.msg("入库通知单号错误!");
  62. }
  63. }else {
  64. layer.msg(data.msg)
  65. }
  66. },
  67. error: function(data) {
  68. var responseText = data.responseText;
  69. var json_str = JSON.parse(responseText);
  70. var status = json_str.status;
  71. var message = json_str.message;
  72. //判断是否是session超时
  73. if(403==status){
  74. layer.alert(message,function(){
  75. window.location.href="/login";
  76. });
  77. }
  78. layer.closeAll('loading');
  79. }
  80. })
  81. }
  82. function initVal(){
  83. $("#site").val(currentData.site);
  84. $("#orderNo").val(currentData.orderNo);
  85. $("#partNo").val(currentData.partNo);
  86. $("#partDescription").val(currentData.partDescription);
  87. $("#status").val(currentData.status);
  88. $("#lotSize").val(currentData.lotSize);
  89. $("#finishedQty").val(currentData.finishedQty);
  90. $("#transFerNo").val(currentData.transFerNo);
  91. $("#weightFactor").val(currentData.weightFactor);
  92. // if(currentData.weightFactor!='-1'&&currentData.weightFactor!=''&&currentData.weightFactor!=null){
  93. // $("#lotSizeKG").val((currentData.lotSize*currentData.weightFactor).toFixed(1));
  94. // $("#finishedQtyKG").val((currentData.finishedQty*currentData.weightFactor).toFixed(1));
  95. // }else {
  96. // $("#lotSizeKG").val("erp未维护数据");
  97. // $("#finishedQtyKG").val("");
  98. // }
  99. }
  100. //下级界面页面跳转
  101. function pageJump(){
  102. if(currentData == null){
  103. layer.msg("当前无入库通知单信息!");
  104. return false
  105. }
  106. if(currentData.lotSize <= currentData.finishedQty ){
  107. layer.msg("该通知单已入库完毕无需再次入库!");
  108. return false
  109. }
  110. currentData = JSON.stringify(currentData);
  111. $.cookie("transFer",currentData);
  112. /*,{
  113. expires : 1,
  114. path : "/"
  115. }*/
  116. var menuId = $("#menuId").val();
  117. var superiorName = $("#current_titleName").val();
  118. window.location.href = "/pda/transferWarehousing2ForHunlian?menuId=" + menuId + "&titleName=" + superiorName;
  119. }
  120. //下级界面页面跳转
  121. function pdaBaseJump(){
  122. window.location.href = "/pda/pdaBase";
  123. }
  124. //初始化下拉框
  125. function selectInit(){
  126. $('.selectpicker').selectpicker({
  127. noneSelectedText: '',
  128. noneResultsText: '',
  129. liveSearch: true,
  130. width:140,
  131. size:5 //设置select高度,同时显示5个值
  132. });
  133. }