Просмотр исходного кода

Merge branch 'Haozi' of ssh://was.baoshi56.com:10022/var/git/bswas

 Conflicts:
	app/Http/Controllers/TestController.php
LD 5 лет назад
Родитель
Сommit
c3b7b2df5b

+ 13 - 1
app/Http/Controllers/UserController.php

@@ -27,6 +27,7 @@ class UserController extends Controller
     public function index(Request $request)
     {
         if(!Gate::allows('用户-查询')){ return redirect(url('/'));  }
+        $owners=app("OwnerService")->getIntersectPermitting();
         $userDetailQuery = UserDetail::query()->select('user_id')->where('type','临时工');
         $query = User::with(['roles','logistics','userWorkgroups','suppliers','userDetail'])->whereNotIn('id',$userDetailQuery);
         if($request->has('user')){
@@ -38,11 +39,22 @@ class UserController extends Controller
                  $query->where('name','like',$role);
             });
         }
+        if($request->has('owner_id')){
+            $owner_id= $request->input('owner_id');
+            $owner_ids = array_filter(preg_split('/[,, ]+/is',$owner_id));
+            $ids=[];
+            foreach ($owner_ids as $id)$ids[]='_'.$id;
+            $query->whereHas('roles',function($query) use ($ids){
+                $query->whereHas('authorities',function ($query)use($ids){
+                    $query->whereIn('name',$ids);
+                });
+            });
+        }
         $users = $query->orderBy('id','desc')->paginate($request->paginate ?? 50);
         $users->each(function (User $user){
             $user['isSuperAdmin']=$user->isSuperAdmin();
         });
-        return view('maintenance.user.index',['users'=>$users]);
+        return view('maintenance.user.index',compact('users','owners'));
     }
 
     /**

+ 12 - 2
resources/views/maintenance/user/index.blade.php

@@ -64,11 +64,21 @@
             data:{
                 users:{!! $users->toJson() !!}['data'],
                 form:'',
+                owners:[
+                        @foreach($owners as $owner)
+                    {name:'{{$owner->id}}',value:'{{$owner->name}}'},
+                    @endforeach
+                ],
                 selectTr:0
             },
             mounted:function(){
-                let data = [[{name:'user',type:'input',tip:'用户名:可在两侧添加百分号(%)进行模糊搜索',placeholder:'用户名'},
-                    {name:'role',type:'input',tip:'角色名:可在两侧添加百分号(%)进行模糊搜索',placeholder:'角色名'}]];
+                let data = [
+                    [{name:'user',type:'input',tip:'用户名:可在两侧添加百分号(%)进行模糊搜索',placeholder:'用户名'},
+                    {name:'role',type:'input',tip:'角色名:可在两侧添加百分号(%)进行模糊搜索',placeholder:'角色名'},
+                        {name:'owner_id',type:'select_multiple_select',tip:['输入关键词快速定位下拉列表,回车确定','选择要显示的客户'],
+                            placeholder:['货主','定位或多选货主'],data:this.owners},
+                    ]
+                ];
                 this.form = new query({
                     el: '#form_div',
                     condition: data,

+ 4 - 4
resources/views/procurement/finance/procurementBill.blade.php

@@ -27,9 +27,9 @@
                 <td class=""><span v-if="procurement.supplier_id">@{{ procurement.deadline }}</span></td>
                 <td class=""><span v-if="procurement.signed_at">@{{ procurement.signed_at }}</span></td>
                 <td ><span v-if="procurement.owner_material.owner">@{{ procurement.owner_material.owner.name }}</span></td>
-                <td ><span v-if="procurement.owner_material.owner">@{{ procurement.owner_material.owner.customer?procurement.owner_material.owner.customer.company_name:'' }}</span></td>
+{{--                <td ><span v-if="procurement.owner_material.owner">@{{ procurement.owner_material.owner.customer?procurement.owner_material.owner.customer.company_name:'' }}</span></td>--}}
                 <td ><span v-if="procurement.supplier">@{{ procurement.supplier.name }}</span></td>
-                <td class="tooltipTarget" style="max-width: 200px;overflow:hidden" v-if="procurement.owner_material.material"><span>@{{ procurement.owner_material.material.code }}</span></td>
+                <td class="tooltipTarget" style="max-width: 200px;overflow:hidden" v-if="procurement.owner_material"><span>@{{ procurement.owner_material.material_code }}</span></td>
                 <td class="text-muted" v-if="procurement.owner_material.material"><span>@{{ procurement.owner_material.material.name }}</span></td>
                 <td class="text-muted" v-if="procurement.owner_material"><span>@{{ procurement.owner_material.size }}</span></td>
                 <td class="text-muted" v-if="procurement.owner_material"><span>@{{ procurement.owner_material.special }}</span></td>
@@ -105,7 +105,7 @@
                             name: 'supplier_id', type: 'select_multiple_select', tip: ['输入关键词快速定位下拉列表,回车确定', '选择要显示的供应商'],
                             placeholder: ['供应商', '定位或多选供应商'], data: this.suppliers
                         },
-                        {name: 'company_name', type: 'input', tip: '采购公司:可在两侧增加百分号(%)进行模糊搜索', placeholder: '采购公司'},
+                        // {name: 'company_name', type: 'input', tip: '采购公司:可在两侧增加百分号(%)进行模糊搜索', placeholder: '采购公司'},
                     ],
                 ];
                 this.form = new query({
@@ -119,7 +119,7 @@
                     {name: 'code', value: '接单日期', neglect: true,class: 'text-center'},
                     {name: 'code', value: '签收日期', neglect: true,class: 'text-center'},
                     {name: 'owner_id', value: '项目名称',class: 'text-center'},
-                    {name: 'company_name', value: '采购公司',class: 'text-center'},
+                    // {name: 'company_name', value: '采购公司',class: 'text-center'},
                     {name: 'supplier_name', value: '供应商',class: 'text-center'},
                     {name: 'material_code', value: '耗材编号',class: 'text-center'},
                     {name: 'material_name', value: '耗材',class: 'text-center'},

+ 6 - 6
resources/views/procurement/procurement/_addEnquiry.blade.php

@@ -21,12 +21,12 @@
                             </span>
                         </div>
                     </div>
-                    <div class="form-group row">
-                        <label for="customer_name" class="col-2 col-form-label text-right">客户名称</label>
-                        <div class="col-8">
-                            <input type="text" class="form-control " name="customer_name" autocomplete="off" value="{{ old('customer_name') }}" v-model="customer_name" readonly>
-                        </div>
-                    </div>
+{{--                    <div class="form-group row">--}}
+{{--                        <label for="customer_name" class="col-2 col-form-label text-right">客户名称</label>--}}
+{{--                        <div class="col-8">--}}
+{{--                            <input type="text" class="form-control " name="customer_name" autocomplete="off" value="{{ old('customer_name') }}" v-model="customer_name" readonly>--}}
+{{--                        </div>--}}
+{{--                    </div>--}}
                     <div class="form-group row">
                         <label for="owner_material_id" class="col-2 col-form-label text-right text-primary">项目耗材编号{{old('owner_material_id')}} *</label>
                         <div class="col-8">

+ 6 - 6
resources/views/procurement/procurement/_addProcurement.blade.php

@@ -21,12 +21,12 @@
                             </span>
                         </div>
                     </div>
-                    <div class="form-group row">
-                        <label for="customer_name" class="col-2 col-form-label text-right">客户名称</label>
-                        <div class="col-8">
-                           <input  id="customer_name" type="text" class="form-control " name="customer_name" autocomplete="off" value="{{ old('customer_name') }}" v-model="customer_name" readonly>
-                        </div>
-                    </div>
+{{--                    <div class="form-group row">--}}
+{{--                        <label for="customer_name" class="col-2 col-form-label text-right">客户名称</label>--}}
+{{--                        <div class="col-8">--}}
+{{--                           <input  id="customer_name" type="text" class="form-control " name="customer_name" autocomplete="off" value="{{ old('customer_name') }}" v-model="customer_name" readonly>--}}
+{{--                        </div>--}}
+{{--                    </div>--}}
                     <div class="form-group row">
                         <label for="owner_material_id" class="col-2 col-form-label text-right text-primary">项目耗材编号{{old('owner_material_id')}} *</label>
                         <div class="col-8">

+ 6 - 6
resources/views/procurement/procurement/_addProof.blade.php

@@ -21,12 +21,12 @@
                             </span>
                         </div>
                     </div>
-                    <div class="form-group row">
-                        <label for="customer_name" class="col-2 col-form-label text-right">客户名称</label>
-                        <div class="col-8">
-                            <input type="text" class="form-control " name="customer_name" autocomplete="off" value="{{ old('customer_name') }}" v-model="customer_name" readonly>
-                        </div>
-                    </div>
+{{--                    <div class="form-group row">--}}
+{{--                        <label for="customer_name" class="col-2 col-form-label text-right">客户名称</label>--}}
+{{--                        <div class="col-8">--}}
+{{--                            <input type="text" class="form-control " name="customer_name" autocomplete="off" value="{{ old('customer_name') }}" v-model="customer_name" readonly>--}}
+{{--                        </div>--}}
+{{--                    </div>--}}
                     <div class="form-group row">
                         <label for="owner_material_id" class="col-2 col-form-label text-right text-primary">项目耗材编号{{old('owner_material_id')}} *</label>
                         <div class="col-8">

+ 6 - 6
resources/views/procurement/procurement/create.blade.php

@@ -23,12 +23,12 @@
                             <p class="form-control-static text-danger small font-weight-bold" >{{ $errors->first('owner_id') }}</p>
                         </div>
                     </div>
-                    <div class="form-group row">
-                        <label for="customer_name" class="col-2 col-form-label text-right">客户名称</label>
-                        <div class="col-8">
-                            <input type="text" class="form-control " name="customer_name" autocomplete="off" value="{{ old('customer_name') }}" v-model="customer_name" readonly>
-                        </div>
-                    </div>
+{{--                    <div class="form-group row">--}}
+{{--                        <label for="customer_name" class="col-2 col-form-label text-right">客户名称</label>--}}
+{{--                        <div class="col-8">--}}
+{{--                            <input type="text" class="form-control " name="customer_name" autocomplete="off" value="{{ old('customer_name') }}" v-model="customer_name" readonly>--}}
+{{--                        </div>--}}
+{{--                    </div>--}}
                     <div class="form-group row">
                         <label for="owner_material_id" class="col-2 col-form-label text-right text-primary">项目耗材编号{{old('owner_material_id')}} *</label>
                         <div class="col-8">

+ 4 - 4
resources/views/procurement/procurement/index.blade.php

@@ -69,8 +69,8 @@
                 <td><span>@{{ procurement.code }}</span></td>
                 <td><span v-if="procurement.owner_material.owner">@{{ procurement.owner_material.owner.name }}</span></td>
                 <td>@{{ procurement_type[procurement.type] }}</td>
-                <td><span v-if="procurement.owner_material.owner">@{{ procurement.owner_material.owner.customer? procurement.owner_material.owner.customer.company_name:'' }}</span></td>
-                <td class="tooltipTarget" style="max-width: 200px;overflow:hidden"><span v-if="procurement.owner_material.material">@{{ procurement.owner_material.material.code }}</span></td>
+{{--                <td><span v-if="procurement.owner_material.owner">@{{ procurement.owner_material.owner.customer? procurement.owner_material.owner.customer.company_name:'' }}</span></td>--}}
+                <td class="tooltipTarget" style="max-width: 200px;overflow:hidden"><span v-if="procurement.owner_material">@{{ procurement.owner_material.material_code }}</span></td>
                 <td><span v-if="procurement.owner_material.material">@{{ procurement.owner_material.material.name }}</span></td>
                 <td><span v-if="procurement.owner_material">@{{ procurement.owner_material.size }}</span></td>
                 <td><span v-if="procurement.owner_material">@{{ procurement.owner_material.special }}</span></td>
@@ -192,7 +192,7 @@
                             placeholder: ['耗材', '定位或多选耗材'],
                             data: this.materials
                         },
-                        {name: 'company_name', type: 'input', tip: '采购公司:可在两侧增加百分号(%)进行模糊搜索', placeholder: '采购公司'},
+                        // {name: 'company_name', type: 'input', tip: '采购公司:可在两侧增加百分号(%)进行模糊搜索', placeholder: '采购公司'},
                     ],
                 ];
                 this.form = new query({
@@ -204,7 +204,7 @@
                     {name: 'code', value: '采购编号', neglect: true,class: 'text-center'},
                     {name: 'owner_id', value: '项目', class: 'text-center'},
                     {name: 'type', value: '单据类型', class: 'text-center'},
-                    {name: 'company_name', value: '采购公司', class: 'text-center'},
+                    // {name: 'company_name', value: '采购公司', class: 'text-center'},
                     {name: 'material_code', value: '耗材编号', class: 'text-center'},
                     {name: 'material_name', value: '耗材'},
                     {name: 'size', value: '尺寸大小', class: 'text-center'},