| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- @extends('layouts.app')
- @section('title')运单发货@endsection
- @section('content')
- <div class="container-fluid d-none" id="container">
- <div class="mt-3 col-8 offset-2">
- <div class="form-group row">
- <label for="waybill">运单号</label>
- <input id="waybill" type="text" class="form-control" v-model="info.waybill" @keydown.enter="enterVal($event)" @blur="searchWaybill()"></input>
- </div>
- <div class="form-group row">
- <label for="logistic">物流单号</label>
- <input id="logistic" type="text" class="form-control form-control-sm" v-model="info.logistic" @keydown.enter="enterVal($event)"></input>
- </div>
- <div class="form-group row">
- <label for="phone">查件电话</label>
- <input id="phone" type="text" class="form-control form-control-sm" v-model="info.phone" @keydown.enter="enterVal($event)"></input>
- </div>
- <div class="form-group row">
- <label for="amount">数量</label>
- <div class="input-group input-group-sm">
- <input id="amount" type="number" class="form-control" v-model="info.amount" step="0.01" @keydown.enter="enterVal($event)"></input>
- <div class="input-group-append">
- <span class="input-group-text">件</span>
- </div>
- </div>
- </div>
- <div class="form-group row">
- <label for="weight">重量</label>
- <div class="input-group input-group-sm">
- <input id="weight" type="number" class="form-control" v-model="info.weight" step="0.01" @keydown.enter="enterVal($event)"></input>
- <div class="input-group-append">
- <span class="input-group-text">KG</span>
- </div>
- </div>
- </div>
- <div class="form-group row">
- <label for="volume">体积</label>
- <div class="input-group input-group-sm">
- <input id="volume" type="number" class="form-control" v-model="info.volume" step="0.01" @keydown.enter="enterVal($event)"></input>
- <div class="input-group-append">
- <span class="input-group-text">M³</span>
- </div>
- </div>
- </div>
- <div class="input-group row">
- <button type="submit" id="submit" class="btn btn-success offset-2 col-10" @click="executeSubmit()" @keydown.enter="executeSubmit()">提交调配信息</button>
- </div>
- </div>
- </div>
- @stop
- @section('lastScript')
- <script type="text/javascript">
- new Vue({
- el:"#container",
- data:{
- isAndroid:false,
- info:{},
- element:["waybill","logistic","phone","amount","weight","volume","submit"],
- counter:0,
- },
- mounted(){
- if (navigator.userAgent.indexOf("Android")!==-1)this.isAndroid = true;
- this.pageInit();
- $("#container").removeClass("d-none");
- let element = document.getElementById("waybill");
- if (element)element.focus();
- },
- methods:{
- //页面初始化
- pageInit(){
- if (!this.isAndroid)return;
- let element = document.getElementById("navbarSupportedContent").parentElement;
- element.className = "row";
- element.children[0].className += " col-5";
- element.children[0].href = "#";
- element.innerHTML = element.children[0].outerHTML;
- let e1 = document.getElementById("menu");
- let e2 = document.getElementById("demand-div");
- if (e1)e1.remove();
- if (e2)e2.remove();
- document.getElementById("container").style.height = (window.innerHeight-100)+"px";
- },
- //回车向下TAB
- enterVal(e){
- let index = this.element.indexOf(e.target.id)+1;
- let element = document.getElementById(this.element[index]);
- if (element)element.focus();
- e.preventDefault();
- return false;
- },
- searchWaybill(){
- let bill = event.target.value;
- if (!bill)return;
- window.tempTip.postBasicRequest("{{url('transport/waybill/android/searchWaybill')}}",{bill:bill},res=>{
- if (!this.info.logistic)this.info.logistic = res.carrier_bill;
- if (!this.info.phone)this.info.phone = res.inquire_tel;
- if (!this.info.amount)this.info.amount = res.amount;
- if (!this.info.weight)this.info.weight = res.carrier_weight;
- if (!this.info.volume)this.info.volume = res.carrier_weight_other;
- });
- },
- executeSubmit(){
- window.tempTip.postBasicRequest("{{url('transport/waybill/android/waybillDispatch')}}",this.info,res=>{
- this.info = {};
- return "调配成功";
- });
- },
- },
- });
- </script>
- @stop
|