<md-button class="md-primary md-fab novo" ng-click="validaNew()">
	<md-icon md-font-icon="flaticon-plus"></md-icon>
</md-button>
<div class="content os">
	<h1>Ordens de Serviço</h1>
	<md-toolbar class="min"></md-toolbar>
	<md-content>
		<md-list>
			<md-list-item class="md-2-line testeResize" ng-repeat="os in listaOs | filter:procuraGeral">
				<div class="md-list-item-text" layout-gt-sm="column">
					<div layout-gt-sm="row">
						<h3 flex>
							<span>Número: </span>
							{{("000000"+os.ordem).slice(-6)}}
						</h3>
						<h3 flex>
							<span>Abertura: </span>
							{{os.dataAbertura | date:'dd/MM/yyyy HH:mm'}}
						</h3>
					</div>
					<div layout-gt-sm="row">
						<h3 flex>
							<span>Solicitante: </span>{{os.solicitante | uppercase}}
						</h3>
						<h3 flex>
							<span>Status: </span>
							<span ng-class="{statusA:os.status == 'A',statusB:os.status == 'B',statusF:os.status == 'F'}">{{os.status == 'A' ? 'Aberta' : os.status == 'B' ? 'Fechada' : 'Faturada' | uppercase}}</span>
						</h3>
					</div>
					<div layout-gt-sm="row">
						<h3>
							<span>Observação: </span>
						</h3>
						<p class="obs" flex>{{os.observacoes}}</p>
					</div>
					<div layout-gt-sm="row">
						<h3 flex>
							<span>Endereço: </span>
							{{buscarEnderecoAtendimento(os.codEndereco)}}
						</h3>
					</div>
					<md-button class="buttonPrinter" ng-init="os.exibeAtendimentos = false" ng-click="exibirAtendimentos(os)">
						<md-tooltip md-direction="top">
							Exibir detalhes
						</md-tooltip>
						<md-icon md-font-icon="flaticon-information-button"></md-icon>
					</md-button>
					<md-card ng-if="os.exibeAtendimentos">
						<md-card-header>
							<md-card-header-text>
								<span class="md-subhead">{{os.atendimentos.length > 0 ? 'Atendimentos' : 'Não existem atendimentos para essa Ordem de serviço.'}}</span>
							</md-card-header-text>
						</md-card-header>
						<md-card-content ng-repeat="a in os.atendimentos">
							<div layout-gt-sm="row">
								<h3 flex>
									<span>Técnico: </span>{{a.nomeTecnico}}</h3>
								<h3 flex>
									<span>Inicio: </span>{{a.dataInicio | date:'dd/MM/yyyy HH:mm'}}</h3>
								<h3 flex>
									<span>Término: </span>{{a.dataTermino | date:'dd/MM/yyyy HH:mm'}}</h3>
							</div>
							<div layout-gt-sm="row">
								<h3>
									<span>Observação: </span>
								</h3>
								<p flex>{{a.observacoes}}</p>
							</div>
						</md-card-content>
					</md-card>
				</div>
				<md-divider ng-if="!$last"></md-divider>
			</md-list-item>
		</md-list>
	</md-content>
</div>