Przeglądaj źródła

运输界面错位

Zhouzhendong 4 lat temu
rodzic
commit
8feeb546ae

+ 5 - 7
app/Http/Controllers/ProcessController.php

@@ -14,7 +14,6 @@ use App\ProcessesContent;
 use App\ProcessMethod;
 use App\ProcessStatistic;
 use App\Services\OwnerService;
-use App\Services\ProcessService;
 use App\Sign;
 use App\Tutorial;
 use App\User;
@@ -22,14 +21,15 @@ use App\UserDetail;
 use App\UserDutyCheck;
 use App\UserLabor;
 use Carbon\Carbon;
-use Exception;
+use Illuminate\Contracts\Foundation\Application;
+use Illuminate\Contracts\View\Factory;
 use Illuminate\Database\Eloquent\Builder;
 use Illuminate\Http\Request;
 use Illuminate\Support\Facades\Auth;
 use Illuminate\Support\Facades\DB;
 use Illuminate\Support\Facades\Gate;
-use Illuminate\Support\Facades\Http;
 use Illuminate\Support\Facades\Validator;
+use Illuminate\View\View;
 use Oursdreams\Export\Export;
 use Ramsey\Uuid\Uuid;
 
@@ -39,11 +39,10 @@ class ProcessController extends Controller
      * Display a listing of the resource.
      * @param Request $request
      * @param OwnerService $ownerService
-     * @return void
+     * @return Application|Factory|View
      */
     public function index(Request $request,OwnerService $ownerService)
     {
-        if(!Gate::allows('二次加工管理-查询')){ return redirect(url('/'));  }
         $paginateParams = $request->input();
         $processes = app('ProcessService')->paginate($paginateParams);
         $owners=$ownerService->getIntersectPermitting();
@@ -201,9 +200,8 @@ class ProcessController extends Controller
     public function accomplish(Request $request){
         if(!Gate::allows('二次加工管理-交接完成')){ return ['success'=>false,'data'=>'您无权进行该操作!'];  }
         $process=Process::with('processDailies')->find($request->id);
-        if (!$process)return ['success'=>false];
+        if (!$process || $process->status == '交接完成')return ['success'=>false];
         $result=$this->statistic($process);
-//        if (!$result['success'])return $result;
         $process->update(['status'=>'交接完成']);
         $process->createOperatorLog('交接完成');
         $processStatistic=$result['data'];

+ 1 - 2
app/Services/ProcessService.php

@@ -62,8 +62,7 @@ class ProcessService
             'owners' => ['alias' => 'owner_id' ,'multi' => ','],
             'id' => ['multi' => ','],
         ];
-        $processes = app(QueryService::class)->query($params,$processes,$columnQueryRules,"processes");
-        return $processes;
+        return app(QueryService::class)->query($params,$processes,$columnQueryRules,"processes");
     }
 
     public function paginate(array $params){

+ 9 - 9
resources/views/transport/waybill/index.blade.php

@@ -153,15 +153,15 @@
                     <td class="td-warm"><span>@{{ waybill.order_status }}</span></td>
                     <td class="td-warm"><span>@{{waybill.end_date}}</span></td>
                     <td class="td-warm"><span>@{{waybill.waybill_number}}</span></td>
-                    @can('运输管理-运单-运单编辑')
-                        <td class="td-warm" >
-                            <span v-if="waybill.charge" class="btn-sm btn-outline-secondary btn" @click="waybillChargeCheck($event)" :data_id="waybill.id">@{{waybill.charge|money}}</span>
-                            <input v-else type="number" class="form-control form-control-sm" @blur="addWaybillCharge($event)" onfocus="$(this).css('width','85px')" :value="waybill.charge" :data_id="waybill.id" >
-                            <input type="number" class="form-control form-control-sm"  @blur="updateWaybillCharge($event)" :value="waybill.charge" :data_id="waybill.id" style="min-width:85px;display: none">
-                        </td>
-                    @else
+                    <td class="td-warm" >
+                        @can('运输管理-运单-运单编辑')
+                        <span v-if="waybill.charge" class="btn-sm btn-outline-secondary btn" @click="waybillChargeCheck($event)" :data_id="waybill.id">@{{waybill.charge|money}}</span>
+                        <input v-else type="number" class="form-control form-control-sm" @blur="addWaybillCharge($event)" onfocus="$(this).css('width','85px')" :value="waybill.charge" :data_id="waybill.id" >
+                        <input type="number" class="form-control form-control-sm"  @blur="updateWaybillCharge($event)" :value="waybill.charge" :data_id="waybill.id" style="min-width:85px;display: none">
+                        @else
                         <td class="td-warm" ><span v-if="waybill.charge">@{{waybill.charge|money}}</span></td>
-                    @endcan
+                        @endcan
+                    </td>
                     <td class="td-warm"><span>@{{waybill.other_charge}}</span></td>
                     <td class="td-warm"><span>@{{waybill.other_charge_remark}}</span></td>
                     <td class="td-warm">
@@ -842,7 +842,7 @@
                 rendingHeader(){
                     let column = [
                         {name:'operation',value: '操作', neglect: true, class:"td-operation"},
-                        {name:'onTop',value: '置顶', neglect: true, class:"td-operation"},
+                         @can('运输管理-运单-置顶'){name:'onTop',value: '置顶', neglect: true, class:"td-operation"},@endcan
                         {name:'status',value: '状态', class:"td-operation"},
                         {name:'express_face_list',value: '快递面单是否打印', class:"td-warm"},
                         {name:'index',value: '序号', neglect: true, class:"td-warm"},