Commit eb6af79b authored by songrui's avatar songrui

医生端 表单校验修改

parent 3735a1aa
......@@ -81,6 +81,14 @@ export default {
return excludeType && excludeType.split(',').map(e => Number(e))
}
},
// 路由守卫
beforeRouteLeave(to, from) {
if ([2, 3].includes(this.step)) {
this.onBack()
return false
}
return true
},
created() {
this.init()
},
......@@ -128,6 +136,7 @@ export default {
this.store.onRefreshMark()
showSuccessToast('提交成功')
setTimeout(() => {
this.step++
this.$router.replace({
path: '/doctor/workbench'
})
......
......@@ -368,7 +368,7 @@ export default {
},
async submit() {
try {
this.$refs.form.validate()
await this.$refs.form.validate()
if (this.form.diseaseType === 4) {
const diagnoseResult = this.form.diagnoseResult || []
if (!diagnoseResult.length && !this.form.diagnoseLevel) {
......
......@@ -32,7 +32,6 @@ import { getChronicResidentsId } from '@/api/doctor/generalFU'
import { firstScreenDetail, saveFirstScreening, updateFirstScreening } from '@/api/doctor/screening.js'
import { fetchDataHandle } from '@/utils/common.js'
import { useStore } from '@/doctor/store'
import { showConfirmDialog } from 'vant'
export default {
components: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment