125 lines
4.5 KiB
HTML
125 lines
4.5 KiB
HTML
|
|
<mg-ajax
|
|
path="/client/api/Addresses/{{edit.params.addressId}}"
|
|
actions="$ctrl.address = edit.model"
|
|
options="mgEdit">
|
|
</mg-ajax>
|
|
<vn-watcher
|
|
vn-id="watcher"
|
|
data="$ctrl.address"
|
|
url="/client/api/Addresses"
|
|
id-field="id"
|
|
form="form">
|
|
</vn-watcher>
|
|
<vn-crud-model
|
|
vn-id="model"
|
|
url="/client/api/AddressObservations"
|
|
fields="['id', 'addressFk', 'observationTypeFk', 'description']"
|
|
link="{addressFk: $ctrl.$stateParams.addressId}"
|
|
data="observations"
|
|
auto-load="true">
|
|
</vn-crud-model>
|
|
<vn-crud-model
|
|
url="/client/api/ObservationTypes"
|
|
fields="['id', 'description']"
|
|
data="types"
|
|
auto-load="true">
|
|
</vn-crud-model>
|
|
<form name="form" ng-submit="$ctrl.onSubmit()" compact>
|
|
<vn-card pad-large>
|
|
<vn-horizontal pad-small-v>
|
|
<vn-check vn-one label="Enabled" field="$ctrl.address.isActive"></vn-check>
|
|
<vn-check
|
|
vn-one label="Is equalizated"
|
|
field="$ctrl.address.isEqualizated"
|
|
vn-acl="administrative, salesAssistant">
|
|
</vn-check>
|
|
</vn-horizontal>
|
|
<vn-horizontal>
|
|
<vn-textfield vn-one label="Consignee" field="$ctrl.address.nickname" vn-focus></vn-textfield>
|
|
<vn-textfield vn-one label="Street" field="$ctrl.address.street"></vn-textfield>
|
|
</vn-horizontal>
|
|
<vn-horizontal>
|
|
<vn-autocomplete vn-id="postcode" vn-one
|
|
field="$ctrl.address.postalCode"
|
|
on-change="$ctrl.setLocation()"
|
|
search-function="{code: $search}"
|
|
url="/api/Postcodes/location"
|
|
fields="['code', 'townFk']"
|
|
show-field="code"
|
|
value-field="code"
|
|
label="Postcode">
|
|
<tpl-item>
|
|
{{code}}, {{town.name}} - {{town.province.name}}
|
|
({{town.province.country.country}})
|
|
</tpl-item>
|
|
</vn-autocomplete>
|
|
<vn-autocomplete vn-one
|
|
label="City"
|
|
url="/api/Towns"
|
|
show-field="name"
|
|
value-field="name"
|
|
field="$ctrl.address.city">
|
|
</vn-autocomplete>
|
|
<vn-autocomplete vn-one
|
|
disabled="true"
|
|
field="$ctrl.address.provinceFk"
|
|
url="/api/Provinces"
|
|
show-field="name"
|
|
value-field="id"
|
|
label="Province">
|
|
</vn-autocomplete>
|
|
</vn-horizontal>
|
|
<vn-horizontal>
|
|
<vn-autocomplete vn-one
|
|
initial-data="$ctrl.address.agencyMode"
|
|
field="$ctrl.address.agencyModeFk"
|
|
url="/client/api/AgencyModes/isActive"
|
|
show-field="name"
|
|
value-field="id"
|
|
label="Agency">
|
|
</vn-autocomplete>
|
|
<vn-textfield vn-one label="Phone" field="$ctrl.address.phone"></vn-textfield>
|
|
<vn-textfield vn-one label="Mobile" field="$ctrl.address.mobile"></vn-textfield>
|
|
</vn-horizontal>
|
|
<vn-title>Notes</vn-title>
|
|
<div name="observations">
|
|
<vn-horizontal ng-repeat="observation in observations">
|
|
<vn-autocomplete
|
|
vn-one
|
|
vn-focus
|
|
data="types"
|
|
field="observation.observationTypeFk"
|
|
show-field="description"
|
|
label="Observation type">
|
|
</vn-autocomplete>
|
|
<vn-textfield
|
|
vn-two
|
|
label="Description"
|
|
model="observation.description"
|
|
rule="addressObservation.description">
|
|
</vn-textfield>
|
|
<vn-none>
|
|
<vn-icon-button
|
|
vn-tooltip="Remove note"
|
|
icon="delete"
|
|
ng-click="$ctrl.removeObservation($index)"
|
|
tabindex="-1">
|
|
</vn-icon-button>
|
|
</vn-none>
|
|
</vn-horizontal>
|
|
</div>
|
|
<vn-icon-button
|
|
vn-bind="+"
|
|
vn-tooltip="Add note"
|
|
icon="add_circle"
|
|
ng-if="types.length > observations.length"
|
|
ng-click="model.insert()">
|
|
</vn-icon-button>
|
|
</vn-card>
|
|
<vn-button-bar>
|
|
<vn-submit label="Save"></vn-submit>
|
|
<vn-button ng-click="$ctrl.cancel()" label="Cancel"></vn-button>
|
|
</vn-button-bar>
|
|
</form>
|