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

View File

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

View File

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