|
|
@@ -141,6 +141,36 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
+{{-- 货主分组开始--}}
|
|
|
+ <hr class="col-8 offset-2 border-info">
|
|
|
+ <div class="form-group row">
|
|
|
+ <label for="supplier" class="col-md-3 col-form-label text-md-right">货主分组</label>
|
|
|
+ <div class="col-md-7">
|
|
|
+ <input type="text" class="form-control tooltipTarget" placeholder="定位货主组"
|
|
|
+ @input="seekOwnerGroup($event)" title="输入关键词快速定位"></div>
|
|
|
+ </div>
|
|
|
+ <div class="form-group row">
|
|
|
+ <label class="col-md-3"></label>
|
|
|
+ <div class="col-md-4">
|
|
|
+ <input name="ownerGroup" hidden v-model="ownerGroups" >
|
|
|
+ <div class="input-group" style="max-height: 190px; overflow-y: scroll;border-radius:5px;opacity:0.5;text-align: center;">
|
|
|
+ <ul class="list-group tooltipTarget" style="width: 100%" onselectstart="return false;">
|
|
|
+ <li :data-original-title="ownerGroup.style ? '双击删除货主组' :'双击添加货主组'" v-for="ownerGroup in ownerGroupsFilter" :id="ownerGroup.name" class="list-group-item list-group-item-action pt-0 pb-0"
|
|
|
+ @dblclick="selectedOwnerGroup(ownerGroup)" :class="ownerGroup.style ? 'active' :''"><span style="cursor: default;" :id="ownerGroup.name"> @{{ ownerGroup.name }} </span></li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="col-md-3">
|
|
|
+ <div class="input-group" style="max-height: 190px; overflow-y: scroll;border-radius:5px;text-align: center;">
|
|
|
+ <ul class="list-group" style="width: 100%" onselectstart="return false;">
|
|
|
+ <li title="双击删除货主组" v-for="ownerGroup in ownerGroupsList" :id="ownerGroup.name" class="list-group-item list-group-item-action pt-0 pb-0"
|
|
|
+ @dblclick="selectedOwnerGroup(ownerGroup)" ><span style="cursor: default;" > @{{ ownerGroup.name }} </span></li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+{{-- 货主分组结束--}}
|
|
|
+
|
|
|
<hr class="col-8 offset-2 border-info">
|
|
|
<div class="form-group row">
|
|
|
<div class="col-8 offset-2">
|
|
|
@@ -227,6 +257,29 @@
|
|
|
@endif
|
|
|
],
|
|
|
suppliersList: [],
|
|
|
+
|
|
|
+
|
|
|
+ ownerGroupsAll: [
|
|
|
+ @foreach($ownerGroups as $ownerGroup)
|
|
|
+ {id: '{{$ownerGroup->id}}', name: '{{$ownerGroup->name}}', style: false},
|
|
|
+ @endforeach
|
|
|
+ ],
|
|
|
+ ownerGroupsFilter: [
|
|
|
+ @foreach($ownerGroups as $ownerGroup)
|
|
|
+ {id: '{{$ownerGroup->id}}', name: '{{$ownerGroup->name}}', style: false},
|
|
|
+ @endforeach
|
|
|
+ ],
|
|
|
+ ownerGroups: [
|
|
|
+ @if(old('ownerGroup'))
|
|
|
+ {{ old('ownerGroup') }}
|
|
|
+ @else
|
|
|
+ @foreach( $ownerGroup as $group )
|
|
|
+ {{$group->id??''}},
|
|
|
+ @endforeach
|
|
|
+ @endif
|
|
|
+ ],
|
|
|
+ ownerGroupsList: [],
|
|
|
+
|
|
|
},
|
|
|
mounted:function(){
|
|
|
$(".tooltipTarget").tooltip({'trigger':'hover'});
|
|
|
@@ -275,6 +328,22 @@
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ if (this.ownerGroups.length>0){
|
|
|
+ let ownerGroupsAll=this.ownerGroupsAll;
|
|
|
+ let ownerGroups=this.ownerGroups;
|
|
|
+ let ownerGroupsList=this.ownerGroupsList;
|
|
|
+ for (let i = 0; i < ownerGroups.length; i++) {
|
|
|
+ ownerGroupsAll.every(function (ownerGroupAll) {
|
|
|
+ if (ownerGroupAll.id == ownerGroups[i]) {
|
|
|
+ ownerGroupAll.style = true;
|
|
|
+ ownerGroupsList.push({'id':ownerGroupAll.id,'name':ownerGroupAll.name});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
methods:{
|
|
|
selectedLogistic:function (e) {
|
|
|
@@ -482,6 +551,75 @@
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
+ selectedOwnerGroup:function (e) {
|
|
|
+ let ownerGroups=this.ownerGroups;
|
|
|
+ let ownerGroupsAll=this.ownerGroupsAll;
|
|
|
+ let ownerGroupsList=this.ownerGroupsList;
|
|
|
+ let isOwnerGroup=true;
|
|
|
+ if (ownerGroups&&ownerGroupsAll) {
|
|
|
+ for (let i = 0; i < ownerGroups.length; i++) {
|
|
|
+ if (ownerGroups[i] == e.id) {
|
|
|
+ ownerGroups.splice(i,1);
|
|
|
+ ownerGroupsAll.every(function (ownerGroupAll) {
|
|
|
+ if (ownerGroupAll.id == e.id) {
|
|
|
+ ownerGroupAll.style = false;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ });
|
|
|
+ ownerGroupsList.every(function (ownerGroup,i) {
|
|
|
+ if (ownerGroup.id==e.id){
|
|
|
+ ownerGroupsList.splice(i,1);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ });
|
|
|
+ isOwnerGroup= false;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ isOwnerGroup= true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (isOwnerGroup || !ownerGroups){
|
|
|
+ ownerGroups.push(e.id);
|
|
|
+ ownerGroupsAll.every(function (ownerGroupAll) {
|
|
|
+ if (ownerGroupAll.id==e.id){
|
|
|
+ ownerGroupAll.style=true;
|
|
|
+ ownerGroupsList.push({'id':ownerGroupAll.id,'name':ownerGroupAll.name});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ setTimeout(function(){
|
|
|
+ $(".tooltipTarget").tooltip({'trigger':'hover'});
|
|
|
+ },10)
|
|
|
+ },
|
|
|
+ seekOwnerGroup:function (e) {
|
|
|
+ let $val=e.target.value;
|
|
|
+ let ownerGroupsAll=this.suppliersAll;
|
|
|
+ let bool = false;
|
|
|
+ ownerGroupsAll.every(function (ownerGroupAll) {
|
|
|
+ let name=ownerGroupAll.name;
|
|
|
+ if (name.includes($val)){
|
|
|
+ bool = true;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ });
|
|
|
+ if($val === '' ){
|
|
|
+ this.ownerGroupsFilter = this.ownerGroupsAll;
|
|
|
+ }else if(bool){
|
|
|
+ this.ownerGroupsFilter = [];
|
|
|
+ for (let i = 0; i <ownerGroupsAll.length ; i++) {
|
|
|
+ let ownerGroup = ownerGroupsAll[i];
|
|
|
+ if(ownerGroup.name.includes($val)){
|
|
|
+ this.ownerGroupsFilter.push(ownerGroup);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
});
|
|
|
|