-
+
diff --git a/src/views/screening/components/ConfigForms.vue b/src/views/screening/components/ConfigForms.vue
index 96a3df040371d1a820c0f679015645875a8863ec..4f0a7808bc0cf9360de2c0ad025dcbcf32832a74 100644
--- a/src/views/screening/components/ConfigForms.vue
+++ b/src/views/screening/components/ConfigForms.vue
@@ -1,13 +1,17 @@
-
+
{{ formType == 1 ? "临时保存" : "返回" }}
@@ -24,7 +28,9 @@
:key="form.id"
:label="form.label"
:name="'index' + index"
+ disabled
>
+
@@ -41,6 +47,7 @@
@setFormJson="setFormJson"
@handleConfirm="handleConfirm"
@onPrev="onPrev"
+ @temporaryConfirm="temporaryConfirm"
>
@@ -51,8 +58,7 @@
@@ -83,7 +89,7 @@
type="primary"
:loading="loading"
class="textBtn"
- @click="view"
+ @click="viewJump"
>查看
{
+ 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(() => {
getPatientDetail({
formId: this.formId, // 每个大表单的id
patientId: this.patientId || this.patientStandbyId,
- formRecordId: this.newformRecordId,
+ // formRecordId: this.newformRecordId,
})
.then((res) => {
- console.log(res)
+ const data = res.data.data
+ this.formInitial = data
})
.finally(() => {
this.loading = false
@@ -163,27 +200,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
}
},
},
@@ -200,25 +216,53 @@ 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"
+ // 保存逻辑处理
+ // !获取当前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"
this.$refs.showDialog.dialogVisible = true
-
this.loading = false
} else {
// 返回
this.$router.back()
}
},
- dialogSubmit() {},
- dialogCancel() {},
- continueSubmit() {},
+ continueSubmit() {
+ sessionStorage.removeItem("index1Data")
+ this.activeName = "index0"
+ // 清空表单
+ for (let i = 0; i < this.$refs.formTabs.length; i++) {
+ this.$refs.formTabs[i].resetForm()
+ this.$refs.formTabs[i].initForm()
+ }
+ // 清空红字:不符合筛查条件
+ this.$refs.showDialog.dialogVisible = false
+ },
+ viewJump() {
+ // this.$router.push('/')
+ alert("跳转")
+ },
},
provide() {
return {
@@ -230,11 +274,11 @@ export default {