client.create not showing all postcodes, changed autocomplete #1619
gitea/salix/dev This commit looks good Details

This commit is contained in:
Joan Sanchez 2019-07-26 13:05:22 +02:00
parent 64a4e5f43d
commit f4a3b8e9b2
4 changed files with 82 additions and 71 deletions

View File

@ -24,12 +24,30 @@
<vn-textfield vn-one label="Street address" field="$ctrl.address.street"></vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete vn-id="province" vn-one
field="$ctrl.address.provinceFk"
url="/api/Provinces"
show-field="name"
value-field="id"
label="Province">
</vn-autocomplete>
<vn-autocomplete vn-id="town" vn-one
label="City"
url="/api/Towns"
fields="['id', 'name']"
where="{provinceFk: province.selection.id}"
show-field="name"
value-field="name"
field="$ctrl.address.city">
</vn-autocomplete>
<vn-autocomplete vn-one
url="/api/Postcodes/location"
fields="['code', 'townFk']"
field="$ctrl.address.postalCode"
selection="$ctrl.postcodeSelection"
search-function="{code: $search}"
url="/api/Postcodes/location"
fields="['code', 'townFk']"
where="{townFk: town.selection.id}"
order="code, townFk"
show-field="code"
value-field="code"
label="Postcode">
@ -43,21 +61,7 @@
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-horizontal>
<vn-autocomplete
vn-one

View File

@ -40,12 +40,30 @@
<vn-textfield vn-one label="Street" field="$ctrl.address.street"></vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete vn-id="province" vn-one
field="$ctrl.address.provinceFk"
url="/api/Provinces"
show-field="name"
value-field="id"
label="Province">
</vn-autocomplete>
<vn-autocomplete vn-id="town" vn-one
label="City"
url="/api/Towns"
fields="['id', 'name']"
where="{provinceFk: province.selection.id}"
show-field="name"
value-field="name"
field="$ctrl.address.city">
</vn-autocomplete>
<vn-autocomplete vn-one
url="/api/Postcodes/location"
fields="['code', 'townFk']"
field="$ctrl.address.postalCode"
selection="$ctrl.postcodeSelection"
search-function="{code: $search}"
url="/api/Postcodes/location"
fields="['code', 'townFk']"
where="{townFk: town.selection.id}"
order="code, townFk"
show-field="code"
value-field="code"
label="Postcode">
@ -59,21 +77,6 @@
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-autocomplete>
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete vn-one

View File

@ -33,19 +33,31 @@
</vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete vn-one
field="$ctrl.client.postcode"
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-id="country" vn-one
field="$ctrl.client.countryFk"
url="/api/Countries"
show-field="country"
value-field="id"
label="Country">
</vn-autocomplete>
<vn-autocomplete vn-id="province" vn-one
url="/api/Provinces"
field="$ctrl.client.provinceFk"
where="{countryFk: country.selection.id}"
show-field="name"
value-field="id"
label="Province">
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete vn-id="town" vn-one
label="City"
url="/api/Towns"
fields="['id', 'name']"
where="{provinceFk: province.selection.id}"
show-field="name"
value-field="name"
field="$ctrl.client.city">
</vn-autocomplete>
<vn-icon-button vn-auto margin-medium-v
icon="add_circle"
@ -53,29 +65,20 @@
ng-click="postcode.open()">
</vn-icon-button>
<vn-autocomplete vn-one
label="City"
url="/api/Towns"
show-field="name"
value-field="name"
field="$ctrl.client.city">
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete vn-one
disabled="true"
field="$ctrl.client.provinceFk"
url="/api/Provinces"
show-field="name"
value-field="id"
label="Province">
</vn-autocomplete>
<vn-autocomplete vn-one
disabled="true"
field="$ctrl.client.countryFk"
url="/api/Countries"
show-field="country"
value-field="id"
label="Country">
url="/api/Postcodes/location"
fields="['code', 'townFk']"
field="$ctrl.client.postcode"
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-horizontal>
<vn-horizontal>

View File

@ -1,2 +1,3 @@
Routes: Rutas
Search routes by id: Buscar rutas por identificador
Search routes by id: Buscar rutas por identificador
New route: Nueva ruta