From 37fa3f5e67720dc8f8e3697061580cdcec0ac3cc Mon Sep 17 00:00:00 2001 From: "1747191978@qq.com" <1942943850@qq.com> Date: Mon, 14 Apr 2025 12:15:50 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AD=9B=E6=9F=A5id=E5=AD=98=E5=9C=A8=E5=88=99?= =?UTF-8?q?=E6=98=AF=E4=BF=AE=E6=94=B9=EF=BC=8C=E5=90=A6=E5=88=99=E6=98=AF?= =?UTF-8?q?=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/screening/h5eva.vue | 103 +++++++++--------- 1 file changed, 51 insertions(+), 52 deletions(-) diff --git a/acupuncture-前台/src/views/screening/h5eva.vue b/acupuncture-前台/src/views/screening/h5eva.vue index 071d7a54..9f636f21 100644 --- a/acupuncture-前台/src/views/screening/h5eva.vue +++ b/acupuncture-前台/src/views/screening/h5eva.vue @@ -316,7 +316,8 @@ export default { open: false, loading: false, disabled: true, - detailList: {}, + detailList: {}, // 筛查患者详情 + detailId: null, // 筛查患者id tenantId: "", tenantName: "", stepNum: 1, // 步骤数 @@ -649,7 +650,9 @@ export default { // 编辑信息 handleContinue() { this.form = { ...this.form, ...this.detailList }; - this.open = false; + setTimeout(() => { + this.open = false; + }, 200); }, // 查看结果 handleResult() { @@ -673,6 +676,7 @@ export default { this.detailList = {}; if (res.data.list.length) { let data = res.data.list[0]; + this.detailId = data.id; data.detailList.forEach((item) => { this.detailList[item.questionCode] = item.answer; }); @@ -901,58 +905,17 @@ export default { centerId: this.tenantId, }, }; - create(params).then(async (res) => { + // detailId 存在,说明是编辑 + if (this.detailId) { this.loading = true; - this.detailId = res.data.detailId; - this.id = res.data.id; - // ------ 保存答案 ------ - // 基本信息 - await this.saveAnswer(this.form["SCWJ-DW"], "SCWJ-DW"); - await this.saveAnswer(this.form["SCWJ-NAME"], "SCWJ-NAME"); - await this.saveAnswer(this.form["SCWJ-SEX"], "SCWJ-SEX"); - await this.saveAnswer(this.form["SCWJ-BIRTH"], "SCWJ-BIRTH"); - await this.saveAnswer(this.form["SCWJ-AGE"], "SCWJ-AGE"); - await this.saveAnswer(this.form["SCWJ-PHONE"], "SCWJ-PHONE"); - await this.saveAnswer(this.form["SCWJ-HEIGHT"], "SCWJ-HEIGHT"); - await this.saveAnswer(this.form["SCWJ-WEIGHT"], "SCWJ-WEIGHT"); - await this.saveAnswer(this.form["SCWJ-BMI"], "SCWJ-BMI"); - await this.saveAnswer(this.form["SCWJ-JL"], "SCWJ-JL"); - await this.saveAnswer(this.form["SCWJ-SCSJ"], "SCWJ-SCSJ"); - await this.saveAnswer(this.form["SCWJ-RSSJ"], "SCWJ-RSSJ"); - await this.saveAnswer(this.form["SCWJ-SXSJ"], "SCWJ-SXSJ"); - await this.saveAnswer(this.form["SCWJ-QCSJ"], "SCWJ-QCSJ"); - await this.saveAnswer(this.form["SCWJ-SMXL"], "SCWJ-SMXL"); - // 现病史暂时去掉(甲方:把疾病风险选择去掉,领导说太占时间了) - // await this.saveAnswer( - // this.form["SCWJ-XBS"].toString(), - // "SCWJ-XBS" - // ); - // await this.saveAnswer(this.form["SCWJ-XBS-QT"], "SCWJ-XBS-QT"); - await this.saveAnswer(this.tips, "SCREEN-JL"); - - // 筛查总分 - // await this.saveAnswer(score, "SCWJ-RESULT"); - // await this.saveAnswer( - // this.form["SCWJ-ZLFS"].toString(), - // "SCWJ-ZLFS" - // ); // 治疗方式 - // await this.saveAnswer(this.form["SCWJ-ZLZQ"], "SCWJ-ZLZQ"); // 治疗周期 - // ------ 提交筛查 ------ - const submitParams = { param: { detailId: this.detailId } }; - await screenSubmit(submitParams).then((response) => { - this.loading = false; - this.disabled = false; - this.$modal.msgSuccess("提交成功"); + this.handlesaveCommit(); + } else { + create(params).then(async (res) => { + this.loading = true; + this.detailId = res.data.detailId; + this.handlesaveCommit(); }); - // 根据筛查结果,判断是否需要显示二维码 - this.$router.replace({ - path: "/screening/h5Result", - query: { - tenantName: this.tenantName, - data: JSON.stringify(this.form), - }, - }); - }); + } } }); } catch (error) { @@ -962,6 +925,42 @@ export default { this.$message.error("提交失败,请稍后重试!"); } }, + // 保存答案、提交 + async handlesaveCommit() { + // ------ 保存答案 ------ + // 基本信息 + await this.saveAnswer(this.form["SCWJ-DW"], "SCWJ-DW"); + await this.saveAnswer(this.form["SCWJ-NAME"], "SCWJ-NAME"); + await this.saveAnswer(this.form["SCWJ-SEX"], "SCWJ-SEX"); + await this.saveAnswer(this.form["SCWJ-BIRTH"], "SCWJ-BIRTH"); + await this.saveAnswer(this.form["SCWJ-AGE"], "SCWJ-AGE"); + await this.saveAnswer(this.form["SCWJ-PHONE"], "SCWJ-PHONE"); + await this.saveAnswer(this.form["SCWJ-HEIGHT"], "SCWJ-HEIGHT"); + await this.saveAnswer(this.form["SCWJ-WEIGHT"], "SCWJ-WEIGHT"); + await this.saveAnswer(this.form["SCWJ-BMI"], "SCWJ-BMI"); + await this.saveAnswer(this.form["SCWJ-JL"], "SCWJ-JL"); + await this.saveAnswer(this.form["SCWJ-SCSJ"], "SCWJ-SCSJ"); + await this.saveAnswer(this.form["SCWJ-RSSJ"], "SCWJ-RSSJ"); + await this.saveAnswer(this.form["SCWJ-SXSJ"], "SCWJ-SXSJ"); + await this.saveAnswer(this.form["SCWJ-QCSJ"], "SCWJ-QCSJ"); + await this.saveAnswer(this.form["SCWJ-SMXL"], "SCWJ-SMXL"); + await this.saveAnswer(this.tips, "SCREEN-JL"); + // ------ 提交筛查 ------ + const submitParams = { param: { detailId: this.detailId } }; + await screenSubmit(submitParams).then((response) => { + this.loading = false; + this.disabled = false; + this.$modal.msgSuccess("提交成功"); + }); + // 根据筛查结果,判断是否需要显示二维码 + this.$router.replace({ + path: "/screening/h5Result", + query: { + tenantName: this.tenantName, + data: JSON.stringify(this.form), + }, + }); + }, // 保存答案 async saveAnswer(value, str) { try {