dispatch.blade.php 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. @extends('layouts.app')
  2. @section('title')运单发货@endsection
  3. @section('content')
  4. <div class="container-fluid d-none" id="container">
  5. <div class="mt-3 col-8 offset-2">
  6. <div class="form-group row">
  7. <label for="waybill">运单号</label>
  8. <input id="waybill" type="text" class="form-control" v-model="info.waybill" @keydown.enter="enterVal($event)" @blur="searchWaybill()"></input>
  9. </div>
  10. <div class="form-group row">
  11. <label for="logistic">物流单号</label>
  12. <input id="logistic" type="text" class="form-control form-control-sm" v-model="info.logistic" @keydown.enter="enterVal($event)"></input>
  13. </div>
  14. <div class="form-group row">
  15. <label for="phone">查件电话</label>
  16. <input id="phone" type="text" class="form-control form-control-sm" v-model="info.phone" @keydown.enter="enterVal($event)"></input>
  17. </div>
  18. <div class="form-group row">
  19. <label for="amount">数量</label>
  20. <div class="input-group input-group-sm">
  21. <input id="amount" type="number" class="form-control" v-model="info.amount" step="0.01" @keydown.enter="enterVal($event)"></input>
  22. <div class="input-group-append">
  23. <span class="input-group-text">件</span>
  24. </div>
  25. </div>
  26. </div>
  27. <div class="form-group row">
  28. <label for="weight">重量</label>
  29. <div class="input-group input-group-sm">
  30. <input id="weight" type="number" class="form-control" v-model="info.weight" step="0.01" @keydown.enter="enterVal($event)"></input>
  31. <div class="input-group-append">
  32. <span class="input-group-text">KG</span>
  33. </div>
  34. </div>
  35. </div>
  36. <div class="form-group row">
  37. <label for="volume">体积</label>
  38. <div class="input-group input-group-sm">
  39. <input id="volume" type="number" class="form-control" v-model="info.volume" step="0.01" @keydown.enter="enterVal($event)"></input>
  40. <div class="input-group-append">
  41. <span class="input-group-text">M³</span>
  42. </div>
  43. </div>
  44. </div>
  45. <div class="input-group row">
  46. <button type="submit" id="submit" class="btn btn-success offset-2 col-10" @click="executeSubmit()" @keydown.enter="executeSubmit()">提交调配信息</button>
  47. </div>
  48. </div>
  49. </div>
  50. @stop
  51. @section('lastScript')
  52. <script type="text/javascript">
  53. new Vue({
  54. el:"#container",
  55. data:{
  56. isAndroid:false,
  57. info:{},
  58. element:["waybill","logistic","phone","amount","weight","volume","submit"],
  59. counter:0,
  60. },
  61. mounted(){
  62. if (navigator.userAgent.indexOf("Android")!==-1)this.isAndroid = true;
  63. this.pageInit();
  64. $("#container").removeClass("d-none");
  65. let element = document.getElementById("waybill");
  66. if (element)element.focus();
  67. },
  68. methods:{
  69. //页面初始化
  70. pageInit(){
  71. if (!this.isAndroid)return;
  72. let element = document.getElementById("navbarSupportedContent").parentElement;
  73. element.className = "row";
  74. element.children[0].className += " col-5";
  75. element.children[0].href = "#";
  76. element.innerHTML = element.children[0].outerHTML;
  77. let e1 = document.getElementById("menu");
  78. let e2 = document.getElementById("demand-div");
  79. if (e1)e1.remove();
  80. if (e2)e2.remove();
  81. document.getElementById("container").style.height = (window.innerHeight-100)+"px";
  82. },
  83. //回车向下TAB
  84. enterVal(e){
  85. let index = this.element.indexOf(e.target.id)+1;
  86. let element = document.getElementById(this.element[index]);
  87. if (element)element.focus();
  88. e.preventDefault();
  89. return false;
  90. },
  91. searchWaybill(){
  92. let bill = event.target.value;
  93. if (!bill)return;
  94. window.tempTip.postBasicRequest("{{url('transport/waybill/android/searchWaybill')}}",{bill:bill},res=>{
  95. if (!this.info.logistic)this.info.logistic = res.carrier_bill;
  96. if (!this.info.phone)this.info.phone = res.inquire_tel;
  97. if (!this.info.amount)this.info.amount = res.amount;
  98. if (!this.info.weight)this.info.weight = res.carrier_weight;
  99. if (!this.info.volume)this.info.volume = res.carrier_weight_other;
  100. });
  101. },
  102. executeSubmit(){
  103. window.tempTip.postBasicRequest("{{url('transport/waybill/android/waybillDispatch')}}",this.info,res=>{
  104. this.info = {};
  105. return "调配成功";
  106. });
  107. },
  108. },
  109. });
  110. </script>
  111. @stop