2021-04-29 12:41:10 +00:00
|
|
|
|
|
|
|
<mg-ajax
|
|
|
|
path="SupplierAddresses/{{edit.params.addressId}}"
|
|
|
|
actions="$ctrl.address = edit.model"
|
|
|
|
options="mgEdit">
|
|
|
|
</mg-ajax>
|
|
|
|
<vn-watcher
|
|
|
|
vn-id="watcher"
|
|
|
|
url="SupplierAddresses"
|
|
|
|
id-field="id"
|
|
|
|
data="$ctrl.address"
|
|
|
|
form="form">
|
|
|
|
</vn-watcher>
|
|
|
|
<form name="form" ng-submit="$ctrl.onSubmit()" class="vn-w-md">
|
|
|
|
<vn-card class="vn-pa-lg">
|
|
|
|
<vn-horizontal>
|
|
|
|
<vn-textfield
|
|
|
|
vn-one
|
|
|
|
label="Name"
|
|
|
|
ng-model="$ctrl.address.nickname"
|
|
|
|
rule
|
|
|
|
vn-focus>
|
|
|
|
</vn-textfield>
|
|
|
|
<vn-textfield
|
|
|
|
vn-one
|
|
|
|
label="Street"
|
|
|
|
ng-model="$ctrl.address.street"
|
|
|
|
rule>
|
|
|
|
</vn-textfield>
|
|
|
|
</vn-horizontal>
|
|
|
|
<vn-horizontal>
|
|
|
|
<vn-datalist vn-one
|
|
|
|
label="Postcode"
|
|
|
|
ng-model="$ctrl.address.postalCode"
|
|
|
|
selection="$ctrl.postcode"
|
|
|
|
url="Postcodes/location"
|
|
|
|
fields="['code','townFk']"
|
|
|
|
order="code, townFk"
|
|
|
|
value-field="code"
|
|
|
|
show-field="code"
|
|
|
|
rule>
|
|
|
|
<tpl-item>
|
2023-06-12 12:58:28 +00:00
|
|
|
{{code}} - {{town.name}} ({{town.province.name}},
|
2024-04-25 10:35:21 +00:00
|
|
|
{{town.province.country.name}})
|
2021-04-29 12:41:10 +00:00
|
|
|
</tpl-item>
|
|
|
|
<append>
|
2023-06-12 12:58:28 +00:00
|
|
|
<vn-icon-button
|
2021-04-29 12:41:10 +00:00
|
|
|
icon="add_circle"
|
|
|
|
vn-tooltip="New postcode"
|
|
|
|
ng-click="postcode.open()"
|
2023-06-21 11:34:27 +00:00
|
|
|
vn-acl="deliveryAssistant"
|
2021-04-29 12:41:10 +00:00
|
|
|
vn-acl-action="remove">
|
|
|
|
</vn-icon-button>
|
|
|
|
</append>
|
|
|
|
</vn-datalist>
|
2023-06-12 12:58:28 +00:00
|
|
|
<vn-datalist vn-id="town" vn-one
|
2021-04-29 12:41:10 +00:00
|
|
|
label="City"
|
|
|
|
ng-model="$ctrl.address.city"
|
|
|
|
selection="$ctrl.town"
|
|
|
|
url="Towns/location"
|
|
|
|
fields="['id', 'name', 'provinceFk']"
|
|
|
|
show-field="name"
|
|
|
|
value-field="name">
|
|
|
|
<tpl-item>
|
|
|
|
{{name}}, {{province.name}}
|
2024-04-25 10:35:21 +00:00
|
|
|
({{province.country.name}})
|
2021-04-29 12:41:10 +00:00
|
|
|
</tpl-item>
|
|
|
|
</vn-datalist>
|
|
|
|
<vn-autocomplete vn-id="province" vn-one
|
|
|
|
label="Province"
|
|
|
|
ng-model="$ctrl.address.provinceFk"
|
|
|
|
url="Provinces/location"
|
|
|
|
fields="['id', 'name', 'countryFk']"
|
|
|
|
show-field="name"
|
|
|
|
value-field="id"
|
|
|
|
rule>
|
2024-04-25 10:35:21 +00:00
|
|
|
<tpl-item>{{name}} ({{country.name}})</tpl-item>
|
2021-04-29 12:41:10 +00:00
|
|
|
</vn-autocomplete>
|
|
|
|
</vn-horizontal>
|
|
|
|
<vn-horizontal>
|
|
|
|
<vn-textfield
|
|
|
|
vn-one
|
|
|
|
label="Phone"
|
|
|
|
ng-model="$ctrl.address.phone"
|
|
|
|
rule>
|
|
|
|
</vn-textfield>
|
|
|
|
<vn-textfield
|
|
|
|
vn-one
|
|
|
|
label="Mobile"
|
|
|
|
ng-model="$ctrl.address.mobile"
|
|
|
|
rule>
|
|
|
|
</vn-textfield>
|
|
|
|
</vn-horizontal>
|
|
|
|
</vn-card>
|
|
|
|
<vn-button-bar>
|
|
|
|
<vn-submit label="Save"></vn-submit>
|
|
|
|
<vn-button label="Cancel" ui-sref="supplier.card.address.index"></vn-button>
|
|
|
|
</vn-button-bar>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
<!-- New postcode dialog -->
|
2023-06-12 12:58:28 +00:00
|
|
|
<vn-geo-postcode vn-id="postcode"
|
2021-04-29 12:41:10 +00:00
|
|
|
on-response="$ctrl.onResponse($response)">
|
2023-06-12 12:58:28 +00:00
|
|
|
</vn-geo-postcode>
|