From 4afd404fa531da2120684353be7e8ce7c30a2244 Mon Sep 17 00:00:00 2001 From: miaojiale <1123971748@qq.com> Date: Wed, 8 Mar 2023 14:57:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=83=A8=E5=88=86=E9=9A=8F?= =?UTF-8?q?=E8=AE=BF=E8=A1=A8=E5=8D=95=E7=9A=84=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/patient.js | 9 ++++++ src/views/followupentry/index.vue | 7 ++-- src/views/followupresearch/index.vue | 2 +- .../screening/components/ConfigForms.vue | 29 +++++++++++------ src/views/screening/components/mixin.js | 32 ++++++++++++++++++- 5 files changed, 66 insertions(+), 13 deletions(-) diff --git a/src/api/patient.js b/src/api/patient.js index b12697e..e69c186 100644 --- a/src/api/patient.js +++ b/src/api/patient.js @@ -43,6 +43,15 @@ export function addPatient(data = {}, type = "") { }) } +// 随访录入 +export function addFollowPatient(data = {}, type = "") { + return request({ + url: `/disease-data/data/patient/follow/${type}`, + method: "post", + data, + }) +} + // 删除草稿 export function deletePatient(data) { return request({ diff --git a/src/views/followupentry/index.vue b/src/views/followupentry/index.vue index 5fe9b91..497e97a 100644 --- a/src/views/followupentry/index.vue +++ b/src/views/followupentry/index.vue @@ -5,6 +5,7 @@ form-type="2" formClass="follow-form" :disabled="false" + :patientId="patientId" > @@ -17,9 +18,11 @@ export default { ConfigForms, }, data() { - return {} + return { patientId: "" } + }, + created() { + this.patientId = this.$route.query.patientId }, - created() {}, methods: {}, } diff --git a/src/views/followupresearch/index.vue b/src/views/followupresearch/index.vue index c1d532f..ada02f8 100644 --- a/src/views/followupresearch/index.vue +++ b/src/views/followupresearch/index.vue @@ -282,7 +282,7 @@ export default { console.log("跳转", data, i) sessionStorage.setItem("formEdit", JSON.stringify(data)) this.$router.push({ - path: "/followupentry", + path: `/followupentry?patientId=${data.patientId}`, }) }, async handleSearch() { diff --git a/src/views/screening/components/ConfigForms.vue b/src/views/screening/components/ConfigForms.vue index 8b63c43..78dbac7 100644 --- a/src/views/screening/components/ConfigForms.vue +++ b/src/views/screening/components/ConfigForms.vue @@ -149,10 +149,12 @@ export default { watch: { activeName(val) { if (!this.disabled) { - if (!["index0", "index1"].includes(val)) { - this.infoCompelete = true - } else { - this.infoCompelete = false + if (this.$route.path != "/followupentry") { + if (!["index0", "index1"].includes(val)) { + this.infoCompelete = true + } else { + this.infoCompelete = false + } } } if (val == "index1") { @@ -218,11 +220,20 @@ export default { }, methods: { handleConfirm(data, done, cb) { - this.addPatient(data, done, cb) - this.$emit("addMethods", { - activeName: this.activeName, - form: data.data, - }) + console.log("提交", this.formType) + if (this.formType == "2") { + this.addFollowPatient(data, done, cb) + this.$emit("addMethods", { + activeName: this.activeName, + form: data.data, + }) + } else { + this.addPatient(data, done, cb) + this.$emit("addMethods", { + activeName: this.activeName, + form: data.data, + }) + } }, temporaryConfirm(data, done, cb) { this.addPatient(data, done, cb, () => { diff --git a/src/views/screening/components/mixin.js b/src/views/screening/components/mixin.js index c33ee4e..c4df937 100644 --- a/src/views/screening/components/mixin.js +++ b/src/views/screening/components/mixin.js @@ -1,4 +1,4 @@ -import { addPatient } from "@/api/patient.js" +import { addPatient, addFollowPatient } from "@/api/patient.js" import FormTab from "./FormTab" import { mapGetters } from "vuex" @@ -86,6 +86,36 @@ export default { } }) }, + async addFollowPatient(data, done, cb, ConfigFormsCallback) { + addFollowPatient(data, "") + .then((res) => { + // this.$message.success("操作成功") + if (res.data) { + this.isUpdated = true + this.patientStandbyId = res.data.patientId + this.newformRecordId = res.data.formRecordId + if ( + cb && + Object.prototype.toString.call(cb) === "[object Function]" + ) { + cb(res) + } + } + }) + .finally((e) => { + done() + console.log("走了", ConfigFormsCallback) + if ( + ConfigFormsCallback && + Object.prototype.toString.call(ConfigFormsCallback) === + "[object Function]" + ) { + ConfigFormsCallback() + } else { + this.nextTab() + } + }) + }, // json存储 setFormJson(formJson) { -- 2.22.0