Autocomplete warehouse on agency selection
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Joan Sanchez 2020-09-23 14:13:44 +02:00
parent c49614b8cf
commit a8589d6945
3 changed files with 18 additions and 5 deletions

View File

@ -7,8 +7,10 @@
<form name="form">
<vn-card class="vn-w-md vn-pa-lg">
<vn-horizontal>
<vn-autocomplete vn-one
<vn-autocomplete
vn-one
vn-id="client"
required="true"
url="Clients"
label="Client"
show-field="name"
@ -18,7 +20,9 @@
initial-data="$ctrl.clientId"
order="id">
</vn-autocomplete>
<vn-autocomplete vn-one
<vn-autocomplete
vn-one
required="true"
data="$ctrl.addresses"
label="Address"
show-field="nickname"
@ -41,6 +45,7 @@
</append>
</vn-autocomplete>
<vn-autocomplete vn-one
required="true"
url="Warehouses"
label="Warehouse"
show-field="name"
@ -49,8 +54,9 @@
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete
<vn-autocomplete
vn-one
required="true"
url="Companies"
label="Company"
show-field="code"
@ -59,8 +65,8 @@
initial-data="$ctrl.ticket.companyFk">
</vn-autocomplete>
<vn-autocomplete
vn-id="agencyMode"
vn-one
vn-id="agencyMode"
url="AgencyModes/byWarehouse"
label="Agency"
show-field="name"
@ -70,6 +76,7 @@
</vn-autocomplete>
<vn-autocomplete
vn-one
required="true"
url="Zones/includingExpired"
label="Zone"
show-field="name"
@ -85,16 +92,19 @@
<vn-horizontal>
<vn-date-picker
vn-one
required="true"
label="Shipped"
ng-model="$ctrl.shipped">
</vn-date-picker>
<vn-input-time
vn-one
required="true"
label="Shipped hour"
ng-model="$ctrl.shipped">
</vn-input-time>
<vn-date-picker
vn-one
required="true"
label="Landed"
ng-model="$ctrl.landed">
</vn-date-picker>

View File

@ -99,6 +99,9 @@ class Controller extends Component {
if (!value) return;
const agencyMode = this.$.agencyMode.selection;
this.ticket.warehouseFk = agencyMode.warehouseFk;
this.getLanded({
shipped: this.ticket.shipped,
addressFk: this.ticket.addressFk,

View File

@ -25,7 +25,7 @@ module.exports = Self => {
filter = mergeFilters(filter, {where});
let stmt = new ParameterizedSQL(
`SELECT id, name
`SELECT id, name, warehouseFk
FROM (
SELECT DISTINCT am.id, am.name, am.isActive, zw.warehouseFk
FROM zoneWarehouse zw