1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- <template>
- <window-size>
- <van-field v-model="socialNo" label="身份证号" placeholder="请输入要查询的身份证号" clearable>
- <template #button>
- <van-button size="small" type="primary" @click="startQuery">查询</van-button>
- </template>
- </van-field>
- <div style="height: 5px"></div>
- <div v-for="(item, index) in covidExamIndexes" :key="index">
- <van-cell
- :title="item.aply_CTNT"
- :label="item.ordr_CREATE_DATE"
- :value="filterType(item.patient_TYPE, item.ptnt_ID)"
- is-link
- center
- :to="'/checkExamDetail/' + item.ordr_ID + '/' + item.ptnt_ID + '/' + item.patient_TYPE"
- ></van-cell>
- </div>
- </window-size>
- </template>
- <script>
- import { onMounted, ref } from 'vue'
- import { checkCovidExamIndexBySocialNo } from '../../../api/check-exam'
- import { showToast } from 'vant'
- import { useRouter } from 'vue-router'
- import { getPatientInfo } from '../../../api/assessments'
- import { computed } from '@vue/reactivity'
- import store from '../../../store'
- export default {
- setup() {
- const router = useRouter()
- const patientId = router.currentRoute.value.params.patientId
- const socialNo = ref(null)
- const covidExamIndexes = computed(() => {
- return store.state.covidExamIndexes
- })
- const startQuery = () => {
- if (!socialNo.value) {
- showToast({
- message: '请输入正确的身份证号码',
- position: 'top',
- });
- } else {
- checkCovidExamIndexBySocialNo(socialNo.value).then((res) => {
- store.commit('SET_COVIDEXAMIDCARD', socialNo.value)
- store.commit('SET_COVIDEXAMINDEXES', res)
- })
- }
- }
- onMounted(() => {
- if (covidExamIndexes.value.length === 0) {
- getPatientInfo(patientId).then((res) => {
- socialNo.value = res.idcard
- })
- } else {
- socialNo.value = store.state.covidExamIdCard
- }
- })
- return {
- socialNo,
- covidExamIndexes,
- startQuery,
- filterType,
- }
- },
- }
- function filterType(val, no) {
- if (val === '0') {
- return '门诊号:' + no
- } else if (val === '1') {
- return '住院号:' + no
- } else if (val === '3') {
- return '体检号:' + no
- }
- return ''
- }
- </script>
|