|
|
@@ -26,19 +26,61 @@
|
|
|
<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 class="row">
|
|
|
+ <div class="col">选择执行波次:</div>
|
|
|
+ </div>
|
|
|
+ <div class="row" v-if="current_stationTaskBatch">
|
|
|
+ <div class="col font-weight-bold text-center position-relative"
|
|
|
+ :style="[
|
|
|
+ {opacity:
|
|
|
+ current_stationTaskBatch.status==='完成'?'0.5':'1'
|
|
|
+ },
|
|
|
+ ]"
|
|
|
+ :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':'',
|
|
|
+ ]"
|
|
|
+ >
|
|
|
+ <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>
|
|
|
- </b>
|
|
|
+ </div>
|
|
|
+ <div class="col">
|
|
|
+ <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>
|
|
|
+ </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"
|
|
|
+ @click="current_stationTaskBatch=stationTaskBatch"
|
|
|
+ class="btn"
|
|
|
+ :class="[
|
|
|
+ (current_stationTaskBatch&¤t_stationTaskBatch.id===stationTaskBatch.id)?'btn-outline-info':'btn-outline-dark',
|
|
|
+ ]"
|
|
|
+ :style="[
|
|
|
+ {opacity:
|
|
|
+ stationTaskBatch.status==='完成'?'0.5':'1'
|
|
|
+ },
|
|
|
+ ]"
|
|
|
+ >
|
|
|
+ @{{stationTaskBatch.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>
|
|
|
</div>
|
|
|
<div class="row">
|
|
|
@@ -157,7 +199,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 +338,7 @@
|
|
|
text:'',
|
|
|
}
|
|
|
},
|
|
|
+ current_stationTaskBatch: null,
|
|
|
grids:{
|
|
|
single:{status:'',},
|
|
|
half:{
|
|
|
@@ -351,24 +394,57 @@
|
|
|
this.inputs.manuallyTakeBox.text='';
|
|
|
})
|
|
|
},
|
|
|
+ runTheTaskBatch(stationTaskBatch){
|
|
|
+ stationTaskBatch.runningStatus='请求中'
|
|
|
+ axios.post('{{url('/api/thirdPart/haiq/runTaskBatch')}}',{station_task_batch_id:stationTaskBatch.id})
|
|
|
+ .then(function(response){
|
|
|
+ if(!response.data.success){
|
|
|
+ stationTaskBatch.runningStatus='请求失败';
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ stationTaskBatch.runningStatus='请求成功'
|
|
|
+ }).catch(function(err){
|
|
|
+ stationTaskBatch.runningStatus='请求异常'
|
|
|
+ tempTip.okWindow(err,'确定')
|
|
|
+ })
|
|
|
+ },
|
|
|
},
|
|
|
computed:{
|
|
|
task(){
|
|
|
if(!this.station['current_station_task'])return null;
|
|
|
return this.station['current_station_task'];
|
|
|
},
|
|
|
+ stationTasks(){
|
|
|
+ if(!this.station)return;
|
|
|
+ return this.station.station_tasks_today;
|
|
|
+ },
|
|
|
+ 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'){
|
|
|
+ // if(stationTaskBatch_index['_'+stationTaskBatch.batch_id]['status']==='完成')return;
|
|
|
+ stationTaskBatches.push(stationTaskBatch)
|
|
|
+ }
|
|
|
+ stationTaskBatch_index['_'+stationTaskBatch.batch_id]=stationTaskBatch;
|
|
|
+ })
|
|
|
+ });
|
|
|
+ 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 [];
|
|
|
@@ -556,6 +632,12 @@
|
|
|
}
|
|
|
|
|
|
},
|
|
|
+ },
|
|
|
+ filters:{
|
|
|
+ simplifyBatchCode(val){
|
|
|
+ if(!val){return ''}
|
|
|
+ return val.replace(/W\d{6}0*/,'').trim()
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
</script>
|