Commit 061101a2 authored by songrui's avatar songrui

简易筛查 添加详情列表

parent 04489bb6
......@@ -16,6 +16,11 @@ const routes = [
name: 'tumour-screening-simple-detail',
component: () => import(/* webpackChunkName: "page-tumour-screening-detail" */ '@/tumour/screening/simpleV2/detail/Detail.vue')
},
{
path: 'screening/simple/list',
name: 'tumour-screening-simple-list',
component: () => import(/* webpackChunkName: "page-tumour-screening-list" */ '@/tumour/screening/simpleV2/list/List.vue')
},
{
path: 'visit/detail',
name: 'tumour-visit-detail',
......
......@@ -15,7 +15,7 @@ export function getInspectCode() {
return fetchBase({ url: `/tumour-admin/v1/h5-app/dict-code-table`})
}
// 查询居民当年是否存在筛查记录
export function getSimpleScreenYears(idCard) {
return fetchBase({ url: `/tumour-admin/v1/h5-app/years-simple/${idCard}`, loading: true})
// 查询居民当年是否存在筛查记录 idCard residentId
export function getSimpleScreenYears(id, loading = true) {
return fetchBase({ url: `/tumour-admin/v1/h5-app/years-simple/${id}`, loading})
}
......@@ -42,7 +42,7 @@
<template #icon>
<doc-icon type="doc-item" class="left-icon"/>
</template>
<table>
<table class="w-full">
<colgroup>
<col></col>
<col style="width: .55rem"></col>
......
......@@ -4,10 +4,12 @@
<span class="back-bt" @click="onBack" v-if="setp === 2">
<doc-icon type="doc-left" />
</span>
<span>肿瘤风险评估</span>
<span class="font-semibold">肿瘤风险评估</span>
<span class="record-bt" v-if="setp === 1"
@click="toRecord">当年筛查记录</span>
</div>
<div class="grow overflow-y-auto pb-5">
<BaseForm ref="base" v-show="setp === 1"/>
<BaseForm ref="base" v-show="setp === 1" @checked="onIdCardChecked"/>
<QuestionForm ref="question" v-if="setp === 2"
:species="species"/>
<Result v-if="setp === 3" :info="resultInfo"/>
......@@ -26,7 +28,7 @@
import BaseForm from './base.vue'
import QuestionForm from './Question.vue'
import Result from './Result.vue'
import { showNotify } from 'vant'
import { showNotify, showToast } from 'vant'
import { addSimpleScreen } from '@/tumour/api/screening.js'
import { fetchDataHandle } from '@/utils/common.js'
......@@ -45,7 +47,9 @@ export default {
// 基础用户信息
baseInfo: {},
// 提交结果信息
resultInfo: {}
resultInfo: {},
// 查询idCard后返回的数据 用于查询筛查列表
recordId: null
}
},
computed: {
......@@ -60,7 +64,6 @@ export default {
if (!this.doctorId) {
showNotify({ type: 'warning', message: '未获取到医生信息', duration: 0 })
}
},
methods: {
init() {
......@@ -78,6 +81,26 @@ export default {
this.setp = 2
})
},
// 当年筛查记录
toRecord() {
if (!this.recordId) {
showToast('请输入身份证号')
return
}
if (this.recordId === -1) {
showToast('该用户暂无筛查记录')
return
}
this.$router.push({
name: 'tumour-screening-simple-list',
query: {
recordId: this.recordId
}
})
},
onIdCardChecked(recordId) {
this.recordId = recordId
},
submit() {
this.$refs.question.submit().then(res => {
const result = {
......@@ -111,6 +134,12 @@ export default {
position: absolute;
left: .16rem;
}
.record-bt {
position: absolute;
right: .12rem;
font-size: .14rem;
color: var(--van-primary-color);
}
}
.bt-group {
padding: 0 10%;
......
......@@ -179,12 +179,12 @@
<van-checkbox-group v-model="form.species" class="pt-2 pl-2">
<van-checkbox v-for="(item, index) in cancerArray" :key="index"
:name="item.value" shape="square"
:disabled="speciesChecked.includes(item.value + '')"
class="mb-3">{{ item.name }}</van-checkbox>
</van-checkbox-group>
</template>
</van-field>
</van-form>
<!-- {{ form }} -->
</div>
</template>
......@@ -261,6 +261,7 @@ export default {
components: {
DocAddress
},
emits: ['checked'],
data() {
return {
form: defaultForm(),
......@@ -290,8 +291,8 @@ export default {
presentCode: [{ required: true, message: '请输入' }],
species: [{ required: true, message: '请选择' }]
},
// 是否查询过简易筛查详情
detailChecked: false
// 已筛查过的癌种
speciesChecked: []
}
},
setup() {
......@@ -325,6 +326,7 @@ export default {
genderTrans: getDictValue('DC00005', info.gender),
dataBirth: info.dataBirth,
age: info.age,
idCard,
species: []
})
console.log(info)
......@@ -333,29 +335,38 @@ export default {
// 查询是否存在简易筛查信息
checkDetail() {
console.log(this.form)
if (this.detailChecked) return
const idCard = this.form.idCard
if (!idCard || idCardRule.validator(idCard)) return
getSimpleScreenYears(idCard).then(res => {
const result = res.data
if (!result) return
this.detailChecked = true
let date = result.screenDate
date && (date = date.split('-'))
const msg = `${result.residentName}${result.gender == 2 ? '女士' : '先生'}您好!您于${date[0]}${date[1]}${date[2]}日在${result.screenUnitName}已做过初筛,建议下年度再进行筛查!`
showConfirmDialog({
title: '温馨提示',
message: msg,
confirmButtonText: '详情'
}).then(() => {
this.$router.push({
name: 'tumour-screening-simple-detail',
query: {
id: result.id,
notHome: true
const result = res.data || []
if (!result.length) {
this.$emit('checked', -1)
return
}
let species= []
result.forEach(e => {
species = [...species, ...e.species.split(',')]
})
}).catch(() => {})
species = [...new Set(species)]
this.speciesChecked = species
this.$emit('checked', result[0].residentId)
// let date = result.screenDate
// date && (date = date.split('-'))
// const msg = `${result.residentName}${result.gender == 2 ? '女士' : '先生'}您好!您于${date[0]}年${date[1]}月${date[2]}日在${result.screenUnitName}已做过初筛,建议下年度再进行筛查!`
// showConfirmDialog({
// title: '温馨提示',
// message: msg,
// confirmButtonText: '详情'
// }).then(() => {
// this.$router.push({
// name: 'tumour-screening-simple-detail',
// query: {
// id: result.id,
// notHome: true
// }
// })
// }).catch(() => {})
})
},
submit() {
......
<template>
<div class="h-full flex flex-col screening-simple-list">
<DocNavBar>
当年筛查记录
</DocNavBar>
<div class="grow overflow-y-auto" ref="list" style="background-color: #f9f9f9;">
<van-list v-model:loading="loading"
:finished="finished"
:finished-text="innerList.length ? '没有更多了' : ''"
:immediate-check="false"
@load="onMore" >
<div class="p-2 flex flex-col gap-y-2.5 card-list">
<div class="py-3 px-4 card" v-for='item in innerList' :key="item.id"
@click="toDetail(item)">
<div>
<span class="label">筛查结论</span>
<span>{{ item.result }}</span>
</div>
<div>
<span class="label">筛查时间</span>
<span>{{ item.screenDate }}</span>
</div>
<div>
<span class="label">筛查单位</span>
<span>{{ item.screenUnitName }}</span>
</div>
</div>
</div>
</van-list>
<div class='text-center shrink-0 empty' v-if='!list.length'>
<img src='@/assets/image/empty.png' alt='' style='width: 1.2rem;'>
<p>暂无数据</p>
</div>
</div>
</div>
</template>
<script>
import DocNavBar from '@/components/docNavBar/DocNavBar.vue'
import { getSimpleScreenYears } from '@/tumour/api/screening.js'
export default {
components: {
DocNavBar
},
data() {
return {
list: [],
innerList: [],
pagination: {
total: 0,
pageIndex: 1,
pageSize: 8
},
loading: false,
finished: false
}
},
computed: {
routeQuery() {
return this.$route.query
},
recordId() {
return this.routeQuery.recordId
}
},
created() {
if (!this.recordId) {
showNotify({ type: 'warning', message: '未获取到用户信息', duration: 0 })
return
}
this.load()
},
methods: {
load() {
getSimpleScreenYears(this.recordId).then(res => {
this.list = res.data || []
this.list.forEach(item => {
const speciesTrans = item.speciesTrans.split(',')
const highRiskTrans = item.highRiskTrans ? item.highRiskTrans.split(',') : []
let result = []
highRiskTrans.forEach(e => {
result.push(`${e}: 高危`)
})
speciesTrans.filter(e => !highRiskTrans.find(i => e === i)).forEach(e => {
result.push(`${e}:一般人群`)
})
item.result = result.join(';')
})
this.pagination.total = this.list.length
this.innerList = this.list.slice(0, this.pagination.pageSize)
this.finished = this.innerList.length >= this.pagination.total
})
},
onMore() {
this.pagination.pageIndex =+ 1
this.innerList = this.list.slice(0, this.pagination.pageSize * (this.pagination.pageIndex + 1))
this.finished = this.innerList.length >= this.pagination.total
},
toDetail(record) {
this.$router.push({
name: 'tumour-screening-simple-detail',
query: {
id: record.id,
notHome: true
}
})
}
}
}
</script>
<style lang="less" scoped>
.card {
position: relative;
background-color: #fff;
border-radius: 12px;
>div {
display: flex;
margin-bottom: 8px;
&:last-of-type {
margin-bottom: 0!important;
}
}
.label {
min-width: 6em;
color: #8C8C8C;
}
}
</style>
......@@ -22,8 +22,8 @@ module.exports = defineConfig({
// 设置代理
proxy: {
'/tumour-admin': {
// target: 'http://192.168.1.174:8081',
target: 'https://beta-tumour.zmnyjk.com',
target: 'http://192.168.1.174:8081',
// target: 'https://beta-tumour.zmnyjk.com',
changOrigin: true,
pathRewrite: {
'^/tumour-admin': '/tumour-admin'
......
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