Commit 8d53d716 authored by miaojiale's avatar miaojiale

接口增加followId

parent 5a18f64a
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
contrast contrast
:form-initial="formInitial" :form-initial="formInitial"
:survival-flag="survivalFlag" :survival-flag="survivalFlag"
:followId="followId"
@setFormJson="setFormJson" @setFormJson="setFormJson"
@handleConfirm="handleConfirm" @handleConfirm="handleConfirm"
@onPrev="onPrev" @onPrev="onPrev"
......
...@@ -108,6 +108,7 @@ export default { ...@@ -108,6 +108,7 @@ export default {
type: String, type: String,
default: "", default: "",
}, },
followId: String,
}, },
provide() { provide() {
return { return {
...@@ -163,6 +164,62 @@ export default { ...@@ -163,6 +164,62 @@ export default {
return this.loading || this.formloading return this.loading || this.formloading
}, },
}, },
watch: {
formEdit(val) {
console.log("回显3", val)
},
formInitial: {
handler(v) {
if (v) {
this.$set(this.formData, "formEdit", { ...v })
console.log(this.formData.formEdit)
}
},
deep: true,
},
},
created() {
if (sessionStorage.getItem("formEdit")) {
let data = JSON.parse(sessionStorage.getItem("formEdit"))
for (const key in data) {
if (typeof data[key] == "number") {
data[key] = data[key] + ""
}
}
this.formData.formEdit = data
}
this.initForm()
if (this.getAll) {
// 监听patientId 获取页面所有数据
this.$watch(
"patientId",
() => {
this.initData()
},
{ immediate: true }
)
} else {
// 监听form.silent 获取当前tab页数据
if (this.formType != 2) {
this.$watch(
"form.silent",
() => {
this.initData()
},
{ immediate: true }
)
}
}
},
mounted() {
//! 设置新增判断
if (this.$route.path == "/screening/add") {
// this.handleAdd()
if (!this.formData.formRecordId) {
this.handleAdd()
}
}
},
methods: { methods: {
resetForm() { resetForm() {
this.$refs.form.resetForm(false) this.$refs.form.resetForm(false)
...@@ -227,6 +284,9 @@ export default { ...@@ -227,6 +284,9 @@ export default {
if (this.isDraft) { if (this.isDraft) {
params.statusMap.is_draft = this.isDraft params.statusMap.is_draft = this.isDraft
} }
if (this.$route.path == "/followupentry" && this.activeName != "index1") {
params.followId = this.followId
}
this.$emit("handleConfirm", params, done, (res) => { this.$emit("handleConfirm", params, done, (res) => {
// 多次填写的表单新增时,获取最新数据 // 多次填写的表单新增时,获取最新数据
if (this.form.fillType === 1 && !this.formData.formRecordId) { if (this.form.fillType === 1 && !this.formData.formRecordId) {
...@@ -371,62 +431,6 @@ export default { ...@@ -371,62 +431,6 @@ export default {
}) })
}, },
}, },
watch: {
formEdit(val) {
console.log("回显3", val)
},
formInitial: {
handler(v) {
if (v) {
this.$set(this.formData, "formEdit", { ...v })
console.log(this.formData.formEdit)
}
},
deep: true,
},
},
created() {
if (sessionStorage.getItem("formEdit")) {
let data = JSON.parse(sessionStorage.getItem("formEdit"))
for (const key in data) {
if (typeof data[key] == "number") {
data[key] = data[key] + ""
}
}
this.formData.formEdit = data
}
this.initForm()
if (this.getAll) {
// 监听patientId 获取页面所有数据
this.$watch(
"patientId",
() => {
this.initData()
},
{ immediate: true }
)
} else {
// 监听form.silent 获取当前tab页数据
if (this.formType != 2) {
this.$watch(
"form.silent",
() => {
this.initData()
},
{ immediate: true }
)
}
}
},
mounted() {
//! 设置新增判断
if (this.$route.path == "/screening/add") {
// this.handleAdd()
if (!this.formData.formRecordId) {
this.handleAdd()
}
}
},
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
......
...@@ -93,6 +93,7 @@ export default { ...@@ -93,6 +93,7 @@ export default {
if (res.data) { if (res.data) {
this.isUpdated = true this.isUpdated = true
this.patientStandbyId = res.data.patientId this.patientStandbyId = res.data.patientId
this.followId = res.data.followId
this.newformRecordId = res.data.formRecordId this.newformRecordId = res.data.formRecordId
if ( if (
cb && cb &&
......
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