Compare commits

...

2 Commits

6 changed files with 8 additions and 48 deletions

View File

@@ -122,7 +122,7 @@
<span>司机状态</span> <span>司机状态</span>
</div> </div>
<div class="isJoin"> <div class="isJoin">
<van-radio-group v-model="states" @change="isUse" :disabled="statesDisabled" :class="{ 'disabled-radio': statesDisabled }" class="joinWrap"> <van-radio-group v-model="states" @change="isUse" class="joinWrap">
<van-radio :name="1" style="margin-right: 26px" class="item"> <van-radio :name="1" style="margin-right: 26px" class="item">
启用 启用
<img <img
@@ -185,7 +185,6 @@ export default {
iconList: [], iconList: [],
driverInfo: {}, driverInfo: {},
drivingLicenceName: '', drivingLicenceName: '',
fromSupplierAdd: false, // 是否从 supplierAdd 进入
idCardAuthority:'', idCardAuthority:'',
idCardValidStartTime:'', idCardValidStartTime:'',
idCardValidEndTime:'', idCardValidEndTime:'',
@@ -223,13 +222,6 @@ export default {
this.identityCardFront = this.$route.params?.identityCardFront; this.identityCardFront = this.$route.params?.identityCardFront;
this.driverInfo.lssueDate = this.$route.params?.lssueDate; this.driverInfo.lssueDate = this.$route.params?.lssueDate;
this.drivingLicenceName = this.$route.params?.drivingLicenceName; this.drivingLicenceName = this.$route.params?.drivingLicenceName;
// 获取 fromSupplierAdd 标识
const fromSupplierAdd = this.$route.params?.fromSupplierAdd;
this.fromSupplierAdd = fromSupplierAdd === 'true';
// 如果从 supplierAdd 进入且不是修改模式,默认设置为停用状态
if(!this.id && this.fromSupplierAdd) {
this.states = 0;
}
if( this.identityCardFront ) { if( this.identityCardFront ) {
this.identityCardFrontList = [{ url : this.identityCardFront }]; this.identityCardFrontList = [{ url : this.identityCardFront }];
} }
@@ -464,12 +456,6 @@ export default {
},2000) },2000)
}, },
}, },
computed: {
// 司机状态是否禁用(从 supplierAdd 进入且非修改模式时禁用)
statesDisabled() {
return !this.id && this.fromSupplierAdd;
}
},
components:{ components:{
TwoCommonBtn, TwoCommonBtn,
CellGroup CellGroup
@@ -544,8 +530,4 @@ export default {
position: fixed; position: fixed;
bottom: 30px; bottom: 30px;
} }
.disabled-radio {
pointer-events: none;
opacity: 0.6;
}
</style> </style>

View File

@@ -137,7 +137,6 @@ export default {
supplierId: '', supplierId: '',
routeId: '', routeId: '',
initialized: false, initialized: false,
fromSupplierAdd: '', // 是否从 supplierAdd 进入
supplierType:'', supplierType:'',
count: 0, count: 0,
isLoading: false, isLoading: false,
@@ -187,8 +186,6 @@ export default {
this.supplierId = rawId ? Number(rawId) : ''; this.supplierId = rawId ? Number(rawId) : '';
const potentialId = this.$route.query.potentialId || urlParams.get('potentialId'); const potentialId = this.$route.query.potentialId || urlParams.get('potentialId');
this.routeId = potentialId; this.routeId = potentialId;
// 获取 fromSupplierAdd 标识
this.fromSupplierAdd = this.$route.query.fromSupplierAdd || urlParams.get('fromSupplierAdd') || '';
if(!rawId) { if(!rawId) {
this.getPermissions(); this.getPermissions();
} }
@@ -258,7 +255,7 @@ export default {
}else{ }else{
this.$router.push({ this.$router.push({
name: 'driverAdd', name: 'driverAdd',
params: this.supplierId ? { supplierId: this.supplierId, fromSupplierAdd: this.fromSupplierAdd } : {} params: this.supplierId ? { supplierId: this.supplierId } : {}
}) })
} }
}, },

View File

@@ -323,10 +323,6 @@
}); });
this.wechatId = res?.data?.wechatId this.wechatId = res?.data?.wechatId
}, },
isFromSupplierAdd() {
// 判断是否从 supplierAdd 进入
return this.$route.name === 'supplierAdd' || this.$route.query.fromSupplierAdd === 'true';
},
async saveHandler() { async saveHandler() {
if( this.clickFlag ) { if( this.clickFlag ) {
try { try {

View File

@@ -166,8 +166,8 @@
methods: { methods: {
goAddVehicle() { goAddVehicle() {
const supplierId = this.id const supplierId = this.id
localStorage.setItem('lastRoute', JSON.stringify({ name: 'vehicleManage', query: { id: supplierId, fromSupplierAdd: 'true' } })); localStorage.setItem('lastRoute', JSON.stringify({ name: 'vehicleManage', query: { id: supplierId } }));
this.goPage('vehicleManage', { id: supplierId, fromSupplierAdd: 'true' }); this.goPage('vehicleManage', { id: supplierId });
}, },
goModifyPage() { goModifyPage() {
this.goPage('supplierAdd', { id : this.id }) this.goPage('supplierAdd', { id : this.id })

View File

@@ -197,7 +197,7 @@
<span>车辆状态</span> <span>车辆状态</span>
</div> </div>
<div class="isJoin"> <div class="isJoin">
<van-radio-group v-model="vehicleStatus" :class="{ 'disabled-tree': vehicleInfoDisabled || vehicleStatusDisabled }" :disabled="vehicleInfoDisabled || vehicleStatusDisabled" @change="isVehicleChange" class="joinWrap"> <van-radio-group v-model="vehicleStatus" :class="{ 'disabled-tree': vehicleInfoDisabled }" :disabled="vehicleInfoDisabled" @change="isVehicleChange" class="joinWrap">
<van-radio :name="1" style="margin-right: 14px"> <van-radio :name="1" style="margin-right: 14px">
启用 启用
<img <img
@@ -471,7 +471,6 @@ export default {
checkList: [], checkList: [],
virtualVehicle: '', virtualVehicle: '',
vehicleStatus: '', vehicleStatus: '',
fromSupplierAdd: false, // 是否从 supplierAdd 进入
showDatePicker: false, showDatePicker: false,
dateVal: '', dateVal: '',
trailerService: '',//拖车服务 trailerService: '',//拖车服务
@@ -649,10 +648,6 @@ export default {
} else { } else {
return false return false
} }
},
// 车辆状态是否禁用(从 supplierAdd 进入且非修改模式时禁用)
vehicleStatusDisabled() {
return !this.id && this.fromSupplierAdd;
} }
}, },
watch:{ watch:{
@@ -694,9 +689,6 @@ export default {
const urlParams = new URLSearchParams(window.location.search); const urlParams = new URLSearchParams(window.location.search);
const rawId = this.$route.query.supplierId || urlParams.get('supplierId'); const rawId = this.$route.query.supplierId || urlParams.get('supplierId');
this.supplierId = rawId ? Number(rawId) : ''; this.supplierId = rawId ? Number(rawId) : '';
// 获取 fromSupplierAdd 标识
const fromSupplierAdd = this.$route.query.fromSupplierAdd || urlParams.get('fromSupplierAdd');
this.fromSupplierAdd = fromSupplierAdd === 'true';
await this.getSupplierServiceTree(); await this.getSupplierServiceTree();
await this.getTypeList(); await this.getTypeList();
if( this.id){ if( this.id){
@@ -713,10 +705,6 @@ export default {
liabilityInsuranceEndTime:'', liabilityInsuranceEndTime:'',
insurancePicturePhoto:'' insurancePicturePhoto:''
} }
// 如果从 supplierAdd 进入,默认设置为停用状态
if(this.fromSupplierAdd) {
this.vehicleStatus = 2;
}
} }
}, },
methods:{ methods:{

View File

@@ -11,7 +11,7 @@
@click-left="goBack" @click-left="goBack"
> >
<template slot="right" v-if="permissonList.includes('vehicleAddBtn') || supplierId"> <template slot="right" v-if="permissonList.includes('vehicleAddBtn') || supplierId">
<div class="rightWrap" @click="goPage('vehicleAdd', supplierId ? { supplierId, fromSupplierAdd } : {})"> <div class="rightWrap" @click="goPage('vehicleAdd', supplierId ? { supplierId } : {})">
<img src="@/assets/addImg.png" /> <img src="@/assets/addImg.png" />
<span class="addTxt">添加</span> <span class="addTxt">添加</span>
</div> </div>
@@ -149,7 +149,6 @@ export default {
searchVal: '', searchVal: '',
authStates: [], authStates: [],
liabilityInsuranceAuditList: [], liabilityInsuranceAuditList: [],
fromSupplierAdd: '', // 是否从 supplierAdd 进入
inputStatusListOptions: [{ inputStatusListOptions: [{
name: '行驶证未录入', name: '行驶证未录入',
value: 0 value: 0
@@ -206,8 +205,6 @@ export default {
} else { } else {
this.initialized = true; this.initialized = true;
} }
// 获取 fromSupplierAdd 标识
this.fromSupplierAdd = this.$route.query.fromSupplierAdd || urlParams.get('fromSupplierAdd') || '';
let _token = localStorage.getItem('token') let _token = localStorage.getItem('token')
if( _token ) { if( _token ) {
this.getPermissions(); this.getPermissions();
@@ -215,8 +212,8 @@ export default {
}, },
methods:{ methods:{
nextToDriver() { nextToDriver() {
localStorage.setItem('lastRoute', JSON.stringify({ name: 'driverManage', query: { id: this.supplierId, potentialId: this.routeId, fromSupplierAdd: this.fromSupplierAdd } })); localStorage.setItem('lastRoute', JSON.stringify({ name: 'driverManage', query: { id: this.supplierId, potentialId: this.routeId } }));
this.goPage('driverManage', { id: this.supplierId, potentialId: this.routeId, fromSupplierAdd: this.fromSupplierAdd }); this.goPage('driverManage', { id: this.supplierId, potentialId: this.routeId });
}, },
async getSupplierById(id) { async getSupplierById(id) {
let res = await supplierSelectById({ id }); let res = await supplierSelectById({ id });