From 8d53d7164c60cf8970ea0ea52a39b5759b002d18 Mon Sep 17 00:00:00 2001 From: miaojiale <1123971748@qq.com> Date: Wed, 8 Mar 2023 16:35:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=A2=9E=E5=8A=A0followId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screening/components/ConfigForms.vue | 1 + src/views/screening/components/FormTab.vue | 116 +++++++++--------- src/views/screening/components/mixin.js | 1 + 3 files changed, 62 insertions(+), 56 deletions(-) diff --git a/src/views/screening/components/ConfigForms.vue b/src/views/screening/components/ConfigForms.vue index 2f3f4b3..8aa42e8 100644 --- a/src/views/screening/components/ConfigForms.vue +++ b/src/views/screening/components/ConfigForms.vue @@ -48,6 +48,7 @@ contrast :form-initial="formInitial" :survival-flag="survivalFlag" + :followId="followId" @setFormJson="setFormJson" @handleConfirm="handleConfirm" @onPrev="onPrev" diff --git a/src/views/screening/components/FormTab.vue b/src/views/screening/components/FormTab.vue index dbb9d58..23175e1 100644 --- a/src/views/screening/components/FormTab.vue +++ b/src/views/screening/components/FormTab.vue @@ -108,6 +108,7 @@ export default { type: String, default: "", }, + followId: String, }, provide() { return { @@ -163,6 +164,62 @@ export default { return this.loading || this.formloading }, }, + watch: { + 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 (sessionStorage.getItem("formEdit")) { + let data = JSON.parse(sessionStorage.getItem("formEdit")) + for (const key in data) { + if (typeof data[key] == "number") { + data[key] = data[key] + "" + } + } + this.formData.formEdit = data + } + this.initForm() + if (this.getAll) { + // 监å¬patientId 获å–页颿‰€æœ‰æ•°æ® + this.$watch( + "patientId", + () => { + this.initData() + }, + { immediate: true } + ) + } else { + // 监å¬form.silent 获å–当å‰tabé¡µæ•°æ® + if (this.formType != 2) { + this.$watch( + "form.silent", + () => { + this.initData() + }, + { immediate: true } + ) + } + } + }, + mounted() { + //! è®¾ç½®æ–°å¢žåˆ¤æ– + if (this.$route.path == "/screening/add") { + // this.handleAdd() + if (!this.formData.formRecordId) { + this.handleAdd() + } + } + }, methods: { resetForm() { this.$refs.form.resetForm(false) @@ -227,6 +284,9 @@ export default { if (this.isDraft) { params.statusMap.is_draft = this.isDraft } + if (this.$route.path == "/followupentry" && this.activeName != "index1") { + params.followId = this.followId + } this.$emit("handleConfirm", params, done, (res) => { // å¤šæ¬¡å¡«å†™çš„è¡¨å•æ–°å¢žæ—¶ï¼ŒèŽ·å–æœ€æ–°æ•°æ® if (this.form.fillType === 1 && !this.formData.formRecordId) { @@ -371,62 +431,6 @@ export default { }) }, }, - watch: { - 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 (sessionStorage.getItem("formEdit")) { - let data = JSON.parse(sessionStorage.getItem("formEdit")) - for (const key in data) { - if (typeof data[key] == "number") { - data[key] = data[key] + "" - } - } - this.formData.formEdit = data - } - this.initForm() - if (this.getAll) { - // 监å¬patientId 获å–页颿‰€æœ‰æ•°æ® - this.$watch( - "patientId", - () => { - this.initData() - }, - { immediate: true } - ) - } else { - // 监å¬form.silent 获å–当å‰tabé¡µæ•°æ® - if (this.formType != 2) { - this.$watch( - "form.silent", - () => { - this.initData() - }, - { immediate: true } - ) - } - } - }, - mounted() { - //! è®¾ç½®æ–°å¢žåˆ¤æ– - if (this.$route.path == "/screening/add") { - // this.handleAdd() - if (!this.formData.formRecordId) { - this.handleAdd() - } - } - }, } </script> <style scoped lang="scss"> diff --git a/src/views/screening/components/mixin.js b/src/views/screening/components/mixin.js index c4df937..cf67d7d 100644 --- a/src/views/screening/components/mixin.js +++ b/src/views/screening/components/mixin.js @@ -93,6 +93,7 @@ export default { if (res.data) { this.isUpdated = true this.patientStandbyId = res.data.patientId + this.followId = res.data.followId this.newformRecordId = res.data.formRecordId if ( cb && -- 2.22.0