|
|
@@ -50,7 +50,15 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="col">
|
|
|
- <button class="btn btn-info btn-lg mt-4" @click="runTheTaskBatch(current_stationTaskBatch)">
|
|
|
+ <button class="btn btn-lg mt-4" @click="runTheTaskBatch()"
|
|
|
+ :class="[
|
|
|
+ (current_stationTaskBatch.runningStatus==='')?'btn-info':'',
|
|
|
+ (current_stationTaskBatch.runningStatus==='请求中')?'btn-dark':'',
|
|
|
+ (current_stationTaskBatch.runningStatus==='请求失败')?'btn-danger':'',
|
|
|
+ (current_stationTaskBatch.runningStatus==='请求成功')?'btn-success':'',
|
|
|
+ (current_stationTaskBatch.runningStatus==='请求异常')?'btn-danger':'',
|
|
|
+ ]"
|
|
|
+ >
|
|
|
<span v-if="!current_stationTaskBatch.runningStatus">执行</span>
|
|
|
<span v-if="current_stationTaskBatch.runningStatus==='请求中'">请求中</span>
|
|
|
<span v-if="current_stationTaskBatch.runningStatus==='请求失败'">(失败)重新执行</span>
|
|
|
@@ -67,7 +75,7 @@
|
|
|
<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"
|
|
|
- @click="current_stationTaskBatch=stationTaskBatch"
|
|
|
+ @click="selectBatch(stationTaskBatch)"
|
|
|
class="btn"
|
|
|
:class="[
|
|
|
(current_stationTaskBatch&¤t_stationTaskBatch.id===stationTaskBatch.id)?'btn-outline-info':'btn-outline-dark',
|
|
|
@@ -331,7 +339,7 @@
|
|
|
broadcastName : "{{config('database.redis.options.prefix').'station-'.$station->id}}",
|
|
|
channelName : ".App\\Events\\BroadcastToStation",
|
|
|
error:"",
|
|
|
- station:{!! $station??[] !!},
|
|
|
+ station:{!! $station !!},
|
|
|
inputs:{
|
|
|
manuallyTakeBox:{
|
|
|
visible:false,
|
|
|
@@ -339,6 +347,8 @@
|
|
|
}
|
|
|
},
|
|
|
current_stationTaskBatch: null,
|
|
|
+ stationTask_indexByBatch: [],
|
|
|
+ stationTaskBatch_index: [],
|
|
|
grids:{
|
|
|
single:{status:'',},
|
|
|
half:{
|
|
|
@@ -379,12 +389,17 @@
|
|
|
this.station['current_station_task']=json;
|
|
|
});
|
|
|
},
|
|
|
+ selectBatch(stationTaskBatch){
|
|
|
+ this.current_stationTaskBatch=stationTaskBatch;
|
|
|
+ if(typeof(this.current_stationTaskBatch.runningStatus)==='undefined')
|
|
|
+ this.current_stationTaskBatch.runningStatus=''
|
|
|
+ },
|
|
|
manuallyTakeBoxOut(){
|
|
|
let text = this.inputs.manuallyTakeBox.text.trim();
|
|
|
if(!text){
|
|
|
alert('请输入料箱号')
|
|
|
return
|
|
|
- };
|
|
|
+ }
|
|
|
axios.post('{{url('/api/thirdPart/haiq/storage/takeOutToULine')}}',{codes:text})
|
|
|
.then(function(response){
|
|
|
tempTip.okWindow(response.data.result,'确定')
|
|
|
@@ -394,25 +409,29 @@
|
|
|
this.inputs.manuallyTakeBox.text='';
|
|
|
})
|
|
|
},
|
|
|
- runTheTaskBatch(stationTaskBatch){
|
|
|
- stationTaskBatch.runningStatus='请求中'
|
|
|
- axios.post('{{url('/api/thirdPart/haiq/runTaskBatch')}}',{station_task_batch_id:stationTaskBatch.id})
|
|
|
+ runTheTaskBatch(){
|
|
|
+ let _this=this;
|
|
|
+ _this.current_stationTaskBatch.runningStatus='请求中';
|
|
|
+ _this.$forceUpdate();
|
|
|
+ axios.post('{{url('/api/thirdPart/haiq/runTaskBatch')}}',{station_task_batch_id:_this.current_stationTaskBatch.id})
|
|
|
.then(function(response){
|
|
|
if(!response.data.success){
|
|
|
- stationTaskBatch.runningStatus='请求失败';
|
|
|
+ _this.current_stationTaskBatch.runningStatus='请求失败';
|
|
|
return;
|
|
|
}
|
|
|
- stationTaskBatch.runningStatus='请求成功'
|
|
|
+ _this.current_stationTaskBatch.runningStatus='请求成功'
|
|
|
}).catch(function(err){
|
|
|
- stationTaskBatch.runningStatus='请求异常'
|
|
|
- tempTip.okWindow(err,'确定')
|
|
|
- })
|
|
|
+ _this.current_stationTaskBatch.runningStatus='请求异常'
|
|
|
+ tempTip.okWindow(err+': 服务器代码出错,请联系开发部门负责人','确定')
|
|
|
+ }).finally(function(){
|
|
|
+ _this.$forceUpdate();
|
|
|
+ });
|
|
|
},
|
|
|
},
|
|
|
computed:{
|
|
|
task(){
|
|
|
- if(!this.station['current_station_task'])return null;
|
|
|
- return this.station['current_station_task'];
|
|
|
+ if(!this.current_stationTaskBatch||typeof(this.current_stationTaskBatch['_'+this.current_stationTaskBatch.batch_id])==='undefined')return null;
|
|
|
+ return this.stationTask_indexByBatch['_'+this.current_stationTaskBatch.batch_id]
|
|
|
},
|
|
|
stationTasks(){
|
|
|
if(!this.station)return;
|
|
|
@@ -420,16 +439,17 @@
|
|
|
},
|
|
|
stationTaskBatches(){
|
|
|
if(!this.stationTasks)return;
|
|
|
+ let _this=this;
|
|
|
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'){
|
|
|
+ if(typeof(_this.stationTaskBatch_index['_'+stationTaskBatch.batch_id])==='undefined'){
|
|
|
// if(stationTaskBatch_index['_'+stationTaskBatch.batch_id]['status']==='完成')return;
|
|
|
stationTaskBatches.push(stationTaskBatch)
|
|
|
+ _this.stationTaskBatch_index['_'+stationTaskBatch.batch_id]=stationTaskBatch;
|
|
|
+ _this.stationTask_indexByBatch['_'+stationTaskBatch.batch_id]=stationTask;
|
|
|
}
|
|
|
- stationTaskBatch_index['_'+stationTaskBatch.batch_id]=stationTaskBatch;
|
|
|
})
|
|
|
});
|
|
|
return stationTaskBatches;
|