|
|
@@ -40,7 +40,7 @@
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<th class="tag" scope="row" scope="row">承运商</th>
|
|
|
- <td style="border-right:thick double #aaaaaa;">@{{package.logistic}}</td>
|
|
|
+ <td style="border-right:thick double #aaaaaa;">@{{package.logistic_name}}</td>
|
|
|
<th class="tag" scope="row" scope="row">快递单号</th>
|
|
|
<td>@{{package.logistic_number}}</td>
|
|
|
</tr>
|
|
|
@@ -81,7 +81,7 @@
|
|
|
{id:'',logistic_number:'',delivery_number:'',
|
|
|
weight:'',owner:'',paperBox:'',
|
|
|
measuringMachine:'',recipient:'',measuringMachine_status:'',
|
|
|
- status:'',weighed_at:'',bulk:'',logistic:''},
|
|
|
+ status:'',weighed_at:'',bulk:'',logistic_name:''},
|
|
|
measuringMachines:[
|
|
|
@foreach($measuringMachines as $measuringMachine)
|
|
|
{id:'{{$measuringMachine->id}}',name:'{{$measuringMachine->name}}',code:'{{$measuringMachine->code}}',status:'{{$measuringMachine->status}}',},
|
|
|
@@ -95,7 +95,7 @@
|
|
|
onColor:{color:'green'},
|
|
|
offColor:{color:'red'},
|
|
|
logisticAudioURL:{},
|
|
|
- initAmount:1,
|
|
|
+ currentAudioIndex:1,
|
|
|
amount:3,
|
|
|
},
|
|
|
mounted(){
|
|
|
@@ -113,11 +113,11 @@
|
|
|
Echo.channel('{{$laravelEchoPrefix}}package').listen('WeighedEvent',(e)=>{
|
|
|
let package=e.package;
|
|
|
let _this=this;
|
|
|
- let audio=document.getElementById("audio"+_this.initAmount);
|
|
|
- if (_this.initAmount==_this.amount){
|
|
|
- _this.initAmount=1;
|
|
|
+ let audio=document.getElementById("audio"+_this.currentAudioIndex);
|
|
|
+ if (_this.currentAudioIndex==_this.amount){
|
|
|
+ _this.currentAudioIndex=1;
|
|
|
}else{
|
|
|
- _this.initAmount=_this.initAmount+1;
|
|
|
+ _this.currentAudioIndex=_this.currentAudioIndex+1;
|
|
|
}
|
|
|
if (package&& package.measuringMachine_name===_this.package.measuringMachine){
|
|
|
if (package.id===_this.package.id){
|
|
|
@@ -125,31 +125,31 @@
|
|
|
_this.measuringMachinesIndex[package.measuringMachine_name].status=package.measuringMachine_status;
|
|
|
tempTip.setDuration(4000);
|
|
|
tempTip.showSuccess('暂无新数据');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ _this.updateData(_this,package);
|
|
|
+ if (_this.logisticAudioURL[package.logistic_name]){
|
|
|
+ audio.src=_this.logisticAudioURL[package.logistic_name];
|
|
|
+ audio.play();
|
|
|
}else {
|
|
|
- _this.updateData(_this,package);
|
|
|
- if (_this.logisticAudioURL[package.logistic_number]){
|
|
|
- audio.src=_this.logisticAudioURL[package.logistic_number];
|
|
|
- audio.play();
|
|
|
- }else {
|
|
|
- axios.post('/package/measureMonitor/speech',{logistic:package.logistic_name})
|
|
|
- .then(function (response) {
|
|
|
- if (response.data){
|
|
|
- _this.logisticAudioURL[_this.package.logistic_number]=response.data;
|
|
|
- audio.src=response.data;
|
|
|
- audio.play();
|
|
|
- }else {
|
|
|
- tempTip.setDuration(4000);
|
|
|
- tempTip.showSuccess('文件名不规范!');
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(function (err) {
|
|
|
+ axios.post('/package/measureMonitor/speech',{logistic:package.logistic_name})
|
|
|
+ .then(function (response) {
|
|
|
+ if (response.data){
|
|
|
+ _this.logisticAudioURL[_this.package.logistic_name]=response.data;
|
|
|
+ audio.src=response.data;
|
|
|
+ audio.play();
|
|
|
+ }else {
|
|
|
tempTip.setDuration(4000);
|
|
|
- tempTip.showSuccess('语音合成发生错误:'+err);
|
|
|
- });
|
|
|
- }
|
|
|
- tempTip.setDuration(4000);
|
|
|
- tempTip.showSuccess('刷新成功!');
|
|
|
+ tempTip.showSuccess('文件名不规范!');
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(function (err) {
|
|
|
+ tempTip.setDuration(4000);
|
|
|
+ tempTip.showSuccess('语音合成发生错误:'+err);
|
|
|
+ });
|
|
|
}
|
|
|
+ tempTip.setDuration(4000);
|
|
|
+ tempTip.showSuccess('刷新成功!');
|
|
|
}
|
|
|
});
|
|
|
/* if(this.timer){
|
|
|
@@ -183,7 +183,7 @@
|
|
|
_this.package.paperBox=package.paperBox_name;
|
|
|
_this.package.recipient=package.recipient;_this.package.status=package.status;
|
|
|
_this.package.weighed_at=package.weighed_at;_this.package.bulk=package.bulk;
|
|
|
- _this.package.logistic=package.logistic_name;
|
|
|
+ _this.package.logistic_name=package.logistic_name;
|
|
|
_this.package.measuringMachine_status=package.measuringMachine_status;
|
|
|
_this.measuringMachinesIndex[package.measuringMachine_name].status=package.measuringMachine_status;
|
|
|
}
|