foca-busqueda-cliente-modal.html
3.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<div class="modal-header py-1">
    <h5 class="modal-title">Búsqueda de Cliente</h5>
</div>
<div class="modal-body" id="modal-body">
    <div class="input-group">
        <input
            ladda="searchLoading"
            type="text"
            class="form-control form-control-sm"
            placeholder="Busqueda"
            ng-model="filters"
            ng-change="search()"
            ng-keydown="busquedaDown($event.keyCode)"
            ng-keypress="busquedaPress($event.keyCode)"
            foca-focus="selectedClientes == -1"
            ng-focus="selectedClientes = -1"
            teclado-virtual
        >
    <div class="input-group-append">
        <button
            ladda="searchLoading"
            class="btn btn-outline-secondary"
            type="button"
            ng-click="busquedaPress(13)">
            <i class="fa fa-search" aria-hidden="true"></i>
        </button>
    </div>
</div>
    <table ng-show="primerBusqueda" class="table table-striped table-sm">
        <thead>
            <tr>
                <th>Código</th>
                <th>Nombre</th>
                <th>CUIT</th>
                <th></th>
            </tr>
        </thead>
        <tbody>
            <tr ng-show="currentPageClientes.length == 0 && primerBusqueda">
                <td colspan="4">
                    No se encontraron resultados.
                </td>
            </tr>
            <tr
                class="selectable"
                ng-repeat="(key, cliente) in currentPageClientes"
                ng-click="select(cliente)">
                <td ng-bind="cliente.cod"></td>
                <td ng-bind="cliente.nom"></td>
                <td ng-bind="cliente.cuit"></td>
                <td>
                    <button
                        type="button"
                        class="btn btn-xs p-1 float-right"
                        ng-class="{
                            'btn-secondary': selectedClientes != key,
                            'btn-primary': selectedClientes == key
                        }"
                        ng-click="select(cliente)"
                        foca-focus="selectedClientes == {{key}}"
                        ng-keydown="itemCliente($event.keyCode)"
                    >
                        <i class="fa fa-arrow-right" aria-hidden="true"></i>
                    </button>
                </td>
            </tr>
        </tbody>
    </table>
    <nav ng-show="currentPageClientes.length > 0 && primerBusqueda">
        <ul class="pagination pagination-sm mb-0">
            <li class="page-item" ng-class="{'disabled': currentPage == 1}">
                <a class="page-link" href="javascript:void()" ng-click="selectPage(currentPage - 1)">
                    <span aria-hidden="true">«</span>
                    <span class="sr-only">Anterior</span>
                </a>
            </li>
            <li
                class="page-item"
                ng-repeat="pagina in paginas"
                ng-class="{'active': pagina == currentPage}"
            >
                <a
                    class="page-link"
                    href="javascript:void()"
                    ng-click="selectPage(pagina)"
                    ng-bind="pagina"
                ></a>
            </li>
            <li class="page-item" ng-class="{'disabled': currentPage == lastPage}">
                <a class="page-link" href="javascript:void()" ng-click="selectPage(currentPage + 1)">
                    <span aria-hidden="true">»</span>
                    <span class="sr-only">Siguiente</span>
                </a>
            </li>
        </ul>
    </nav>
</div>
<div class="modal-footer py-1">
    <button class="btn btn-sm btn-secondary" type="button" ng-click="cancel()">Cancelar</button>
</div>