CheckExamResult.vue 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template>
  2. <window-size>
  3. <van-field v-model="socialNo" label="身份证号" placeholder="请输入要查询的身份证号" clearable>
  4. <template #button>
  5. <van-button size="small" type="primary" @click="startQuery">查询</van-button>
  6. </template>
  7. </van-field>
  8. <div style="height: 5px"></div>
  9. <div v-for="(item, index) in covidExamIndexes" :key="index">
  10. <van-cell
  11. :title="item.aply_CTNT"
  12. :label="item.ordr_CREATE_DATE"
  13. :value="filterType(item.patient_TYPE, item.ptnt_ID)"
  14. is-link
  15. center
  16. :to="'/checkExamDetail/' + item.ordr_ID + '/' + item.ptnt_ID + '/' + item.patient_TYPE"
  17. ></van-cell>
  18. </div>
  19. </window-size>
  20. </template>
  21. <script>
  22. import { onMounted, ref } from 'vue'
  23. import { checkCovidExamIndexBySocialNo } from '../../../api/check-exam'
  24. import { showToast } from 'vant'
  25. import { useRouter } from 'vue-router'
  26. import { getPatientInfo } from '../../../api/assessments'
  27. import { computed } from '@vue/reactivity'
  28. import store from '../../../store'
  29. export default {
  30. setup() {
  31. const router = useRouter()
  32. const patientId = router.currentRoute.value.params.patientId
  33. const socialNo = ref(null)
  34. const covidExamIndexes = computed(() => {
  35. return store.state.covidExamIndexes
  36. })
  37. const startQuery = () => {
  38. if (!socialNo.value) {
  39. showToast({
  40. message: '请输入正确的身份证号码',
  41. position: 'top',
  42. });
  43. } else {
  44. checkCovidExamIndexBySocialNo(socialNo.value).then((res) => {
  45. store.commit('SET_COVIDEXAMIDCARD', socialNo.value)
  46. store.commit('SET_COVIDEXAMINDEXES', res)
  47. })
  48. }
  49. }
  50. onMounted(() => {
  51. if (covidExamIndexes.value.length === 0) {
  52. getPatientInfo(patientId).then((res) => {
  53. socialNo.value = res.idcard
  54. })
  55. } else {
  56. socialNo.value = store.state.covidExamIdCard
  57. }
  58. })
  59. return {
  60. socialNo,
  61. covidExamIndexes,
  62. startQuery,
  63. filterType,
  64. }
  65. },
  66. }
  67. function filterType(val, no) {
  68. if (val === '0') {
  69. return '门诊号:' + no
  70. } else if (val === '1') {
  71. return '住院号:' + no
  72. } else if (val === '3') {
  73. return '体检号:' + no
  74. }
  75. return ''
  76. }
  77. </script>