Commit 19955157 authored by gengchunlei's avatar gengchunlei

医生端 v1.2 1、表单在 物理返回按键下 正常返回上一步

parent bccac849
......@@ -59,6 +59,7 @@ import {
import GeneralFUForm from '@/doctor/followUp/generalFU/form/GeneralFUForm'
import CommonBottom from '@/doctor/followUp/generalFU/form/CommonBottom'
import { useStore } from '@/doctor/store'
const getModeEnum = (patientInfo = {}) => {
return {
mode1: [
......@@ -151,6 +152,17 @@ export default {
return this.$route.query
}
},
watch: {
'routerDetail': {
handler() {
if (this.routerDetail.step) {
this.step = this.routerDetail.step
} else {
this.step = 1
}
}
}
},
methods: {
async init() {
this.info = {}
......@@ -166,7 +178,7 @@ export default {
}
} else {
const res = await getChronicResidentsId(this.routerDetail.residentInfoId)
const weixinInfo = await getResidentWX({residentInfoId: this.routerDetail.residentInfoId})
const weixinInfo = await getResidentWX({ residentInfoId: this.routerDetail.residentInfoId })
const {
id,
createDate,
......@@ -190,13 +202,18 @@ export default {
},
async toNext(val) {
this.$refs.all.scrollTo(0, 0)
if (val == 2) {
this.firstForm = await this.$refs.baseInfo.onSubmit()
}
if (val == 3) {
await this.$refs.generalFUForm.onSubmit()
}
this.step = val
try {
if (val == 2) {
this.firstForm = await this.$refs.baseInfo.onSubmit()
} else if (val == 3) {
await this.$refs.generalFUForm.onSubmit()
} else { //返回上一步
this.$router.back()
return
}
this.step = val
this.toRouter(this.step)
} catch (e) {}
},
//图片上传
async upload(imgList = []) {
......@@ -241,15 +258,27 @@ export default {
fun(params, true).then(({ code }) => {
if (code == 'SUCCESS') {
this.store.onRefreshMark()
this.$router.back()
this.$router.push({
path:`/doctor/patient-detail`,
query: {
residentInfoId: this.routerDetail.residentInfoId
}
})
}
})
},
toRouter(val) {
this.$router.push({
path: '/doctor/followUp/generalFU/add',
query: { ...this.routerDetail, step: val }
})
},
toBack() {
if (this.step != 1) {
this.step--
return
}
// if (this.step != 1) {
// this.step--
// this.toRouter(this.step)
// return
// }
this.$router.back()
}
}
......
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