Commit eb6af79b authored by songrui's avatar songrui

医生端 表单校验修改

parent 3735a1aa
...@@ -81,6 +81,14 @@ export default { ...@@ -81,6 +81,14 @@ export default {
return excludeType && excludeType.split(',').map(e => Number(e)) return excludeType && excludeType.split(',').map(e => Number(e))
} }
}, },
// 路由守卫
beforeRouteLeave(to, from) {
if ([2, 3].includes(this.step)) {
this.onBack()
return false
}
return true
},
created() { created() {
this.init() this.init()
}, },
...@@ -128,6 +136,7 @@ export default { ...@@ -128,6 +136,7 @@ export default {
this.store.onRefreshMark() this.store.onRefreshMark()
showSuccessToast('提交成功') showSuccessToast('提交成功')
setTimeout(() => { setTimeout(() => {
this.step++
this.$router.replace({ this.$router.replace({
path: '/doctor/workbench' path: '/doctor/workbench'
}) })
......
...@@ -368,7 +368,7 @@ export default { ...@@ -368,7 +368,7 @@ export default {
}, },
async submit() { async submit() {
try { try {
this.$refs.form.validate() await this.$refs.form.validate()
if (this.form.diseaseType === 4) { if (this.form.diseaseType === 4) {
const diagnoseResult = this.form.diagnoseResult || [] const diagnoseResult = this.form.diagnoseResult || []
if (!diagnoseResult.length && !this.form.diagnoseLevel) { if (!diagnoseResult.length && !this.form.diagnoseLevel) {
......
...@@ -32,7 +32,6 @@ import { getChronicResidentsId } from '@/api/doctor/generalFU' ...@@ -32,7 +32,6 @@ import { getChronicResidentsId } from '@/api/doctor/generalFU'
import { firstScreenDetail, saveFirstScreening, updateFirstScreening } from '@/api/doctor/screening.js' import { firstScreenDetail, saveFirstScreening, updateFirstScreening } from '@/api/doctor/screening.js'
import { fetchDataHandle } from '@/utils/common.js' import { fetchDataHandle } from '@/utils/common.js'
import { useStore } from '@/doctor/store' import { useStore } from '@/doctor/store'
import { showConfirmDialog } from 'vant'
export default { export default {
components: { 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