Sfoglia il codice sorgente

项目管理新需求与部分BUG解决

Zhouzhendong 5 anni fa
parent
commit
dba4d016e0

+ 1 - 1
app/DeliveryAppointment.php

@@ -28,7 +28,7 @@ class DeliveryAppointment extends Model
     ];
     //时段 映射date_period字段 必须有序 否则展示数据错乱
     const PERIOD=[
-        0 => "9-11",
+        0 => "09-11",
         1 => "13-17",
     ];
     //时长 映射PERIOD常量

+ 2 - 0
app/Http/Controllers/DeliveryAppointmentController.php

@@ -84,6 +84,8 @@ class DeliveryAppointmentController extends Controller
                 $total = $capacity*DeliveryAppointment::HOUR[$key];//仓库该时段产能总量
                 $used = $map[$date."-".$key] ?? 0; //已使用产能
                 $available = $total-$used; //可用产能
+                $period = explode("-",$period);
+                $period = $period[0].":00 - ".$period[1].":00";
                 if ($available < $need)$periods[] = ["time"=>$period,"index"=>$key,"isAvailable"=>false];
                 else $periods[] = ["time"=>$period,"index"=>$key,"isAvailable"=>true];
             }

+ 1 - 1
resources/views/store/deliveryAppointment/_selectDate.blade.php

@@ -1,5 +1,5 @@
 <div class="modal fade" id="modal" tabindex="-1" role="dialog" aria-hidden="true">
-    <div class="modal-dialog modal-dialog-centered modal-lg" role="document">
+    <div class="modal-dialog modal-dialog-centered modal-xl" role="document">
         <div class="modal-content">
             <div class="modal-header">
                 <div class="text-center font-weight-bold">预约时间</div>

+ 11 - 3
resources/views/store/deliveryAppointment/appointment.blade.php

@@ -31,9 +31,9 @@
                                 <label class="col-2">
                                     <div class="dropdown">
                                         <input type="text" class="form-control" v-model="car.car_name" :id="'car-'+i" @input="searchCar(car.car_name)"
-                                               data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
-                                        <div class="dropdown-menu" :aria-labelledby="'car-'+i" v-show="car.car_name && haystack.length>0">
-                                            <span class="row offset-1 text-secondary" v-for="c in haystack" @click="selectCar(c,i)">@{{ c.name }}<br></span>
+                                               data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" @click="searchInit()">
+                                        <div class="dropdown-menu" :aria-labelledby="'car-'+i" v-show="haystack.length>0">
+                                            <span class="row offset-1 text-secondary" v-for="c in haystack" @click.stop="selectCar(c,i)">@{{ c.name }}<br></span>
                                         </div>
                                     </div>
                                 </label>
@@ -142,9 +142,17 @@
                 $('#openFile').tooltip();
             },
             methods:{
+                searchInit(){
+                    let stack = [];
+                    this.cars.forEach(car=>{
+                        stack.push(car);
+                    });
+                    this.haystack = stack;
+                },
                 selectCar(car,index){
                     this.model.cars[index].car_id = car.id;
                     this.model.cars[index].car_name = car.name;
+                    this.haystack = [];
                 },
                 searchCar(name){
                     if (!name){