133 lines
4.1 KiB
HTML
133 lines
4.1 KiB
HTML
<vn-watcher
|
|
vn-id="watcher"
|
|
url="Addresses/createDefaultAddress"
|
|
id-field="id"
|
|
data="$ctrl.data"
|
|
save="post"
|
|
form="form">
|
|
</vn-watcher>
|
|
<vn-crud-model
|
|
vn-id="model"
|
|
url="AddressObservations"
|
|
fields="['id', 'addressFk', 'observationTypeFk', 'description']"
|
|
link="{addressFk: $ctrl.$stateParams.addressId}"
|
|
data="observations"
|
|
auto-load="true">
|
|
</vn-crud-model>
|
|
<form name="form" ng-submit="$ctrl.onSubmit()" class="vn-w-md">
|
|
<vn-card class="vn-pa-lg">
|
|
<vn-horizontal>
|
|
<vn-check
|
|
vn-one
|
|
label="Default" ng-model="$ctrl.data.isDefaultAddress">
|
|
</vn-check>
|
|
</vn-horizontal>
|
|
<vn-horizontal>
|
|
<vn-textfield
|
|
vn-one
|
|
label="Consignee"
|
|
ng-model="$ctrl.address.nickname"
|
|
rule
|
|
vn-focus>
|
|
</vn-textfield>
|
|
<vn-textfield
|
|
vn-one
|
|
label="Street address"
|
|
ng-model="$ctrl.address.street"
|
|
rule>
|
|
</vn-textfield>
|
|
</vn-horizontal>
|
|
<vn-horizontal>
|
|
<vn-autocomplete
|
|
vn-one
|
|
vn-id="province"
|
|
ng-model="$ctrl.address.provinceFk"
|
|
url="Provinces"
|
|
show-field="name"
|
|
value-field="id"
|
|
label="Province">
|
|
</vn-autocomplete>
|
|
<vn-textfield
|
|
vn-one
|
|
label="City"
|
|
ng-model="$ctrl.address.city"
|
|
rule>
|
|
</vn-textfield>
|
|
<!-- <vn-autocomplete vn-id="town" vn-one
|
|
label="City"
|
|
url="Towns"
|
|
fields="['id', 'name']"
|
|
where="{provinceFk: province.selection.id}"
|
|
show-field="name"
|
|
value-field="name"
|
|
ng-model="$ctrl.address.city">
|
|
</vn-autocomplete>
|
|
<vn-autocomplete vn-one
|
|
url="Postcodes/location"
|
|
fields="['code', 'townFk']"
|
|
ng-model="$ctrl.address.postalCode"
|
|
selection="$ctrl.postcodeSelection"
|
|
search-function="{code: $search}"
|
|
where="{townFk: town.selection.id}"
|
|
order="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-textfield
|
|
vn-one
|
|
label="Postcode"
|
|
ng-model="$ctrl.address.postalCode"
|
|
rule>
|
|
</vn-textfield>
|
|
<!--
|
|
<vn-icon-button
|
|
vn-auto
|
|
class="vn-my-md"
|
|
icon="add_circle"
|
|
vn-tooltip="New postcode"
|
|
ng-click="postcode.open()">
|
|
</vn-icon-button>
|
|
-->
|
|
</vn-horizontal>
|
|
<vn-horizontal>
|
|
<vn-autocomplete
|
|
vn-one
|
|
ng-model="$ctrl.address.agencyModeFk"
|
|
url="AgencyModes/isActive"
|
|
show-field="name"
|
|
value-field="id"
|
|
label="Agency">
|
|
</vn-autocomplete>
|
|
<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="client.card.address.index">
|
|
</vn-button>
|
|
</vn-button-bar>
|
|
</form>
|
|
|
|
<!-- New postcode dialog -->
|
|
<vn-client-postcode vn-id="postcode"
|
|
on-response="$ctrl.onResponse($response)">
|
|
</vn-client-postcode>
|