| | |
| | | |
| | | // 选择医院 |
| | | selectHospital(hospital) { |
| | | this.selectedHospitalName = hospital.hospName |
| | | this.searchKeyword = hospital.hospName |
| | | // 添加null检查 |
| | | if (!hospital) { |
| | | console.warn('选择的医院对象为空'); |
| | | return; |
| | | } |
| | | |
| | | this.selectedHospitalName = hospital.hospName || ''; |
| | | this.searchKeyword = hospital.hospName || ''; |
| | | |
| | | const hospitalData = { |
| | | id: hospital.hospId, |
| | | name: hospital.hospName, |
| | | id: hospital.hospId || null, |
| | | name: hospital.hospName || '', |
| | | address: hospital.hospName === '家中' ? '' : this.buildFullAddress(hospital) |
| | | } |
| | | |
| | | this.showResults = false |
| | | this.searchResults = [] |
| | | this.showResults = false; |
| | | this.searchResults = []; |
| | | |
| | | // 触发更新事件 |
| | | this.$emit('input', hospitalData) |
| | | this.$emit('change', hospitalData) |
| | | this.$emit('input', hospitalData); |
| | | this.$emit('change', hospitalData); |
| | | }, |
| | | |
| | | |