patientInfo.vue 957B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <template>
  2. <div class="patient-container">
  3. <patient-sidebar :id="patientID"></patient-sidebar>
  4. <patient-detail :is-edit='true' :class='panelClass' v-on:tran-patient-info="patientInfo=$event"></patient-detail>
  5. </div>
  6. </template>
  7. <script>
  8. import PatientDetail from './components/PatientDetail'
  9. import PatientSidebar from './components/PatientSidebar'
  10. export default {
  11. name: 'editForm',
  12. components: { PatientDetail, PatientSidebar},
  13. data() {
  14. return {
  15. patientID: 0,
  16. panelClass: 'patient-app-container',
  17. patientInfo: {
  18. id: 0
  19. }
  20. }
  21. },
  22. created() {
  23. const id = this.$route.params && this.$route.params.id
  24. this.patientID = parseInt(id)
  25. if (isNaN(this.patientID) || this.patientID <= 0) {
  26. console.log('patient info not had id')
  27. this.$notify.error({
  28. title: '错误',
  29. message: '无效的id'
  30. })
  31. this.$router.push('/patients/patients')
  32. }
  33. }
  34. }
  35. </script>