|
|
@@ -23,7 +23,7 @@
|
|
|
<span class="text-muted align-items-center d-flex">根据条件过滤:</span>
|
|
|
</div>
|
|
|
</td>
|
|
|
- <td style="min-width: 300px">
|
|
|
+ <td>
|
|
|
<div class="form-inline pl-3" style="height: 100px">
|
|
|
<div class="align-items-center">
|
|
|
<div class="text-right">货主:</div>
|
|
|
@@ -35,16 +35,16 @@
|
|
|
</div>
|
|
|
|
|
|
|
|
|
- <div style="max-height: 90px; overflow-y: scroll;border: solid 1px #ddd;border-radius:5px;text-align: center;transform:scale(0.9)" v-if="ownersCopy.length>0">
|
|
|
+ <div style="max-height: 90px; overflow-y: scroll;border: solid 1px #ddd;border-radius:5px;opacity:0.5;text-align: center;transform:scale(0.9)" v-if="ownersCopy.length>0">
|
|
|
<ul class="list-group tooltipTarget" id="seek" onselectstart="return false;">
|
|
|
- <li title="单击添加货主" v-for="ownerCopy in ownersCopy" :id="ownerCopy.name" class="text-muted list-group-item list-group-item-action pt-0 pb-0"
|
|
|
- @click="selectedOwner(ownerCopy)" :class="ownerCopy.style ? 'active' :''"><span style="cursor: default;" :name="ownerCopy.name">@{{ ownerCopy.name }}</span></li>
|
|
|
+ <li title="单击添加货主" v-for="ownerCopy in ownersCopy" :id="ownerCopy.name" class="list-group-item list-group-item-action pt-0 pb-0"
|
|
|
+ @click="selectedOwner(ownerCopy)" :class="ownerCopy.style ? 'active' :''"><span style="cursor: default;" :id="ownerCopy.name">@{{ ownerCopy.name }}</span></li>
|
|
|
</ul>
|
|
|
<input hidden name="owner_id" :value="selectedOwners">
|
|
|
</div>
|
|
|
</div>
|
|
|
</td>
|
|
|
- <td style="min-width: 300px">
|
|
|
+ <td >
|
|
|
<div class="form-inline pl-3" style="height: 100px">
|
|
|
<div class="align-items-center">
|
|
|
<div class="text-right">物流公司:</div>
|
|
|
@@ -54,25 +54,40 @@
|
|
|
title="输入关键词快速定位下拉列表">
|
|
|
</p>
|
|
|
</div>
|
|
|
- <div style="max-height: 90px;overflow-y: scroll;border: solid 1px #ddd;border-radius:5px;text-align: center;transform:scale(0.9)" v-if="logisticsCopy.length>0">
|
|
|
+ <div style="max-height: 90px;overflow-y: scroll;border: solid 1px #ddd;border-radius:5px;opacity:0.5;text-align: center;transform:scale(0.9)" v-if="logisticsAll.length>0">
|
|
|
<ul class="list-group tooltipTarget" onselectstart="return false;">
|
|
|
- <li title="单击添加物流公司" v-for="logisticCopy in logisticsCopy" class="text-muted list-group-item list-group-item-action pt-0 pb-0"
|
|
|
- @click="selectedLogistic(logisticCopy)" :class="logisticCopy.style ? 'active' :''" >
|
|
|
- <span style="cursor: default;" :name="logisticCopy.name">@{{ logisticCopy.name }}</span></li>
|
|
|
+ <li title="单击添加物流公司" v-for="logistic in logisticsAll" class=" list-group-item list-group-item-action pt-0 pb-0"
|
|
|
+ @click="selectedLogistic(logistic)" :class="logistic.style ? 'active' :''" >
|
|
|
+ <span style="cursor: default;" :id="logistic.name">@{{ logistic.name }}</span></li>
|
|
|
</ul>
|
|
|
<input hidden name="logistic_id" :value="selectedLogistics">
|
|
|
</div>
|
|
|
</div>
|
|
|
</td>
|
|
|
<td >
|
|
|
- <div class="form-inline" style="height: 100px;width: 350px">
|
|
|
- <div class=" align-items-center d-flex">
|
|
|
+
|
|
|
+ <div style="height: 100px">
|
|
|
+ <div class="form-inline ">
|
|
|
<label >时间:</label>
|
|
|
- <input style="width: 150px" name="date_start" type="date" v-model="filterData.date_start" class="form-control-sm">
|
|
|
- <input style="width: 150px" name="date_end" type="date" v-model="filterData.date_end" class="form-control-sm">
|
|
|
+ <div class="pl-1" style="width: 300px">
|
|
|
+ <input style="width: 170px;transform:scale(0.8)" type="date" v-model="filterData.date_start" class="form-control">
|
|
|
+ <input id="hour_input" type="text" class="form-control" placeholder="00:00"
|
|
|
+ @input="hourFilter($event)" v-model="inputtingAdd_start" style="transform:scale(0.8);width: 80px"
|
|
|
+ @keypress="hourFilter($event)" >
|
|
|
+ </div>
|
|
|
+ <input v-if="filterData.date_start" hidden name="date_start" :value="filterData.date_start+' '+inputtingAdd_start">
|
|
|
</div>
|
|
|
+ <div class="form-inline pl-5" style="width: 300px">
|
|
|
+ <input style="transform:scale(0.8);width: 170px" type="date" v-model="filterData.date_end" class="form-control" >
|
|
|
+ <input id="hour_input" type="text" class="form-control" placeholder="00:00"
|
|
|
+ @input="hourFilter($event)" v-model="inputtingAdd_end" style="transform:scale(0.8);width:80px"
|
|
|
+ @keypress="hourFilter($event)" >
|
|
|
+ <input v-if="filterData.date_end" hidden name="date_end" :value="filterData.date_end+' '+inputtingAdd_end">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class=" align-items-center d-flex pt-2">
|
|
|
<div class="m-auto d-flex">
|
|
|
- <button class="btn btn-primary pl-5 pr-5">提交</button>
|
|
|
+ <button class="btn btn-primary btn-sm pl-5 pr-5">提交</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</td>
|
|
|
@@ -80,22 +95,48 @@
|
|
|
|
|
|
</td>
|
|
|
</tr>
|
|
|
+ <tr></tr>
|
|
|
+ <tr>
|
|
|
+ <td>
|
|
|
+ <div>
|
|
|
+ <span class="text-muted">操作选定记录:</span>
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ <td colspan="3">
|
|
|
+ <span class="dropdown">
|
|
|
+ <button class="btn btn-outline-dark btn-sm form-control-sm dropdown-toggle tooltipTarget" {{--:class="[rejectedBills_checkBoxes.length>0?'btn-dark text-light':'']"--}}
|
|
|
+ data-toggle="dropdown" title="导出所有页将会以搜索条件得到的过滤结果,将其全部记录(每一页)导出">
|
|
|
+ 导出Excel
|
|
|
+ </button>
|
|
|
+ <div class="dropdown-menu">
|
|
|
+ <a class="dropdown-item" @click="statisticExport(1)" href="javascript:">导出勾选内容</a>
|
|
|
+ <a class="dropdown-item" @click="statisticExport(2)" href="javascript:">导出所有页</a>
|
|
|
+ </div>
|
|
|
+ </span>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
</table>
|
|
|
</form>
|
|
|
</div>
|
|
|
<div class="">
|
|
|
<table class="table table-striped table-sm text-nowrap table-hover">
|
|
|
<tr>
|
|
|
- <th>序号</th>
|
|
|
+ <th>
|
|
|
+ <label for="all">
|
|
|
+ <input id="all" type="checkbox" @click="checkAll($event)">全选
|
|
|
+ </label>
|
|
|
+ </th>
|
|
|
<th>货主</th>
|
|
|
<th>总计</th>
|
|
|
- <th v-for="logisticCopy in logisticsCopy">@{{ logisticCopy.name }}</th>
|
|
|
+ <th v-for="logistic in logisticsAll">@{{ logistic.name }}</th>
|
|
|
</tr>
|
|
|
- <tr v-for="(ownerModel,i) in ownersModel">
|
|
|
- <th class="text-muted">@{{ i+1 }}</th>
|
|
|
+ <tr v-for="ownerModel in ownersModel">
|
|
|
+ <td>
|
|
|
+ <input class="checkItem" type="checkbox" :value="ownerModel.id" v-model="checkData">
|
|
|
+ </td>
|
|
|
<th class="text-muted">@{{ ownerModel.name }}</th>
|
|
|
<td><p v-if="ownerModel.sum">@{{ ownerModel.sum }}</p><p v-else>0</p></td>
|
|
|
- <td class="text-muted" v-for="logisticCopy in logisticsCopy"><p v-if="ownerModel.logistics[logisticCopy.name]">@{{ ownerModel.logistics[logisticCopy.name] }}</p>
|
|
|
+ <td class="text-muted" v-for="logistic in logisticsAll"><p v-if="ownerModel.logistics[logistic.id]">@{{ ownerModel.logistics[logistic.id] }}</p>
|
|
|
<p v-else>0</p></td>
|
|
|
</tr>
|
|
|
</table>
|
|
|
@@ -129,6 +170,11 @@
|
|
|
'{{$logistic->id}}' : "{{$logistic->name}}",
|
|
|
@endforeach
|
|
|
},
|
|
|
+ logisticsAll:[
|
|
|
+ @foreach($logistics as $logistic)
|
|
|
+ {id:'{{$logistic->id}}', name: '{{$logistic->name}}',style:false},
|
|
|
+ @endforeach
|
|
|
+ ],
|
|
|
ownersCopy:[
|
|
|
@foreach($owners as $owner)
|
|
|
{id:'{{$owner->id}}',name:"{{$owner->name}}",style:false},
|
|
|
@@ -140,6 +186,10 @@
|
|
|
{date_start:'',date_end:''},
|
|
|
selectedOwners:[],
|
|
|
selectedLogistics:[],
|
|
|
+ checkData:[],
|
|
|
+ checkSign:'',
|
|
|
+ inputtingAdd_start:'',
|
|
|
+ inputtingAdd_end:'',
|
|
|
},
|
|
|
computed:{
|
|
|
isBeingFilterConditions:function(){
|
|
|
@@ -155,31 +205,32 @@
|
|
|
},
|
|
|
|
|
|
},
|
|
|
+ watch:{
|
|
|
+ checkData:{
|
|
|
+ handler(){
|
|
|
+ if (this.checkData.length === this.ownersModel.length){
|
|
|
+ document.querySelector('#all').checked = true;
|
|
|
+ }else {
|
|
|
+ document.querySelector('#all').checked = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ deep:true
|
|
|
+ }
|
|
|
+ },
|
|
|
mounted:function(){
|
|
|
let _this=this;
|
|
|
let owners=this.owners;
|
|
|
- let logistics=this.logistics;
|
|
|
+
|
|
|
this.packages.forEach(function (package){
|
|
|
if (owners[package.owner_id]){
|
|
|
package.owner_name=owners[package.owner_id];
|
|
|
}
|
|
|
- if (logistics[package.logistic_id]){
|
|
|
- package.logistic_name=logistics[package.logistic_id];
|
|
|
- let isLogistic=_this.logisticsCopy.every(function (logisticCopy) {
|
|
|
- if (logisticCopy.name==logistics[package.logistic_id]){
|
|
|
- return false;
|
|
|
- }
|
|
|
- return true;
|
|
|
- });
|
|
|
- if (isLogistic){
|
|
|
- _this.logisticsCopy.push({'id':package.logistic_id,'name':package.logistic_name,'style':false});
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
let isEvery=true;
|
|
|
if (_this.ownersModel) {
|
|
|
isEvery=_this.ownersModel.every(function (ownerModel) {
|
|
|
if (ownerModel.name==package.owner_name){
|
|
|
- ownerModel.logistics[package.logistic_name]=package.count;
|
|
|
+ ownerModel.logistics[package.logistic_id]=package.count;
|
|
|
ownerModel.sum=parseInt(ownerModel.sum)+parseInt(package.count);
|
|
|
return false;
|
|
|
}
|
|
|
@@ -188,7 +239,13 @@
|
|
|
}
|
|
|
if (isEvery){
|
|
|
let obj={};
|
|
|
- obj[package.logistic_name]=package.count;
|
|
|
+ _this.logisticsAll.every(function (logistic) {
|
|
|
+ if (logistic.id==package.logistic_id) {
|
|
|
+ obj[package.logistic_id]=package.count;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ });
|
|
|
_this.ownersModel.push({'id':package.owner_id,'name':package.owner_name,'sum':package.count,'logistics':obj,});
|
|
|
}
|
|
|
});
|
|
|
@@ -202,7 +259,7 @@
|
|
|
let uriParts =decodeURI(location.href).split("?");
|
|
|
if(uriParts.length>1){
|
|
|
let params = uriParts[1].split('&');
|
|
|
- params.forEach(function(paramPair){
|
|
|
+ params.every(function(paramPair){
|
|
|
let pair=paramPair.split('=');
|
|
|
let key = pair[0], val = pair[1];
|
|
|
$('input[name="'+key+'"]').val(val);
|
|
|
@@ -210,10 +267,10 @@
|
|
|
if (key!='owner_id'||key!='logistic_id') {
|
|
|
decodeURI(data.filterData[key]=val);
|
|
|
}
|
|
|
+ let str=unescape(val);
|
|
|
+ let strs=new Array();
|
|
|
+ strs=str.split(",");
|
|
|
if (key=='owner_id'){
|
|
|
- let str=unescape(val);
|
|
|
- let strs=new Array();
|
|
|
- strs=str.split(",");
|
|
|
for (let i=0;i<strs.length;i++){
|
|
|
data.selectedOwners.push(strs[i]);
|
|
|
data.ownersCopy.every(function (ownerCopy) {
|
|
|
@@ -226,20 +283,30 @@
|
|
|
}
|
|
|
}
|
|
|
if (key=='logistic_id'){
|
|
|
- let str=unescape(val);
|
|
|
- let strs=new Array();
|
|
|
- strs=str.split(",");
|
|
|
for (let i=0;i<strs.length;i++){
|
|
|
data.selectedLogistics.push(strs[i]);
|
|
|
- data.logisticsCopy.every(function (logisticCopy) {
|
|
|
- if (strs[i]==logisticCopy.id){
|
|
|
- logisticCopy.style=true;
|
|
|
+ data.logisticsAll.every(function (logistic) {
|
|
|
+ if (strs[i]==logistic.id){
|
|
|
+ logistic.style=true;
|
|
|
return false;
|
|
|
}
|
|
|
return true;
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
+ if (key=='date_start'){
|
|
|
+ strs=str.split("+");
|
|
|
+ if (strs.length!=2) return;
|
|
|
+ data.filterData.date_start=strs[0];
|
|
|
+ data.inputtingAdd_start=strs[1];
|
|
|
+ }
|
|
|
+ if (key=='date_end'){
|
|
|
+ strs=str.split("+");
|
|
|
+ if (strs.length!=2) return;
|
|
|
+ data.filterData.date_end=strs[0];
|
|
|
+ data.inputtingAdd_end=strs[1];
|
|
|
+ }
|
|
|
+ return true;
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
@@ -255,19 +322,22 @@
|
|
|
}
|
|
|
@endforeach
|
|
|
}
|
|
|
+ $(e.target).focus();
|
|
|
},
|
|
|
logistic_seek:function(e){
|
|
|
let _this=this;
|
|
|
let $val=e.target.value;
|
|
|
- if($val==='')_this.filterData.logistic_id='';
|
|
|
- else{
|
|
|
- @foreach($logistics as $logistic)
|
|
|
- if ("{{ $logistic->name }}".includes($val)){
|
|
|
- _this.filterData.logistic_id="{{ $logistic->id }}";
|
|
|
- location.href="#{{$logistic->name}}";
|
|
|
- }
|
|
|
- @endforeach
|
|
|
+ if($val){
|
|
|
+ _this.logisticsAll.every(function (logistic) {
|
|
|
+ let name=logistic.name;
|
|
|
+ if (name.includes($val)){
|
|
|
+ location.href="#"+logistic.name;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ });
|
|
|
}
|
|
|
+ $(e.target).focus();
|
|
|
},
|
|
|
selectedOwner:function (e) {
|
|
|
let selectedOwners=this.selectedOwners;
|
|
|
@@ -303,9 +373,9 @@
|
|
|
for (let i=0;i<selectedLogistics.length;i++){
|
|
|
if (selectedLogistics[i]==e.id){
|
|
|
selectedLogistics.splice(i,1);
|
|
|
- this.logisticsCopy.every(function (logisticCopy) {
|
|
|
- if (logisticCopy.id==e.id) {
|
|
|
- logisticCopy.style=false;
|
|
|
+ this.logisticsAll.every(function (logistic) {
|
|
|
+ if (logistic.id==e.id) {
|
|
|
+ logistic.style=false;
|
|
|
return false;
|
|
|
}
|
|
|
return true;
|
|
|
@@ -316,16 +386,64 @@
|
|
|
}
|
|
|
if (sign) {
|
|
|
this.selectedLogistics.push(e.id);
|
|
|
- this.logisticsCopy.every(function (logisticCopy) {
|
|
|
- if (logisticCopy.id==e.id) {
|
|
|
- logisticCopy.style=true;
|
|
|
+ this.logisticsAll.every(function (logistic) {
|
|
|
+ if (logistic.id==e.id) {
|
|
|
+ logistic.style=true;
|
|
|
return false;
|
|
|
}
|
|
|
return true;
|
|
|
});
|
|
|
}
|
|
|
- }
|
|
|
- },
|
|
|
+ },
|
|
|
+ checkAll(e){
|
|
|
+ if (e.target.checked){
|
|
|
+ this.ownersModel.forEach((el,i)=>{
|
|
|
+ if (this.checkData.indexOf(el.id) == '-1'){
|
|
|
+ this.checkData.push(el.id);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }else {
|
|
|
+ this.checkData = [];
|
|
|
+ }
|
|
|
+ },
|
|
|
+ statisticExport:function (e) {
|
|
|
+ if (e==1){
|
|
|
+ location.href="{{url('package/statistics?checkSign=')}}"+this.checkData;
|
|
|
+ }else{
|
|
|
+/* let formData=new FormData();
|
|
|
+ formData.append('owner_id',this.selectedOwners);
|
|
|
+ formData.append('logistic_id',this.selectedLogistics);
|
|
|
+ formData.append('date_start',this.filterData.date_start);
|
|
|
+ formData.append('date_end',this.filterData.date_end);
|
|
|
+ formData.append('checkSign','-1');*/
|
|
|
+ location.href="{{url('package/statistics?owner_id=')}}"+this.selectedOwners+
|
|
|
+ "&logistic_id="+this.selectedLogistics+"&date_start="+this.filterData.date_start
|
|
|
+ +"&date_end="+this.filterData.date_end+"&checkSign=-1";
|
|
|
+ }
|
|
|
+ },
|
|
|
+ hourFilter:function(e){
|
|
|
+ setTimeout(function(){
|
|
|
+ e.target.value=e.target.value.replace(':',':');
|
|
|
+ e.target.value=e.target.value.replace(/[a-zA-Z]/,'');
|
|
|
+ e.target.value=e.target.value.replace(/^([\d]{1})([\s]{1})/,"$1:");
|
|
|
+ e.target.value=e.target.value.replace(/^([\d]{1})([\d]{1})([\s]{1})/,"$1$2:");
|
|
|
+ //e.target.value=e.target.value.replace(/^([3-9]{1})([\d]{1})/,"$1:$2");
|
|
|
+ e.target.value=e.target.value.replace(/^([\d]{1})([\d]{1})([\d]{1})/,"$1$2:$3");
|
|
|
+ e.target.value=e.target.value.replace(/^([\d]{1})([\d]{1})([\d]{1})([\d]{1})(.*?)/,"$1$2$3$4");
|
|
|
+ e.target.value=e.target.value.replace(/^([\d]{1})([\d]{1})([\d]{1})([\d]{1})/,"$1$2:$3$4");
|
|
|
+ e.target.value=e.target.value.replace(/^([\d]{1})([\d]{1}):([\d]{1})([\d]{1})([\s\S]{1})/,"$1$2:$3$4");
|
|
|
+ e.target.value=e.target.value.replace(/^([\d]{1})([\d]{1}):([\D]{1,99})/,"$1$2:");
|
|
|
+ e.target.value=e.target.value.replace(/^([\d]{1})([\d]{1})([\d]{1})\./,"$1:$2$3");
|
|
|
+ e.target.value=e.target.value.replace(/^([\d]{1})\.([\d]{1})([\d]{1})/,"$1:$2$3");
|
|
|
+ e.target.value=e.target.value.replace(/^([\d]{1})([\d]{2})([\S\s]{1,99})/,"$1$2:$3");
|
|
|
+ e.target.value=e.target.value.replace(/^([\d]{1}):([\d]{2})([\S\s]{1,99})/,"$1:$2");
|
|
|
+ e.target.value=e.target.value.replace(/^([\d])/,"$1");
|
|
|
+ e.target.value=e.target.value.replace(/^([3-9])([\d]{1})/,"2$2");
|
|
|
+ e.target.value=e.target.value.replace(/^([\d]{1})([4-9]{1})/,"$13");
|
|
|
+ e.target.value=e.target.value.replace(/^([\d]{1})([\d]{1}):([6-9]{1})/,"$1$2:5");
|
|
|
+ },1);
|
|
|
+ },
|
|
|
+ }
|
|
|
});
|
|
|
</script>
|
|
|
@endsection
|