diff --git a/src/views/screening/components/ConfigForms.vue b/src/views/screening/components/ConfigForms.vue index 2f3f4b3e36fafcbe90de0e8b102a6e640a0d1cc5..8aa42e89ac27011515c14d317aff8ba201f45d5f 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 dbb9d5835bd4c026147297840552c3da6950b709..23175e127d27dbc1a0b54975c57547afb143cfa3 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() - } - } - }, }