车辆管理,司机管理代码优化

This commit is contained in:
2023-08-30 14:48:50 +08:00
parent 5909b6081a
commit eb644563d9
5 changed files with 34 additions and 139 deletions

View File

@ -65,14 +65,14 @@
<span class="line"></span>
</div>
<div :ref="'checkboxGroup' + index" class="checkbox-group">
<van-checkbox-group v-model="serviceIds" v-for="(item2,index2) in item.children" :key="index2" class="radioWrap" @change="change">
<van-checkbox-group v-model="serviceIds" v-for="(item2,index2) in item.children" :key="index2" class="radioWrap" >
<van-checkbox class="item" :name="item2.id">{{item2.name }}</van-checkbox>
</van-checkbox-group>
</div>
</div>
</div>
<two-common-btn class="btn" @cancelClick="cancelBtn" @submitClick="submitBtn" />
<two-common-btn class="btn" @cancelClick="h5GoBack" @submitClick="submitBtn" />
</div>
</div>
</template>
@ -88,7 +88,6 @@ export default {
data(){
return{
trailerService: '',//拖车服务
smallRepairService: '',//小修服务
isJoin:'',//是否参与
activeIcon: require('@/assets/check.png'),
inactiveIcon: require('@/assets/uncheck.png'),
@ -153,23 +152,10 @@ export default {
this.selectedOption=result.vehicleType;
this.serviceIds=result.serviceIds
},
change(e) {
// this.trailerService=e
console.log(" this.trailerService",e, this.result)
},
change2(e) {
this.smallRepairService=e
},
isChange(e){
this.isJoin=e
},
cancelBtn(){//取消车辆
this.$router.back()
},
async submitBtn(){
// if(this.carNum || this.selectedOption || this.isJoin){
// this.$toast('必填字段未填写')
// }else{
await saveVehicle({
vehicleId:this.id ? this.id : '',
plateNumber:this.carNum ? this.carNum :'',
@ -186,7 +172,6 @@ export default {
this.$router.back();
},2000)
}
// },
},
components:{
CellGroup,
@ -203,10 +188,7 @@ export default {
color: #323643;
appearance: none;
padding-right: 16px;
background-image: url('@/assets/arrow_bot.png');
background-repeat: no-repeat;
background-position: right center;
background-size: 15px 14px; /* 自定义图像的大小 */
background: url('@/assets/arrow_bot.png') no-repeat right center / 15px 14px;
}
.checkbox-group {
display: none;
@ -221,8 +203,7 @@ export default {
.addContentWrap{
margin-left: 16px;
.itemContent{
display: flex;
justify-content: space-between;
@include flexColBet;
line-height: 56px;
box-sizing: border-box;
padding-right: 25px;
@ -271,11 +252,9 @@ export default {
}
.radioWrap{
margin-left: 10px;
//display: none;
}
.service{
opacity: .7;
color: #323643;
@include colorOpa(#323643,0.7);
line-height: 18px;
white-space: nowrap;
}
@ -291,11 +270,8 @@ export default {
}
}
.btn{
//margin-left: 8px;
width: 90%;
margin: 40px 0 30px 8px;
//position: fixed;
//bottom: 30px;
}
}
</style>