diff --git a/src/components/FormComponents/CustomForm/FormItemText.vue b/src/components/FormComponents/CustomForm/FormItemText.vue index 4c87a69b7ce26fbf844c5cf6138741212640247d..8fec2effb645e6bdc270e28f67cddebbb2469f7d 100644 --- a/src/components/FormComponents/CustomForm/FormItemText.vue +++ b/src/components/FormComponents/CustomForm/FormItemText.vue @@ -25,7 +25,7 @@ {{ screeningAdvise[form[item.prop]] }} - {{ unionName }} + {{ handleUnionName(form[item.prop]) }} {{ form[item.prop] | getItemText(item.dicData, item.type) @@ -63,6 +63,22 @@ export default { }, } }, + computed: { + unionLists() { + let arr + if (sessionStorage.getItem("unionList")) { + arr = JSON.parse(sessionStorage.getItem("unionList")) + } else { + arr = [] + } + return arr + }, + }, + methods: { + handleUnionName(v) { + return this.unionLists.filter((e) => e.id == v)[0].unionName + }, + }, filters: { getItemText(val, list, type) { // 单选改为字符串 @@ -86,8 +102,9 @@ export default { }, watch: { unionList(v) { + console.log("获取到了医联体列表", this.form[this.item.prop]) if (v.length > 0 && this.form[this.item.prop]) { - // console.log("获取到了医联体列表", this.form[this.item.prop]) + console.log("获取到了医联体列表", this.form[this.item.prop]) this.unionName = v.filter( (e) => e.id == this.form[this.item.prop] )[0].unionName diff --git a/src/views/screening/components/ConfigForms.vue b/src/views/screening/components/ConfigForms.vue index d8eb5bd755ee49c26c64e4b085c8de26533751bc..5dd8348a6315751439e999de994cbb8abccf2d74 100644 --- a/src/views/screening/components/ConfigForms.vue +++ b/src/views/screening/components/ConfigForms.vue @@ -161,6 +161,7 @@ import mixin from "./mixin" import CustomForm from "@/components/FormComponents/CustomForm/index" import publicDialog from "../../audit-detail/components/publicDialog.vue" import { getPatientDetail, getFollowDetail } from "@/api/patient.js" +import { getMedicalunionList } from "@/api/medicalunion-management" export default { name: "ConfigForms", @@ -289,11 +290,23 @@ export default { created() { // 字典formType 1 筛查表单 2随访表单 // console.log('回显2',this.formEdit) + this.getMedicalunionList() this.getCurrentFormByType(this.formType) console.log(this.$route.path) this.infoCompelete = this.$route.path == "/followupentry" ? true : false }, methods: { + // 获取医联体列表 + getMedicalunionList() { + getMedicalunionList().then((res) => { + if (res.code == 1) { + let unionList = [...res.data] + sessionStorage.setItem("unionList", JSON.stringify(unionList)) + } else { + sessionStorage.removeItem("unionList") + } + }) + }, handleConfirm(data, done, cb) { console.log("提交", this.formType) if (this.formType == "2") {