Commit 384e81b9 authored by gengchunlei's avatar gengchunlei

居民端小程序 随访列表以及系统初始化逻辑

parent 8b0a7d6c
......@@ -29,3 +29,8 @@ export function getAreaChild(parentCode, loading = true) {
export function getResidentInfo(idCard) {
return fetchBase({ url: `/tumour-admin/v1/h5-app/residents/${idCard}`, loading: true })
}
// 居民idCard或者tel查询居民信息
export function getResidentByInfo(params) {
return fetchBase({ url: `/chronic-resident/v1/chronic-residents-record/query-resident-info-by-id-card`, body: params, loading: true })
}
\ No newline at end of file
......@@ -2,7 +2,6 @@ import {fetchBase} from '@/api/doctor/doctorFetch'
// 居民档案ID查询居民信息
export function queryResidentInfo(params) {
debugger
return fetchBase({ url: `/chronic-admin/v1/chronic-residents-record/detailed`, body: params, loading: true })
}
......
import { fetchBase } from '../fetch.js'
// 查询随访列表
export function queryVisitList(params) {
return fetchBase({ url: `/chronic-resident/v1/chronic-visit-record/page`, body: params, loading: true })
}
\ No newline at end of file
......@@ -11,10 +11,9 @@
</template>
<script>
import { getDict } from '@/api/base.js'
import { getDict, getResidentByInfo } from '@/api/base.js'
import { useStore } from './store/index.js'
import { ref } from 'vue'
import { queryResidentInfo } from '@/api/doctor/resident'
export default {
data() {
......@@ -46,13 +45,7 @@ export default {
},
setup() {
const store = useStore()
const baseInfo = ref(null)
return { store, baseInfo }
},
provide() {
return {
getBaseInfo: () => this.baseInfo
}
return { store }
},
created() {
this.init()
......@@ -62,17 +55,10 @@ export default {
console.log(this.visible)
const res = await getDict()
this.store.$patch({ dict: res.data || {} })
const user = await getResidentByInfo({idCard: '21100319900901301X'})
this.store.$patch({ userInfo: user.data || {} })
this.visible = true
await this.load()
},
load() {
const query = {
residentInfoId: '2020761970'
}
queryResidentInfo(query).then(res => {
debugger
this.baseInfo = res.data || {}
})
},
}
}
......
......@@ -4,7 +4,9 @@ export const useStore = defineStore('chronic', {
state: () => {
return {
// 字典
dict: []
dict: [],
//居民信息
userInfo: {}
}
},
getters: {},
......@@ -13,6 +15,10 @@ export const useStore = defineStore('chronic', {
if (!dict) return []
return this.dict[dict] || []
},
getUserInfo(info) {
if (!info) return {}
return this.userInfo[info] || []
},
getDictValue(dict, value) {
let array = []
if (typeof dict === 'string') {
......
<template>
<div class='h-full flex flex-col visit'>
<van-tabs v-model:active='activeTab' class='shrink-0' v-if='tabList.length'
<div class="p-3 text-black text-center shrink-0 doc-nav-bar">
<span>慢病筛查记录</span>
</div>
<van-tabs v-model:active='activeTab' class='shrink-0 ' v-if='tabList.length'
@change='tabChange'
shrink>
<van-tab v-for='item in tabList' :key='item.name'
......@@ -68,9 +71,8 @@
<van-divider class='mt-3' />
<span class='px-3 float-bt'>
通用随访
</span>
<span class="tag tag-red" v-show="item.serveType == '1'">高危筛查</span>
<span class="tag tag-blue" v-show="item.serveType == '2'">专病筛查</span>
</div>
</van-list>
<div class='text-center shrink-0 empty' v-if='!list.length'>
......@@ -87,12 +89,15 @@
</template>
<script>
import { queryVisitByPage, deleteVisit } from '@/api/doctor/generalFU.js'
import { deleteVisit } from '@/api/doctor/generalFU.js'
import { showConfirmDialog, showToast } from 'vant'
import { useStore } from '@/residentWX/store'
import { queryVisitList } from '@/api/residentWX/visit'
export default {
data() {
return {
store: useStore(),
activeTab: undefined,
list: [],
pagination: {
......@@ -106,10 +111,9 @@ export default {
isRefreshDisable: false
}
},
inject: ['getBaseInfo'],
computed: {
baseInfo() {
return this.getBaseInfo() || {}
return this.store.userInfo
},
chronicTagsArray() {
let chronicTagsArray = this.baseInfo.chronicTagsArray || ''
......@@ -117,7 +121,7 @@ export default {
},
tabList() {
const list = [
{ title: '全部', name: -1, code: '' },
{ title: '全部', name: undefined, code: undefined },
{ title: '高血压', name: 1, code: '1' },
{ title: '糖尿病', name: 2, code: '2' },
{ title: '冠心病', name: 3, code: '4' },
......@@ -126,11 +130,12 @@ export default {
{ title: '慢性肾病', name: 6, code: '32' },
{ title: '血脂异常', name: 7, code: '64' }
]
return list.filter(e => this.chronicTagsArray.includes(e.code))
let res = list.filter(e => this.chronicTagsArray.includes(e.code)) || []
res.unshift( { title: '全部', name: '', code: '' })
return res
}
},
mounted() {
debugger
const list = this.$refs.list
list.addEventListener('scroll', () => {
if (list.scrollTop > 0) {
......@@ -142,14 +147,15 @@ export default {
},
methods: {
load(loading = true) {
debugger
const query = {
residentInfoId: this.baseInfo.residentInfoId,
serveTypeList: [5, 6, 7, 8, 9, 10, 11, 12, 14],
diseaseType: this.activeTab,
pageIndex: this.pagination.pageIndex,
pageSize: this.pagination.pageSize
}
queryVisitByPage(query, loading).then(res => {
queryVisitList(query, loading).then(res => {
debugger
this.list = this.list.concat(res.data.dataList || [])
this.pagination.total = res.data.total || 0
this.finished = this.list.length >= this.pagination.total
......@@ -272,4 +278,23 @@ export default {
left: 0;
right: 0;
}
.tag {
position: absolute;
top: 8px;
right: 8px;
border-radius: 2px;
padding: 4px 8px;
font-size: 12px;
}
.tag-red {
border: 1px solid #FFA39E;
color: #F5222D;
background-color: #FFF1F0;
}
.tag-blue {
border: 1px solid #ADC6FF;
color: #2F54EB;
background-color: #F0F5FF;
}
</style>
......@@ -114,9 +114,9 @@ const routes = [
component: () => import(/* webpackChunkName: "residentWX-visit" */ '@/residentWX/visit/List.vue')
},
{
path: 'visit/currencyFUDetail/:id',
name: 'resident-visit-currencyFUDetail',
component: () => import(/* webpackChunkName: "residentWX-screening" */ '@/residentWX/visit/detail/CurrencyFUDetail.vue')
path: 'visit/GeneralFUDetail/:id',
name: 'resident-visit-GeneralFUDetail',
component: () => import(/* webpackChunkName: "residentWX-screening" */ '@/residentWX/visit/detail/GeneralFUDetail.vue')
},
// 健康指导宣教
{
......
......@@ -39,11 +39,11 @@ module.exports = defineConfig({
}
},
'/chronic-resident': {
// target: 'http://192.168.1.43:8903',
target: 'https://beta-tumour.zmnyjk.com',
target: 'http://192.168.1.174:8903',
// target: 'https://beta-tumour.zmnyjk.com',
changOrigin: true,
pathRewrite: {
'^/chronic-resident': '/chronic-resident'
'^/chronic-resident': '/'
}
}
},
......
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