Commit 04489bb6 authored by songrui's avatar songrui

简易筛查 查询是否已筛查

parent 84b6560b
import 'vant/es/toast/style/index' import 'vant/es/toast/style/index'
import 'vant/es/notify/style/index' import 'vant/es/notify/style/index'
import 'vant/es/dialog/style/index'
// 自定义svg 图标组件 // 自定义svg 图标组件
import DocIcon from '@/components/docIcon/index' import DocIcon from '@/components/docIcon/index'
......
...@@ -14,3 +14,8 @@ export function getSimpleScreenById(id, loading = true) { ...@@ -14,3 +14,8 @@ export function getSimpleScreenById(id, loading = true) {
export function getInspectCode() { export function getInspectCode() {
return fetchBase({ url: `/tumour-admin/v1/h5-app/dict-code-table`}) 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})
}
<template> <template>
<div class="h-full flex flex-col screening-simple-detail"> <div class="h-full flex flex-col screening-simple-detail">
<DocNavBar home v-if="embed !== 'wx'"> <DocNavBar :home="!notHome" v-if="embed !== 'wx'">
筛查详情 筛查详情
</DocNavBar> </DocNavBar>
<div class="grow overflow-y-auto"> <div class="grow overflow-y-auto">
...@@ -112,6 +112,9 @@ export default { ...@@ -112,6 +112,9 @@ export default {
embed() { embed() {
return this.$route.query.embed return this.$route.query.embed
}, },
notHome() {
return this.$route.query.notHome
},
// 筛查项 // 筛查项
screenItems() { screenItems() {
const result = [] const result = []
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
label="身份证号" label="身份证号"
placeholder="请输入身份证号" placeholder="请输入身份证号"
:rules="rules.idCard" :rules="rules.idCard"
@blur="checkDetail"
> >
<template #button> <template #button>
<van-button size="small" plain type="primary" <van-button size="small" plain type="primary"
...@@ -193,7 +194,8 @@ import { idCardRule, mobileValidator } from '@/utils/commonReg.js' ...@@ -193,7 +194,8 @@ import { idCardRule, mobileValidator } from '@/utils/commonReg.js'
import { useStore } from '@/tumour/store/index.js' import { useStore } from '@/tumour/store/index.js'
import { getResidentInfo } from '@/tumour/api/base.js' import { getResidentInfo } from '@/tumour/api/base.js'
import { getDictValue } from '@/tumour/utils/dictionaries.js' import { getDictValue } from '@/tumour/utils/dictionaries.js'
import { showToast } from 'vant' import { getSimpleScreenYears } from '@/tumour/api/screening.js'
import { showToast, showConfirmDialog } from 'vant'
import DocAddress from '@/components/docAddress/DocAddress.vue' import DocAddress from '@/components/docAddress/DocAddress.vue'
const defaultForm = (info = {}) => { const defaultForm = (info = {}) => {
...@@ -287,7 +289,9 @@ export default { ...@@ -287,7 +289,9 @@ export default {
registeredCode: [{ required: true, message: '请输入' }], registeredCode: [{ required: true, message: '请输入' }],
presentCode: [{ required: true, message: '请输入' }], presentCode: [{ required: true, message: '请输入' }],
species: [{ required: true, message: '请选择' }] species: [{ required: true, message: '请选择' }]
} },
// 是否查询过简易筛查详情
detailChecked: false
} }
}, },
setup() { setup() {
...@@ -304,7 +308,7 @@ export default { ...@@ -304,7 +308,7 @@ export default {
methods: { methods: {
getInfo() { getInfo() {
const idCard = this.form.idCard const idCard = this.form.idCard
if (!idCard) return if (!idCard || idCardRule.validator(idCard)) return
getResidentInfo(idCard).then(res => { getResidentInfo(idCard).then(res => {
const result = res.data || {} const result = res.data || {}
if (result.id) { if (result.id) {
...@@ -326,6 +330,34 @@ export default { ...@@ -326,6 +330,34 @@ export default {
console.log(info) console.log(info)
}) })
}, },
// 查询是否存在简易筛查信息
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
}
})
}).catch(() => {})
})
},
submit() { submit() {
return new Promise((resolve) => { return new Promise((resolve) => {
this.$refs.form.validate().then(res => { this.$refs.form.validate().then(res => {
......
...@@ -22,8 +22,8 @@ module.exports = defineConfig({ ...@@ -22,8 +22,8 @@ module.exports = defineConfig({
// 设置代理 // 设置代理
proxy: { proxy: {
'/tumour-admin': { '/tumour-admin': {
target: 'http://192.168.1.174:8081', // target: 'http://192.168.1.174:8081',
// target: 'https://beta-tumour.zmnyjk.com', target: 'https://beta-tumour.zmnyjk.com',
changOrigin: true, changOrigin: true,
pathRewrite: { pathRewrite: {
'^/tumour-admin': '/tumour-admin' '^/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