UI
This commit is contained in:
48
ui/resources/views/ventas/list.blade.php
Normal file
48
ui/resources/views/ventas/list.blade.php
Normal file
@ -0,0 +1,48 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<h1 class="header">
|
||||
Ventas
|
||||
</h1>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
Proyecto
|
||||
</th>
|
||||
<th>
|
||||
Inmobiliaria
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="proyectos"></tbody>
|
||||
</table>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(() => {
|
||||
const base_url = '{{$urls->base}}/ventas/'
|
||||
$.ajax({
|
||||
url: '{{$urls->api}}/proyectos',
|
||||
method: 'get',
|
||||
dataType: 'json'
|
||||
}).then((data) => {
|
||||
const parent = $('#proyectos')
|
||||
$.each(data.proyectos, function(i, el) {
|
||||
parent.append(
|
||||
$('<tr></tr>').append(
|
||||
$('<td></td>').append(
|
||||
$('<a></a>').attr('href', base_url + el.id).html(el.descripcion)
|
||||
)
|
||||
).append(
|
||||
$('<td></td>').append(
|
||||
$('<a></a>').attr('href', base_url + el.id).html(el.inmobiliaria.abreviacion)
|
||||
)
|
||||
)
|
||||
)
|
||||
})
|
||||
})
|
||||
})
|
||||
</script>
|
||||
@endpush
|
Reference in New Issue
Block a user