From 9af26f9b32bf62889f717734accc5f98c928ed62 Mon Sep 17 00:00:00 2001 From: zhoulinf <2507241354@qq.com> Date: Thu, 6 Aug 2026 09:58:58 +0800 Subject: [PATCH] =?UTF-8?q?CRM=5F26-08-05#story#9126,=E8=BD=A6=E8=BE=86?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E3=80=81=E6=9C=8D=E5=8A=A1=E5=95=86=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E7=B3=BB=E7=BB=9F=E9=9C=80=E6=B1=82=EF=BC=88=E6=B8=85?= =?UTF-8?q?=E9=99=A4=E6=95=B0=E6=8D=AE=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/index/vehicleAdd.vue | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/views/index/vehicleAdd.vue b/src/views/index/vehicleAdd.vue index fc8508a4..73832839 100644 --- a/src/views/index/vehicleAdd.vue +++ b/src/views/index/vehicleAdd.vue @@ -723,18 +723,8 @@ export default { }, methods:{ async initPage() { - // 重置图片槽位,避免 keep-alive 缓存复用时残留上一辆车的图片 - this.vehicleLicenseFrontList = [] - this.vehicleLicenseBackList = [] - this.vehicleLicenseCarPhotoList = [] - this.vehicleFrontPhotoList = [] - this.insurancePictureFiles = [] - this.vehicleLicenseFront = '' - this.vehicleLicenseBack = '' - this.vehicleLicenseCarPhoto = '' - this.vehicleFrontPhoto = '' - this.insurancePicturePhoto = '' - this.vehicleLicenseBackOcrFlag = false + // 整体重置为初始 data(keep-alive 缓存复用时清空上一次的新增/修改数据,含 watcher 改过的 vehicleTypes.disabled),再按当前模式初始化 + Object.assign(this.$data, this.$options.data.call(this, this)) this.id=this.$route.params?.id this.approvalForm.supplierId=this.$route.params?.supplierId const urlParams = new URLSearchParams(window.location.search); @@ -745,6 +735,10 @@ export default { if( this.id){ await this.vehicleInfo() }else{ + // 新增:清空 el-tree 勾选状态(缓存复用时可能残留上一辆车的服务种类勾选) + this.$nextTick(() => { + this.$refs.tree && this.$refs.tree.setCheckedKeys([]) + }) this.originData={ vehicleType:'', vehicleStatus:'',