LD 5 лет назад
Родитель
Сommit
707edd15ed
2 измененных файлов с 32 добавлено и 10 удалено
  1. 4 0
      app/Station.php
  2. 28 10
      resources/views/station/monitor/show.blade.php

+ 4 - 0
app/Station.php

@@ -27,6 +27,10 @@ class Station extends Model
         return $this->hasOne(StationTask::class)
             ->where('status','=','处理中');
     }
+    public function stationTasks(){
+        return $this->hasOne(StationTask::class)
+            ->where('status','=','处理中');
+    }
     public function stationTypeBinMonitor(){
         return $this->hasOne(StationTypeBinMonitor::class);
     }

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

@@ -26,21 +26,30 @@
                     <div class="col-4">
                         <div class="row">
                             <div class="col py-3 h4">
-                                <div>波次:</div>
-                                <div class=" text-center">
-                                    <b v-if="task&&task.station_task_batches">
-                                        <div v-for="taskBatch in task.station_task_batches">
-                                            @{{ taskBatch.batch.code }}
-                                        </div>
-                                    </b>
+                                <div>波次列表:</div>
+                                <div class="text-center mt-2" style="overflow: scroll;height:200px;">
+                                    <div class="flex flex-column flex-wrap">
+                                        <button v-for="taskBatch in task.station_task_batches"
+                                                class="btn btn-outline-dark">
+                                            @{{taskBatch.batch.code | simplifyBatchCode}}</button>
+                                    </div>
                                 </div>
                             </div>
                         </div>
                         <div class="row">
-                            <div class="col py-3 text-muted text-center">
-                                <img id="barcode" alt="" :data-refresh="batchCode">
+                            <div class=" text-center">
+                                <b v-if="task&&task.station_task_batches">
+                                    <div v-for="taskBatch in task.station_task_batches">
+                                        @{{ taskBatch.batch.code }}
+                                    </div>
+                                </b>
                             </div>
                         </div>
+{{--                        <div class="row">--}}
+{{--                            <div class="col py-3 text-muted text-center">--}}
+{{--                                <img id="barcode" alt="" :data-refresh="batchCode">--}}
+{{--                            </div>--}}
+{{--                        </div>--}}
                         <div class="row">
                             <div class="col py-3 h4">
                                 料箱号:
@@ -157,7 +166,7 @@
                                 <div class="text-left">
                                     <div >
                                         <div class="btn btn-outline-info" @click="
-                                        (inputs.manuallyTakeBox.visible=true)
+                                        (inputs.manuallyTakeBox.visible=!inputs.manuallyTakeBox.visible)
                                         &&(inputs.manuallyTakeBox.text='')">手动出库</div>
                                         <div class="position-relative bg-white" v-if="inputs.manuallyTakeBox.visible">
                                 <textarea  name="" id="" cols="30" rows="3" class="form-control" v-model="inputs.manuallyTakeBox.text"
@@ -296,6 +305,9 @@
                         text:'',
                     }
                 },
+                batch_tasks: [
+                    // {code:'',id:'',status:''},
+                ],
                 grids:{
                     single:{status:'',},
                     half:{
@@ -556,6 +568,12 @@
                     }
 
                 },
+            },
+            filters:{
+                simplifyBatchCode(val){
+                    if(!val){return ''}
+                    return val.replace(/W\d{6}0*/,'').trim()
+                }
             }
         });
     </script>