5066-vehicleSorted #1467

Merged
carlossa merged 23 commits from 5066-vehicleSorted into dev 2023-07-18 15:21:57 +00:00
3 changed files with 10 additions and 14 deletions
Showing only changes of commit eff46c1cec - Show all commits

View File

@ -24,7 +24,7 @@ describe('Route basic Data path', () => {
const form = 'vn-route-basic-data form'; const form = 'vn-route-basic-data form';
const values = { const values = {
worker: 'adminBossNick', worker: 'adminBossNick',
vehicle: '1111-IMK - Warehouse One', vehicle: '1111-IMK',
created: nextMonth, created: nextMonth,
kmStart: 1, kmStart: 1,
kmEnd: 2, kmEnd: 2,

View File

@ -28,7 +28,8 @@
data="$ctrl.vehicles" data="$ctrl.vehicles"
show-field="numberPlate" show-field="numberPlate"
value-field="id" value-field="id"
order="false"> order="false"
vn-name="vehicle">
<tpl-item>{{::numberPlate}} - {{::name}}</tpl-item> <tpl-item>{{::numberPlate}} - {{::name}}</tpl-item>
</vn-autocomplete> </vn-autocomplete>
</vn-horizontal> </vn-horizontal>

View File

@ -2,23 +2,18 @@ import ngModule from '../module';
import Section from 'salix/components/section'; import Section from 'salix/components/section';
class Controller extends Section { class Controller extends Section {
$onInit() {
this.$http.post(`Vehicles/sorted`, {warehouseFk: this.vnConfig.warehouseFk})
.then(res => {
this.vehicles = res.data;
});
}
onSubmit() { onSubmit() {
this.$.watcher.submit().then(() => this.$.watcher.submit().then(() =>
this.card.reload() this.card.reload()
); );
} }
constructor($element, $) {
super($element, $);
this.$http.get(`UserConfigs/getUserConfig`)
.then(res => {
if (res.data) {
this.$http.post(`Vehicles/sorted`, {warehouseFk: res.data.warehouseFk})
.then(res => {
this.vehicles = res.data;
});
}
});
}
} }
ngModule.vnComponent('vnRouteBasicData', { ngModule.vnComponent('vnRouteBasicData', {