2018-05-31 09:52:39 +00:00
|
|
|
|
2018-02-28 11:07:56 +00:00
|
|
|
<mg-ajax
|
|
|
|
path="/client/api/Addresses/{{edit.params.addressId}}"
|
2018-05-31 09:52:39 +00:00
|
|
|
actions="$ctrl.address = edit.model"
|
2018-02-28 11:07:56 +00:00
|
|
|
options="mgEdit">
|
|
|
|
</mg-ajax>
|
2017-02-21 15:21:55 +00:00
|
|
|
<vn-watcher
|
|
|
|
vn-id="watcher"
|
2018-05-31 09:52:39 +00:00
|
|
|
data="$ctrl.address"
|
2017-02-21 15:21:55 +00:00
|
|
|
url="/client/api/Addresses"
|
|
|
|
id-field="id"
|
2018-05-31 09:52:39 +00:00
|
|
|
form="form">
|
2017-02-21 15:21:55 +00:00
|
|
|
</vn-watcher>
|
2018-05-31 09:52:39 +00:00
|
|
|
<vn-crud-model
|
|
|
|
vn-id="model"
|
|
|
|
url="/client/api/AddressObservations"
|
|
|
|
fields="['id', 'addressFk', 'observationTypeFk', 'description']"
|
|
|
|
link="{addressFk: $ctrl.$stateParams.addressId}"
|
2018-12-19 14:59:35 +00:00
|
|
|
data="observations"
|
|
|
|
auto-load="true">
|
2018-05-31 09:52:39 +00:00
|
|
|
</vn-crud-model>
|
|
|
|
<vn-crud-model
|
|
|
|
url="/client/api/ObservationTypes"
|
|
|
|
fields="['id', 'description']"
|
2018-12-19 14:59:35 +00:00
|
|
|
data="types"
|
|
|
|
auto-load="true">
|
2018-05-31 09:52:39 +00:00
|
|
|
</vn-crud-model>
|
2019-06-13 11:08:11 +00:00
|
|
|
<form name="form" ng-submit="$ctrl.onSubmit()" compact>
|
2018-03-01 22:38:14 +00:00
|
|
|
<vn-card pad-large>
|
2018-05-31 11:45:51 +00:00
|
|
|
<vn-horizontal pad-small-v>
|
2018-03-01 22:38:14 +00:00
|
|
|
<vn-check vn-one label="Enabled" field="$ctrl.address.isActive"></vn-check>
|
2018-03-12 10:10:05 +00:00
|
|
|
<vn-check
|
|
|
|
vn-one label="Is equalizated"
|
|
|
|
field="$ctrl.address.isEqualizated"
|
|
|
|
vn-acl="administrative, salesAssistant">
|
|
|
|
</vn-check>
|
2018-03-01 22:38:14 +00:00
|
|
|
</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>
|
2019-07-08 12:07:09 +00:00
|
|
|
<vn-autocomplete vn-one
|
2019-06-13 11:08:11 +00:00
|
|
|
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>
|
2019-07-08 12:07:09 +00:00
|
|
|
<vn-icon-button vn-auto margin-medium-v
|
|
|
|
icon="add_circle"
|
|
|
|
vn-tooltip="New postcode"
|
|
|
|
ng-click="postcode.open()">
|
|
|
|
</vn-icon-button>
|
2019-06-13 11:08:11 +00:00
|
|
|
<vn-autocomplete vn-one
|
|
|
|
label="City"
|
|
|
|
url="/api/Towns"
|
|
|
|
show-field="name"
|
|
|
|
value-field="name"
|
|
|
|
field="$ctrl.address.city">
|
|
|
|
</vn-autocomplete>
|
2018-03-01 22:38:14 +00:00
|
|
|
<vn-autocomplete vn-one
|
2019-06-13 11:08:11 +00:00
|
|
|
disabled="true"
|
2018-03-01 22:38:14 +00:00
|
|
|
field="$ctrl.address.provinceFk"
|
2019-06-13 11:08:11 +00:00
|
|
|
url="/api/Provinces"
|
2018-03-01 22:38:14 +00:00
|
|
|
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"
|
2019-01-16 07:17:22 +00:00
|
|
|
url="/client/api/AgencyModes/isActive"
|
2018-03-01 22:38:14 +00:00
|
|
|
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>
|
2018-05-31 09:52:39 +00:00
|
|
|
<vn-title>Notes</vn-title>
|
|
|
|
<div name="observations">
|
|
|
|
<vn-horizontal ng-repeat="observation in observations">
|
2018-03-01 22:38:14 +00:00
|
|
|
<vn-autocomplete
|
|
|
|
vn-one
|
2018-04-19 12:46:06 +00:00
|
|
|
vn-focus
|
2018-05-31 09:52:39 +00:00
|
|
|
data="types"
|
2018-03-01 22:38:14 +00:00
|
|
|
field="observation.observationTypeFk"
|
|
|
|
show-field="description"
|
2018-03-13 12:41:54 +00:00
|
|
|
label="Observation type">
|
2017-01-31 13:13:06 +00:00
|
|
|
</vn-autocomplete>
|
2018-03-01 22:38:14 +00:00
|
|
|
<vn-textfield
|
2018-03-07 12:34:34 +00:00
|
|
|
vn-two
|
2018-03-01 22:38:14 +00:00
|
|
|
label="Description"
|
|
|
|
model="observation.description"
|
|
|
|
rule="addressObservation.description">
|
|
|
|
</vn-textfield>
|
2018-06-07 21:47:19 +00:00
|
|
|
<vn-none>
|
|
|
|
<vn-icon-button
|
2018-03-07 12:34:34 +00:00
|
|
|
vn-tooltip="Remove note"
|
2018-12-11 07:50:54 +00:00
|
|
|
icon="delete"
|
2018-06-07 21:47:19 +00:00
|
|
|
ng-click="$ctrl.removeObservation($index)"
|
|
|
|
tabindex="-1">
|
|
|
|
</vn-icon-button>
|
|
|
|
</vn-none>
|
2017-01-31 13:13:06 +00:00
|
|
|
</vn-horizontal>
|
2019-07-08 12:07:09 +00:00
|
|
|
<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>
|
2018-05-31 09:52:39 +00:00
|
|
|
</div>
|
2017-01-31 13:13:06 +00:00
|
|
|
</vn-card>
|
|
|
|
<vn-button-bar>
|
2017-06-07 06:39:40 +00:00
|
|
|
<vn-submit label="Save"></vn-submit>
|
2018-10-17 07:28:38 +00:00
|
|
|
<vn-button ng-click="$ctrl.cancel()" label="Cancel"></vn-button>
|
2017-01-31 13:13:06 +00:00
|
|
|
</vn-button-bar>
|
2017-02-07 11:58:25 +00:00
|
|
|
</form>
|
2019-07-08 12:07:09 +00:00
|
|
|
|
|
|
|
<!-- New postcode dialog -->
|
|
|
|
<vn-client-postcode vn-id="postcode"
|
|
|
|
on-response="$ctrl.onResponse(response)">
|
|
|
|
</vn-client-postcode>
|
|
|
|
|