Sfoglia il codice sorgente

列表 签到等BUG

Zhouzhendong 4 anni fa
parent
commit
87f89f1e80

+ 5 - 3
app/Http/Controllers/DeliveryAppointmentController.php

@@ -566,7 +566,7 @@ html;
         $this->gate("入库管理-入库预约-预约管理-卸货完成");
         if (!request("id"))$this->error("非法参数");
         /** @var DeliveryAppointmentCar|\stdClass $car */
-        $car = DeliveryAppointmentCar::query()->find(request("id"));
+        $car = DeliveryAppointmentCar::query()->where("status",1)->find(request("id"));
         if (!$car || !$car->deliveryAppointment)$this->error("单据不存在");
         $car->update(["status"=>2]);
         app("DeliveryAppointmentService")->checkFull($car->delivery_appointment_id);
@@ -582,9 +582,11 @@ html;
         $this->gate("入库管理-入库预约-预约管理-签到");
         if (!request("id"))$this->error("非法参数");
         /** @var DeliveryAppointmentCar|\stdClass $car */
-        $car = DeliveryAppointmentCar::query()->find(request("id"));
+        $car = DeliveryAppointmentCar::query()->whereHas("deliveryAppointment",function (Builder $query){
+            $query->where("appointment_date",date("Y-m-d"));
+        })->find(request("id"));
         if (!$car || !$car->deliveryAppointment)$this->error("单据不存在");
-        $car->update(["status"=>1]);
+        $car->update(["status"=>1,"delivery_time"=>date("Y-m-d H:i:s")]);
         event(new DeliveryAppointmentEvent($car));
         $this->success();
     }

+ 1 - 0
app/Http/Controllers/TestController.php

@@ -143,6 +143,7 @@ class TestController extends Controller
 
     public function test1()
     {
+        ini_set('max_execution_time',-1);
         foreach (Order::query()->select("id")->where("wms_edittime",">=","2021-06-01 00:00:00")
                      ->whereNotIn("id",OwnerFeeDetail::query()->select("outer_id")
                          ->where("created_at",">=",'2021-06-01 00:00:00')

+ 2 - 2
app/Http/Controllers/WarehouseController.php

@@ -16,11 +16,11 @@ class WarehouseController extends Controller
     /**
      * Display a listing of the resource.
      *
-     * @return Response
+     * @return Response|mixed
      */
     public function index()
     {
-        if(!Gate::allows('仓库-查询')){ return redirect(url('/'));  }
+        if(!Gate::allows('仓库')){ return view("exception.authority");  }
         $warehouses=Warehouse::orderBy('id','desc')->paginate(35);
         return view('maintenance.warehouse.index',['warehouses'=>$warehouses]);
     }

+ 2 - 2
resources/views/store/deliveryAppointment/list.blade.php

@@ -69,8 +69,8 @@
                 </td>
                 <td>@{{ i+1 }}</td>
                 <td>
+                    @can("入库管理-入库预约-预约管理-签到")<span v-if="(info.status==0 || info.appointment_date==today) && info.cars[0].status==0"><button class="btn btn-sm btn-outline-success" @click="signIn(i,0)">签到</button><br></span>@endcan
                     <span v-if="info.status==0">
-                        @can("入库管理-入库预约-预约管理-签到")<button class="btn btn-sm btn-outline-success" @click="signIn(i,0)" v-if="info.status==0 && info.cars[0].status==0 && info.appointment_date==today">签到</button>@endcan<br>
                         <button type="button" @click="cancel(info.id,i)" class="btn btn-sm btn-outline-danger">取消预约</button><br>
                         <button type="button" @click="updateDeliveryDate(info,i)" class="btn btn-sm btn-outline-primary">修改预约</button>
                     </span>
@@ -447,7 +447,7 @@
                         str += code[i]+"<br>";
                     }
                     return str;
-                }
+                },
             },
             filters:{
                 getCommodity(detail){