Browse Source

提交成功隐藏提交按钮

newMaster
liuzhipeng 3 months ago
parent
commit
5b082e7971
  1. 119
      acupuncture-前台/src/views/screening/h5.vue

119
acupuncture-前台/src/views/screening/h5.vue

@ -1,5 +1,5 @@
<template> <template>
<div class="app-container"> <div class="app-container" v-loading="loading">
<div class="hospital">{{ tenantName || "- - - -" }}</div> <div class="hospital">{{ tenantName || "- - - -" }}</div>
<el-form <el-form
v-if="stepNum == 1" v-if="stepNum == 1"
@ -157,7 +157,7 @@
下一步 下一步
</el-button> </el-button>
</div> </div>
<div class="submit-box" v-if="stepNum == 2"> <div class="submit-box" v-if="stepNum == 2 && disabled">
<el-button type="primary" class="submit-box-but" @click="scaleSubmitForm"> <el-button type="primary" class="submit-box-but" @click="scaleSubmitForm">
提交 提交
</el-button> </el-button>
@ -177,9 +177,12 @@ export default {
name: "Notice", name: "Notice",
data() { data() {
return { return {
loading: false,
disabled: true,
hospitalId: "", hospitalId: "",
tenantName: "", tenantName: "",
stepNum: 1, // stepNum: 2, //
uploadFileUrl: process.env.VUE_APP_BASE_URL + "/baidu/ocr/idcardInfo", // uploadFileUrl: process.env.VUE_APP_BASE_URL + "/baidu/ocr/idcardInfo", //
fileList: [], fileList: [],
@ -331,15 +334,15 @@ export default {
}, },
], // ], //
form: { form: {
"SCWJ-NAME": "", "SCWJ-NAME": "测试患者",
"SCWJ-SEX": "", "SCWJ-SEX": "",
"SCWJ-BIRTH": "", "SCWJ-BIRTH": "1945-01-01",
"SCWJ-AGE": "", "SCWJ-AGE": "70",
"SCWJ-PHONE": "", "SCWJ-PHONE": "18534353638",
"SCWJ-HEIGHT": "", "SCWJ-HEIGHT": "170",
"SCWJ-WEIGHT": "", "SCWJ-WEIGHT": "80",
"SCWJ-BMI": "", "SCWJ-BMI": "24.56",
"SCWJ-JL": "", "SCWJ-JL": "正常",
"SCWJ-ZLFS": [], "SCWJ-ZLFS": [],
}, },
// //
@ -542,49 +545,55 @@ export default {
}, },
// //
async scaleSubmitForm() { async scaleSubmitForm() {
// ------ ------ try {
let score = 0; // ------ ------
// , topic${i} let score = 0;
for (let i = 1; i <= 24; i++) { // , topic${i}
if (this.form[`topic${i}`] !== undefined) { for (let i = 1; i <= 24; i++) {
score += this.form[`topic${i}`]; if (this.form[`topic${i}`] !== undefined) {
score += this.form[`topic${i}`];
}
} }
} // ------ ------
// ------ ------ const params = {
const params = { param: {
param: { type: 33,
type: 33, hospitalId: this.hospitalId,
hospitalId: this.hospitalId, centerId: this.hospitalId,
centerId: this.hospitalId, },
}, };
}; create(params).then(async (res) => {
create(params).then(async (res) => { this.loading = true;
this.detailId = res.data.detailId; this.detailId = res.data.detailId;
this.id = res.data.id; this.id = res.data.id;
// ------ ------ // ------ ------
// //
await this.saveAnswer(this.form["SCWJ-NAME"], "SCWJ-NAME"); await this.saveAnswer(this.form["SCWJ-NAME"], "SCWJ-NAME");
await this.saveAnswer(this.form["SCWJ-SEX"], "SCWJ-SEX"); await this.saveAnswer(this.form["SCWJ-SEX"], "SCWJ-SEX");
await this.saveAnswer(this.form["SCWJ-BIRTH"], "SCWJ-BIRTH"); await this.saveAnswer(this.form["SCWJ-BIRTH"], "SCWJ-BIRTH");
await this.saveAnswer(this.form["SCWJ-AGE"], "SCWJ-AGE"); await this.saveAnswer(this.form["SCWJ-AGE"], "SCWJ-AGE");
await this.saveAnswer(this.form["SCWJ-PHONE"], "SCWJ-PHONE"); await this.saveAnswer(this.form["SCWJ-PHONE"], "SCWJ-PHONE");
await this.saveAnswer(this.form["SCWJ-HEIGHT"], "SCWJ-HEIGHT"); await this.saveAnswer(this.form["SCWJ-HEIGHT"], "SCWJ-HEIGHT");
await this.saveAnswer(this.form["SCWJ-WEIGHT"], "SCWJ-WEIGHT"); await this.saveAnswer(this.form["SCWJ-WEIGHT"], "SCWJ-WEIGHT");
await this.saveAnswer(this.form["SCWJ-BMI"], "SCWJ-BMI"); await this.saveAnswer(this.form["SCWJ-BMI"], "SCWJ-BMI");
await this.saveAnswer(this.form["SCWJ-JL"], "SCWJ-JL"); await this.saveAnswer(this.form["SCWJ-JL"], "SCWJ-JL");
// //
await this.saveAnswer(score, "SCWJ-RESULT"); await this.saveAnswer(score, "SCWJ-RESULT");
await this.saveAnswer(this.form["SCWJ-ZLFS"].toString(), "SCWJ-ZLFS"); // await this.saveAnswer(this.form["SCWJ-ZLFS"].toString(), "SCWJ-ZLFS"); //
await this.saveAnswer(this.form["SCWJ-ZLZQ"], "SCWJ-ZLZQ"); // await this.saveAnswer(this.form["SCWJ-ZLZQ"], "SCWJ-ZLZQ"); //
// ------ ------ // ------ ------
const submitParams = { param: { detailId: this.detailId } }; const submitParams = { param: { detailId: this.detailId } };
await screenSubmit(submitParams).then((response) => { await screenSubmit(submitParams).then((response) => {
this.$modal.msgSuccess("提交成功"); this.loading = false;
// setTimeout(() => { this.disabled = false;
// location.reload(); this.$modal.msgSuccess("提交成功");
// }, 3000); });
}); });
}); } catch (error) {
this.loading = false;
console.log("提交失败:", error);
this.$message.error("提交失败,请稍后重试!");
}
}, },
// //
async saveAnswer(value, str) { async saveAnswer(value, str) {
@ -598,8 +607,8 @@ export default {
}; };
await screenSave(params).then((response) => {}); await screenSave(params).then((response) => {});
} catch (error) { } catch (error) {
console.log("error", error); console.log("保存失败:", error);
this.$message.error("网络异常,请检查您的网络!"); this.$message.error("保存失败,请稍后重试!");
} }
}, },
}, },

Loading…
Cancel
Save