<div ng-controller="localCadastroController" ng-init="listarEdificios(-1)">
    <div class="modal-header">
        <h4>Mover bens de local</h4>
    </div>
    <div class="modal-body">
        <label>Origem</label>
        <div class="row">
            <div class="col-md-3">
                <input type="text" placeholder="" class="form-control" style="cursor:default"
                       popover-placement="top"
                       popover-trigger="mouseenter"
                       data-popover="Nome da Entidade"
                       ng-click=""
                       readonly="readonly" ng-model="selectedEdificio.NomeEntidade" />
            </div>
            <div class="col-md-3">
                <select class="form-control"
                        ng-model="selectedEdificio"
                        ng-change="selEdificio(selectedEdificio,-1)"
                        ng-options="e.EdificioEntidade for e in edificios">
                    <option value="">Qualquer Edifício...</option>
                </select>
            </div>
            <div class="col-md-3">
                <select class="form-control"
                        ng-model="selectedPiso"
                        ng-change="selPiso(selectedPiso,-1)"
                        ng-options="p.Descricao for p in selectedEdificio.LstPiso">
                    <option value="">Qualquer Piso...</option>
                </select>
            </div>
            <div class="col-md-3">
                <select class="form-control"
                        ng-model="selectedSala"
                        ng-change="selSala(selectedSala,-1)"
                        ng-options="s.Descricao for s in selectedPiso.LstSala">
                    <option value="">Qualquer Sala...</option>
                </select>
            </div>
        </div>
        <!--<br/>-->
        <div class="row" style="text-align:right; padding-right:20px">
            <label class="checkbox">
                <input type="checkbox" ng-model="marcarDesmarcarMover"
                       ng-click="selecionarRegistosMoverLocal(items,marcarDesmarcarMover)" /> Marcar/desmarcar
            </label>
        </div>
        
        <div class="row" style="overflow: auto; height:290px; margin:0px">
            <table class="table table-bordered table-striped">
                <tr ng-repeat="item in items"
                    class="apontar">
                    <td>{{item.NumInventario}}</td>            
                    <td>{{item.Nome}}</td>
                    <td>{{item.Localizacao}}</td>
                    <td style="width:44px">
                        <input type="checkbox" ng-model="item.selecionado"/>
                    </td>
                 </tr>
            </table>
        </div>
        <br/>
        <label>Destino</label>
        <div class="row">
            <div class="col-md-3">
                <input type="text" placeholder="" class="form-control" style="cursor:default"
                       popover-placement="top"
                       popover-trigger="mouseenter"
                       data-popover="Nome da Entidade"
                       ng-click=""
                       readonly="readonly" ng-model="selectedEdificioDestino.NomeEntidade" />
            </div>
            <div class="col-md-3">
                <select class="form-control"
                        ng-model="selectedEdificioDestino"
                        ng-change="selEdificioDestino(selectedEdificioDestino)"
                        ng-options="e.EdificioEntidade for e in edificios">
                </select>
            </div>
            <div class="col-md-3">
                <select class="form-control"
                        ng-model="selectedPisoDestino"
                        ng-change="selPisoDestino(selectedPisoDestino)"
                        ng-options="p.Descricao for p in selectedEdificioDestino.LstPiso">
                </select>
            </div>
            <div class="col-md-3">
                <select class="form-control"
                        ng-model="selectedSalaDestino"
                        ng-change="selSalaDestino(selectedSalaDestino)"
                        ng-options="s.Descricao for s in selectedPisoDestino.LstSala">
                </select>
            </div>
        </div>
    </div>

    <div class="modal-footer">
        <button class="btn btn-primary" ng-click="mudarBensDeLocal(items,selectedEdificioDestino.PK_Edificio,
                selectedPisoDestino.PK_Piso,selectedSalaDestino.PK_Sala);">Mover</button>
        <button class="btn btn-warning" ng-click="ok()">Fechar</button>
    </div>
</div>
