Browse Source

监视器波次条码

LD 5 years ago
parent
commit
77f732401d
1 changed files with 19 additions and 18 deletions
  1. 19 18
      resources/views/station/monitor/show.blade.php

+ 19 - 18
resources/views/station/monitor/show.blade.php

@@ -37,31 +37,33 @@
                                                     },
                                                 ]"
                                          :class="[
-                                            current_stationTaskBatch.runningStatus===''?'text-info':'',
-                                            current_stationTaskBatch.runningStatus==='请求中'?'text-dark':'',
-                                            current_stationTaskBatch.runningStatus==='请求失败'?'text-danger':'',
-                                            current_stationTaskBatch.runningStatus==='请求成功'?'text-success':'',
-                                            current_stationTaskBatch.runningStatus==='请求异常'?'text-danger':'',
+                                            (current_stationTaskBatch.runningStatus==='')?'text-info':'',
+                                            (current_stationTaskBatch.runningStatus==='请求中')?'text-dark':'',
+                                            (current_stationTaskBatch.runningStatus==='请求失败')?'text-danger':'',
+                                            (current_stationTaskBatch.runningStatus==='请求成功')?'text-success':'',
+                                            (current_stationTaskBatch.runningStatus==='请求异常')?'text-danger':'',
                                          ]"
                                     >
-                                        <div class="text-center">@{{ current_stationTaskBatch.batch.code }}</div>
+                                        <div class="text-center mt-2">@{{ current_stationTaskBatch.batch.code }}</div>
                                         <div class="text-center" style="font-size: 12px;">
                                             @{{ current_stationTaskBatch.batch.owner.name }}
                                         </div>
-                                        <div class="col py-3 text-muted text-center">
-                                            <img id="barcode" alt="" :data-refresh="current_stationTaskBatch.batch.code">
-                                        </div>
                                     </div>
                                     <div class="col">
-                                        <button class="btn btn-info" @click="runTheTaskBatch(current_stationTaskBatch)">
+                                        <button class="btn btn-info btn-lg mt-4" @click="runTheTaskBatch(current_stationTaskBatch)">
                                             <span v-if="!current_stationTaskBatch.runningStatus">执行</span>
-                                            <span v-if="current_stationTaskBatch.runningStatus===请求中">请求中</span>
+                                            <span v-if="current_stationTaskBatch.runningStatus==='请求中'">请求中</span>
                                             <span v-if="current_stationTaskBatch.runningStatus==='请求失败'">(失败)重新执行</span>
                                             <span v-if="current_stationTaskBatch.runningStatus==='请求成功'">(请求成功)重新执行</span>
                                             <span v-if="current_stationTaskBatch.runningStatus==='请求异常'">(请求异常)重新执行</span>
                                         </button>
                                     </div>
                                 </div>
+                                <div class="row">
+                                    <div class="col text-muted text-left">
+                                        <img id="barcode" :alt="batchCode">
+                                    </div>
+                                </div>
                                 <div class="text-center my-2" style="overflow-y: scroll;max-height:200px;">
                                     <div class="flex flex-column flex-wrap" v-if="stationTaskBatches">
                                         <button v-for="stationTaskBatch in stationTaskBatches"
@@ -433,17 +435,16 @@
                     return stationTaskBatches;
                 },
                 batchCode(){
-                    if(!this.task)return;
-                    let batches = this.task.station_task_batches;
-                    if(batches
-                        && Array.isArray(batches)
-                        && batches.length>0
+                    let _this=this;
+                    if(!this.current_stationTaskBatch)return;
+                    if(typeof(this.current_stationTaskBatch)!=='undefined'
+                        && typeof(this.current_stationTaskBatch.batch)!=='undefined'
                     ){
                         setTimeout(function (){
-                            setBarcode(batches[0].batch.code,"#barcode",1,50,false);
+                            setBarcode(_this.current_stationTaskBatch.batch.code,"#barcode",1,50,false);
                         })
                     }
-                    return batches[0].batch.code;
+                    return this.current_stationTaskBatch.batch.code;
                 },
                 taskCommodities(){
                     if(!this.task)return [];