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

115 lines
4.5 KiB
HTML
Raw Normal View History

<mg-ajax path="/client/api/Clients/createWithUser" options="vnPost"></mg-ajax>
<vn-watcher
vn-id="watcher"
2017-02-21 10:36:43 +00:00
data="$ctrl.client"
2017-02-21 15:21:55 +00:00
form="form"
save="post">
</vn-watcher>
2019-01-30 22:47:06 +00:00
<div class="content-block">
2019-07-08 12:07:09 +00:00
<form name="form" vn-http-submit="$ctrl.onSubmit()" compact>
2018-03-01 22:38:14 +00:00
<vn-card pad-large>
<vn-horizontal>
2018-03-22 17:02:48 +00:00
<vn-textfield vn-two label="Comercial Name" field="$ctrl.client.name" vn-focus></vn-textfield>
2018-03-01 22:38:14 +00:00
<vn-autocomplete vn-one
field="$ctrl.client.salesPersonFk"
url="/client/api/Clients/activeWorkersWithRole"
search-function="{firstName: $search}"
show-field="firstName"
2018-03-01 22:38:14 +00:00
value-field="id"
where="{role: 'employee'}"
label="Salesperson">
<tpl-item>{{firstName}} {{name}}</tpl-item>
2018-03-01 22:38:14 +00:00
</vn-autocomplete>
</vn-horizontal>
2018-03-22 17:02:48 +00:00
<vn-horizontal>
2018-05-31 11:34:48 +00:00
<vn-textfield vn-two label="Business name" field="$ctrl.client.socialName"></vn-textfield>
<vn-textfield vn-one label="Tax number" field="$ctrl.client.fi"></vn-textfield>
</vn-horizontal>
<vn-horizontal>
2018-03-22 17:02:48 +00:00
<vn-textfield
vn-two
label="Street"
field="$ctrl.client.street">
</vn-textfield>
2018-05-31 11:34:48 +00:00
</vn-horizontal>
<vn-horizontal>
<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"
vn-tooltip="New postcode"
ng-click="postcode.open()">
</vn-icon-button>
2019-07-08 12:07:09 +00:00
<vn-autocomplete vn-one
url="/api/Postcodes/location"
fields="['code', 'townFk']"
field="$ctrl.client.postcode"
2019-07-08 12:07:09 +00:00
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>
2018-03-22 17:02:48 +00:00
</vn-horizontal>
2018-05-31 11:34:48 +00:00
<vn-horizontal>
<vn-textfield
vn-one
label="Web user"
field="$ctrl.client.userName">
</vn-textfield>
<vn-textfield
vn-one
label="Email"
field="$ctrl.client.email"
info="You can save multiple emails">
</vn-textfield>
</vn-horizontal>
2018-05-31 11:45:51 +00:00
<vn-horizontal pad-small-v>
2018-05-31 11:34:48 +00:00
<vn-check
vn-one
label="Is equalizated"
field="$ctrl.client.isEqualizated">
</vn-check>
</vn-horizontal>
2017-02-21 15:21:55 +00:00
</vn-card>
<vn-button-bar>
<vn-submit label="Create"></vn-submit>
2018-05-31 14:51:33 +00:00
<vn-button ui-sref="client.index" label="Cancel"></vn-button>
2017-02-21 15:21:55 +00:00
</vn-button-bar>
2019-01-30 22:47:06 +00:00
</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>
</div>