questionarioEdit.html
10.8 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
<div id="editQuestionario" class="page-content clearfix"
ng-controller="QuestionarioController">
<div class="bar-buttons-action fixed">
<div class="row">
<div class="col-sm-8 text-left">
<button title="{{$translate.instant('LABEL.SALVAR')}}"
alt="{{$translate.instant('LABEL.SALVAR')}}" class="btn btn-clear"
ng-click="saveOrUpdate()" ng-show="edit">
<i class="fa fa-save green"></i>
<translate>LABEL.SALVAR</translate>
</button>
<button title="{{$translate.instant('LABEL.LIMPAR')}}"
alt="{{$translate.instant('LABEL.LIMPAR')}}" class="btn btn-clear"
ng-click="resetForm();" ng-show="questionario.id === undefined">
<i class="fa fa-eraser yellow-dark"></i>
<translate>LABEL.LIMPAR</translate>
</button>
<button title="{{$translate.instant('LABEL.EDITAR')}}"
alt="{{$translate.instant('LABEL.EDITAR')}}" class="btn btn-clear"
ng-show="!(pgEdit && edit)" ng-click="edit = true; pgEdit = true;">
<i class="fa fa-pencil blue"></i>
<translate>LABEL.EDITAR</translate>
</button>
<button title="{{$translate.instant('LABEL.REMOVER')}}"
alt="{{$translate.instant('LABEL.REMOVER')}}" class="btn btn-clear"
ng-click="remove(questionario);"
ng-show="questionario.id !== undefined">
<i class="fa fa-times red"></i>
<translate>LABEL.REMOVER</translate>
</button>
<button-lock ng-model="questionario.dataBloqueio"
action-lock="confirmarBloqueioQuestionario();"
ng-show="questionario.id !== undefined && isBloquear && edit"></button-lock>
<button title="{{$translate.instant('LABEL.DESBLOQUEAR')}}"
alt="{{$translate.instant('LABEL.DESBLOQUEAR')}}"
class="btn btn-clear" ng-show="isDesbloquear && pgEdit"
ng-click="desbloquear();">
<i class="fa fa-unlock grey"></i>
<translate>LABEL.DESBLOQUEAR</translate>
</button>
<button title="{{$translate.instant('LABEL.PESQUISAR')}}"
alt="{{$translate.instant('LABEL.PESQUISAR')}}"
class="btn btn-clear"
ng-click="$showPageSearchWorkspace(workspace); atualizaPaginaPesquisa();">
<i class="fa fa-search"></i>
<translate>LABEL.PESQUISAR</translate>
</button>
</div>
<!-- .col -->
<div class="col-sm-4 text-right">
<favorito />
<button title="{{$translate.instant('LABEL.AJUDA')}}"
alt="{{$translate.instant('LABEL.AJUDA')}}" class="btn btn-clear">
<i class="fa fa-life-ring"></i>
<translate>LABEL.AJUDA</translate>
</button>
</div>
<!-- .col -->
</div>
<!-- .row -->
</div>
<!-- .bar-buttons-action -->
<breadcrumb ng-workspace="workspace"></breadcrumb>
<form name="questionarioForm" novalidate autocomplete="off">
<p>
<small>( <span class="red">*</span> ) <translate>LABEL.CAMPOS_OBRIGATORIOS</translate></small>
</p>
<div class="row">
<div class="col-sm-4">
<label-input ng-type="text" ng-id="questionario.nome" ng-label="CONTRATOS.NOME_QUESTIONARIO" ng-obrigatorio="true" ng-disabled="!edit" ng-model="questionario.nome" ng-custom-maxlength="100"
form="questionarioForm" />
</div>
<div class="col-sm-4">
<label-select ng-id="questionario.dominioTipoQuestionario" ng-model="questionario.dominioTipoQuestionario" ng-label="LABEL.TIPO_QUESTIONARIO" ng-obrigatorio="true" ng-disabled="!edit || questionario.id"
form="questionarioForm" ng-list="dominiosTipoQuestionario" ng-custom-options="dominioTipoQuest.originalElement as dominioTipoQuest.descricao for dominioTipoQuest"
track-by="track by dominioTipoQuest.codigo"></label-select>
</div>
<!-- .col -->
</div>
<!-- row -->
<legend ng-show="edit">
<translate>CONTRATOS.ADICIONAR_PERGUNTA</translate>
</legend>
<div class="form-group" ng-show="edit">
<div class="row">
<div class="col-sm-9">
<label-text-area ng-id="questionarioPergunta.questao"
ng-label="CONTRATOS.QUESTAO" rows="3" form="questionarioForm"
ng-disabled="!edit" ng-obrigatorio="false"
ng-model="questionarioPergunta.questao"
ng-custom-maxlength="500"></label-text-area>
</div><!-- .col-sm-9 -->
</div><!-- row -->
<div class="row">
<div class="col-sm-3">
<label-select ng-id="questionarioPergunta.dominioTipoResposta"
ng-model="questionarioPergunta.dominioTipoResposta"
ng-label="CONTRATOS.TIPO_RESPOSTA" ng-obrigatorio="false"
ng-disabled="!editTipoResposta" form="questionarioForm"
ng-list="dominiosTipoResposta"
ng-custom-change="mudaTipoResposta()"
track-by="track by dominioTipoResposta.codigo"
ng-custom-options="dominioTipoResposta as dominioTipoResposta.descricao for dominioTipoResposta"></label-select>
</div>
</div><!-- row -->
<div class="row">
<div ng-show="(questionarioPergunta.dominioTipoResposta.codigo == 2 || questionarioPergunta.dominioTipoResposta.codigo == 4) && editTipoResposta">
<div class="col-sm-4">
<label-input ng-type="text" ng-id="possivelResposta.resposta"
ng-label="CONTRATOS.POSSIVEL_RESPOSTA" ng-obrigatorio="false" ng-disabled="!edit"
ng-model="possivelResposta.resposta" ng-custom-maxlength="100"
form="questionarioForm" />
</div>
</div>
</div>
<div class="row">
<div ng-show="(questionarioPergunta.dominioTipoResposta.codigo == 2 || questionarioPergunta.dominioTipoResposta.codigo == 4)">
<div class="col-sm-6">
<div class="panel panel-default">
<div class="panel-heading clearfix" ng-show="editTipoResposta">
<button title="{{$translate.instant('LABEL.ADICIONAR')}}" alt="{{$translate.instant('LABEL.ADICIONAR')}}" class="btn btn-clear" ng-click="addPossivelResposta()" type="button">
<i class="fa fa-plus-circle yellow-dark"></i>
<translate>LABEL.ADICIONAR</translate> </a>
</button>
<button title="{{$translate.instant('LABEL.REMOVER')}}" alt="{{$translate.instant('LABEL.REMOVER')}}" class="btn btn-clear" type="button"
ng-click="prepararExcluirRespostasSelecionadas()" ng-show="edit">
<i class="fa fa-times red"></i>
<translate>LABEL.REMOVER</translate>
</button>
</div><!-- .panel-heading -->
<table class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th class="text-center" style="width: 40px;" ng-show="editTipoResposta">
<input type="checkbox" ng-model="selectedAllRespostas" ng-checked="selectedAllRespostas" ng-click="checkAllRespostas(selectedAllRespostas);" />
</th>
<th style="width: 100%;">
<translate>CONTRATOS.POSSIVEL_RESPOSTA</translate>
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="resposta in questionarioPergunta.respostasEscolha" ng-show="questionarioPergunta.respostasEscolha.length > 0">
<td class="text-center" ng-show="editTipoResposta">
<input type="checkbox" ng-click="resposta.$index = $index" ng-checked="resposta.$selected" ng-model="resposta.$selected" />
</td>
<td>
{{ resposta.resposta }}
</td>
</tr>
<tr ng-hide="questionarioPergunta.respostasEscolha.length != 0">
<td colspan="2">
<translate>LABEL.TABELA_VAZIA</translate>
</td>
</tr>
</tbody>
</table>
</div><!-- .panel -->
</div>
</div>
</div>
</div><!-- .form-group -->
<legend>
<translate>CONTRATOS.PERGUNTAS</translate>
</legend>
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-heading clearfix col-sm-12 text-left">
<div class="col-sm-1" tooltip="{{ !edit ? $translate.instant('PORTAL.MSG.ADICIONAR_NAO_PERMITIDO_ACAO_VISUALIZAR') : '' }}">
<button title="{{$translate.instant('LABEL.ADICIONAR')}}" alt="{{$translate.instant('LABEL.ADICIONAR')}}" class="btn btn-clear" ng-disabled="!edit" ng-click="addQuestao()" type="button">
<i class="fa fa-plus-circle yellow-dark"></i>
<translate>LABEL.ADICIONAR</translate> </a>
</button>
</div>
<div class="col-sm-1" tooltip="{{ listaSize == 0 && edit ? $translate.instant('PORTAL.MSG.EDITAR_SELECIONE_ITEM') : listaSize > 1 && edit ? $translate.instant('PORTAL.MSG.EDITAR_DISABLED_SELECIONADOS') : !edit ? $translate.instant('PORTAL.MSG.EDITAR_NAO_PERMITIDO_ACAO_VISUALIZAR') : '' }}">
<button title="{{$translate.instant('LABEL.EDITAR')}}" alt="{{$translate.instant('LABEL.EDITAR')}}" class="btn btn-clear" ng-disabled="listaSize != 1 || !edit" ng-click="editQuestao()">
<i class="fa fa-pencil blue"></i>
<translate>LABEL.EDITAR</translate>
</button>
</div>
<div class="col-sm-1" tooltip="{{ listaSize == 0 && edit ? $translate.instant('PORTAL.MSG.EXCLUIR_SELECIONE_ITEM') : !edit ? $translate.instant('PORTAL.MSG.EXCLUIR_NAO_PERMITIDO_ACAO_VISUALIZAR') : '' }}">
<button title="{{$translate.instant('LABEL.REMOVER')}}" alt="{{$translate.instant('LABEL.REMOVER')}}" class="btn btn-clear" type="button" ng-click="prepararExcluirQuestoesSelecionados()" ng-disabled="listaSize == 0 || !edit">
<i class="fa fa-times red"></i>
<translate>LABEL.REMOVER</translate>
</button>
</div>
</div><!-- .panel-heading -->
<table class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th class="text-center" style="width: 40px;" ng-show="edit">
<input type="checkbox" ng-model="selectedAll" ng-checked="selectedAll" ng-click="checkAll(selectedAll);" />
</th>
<th style="width: 40%;">
<translate>CONTRATOS.QUESTAO</translate>
</th>
<th style="width: 20%;">
<translate>CONTRATOS.TIPO_RESPOSTA</translate>
</th>
<th style="width: 40%;">
<translate>CONTRATOS.POSSIVEL_RESPOSTA</translate>
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="questao in questionario.questoes" ng-show="questionario.questoes.length > 0">
<td class="text-center" ng-show="edit">
<input type="checkbox" ng-click="questao.$index = $index; atualizarListaSizeSelect()" ng-checked="questao.$selected" ng-model="questao.$selected" />
</td>
<td>
{{ questao.questao }}
</td>
<td>
{{ questao.dominioTipoResposta.descricao }}
</td>
<td ng-show="questao.dominioTipoResposta.codigo == 1">
{{ }}
</td>
<td ng-show="(questao.dominioTipoResposta.codigo == 2 || questao.dominioTipoResposta.codigo == 4)">
<div ng-repeat="escolha in questao.respostasEscolha" >
{{ escolha.resposta }}
</div>
</td>
<td ng-show="questao.dominioTipoResposta.codigo == 3">
<translate>CONTRATOS.VERDADEIRO</translate>, <translate>CONTRATOS.FALSO</translate>
</td>
</tr>
<tr ng-hide="questionario.questoes.length != 0">
<td colspan="4">
<translate>LABEL.TABELA_VAZIA</translate>
</td>
</tr>
</tbody>
</table>
</div><!-- .panel -->
</div>
</form>
</div>
<!-- .page-content -->