SelectCovidVaccinatePatient.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. <window-size>
  3. <div v-for="item in cards" :key="item.patientId">
  4. <van-cell icon="user-o" :label="item.patientId" is-link @click="toVaccinate(item.patientId)">
  5. <template #title>
  6. <span class="custom-title">{{ item.name }}</span>
  7. &nbsp;
  8. <van-tag type="primary" plain v-if="item.isDefault === 1">默认</van-tag>
  9. </template>
  10. </van-cell>
  11. </div>
  12. <div style="height: 5px"></div>
  13. <van-cell
  14. v-if="showAddCard"
  15. icon="add"
  16. title="添加就诊人"
  17. :label="addCardText"
  18. is-link
  19. to="/addElectronicHealthCard"
  20. ></van-cell>
  21. </window-size>
  22. </template>
  23. <script>
  24. import store from '../../../store'
  25. import { computed, ref } from 'vue'
  26. import BindCardMethod from "../../../components/bind-card-method/index.vue";
  27. export default {
  28. components: {
  29. BindCardMethod
  30. },
  31. setup() {
  32. const cards = computed(() => {
  33. return store.state.patientCards
  34. })
  35. const showAddCard = computed(() => {
  36. return cards.value.length < 5
  37. })
  38. const addCardText = computed(() => {
  39. return '还可添加' + (5 - cards.value.length) + '人'
  40. })
  41. const toVaccinate = (patientId) => {
  42. window.open('http://www.hnthyy.cn:8080/covidVaccinate/' + patientId, '_self')
  43. }
  44. return {
  45. cards,
  46. showAddCard,
  47. addCardText,
  48. toVaccinate,
  49. }
  50. },
  51. }
  52. </script>