|
|
@@ -19,13 +19,14 @@
|
|
|
<th>显示器名称</th>
|
|
|
<th>父级设备</th>
|
|
|
<th>硬件ID</th>
|
|
|
+ <th>备注</th>
|
|
|
<th>录入时间</th>
|
|
|
</tr>
|
|
|
<tr v-for="station in stations">
|
|
|
<td class="text-muted">@{{station.id}}</td>
|
|
|
<td>@{{station.name}}</td>
|
|
|
<td>@{{station.parent.name}}</td>
|
|
|
- <td>@{{station.delivery_fee}}</td>
|
|
|
+ <td>@{{station.code}}</td>
|
|
|
<td>@{{station.remark}}</td>
|
|
|
<td class="text-muted">@{{station.created_at}}</td>
|
|
|
<td>
|
|
|
@@ -36,7 +37,7 @@
|
|
|
</td>
|
|
|
</tr>
|
|
|
</table>
|
|
|
- {{$carriers->links()}}
|
|
|
+ {{$stations->links()}}
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -47,44 +48,8 @@
|
|
|
new Vue({
|
|
|
el:"#list",
|
|
|
data:{
|
|
|
- carriers:[
|
|
|
- @foreach( $carriers as $carrier )
|
|
|
- {id:'{{$carrier->id}}',name:'{{$carrier->name}}',mobile:'{{$carrier->mobile}}',
|
|
|
- delivery_fee:'{{$carrier->delivery_fee}}',
|
|
|
- remark:'{{$carrier->remark}}',created_at:'{{$carrier->created_at}}'},
|
|
|
- @endforeach
|
|
|
- ],
|
|
|
+ stations:{!! $stations??'' !!},
|
|
|
},
|
|
|
- methods:{
|
|
|
- edit:function(id){
|
|
|
- location.href = "{{url('maintenance/carrier')}}/"+id+"/edit";
|
|
|
- },
|
|
|
- destroy:function(carrier){
|
|
|
- if(!confirm('确定要删除承运商“' + carrier.name + '”吗?')){return};
|
|
|
- let data=this;
|
|
|
- let url = "{{url('maintenance/carrier')}}/"+carrier.id;
|
|
|
- axios.delete(url,{id:carrier.id})
|
|
|
- .then(function (response) {
|
|
|
- if(response.data.success){
|
|
|
- for (let i = 0; i < data.carriers.length; i++) {
|
|
|
- if (data.carriers[i].id===carrier.id){
|
|
|
- data.carriers.splice(i,1);
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- tempTip.setDuration(1000);
|
|
|
- tempTip.showSuccess('删除承运商"'+carrier.name+'"成功!')
|
|
|
- }else{
|
|
|
- tempTip.setDuration(1000);
|
|
|
- tempTip.show('删除承运商"'+carrier.name+'"失败!')
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(function (err) {
|
|
|
- tempTip.setDuration(3000);
|
|
|
- tempTip.show('删除承运商失败!'+'网络错误:' + err);
|
|
|
- });
|
|
|
- },
|
|
|
- }
|
|
|
});
|
|
|
</script>
|
|
|
@endsection
|