salix/modules/client/front/address/create/index.html

89 lines
3.1 KiB
HTML

<vn-watcher
vn-id="watcher"
url="/client/api/Addresses/createDefaultAddress"
id-field="id"
data="$ctrl.data"
save="post"
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>
<form name="form" ng-submit="$ctrl.onSubmit()" compact>
<vn-card pad-large>
<vn-horizontal pad-small-v>
<vn-check vn-one label="Default" field="$ctrl.data.isDefaultAddress"></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 address" field="$ctrl.address.street"></vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete vn-one
field="$ctrl.address.postalCode"
selection="$ctrl.postcodeSelection"
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-icon-button vn-auto margin-medium-v
icon="add_circle"
vn-tooltip="New postcode"
ng-click="postcode.open()">
</vn-icon-button>
<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-horizontal>
<vn-horizontal>
<vn-autocomplete
vn-one
field="$ctrl.address.agencyModeFk"
url="/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-card>
<vn-button-bar>
<vn-submit label="Save"></vn-submit>
<button
class="mdl-button mdl-button--raised mdl-button--colored"
translate
ui-sref="client.card.address.index"
>Cancel
</button>
</vn-button-bar>
</form>
<!-- New postcode dialog -->
<vn-client-postcode vn-id="postcode"
on-response="$ctrl.onResponse(response)">
</vn-client-postcode>