From 8e88d185a94fad372895812462109c4c626c3e55 Mon Sep 17 00:00:00 2001 From: miaojiale <1123971748@qq.com> Date: Mon, 9 Jan 2023 09:59:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=AC=AC=E5=9B=9B=E9=83=A8?= =?UTF-8?q?=E9=A3=8E=E9=99=A9=E8=AF=84=E4=BC=B0=E6=97=B6=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=9B=9E=E6=98=BE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screening/components/ConfigForms.vue | 16 +------ src/views/screening/components/FormTab.vue | 43 +++++-------------- 2 files changed, 12 insertions(+), 47 deletions(-) diff --git a/src/views/screening/components/ConfigForms.vue b/src/views/screening/components/ConfigForms.vue index a6dd43e..dee4b57 100644 --- a/src/views/screening/components/ConfigForms.vue +++ b/src/views/screening/components/ConfigForms.vue @@ -149,7 +149,7 @@ export default { watch: { activeName(val) { if (val == "index3") { - // setTimeout(() => { + // 第四步风险评估 this.$nextTick(() => { //! this.formInitial = { @@ -158,21 +158,9 @@ export default { screening_advise: "立刻住院", } }) - - // }, 300) } else { - this.formInitial = {} + this.formInitial = false } - // if(val=="index0" && this.formClass){ - // this.showIndex = false - // // this.survivalFlag = true - // console.log(1) - // } - // else{ - // this.showIndex = true - // // this.survivalFlag = false - // console.log(2) - // } }, }, computed: { diff --git a/src/views/screening/components/FormTab.vue b/src/views/screening/components/FormTab.vue index 39428fb..f1df7a5 100644 --- a/src/views/screening/components/FormTab.vue +++ b/src/views/screening/components/FormTab.vue @@ -92,6 +92,7 @@ export default { getAll: Boolean, // 获取页面所有数据 survivalFlag: Boolean, //存活的显示 formEdit: Object, + formInitial: {}, }, provide() { return { @@ -361,39 +362,6 @@ export default { return this.loading || this.formloading }, }, - watch: { - formInitial: { - handler(v) { - if (v) { - this.$set(this.formData, "formEdit", { ...v }) - console.log(this.formData.formEdit) - } - }, - deep: true, - }, - }, - created() { - this.initForm() - if (this.getAll) { - // 监听patientId 获取页面所有数据 - this.$watch( - "patientId", - () => { - this.initData() - }, - { immediate: true } - ) - } else { - // 监听form.silent 获取当前tab页数据 - this.$watch( - "form.silent", - () => { - this.initData() - }, - { immediate: true } - ) - } - }, methods: { initData() { this.formData.formRecordId = null @@ -559,6 +527,15 @@ export default { formEdit(val) { console.log("回显3", val) }, + formInitial: { + handler(v) { + if (v) { + this.$set(this.formData, "formEdit", { ...v }) + console.log(this.formData.formEdit) + } + }, + deep: true, + }, }, created() { if (this.$route.query.formEdit) { -- 2.22.0