|
|
@@ -8,6 +8,9 @@
|
|
|
</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">
|
|
|
@@ -37,6 +40,7 @@
|
|
|
<a class="dropdown-item" @click="waybillExport(true)" href="javascript:">导出所有页</a>
|
|
|
</div>
|
|
|
</span>
|
|
|
+ <button class="btn btn-sm btn-outline-info" data-target="#batchUploadImg" data-toggle="modal">批量上传图片</button>
|
|
|
<div>
|
|
|
@if(Session::has('successTip'))
|
|
|
<div class="alert alert-success h1">{{Session::get('successTip')}}</div>
|
|
|
@@ -338,6 +342,8 @@
|
|
|
paginate : 50,
|
|
|
page : Number('{{$waybills->currentPage()}}'),
|
|
|
count : Number('{{$waybills->count()}}'),
|
|
|
+ images:[],
|
|
|
+ batchUploadError:[],
|
|
|
},
|
|
|
watch:{
|
|
|
checkData:{
|
|
|
@@ -497,10 +503,6 @@
|
|
|
tempTip.show('审核失败,网络连接错误!'+err);
|
|
|
});
|
|
|
},
|
|
|
- {{--waybillUpdate(id){--}}
|
|
|
- {{-- location.href="{{url('waybill/waybillEdit')}}/"+id;--}}
|
|
|
- {{--},--}}
|
|
|
- // 软删除
|
|
|
waybillDestroy(id,waybill_number,index){
|
|
|
if(!confirm('确定要删除运单号为:“'+waybill_number+'”的运单吗?')){return};
|
|
|
let url = '{{url('waybill')}}/'+id;
|
|
|
@@ -550,9 +552,6 @@
|
|
|
tempTip.show('审核驳回失败,网络连接错误!'+err);
|
|
|
});
|
|
|
},
|
|
|
- {{--job(id){--}}
|
|
|
- {{-- location.href="{{url('waybill')}}/"+id+"/edit";--}}
|
|
|
- {{--},--}}
|
|
|
waybillEndAudit(id,waybill_number){
|
|
|
if(!confirm('确定要通过“'+waybill_number+'”的终审吗?')){return};
|
|
|
let _this=this;
|
|
|
@@ -665,7 +664,7 @@
|
|
|
"<img src=\""+url+'-common.'+suffix+"\" style='position: relative;left:-50px;' >" +
|
|
|
"</a>" +
|
|
|
"</div>"+
|
|
|
- @can('运输管理-图片删除')"<button type='button' class='btn btn-sm btn-danger' onclick='vueList.btnDeleteImg(this)' value='"+id+"' style='position: relative;float: right;margin-right: 51px;margin-top: -30px;' >删除</button>" +@endcan
|
|
|
+ @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>");
|
|
|
},
|
|
|
@@ -787,10 +786,6 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
// 运费修改
|
|
|
waybillFeeCheck:function (e) {
|
|
|
let target = $(e.target);
|
|
|
@@ -961,7 +956,73 @@
|
|
|
tempTip.setDuration(3000);
|
|
|
tempTip.show('刷新计重失败,网络连接错误!'+err);
|
|
|
});
|
|
|
- }
|
|
|
+ },
|
|
|
+ //选择文件
|
|
|
+ selectedFile(){
|
|
|
+ $("#uploadImg").click();
|
|
|
+ },
|
|
|
+ //上传文件
|
|
|
+ uploadFiles(event){
|
|
|
+ let images = event.target.files;
|
|
|
+ for(let i=0;i<images.length;i++){
|
|
|
+ images[i]['src'] = window.URL.createObjectURL(images[i]);
|
|
|
+ this.images.push(images[i]);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //删除图片
|
|
|
+ delTempImg(index){
|
|
|
+ this.$delete(this.images,index);
|
|
|
+ },
|
|
|
+ //上传图片
|
|
|
+ batchUploadImages(){
|
|
|
+ if (this.images.length<1){
|
|
|
+ window.tempTip.setDuration(3000);
|
|
|
+ window.tempTip.show("未选择图片");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let formData = new FormData();
|
|
|
+ this.images.forEach(image=>{
|
|
|
+ formData.append("images[]",image);
|
|
|
+ });
|
|
|
+ window.tempTip.setIndex(1099);
|
|
|
+ window.tempTip.setDuration(9999);
|
|
|
+ window.tempTip.waitingTip("上传中,请稍等......");
|
|
|
+ window.axios.post('{{url('waybill/batchUploadImages')}}',formData,{
|
|
|
+ 'Content-Type':'multipart/form-data'
|
|
|
+ }).then(res=>{
|
|
|
+ if (res.data.success){
|
|
|
+ let result = res.data.data.data;
|
|
|
+ let errors = res.data.data.errors;
|
|
|
+ if (errors.length>0)this.batchUploadError = errors;
|
|
|
+ console.log(result);
|
|
|
+ result.forEach(r=>{
|
|
|
+ this.waybills.some(waybill=> {
|
|
|
+ if (waybill.id==r.id){
|
|
|
+ waybill.url=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.$forceUpdate();
|
|
|
+ window.tempTip.cancelWaitingTip();
|
|
|
+ window.tempTip.setDuration(2000);
|
|
|
+ window.tempTip.showSuccess("上传成功!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ window.tempTip.cancelWaitingTip();
|
|
|
+ window.tempTip.setDuration(3000);
|
|
|
+ window.tempTip.show(res.data.data);
|
|
|
+ }).catch(err=>{
|
|
|
+ window.tempTip.cancelWaitingTip();
|
|
|
+ window.tempTip.setDuration(3000);
|
|
|
+ window.tempTip.show('网络错误:'+err);
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
filters:{
|
|
|
km:function(value){
|
|
|
@@ -979,12 +1040,19 @@
|
|
|
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
|