CheckExamResult.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <template>
  2. <window-size>
  3. <van-field v-model="socialNo" label="身份证号" placeholder="请输入要查询的身份证号">
  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 list" :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"
  17. ></van-cell>
  18. </div>
  19. </window-size>
  20. </template>
  21. <script>
  22. import { onMounted, ref } from 'vue'
  23. import { checkIndexBySocialNo } from '../../../api/check-exam'
  24. import { Toast } from 'vant'
  25. import { useRouter } from 'vue-router'
  26. import { getPatientInfo } from '../../../api/assessments'
  27. export default {
  28. setup() {
  29. const router = useRouter()
  30. const patientId = router.currentRoute.value.params.patientId
  31. const socialNo = ref(null)
  32. const list = ref([])
  33. const startQuery = () => {
  34. if (!socialNo.value) {
  35. Toast({
  36. message: '请输入正确的身份证号码',
  37. position: 'top',
  38. })
  39. } else {
  40. checkIndexBySocialNo(socialNo.value).then((res) => {
  41. list.value = res
  42. })
  43. }
  44. }
  45. onMounted(() => {
  46. getPatientInfo(patientId).then((res) => {
  47. socialNo.value = res.idcard
  48. })
  49. })
  50. return {
  51. socialNo,
  52. list,
  53. startQuery,
  54. filterType,
  55. }
  56. },
  57. }
  58. function filterType(val, no) {
  59. if (val === '0') {
  60. return '门诊号:' + no
  61. } else if (val === '1') {
  62. return '住院号:' + no
  63. } else if (val === '3') {
  64. return '体检号:' + no
  65. }
  66. return ''
  67. }
  68. </script>