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

180 lines
5.7 KiB
HTML
Raw Normal View History

2018-02-28 11:07:56 +00:00
<mg-ajax
path="/client/api/Addresses/{{edit.params.addressId}}"
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"
data="$ctrl.address"
2017-02-21 15:21:55 +00:00
url="/client/api/Addresses"
id-field="id"
form="form">
2017-02-21 15:21:55 +00:00
</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>
<vn-crud-model
url="/client/api/ObservationTypes"
fields="['id', 'description']"
data="types"
auto-load="true">
</vn-crud-model>
<form name="form" ng-submit="$ctrl.onSubmit()" compact>
<vn-card class="vn-pa-lg">
2019-10-09 22:47:29 +00:00
<vn-horizontal>
<vn-check
vn-one
label="Enabled"
ng-model="$ctrl.address.isActive">
</vn-check>
<vn-check
2019-10-09 22:47:29 +00:00
vn-one
label="Is equalizated"
ng-model="$ctrl.address.isEqualizated"
vn-acl="administrative, salesAssistant">
</vn-check>
2018-03-01 22:38:14 +00:00
</vn-horizontal>
<vn-horizontal>
2019-10-09 22:47:29 +00:00
<vn-textfield
vn-one
label="Consignee"
ng-model="$ctrl.address.nickname"
rule
vn-focus>
</vn-textfield>
<vn-textfield
vn-one
label="Street"
ng-model="$ctrl.address.street"
rule>
</vn-textfield>
2018-03-01 22:38:14 +00:00
</vn-horizontal>
<vn-horizontal>
2019-10-09 22:47:29 +00:00
<vn-autocomplete
vn-one
vn-id="province"
ng-model="$ctrl.address.provinceFk"
url="/api/Provinces"
show-field="name"
value-field="id"
label="Province">
</vn-autocomplete>
2019-10-09 22:47:29 +00:00
<vn-textfield
vn-one
label="City"
2019-10-09 22:47:29 +00:00
ng-model="$ctrl.address.city"
rule>
</vn-textfield>
2019-10-09 22:47:29 +00:00
<!--
<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"
2019-10-09 22:47:29 +00:00
ng-model="$ctrl.address.city">
</vn-autocomplete>
2019-07-08 12:07:09 +00:00
<vn-autocomplete vn-one
url="/api/Postcodes/location"
fields="['code', 'townFk']"
2019-10-09 22:47:29 +00:00
ng-model="$ctrl.address.postalCode"
2019-08-02 06:27:55 +00:00
where="{townFk: town.selection.id}"
search-function="{code: $search}"
order="code, townFk"
show-field="code"
value-field="code"
label="Postcode">
2019-10-09 22:47:29 +00:00
</vn-autocomplete>
-->
<vn-textfield
vn-one
label="Postcode"
2019-10-09 22:47:29 +00:00
ng-model="$ctrl.address.postalCode"
rule>
</vn-textfield>
<!--
<vn-icon-button
vn-auto
class="vn-my-md"
2019-07-08 12:07:09 +00:00
icon="add_circle"
vn-tooltip="New postcode"
ng-click="postcode.open()">
</vn-icon-button>
-->
2018-03-01 22:38:14 +00:00
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete vn-one
initial-data="$ctrl.address.agencyMode"
2019-10-09 22:47:29 +00:00
ng-model="$ctrl.address.agencyModeFk"
url="/client/api/AgencyModes/isActive"
2018-03-01 22:38:14 +00:00
show-field="name"
value-field="id"
label="Agency">
</vn-autocomplete>
2019-10-09 22:47:29 +00:00
<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>
2018-03-01 22:38:14 +00:00
</vn-horizontal>
<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
vn-focus
data="types"
2019-10-09 22:47:29 +00:00
ng-model="observation.observationTypeFk"
2018-03-01 22:38:14 +00:00
show-field="description"
2018-03-13 12:41:54 +00:00
label="Observation type">
</vn-autocomplete>
2018-03-01 22:38:14 +00:00
<vn-textfield
vn-two
2018-03-01 22:38:14 +00:00
label="Description"
2019-10-09 22:47:29 +00:00
ng-model="observation.description"
2018-03-01 22:38:14 +00:00
rule="addressObservation.description">
</vn-textfield>
<vn-none>
<vn-icon-button
vn-tooltip="Remove note"
icon="delete"
ng-click="$ctrl.removeObservation($index)"
tabindex="-1">
</vn-icon-button>
</vn-none>
</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>
</div>
</vn-card>
<vn-button-bar>
2017-06-07 06:39:40 +00:00
<vn-submit label="Save"></vn-submit>
<vn-button ng-click="$ctrl.cancel()" label="Cancel"></vn-button>
</vn-button-bar>
</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>