|
|
@@ -29,7 +29,7 @@
|
|
|
<form method="GET" action="@if($uriType=='ZF'){{url('waybill/index/ZF')}}@elseif($uriType=='ZX'){{url('waybill/index/ZX')}}@else{{url('waybill/index')}}@endif" id="optionSubmit">
|
|
|
<table class="table table-sm table-bordered text-nowrap mb-0" style="background: #fff;">
|
|
|
<tr v-if="isBeingFilterConditions">
|
|
|
- <td colspan="4"><div class="col" style="padding:0">
|
|
|
+ <td colspan="4"><div class="col" style="padding:0;">
|
|
|
<a href="@if($uriType=='ZF'){{url('waybill/index/ZF')}}@elseif($uriType=='ZX'){{url('waybill/index/ZX')}}@else{{url('waybill/index')}}@endif"><span class="btn btn-warning text-dark">清除过滤条件</span></a>
|
|
|
</div>
|
|
|
</td>
|
|
|
@@ -48,22 +48,20 @@
|
|
|
<tr >
|
|
|
<td >
|
|
|
<div class="form-inline">
|
|
|
- <select name="owner_id" v-model="filterData.owner_id" class="form-control form-control-sm tooltipTarget " @change="setOwner" style="vertical-align: middle;max-width: 100px" :class="filterData.owner_id?'bg-warning':''">
|
|
|
- <option value="" class="text-secondary">货主 </option>
|
|
|
- <option v-for="owner in owners" :value="owner.id" class="font-weight-bold">@{{owner.name}}</option>
|
|
|
- </select>
|
|
|
- <div style="position: relative;">
|
|
|
- <button type="button" v-show="!isOwnersBtn" @click="isOwnersBtn=true;" style=" max-width: 100px" class="btn btn-sm btn-outline-dark container pull-left">多货主查询</button>
|
|
|
- <button type="button" v-show="isOwnersBtn" @click="isOwnersBtn=false;" style=" max-width: 100px" class="btn btn-sm btn-outline-dark container pull-left">收起货主</button>
|
|
|
- <span v-show="isOwnersBtn" class="border" style="position: absolute;left:0;top:30px;width:80px;max-height:100px;overflow:auto;background-color: white">
|
|
|
- <ul style="list-style-type:none" class="pl-0">
|
|
|
+ <select name="owner_id" v-model="filterData.owner_id" class="form-control form-control-sm tooltipTarget " @change="setOwner" style="vertical-align: middle;max-width: 100px" :class="filterData.owner_id?'bg-warning':''">
|
|
|
+ <option value="" class="text-secondary">货主 </option>
|
|
|
+ <option v-for="owner in owners" :value="owner.id" class="font-weight-bold">@{{owner.name}}</option>
|
|
|
+ </select>
|
|
|
+ <div style="position: relative;" @mouseover="isOut=true;mouseleaveOwner();" @mouseleave="isOut=false;mouseleaveOwner();">
|
|
|
+ <input type="text" title="多选货主时双击选中" class="form-control form-control-sm tooltipTarget" @input="owner_seek($event)" placeholder="定位货主" @blur="isBlur=false;blurOwner();" @focus="isOwnersBtn=true;isBlur=true;">
|
|
|
+ <span v-show="isOwnersBtn" class="border" style="position: absolute;left:0;top:30px;width:150px;max-height:100px;overflow:auto;background-color: white">
|
|
|
+ <ul style="list-style-type:none" class="pl-0" >
|
|
|
<li v-for="owner in owners" style="cursor: pointer;user-select:none;" :style="{'background-color':filterData.owners['_'+owner.id]?'#4aa0e6':''}"
|
|
|
@dblclick="selectedOwner(owner.id)" class="text-left">@{{owner.name}}<hr class="m-0" style="width: 100%"></li>
|
|
|
</ul>
|
|
|
-
|
|
|
</span>
|
|
|
- <input hidden name="owners" :value="JSON.stringify(filterData.owners)">
|
|
|
- </div>
|
|
|
+ <input hidden name="owners" :value="JSON.stringify(filterData.owners)">
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</td>
|
|
|
<td >
|
|
|
@@ -119,6 +117,7 @@
|
|
|
<a class="dropdown-item" @click="waybillExport(2)" href="javascript:">导出所有页</a>
|
|
|
</div>
|
|
|
</span>
|
|
|
+ @can('运输管理-图片删除')<button type="button" @click="deleteImg()" class="btn btn-sm btn-outline-danger ml-2">删除所选图片</button>@endcan
|
|
|
</td>
|
|
|
</tr>
|
|
|
</table>
|
|
|
@@ -153,6 +152,7 @@
|
|
|
<th class="td-bill">上游单号</th>
|
|
|
<th class="td-bill">WMS订单号</th>
|
|
|
<th class="td-bill">运单号</th>
|
|
|
+ <th class="td-bill">照片</th>
|
|
|
<th class="td-transit">收件人</th>
|
|
|
<th class="td-transit">收件人电话</th>
|
|
|
<th class="td-transit">始发地</th>
|
|
|
@@ -193,7 +193,7 @@
|
|
|
@can('运输管理-运单审核')
|
|
|
<button class="btn btn-outline-primary btn-sm" @click="waybillAudit(waybill.id,waybill.waybill_number)">审核</button>
|
|
|
@endcan
|
|
|
- @can('运输管理-运单编辑')
|
|
|
+ @can('运输管理-编辑')
|
|
|
<button class="btn btn-outline-secondary btn-sm" @click="waybillUpdate(waybill.id)">修改</button>
|
|
|
@endcan
|
|
|
</span>
|
|
|
@@ -220,6 +220,16 @@
|
|
|
<td class="td-bill">@{{waybill.source_bill}}</td>
|
|
|
<td class="td-bill">@{{waybill.wms_bill_number}}</td>
|
|
|
<td class="td-bill">@{{waybill.waybill_number}}</td>
|
|
|
+ <td class="td-bill">
|
|
|
+ <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" :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-info" 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-transit">@{{waybill.recipient}}</td>
|
|
|
<td class="td-transit">@{{waybill.recipient_mobile}}</td>
|
|
|
<td class="td-transit text-muted">@{{waybill.origination}}</td>
|
|
|
@@ -258,7 +268,7 @@
|
|
|
{{-- @can('运输管理-运单审核')--}}
|
|
|
{{-- <button class="btn btn-outline-success btn-sm" @click="waybillAudit(waybill.id,waybill.waybill_number)">审核</button>--}}
|
|
|
{{-- @endcan--}}
|
|
|
- {{-- @can('运输管理-运单编辑')--}}
|
|
|
+ {{-- @can('运输管理-编辑')--}}
|
|
|
{{-- <button class="btn btn-outline-secondary btn-sm" @click="waybillUpdate(waybill.id)">修改</button>--}}
|
|
|
{{-- @endcan--}}
|
|
|
{{-- </div>--}}
|
|
|
@@ -323,7 +333,7 @@
|
|
|
waybills:[
|
|
|
@foreach($waybills as $waybill)
|
|
|
{
|
|
|
- id:'{{$waybill->id}}',created_at:'{{$waybill->created_at}}',updated_at:'{{$waybill->updated_at}}',
|
|
|
+ id:'{{$waybill->id}}',created_at:'{{$waybill->created_at}}',updated_at:'{{$waybill->updated_at}}',url:'{{$waybill->upload_file_url}}',suffix:'{{$waybill->upload_file_type}}',
|
|
|
status:'{{$waybill->status}}',type:'{{$waybill->type}}',waybill_number:'{{$waybill->waybill_number}}',
|
|
|
owner:'{{$waybill->owner_name}}',source_bill:'{{$waybill->source_bill}}',wms_bill_number:'{{$waybill->wms_bill_number}}',origination:'{{$waybill->origination}}',
|
|
|
destination:'{{$waybill->destination}}',recipient:'{{$waybill->recipient}}',recipient_mobile:'{{$waybill->recipient_mobile}}',
|
|
|
@@ -357,7 +367,10 @@
|
|
|
{!! $owner !!},
|
|
|
@endforeach
|
|
|
],
|
|
|
+ isOut:false,
|
|
|
+ isBlur:false,
|
|
|
isOwnersBtn:false,
|
|
|
+ imgs:'',
|
|
|
},
|
|
|
computed:{
|
|
|
isBeingFilterConditions:function(){
|
|
|
@@ -388,8 +401,30 @@
|
|
|
this.initInputs();
|
|
|
$(".tooltipTarget").tooltip({'trigger':'hover'});
|
|
|
$('#list').removeClass('d-none');
|
|
|
+ this.imgs=Array.from(document.getElementById('list').querySelectorAll('img'));
|
|
|
+ this.lazy();
|
|
|
+ if (this.imgs&&this.imgs.length>0){
|
|
|
+ window.addEventListener('scroll',this.lazy)
|
|
|
+ }
|
|
|
},
|
|
|
methods:{
|
|
|
+ lazy(){
|
|
|
+ //可视区域高度
|
|
|
+ let height=window.innerHeight;
|
|
|
+ //滚动区域高度
|
|
|
+ let scrollHeight = document.documentElement.scrollTop || document.body.scrollTop;
|
|
|
+ let _this=this;
|
|
|
+ this.imgs.forEach(function (img,i) {
|
|
|
+ if ((height+scrollHeight)>$('#'+img.getAttribute('id')).offset().top && img.getAttribute('data-src')){
|
|
|
+ let temp=new Image();
|
|
|
+ temp.src=img.getAttribute('data-src');
|
|
|
+ temp.onload=function () {
|
|
|
+ img.src=img.getAttribute('data-src');
|
|
|
+ _this.$delete(_this.imgs,i);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
initInputs:function(){
|
|
|
let data=this;
|
|
|
let uriParts =decodeURI(location.href).split("?");
|
|
|
@@ -444,7 +479,7 @@
|
|
|
if(!confirm('确定要驳回“'+waybill_number+'”的审核吗?')){return};
|
|
|
let _this=this;
|
|
|
let w;
|
|
|
- let url='{{url('waybill/waybillRetreatAudit')}}';
|
|
|
+ let url='{{url('files')}}';
|
|
|
axios.post(url,{id:id})
|
|
|
.then(
|
|
|
function (response) {
|
|
|
@@ -601,8 +636,111 @@
|
|
|
return;
|
|
|
}
|
|
|
this.$set(this.filterData.owners,'_'+id,id);
|
|
|
- if (this.filterData.owners.length===1)this.filterData.owner_id=id;
|
|
|
+ if (Object.keys(this.filterData.owners).length===1)this.filterData.owner_id=id;
|
|
|
else this.filterData.owner_id='';
|
|
|
+ },
|
|
|
+ owner_seek:function (e) {
|
|
|
+ let val=e.target.value;
|
|
|
+ if (this.owners.length<1)return;
|
|
|
+ let _this=this;
|
|
|
+ let ownerTemp=_this.owners[0];
|
|
|
+ this.owners.every(function (owner,i) {
|
|
|
+ if (owner.name.includes(val)){
|
|
|
+ if (i===0)return ;
|
|
|
+ _this.$set(_this.owners,0,owner);
|
|
|
+ _this.$set(_this.owners,i,ownerTemp);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ 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: relative;margin-top: 2px\">" +
|
|
|
+ " <a target='_blank' href='"+url+'-bulky.'+suffix+"'><img src=\""+url+'-common.'+suffix+"\" style=\"position: absolute;left:-50px; \" ></a>" +
|
|
|
+ " <p class='title text-center'><button class='btn btn-outline-light btn-sm'>删除</button></p>" +
|
|
|
+ " </div>");
|
|
|
+ },
|
|
|
+ removeCommonImg(id){
|
|
|
+ $('#'+id).remove();
|
|
|
+ },
|
|
|
+ deleteImg(){
|
|
|
+ if (this.checkData.length <= 0) {
|
|
|
+ tempTip.setDuration(2000);
|
|
|
+ tempTip.showSuccess('没有勾选任何记录');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!confirm('确定要删除所选图片吗?'))return;
|
|
|
+ let _this=this;
|
|
|
+ axios.post('{{url('waybill/deleteImg')}}',{ids:_this.checkData})
|
|
|
+ .then(function (response) {
|
|
|
+ if (!response.data.success){
|
|
|
+ tempTip.setDuration(4000);
|
|
|
+ tempTip.show("删除失败");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ _this.checkData.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);
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
filters:{
|