diff --git a/src/views/index/driverAdd.vue b/src/views/index/driverAdd.vue index 0d7172c5..bf3e2041 100644 --- a/src/views/index/driverAdd.vue +++ b/src/views/index/driverAdd.vue @@ -222,6 +222,12 @@ export default { this.identityCardFront = this.$route.params?.identityCardFront; this.driverInfo.lssueDate = this.$route.params?.lssueDate; this.drivingLicenceName = this.$route.params?.drivingLicenceName; + // 获取 fromSupplierAdd 标识 + const fromSupplierAdd = this.$route.params?.fromSupplierAdd; + // 如果从 supplierAdd 进入且不是修改模式,默认设置为停用状态 + if(!this.id && fromSupplierAdd === 'true') { + this.states = 0; + } if( this.identityCardFront ) { this.identityCardFrontList = [{ url : this.identityCardFront }]; } diff --git a/src/views/index/driverManage.vue b/src/views/index/driverManage.vue index c0277129..65222bd5 100644 --- a/src/views/index/driverManage.vue +++ b/src/views/index/driverManage.vue @@ -137,6 +137,7 @@ export default { supplierId: '', routeId: '', initialized: false, + fromSupplierAdd: '', // 是否从 supplierAdd 进入 supplierType:'', count: 0, isLoading: false, @@ -186,6 +187,8 @@ export default { this.supplierId = rawId ? Number(rawId) : ''; const potentialId = this.$route.query.potentialId || urlParams.get('potentialId'); this.routeId = potentialId; + // 获取 fromSupplierAdd 标识 + this.fromSupplierAdd = this.$route.query.fromSupplierAdd || urlParams.get('fromSupplierAdd') || ''; if(!rawId) { this.getPermissions(); } @@ -255,7 +258,7 @@ export default { }else{ this.$router.push({ name: 'driverAdd', - params: this.supplierId ? { supplierId: this.supplierId } : {} + params: this.supplierId ? { supplierId: this.supplierId, fromSupplierAdd: this.fromSupplierAdd } : {} }) } }, diff --git a/src/views/index/supplierAdd.vue b/src/views/index/supplierAdd.vue index 39c69048..6d0e927f 100644 --- a/src/views/index/supplierAdd.vue +++ b/src/views/index/supplierAdd.vue @@ -323,6 +323,10 @@ }); this.wechatId = res?.data?.wechatId }, + isFromSupplierAdd() { + // 判断是否从 supplierAdd 进入 + return this.$route.name === 'supplierAdd' || this.$route.query.fromSupplierAdd === 'true'; + }, async saveHandler() { if( this.clickFlag ) { try { diff --git a/src/views/index/supplierInfo.vue b/src/views/index/supplierInfo.vue index 47aa81d8..c222cffc 100644 --- a/src/views/index/supplierInfo.vue +++ b/src/views/index/supplierInfo.vue @@ -166,8 +166,8 @@ methods: { goAddVehicle() { const supplierId = this.id - localStorage.setItem('lastRoute', JSON.stringify({ name: 'vehicleManage', query: { id: supplierId } })); - this.goPage('vehicleManage', { id: supplierId }); + localStorage.setItem('lastRoute', JSON.stringify({ name: 'vehicleManage', query: { id: supplierId, fromSupplierAdd: 'true' } })); + this.goPage('vehicleManage', { id: supplierId, fromSupplierAdd: 'true' }); }, goModifyPage() { this.goPage('supplierAdd', { id : this.id }) diff --git a/src/views/index/vehicleAdd.vue b/src/views/index/vehicleAdd.vue index 1e0399ac..305a1a43 100644 --- a/src/views/index/vehicleAdd.vue +++ b/src/views/index/vehicleAdd.vue @@ -689,6 +689,8 @@ export default { const urlParams = new URLSearchParams(window.location.search); const rawId = this.$route.query.supplierId || urlParams.get('supplierId'); this.supplierId = rawId ? Number(rawId) : ''; + // 获取 fromSupplierAdd 标识 + const fromSupplierAdd = this.$route.query.fromSupplierAdd || urlParams.get('fromSupplierAdd'); await this.getSupplierServiceTree(); await this.getTypeList(); if( this.id){ @@ -705,6 +707,10 @@ export default { liabilityInsuranceEndTime:'', insurancePicturePhoto:'' } + // 如果从 supplierAdd 进入,默认设置为停用状态 + if(fromSupplierAdd === 'true') { + this.vehicleStatus = 2; + } } }, methods:{ diff --git a/src/views/index/vehicleManage.vue b/src/views/index/vehicleManage.vue index 1d9404f3..93bebc77 100644 --- a/src/views/index/vehicleManage.vue +++ b/src/views/index/vehicleManage.vue @@ -11,7 +11,7 @@ @click-left="goBack" >