| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124 |
- @extends('layouts.app')
- @section('title')查询-运输管理@endsection
- @section('content')
- <div id="nav2">
- @component('waybill.menu')
- @endcomponent
- </div>
- <div class="container-fluid" style="min-width: 1500px;">
- <div class="d-none" id="list">
- @include("waybill._batchUploadImg")
- <div class="container-fluid nav3">
- <div class="card menu-third" >
- <ul class="nav nav-pills">
- @can('运输管理-查询')
- <li class="nav-item">
- <a class="nav-link @if($uriType=='') active @endif" href="{{url('waybill/index')}}">全部</a>
- </li> @endcan
- @can('运输管理-查询')
- <li class="nav-item">
- <a class="nav-link @if($uriType=='专线') active @endif" href="{{url('waybill/index?uriType=专线')}}">专线</a>
- </li> @endcan
- @can('运输管理-查询')
- <li class="nav-item">
- <a class="nav-link @if($uriType=='直发车') active @endif" href="{{url('waybill/index?uriType=直发车')}}">直发车</a>
- </li> @endcan
- </ul>
- </div>
- </div>
- <div id="form_div"></div>
- <span class="dropdown">
- <button class="btn btn-outline-dark btn-sm form-control-sm dropdown-toggle tooltipTarget" :class="[checkData.length>0?'btn-dark text-light':'']"
- data-toggle="dropdown" title="导出所有页将会以搜索条件得到的筛选结果,将其全部记录(每一页)导出">
- 导出Excel
- </button>
- <div class="dropdown-menu">
- <a class="dropdown-item" @click="waybillExport(false)" href="javascript:">导出勾选内容</a>
- <a class="dropdown-item" @click="waybillExport(true)" href="javascript:">导出所有页</a>
- </div>
- </span>
- @can('运输管理-图片上传')<button class="btn btn-sm btn-outline-info" data-target="#batchUploadImg" data-toggle="modal">批量上传图片</button>@endcan
- <div>
- @if(Session::has('successTip'))
- <div class="alert alert-success h1">{{Session::get('successTip')}}</div>
- @endif
- </div>
- <label for="all" class="d-none" id="cloneCheckAll">
- <input id="all" type="checkbox" @click="checkAll($event)">全选
- </label>
- <table class="table table-striped table-sm table-bordered table-hover text-nowrap d-none" id="headerRoll"></table>
- <table class="table table-striped table-sm table-bordered table-hover text-nowrap waybill-table" style="background: #fff;" id="headerParent">
- <tr>
- <th class="table-header-layer-1" colspan="4"></th>
- <th class="table-header-layer-1" colspan="11"><span class="fa fa-file-text-o"></span> 运单信息</th>
- <th class="table-header-layer-1" colspan="16"><span class="fa fa-truck"></span> 运输信息</th>
- <th class="table-header-layer-1" colspan="5"><span class="fa fa-rmb"></span> 费用信息
- @can('运输管理-删除')
- <th class="table-header-layer-1" colspan="1"> </th>
- @endcan
- </tr>
- <tr id="header"></tr>
- <tr v-for="(waybill,i) in waybills" :style="[{color:waybill.status=='待重审'?'red':''||waybill.status=='已完结'?'green':''},{'font-weight': waybill.id==selectedStyle?'bold':''}]"
- :id="'waybill'+waybill.id" @click="selectedColor(waybill.id,$event)" position="static" @mouseover="hidetop($event)" @mouseleave="showtop($event)">
- <td>
- <input class="checkItem" type="checkbox" :value="waybill.id" v-model="checkData">
- </td>
- <td>
- <span v-if=waybill.status==="未审核"||waybill.status==="待重审">
- @can('运输管理-运单审核')
- <button class="btn btn-outline-primary btn-sm" @click="waybillAudit(waybill.id,waybill.waybill_number)">审核</button>
- @endcan
- @can('运输管理-编辑')
- <a target="_blank" class="btn btn-outline-secondary btn-sm" :href= "('{{url('waybill/waybillEdit')}}/'+waybill.id)">修改</a>
- @endcan
- </span>
- <span v-if=waybill.status==="已审核">
- @can('运输管理-调度')
- <button class="btn btn-outline-secondary btn-sm" @click="waybillRetreatAudit(waybill.id,waybill.waybill_number)">取消审核</button>
- <a target="_blank" class="btn btn-outline-secondary btn-sm" :href= "('{{url('waybill')}}/'+waybill.id+'/edit')">调度</a>
- @endcan
- </span>
- <span v-if=waybill.status==="待终审">
- @can('运输管理-调度审核')
- <button class="btn btn-outline-success btn-sm" @click="waybillEndAudit(waybill.id,waybill.waybill_number)">完结</button>
- @endcan
- @can('运输管理-调度')
- <a target="_blank" class="btn btn-outline-secondary btn-sm" :href= "('{{url('waybill')}}/'+waybill.id+'/edit')">改调度</a>
- @endcan
- </span>
- </td>
- @can('运输管理-置顶')
- <td class="td-warm text-muted" v-if="waybill.remark" style="height: 55px">
- <button type="button" class="btn btn-sm btn-outline-danger " @click="cancelOnTop($event)" :data_id="waybill.id" style="opacity: 0.75">取消</button>
- </td>
- <td v-else>
- <button type="button" class="btn btn-sm btn-outline-secondary" @click="waybillOnTop($event)" :data_id="waybill.id" style="opacity: 0.75">置顶</button>
- </td>
- @endcan
- <td :class="[waybill.status=='已审核'?'text-success':'']">@{{waybill.status}}</td>
- <td class="td-warm text-muted toptd" >
- <div v-if="waybill.remark" class="bg-light-yellow text-danger top" data-toggle="tooltip" style="opacity: 0.1;position: absolute;z-index: 1"
- >置顶备注:@{{ waybill.remark }}</div>
- @{{ i+1 }}</td>
- <td class="td-warm text-muted">@{{waybill.created_at}}</td>
- <td class="td-warm text-muted">
- <a href="#" v-if="waybill.waybillAuditLogs.length>0" class="dropdown-toggle" data-toggle="dropdown">
- @{{ waybill.waybillAuditLogs[0].user ? waybill.waybillAuditLogs[0].user.name : '系统' }}<b class="caret"></b>
- </a>
- <div style="position: absolute;width:320px;margin-left:-100px;background-color: white;max-height:150px ;overflow-y:auto" class="small mt-0 dropdown-menu">
- <table class="table table-sm table-striped table-bordered">
- <tr>
- <th>经手人</th>
- <th>操作</th>
- <th>时间</th>
- </tr>
- <tr v-for="people in waybill.waybillAuditLogs">
- <td>@{{ people.user ? people.user.name : '系统' }}</td>
- <td class="text-danger font-weight-bold">@{{ people.audit_stage }}</td>
- <td>@{{ people.created_at }}</td>
- </tr>
- </table>
- </div>
- </td>
- <td class="td-warm">@{{waybill.type}} <span class="badge badge-sm bg-warning" v-if="waybill.collect_fee && waybill.collect_fee>0">到付</span></td>
- <td class="td-warm">@{{waybill.owner}}</td>
- <td class="td-warm toptd" :title="waybill.remark? '置顶备注:'+waybill.remark :''">@{{waybill.source_bill}}</td>
- <td class="td-warm">
- <span class="badge badge-pill badge-danger" v-if="waybill.is_cancel">取消</span>
- @{{waybill.wms_bill_number}}
- </td>
- <td class="td-warm">@{{waybill.waybill_number}}</td>
- @can('运输管理-运单编辑')
- <td class="td-warm" >
- <span v-if="waybill.charge" class="btn-sm btn-outline-secondary btn" @click="waybillChargeCheck($event)" :data_id="waybill.id">@{{waybill.charge|money}}</span>
- <input v-else type="number" class="form-control form-control-sm" @blur="addWaybillCharge($event)" onfocus="$(this).css('width','85px')" :value="waybill.charge" :data_id="waybill.id" >
- <input type="number" class="form-control form-control-sm" @blur="updateWaybillCharge($event)" :value="waybill.charge" :data_id="waybill.id" style="min-width:85px;display: none">
- </td>
- @else
- <td class="td-warm" ><span v-if="waybill.charge">@{{waybill.charge|money}}</span></td>
- @endcan
- <td class="td-warm">@{{waybill.other_charge}}</td>
- <td class="td-warm">@{{waybill.other_charge_remark}}</td>
- <td class="td-warm">
- <div align="center" @mouseleave="removeCommonImg('common_img_'+waybill.id)" @mouseenter="commonImg('img_'+waybill.id,waybill.url,waybill.suffix)">
- <img v-if="waybill.url" :id="'img_'+waybill.id" :src="waybill.url+'-thumbnail.'+waybill.suffix"
- {{--:data-src="waybill.url+'-thumbnail.'+waybill.suffix" src="{{url('icon/img404-thumbnail.jpg')}}"--}}>
- @can('运输管理-图片上传')<div v-if="!waybill.url">
- <input class="btn btn-sm btn-outline-secondary" type="button" @click="certiimg(waybill.waybill_number)" value="上传照片 "/>
- <input type="file" @change="submitFile($event,waybill.waybill_number)" :id="waybill.waybill_number"
- style="display: none" accept="image/gif,image/jpeg,image/jpg,image/png,image/svg"/>
- </div>@endcan
- </div>
- </td>
- <td class="td-cool">@{{waybill.recipient}}</td>
- <td class="td-cool">@{{waybill.recipient_mobile}}</td>
- <td class="td-cool text-muted">@{{waybill.origination}}</td>
- <td class="td-cool text-muted">@{{waybill.province}}</td>
- <td class="td-cool text-muted">@{{waybill.city}}</td>
- <td class="td-cool text-muted">@{{waybill.district}}</td>
- <td class="td-cool text-muted">@{{waybill.destination}}</td>
- <td class="td-cool">@{{waybill.carrier}}</td>
- <td class="td-cool">
- <span v-if="waybill.carrier_bill">
- @{{waybill.carrier_bill}}<span v-if="waybill.carType">/@{{ waybill.carType.name }}<i v-if="waybill.carType.length">(@{{waybill.carType.length}}米)</i></span>
- </span>
- {{-- <span v-if="waybill.type==='专线'">@{{waybill.carrier_bill}}</span>--}}
- {{-- <span v-if="waybill.type==='直发车'">--}}
- {{-- <span v-if="waybill.carType">--}}
- {{-- @{{ waybill.carType.name }}<i v-if="waybill.carType.length">(@{{waybill.carType.length}}米)</i>--}}
- {{-- </span>--}}
- {{-- </span>--}}
- </td>
- <td class="td-cool">
- <span v-if="waybill.type === '直发车'">
- @{{ waybill.car_owner_info }}
- </span>
- </td>
- <td class="td-cool"><span v-if="waybill.warehouse_weight">@{{waybill.warehouse_weight|filterZero}} @{{waybill.warehouse_weight_unit}}</span></td>
- <td class="td-cool"><span v-if="waybill.carrier_weight">@{{waybill.carrier_weight|filterZero}} @{{waybill.carrier_weight_unit}}</span></td>
- <td class="td-cool text-center" style="position: relative" @mouseenter="btnRefreshWeightZoomOut(waybill)" @mouseleave="btnRefreshWeightZoomIn(waybill)">
- <span v-if="waybill.warehouse_weight_other&&waybill.btn_refresh_weight=='zoomIn'"> @{{waybill.warehouse_weight_other}} @{{waybill.warehouse_weight_unit_other}}</span>
- <button type="button" class="btn btn-sm btn-outline-info" @click="refreshWaveHouseWeight(waybill.wms_bill_number)"
- :style="[
- {position:waybill.btn_refresh_weight&&waybill.btn_refresh_weight=='zoomIn'?'absolute':'static'},
- {transform:waybill.btn_refresh_weight&&waybill.btn_refresh_weight=='zoomIn'?'scale(0.55)':'scale(1)'},
- {right:waybill.btn_refresh_weight&&waybill.btn_refresh_weight=='zoomIn'?'-10px':'auto'},
- {bottom:waybill.btn_refresh_weight&&waybill.btn_refresh_weight=='zoomIn'?'-6px':'auto'},
- ]">刷新</button>
- </td>
- <td class="td-cool"><span v-if="waybill.carrier_weight_other">@{{waybill.carrier_weight_other|filterZero}} @{{waybill.carrier_weight_unit_other}}</span></td>
- <td class="td-cool"><span v-if="waybill.amount">@{{waybill.amount}} @{{waybill.amount_unit_name }}</span></td>
- <td class="td-cool">@{{waybill.mileage|km}} </td>
- @can('运输管理-可见费用项')
- @can('运输管理-运费')
- <td class="td-helpful" v-if="waybill.fee">
- <span v-if="waybill.type==='专线'"></span>
- <span v-else-if="waybill.fee" class="btn-sm btn-outline-secondary btn" @click="waybillFeeCheck($event)" :data_id="waybill.id">@{{waybill.fee|money}}</span>
- <input type="number" class="form-control form-control-sm" @blur="updateWaybillFee($event)" :value="waybill.fee" :data_id="waybill.id" style="min-width:85px;display: none">
- </td>
- <td class="td-helpful" v-else>
- <span v-if="waybill.type==='专线'"></span>
- <input v-else type="number" class="form-control form-control-sm" @blur="addWaybillFee($event)" onfocus="$(this).css('width','85px')" :value="waybill.fee" :data_id="waybill.id" >
- </td>
- @endcan
- <td class="td-helpful">@{{waybill.pick_up_fee}}</td>
- <td class="td-helpful">@{{waybill.other_fee}}</td>
- @endcan
- <td class="td-helpful">@{{waybill.deliver_at}}</td>
- <td class="td-helpful"><span v-html="waybill.dispatch_remark"></span></td>
- @can('运输管理-删除')
- <td class="td-operation">
- <button type="button" class="btn btn-outline-danger btn-sm" @click="waybillDestroy(waybill.id,waybill.waybill_number,i)">删</button>
- </td>
- @endcan
- </tr>
- </table>
- <div class="modal fade " id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
- <div class="modal-dialog modal-dialog-centered">
- <div class="modal-content">
- <div class="modal-header">
- <h5 class="modal-title" id="exampleModalLabel">请输入置顶备注</h5>
- <button type="button" class="close" data-dismiss="modal" aria-label="Close" @click="changeRemark">
- <span aria-hidden="true">×</span>
- </button>
- </div>
- <div class="modal-body">
- <input type="hidden" class="form-control" id="onTopId">
- <textarea type="text" class="form-control" required id="remark" @change="changeRemark" ></textarea>
- <div class="invalid-feedback">
- 备注信息不能为空
- </div>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal" @click="changeRemark" >关闭</button>
- <button type="button" class="btn btn-sm btn-primary" @click="submitOnTop">提交</button>
- </div>
- </div>
- </div>
- </div>
- <div class="text-info h5 btn btn">@{{ ((page-1)*paginate) + count }}/{{$waybills->total()}}</div>
- {{$waybills->appends($paginateParams)->links()}}
- </div>
- </div>
- @endsection
- @section('lastScript')
- <style type="text/css">
- @keyframes anima
- {
- from {
- opacity:0.1;
- }
- to{
- opacity:1;
- }
- }
- @-webkit-keyframes anima
- {
- from {
- opacity:0.75;
- }
- to{
- opacity:0.1;
- }
- }
- .bg-light-yellow{
- background: #fffff8;
- }
- .top{
- padding-top: 0px;
- padding-left: 10px;
- margin-top: -4px;
- margin-left: -5px;
- line-height: 55px;
- position: absolute;
- animation: anima;
- animation-duration: 3s;
- animation-timing-function: cubic-bezier(0,0,1,1);
- animation-direction: alternate;
- animation-play-state: running;
- -webkit-animation-name: anima;
- -webkit-animation-duration: 3s;
- -webkit-animation-timing-function: cubic-bezier(0,0,1,1);
- -webkit-animation-iteration-count: infinite;
- -webkit-animation-direction: alternate;
- -webkit-animation-play-state: running;
- }
- </style>
- <script type="text/javascript" src="{{mix('js/queryForm/export.js')}}"></script>
- <script type="text/javascript" src="{{mix('js/queryForm/queryForm.js')}}"></script>
- <script type="text/javascript" src="{{mix('js/queryForm/header.js')}}"></script>
- <script>
- let vue = new Vue({
- el:'#list',
- data:{
- waybills:[
- @foreach($waybills as $waybill)
- {
- id:'{{$waybill->id}}',
- created_at:'{{$waybill->created_at}}',
- updated_at:'{{$waybill->updated_at}}',
- url:'{{$waybill->uploadFile ? asset('/storage'.$waybill->uploadFile->url) : ''}}',
- suffix:'{{$waybill->uploadFile ? $waybill->uploadFile->type : ''}}',
- status:'{{$waybill->status}}',
- type:'{{$waybill->type}}',
- waybill_number:'{{$waybill->waybill_number}}',
- owner:'{{$waybill->owner_name ?? ($waybill->owner->name ?? '')}}',
- source_bill:'{{$waybill->order->client_code ?? $waybill->source_bill}}',
- wms_bill_number:'{{$waybill->wms_bill_number}}',
- is_cancel:'{{$waybill->order->wms_status ?? ''}}' === '订单取消',
- origination:'{{$waybill->origination}}',
- destination:'{{$waybill->order_address ?? $waybill->destination}}',
- recipient:'{{$waybill->order->consignee_name ?? $waybill->recipient}}',
- recipient_mobile:'{{$waybill->order_consignee_phone ?? $waybill->recipient_mobile}}',
- charge:'{{$waybill->charge}}',
- ordering_remark:'{{preg_replace("/[\n\s]/",' ',($waybill->ordering_remark??""))}}',
- carrier:'{{$waybill->logistic->name ?? ''}}',
- carrier_bill:'{{$waybill->carrier_bill}}',
- warehouse_weight:'{{$waybill->warehouse_weight}}',
- warehouse_weight_unit:'{{$waybill->warehouseWeightUnit->name ?? ''}}',
- carrier_weight:'{{$waybill->carrier_weight}}',
- carrier_weight_unit:'{{$waybill->carrierWeightUnit->name ?? ''}}',
- warehouse_weight_other:'{{$waybill->warehouse_weight_other}}',
- warehouse_weight_unit_other:'{{$waybill->warehouseWeightUnitOther->name ?? ''}}',
- carrier_weight_other:'{{$waybill->carrier_weight_other}}',
- carrier_weight_unit_other:'{{$waybill->carrierWeightUnitOther->name ?? ''}}',
- amount_unit_name:'{{$waybill->amountUnit->name ?? ''}}',
- other_charge:'{{$waybill->other_charge}}',
- other_charge_remark:'{{$waybill->other_charge_remark}}',
- mileage:'{{$waybill->mileage}}',
- amount:'{{$waybill->amount}}',
- @if($waybill->carType)carType:{!! $waybill->carType !!},car_owner_info:'{{$waybill->car_owner_info}}',@endif
- @can('运输管理-可见费用项') fee:'{{$waybill->fee}}',
- pick_up_fee:'{{$waybill->pick_up_fee}}',other_fee:'{{$waybill->other_fee}}',
- collect_fee:'{{$waybill->collect_fee}}', @endcan
- deliver_at:'{{$waybill->deliver_at}}',
- dispatch_remark:'{{$waybill->dispatch_remark}}',
- isBtn:false,
- waybillAuditLogs:{!! $waybill->waybillAuditLogs !!},
- btn_refresh_weight:'zoomIn',
- remark:'{{$waybill->remark ?? ''}}',
- province:'{{$waybill->order_province ?? ($waybill->destinationCity->parent->name ?? '')}}',
- city:'{{$waybill->order_city ?? ($waybill->destinationCity->name ?? '')}}',
- district:'{{$waybill->order_district ?? ($waybill->district->name ?? '')}}',
- },
- @endforeach
- ],
- checkData:[],
- selectedStyle:[],
- owners:[
- @foreach($owners as $owner)
- {name:'{{$owner->id}}',value:'{{$owner->name}}'},
- @endforeach
- ],
- logistics:[
- @foreach($logistics as $logistic)
- {name:"{{$logistic->id}}",value:'{{$logistic->name}}'},
- @endforeach
- ],
- status:[
- {name:'未审核',value:'未审核'},
- {name:'已审核',value:'已审核'},
- {name:'待调度',value:'待调度'},
- {name:'待终审',value:'待终审'},
- {name:'已完结',value:'已完结'},
- ],
- isOut:false,
- isBlur:false,
- isOwnersBtn:false,
- imgs:'',
- is_ownerSelectShow:true,
- sum:{!! $waybills->total() !!},
- paginate : 50,
- page : Number('{{$waybills->currentPage()}}'),
- count : Number('{{$waybills->count()}}'),
- images:[],
- batchUploadError:[],
- size:0,
- selectTr:''
- },
- watch:{
- checkData:{
- handler(){
- if (this.checkData.length === this.waybills.length){
- document.querySelector('#all').checked = true;
- document.querySelector('#all_temp').checked = true;
- }else {
- document.querySelector('#all').checked = false;
- document.querySelector('#all_temp').checked = false;
- }
- },
- deep:true
- },
- },
- mounted:function(){
- $(".tooltipTarget").tooltip({'trigger':'hover'});
- $('#list').removeClass('d-none');
- let waybill = $('.table-header-layer-1')[1];
- $('.top').css('min-width', waybill.scrollWidth);
- /*this.imgs=Array.from(document.getElementById('list').querySelectorAll('img'));
- this.lazy();
- if (this.imgs&&this.imgs.length>0){
- window.addEventListener('scroll',this.lazy)
- }*/
- let data=[
- [
- {name:'owner_id',type:'select_multiple_select',tip:['输入关键词快速定位下拉列表,回车确定','选择要显示的客户'],
- placeholder:['货主','定位或多选货主'],data:this.owners},
- {name:'created_at_start',type:'time',tip:['选择显示指定日期的起始时间','选择显示指定日期的起始时间']},
- {name:'origination',type:'input',tip:'始发地:可在左侧增加百分号(%)进行模糊搜索',placeholder: '始发地'},
- {name:'carrier_bill',type:'input',tip:'承运商单号:可在左侧增加百分号(%)进行模糊搜索',placeholder: '承运商单号'},
- {name:'status',type:'select',placeholder: '运单状态',data:this.status},
- {name:'source_bill',type:'input',tip: '上游单号:可在左侧增加百分号(%)进行模糊搜索',placeholder: '上游单号'},
- {name:'recipient',type:'input',tip: '收货人姓名:可在左侧增加百分号(%)进行模糊搜索',placeholder: '收货人姓名'},
- {name:'car_owner_info',type:'input',tip: '车辆信息:可在左侧增加百分号(%)进行模糊搜索',placeholder: '车辆信息'},
- ],
- [
- {name:'wms_bill_number',type:'input',tip:'WMS单号:可在两侧增加百分号(%)进行模糊搜索',placeholder: 'WMS单号'},
- {name:'created_at_end',type:'time',tip:['选择显示指定日期的结束时间','选择显示指定日期的结束时间']},
- {name:'destination',type:'input',tip:'目的地:可在两侧增加百分号(%)进行模糊搜索',placeholder: '目的地'},
- {name:'waybill_number',type:'input',tip:'运单号:可在两侧增加百分号(%)进行模糊搜索',placeholder: '运单号'},
- {name:'logistic_id',type:'select',placeholder: '承运商',data:this.logistics},
- {name:'recipient_mobile',type:'input',tip: '收货人电话:可在左侧增加百分号(%)进行模糊搜索',placeholder: '收货人电话'},
- ],
- ];
- let param=[];
- this.$set(param,"uriType",'{{$uriType}}');
- this.form = new query({
- el:"#form_div",
- condition:data,
- param:param,
- });
- this.form.init();
- let column = [
- {name:'cloneCheckAll',customization:true,type:'checkAll',column:'id',
- dom:$('#cloneCheckAll').removeClass('d-none'), neglect: true},
- @can('运输管理-编辑','运输管理-运单审核','运输管理-调度','运输管理-编辑')
- {name:'operation',value: '操作', neglect: true, class:"td-operation"},@endcan
- {name:'onTop',value: '置顶', neglect: true, class:"td-operation"},
- {name:'status',value: '状态', class:"td-operation"},
- {name:'index',value: '序号', neglect: true, class:"td-warm"},
- {name:'created_at', neglect: true,value: '创建时间', class:"td-warm"},
- {name:'operating',value: '操作记录', class:"td-warm"},
- {name:'type',value: '运单类型', class:"td-warm"},
- {name:'owner',value: '货主', class:"td-warm"},
- {name:'source_bill',value: '上游单号', class:"td-warm"},
- {name:'wms_bill_number',value: 'WMS订单号', class:"td-warm"},
- {name:'waybill_number',value: '运单号', class:"td-warm"},
- {name:'charge',value: '运输收费', neglect: true, class:"td-warm"},
- {name:'other_charge',value: '其他收费', neglect: true, class:"td-warm"},
- {name:'other_charge_remark',value: '其他收费备注', class:"td-warm"},
- @can('运输管理-图片上传'){name:'img',value: '照片', neglect: true, class:"td-warm"},@endcan
- {name:'recipient',value: '收件人', class:"td-cool"},
- {name:'recipient_mobile',value: '收件人电话', class:"td-cool"},
- {name:'origination',value: '始发地', class:"td-cool"},
- {name:'province',value: '省', class:"td-cool"},
- {name:'city',value: '市', class:"td-cool"},
- {name:'district',value: '区', class:"td-cool"},
- {name:'destination',value: '目的地', class:"td-cool"},
- {name:'carrier',value: '承运商', class:"td-cool"},
- {name:'carrier_bill',value: '单号/车型', neglect: true, class:"td-cool"},
- {name:'car_owner_info',value: '车辆信息', neglect: true, class:"td-cool"}, // 车辆信息
- {name:'warehouse_weight',value: '仓库计抛', neglect: true, class:"td-cool"},
- {name:'carrier_weight',value: '承运商计抛', neglect: true, class:"td-cool"},
- {name:'warehouse_weight_other',value: '仓库计重', neglect: true, class:"td-cool"},
- {name:'carrier_weight_other',value: '承运商计重', neglect: true, class:"td-cool"},
- {name:'amount',value: '计件', neglect: true, class:"td-cool"},
- {name:'mileage',value: '里程', neglect: true, class:"td-cool"},
- @can('运输管理-运费'){name:'fee',value: '运费', neglect: true, class:"td-helpful"},@endcan
- {name:'pick_up_fee',value: '提货费', neglect: true, class:"td-helpful"},
- {name:'other_fee',value: '其他支出', neglect: true, class:"td-helpful"},
- {name:'deliver_at',value: '发货时间', class:"td-helpful"},
- {name:'dispatch_remark',value: '调度备注', class:"td-helpful"},
- @can('运输管理-删除'){name:'remove',value: '操作', neglect: true, class:"td-delete"},@endcan
- ];
- let _this = this;
- setTimeout(function () {
- let header = new Header({
- el: "#header",
- column: column,
- data: _this.waybills,
- restorationColumn: 'id',
- fixedTop:($('#form_div').height())+2,
- offset:0.5,
- vue : vue,
- });
- header.init();
- },0);
- this.paginate = $("#paginate").val();
- },
- methods:{
- btnRefreshWeightZoomIn(waybill){
- waybill.btn_refresh_weight='zoomIn'
- },
- btnRefreshWeightZoomOut(waybill){
- waybill.btn_refresh_weight='zoomOut'
- },
- /*lazy(){
- //高度
- let h=(window.innerWidth)+(document.documentElement.scrollTop || document.body.scrollTop);
- this.imgs.forEach((img,i)=>{
- let src = img.getAttribute('data-src');
- if ((h>this.getElementToPageTop(img)-500) && src){
- let t = new Image();
- t.src = src;
- if (t.complete) {
- img.src = src;
- this.$delete(this.imgs,i);
- return;
- }
- t.onload = ()=>{
- img.src = src;
- this.$delete(this.imgs,i);
- };
- }
- });
- },
- getElementToPageTop(el) {
- if(el.parentElement) {
- return this.getElementToPageTop(el.parentElement) + el.offsetTop
- }
- return el.offsetTop
- },*/
- waybillAudit(id,waybill_number){
- if(!confirm('确定要通过“'+waybill_number+'”的审核吗?')){return};
- let _this=this;
- let w;
- let url = '{{url('waybill/waybillAudit')}}';
- axios.post(url, {id:id})
- .then(
- function (response) {
- if (response.data.success){
- _this.waybills.forEach(function (waybill) {
- if (waybill.id===id){
- waybill.status=response.data.status;
- waybill.waybillAuditLogs.push(response.data.waybillAuditLog);
- w=waybill.waybill_number;
- }
- });
- tempTip.setDuration(3000);
- tempTip.showSuccess('审核'+w+'成功!');
- }else if (response.data.exception!=null){
- tempTip.setDuration(3000);
- tempTip.show(response.data.exception);
- }else {
- tempTip.setDuration(3000);
- tempTip.show('审核失败!');
- }
- }
- ).catch(function (err) {
- tempTip.setDuration(3000);
- tempTip.show('审核失败,网络连接错误!'+err);
- });
- },
- waybillDestroy(id,waybill_number,index){
- if(!confirm('确定要删除运单号为:“'+waybill_number+'”的运单吗?')){return};
- let url = '{{url('waybill')}}/'+id;
- let _this = this;
- axios.delete(url).then(
- function (response) {
- if(!response.data.success){
- tempTip.setDuration(3000);
- tempTip.show('运单:'+waybill_number+'删除失败!');
- }else {
- tempTip.setDuration(2000);
- tempTip.showSuccess('运单:'+waybill_number+'删除成功!');
- _this.$delete(_this.waybills,index);
- }
- }
- ).catch(function (err) {
- tempTip.setDuration(3000);
- tempTip.show('删除失败,网络链接错误!'+err);
- });
- },
- waybillRetreatAudit(id,waybill_number){
- if(!confirm('确定要驳回“'+waybill_number+'”的审核吗?')){return};
- let _this=this;
- let w;
- let url='{{url('files')}}';
- axios.post(url,{id:id})
- .then(
- function (response) {
- if (response.data.success){
- _this.waybills.forEach(function (waybill){
- if (waybill.id===id){
- waybill.status=response.data.status;
- waybill.waybillAuditLogs=[];
- w=waybill.waybill_number;
- }
- });
- tempTip.setDuration(3000);
- tempTip.showSuccess(w+'审核驳回成功!');
- }else {
- tempTip.setDuration(3000);
- tempTip.show('审核驳回失败!');
- }
- }
- ).catch(function (err) {
- tempTip.setDuration(3000);
- tempTip.show('审核驳回失败,网络连接错误!'+err);
- });
- },
- waybillEndAudit(id,waybill_number){
- if(!confirm('确定要通过“'+waybill_number+'”的终审吗?')){return};
- let _this=this;
- let w;
- let url='{{url('waybill/waybillEndAudit')}}';
- axios.post(url, {id:id})
- .then(
- function (response) {
- if (response.data.success){
- _this.waybills.forEach(function (s) {
- if (s.id===id){
- s.status=response.data.status;
- s.waybillAuditLogs.push(response.data.waybillAuditLog);
- w=s.waybill_number;
- }
- });
- tempTip.setDuration(3000);
- tempTip.showSuccess(w+'终审完毕!');
- }else if (response.data.exception!=null){
- tempTip.setDuration(3000);
- tempTip.show(response.data.exception);
- }else {
- tempTip.setDuration(3000);
- tempTip.show('终审失败!');
- }
- }
- ).catch(function (err) {
- tempTip.setDuration(3000);
- tempTip.show('终审失败,网络连接错误!'+err);
- });
- },
- checkAll(e){
- if (e.target.checked){
- this.waybills.forEach((el,i)=>{
- if (this.checkData.indexOf(el.id) == '-1'){
- this.checkData.push(el.id);
- }
- });
- }else {
- this.checkData = [];
- }
- },
- waybillExport(checkAllSign){
- let url = '{{url('waybill/export')}}';
- let token='{{ csrf_token() }}';
- excelExport(checkAllSign,this.checkData,url,this.sum,token);
- },
- selectedColor(id,e){
- $('#headerParent tr[class=focusing]').removeClass('focusing')
- if (id==this.selectedStyle){
- this.selectedStyle='';
- return;
- }
- this.selectedStyle=id;
- $(e.target).parent('tr').addClass('focusing')
- },
- mouseleaveOwner:function () {
- if(!this.isOut&&!this.isBlur){
- this.isOwnersBtn=false;
- }
- },
- blurOwner:function () {
- if (!this.isOut&&!this.isBlur){
- this.isOwnersBtn=false;
- }
- },
- certiimg(waybill_number){
- $('#'+waybill_number).click();
- },
- submitFile(e,waybill_number){
- let file=e.target.files[0];
- if (file.size >=5242880){
- tempTip.setDuration(3000);
- tempTip.show("图片大小不能超过5MB!");
- return;
- }
- let _this=this;
- let formData=new FormData();
- formData.append("file",file);
- formData.append("waybill_number",waybill_number);
- axios.post('{{url('waybill/upload')}}',formData)
- .then(function (response) {
- if (!response.data.success){
- tempTip.setDuration(4000);
- tempTip.show(response.data.error);
- return;
- }
- _this.waybills.some(function (waybill) {
- if (waybill.waybill_number===waybill_number){
- waybill.url=response.data.data.url;
- waybill.suffix=response.data.data.type;
- /*setTimeout(function () {
- _this.imgs.push(document.getElementById('img_'+waybill.id));
- _this.lazy();
- },1);*/
- tempTip.setDuration(3000);
- tempTip.showSuccess("上传成功!");
- return true;
- }
- });
- }).catch(function (err) {
- tempTip.setDuration(4000);
- tempTip.show("网络错误:"+err);
- })
- },
- commonImg(id,url,suffix){
- $('#'+id).after(
- "<div id=\"common_"+id+"\" style='position: absolute;padding-top: 2px;z-index: 99'>" +
- "<div style='position:absolute'>"+
- "<div >"+
- "<a target='_blank' href='"+url+'-bulky.'+suffix+"'>" +
- "<img src=\""+url+'-common.'+suffix+"\" style='position: relative;left:-50px;' >" +
- "</a>" +
- "</div>"+
- @can('运输管理-图片删除')"<button type='button' class='btn btn-sm btn-danger' onclick='vue.btnDeleteImg(this)' value='"+id+"' style='position: relative;float: right;margin-right: 51px;margin-top: -30px;' >删除</button>" +@endcan
- "</div>"+
- "</div>");
- },
- removeCommonImg(id){
- $('#'+id).remove();
- },
- btnDeleteImg(e){
- let idstr = $(e).val();
- let id = idstr.substr( idstr.indexOf('_')+1);
- if (!confirm('确定要删除所选图片吗?'))return;
- this.destroyImg([id]);
- },
- deleteImg(){
- if (this.checkData.length <= 0) {
- tempTip.setDuration(2000);
- tempTip.showSuccess('没有勾选任何记录');
- return;
- }
- if (!confirm('确定要删除所选图片吗?'))return;
- this.destroyImg(this.checkData);
- },
- destroyImg(id){
- let _this = this;
- axios.post('{{url('waybill/deleteImg')}}',{'ids':id})
- .then(function (response) {
- if (!response.data.success){
- tempTip.setDuration(4000);
- tempTip.show("删除失败");
- return;
- }
- id.forEach(function (id) {
- _this.waybills.some(function (waybill) {
- if (waybill.id===id){
- waybill.url='';
- return true;
- }
- });
- });
- tempTip.setDuration(3000);
- tempTip.showSuccess("删除成功!");
- }).catch(function (err) {
- tempTip.setDuration(4000);
- tempTip.show("网络错误:"+err);
- });
- },
- // 运输收费修改
- waybillChargeCheck:function (e) {
- let target = $(e.target);
- target.hide();
- let input = target.next();
- input.show();
- input.focus();
- },
- // 运输收费失焦事件
- updateWaybillCharge:function (e) {
- let target = $(e.target);
- let _this = this;
- let span = target.prev();
- let id = target.attr('data_id');
- let oldCharge = span.text();
- let charge = target.val();
- if(charge !== span.text()){
- let ajaxUrl= '{{url("apiLocal/waybill/changeCharge")}}';
- axios.post(ajaxUrl,{'id':id,'charge':charge}).then(function (response) {
- if(response.data.success){
- _this.updateWaybill(id,charge);
- tempTip.setDuration(2000);
- tempTip.showSuccess('运输收费修改成功');
- }else{
- tempTip.setDuration(3000);
- tempTip.show('运输收费修改失败!'+response.data.fail_info);
- _this.updateWaybill(id,oldCharge);
- }
- }).catch(function (err) {
- tempTip.setDuration(3000);
- tempTip.show('运输收费修改失败!网络异常:'+err);
- _this.updateWaybill(id,oldCharge);
- });
- }
- span.show();
- target.hide();
- },
- // 为运单添加运输收费
- addWaybillCharge(e){
- let target = $(e.target);
- target.css('width','85px');
- let _this = this;
- let id = target.attr('data_id');
- let charge = target.val();
- let ajaxUrl= '{{url("apiLocal/waybill/changeCharge")}}';
- if(charge === ''|| charge === null){
- target.css('width','75px');
- return;
- }else{
- axios.post(ajaxUrl,{'id':id,'charge':charge}).then(function (response) {
- if(response.data.success){
- tempTip.setDuration(2000);
- tempTip.showSuccess('运输收费添加成功');
- _this.updateWaybill(id,charge);
- }else{
- tempTip.setDuration(3000);
- tempTip.show('运输收费添加失败!'+response.data.fail_info);
- }
- }).catch(function (err) {
- tempTip.setDuration(3000);
- tempTip.show('运输收费添加失败!网络异常:'+err);
- });
- target.css('width','75px');
- }
- },
- // 修改运输收费更新表格数据
- updateWaybill(id,newCharge){
- this.waybills.some(function(waybill){
- if(waybill.id === id){
- waybill.charge = newCharge;
- return true;
- }
- })
- },
- // 运费修改
- waybillFeeCheck:function (e) {
- let target = $(e.target);
- target.hide();
- let input = target.next();
- input.show();
- input.focus();
- },
- // 失焦事件
- updateWaybillFee:function (e) {
- let target = $(e.target);
- let _this = this;
- let span = target.prev();
- let id = target.attr('data_id');
- let oldFee = span.text();
- let fee = target.val();
- if(fee !== span.text()){
- let ajaxUrl= '{{url("apiLocal/waybill/changeFee")}}';
- axios.post(ajaxUrl,{'id':id,'fee':fee}).then(function (response) {
- if(response.data.success){
- _this.updateWaybills(id,fee);
- tempTip.setDuration(2000);
- tempTip.showSuccess('运单运费修改成功');
- }else{
- tempTip.setDuration(3000);
- tempTip.show('运单运费修改失败!'+response.data.fail_info);
- _this.updateWaybills(id,oldFee);
- }
- }).catch(function (err) {
- tempTip.setDuration(3000);
- tempTip.show('运单运费修改失败!网络异常:'+err);
- _this.updateWaybills(id,oldFee);
- });
- }
- span.show();
- target.hide();
- },
- // 为直发车运单添加运费
- addWaybillFee(e){
- let target = $(e.target);
- target.css('width','85px');
- let _this = this;
- let id = target.attr('data_id');
- let fee = target.val();
- let ajaxUrl= '{{url("apiLocal/waybill/changeFee")}}';
- if(fee === ''|| fee === null){
- target.css('width','75px');
- return;
- }else{
- axios.post(ajaxUrl,{'id':id,'fee':fee}).then(function (response) {
- if(response.data.success){
- tempTip.setDuration(2000);
- tempTip.showSuccess('运单运费添加成功');
- _this.updateWaybills(id,fee);
- }else{
- tempTip.setDuration(3000);
- tempTip.show('运单运费添加失败!'+response.data.fail_info);
- }
- }).catch(function (err) {
- tempTip.setDuration(3000);
- tempTip.show('运单运费添加失败!网络异常:'+response.data.fail_info);
- });
- target.css('width','75px');
- }
- },
- // 更新表格数据
- updateWaybills(id,newFee){
- this.waybills.some(function(waybill){
- if(waybill.id === id){
- waybill.fee = newFee;
- return true;
- }
- })
- },
- // 置顶操作
- waybillOnTop:function(e){
- let target = $(e.target);
- let id = target.attr('data_id');
- $("#onTopId").val(id);
- $('#exampleModal').modal('show');
- },
- submitOnTop:function(){
- let ajaxUrl = '{{url('waybill/ontop/top')}}';
- let remark = $("#remark").val();
- let id = $("#onTopId").val();
- if(remark === ''){
- $("#remark").focus();
- $('#remark').addClass('is-invalid');
- }else{
- axios.post(ajaxUrl,{'id':id,'detail':remark}).then(function (response) {
- if(response.data.success){
- tempTip.setDuration(3000);
- tempTip.showSuccess('置顶成功');
- $('#exampleModal').modal('hide');
- setTimeout(function(){
- window.location.reload();
- }
- ,1000);
- }else{
- tempTip.setDuration(3000);
- tempTip.show('置顶失败!'+response.fail_info);
- }
- }).catch(function (err) {
- tempTip.setDuration(3000);
- tempTip.show('置顶失败,网络连接错误!'+err);
- });
- }
- },
- changeRemark:function(){
- $('#remark').removeClass('is-invalid');
- },
- cancelOnTop:function (e) {
- let target = $(e.target);
- let id = target.attr('data_id');
- let ajaxUrl='{{url('waybill/ontop/cancel')}}';
- if(id !== null){
- axios.post(ajaxUrl,{'id':id}).then(function (response) {
- if(response.data.success){
- tempTip.setDuration(30000);
- tempTip.showSuccess('取消置顶成功');
- setTimeout(function(){
- window.location.reload();
- }
- ,1000);
- }else{
- tempTip.setDuration(3000);
- tempTip.show('取消置顶失败!'+response.fail_info);
- }
- }).catch(function (err) {
- tempTip.setDuration(3000);
- tempTip.show('取消置顶失败,网络连接错误!'+err);
- });
- }
- },
- hidetop:function(e) {
- let target = $(e.target);
- let top = target.parent().find('.top');
- let tip = target.parent().find('.toptd');
- top.hide();
- tip.tooltip('show');
- },
- showtop:function(e){
- let target = $(e.target);
- let top = target.parent().find('.top');
- let tip = target.parent().find('.toptd');
- top.show();
- tip.tooltip('hide');
- },
- refreshWaveHouseWeight(wms_bill_number) {
- let _this=this;
- let url='{{url('waybill/refreshWaveHouseWeight')}}';
- window.axios.post(url,{'wms_bill_number':wms_bill_number}).then(function (response) {
- if(response.data.success){
- _this.waybills.every(function (waybill) {
- if (waybill.wms_bill_number==wms_bill_number){
- waybill.warehouse_weight_other=response.data.warehouseWeight;
- return false;
- }
- return true;
- });
- window.tempTip.setDuration(3000);
- window.tempTip.showSuccess('刷新计重成功');
- }else{
- window.tempTip.setDuration(3000);
- window.tempTip.show('刷新计重失败!'+response.data.fail_info);
- }
- }).catch(function (err) {
- window.tempTip.setDuration(3000);
- window.tempTip.show('刷新计重失败,网络连接错误!'+err);
- });
- },
- //选择文件
- selectedFile(){
- $("#uploadImg").click();
- },
- //上传文件
- uploadFiles(event){
- let images = event.target.files;
- for(let i=0;i<images.length;i++){
- let MAX_HEIGHT = 1000;
- let image = new Image();
- image.onload = ()=>{
- let canvas = document.createElement("canvas");
- if (image.height > MAX_HEIGHT && image.height >= image.width) {
- image.width *= MAX_HEIGHT / image.height;
- image.height = MAX_HEIGHT;
- }
- if (image.width > MAX_HEIGHT && image.width > image.height) {
- image.height *= MAX_HEIGHT / image.width;
- image.width = MAX_HEIGHT;
- }
- let ctx = canvas.getContext("2d");
- ctx.clearRect(0, 0, canvas.width, canvas.height);
- canvas.width = image.width;
- canvas.height = image.height;
- ctx.drawImage(image, 0, 0, image.width, image.height);
- let src = canvas.toDataURL("image/jpeg");
- let size = src.length;
- this.images.push({
- src : src,
- name : images[i]["name"],
- size : size,
- });
- this.size += size;
- };
- image.src = window.URL.createObjectURL(images[i]);
- }
- },
- //删除图片
- delTempImg(index){
- this.$delete(this.images,index);
- },
- //上传图片
- batchUploadImages(){
- window.tempTip.setDuration(3000);
- if (this.images.length<1){
- window.tempTip.show("未选择图片");
- return;
- }
- if (this.size > 104857600){
- window.tempTip.show("上传图片超出100MB,请分开上传");
- return;
- }
- window.tempTip.postBasicRequest('{{url('waybill/batchUploadImages')}}',{images:this.images},res=>{
- let result = res.data;
- let errors = res.errors;
- if (errors.length>0)this.batchUploadError = errors;
- result.forEach(r=>{
- this.waybills.some(waybill=> {
- if (waybill.id==r.id){
- waybill.url="/storage"+r.upload_file.url;
- waybill.suffix=r.upload_file.type;
- /*setTimeout(()=> {
- this.imgs.push(document.getElementById('img_'+waybill.id));
- this.lazy();
- },1);*/
- return true;
- }
- });
- this.size = 0;
- });
- this.$forceUpdate();
- return "上传成功";
- },true);
- },
- },
- filters:{
- km:function(value){
- if(!value)return '';
- return value + ' km';
- },
- money:function(value){
- if(value.indexOf('.')>0){
- return value
- }
- return value += '.00';
- },
- filterZero:function(value){
- value=value.replace(/\.00$/,'');
- value=value.replace(/(\.[1-9])0$/,'$1');
- return value;
- },
- size:function (val) {
- if (!val)return '';
- val = Number(parseInt(val/1024));
- if (val >= 1024){
- return parseInt(val/1024)+"MB";
- }
- return val+"KB";
- },
- }
- });
- // modal 隐藏时修改 input 为空
- $("#exampleModal").on('hide.bs.modal',function(e){
- $('#remark').val('');
- });
- </script>
- @endsection
|