|
|
@@ -2,46 +2,49 @@
|
|
|
@section('title')发运-运输管理@endsection
|
|
|
|
|
|
@section('content')
|
|
|
- <div id="list" class="d-none container-fluid">
|
|
|
- <div class="card">
|
|
|
- <div class="card-header p-0">
|
|
|
- <i class="fa fa-angle-down"></i>
|
|
|
+ <div id="list" class="d-none container-fluid mt-2">
|
|
|
+ <div class="card" v-for="(waybills,date) in groups">
|
|
|
+ <div class="card-header p-0 text-center" @click="selectedHeader(date)">
|
|
|
+ @{{ date }}
|
|
|
+ <i class="fa mr-2 pull-right" :class="header[date] ? 'fa-angle-down' : 'fa-angle-right'"></i>
|
|
|
</div>
|
|
|
- <div class="card-body">
|
|
|
-
|
|
|
- </div>
|
|
|
- <table class="table table-striped table-sm table-bordered table-hover p-0 d-block d-sm-none" style="background: rgb(255, 255, 255);">
|
|
|
- <tbody>
|
|
|
- <tr v-for="waybill in waybills">
|
|
|
- <td style="filter:grayscale(30%); " :id="'waybill-'+waybill.id">
|
|
|
- <div :style="waybill.status!='已完结'?'background-color:#f6eee8':''" class="mt-3">
|
|
|
- <div style="transform:scale(0.9)" class="pl-0">
|
|
|
- <span class="mr-3 text-nowrap"><span style="color:#783000">日期:</span><span style="color:#af7651">@{{ waybill.deliver_at }}</span></span>
|
|
|
- <span class="mr-3 text-nowrap"><span style="color:#783000">承运商:</span><span style="color:#af7651">@{{ waybill.carrier_name }}</span></span>
|
|
|
- <span class="mr-3 text-nowrap"><span style="color:#783000">宝时运单号:</span><span style="color:#af7651">@{{ waybill.waybill_number }}</span><br></span>
|
|
|
- <span class="mr-3 text-nowrap"><span style="color:#783000">目的地:</span><span style="color:#af7651">@{{ waybill.address }}</span><br></span>
|
|
|
- <span class="mr-3 text-nowrap"><span style="color:#783000">收货人:</span><span style="color:#af7651">@{{ waybill.recipient }}</span></span>
|
|
|
- <span class="mr-3 text-nowrap"><span style="color:#783000">提货仓:</span><span style="color:#af7651">@{{ waybill.origination }}</span></span>
|
|
|
- <span class="mr-3 text-nowrap"><span style="color:#783000">预估重量:</span><span style="color:#af7651" v-if="waybill.warehouse_weight_other">@{{ waybill.warehouse_weight_other }} @{{ waybill.warehouse_weight_unit_other_name }}</span></span>
|
|
|
- <span class="mr-3 text-nowrap"><span style="color:#783000">预估体积:</span><span style="color:#af7651" v-if="waybill.warehouse_weight">@{{ waybill.warehouse_weight }} @{{ waybill.warehouse_weight_unit_name }}</span></span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div :style="waybill.status!='已完结'?'background-color:#e8eef6':''" class="mb-3">
|
|
|
- <div style="transform:scale(0.9)" class="pl-0 form-inline">
|
|
|
+ <div class="card-body p-0" v-if="header[date]">
|
|
|
+ <div class="w-100 h-100 d-inline-block text-center" v-if="loadAnimation[date]">
|
|
|
+ <i class="fa fa-spinner fa-pulse"></i>
|
|
|
+ </div>
|
|
|
+ <div v-else>
|
|
|
+ <table class="table table-striped table-sm table-bordered table-hover p-0 d-block d-sm-none" style="background: rgb(255, 255, 255);">
|
|
|
+ <tbody>
|
|
|
+ <tr v-for="waybill in waybills">
|
|
|
+ <td style="filter:grayscale(30%); " :id="'waybill-'+waybill.id">
|
|
|
+ <div :style="waybill.status!='已完结'?'background-color:#f6eee8':''" class="mt-3">
|
|
|
+ <div style="transform:scale(0.9)" class="pl-0">
|
|
|
+ <span class="mr-3 text-nowrap"><span style="color:#783000">日期:</span><span style="color:#af7651">@{{ waybill.deliver_at }}</span></span>
|
|
|
+ <span class="mr-3 text-nowrap"><span style="color:#783000">承运商:</span><span style="color:#af7651">@{{ waybill.carrier_name }}</span></span>
|
|
|
+ <span class="mr-3 text-nowrap"><span style="color:#783000">宝时运单号:</span><span style="color:#af7651">@{{ waybill.waybill_number }}</span><br></span>
|
|
|
+ <span class="mr-3 text-nowrap"><span style="color:#783000">目的地:</span><span style="color:#af7651">@{{ waybill.address }}</span><br></span>
|
|
|
+ <span class="mr-3 text-nowrap"><span style="color:#783000">收货人:</span><span style="color:#af7651">@{{ waybill.recipient }}</span></span>
|
|
|
+ <span class="mr-3 text-nowrap"><span style="color:#783000">提货仓:</span><span style="color:#af7651">@{{ waybill.origination }}</span></span>
|
|
|
+ <span class="mr-3 text-nowrap"><span style="color:#783000">预估重量:</span><span style="color:#af7651" v-if="waybill.warehouse_weight_other">@{{ waybill.warehouse_weight_other }} @{{ waybill.warehouse_weight_unit_other_name }}</span></span>
|
|
|
+ <span class="mr-3 text-nowrap"><span style="color:#783000">预估体积:</span><span style="color:#af7651" v-if="waybill.warehouse_weight">@{{ waybill.warehouse_weight }} @{{ waybill.warehouse_weight_unit_name }}</span></span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div style="background-color:#e8eef6" class="mb-3">
|
|
|
+ <div style="transform:scale(0.9)" class="pl-0 form-inline">
|
|
|
<span class="mr-3 text-nowrap form-inline"><span style="color:#02346a">专线运单号:</span>
|
|
|
<input :id="'carrier_bill'+waybill.id" :class="errors['_'+waybill.id]&&errors['_'+waybill.id].carrier_bill?'is-invalid tooltipTargetError':''"
|
|
|
- :title="errors['_'+waybill.id]&&errors['_'+waybill.id].carrier_bill?errors['_'+waybill.id].carrier_bill[0]:''" v-if="waybill.isBtn" type="text" :value="waybill.carrier_bill"
|
|
|
+ :title="errors['_'+waybill.id]&&errors['_'+waybill.id].carrier_bill?errors['_'+waybill.id].carrier_bill[0]:''" v-if="waybill.isBtn || updatePool[waybill.id]" type="text" :value="waybill.carrier_bill"
|
|
|
class="form-control form-control-sm " @click="enlarge($event)" style="width: 50px">
|
|
|
<span v-else class="text-muted">@{{ waybill.carrier_bill }}</span>
|
|
|
</span>
|
|
|
- <span class="mr-3 text-nowrap form-inline"><span style="color:#02346a">查 件 电 话:</span>
|
|
|
+ <span class="mr-3 text-nowrap form-inline"><span style="color:#02346a">查 件 电 话:</span>
|
|
|
<input :id="'inquire_tel'+waybill.id" :class="errors['_'+waybill.id]&&errors['_'+waybill.id].inquire_tel?'is-invalid tooltipTargetError':''"
|
|
|
- :title="errors['_'+waybill.id]&&errors['_'+waybill.id].inquire_tel?errors['_'+waybill.id].inquire_tel[0]:''" v-if="waybill.isBtn" type="text" :value="waybill.inquire_tel"
|
|
|
+ :title="errors['_'+waybill.id]&&errors['_'+waybill.id].inquire_tel?errors['_'+waybill.id].inquire_tel[0]:''" v-if="waybill.isBtn || updatePool[waybill.id]" type="text" :value="waybill.inquire_tel"
|
|
|
class="form-control form-control-sm" @click="enlarge($event)" style="width:50px">
|
|
|
<span v-else class="text-muted">@{{ waybill.inquire_tel }}</span>
|
|
|
</span>
|
|
|
- <span class="mr-3 text-nowrap form-inline"><span style="color:#02346a">数量:</span>
|
|
|
- <span class="input-group input-group-sm" v-if="waybill.isBtn">
|
|
|
+ <span class="mr-3 text-nowrap form-inline"><span style="color:#02346a">数量:</span>
|
|
|
+ <span class="input-group input-group-sm" v-if="waybill.isBtn || updatePool[waybill.id]">
|
|
|
<input :id="'amount'+waybill.id" :class="errors['_'+waybill.id]&&errors['_'+waybill.id].amount?'is-invalid tooltipTargetError':''"
|
|
|
:title="errors['_'+waybill.id]&&errors['_'+waybill.id].amount?errors['_'+waybill.id].amount[0]:''" type="text" :value="waybill.amount"
|
|
|
class="form-control"
|
|
|
@@ -52,8 +55,8 @@
|
|
|
</span>
|
|
|
<span v-else class="text-muted"><span v-if="waybill.amount">@{{ waybill.amount }} @{{ waybill.amount_unit_name }}</span></span>
|
|
|
</span>
|
|
|
- <span class="mr-3 text-nowrap form-inline"><span style="color:#02346a">重量:</span>
|
|
|
- <span class="input-group input-group-sm" v-if="waybill.isBtn">
|
|
|
+ <span class="mr-3 text-nowrap form-inline"><span style="color:#02346a">重量:</span>
|
|
|
+ <span class="input-group input-group-sm" v-if="waybill.isBtn || updatePool[waybill.id]">
|
|
|
<input :id="'carrier_weight_other'+waybill.id" :class="errors['_'+waybill.id]&&errors['_'+waybill.id].carrier_weight_other?'is-invalid tooltipTargetError':''"
|
|
|
:title="errors['_'+waybill.id]&&errors['_'+waybill.id].carrier_weight_other?errors['_'+waybill.id].carrier_weight_other[0]:''" type="text" :value="waybill.carrier_weight_other"
|
|
|
class="form-control" @click="enlarge($event)" style="width:50px">
|
|
|
@@ -63,8 +66,8 @@
|
|
|
</span>
|
|
|
<span v-else class="text-muted">@{{ waybill.carrier_weight_other }}</span>
|
|
|
</span>
|
|
|
- <span class="mr-3 text-nowrap form-inline"><span style="color:#02346a">体积:</span>
|
|
|
- <span class="input-group input-group-sm" v-if="waybill.isBtn">
|
|
|
+ <span class="mr-3 text-nowrap form-inline"><span style="color:#02346a">体积:</span>
|
|
|
+ <span class="input-group input-group-sm" v-if="waybill.isBtn || updatePool[waybill.id]">
|
|
|
<input :id="'carrier_weight'+waybill.id" :class="errors['_'+waybill.id]&&errors['_'+waybill.id].carrier_weight?'is-invalid tooltipTargetError':''"
|
|
|
:title="errors['_'+waybill.id]&&errors['_'+waybill.id].carrier_weight?errors['_'+waybill.id].carrier_weight[0]:''" type="text" :value="waybill.carrier_weight"
|
|
|
class="form-control" @click="enlarge($event)" style="width:50px">
|
|
|
@@ -74,7 +77,7 @@
|
|
|
</span>
|
|
|
<span v-else class="text-muted">@{{ waybill.carrier_weight }}</span>
|
|
|
</span>
|
|
|
- <span class="mr-3 text-nowrap form-inline" v-if="!waybill.isBtn && (waybill.status!=='已完结' && waybill.status!=='无模型')"><span style="color:#02346a">附加费:</span>
|
|
|
+ <span class="mr-3 text-nowrap form-inline" v-if="!waybill.isBtn"><span style="color:#02346a">附加费:</span>
|
|
|
<span class="input-group input-group-sm">
|
|
|
<input :id="'subjoin_fee'+waybill.id" :value="waybill.subjoin_fee" type="number" step="0.01"
|
|
|
class="form-control" style="width:150px">
|
|
|
@@ -83,15 +86,18 @@
|
|
|
</span>
|
|
|
</span>
|
|
|
</span>
|
|
|
- <span class="mr-3 text-nowrap" v-if="waybill.status!=='已完结' || waybill.status!=='无模型'">
|
|
|
- <button class="btn btn-sm btn-outline-success" @click="submit(waybill.isBtn,waybill.id)">提交</button>
|
|
|
+ <span class="mr-3 text-nowrap">
|
|
|
+ <button class="btn btn-sm btn-outline-success" @click="submit(date,waybill.isBtn,waybill.id)">提交</button>
|
|
|
+ <button v-if="!waybill.isBtn && !updatePool[waybill.id]" class="btn btn-sm btn-outline-info" @click="$set(updatePool,waybill.id,true);">修改</button>
|
|
|
</span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- </tbody>
|
|
|
- </table>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div class="bg-white w-100 row" id="searchBlock" style="position: fixed;top:0;left:0;
|
|
|
width: 100%; text-align: center; border-radius: 3px;">
|
|
|
@@ -115,44 +121,27 @@
|
|
|
el:"#list",
|
|
|
data:{
|
|
|
groups:{
|
|
|
- @foreach($groups as $group){{$group->deliver_at}}:[]@endforeach
|
|
|
+ @foreach($groups as $group)"{{$group->date}}":[],@endforeach
|
|
|
},
|
|
|
- waybills:[
|
|
|
- {{--@foreach($waybills as $waybill)
|
|
|
- {id:'{{$waybill->id}}',
|
|
|
- deliver_at:'{{$waybill->deliver_at}}',
|
|
|
- waybill_number:'{{$waybill->waybill_number}}',
|
|
|
- origination:'{{$waybill->origination}}',
|
|
|
- carrier_bill:'{{$waybill->carrier_bill}}',
|
|
|
- warehouse_weight:'{{$waybill->warehouse_weight}}',
|
|
|
- carrier_weight:'{{$waybill->carrier_weight}}',
|
|
|
- warehouse_weight_other:'{{$waybill->warehouse_weight_other}}',
|
|
|
- carrier_weight_other:'{{$waybill->carrier_weight_other}}',
|
|
|
- status:'{{$waybill->status}}',
|
|
|
- amount:'{{$waybill->amount}}',
|
|
|
- inquire_tel:'{{$waybill->inquire_tel}}',
|
|
|
- carrier_name:'{{$waybill->logistic->name ?? ''}}',
|
|
|
- isBtn:!!!'{{$waybill->carrier_bill}}',
|
|
|
- subjoin_fee:'{{$waybill->subjoin_fee}}',
|
|
|
- recipient:'{{$waybill->order->consignee_name ?? $waybill->recipient}}',
|
|
|
- address:'{{$waybill->order ? $waybill->order->province.$waybill->order->city.$waybill->order->district : $waybill->destination}}',
|
|
|
- },
|
|
|
- @endforeach--}}
|
|
|
- ],
|
|
|
+ header:{},
|
|
|
errors:{},
|
|
|
+ loadAnimation:{},
|
|
|
searchText:"{{$searchText}}",
|
|
|
- lastId:"",
|
|
|
lastHeight:"",
|
|
|
+ updatePool:{},
|
|
|
},
|
|
|
mounted:function(){
|
|
|
$(".tooltipTarget").tooltip({'trigger':'hover'});
|
|
|
- if (this.waybills.length>0)this.lastId = this.waybills[this.waybills.length-1].id;
|
|
|
- this.listener();
|
|
|
if (navigator.userAgent.indexOf("Android")!==-1)this.isAndroid = true;
|
|
|
this.pageInit();
|
|
|
$("#list").removeClass('d-none');
|
|
|
},
|
|
|
methods:{
|
|
|
+ selectedHeader(date){
|
|
|
+ if (this.header[date]===undefined)this.loadData(date);
|
|
|
+ if (this.header[date])this.$set(this.header,date,!this.header[date])
|
|
|
+ else this.$set(this.header,date,true);
|
|
|
+ },
|
|
|
listener(){
|
|
|
window.addEventListener('scroll', ()=>{
|
|
|
let clientHeight = document.documentElement.clientHeight;
|
|
|
@@ -167,14 +156,12 @@
|
|
|
}
|
|
|
}, false);
|
|
|
},
|
|
|
- loadData(){
|
|
|
- window.tempTip.postBasicRequest("{{url('transport/waybill/loadData')}}",{searchText:this.searchText,lastId:this.lastId},res=>{
|
|
|
- if(!res || res.length<1){
|
|
|
- window.removeEventListener("scroll",function (){},false);
|
|
|
- return;
|
|
|
- }
|
|
|
+ loadData(date){
|
|
|
+ this.$set(this.loadAnimation,date,true);
|
|
|
+ window.tempTip.postBasicRequest("{{url('transport/waybill/loadData')}}",{searchText:this.searchText,lastId:this.lastId,date:date},res=>{
|
|
|
+ this.$set(this.loadAnimation,date,false);
|
|
|
+ if(!res || res.length<1)return;
|
|
|
let waybills = [];
|
|
|
- let lastId = "";
|
|
|
res.forEach(waybill=>{
|
|
|
waybills.push({
|
|
|
id:waybill.id,
|
|
|
@@ -195,10 +182,8 @@
|
|
|
recipient:waybill.order ? waybill.order.consignee_name : waybill.recipient,
|
|
|
address:waybill.order ? waybill.order.province+waybill.order.city+waybill.order.district : waybill.destination,
|
|
|
});
|
|
|
- lastId = waybill.id;
|
|
|
});
|
|
|
- this.waybills.push.apply(this.waybills, waybills);
|
|
|
- this.lastId = lastId;
|
|
|
+ this.groups[date] = waybills;
|
|
|
});
|
|
|
},
|
|
|
searchSubmit(){
|
|
|
@@ -227,21 +212,21 @@
|
|
|
shrink(e){
|
|
|
e.target.style.width="50px";
|
|
|
},
|
|
|
- appendSubjoinFee(waybillId){
|
|
|
+ appendSubjoinFee(date,waybillId){
|
|
|
let subjoinFee = $("#subjoin_fee"+waybillId).val();
|
|
|
if (!subjoinFee)return;
|
|
|
window.tempTip.postBasicRequest("{{url('transport/waybill/appendSubjoinFee')}}",{subjoinFee:subjoinFee,id:waybillId},()=>{
|
|
|
- this.waybills.some((waybill,index)=>{
|
|
|
+ this.groups[date].some((waybill,index)=>{
|
|
|
if (waybill.id===waybillId){
|
|
|
- this.$set(this.waybills[index],"subjoin_fee",subjoinFee);
|
|
|
+ this.$set(this.groups[date][index],"subjoin_fee",subjoinFee);
|
|
|
return true;
|
|
|
}
|
|
|
});
|
|
|
- return "附加费添加成功";
|
|
|
+ return !this.updatePool[waybillId] ? "附加费添加成功" : '';
|
|
|
});
|
|
|
},
|
|
|
- submit(isBtn,waybillId,id=null){
|
|
|
- if(!isBtn){this.appendSubjoinFee(waybillId);return;}
|
|
|
+ submit(date,isBtn,waybillId,id=null){
|
|
|
+ if(!isBtn){this.appendSubjoinFee(date,waybillId);if (!this.updatePool[waybillId])return;}
|
|
|
window.tempTip.confirm("确定要提交调配信息吗?",()=>{
|
|
|
let data={
|
|
|
id : id ? id : waybillId,
|
|
|
@@ -271,7 +256,7 @@
|
|
|
},1);
|
|
|
return;
|
|
|
}
|
|
|
- this.waybills.some(function (waybill) {
|
|
|
+ this.groups[date].some(function (waybill) {
|
|
|
if (waybill.id===data['id']){
|
|
|
waybill.carrier_bill=response.data.carrier_bill;
|
|
|
waybill.inquire_tel=response.data.inquire_tel;
|
|
|
@@ -280,11 +265,13 @@
|
|
|
waybill.carrier_weight=response.data.carrier_weight;
|
|
|
waybill.carrier_weight_other=response.data.carrier_weight_other;
|
|
|
if (waybill.carrier_bill)waybill.isBtn=false;
|
|
|
- tempTip.setDuration(2000);
|
|
|
- tempTip.showSuccess('录入成功!');
|
|
|
return true;
|
|
|
}
|
|
|
});
|
|
|
+ tempTip.setDuration(2000);
|
|
|
+ if (this.updatePool[waybillId]){
|
|
|
+ tempTip.showSuccess('修改成功!');this.$set(this.updatePool,waybillId,false);
|
|
|
+ }else tempTip.showSuccess('录入成功!');
|
|
|
}).catch(function (err) {
|
|
|
tempTip.setDuration(3000);
|
|
|
tempTip.show('网络异常:'+err);
|