metadadosDocumentoEdit.html 16.1 KB
<div id="widget-documento" class="widget-box margin-bottom">
	<div class="widget-header">
		<h2 class="widget-title">
			<translate>LABEL.DOCUMENTO</translate>
		</h2>

		<div class="widget-toolbar">
			<a href="#void" ng-click="widgetDocumentoIsCollapsed = !widgetDocumentoIsCollapsed"> <i class="fa"
				ng-class="{'fa-chevron-up': !widgetDocumentoIsCollapsed, 'fa-chevron-down': widgetDocumentoIsCollapsed}"></i></a> <a href="#void" ng-click="closeWidget('widget-processo')"> <i class="fa fa-close"></i></a>
		</div>
	</div>
	<div id="metadadosDocumentoGedCollapsed" collapse="widgetDocumentoIsCollapsed" class="widget-body">
		<div class="widget-main clearfix">
			<div id="editDocumentoGed" class="page-content clearfix">

				<p>
					<small>( <span class="red">*</span> ) <translate>LABEL.CAMPOS_OBRIGATORIOS</translate></small>
				</p>

				<div class="row">
					<div class="col-md-12">
						<label ng-show='documentoGed.id != null' style="position: absolute; right: 16px"><translate>ECM.LABEL.VERSAO_ATUAL</translate> {{documentoGed.documentoVersao}}</label>
					</div>
				</div>

				<fieldset>
					<legend>
						<translate>ECM.LABEL.DADOS_DOCUMENTO</translate>
					</legend>

					<div class="row">
						<div class="col-md-6">
							<label-input-radio ng-id="documentoGed.formaCriacao.codigo" ng-label="ECM.LABEL.FORMADECRIACAO" list="formaCriacaoList" ng-disabled="!edit || documentoGed.id" text="descricao" value="codigo"
								ng-model="documentoGed.formaCriacao.codigo" form="documentoGedForm" ng-custom-change='limparCamposDocumento()'></label-input-radio>

						</div>
					</div>

					<div class="row">

						<div class="col-md-8">
							<auto-complete ng-id="documentoGed.tipoDocumento" ng-set-result="construirRelacionamento(item)" ng-label="ECM.LABEL.TIPODOCUMENTO" ng-model="documentoGed.tipoDocumento" form="documentoGedForm"
								ng-obrigatorio="true" ng-acao-borracha='limparCamposTipoProcesso()' ng-disabled="!edit ||(documentoGed.id && documentoGed.formaCriacao.codigo == 1)"
								ng-find="findAutoCompleteTipoDocumento(value)" ng-item="item.nome" />
						</div>

					</div>

					<div class="row">
						<div class="col-md-4">
							<label-input ng-id="documentoGed.numero" ng-label="LABEL.NUMERO" ng-type="numerico" ng-model="documentoGed.numero" form="documentoGedForm" ng-obrigatorio="documentoGed.formaCriacao.codigo == 2"
								ng-custom-maxlength="255" ng-type="text" ng-disabled="!edit || (documentoGed.formaCriacao.codigo == 1 && documentoGed.tipoDocumento.formaNumeracao.codigo != 2)" />
						</div>

						<div class="row" ng-show='documentoGed.formaCriacao.codigo == 2'>
							<div class="col-md-4">
								<label-input-data ng-id="documentoGed.dataReferencia" form="documentoGedForm" ng-label="ECM.LABEL.DATA_REFERENCIA" ng-obrigatorio="documentoGed.formaCriacao.codigo == 2" ng-disabled="!edit"
									ng-model="documentoGed.dataReferencia" />
							</div>
						</div>
					</div>

					<div class="row">

						<div class="col-md-4">
							<label-select ng-id="documentoGed.estado" ng-model="documentoGed.estado" ng-label="ECM.LABEL.ESTADO" ng-obrigatorio='true' form="documentoGedForm" ng-list="estadoList"
								ng-custom-options="dominioEstado.originalElement as dominioEstado.descricao for dominioEstado" track-by="track by dominioEstado.id" ng-disabled='!edit'> </label-select>
						</div>

						<div class="col-md-8">
							<auto-complete ng-id="documentoGed.destinatario" ng-label="ECM.LABEL.DESTINATARIO" ng-model="documentoGed.destinatario" form="documentoGedForm" ng-obrigatorio="true" ng-disabled="!edit"
								ng-find="findAutoCompleteDestinatario(value);" ng-item="item.nome" />
						</div>

					</div>

					<div class="row">
						<div class="col-md-12" ng-show='documentoGed.tipoDocumento.id'>
							<auto-complete ng-id="assuntoSelecionado" ng-label="ECM.LABEL.ASSUNTO" ng-model="assuntoSelecionado" ng-set-result='setTipoAssunto(item)' form="documentoGedForm" ng-obrigatorio="{{!sugestoes}}"
								ng-disabled="!edit || sugestoes.length > 0" ng-find="findAutoCompleteSugestao(value)" ng-item="item.assunto" />
						</div>
					</div>

					<div class="row">
						<div class="col-md-12" ng-show='documentoGed.tipoDocumento.id'>
							<div class="form-group">
								<label><translate>ECM.LABEL.SUGESTOES_ASSUNTO</translate></label>
								<div class="input-group">
									<select class="form-control typeahead-wide" ng-model="sugestoes" ng-change="setAssunto(sugestoes)" multiple id="sugestoes" name="sugestoes" ng-disabled='assuntoSelecionado.id' ng-multiple="true"
										ng-options="sugestao as sugestao.assunto for sugestao in assuntos track by sugestao.id">
									</select> 
									<span ng-show="sugestoes" class="input-group-addon" ng-click="sugestoes = null" ng-class="{'hover-directive' : (($hover == true) && !disabled)}" ng-mouseover="$hover = true"
										ng-mouseout="$hover = false"> <i class="fa fa-eraser bigger-110"></i>
									</span> 
									<span class="input-group-addon" style="visibility: hidden;"> <i class="fa fa-search bigger-110"></i></span>
								</div>
							</div>
						</div>
					</div>

					<div class="row" ng-show='documentoGed.tipoDocumento.id'>

						<div class="col-md-6">
							<label-select ng-id="documentoGed.nivelAcesso" ng-label="ECM.LABEL.NIVEL_ACESSO" ng-model="documentoGed.nivelAcesso" ng-custom-change='setHipoteseLegal(documentoGed.nivelAcesso.id)'
								form="documentoGedForm" ng-obrigatorio="true" ng-disabled="!edit"
								ng-custom-options="nivelAcessoTipoDocumento.originalElement as nivelAcessoTipoDocumento.nivelAcesso.descricao  for nivelAcessoTipoDocumento" track-by="track by nivelAcessoTipoDocumento.id"
								ng-list="nivelAcessoTipoDocumentoList" />
						</div>

						<div class="col-md-6">
							<div class="form-group" ng-show='documentoGed.nivelAcesso.nivelAcesso.codigo == 0'>
								<label class="control-label block"
									ng-class="{'has-error': documentoGedForm['documentoGed.tipoSigiloDocumento.id'].$error.required && (!documentoGedForm['documentoGed.tipoSigiloDocumento.id'].$pristine || documentoGedForm.$submitted)}">
									<translate>ECM.LABEL.SIGILO</translate> <span class="red">*</span> <i
									ng-show="documentoGedForm['documentoGed.tipoSigiloDocumento.id'].$error.required && (!documentoGedForm['documentoGed.tipoSigiloDocumento.id'].$pristine || documentoGedForm.$submitted)"
									class='fa fa-warning red' tooltip="{{$translate.instant('ECM.LABEL.SIGILO') + ' ' +$translate.instant('LABEL.CAMPO_OBRIGATORIO')}}" tooltip-placement='top'></i>
								</label>

								<div class="radio-inline" ng-repeat="sigiloTipoDocumento in documentoGed.nivelAcesso.sigilos">
									<label> <input type="radio" required="documentoGed.nivelAcesso.nivelAcesso.codigo == 1" name="documentoGed.tipoSigiloDocumento.id" id="documentoGed.tipoSigiloDocumento.id"
										ng-disabled="!edit" ng-value="sigiloTipoDocumento.sigilo.id" ng-model="documentoGed.sigilo.id" ng-change='setHipoteseLegal()' /> {{sigiloTipoDocumento.sigilo.tipoSigilo.descricao}}
									</label>
								</div>
							</div>
						</div>

					</div>

					<div class="row">
						<div class="col-sm-6" ng-show='documentoGed.nivelAcesso.nivelAcesso.codigo == 1 || documentoGed.sigilo.id'>
							<label-select ng-id="documentoGed.hipoteseLegal" ng-model="documentoGed.hipoteseLegal" ng-label="ECM.LABEL.HIPOTESELEGAL" ng-obrigatorio='documentoGed.nivelAcesso.nivelAcesso.codigo == 1 || documentoGed.sigilo.id' form="documentoGedForm" ng-list="hipoteses"
								ng-custom-options="hipoteseLegal.originalElement as hipoteseLegal.nome for hipoteseLegal" track-by="track by hipoteseLegal.id" ng-disabled='!edit'> </label-select>
						</div>
					</div>

					<div class="row" ng-show='documentoGed.formaCriacao.codigo == 2'>
						<div class="col-md-6">
							<auto-complete ng-id="documentoGed.tipoSuporteDocumento" ng-label="ECM.LABEL.TIPO_SUPORTE" ng-disabled="!edit" form='documentoGedForm' ng-model="documentoGed.tipoSuporteDocumento"
								ng-find="findAutoCompleteTipoSuporte(value)" button-new-action="novoTipoSuporteDocumento()" button-new-tooltip="{{$translate.instant('ECM.LABEL.NOVO_TIPO_SUPORTE')}}" button-new-show="true" ng-item="item.nome" ng-obrigatorio="{{documentoGed.formaCriacao.codigo == 2 && !outrosSuporte}}" />
						</div>

					</div>

					<div class="row" ng-show='documentoGed.formaCriacao.codigo == 2'>

						<div class="col-md-2" style="margin-bottom: 34px;">
							<label-input-checkbox ng-model="mantido" ng-disabled="!edit" ng-label="ECM.LABEL.MANTIDO" ng-custom-change="limparLocalizacao()"></label-input-checkbox>
						</div>
						<div class="col-md-10" ng-show="mantido">
							<label-input ng-id="documentoGed.localizacao" ng-label="LABEL.LOCALIZACAO" ng-type="text" ng-model="documentoGed.localizacao" form="documentoGedForm" ng-obrigatorio="mantido"
								ng-custom-maxlength="255" ng-type="text" ng-disabled="!edit" />
						</div>

					</div>

					<div class="row">
						<div class="col-md-12">

							<label-text-area ng-id="documentoGed.assuntoComplementar" ng-label="ECM.LABEL.ASSUNTOCOMPLEMENTAR" ng-model="documentoGed.assuntoComplementar" form="documentoGedForm" ng-obrigatorio="false"
								ng-disabled="!edit" rows="3" />
						</div>
					</div>

					<fieldset>

						<legend>
							<label> <translate>ECM.LABEL.INTERESSADOS</translate>
							</label>
						</legend>

						<div class="row">

							<div class="col-md-10">
								<auto-complete ng-id="interessado" ng-label="ECM.LABEL.INTERESSADO" ng-disabled="!edit" form='documentoGedForm' ng-model="interessado" ng-find="findAutoCompleteInteressados(value)"
									ng-item="item.nome" ng-set-result="setInteressados(item)" />
							</div>

							<div class="col-md-12">
								<div class="row">
									<div class="col-sm-12">
										<div class="panel panel-default">
											<div class="panel-heading clearfix">
												<button class="btn btn-clear" type="button" ng-hide="!edit" ng-click="removerInteressados()">
													<i class="fa fa-times red"></i>
													<translate>LABEL.REMOVER</translate>
												</button>
											</div>
											<table class="table table-striped table-bordered table-hover">
												<thead>
													<tr>
														<th width="5%" class="text-center"></th>

														<th class="text-center"><translate>LABEL.NOME</translate></th>
													</tr>
												</thead>
												<tbody>
													<tr ng-repeat="interessado in documentoGed.interessados">
														<td class="text-center"><input type="radio" name="interessadoChecked" id="interessadoChecked" ng-value="interessado" ng-model="$parent.interessadoChecked"
															ng-click="setInteressadoRemocao(interessado, $index)" /></td>

														<td class="text-center">{{interessado.interessado.nome}}</td>

													</tr>
													<tr ng-hide="documentoGed.interessados.length > 0">
														<td colspan="3" class="text-center"><translate>LABEL.TABELA_VAZIA</translate></td>
													</tr>
												</tbody>
											</table>
										</div>
									</div>
								</div>
							</div>
						</div>
					</fieldset>

					<fieldset ng-show='edit && documentoGed.formaCriacao.codigo == 1'>
						<legend>
							<label class="control-label block" ng-class="{'has-error': !documentoGed.conteudo && documentoGedForm.$submitted}"> <translate>ECM.LABEL.CONTEUDO</translate><span class="red">*</span> <i
								ng-show="!documentoGed.conteudo && documentoGedForm.$submitted" class='fa fa-warning red'
								tooltip="{{$translate.instant('ECM.LABEL.CONTEUDO') + ' ' +$translate.instant('LABEL.CAMPO_OBRIGATORIO')}}" tooltip-placement='top'></i></label>

						</legend>
						<div class="row">
							<div class="col-md-12">
								<div class="form-group">
									<div id="documentoGed.conteudo" ckeditor="options" ng-model="documentoGed.conteudo" ready="onReady()"></div>
								</div>
							</div>
						</div>
					</fieldset>

					<fieldset ng-show='edit && documentoGed.formaCriacao.codigo == 2'>
						<legend>
							<label ng-class="{'has-error' : documentoGedForm.$submitted && !uploader.queue.length}"> <translate>ECM.LABEL.ANEXO</translate> <span class='red'>*</span> <i
								ng-show="documentoGedForm.$submitted && !uploader.queue.length" class='fa fa-warng red' tooltip="{{$translate.instant('LABEL.ANEXO') + ' ' +$translate.instant('LABEL.CAMPO_OBRIGATORIO')}}"
								tooltip-placement='top'></i>
							</label>
						</legend>

						<div class="row" style="padding: 0px 12px 0px 12px !important;" ng-show='uploader.queue < 1 && !documentoGed.anexo.id'>
							<div nv-file-drop="" uploader="uploader" id="actionUploadArquivos" onclick="$('#uploadArquivos').click();">
								<div nv-file-over="" uploader="uploader" over-class="another-file-over-class" class="well my-drop-zone">
									<p>
										<translate>MSG.ARRASTE_SOLTE_ARQUIVO</translate>
										<i class="upload-icon ace-icon fa fa-cloud-upload blue fa-3x"></i>
									</p>
								</div>
							</div>
							<input id="uploadArquivos" type="file" nv-file-select="" uploader="uploader" ng-required='documentoGed.formaCriacao.codigo == 2' ng-show='false' />
						</div>

						<div class="row" ng-show='uploader.queue[0]'>
							<div class="col-sm-6">
								<label>{{ uploader.queue[0].file.name}}</label>
							</div>

							<div class="col-sm-4">
								<strong><label>{{ uploader.queue[0].file.size/1024/1024|number:2 }} MB</label></strong>
							</div>
							<div class="col-sm-2">
								<button type="button" class="btn btn-default btn-sm" title="{{$translate.instant('LABEL.REMOVER')}}" ng-click="exibirDialogRemocaoUpload()" ng-hide="!edit">
									<i class="fa fa-times red"></i>
									<translate>LABEL.REMOVER</translate>
								</button>
							</div>
						</div>

						<div class="row" ng-show='documentoGed.anexo.id'>
							<div class="col-sm-6">
								<strong><label>{{ documentoGed.anexo.descricao}}</label></strong>
							</div>

							<div class="col-sm-4">
								<strong><label>{{ documentoGed.anexo.tamanho/1024/1024|number:2 }} MB</label></strong>
							</div>
							<div class="col-sm-2">
								<button type="button" class="btn btn-default btn-sm" title="{{$translate.instant('LABEL.REMOVER')}}" ng-click="exibirDialogRemocaoUpload()" ng-hide="!edit">
									<i class="fa fa-times red"></i>
									<translate>LABEL.REMOVER</translate>
								</button>
							</div>
						</div>

					</fieldset>

				</fieldset>

				<div class="row" ng-show="edit && documentoGed.id == null">
					<div class="col-md-12">
						<div ng-show="edit && documentoGed.id == null" class="btn-group">
							<button title="{{$translate.instant('LABEL.SALVAR')}}" ng-click="saveOrUpdate(false)" alt="{{$translate.instant('LABEL.SALVAR')}}" type="button" class="btn btn-sm btn-primary" dropdown-toggle>
								<translate>LABEL.SALVAR</translate>
							</button>
						</div>
						<div class="btn-group">
							<button class="btn btn-sm btn-primary" ng-click="resetForm()" type="button">
								<translate>LABEL.LIMPAR</translate>
							</button>
						</div>
					</div>
				</div>

				<div class="row" ng-show="edit && documentoGed.id != null">
					<div class="col-md-12">
						<div ng-show="edit" class="btn-group dropup" role="group" dropdown>
							<button title="{{$translate.instant('LABEL.SALVAR')}}" alt="{{$translate.instant('LABEL.SALVAR')}}" type="button" class="btn btn-sm btn-primary" dropdown-toggle>
								<i class="fa fa-save green"></i>
								<translate>LABEL.SALVAR</translate>
								<span class="fa fa-caret-down icon-on-right"></span>
							</button>
							<ul class="dropdown-menu-center dropdown-menu dropdown-caret" role="menu">
								<li><a href="#void" ng-click="saveOrUpdate(true)"><i class="fa fa-file-text-o red"></i> <translate>ECM.LABEL.NOVA_VERSAO</translate>({{documentoGed.versaoDocumento + 1 | number:0}}.0)</a></li>
								<li><a href="#void" ng-click="saveOrUpdate(false)"><i class="fa fa-file-text-o red"></i> <translate>ECM.LABEL.VERSAO_INTERMEDIARIA</translate>({{documentoGed.versaoDocumento + 0.1 |
										number:1}})</a></li>
							</ul>
						</div>
						<div class="btn-group">
							<button class="btn btn-sm btn-primary" ng-click="resetForm()" type="button">
								<translate>LABEL.LIMPAR</translate>
							</button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>