5066-vehicleSorted #1467
|
@ -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,
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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', {
|
||||||
|
|
Loading…
Reference in New Issue