picking.blade.php 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. @extends('layouts.app')
  2. @section('title')波次分拣@endsection
  3. @section('content')
  4. <div id="container" class="d-none container-fluid mt-2">
  5. <div class="card">
  6. <div class="card-header">
  7. <b>波次信息</b>
  8. <button class="btn text-white btn-sm btn-info pull-right" @click="isShow=!isShow" data-toggle="collapse" data-target="#body">@{{ isShow ? '隐藏' : '显示' }}</button>
  9. </div>
  10. <div class="card-body collapse" id="body">
  11. <div v-for="(val,index) in waves" class="mt-2">
  12. <div class="card-title font-weight-bold mb-0">@{{ batch+'-'+(index+1) }}</div>
  13. <div class="card-text text-muted small">
  14. <div v-for="(obj,i) in val" class="row m-0" style="border-bottom: RGB(247,247,247) 1px solid">
  15. <span class="col-6">@{{ obj.barcode }}</span>
  16. <span class="col-6">@{{ obj.qty }}</span>
  17. </div>
  18. </div>
  19. </div>
  20. </div>
  21. <div class="card mt-2">
  22. <div class="card-header row m-0">
  23. <b class="col-4">分拣信息</b>
  24. <input id="barcode" v-model="barcode" @keydown.enter="searchBarcode()" class="form-control form-control-sm rounded-pill col-6 offset-2" placeholder="条码"></input>
  25. </div>
  26. <div class="card-body">
  27. <div class="row border-info" style="height:60vh;overflow-y: auto">
  28. <div class="col-5 m-2 p-0" style="height: 80px;border: 1px solid #aaaaaa;z-index:100;position:relative;" v-for="index in waves.length"
  29. :style="[waveQtyMap['_'+(index-1)] && waveQtyMap['_'+(index-1)]>0 ? {boxShadow: '0 0 5px 5px rgba(19,193,137)'} : '']">
  30. <div class="text-center small font-weight-bold text-secondary">@{{ batch+'-'+index }}</div>
  31. <div style="display:flex;align-items:center;justify-content:center;" class="w-100 h-75 text-primary font-weight-bold">
  32. @{{ waveQtyMap['_'+(index-1)] ? waveQtyMap['_'+(index-1)] : '0' }}
  33. </div>
  34. </div>
  35. </div>
  36. </div>
  37. </div>
  38. </div>
  39. <div class="bg-white w-100 row" id="searchBlock" style="position: fixed;top:0;left:0;
  40. width: 100%; text-align: center; border-radius: 3px;">
  41. <div class="position-relative offset-2 col-9 mt-3 mb-3">
  42. <input id="loadBatch" class="form-control form-control-sm w-100 rounded-pill" @keydown.enter="loadBatch()" v-model="batch" type="text" placeholder="波次号"></input>
  43. <a id="search" @click="loadBatch()"><button type="button" class="border btn btn-sm btn-primary text-white rounded-pill position-absolute" style="top: 0;right: 12px;">开始分拣</button></a>
  44. </div>
  45. </div>
  46. </div>
  47. @endsection
  48. @section('lastScript')
  49. <script>
  50. new Vue({
  51. el:"#container",
  52. data:{
  53. batch:"",
  54. isShow:false,
  55. waves:[],
  56. waveQtyMap:{},
  57. },
  58. mounted:function(){
  59. this.pageInit();
  60. setTimeout(()=>{
  61. $("#container").removeClass('d-none');
  62. },100);
  63. setTimeout(()=>{
  64. $("#loadBatch").focus();
  65. },200);
  66. },
  67. methods:{
  68. //页面初始化
  69. pageInit(){
  70. let element = document.getElementById("navbarSupportedContent").parentElement;
  71. element.className = "row";
  72. element.children[0].className += " col-5";
  73. element.children[0].href = "#";
  74. element.innerHTML = element.children[0].outerHTML;
  75. let e1 = document.getElementById("menu");
  76. let e2 = document.getElementById("demand-div");
  77. //let e3 = document.getElementsByClassName("navbar");
  78. if (e1)e1.remove();
  79. if (e2)e2.remove();
  80. //if (e3.length>0)e3[0].remove();
  81. element = document.getElementById("container");
  82. if (element)element.style.height = (window.innerHeight-100)+"px";
  83. },
  84. loadBatch(){
  85. window.tempTip.postBasicRequest("{{url('order/wave/loadBatch')}}",{code:this.batch},res=>{
  86. this.waves = res;
  87. $("#barcode").focus();
  88. })
  89. },
  90. searchBarcode(){
  91. let waveQtyMap = {};
  92. this.waves.forEach((wave,i)=>{
  93. wave.forEach(order=>{
  94. if (order.barcode === this.barcode){
  95. if (waveQtyMap['_'+i]===undefined)waveQtyMap['_'+i] = 1;
  96. else waveQtyMap['_'+i]++;
  97. }
  98. })
  99. })
  100. this.waveQtyMap = waveQtyMap;
  101. this.barcode = "";
  102. $("#barcode").focus();
  103. },
  104. }
  105. });
  106. </script>
  107. @endsection