salix/modules/ticket/front/note/index.html

62 lines
2.1 KiB
HTML

<vn-crud-model
vn-id="model"
url="/ticket/api/TicketObservations"
fields="['id', 'ticketFk', 'observationTypeFk', 'description']"
link="{ticketFk: $ctrl.$stateParams.id}"
data="observations"
auto-load="true">
</vn-crud-model>
<vn-crud-model
url="/ticket/api/ObservationTypes"
data="observationTypes"
auto-load="true">
</vn-crud-model>
<vn-watcher
vn-id="watcher"
data="observations"
form="form">
</vn-watcher>
<form name="form" ng-submit="$ctrl.onSubmit()" compact>
<vn-card pad-large>
<vn-one margin-medium-top>
<vn-title>Notes</vn-title>
<vn-horizontal ng-repeat="observation in observations track by $index">
<vn-autocomplete
ng-attr-disabled="observation.id ? true : false"
field="observation.observationTypeFk"
data="observationTypes"
show-field="description"
label="Observation type" vn-one vn-focus>
</vn-autocomplete>
<vn-textfield
vn-two
margin-large-right
label="Description"
model="observation.description"
rule="ticketObservation.description">
</vn-textfield>
<vn-auto pad-medium-top>
<vn-icon
pointer
medium-grey
vn-tooltip="Remove note"
icon="delete"
ng-click="model.remove($index)">
</vn-icon>
</vn-auto>
</vn-horizontal>
</vn-one>
<vn-one>
<vn-icon-button
pointer vn-tooltip="Add note"
icon="add_circle"
vn-bind="+"
ng-if="observationTypes.length > observations.length"
ng-click="model.insert()">
</vn-icon-button>
</vn-one>
</vn-card>
<vn-button-bar>
<vn-submit label="Save"></vn-submit>
</vn-button-bar>
</form>