|
|
@@ -44,6 +44,20 @@
|
|
|
@enderror
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
+ <div class="form-group row">
|
|
|
+ <label for="email" class="col-2 col-form-label text-right">手机号</label>
|
|
|
+ <div class="col-8">
|
|
|
+ <input type="text" class="form-control @error('phone') is-invalid @enderror"
|
|
|
+ name="phone" autocomplete="off" value="@if(old('phone')){{old('phone')}}@else{{$user->userDetail->mobile_phone}}@endif" required>
|
|
|
+ @error('phone')
|
|
|
+ <span class="invalid-feedback" role="alert">
|
|
|
+ <strong>{{ $message }}</strong>
|
|
|
+ </span>
|
|
|
+ @enderror
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
<div class="form-group row">
|
|
|
<label for="userWorkgroup" class="col-2 col-form-label text-right">工作组</label>
|
|
|
<div class="col-8">
|
|
|
@@ -107,6 +121,35 @@
|
|
|
</div>
|
|
|
</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="seekSupplier($event)" title="输入关键词快速定位"></div>
|
|
|
+ </div>
|
|
|
+ <div class="form-group row">
|
|
|
+ <label class="col-md-3"></label>
|
|
|
+ <div class="col-md-4">
|
|
|
+ <input name="supplier" hidden v-model="suppliers" >
|
|
|
+ <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="supplier.style ? '双击删除供应商' :'双击添加供应商'" v-for="supplier in suppliersFilter" :id="supplier.name" class="list-group-item list-group-item-action pt-0 pb-0"
|
|
|
+ @dblclick="selectedSupplier(supplier)" :class="supplier.style ? 'active' :''"><span style="cursor: default;" :id="supplier.name"> @{{ supplier.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="supplier in suppliersList" :id="supplier.name" class="list-group-item list-group-item-action pt-0 pb-0"
|
|
|
+ @dblclick="selectedSupplier(supplier)" ><span style="cursor: default;" > @{{ supplier.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">
|
|
|
@@ -151,6 +194,7 @@
|
|
|
@endif
|
|
|
],
|
|
|
rolesList:[],
|
|
|
+
|
|
|
logisticsAll:[
|
|
|
@foreach($logistics as $logistic)
|
|
|
{id:'{{$logistic->id}}',name:'{{$logistic->name}}',style:false},
|
|
|
@@ -171,6 +215,27 @@
|
|
|
@endforeach
|
|
|
],
|
|
|
logisticsList:[],
|
|
|
+
|
|
|
+ suppliersAll: [
|
|
|
+ @foreach($suppliers as $supplier)
|
|
|
+ {id: '{{$supplier->id}}', name: '{{$supplier->name}}', style: false},
|
|
|
+ @endforeach
|
|
|
+ ],
|
|
|
+ suppliersFilter: [
|
|
|
+ @foreach($suppliers as $supplier)
|
|
|
+ {id: '{{$supplier->id}}', name: '{{$supplier->name}}', style: false},
|
|
|
+ @endforeach
|
|
|
+ ],
|
|
|
+ suppliers: [
|
|
|
+ @if(old('supplier'))
|
|
|
+ {{ old('supplier') }}
|
|
|
+ @else
|
|
|
+ @foreach( $supplierUser as $supplier )
|
|
|
+ {{$supplier->id}},
|
|
|
+ @endforeach
|
|
|
+ @endif
|
|
|
+ ],
|
|
|
+ suppliersList: [],
|
|
|
},
|
|
|
mounted:function(){
|
|
|
$(".tooltipTarget").tooltip({'trigger':'hover'});
|
|
|
@@ -204,6 +269,21 @@
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
+ if (this.suppliers.length>0){
|
|
|
+ let suppliersAll=this.suppliersAll;
|
|
|
+ let suppliers=this.suppliers;
|
|
|
+ let suppliersList=this.suppliersList;
|
|
|
+ for (let i = 0; i < suppliers.length; i++) {
|
|
|
+ suppliersAll.every(function (supplierAll) {
|
|
|
+ if (supplierAll.id == suppliers[i]) {
|
|
|
+ supplierAll.style = true;
|
|
|
+ suppliersList.push({'id':supplierAll.id,'name':supplierAll.name});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
methods:{
|
|
|
selectedLogistic:function (e) {
|
|
|
@@ -250,6 +330,50 @@
|
|
|
$(".tooltipTarget").tooltip({'trigger':'hover'});
|
|
|
},10)
|
|
|
},
|
|
|
+ selectedSupplier:function (e) {
|
|
|
+ let suppliers=this.suppliers;
|
|
|
+ let suppliersAll=this.suppliersAll;
|
|
|
+ let suppliersList=this.suppliersList;
|
|
|
+ let isSupplier=true;
|
|
|
+ if (suppliers&&suppliersAll) {
|
|
|
+ for (let i = 0; i < suppliers.length; i++) {
|
|
|
+ if (suppliers[i] == e.id) {
|
|
|
+ suppliers.splice(i,1);
|
|
|
+ suppliersAll.every(function (supplierAll) {
|
|
|
+ if (supplierAll.id == e.id) {
|
|
|
+ supplierAll.style = false;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ });
|
|
|
+ suppliersList.every(function (supplier,i) {
|
|
|
+ if (supplier.id==e.id){
|
|
|
+ suppliersList.splice(i,1);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ });
|
|
|
+ isSupplier= false;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ isSupplier= true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (isSupplier || !suppliers){
|
|
|
+ suppliers.push(e.id);
|
|
|
+ suppliersAll.every(function (supplierAll) {
|
|
|
+ if (supplierAll.id==e.id){
|
|
|
+ supplierAll.style=true;
|
|
|
+ suppliersList.push({'id':supplierAll.id,'name':supplierAll.name});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ setTimeout(function(){
|
|
|
+ $(".tooltipTarget").tooltip({'trigger':'hover'});
|
|
|
+ },10)
|
|
|
+ },
|
|
|
seekLogistic:function (e) {
|
|
|
let $val=e.target.value;
|
|
|
let logisticsAll=this.logisticsAll;
|
|
|
@@ -279,7 +403,7 @@
|
|
|
let rolesAll=this.rolesAll;
|
|
|
let rolesList=this.rolesList;
|
|
|
let isRole=true;
|
|
|
- if (roles&&rolesAll) {
|
|
|
+ if (roles && rolesAll) {
|
|
|
for (let i = 0; i < roles.length; i++) {
|
|
|
if (roles[i] == e.id) {
|
|
|
roles.splice(i,1);
|
|
|
@@ -304,7 +428,7 @@
|
|
|
}
|
|
|
}
|
|
|
if (isRole || !roles){
|
|
|
- roles.push(e.id);
|
|
|
+ roles.push(Number(e.id));
|
|
|
rolesAll.every(function (roleAll) {
|
|
|
if (roleAll.id==e.id){
|
|
|
roleAll.style=true;
|
|
|
@@ -313,6 +437,7 @@
|
|
|
}
|
|
|
return true;
|
|
|
});
|
|
|
+ console.log(roles)
|
|
|
}
|
|
|
setTimeout(function(){
|
|
|
$(".tooltipTarget").tooltip({'trigger':'hover'});
|
|
|
@@ -342,6 +467,30 @@
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ seekSupplier:function (e) {
|
|
|
+ let $val=e.target.value;
|
|
|
+ let suppliersAll=this.suppliersAll;
|
|
|
+ let bool = false;
|
|
|
+ suppliersAll.every(function (supplierAll) {
|
|
|
+ let name=supplierAll.name;
|
|
|
+ if (name.includes($val)){
|
|
|
+ bool = true;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ });
|
|
|
+ if($val === '' ){
|
|
|
+ this.suppliersFilter = this.suppliersAll;
|
|
|
+ }else if(bool){
|
|
|
+ this.suppliersFilter = [];
|
|
|
+ for (let i = 0; i <suppliersAll.length ; i++) {
|
|
|
+ let supplier = suppliersAll[i];
|
|
|
+ if(supplier.name.includes($val)){
|
|
|
+ this.suppliersFilter.push(supplier);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
});
|
|
|
|