Commit c41edeb9 authored by miaojiale's avatar miaojiale

1.处理登录

2.随访录入
3.随访风险评估
4.随访查询联动
parent 86be8412
......@@ -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({
......
......@@ -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: {
......
......@@ -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() {
......
......@@ -2,10 +2,14 @@
<!-- 随访调查录入 -->
<div>
<ConfigForms
v-if="refreshFlag"
form-type="2"
formClass="follow-form"
:disabled="false"
:patientId="patientId"
form-class="follow-form"
:disabled="disabled"
:tab-disabled="tabDisabled"
:get-data="getData"
:patient-id="patientId"
@refreshData="refreshData"
></ConfigForms>
</div>
</template>
......@@ -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: {},
}
</script>
......
......@@ -2,7 +2,11 @@
<!-- 随访查询 -->
<div class="screeningSearch">
<div class="top">
<form-components :forms="formList" :formEdit="formEdit" @handleSearch="onSearch"></form-components>
<form-components
:forms="formList"
:form-edit="formEdit"
@handleSearch="onSearch"
></form-components>
</div>
<div class="bot">
<el-table-self
......@@ -31,11 +35,12 @@ import { getDictDetail } from "@/api/dict.js"
export default {
components: {
FormComponents,
CustomsTable,
// CustomsTable,
},
mixins: [paginationMixin],
data() {
return {
followId: "",
listLoading: false,
keyword: "",
modifiedFlag: false,
......@@ -61,7 +66,10 @@ export default {
minWidth: 80,
value: "sex",
formatter: (row) => {
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()
}
})
},
},
}
......
......@@ -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() {
......
......@@ -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 @@
</el-tabs>
</div>
<el-empty v-else description="暂无数据"></el-empty>
<!-- 筛查提交弹窗 -->
<public-dialog ref="showDialog" :show-close="true">
<!-- 保存草稿 -->
<template v-if="dialogType == 'draft'" slot="content">
......@@ -100,6 +102,35 @@
</div>
</template>
</public-dialog>
<!-- 随访提交弹窗 -->
<public-dialog ref="followDialog" :show-close="true">
<!-- 保存提交 -->
<template slot="content">
<div class="title center">提交成功!</div>
<div class="content center">
<div class="img">
<img src="~@/assets/img/DataCenter/submit.png" alt />
</div>
<div class="showTips">您可以在【随访查询】页面查询到该数据</div>
</div>
<div class="btn">
<el-button
type="primary"
:loading="loading"
class="textBtn"
@click="viewJumpFollow"
>查看</el-button
>
<el-button
v-if="formType != 2"
type="primary"
:loading="loading"
@click="continueSubmit"
>继续添加</el-button
>
</div>
</template>
</public-dialog>
</div>
</template>
......@@ -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 {
......
......@@ -81,7 +81,11 @@
</el-container>
</template>
<script>
import { getPatientDetail, getRecordList } from "@/api/patient.js"
import {
getPatientDetail,
getRecordList,
getFollowDetail,
} from "@/api/patient.js"
import { getFormDetail } from "@/api/field"
import CustomForm from "@/components/FormComponents/CustomForm/index"
import ReadForm from "@/components/FormComponents/ReadForm/index"
......@@ -93,6 +97,7 @@ export default {
activeName: String,
externalScroll: Boolean, //外部滚动
disabled: Boolean,
getData: Boolean,
contrast: Boolean, //同屏对照
form: Object,
formType: String,
......@@ -118,6 +123,12 @@ export default {
},
}
},
inject: {
tabFollowId: {
type: Function,
default: () => {},
},
},
data() {
return {
btnType: "",
......@@ -157,6 +168,9 @@ export default {
return !(Object.keys(this.widgetFormPreview) || this.widgetFormPreview)
.length
},
getTabFollowId() {
return this.tabFollowId()
},
sideWidth() {
return this.asideShow ? "200px" : "0px"
},
......@@ -203,8 +217,9 @@ export default {
{ immediate: true }
)
} else {
console.log(206, this.getData)
// 监听form.silent 获取当前tab页数据
if (this.formType != 2) {
if (this.getData) {
this.$watch(
"form.silent",
() => {
......@@ -236,7 +251,7 @@ export default {
this.$refs.form.clearAge()
},
initData() {
console.log('初始化',this.formData)
console.log("初始化", this.formData)
this.formData.formRecordId = null
this.formCacheList = []
this.getPatientDetail()
......@@ -293,8 +308,9 @@ export default {
if (this.isDraft) {
params.statusMap.is_draft = this.isDraft
}
// 处理followId 针对随访查询的列表数据的查询和修改操作
if (this.$route.path == "/followupentry" && this.activeName != "index0") {
params.followId = this.followId
params.followId = this.followId || this.getTabFollowId
}
this.$emit("handleConfirm", params, done, (res) => {
// 多次填写的表单新增时,获取最新数据
......@@ -379,17 +395,31 @@ export default {
})
if (!this.patientId || this.form.silent) return
this.loading = true
getPatientDetail({
patientId: this.patientId,
formId: this.form.formId,
formRecordId: this.formData.formRecordId,
})
.then((res) => {
this.formatData(res)
if (this.formType == 2) {
getFollowDetail({
followId: this.followId || this.getTabFollowId,
formId: this.form.formId,
formRecordId: this.formData.formRecordId,
})
.finally(() => {
this.loading = false
.then((res) => {
this.formatData(res)
})
.finally(() => {
this.loading = false
})
} else {
getPatientDetail({
patientId: this.patientId,
formId: this.form.formId,
formRecordId: this.formData.formRecordId,
})
.then((res) => {
this.formatData(res)
})
.finally(() => {
this.loading = false
})
}
},
formatData(res, cache) {
const d = res.data || {}
......@@ -402,7 +432,7 @@ export default {
if (form["YZZKJC"] && typeof form["YZZKJC"] === "string") {
form["YZZKJC"] = JSON.parse(form["YZZKJC"])
}
console.log('form形成',form,this.formData)
console.log("form形成", form, this.formData)
if (!cache) {
this.formData.formEdit = form
}
......@@ -418,7 +448,7 @@ export default {
}
},
// 表单数据转化
formatString(form){
formatString(form) {
for (const key in form) {
Object.prototype.toString.call(form[key]) == "[object Number]"
? (form[key] = String(form[key]))
......@@ -427,7 +457,7 @@ export default {
this.formData.formEdit = form
},
getRecordList(formRecordId) {
console.log('获取表单id',formRecordId)
console.log("获取表单id", formRecordId)
if (!this.patientId) return
getRecordList({
patientId: this.patientId,
......
......@@ -13,6 +13,7 @@ export default {
newformRecordId: null, //记录Id
formTabs: [],
formId: "",
followId: "",
formTabsList: [],
isUpdated: false,
}
......@@ -27,7 +28,7 @@ export default {
nextTab() {
let i = this.activeName.split("index")[1] - 0
i++
if (i == 6) {
if (i == this.formTabs.length) {
this.onSubmit(3)
return
} else {
......
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