血透系统PC前端

editPatient.vue 1011B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <template>
  2. <div class="patient-container">
  3. <patient-sidebar :id="patientID"></patient-sidebar>
  4. <patient-form :is-edit='true' :class='panelClass' v-on:tran-patient-info="patientInfo=$event"></patient-form>
  5. </div>
  6. </template>
  7. <script>
  8. import PatientForm from './components/PatientForm'
  9. import PatientSidebar from './components/PatientSidebar'
  10. export default {
  11. name: 'editForm',
  12. components: { PatientForm,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. this.$notify.error({
  27. title: "错误",
  28. message: "无效的id"
  29. });
  30. this.$router.push('/patients/patients');
  31. }
  32. }
  33. }
  34. </script>
  35. <style rel="stylesheet/scss" lang="scss" scoped>
  36. .app-container{
  37. margin: 0;
  38. }
  39. </style>