@@ -6,6 +6,9 @@ import {trans} from "laravel-vue-i18n";
6
6
export default {
7
7
name: " TripCreationForm" ,
8
8
components: {StationRow},
9
+ mounted () {
10
+ this .loadOperators ();
11
+ },
9
12
data () {
10
13
return {
11
14
form: {
@@ -39,6 +42,7 @@ export default {
39
42
{value: " taxi" , text: " taxi" },
40
43
{value: " plane" , text: " plane" },
41
44
],
45
+ operators: null ,
42
46
disallowed: [" fahrrad" , " auto" , " fuss" , " fuß" , " foot" , " car" , " bike" ],
43
47
showDisallowed: false ,
44
48
};
@@ -125,6 +129,20 @@ export default {
125
129
return this .trainTypeInput .toLowerCase ().includes (disallowed);
126
130
});
127
131
},
132
+ loadOperators () {
133
+ fetch (" /api/v1/operators" , {
134
+ method: " GET" ,
135
+ headers: {
136
+ " Content-Type" : " application/json" ,
137
+ },
138
+ }).then ((data ) => {
139
+ if (data .ok ) {
140
+ data .json ().then ((result ) => {
141
+ this .operators = result .data ;
142
+ });
143
+ }
144
+ });
145
+ }
128
146
}
129
147
}
130
148
</script >
@@ -181,12 +199,12 @@ export default {
181
199
></StationRow >
182
200
</div >
183
201
<div class =" row g-3 mt-1" >
184
- <div class =" col-4 " >
202
+ <div class =" col-3 " >
185
203
<input type =" text" class =" form-control mobile-input-fs-16"
186
204
:placeholder =" trans('trip_creation.form.line')" v-model =" trainTypeInput"
187
205
@focusout =" checkDisallowed" >
188
206
</div >
189
- <div class =" col-4 " >
207
+ <div class =" col-3 " >
190
208
<input type =" text" class =" form-control mobile-input-fs-16"
191
209
:placeholder =" trans('trip_creation.form.number')" v-model =" journeyNumberInput" >
192
210
</div >
@@ -196,6 +214,12 @@ export default {
196
214
<option v-for =" category in categories" :value =" category.value" >{{ category.text }}</option >
197
215
</select >
198
216
</div >
217
+ <div class =" col" >
218
+ <select class =" form-select" v-model =" form.operatorId" >
219
+ <option selected >{{ trans("trip_creation.form.operator") }}</option >
220
+ <option v-for =" operator in operators" :value =" operator.id" >{{ operator.name }}</option >
221
+ </select >
222
+ </div >
199
223
</div >
200
224
<div class =" row g-3 mt-1" >
201
225
<span class =" text-danger" v-show =" showDisallowed" >
0 commit comments