Commit 8d53d716 authored by miaojiale's avatar miaojiale

接口增加followId

parent 5a18f64a
......@@ -48,6 +48,7 @@
contrast
:form-initial="formInitial"
:survival-flag="survivalFlag"
:followId="followId"
@setFormJson="setFormJson"
@handleConfirm="handleConfirm"
@onPrev="onPrev"
......
......@@ -108,6 +108,7 @@ export default {
type: String,
default: "",
},
followId: String,
},
provide() {
return {
......@@ -163,6 +164,62 @@ export default {
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: {
resetForm() {
this.$refs.form.resetForm(false)
......@@ -227,6 +284,9 @@ export default {
if (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) => {
// 多次填写的表单新增时,获取最新数据
if (this.form.fillType === 1 && !this.formData.formRecordId) {
......@@ -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>
<style scoped lang="scss">
......
......@@ -93,6 +93,7 @@ export default {
if (res.data) {
this.isUpdated = true
this.patientStandbyId = res.data.patientId
this.followId = res.data.followId
this.newformRecordId = res.data.formRecordId
if (
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