From c41edeb92a90a2addbbb81bc29927a7097d4eeeb Mon Sep 17 00:00:00 2001 From: miaojiale <1123971748@qq.com> Date: Mon, 13 Mar 2023 15:20:54 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=A4=84=E7=90=86=E7=99=BB=E5=BD=95=202.?= =?UTF-8?q?=E9=9A=8F=E8=AE=BF=E5=BD=95=E5=85=A5=203.=E9=9A=8F=E8=AE=BF?= =?UTF-8?q?=E9=A3=8E=E9=99=A9=E8=AF=84=E4=BC=B0=204.=E9=9A=8F=E8=AE=BF?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E8=81=94=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/patient.js | 9 + src/components/layout/index.vue | 3 +- src/layouts/components/NavBar/index.vue | 8 +- src/views/followupentry/index.vue | 54 +++++- src/views/followupquery/index.vue | 158 +++++++++++------- src/views/followupresearch/index.vue | 7 +- .../screening/components/ConfigForms.vue | 131 +++++++++++---- src/views/screening/components/FormTab.vue | 62 +++++-- src/views/screening/components/mixin.js | 3 +- 9 files changed, 317 insertions(+), 118 deletions(-) diff --git a/src/api/patient.js b/src/api/patient.js index e69c186..fd37c67 100644 --- a/src/api/patient.js +++ b/src/api/patient.js @@ -69,6 +69,15 @@ export function getPatientDetail(params = {}) { }) } +/* 随访患者数据详情 */ +export function getFollowDetail(params = {}) { + return request({ + url: "/disease-data/data/patient/follow/info", + method: "get", + params, + }) +} + /* 获取表单填报记录list*/ export function getRecordList(params = {}) { return request({ diff --git a/src/components/layout/index.vue b/src/components/layout/index.vue index 697ada4..91a4755 100644 --- a/src/components/layout/index.vue +++ b/src/components/layout/index.vue @@ -135,7 +135,7 @@ export default { }, ], }, - allianceToken: getAccessToken(), + allianceToken: "", currentRoute: this.$route.path, userInfo: {}, } @@ -152,6 +152,7 @@ export default { // if (localStorage.getItem('allianceToken')) { // this.$router.push('/datacenter/home') // } + this.allianceToken = getAccessToken() this.userInfo = JSON.parse(localStorage.getItem("userInfo")) }, methods: { diff --git a/src/layouts/components/NavBar/index.vue b/src/layouts/components/NavBar/index.vue index da66aca..cb94524 100644 --- a/src/layouts/components/NavBar/index.vue +++ b/src/layouts/components/NavBar/index.vue @@ -174,9 +174,11 @@ export default { // this.getMessage() }, mounted() { - document - .querySelector(".messageBox") - .addEventListener("scroll", this.scrolling) + if (document.querySelector(".messageBox")) { + document + .querySelector(".messageBox") + .addEventListener("scroll", this.scrolling) + } }, methods: { scrolling() { diff --git a/src/views/followupentry/index.vue b/src/views/followupentry/index.vue index 497e97a..271ab6a 100644 --- a/src/views/followupentry/index.vue +++ b/src/views/followupentry/index.vue @@ -2,10 +2,14 @@
@@ -18,12 +22,48 @@ export default { ConfigForms, }, data() { - return { patientId: "" } + return { + disabled: false, + tabDisabled: true, + refreshFlag: true, + } }, - created() { - this.patientId = this.$route.query.patientId + provide() { + return { + tabFollowId: () => this.followId, + } + }, + computed: { + patientId() { + return this.$route.query.patientId + }, + model() { + return this.$route.query.model + }, + followId() { + return this.$route.query.followId + }, + getData() { + return Boolean(this.$route.query.getData - 0) + }, + }, + mounted() { + if (this.model == "view") { + this.disabled = true + this.tabDisabled = false + } else { + this.disabled = false + this.tabDisabled = true + } + }, + methods: { + refreshData(data) { + // this.refreshFlag = false + // this.$nextTick(() => { + // this.refreshFlag = true + // }) + }, }, - methods: {}, } diff --git a/src/views/followupquery/index.vue b/src/views/followupquery/index.vue index b1ad5e5..6976a14 100644 --- a/src/views/followupquery/index.vue +++ b/src/views/followupquery/index.vue @@ -2,7 +2,11 @@
- +
{ - return this.$handle.formatDicList(this.dictMap["d-sex"], row.sex + "") + return this.$handle.formatDicList( + this.dictMap["d-sex"], + row.sex + "" + ) }, }, { @@ -93,7 +101,10 @@ export default { minWidth: 120, value: "riskRank", formatter: (row) => { - return this.$handle.formatDicList(this.dictMap["risk_level"],String(row.riskRank)) + return this.$handle.formatDicList( + this.dictMap["risk_level"], + String(row.riskRank) + ) }, }, { @@ -109,7 +120,10 @@ export default { value: "followBatch", minWidth: 120, formatter: (row) => { - return this.$handle.formatDicList(this.dictMap["follow_type"],String(row.followBatch)) + return this.$handle.formatDicList( + this.dictMap["follow_type"], + String(row.followBatch) + ) }, }, { @@ -119,7 +133,7 @@ export default { operType: "button", operations: [ { - isIndex:true, + isIndex: true, func: this.rowOpration, formatter(row) { return { @@ -129,8 +143,8 @@ export default { }, }, { - isIndex:true, - func: this.rowOpration, + isIndex: true, + func: this.handleEdit, formatter(row) { if (row.checkStatus != 3 && row.checkStatus != 4) { return { @@ -164,7 +178,7 @@ export default { type: "select", label: "随访审核状态", prop: "checkStatus", - trans:"checkStatus", + trans: "checkStatus", placeholder: "请选择随访状态", rules: [], opts: [], @@ -173,7 +187,7 @@ export default { type: "select", label: "随访进度", prop: "followBatch", - trans:'follow_type', + trans: "follow_type", placeholder: "请选择随访进度", rules: [], opts: [], @@ -182,7 +196,7 @@ export default { type: "select", label: "计划随访时间", prop: "nextFollowTime", - trans:'next_follow_time', + trans: "next_follow_time", placeholder: "请选择计划随访时间", rules: [], opts: [], @@ -233,25 +247,43 @@ export default { ], }, ], - formEdit:{} + formEdit: {}, } }, watch: { - pageSize(val){ - sessionStorage.setItem('followQuery-pageSize',val) + pageSize(val) { + sessionStorage.setItem("followQuery-pageSize", val) }, //当前页 - pageIndex(val){ - sessionStorage.setItem('followQuery-pageIndex',val) - } + pageIndex(val) { + sessionStorage.setItem("followQuery-pageIndex", val) + }, + followId(v) { + if (v) { + this.listLoading = true + this.$nextTick(() => { + setTimeout(() => { + this.listLoading = false + let query = { ...this.$route.query } + this.$router.replace({ query: {} }) + this.$router.push({ + path: "/followupentry", + query: query, + }) + }, 500) + }) + } + }, }, - created(){ + created() { this.initSearchForm() }, mounted() { + this.followId = this.$route.query.followId // this.formEdit = sessionStorage.getItem('followQuery-form') ? JSON.parse(sessionStorage.getItem('followQuery-form')) : {} - this.pageSize = Number(sessionStorage.getItem('followQuery-pageSize')) || 10 - this.pageIndex = Number(sessionStorage.getItem('followQuery-pageIndex')) || 1 + this.pageSize = Number(sessionStorage.getItem("followQuery-pageSize")) || 10 + this.pageIndex = + Number(sessionStorage.getItem("followQuery-pageIndex")) || 1 this.getCurrentFormByType(2) }, methods: { @@ -266,69 +298,77 @@ export default { handleSizeChange(v) { console.log(v) }, - rowOpration(data, i,index) { - let model = 0 - switch(index){ - case 0: - model = 'view' - break; - case 1: - model = 'edit' - break; - } - this.$router.push({path:"/followupentry",query:{patientId:data.patientId,model:model}}) + handleEdit(data, i, index) { + this.$router.push({ + path: "/followupentry", + query: { + patientId: data.patientId, + followId: data.id, + model: "edit", + getData: 1, + }, + }) + }, + rowOpration(data, i, index) { + this.$router.push({ + path: "/followupentry", + query: { + patientId: data.patientId, + followId: data.id, + model: "view", + getData: 1, + }, + }) }, onSearch(form) { - sessionStorage.setItem('followQuery-form',JSON.stringify(form)) + sessionStorage.setItem("followQuery-form", JSON.stringify(form)) this.formEdit = form this.handleSearch() }, - async handleSearch(){ + async handleSearch() { this.listLoading = true - let params={ - pageSize:this.pageSize, - pageNum:this.pageIndex, - formId:this.formId, - patientFrom:sessionStorage.getItem('selectedIndex') //筛查场景 + let params = { + pageSize: this.pageSize, + pageNum: this.pageIndex, + formId: this.formId, + patientFrom: sessionStorage.getItem("selectedIndex"), //筛查场景 } - if(this.formEdit){ - params=Object.assign(this.formEdit,params) + if (this.formEdit) { + params = Object.assign(this.formEdit, params) } let res = await getFollowSearch(params) - if(res.code==1){ + if (res.code == 1) { //分页内容 const d = res.data - this.total= d.total - this.tableData=d['records'] + this.total = d.total + this.tableData = d["records"] } this.listLoading = false }, //查询表单枚举值字典 - initSearchForm(){ - this.formList.forEach((item,index) => { - if(item.trans){ - if(!item['opts']){ - item['opts']=[] - } - else{ - item['opts']=this.dictMap[item.trans] + initSearchForm() { + this.formList.forEach((item, index) => { + if (item.trans) { + if (!item["opts"]) { + item["opts"] = [] + } else { + item["opts"] = this.dictMap[item.trans] } } }) - this.$forceUpdate(); + this.$forceUpdate() }, //获取随访表单类型 getCurrentFormByType(type) { getCurrentFormByType({ type, - groupId: this.$store.state.user.group.groupId || '', + groupId: this.$store.state.user.group.groupId || "", + }).then((res) => { + if (res.code === 1) { + this.formId = res.data[0].id + this.handleSearch() + } }) - .then((res) => { - if (res.code === 1) { - this.formId = res.data[0].id - this.handleSearch() - } - }) }, }, } diff --git a/src/views/followupresearch/index.vue b/src/views/followupresearch/index.vue index 09822a1..0240872 100644 --- a/src/views/followupresearch/index.vue +++ b/src/views/followupresearch/index.vue @@ -284,7 +284,12 @@ export default { console.log("跳转", data, i) sessionStorage.setItem("formEdit", JSON.stringify(data)) this.$router.push({ - path: `/followupentry?patientId=${data.patientId}`, + path: `/followupentry`, + query: { + patientId: data.patientId, + getData: 0, + model: "add", + }, }) }, async handleSearch() { diff --git a/src/views/screening/components/ConfigForms.vue b/src/views/screening/components/ConfigForms.vue index d6793c1..d6dec73 100644 --- a/src/views/screening/components/ConfigForms.vue +++ b/src/views/screening/components/ConfigForms.vue @@ -40,15 +40,16 @@ :patient-standby-id="patientStandbyId" :newform-record-id="newformRecordId" :form="form" - :formType="formType" + :form-type="formType" + :get-data="getData" :disabled="disabled" :operation="operation" - :isDraft="isDraft" + :is-draft="isDraft" :active-name="activeName" contrast :form-initial="formInitial" :survival-flag="survivalFlag" - :followId="followId" + :follow-id="followId" @setFormJson="setFormJson" @handleConfirm="handleConfirm" @onPrev="onPrev" @@ -61,6 +62,7 @@
+ + + + + +
@@ -107,7 +138,7 @@ import mixin from "./mixin" import CustomForm from "@/components/FormComponents/CustomForm/index" import publicDialog from "../../audit-detail/components/publicDialog.vue" -import { getPatientDetail } from "@/api/patient.js" +import { getPatientDetail, getFollowDetail } from "@/api/patient.js" export default { name: "ConfigForms", @@ -121,6 +152,13 @@ export default { formClass: String, operation: String, isDraft: String, + getData: { type: Boolean, default: true }, + }, + inject: { + tabFollowId: { + type: String, + default: "", + }, }, data() { return { @@ -133,6 +171,9 @@ export default { } }, computed: { + getTabFollowId() { + return this.tabFollowId() + }, survivalFlag() { if (this.activeName == "index0" && this.formClass) { return true @@ -188,27 +229,35 @@ export default { if (val == "index3") { // 第四步风险评估 this.$nextTick(() => { - getPatientDetail({ - formId: this.formId, // 每个大表单的id - patientId: this.patientId || this.patientStandbyId, - // formRecordId: this.newformRecordId, - }) - .then((res) => { - const data = res.data.data - this.formInitial = data + if (this.formType == 2) { + // 随访回显 + getFollowDetail({ + formId: this.formId, // 每个大表单的id + followId: this.followId || this.getTabFollowId, + // formRecordId: this.newformRecordId, }) - .finally(() => { - this.loading = false + .then((res) => { + const data = res.data.data + this.formInitial = data + }) + .finally(() => { + this.loading = false + }) + } else { + // 筛查回显 + getPatientDetail({ + formId: this.formId, // 每个大表单的id + patientId: this.patientId || this.patientStandbyId, + // formRecordId: this.newformRecordId, }) - this.$nextTick(() => { - console.log("走了") - //! - // this.formInitial = { - // risk_rank: "中危", - // risk_score: "5分", - // screening_advise: "立刻住院", - // } - }) + .then((res) => { + const data = res.data.data + this.formInitial = data + }) + .finally(() => { + this.loading = false + }) + } }) } }, @@ -225,10 +274,6 @@ export default { console.log("提交", this.formType) if (this.formType == "2") { this.addFollowPatient(data, done, cb) - this.$emit("addMethods", { - activeName: this.activeName, - form: data.data, - }) } else { this.addPatient(data, done, cb) this.$emit("addMethods", { @@ -260,9 +305,14 @@ export default { formTab.temporarySave() // console.log(formTab) } else if (type == 3) { - //提交 + // 筛查提交 this.dialogType = "submit" - this.$refs.showDialog.dialogVisible = true + if (this.formType == 2) { + this.$refs.followDialog.dialogVisible = true + } else { + this.$refs.showDialog.dialogVisible = true + } + this.loading = false } else { // 返回 @@ -279,7 +329,6 @@ export default { } // 清空红字:不符合筛查条件 this.$refs.showDialog.dialogVisible = false - //判断路径 if (this.$route.path != "/screening/add") { this.$router.push("/screening/add") } @@ -300,6 +349,28 @@ export default { this.$refs.showDialog.dialogVisible = false // alert("跳转") }, + viewJumpFollow() { + // this.activeName = "index0" + this.$router.push({ + path: "/followupquery", + query: { + patientId: this.patientId, + followId: this.followId || this.tabFollowId, + model: "view", + getData: 1, + }, + }) + this.$refs.followDialog.dialogVisible = false + // this.$emit( + // "refreshData", + // JSON.stringify({ + // patientId: this.patientId, + // followId: this.followId || this.tabFollowId, + // model: "view", + // getData: 1, + // }) + // ) + }, }, provide() { return { diff --git a/src/views/screening/components/FormTab.vue b/src/views/screening/components/FormTab.vue index c7c1de8..d879b24 100644 --- a/src/views/screening/components/FormTab.vue +++ b/src/views/screening/components/FormTab.vue @@ -81,7 +81,11 @@