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

110 lines
4.0 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>
2018-12-14 11:56:21 +00:00
<form name="form" ng-submit="$ctrl.submit()" compact>
2018-03-01 22:38:14 +00:00
<vn-card pad-large>
2018-07-25 13:14:03 +00:00
<vn-title>Edit address</vn-title>
2018-05-31 11:45:51 +00:00
<vn-horizontal pad-small-v>
2018-03-01 22:38:14 +00:00
<vn-check vn-one label="Enabled" field="$ctrl.address.isActive"></vn-check>
<vn-check
vn-one label="Is equalizated"
field="$ctrl.address.isEqualizated"
vn-acl="administrative, salesAssistant">
</vn-check>
2018-03-01 22:38:14 +00:00
</vn-horizontal>
<vn-horizontal>
<vn-textfield vn-one label="Consignee" field="$ctrl.address.nickname" vn-focus></vn-textfield>
<vn-textfield vn-one label="Street" field="$ctrl.address.street"></vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-textfield vn-one label="Postcode" field="$ctrl.address.postalCode"></vn-textfield>
<vn-textfield vn-one label="City" field="$ctrl.address.city"></vn-textfield>
<vn-autocomplete vn-one
initial-data="$ctrl.address.province"
field="$ctrl.address.provinceFk"
url="/client/api/Provinces"
show-field="name"
value-field="id"
label="Province">
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete vn-one
initial-data="$ctrl.address.agencyMode"
field="$ctrl.address.agencyModeFk"
url="/client/api/AgencyMode/isActive"
2018-03-01 22:38:14 +00:00
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-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"
2018-03-01 22:38:14 +00:00
field="observation.observationTypeFk"
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"
model="observation.description"
rule="addressObservation.description">
</vn-textfield>
<vn-none>
<vn-icon-button
2018-03-01 22:38:14 +00:00
medium-grey
margin-medium-v
vn-tooltip="Remove note"
icon="delete"
ng-click="$ctrl.removeObservation($index)"
tabindex="-1">
</vn-icon-button>
</vn-none>
</vn-horizontal>
</div>
<vn-icon-button
pointer
vn-bind="+"
vn-tooltip="Add note"
icon="add_circle"
ng-if="types.length > observations.length"
ng-click="model.insert()">
</vn-icon-button>
</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>