-
+
diff --git a/src/views/screening/components/ConfigForms.vue b/src/views/screening/components/ConfigForms.vue
index 983f837de6c5b2da3e05eec331a0dadbdb98accb..403ebdc34f9858a08dba69464bfec876c1f9c28a 100644
--- a/src/views/screening/components/ConfigForms.vue
+++ b/src/views/screening/components/ConfigForms.vue
@@ -1,6 +1,12 @@
@@ -8,6 +14,7 @@
v-if="!disabled"
class="draftButton"
:loading="loading"
+ :disabled="!infoCompelete"
@click="onSubmit(formType)"
>{{ formType == 1 ? "临时保存" : "返回" }}
@@ -24,8 +31,8 @@
:key="form.id"
:label="form.label"
:name="'index' + index"
- disabled
>
+
@@ -42,6 +49,7 @@
@setFormJson="setFormJson"
@handleConfirm="handleConfirm"
@onPrev="onPrev"
+ @temporaryConfirm="temporaryConfirm"
>
@@ -50,7 +58,10 @@
-
+
已保存至草稿箱!
@@ -114,6 +125,7 @@ export default {
// survivalFlag:false
dialogType: "",
loading: false,
+ infoCompelete: false,
formInitial: {}, // 第四步的数据
}
},
@@ -135,7 +147,36 @@ export default {
},
watch: {
activeName(val) {
- console.log(this.formId)
+ if (!this.disabled) {
+ if (!["index0"].includes(val)) {
+ this.infoCompelete = true
+ } else {
+ this.infoCompelete = false
+ }
+ }
+ if (val == "index1") {
+ // 第二步问卷调查
+ this.$nextTick(() => {
+ let { birthday } = JSON.parse(sessionStorage.getItem("index1Data"))
+ let date = new Date(String(birthday).replace(/-/g, "/"))
+ let d = new Date()
+ let age =
+ d.getFullYear() -
+ date.getFullYear() -
+ (d.getMonth() < date.getMonth() ||
+ (d.getMonth() == date.getMonth() && d.getDate() < date.getDate())
+ ? 1
+ : 0)
+ //!
+ this.formInitial = {
+ birthday,
+ age,
+ }
+ })
+ } else {
+ this.formInitial = false
+ }
+
if (val == "index3") {
// 第四步风险评估
this.$nextTick(() => {
@@ -161,27 +202,6 @@ export default {
// }
})
})
- } else if (val == "index1") {
- // 第二步问卷调查
- this.$nextTick(() => {
- let { birthday } = JSON.parse(sessionStorage.getItem("index1Data"))
- let date = new Date(String(birthday).replace(/-/g, "/"))
- let d = new Date()
- let age =
- d.getFullYear() -
- date.getFullYear() -
- (d.getMonth() < date.getMonth() ||
- (d.getMonth() == date.getMonth() && d.getDate() < date.getDate())
- ? 1
- : 0)
- //!
- this.formInitial = {
- birthday,
- age,
- }
- })
- } else {
- this.formInitial = false
}
},
},
@@ -198,16 +218,28 @@ export default {
form: data.data,
})
},
+ temporaryConfirm(data, done, cb) {
+ this.addPatient(data, done, cb, () => {
+ console.log("倒了")
+ this.$refs.showDialog.dialogVisible = true
+ this.loading = false
+ })
+ },
onPrev(done) {
this.prevTab(done)
},
onSubmit(type) {
- this.loading = true
+ // this.loading = true
if (type == 1) {
// 临时保存草稿
this.dialogType = "draft"
- this.$refs.showDialog.dialogVisible = true
- this.loading = false
+ // 保存逻辑处理
+ // !获取当前tab的formTab
+ let formTab = this.$refs.formTabs.filter(
+ (e) => e.form.formId == this.formId
+ )[0]
+ formTab.temporarySave()
+ // console.log(formTab)
} else if (type == 2) {
//提交
this.dialogType = "submit"
@@ -227,7 +259,6 @@ export default {
this.$refs.formTabs[i].initForm()
}
// 清空红字:不符合筛查条件
-
this.$refs.showDialog.dialogVisible = false
},
viewJump() {
@@ -245,7 +276,6 @@ export default {