wlzboy
5 天以前 c098f1e3a3e052aa3d65584aae6dc003a70d75ad
app/pagesTask/components/HospitalSelector.vue
@@ -224,21 +224,27 @@
    
    // 选择医院
    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);
    },