|
|
@@ -54,11 +54,11 @@
|
|
|
title="输入关键词快速定位下拉列表">
|
|
|
</p>
|
|
|
</div>
|
|
|
- <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="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=" list-group-item list-group-item-action pt-0 pb-0"
|
|
|
- @click="selectedLogistic(logisticCopy)" :class="logisticCopy.style ? 'active' :''" >
|
|
|
- <span style="cursor: default;" :id="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>
|
|
|
@@ -112,7 +112,6 @@
|
|
|
<a class="dropdown-item" @click="statisticExport(1)" href="javascript:">导出勾选内容</a>
|
|
|
<a class="dropdown-item" @click="statisticExport(2)" href="javascript:">导出所有页</a>
|
|
|
</div>
|
|
|
- <input hidden name="checkSign" v-model="checkSign">
|
|
|
</span>
|
|
|
</td>
|
|
|
</tr>
|
|
|
@@ -129,7 +128,7 @@
|
|
|
</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 in ownersModel">
|
|
|
<td>
|
|
|
@@ -137,7 +136,7 @@
|
|
|
</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>
|
|
|
@@ -171,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},
|
|
|
@@ -216,28 +220,17 @@
|
|
|
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;
|
|
|
}
|
|
|
@@ -246,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,});
|
|
|
}
|
|
|
});
|
|
|
@@ -260,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);
|
|
|
@@ -286,9 +285,9 @@
|
|
|
if (key=='logistic_id'){
|
|
|
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;
|
|
|
@@ -307,6 +306,7 @@
|
|
|
data.filterData.date_end=strs[0];
|
|
|
data.inputtingAdd_end=strs[1];
|
|
|
}
|
|
|
+ return true;
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
@@ -322,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;
|
|
|
@@ -370,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;
|
|
|
@@ -383,9 +386,9 @@
|
|
|
}
|
|
|
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;
|
|
|
@@ -407,10 +410,15 @@
|
|
|
if (e==1){
|
|
|
location.href="{{url('package/statistics?checkSign=')}}"+this.checkData;
|
|
|
}else{
|
|
|
- this.checkSign=-1;
|
|
|
- setTimeout(function(){
|
|
|
- $("#optionSubmit").submit();
|
|
|
- },50);
|
|
|
+/* 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){
|
|
|
@@ -429,7 +437,8 @@
|
|
|
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(/^([3-9])/,"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);
|