Commit 04489bb6 authored by songrui's avatar songrui

简易筛查 查询是否已筛查

parent 84b6560b
import 'vant/es/toast/style/index'
import 'vant/es/notify/style/index'
import 'vant/es/dialog/style/index'
// 自定义svg 图标组件
import DocIcon from '@/components/docIcon/index'
......
......@@ -13,4 +13,9 @@ export function getSimpleScreenById(id, loading = true) {
// 获取检验项目对码表
export function getInspectCode() {
return fetchBase({ url: `/tumour-admin/v1/h5-app/dict-code-table`})
}
\ No newline at end of file
}
// 查询居民当年是否存在筛查记录
export function getSimpleScreenYears(idCard) {
return fetchBase({ url: `/tumour-admin/v1/h5-app/years-simple/${idCard}`, loading: true})
}
<template>
<div class="h-full flex flex-col screening-simple-detail">
<DocNavBar home v-if="embed !== 'wx'">
<DocNavBar :home="!notHome" v-if="embed !== 'wx'">
筛查详情
</DocNavBar>
<div class="grow overflow-y-auto">
......@@ -112,6 +112,9 @@ export default {
embed() {
return this.$route.query.embed
},
notHome() {
return this.$route.query.notHome
},
// 筛查项
screenItems() {
const result = []
......
......@@ -10,6 +10,7 @@
label="身份证号"
placeholder="请输入身份证号"
:rules="rules.idCard"
@blur="checkDetail"
>
<template #button>
<van-button size="small" plain type="primary"
......@@ -193,7 +194,8 @@ import { idCardRule, mobileValidator } from '@/utils/commonReg.js'
import { useStore } from '@/tumour/store/index.js'
import { getResidentInfo } from '@/tumour/api/base.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'
const defaultForm = (info = {}) => {
......@@ -287,7 +289,9 @@ export default {
registeredCode: [{ required: true, message: '请输入' }],
presentCode: [{ required: true, message: '请输入' }],
species: [{ required: true, message: '请选择' }]
}
},
// 是否查询过简易筛查详情
detailChecked: false
}
},
setup() {
......@@ -304,7 +308,7 @@ export default {
methods: {
getInfo() {
const idCard = this.form.idCard
if (!idCard) return
if (!idCard || idCardRule.validator(idCard)) return
getResidentInfo(idCard).then(res => {
const result = res.data || {}
if (result.id) {
......@@ -326,6 +330,34 @@ export default {
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() {
return new Promise((resolve) => {
this.$refs.form.validate().then(res => {
......
......@@ -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