driver-vehicle.vue
5.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
<!-- 车辆详情 -->
<template>
<el-container class="customer-details-box">
<el-card
shadow="never"
style="width:100%;"
>
<div class="block">
<div class="car-base driver-vehicle">车辆信息</div>
<el-card
shadow="never"
class="form-box"
>
<div class="form-item-box">
<div class="form-item">
<span class="span-title">当前使用车辆:</span>
<el-input
v-model="driverTrucks.truckName"
:disabled="disabled"
placeholder="请输入当前使用车辆"
/>
</div>
<div class="form-item">
<span class="span-title">车辆所属线路:</span>
<el-input
v-model="driverTrucks.lineName"
:disabled="disabled"
placeholder="请输入车辆所属线路"
/>
</div>
<div class="form-item">
<span class="span-title">车辆所属车次:</span>
<el-input
v-model="driverTrucks.tripsName"
:disabled="disabled"
placeholder="请输入车辆所属车次"
/>
</div>
</div>
</el-card>
<div class="footer-box">
<el-button
class="cancel-btn"
@click="handleEditDriverList()"
>返回</el-button>
</div>
</div>
</el-card>
</el-container>
</template>
<script>
import { driverTruckList } from '@/api/transit'
export default {
data() {
return {
disabled: true,
driverTrucks: {
truckName: '',
lineName: '',
tripsName: ''
}
}
},
created() {
this.id = this.$route.query.id
this.getList(this.id)
},
methods: {
// 获取司机车辆安排信息
async getList(id) {
var _this = this
const { data: res } = await driverTruckList(id)
res.forEach(function(item, index) {
if (item.truck != null) {
_this.driverTrucks.truckName = item.truck.licensePlate
}
if (item.transportLine != null) {
_this.driverTrucks.lineName = item.transportLine.name
}
if (item.transportTrips != null) {
_this.driverTrucks.tripsName = item.transportTrips.name
}
})
},
// 返回触发跳转的页面
handleEditDriverList() {
// this.$router.push({ path: '/transit/driver' })
// this.$router.push('/transit/motorcade')
// if (this.$route.query.formUrlName) this.$router.push({ path: '/transit/driver' })
// else this.$router.push('/transit/motorcade')
if (this.$route.query.formUrlName === '车辆管理') {
this.$router.push('/transit/vehicle')
} else if (this.$route.query.formUrlName === '司机管理') {
this.$router.push('/transit/driver')
} else {
this.$router.push('/transit/motorcade')
}
}
}
}
</script>
<style lang="scss" scoped>
/deep/ .el-aside {
color: #333;
}
/deep/ .el-row {
margin-bottom: 20px;
}
.customer-details-box{
height:100%;
margin-left: 20px;
.block{
background-color: #FFFFFF;
width:100%;
padding: 0 24px;
}
.car-base{
color:#2A2929;
font-size:16px;
margin: 15px 0;
font-weight: 700;
}
.car-img-base{
margin: 25px 0;
border-bottom: 1px solid #e5e7ec;
.info-box{
border: 0 !important;
padding: 35px 0;
width: 100%;
}
}
.form-box{
border: 0 !important;
/deep/ .el-card__body{
padding: 15px 26px;
.form-item-box{
display: flex;
flex-wrap: wrap;
.form-item{
width: 50%;
display: flex;
align-items: center;
margin-top: 24px;
box-sizing: border-box;
&:nth-child(1),&:nth-child(2){
margin-top: 0;
}
&:nth-child(odd){
padding-right: 35px;
}
&:nth-child(even){
padding-left: 35px;
}
.span-title{
min-width: 120px;
font-weight: 400;
text-align: right;
color: #20232a;
font-size: 14px;
}
/deep/ .el-input{
flex: 1;
margin-left: 10px;
}
/deep/.el-input.is-disabled .el-input__inner{
background: #eff3f8;
border: 1px solid #d8dde3;
border-radius: 5px;
font-weight: 400;
color: #bac0cd;
}
}
}
}
}
.footer-box{
text-align: center;
margin-top: 20px;
padding: 30px 0 16px;
border-top: 1px solid #e5e7ec;
.save-btn{
background-color:#E15536;
color:#ffffff;
width:110px;
border-radius: 5px;
font-weight: 400;
border: 1px solid #E15536;
&:hover{
background: #ffab98;
border: 1px solid #ffab98;
}
}
.cancel-btn{
width:110px;
color: #2a2929;
border: 1px solid #d8dde3;
border-radius: 5px;
font-weight: 400;
&:hover{
background: #ffeeeb;
border: 1px solid #f3917c;
color: #e15536;
}
}
}
}
</style>