From f7dd1574445fb3274ba48bb05b3dca2508166f25 Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Fri, 4 Jul 2025 11:24:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E5=8A=9E=E7=90=86-=E9=A2=86?= =?UTF-8?q?=E7=94=A8=E8=AE=B0=E5=BD=95=E6=9F=A5=E8=AF=A2=E6=9F=A5=E7=9C=8B?= =?UTF-8?q?=E6=97=B6=E6=B2=A1=E6=9C=89=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/business/businessHandling/index.vue | 54 ++++++++++++++----- 1 file changed, 40 insertions(+), 14 deletions(-) diff --git a/src/views/business/businessHandling/index.vue b/src/views/business/businessHandling/index.vue index 0936f9c6..3a7dfd40 100644 --- a/src/views/business/businessHandling/index.vue +++ b/src/views/business/businessHandling/index.vue @@ -586,22 +586,48 @@ export default { } // 重置表单验证状态,避免旧的错误提示残留 this.$refs.maForm.clearValidate('deviceType') + }, + + // 监听一下路由的type + $route: { + handler(newVal) { + if (newVal.query.type == 'edit') { + this.isEdit = true + this.isDetail = false + this.id = newVal.query.id + const obj = Object.assign({}, newVal, { title: '领用申请编辑' }) + this.$tab.updatePage(obj) + } else if (newVal.query.type == 'detail') { + this.isEdit = false + this.isDetail = true + this.id = newVal.query.id + const obj = Object.assign({}, this.$route, { title: '领用申请详情' }) + this.$tab.updatePage(obj) + } + + if (this.isEdit || this.isDetail) { + console.log('isEdit', this.isEdit) + this.getTaskInfo() + } + }, + deep: true, + immediate: true } }, created() { // getCode() if (this.$route.query.type == 'edit') { - this.isEdit = true - this.isDetail = false - this.id = this.$route.query.id - const obj = Object.assign({}, this.$route, { title: '领用申请编辑' }) - this.$tab.updatePage(obj) + // this.isEdit = true + // this.isDetail = false + // this.id = this.$route.query.id + // const obj = Object.assign({}, this.$route, { title: '领用申请编辑' }) + // this.$tab.updatePage(obj) } else if (this.$route.query.type == 'detail') { - this.isEdit = false - this.isDetail = true - this.id = this.$route.query.id - const obj = Object.assign({}, this.$route, { title: '领用申请详情' }) - this.$tab.updatePage(obj) + // this.isEdit = false + // this.isDetail = true + // this.id = this.$route.query.id + // const obj = Object.assign({}, this.$route, { title: '领用申请详情' }) + // this.$tab.updatePage(obj) } else { this.isEdit = false this.isDetail = false @@ -613,10 +639,10 @@ export default { this.equipmentType() //机具类型下拉选 this.getStandardConfigList() // 标准配置下拉选 this.getMaTypeNameOpt() // 类型名称下拉选 - if (this.isEdit || this.isDetail) { - console.log('isEdit', this.isEdit) - this.getTaskInfo() - } + // if (this.isEdit || this.isDetail) { + // console.log('isEdit', this.isEdit) + // this.getTaskInfo() + // } console.log('🚀 ~ created ~ this.isDetail:', this.isDetail) console.log(this.$store, 'this.$store.getters') console.log(this.$route.query, 'this.$route.query')