Browse Source

站监视显示

LD 4 years ago
parent
commit
f9b0ef1bd5

+ 1 - 1
app/Http/Controllers/StationController.php

@@ -71,7 +71,7 @@ class StationController extends Controller
             ]);
             $station->load("stationTypeBinMonitor");
         }
-        dd(data_get($station['stationTasks_today'],'*.id'),data_get($station['stationTasks_today'],'*.batch_id'));
+//        dd(data_get($station['stationTasks_today'],'*.id'),data_get($station['stationTasks_today'],'*.batch_id'));
         return view('station.monitor.show',compact('station'));
     }
 

+ 10 - 9
resources/views/station/monitor/show.blade.php

@@ -26,7 +26,13 @@
                     <div class="col-4">
                         <div class="row">
                             <div class="col py-3 h4">
-                                <div>波次列表:</div>
+                                <div class="row">
+                                    <div class="col">选择执行波次:</div>
+                                </div>
+                                <div class="row" v-if="current_stationTaskBatch">
+                                    <div class="col font-weight-bold text-right">@{{ current_stationTaskBatch.batch.code }}</div>
+                                    <div class="col">cxdfxfsdfsd</div>
+                                </div>
                                 <div class="text-center mt-2" style="overflow: scroll;height:200px;">
                                     <div class="flex flex-column flex-wrap" v-if="stationTaskBatches">
                                         <button v-for="stationTaskBatch in stationTaskBatches"
@@ -37,13 +43,6 @@
                                 </div>
                             </div>
                         </div>
-                        <div class="row">
-                            <div class=" text-center" v-if="current_stationTaskBatch">
-                                <b class="text-center">
-                                        @{{ current_stationTaskBatch.batch.code }}
-                                </b>
-                            </div>
-                        </div>
 {{--                        <div class="row">--}}
 {{--                            <div class="col py-3 text-muted text-center">--}}
 {{--                                <img id="barcode" alt="" :data-refresh="batchCode">--}}
@@ -325,7 +324,6 @@
             mounted() {
                 this._makeMenuHiding();
                 this._listenBroadcast();
-                console.log(this.stationTaskBatches);
             },
             methods:{
                 _makeMenuHiding(){
@@ -374,10 +372,13 @@
                 stationTaskBatches(){
                     if(!this.stationTasks)return;
                     let stationTaskBatches=[];
+                    let stationTaskBatch_index=[];
                     this.stationTasks.forEach(function(stationTask){
                         if(!stationTask.station_task_batches)return;
                         stationTask.station_task_batches.forEach(function(stationTaskBatch){
+                            if(typeof(stationTaskBatch_index['_'+stationTaskBatch.batch_id])!=='undefined')return;
                             stationTaskBatches.push(stationTaskBatch)
+                            stationTaskBatch_index['_'+stationTaskBatch.batch_id]=stationTaskBatch;
                         })
                     });
                     return stationTaskBatches;