salix/modules/route/front/basic-data/index.html

104 lines
3.3 KiB
HTML

<mg-ajax path="Routes/{{patch.params.id}}" options="vnPatch"></mg-ajax>
<vn-watcher
vn-id="watcher"
data="$ctrl.route"
form="form"
save="patch">
</vn-watcher>
<form name="form" ng-submit="$ctrl.onSubmit()" class="vn-w-md">
<vn-card class="vn-pa-lg">
<vn-horizontal>
<vn-autocomplete
ng-model="$ctrl.route.workerFk"
url="Workers/activeWithInheritedRole"
show-field="nickname"
search-function="{firstName: $search}"
value-field="id"
where="{role: 'employee'}"
label="Worker"
vn-name="worker">
<tpl-item>
<div>{{::nickname}}</div>
<div class="text-secondary text-caption">{{::name}}</div>
</tpl-item>
</vn-autocomplete>
<vn-autocomplete
ng-model="$ctrl.route.vehicleFk"
url="Vehicles"
show-field="numberPlate"
value-field="id"
label="Vehicle"
vn-name="vehicle">
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal>
<vn-date-picker
label="Created"
ng-model="$ctrl.route.created"
vn-name="created">
</vn-date-picker>
<vn-autocomplete
ng-model="$ctrl.route.agencyModeFk"
url="AgencyModes"
show-field="name"
value-field="id"
label="Agency"
vn-name="agencyMode">
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal>
<vn-input-number
label="Km start"
ng-model="$ctrl.route.kmStart"
vn-name="kmStart"
rule>
</vn-input-number>
<vn-input-number
label="Km end"
ng-model="$ctrl.route.kmEnd"
vn-name="kmEnd"
rule>
</vn-input-number>
</vn-horizontal>
<vn-horizontal>
<vn-input-time
label="Hour started"
ng-model="$ctrl.route.started"
vn-name="started">
</vn-input-time>
<vn-input-time
label="Hour finished"
ng-model="$ctrl.route.finished"
vn-name="finished">
</vn-input-time>
<vn-check
class="vn-mr-md"
label="Is served"
ng-model="$ctrl.route.isOk"
vn-name="isOk">
</vn-check>
</vn-horizontal>
<vn-horizontal>
<vn-textArea
label="Description"
ng-model="$ctrl.route.description"
vn-name="description"
rule
vn-focus>
</vn-textArea>
</vn-horizontal>
</vn-card>
<vn-button-bar>
<vn-submit
disabled="!watcher.dataChanged()"
label="Save">
</vn-submit>
<vn-button
class="cancel"
label="Undo changes"
disabled="!watcher.dataChanged()"
ng-click="watcher.loadOriginalData()">
</vn-button>
</vn-button-bar>
</form>