From 09e6dc3fb7266620fafb5e341808a8eb36e080a1 Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期六, 13 十二月 2025 22:51:52 +0800
Subject: [PATCH] feat:增加企业微信消息提醒

---
 app/pagesTask/components/HospitalSelector.vue |  133 ++++++--------------------------------------
 1 files changed, 18 insertions(+), 115 deletions(-)

diff --git a/app/pagesTask/components/HospitalSelector.vue b/app/pagesTask/components/HospitalSelector.vue
index 5f3c420..cd4fd01 100644
--- a/app/pagesTask/components/HospitalSelector.vue
+++ b/app/pagesTask/components/HospitalSelector.vue
@@ -27,42 +27,6 @@
       </view>
     </view>
     
-    <view class="form-item" v-if="showDepartment">
-      <view class="form-label" :class="{ required: departmentRequired }">绉戝</view>
-      <picker 
-        v-if="selectedHospitalName !== '瀹朵腑' && departmentOptions.length > 0"
-        mode="selector" 
-        :range="departmentOptions" 
-        range-key="text" 
-        @change="onDepartmentChange"
-      >
-        <view class="form-input picker-input">
-          {{ departmentValue || '璇烽�夋嫨绉戝' }}
-          <uni-icons type="arrowright" size="16" color="#999"></uni-icons>
-        </view>
-      </picker>
-      <input 
-        v-else-if="selectedHospitalName !== '瀹朵腑'"
-        class="form-input" 
-        placeholder="璇疯緭鍏ョ瀹�" 
-        :value="departmentValue"
-        @input="onDepartmentInput"
-      />
-      <view v-else class="form-input picker-input disabled">
-        鍏跺畠
-      </view>
-    </view>
-    
-    <view class="form-item" v-if="showBedNumber">
-      <view class="form-label">搴婂彿</view>
-      <input 
-        class="form-input" 
-        placeholder="璇疯緭鍏ュ簥鍙�" 
-        :value="bedNumberValue"
-        @input="onBedNumberInput"
-      />
-    </view>
-    
     <view class="form-item">
       <view class="form-label" :class="{ required: required }">{{ addressLabel }}</view>
       <view class="address-input-container" v-if="selectedHospitalName === '瀹朵腑'">
@@ -136,26 +100,6 @@
         address: ''
       })
     },
-    // 鏄惁鏄剧ず绉戝
-    showDepartment: {
-      type: Boolean,
-      default: true
-    },
-    // 绉戝鏄惁蹇呭~
-    departmentRequired: {
-      type: Boolean,
-      default: false
-    },
-    // 绉戝閫夐」鍒楄〃锛堢敤浜� picker锛�
-    departmentOptions: {
-      type: Array,
-      default: () => []
-    },
-    // 鏄惁鏄剧ず搴婂彿
-    showBedNumber: {
-      type: Boolean,
-      default: true
-    },
     // 閮ㄩ棬ID锛堢敤浜庡尯鍩熻繃婊わ級
     deptId: {
       type: [Number, String],
@@ -186,12 +130,6 @@
   computed: {
     addressValue() {
       return this.value.address || ''
-    },
-    departmentValue() {
-      return this.value.department || ''
-    },
-    bedNumberValue() {
-      return this.value.bedNumber || ''
     }
   },
   watch: {
@@ -286,30 +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,
-        department: this.value.department || '',
-        departmentId: this.value.departmentId || null,
-        bedNumber: this.value.bedNumber || '',
+        id: hospital.hospId || null,
+        name: hospital.hospName || '',
         address: hospital.hospName === '瀹朵腑' ? '' : this.buildFullAddress(hospital)
       }
       
-      // 濡傛灉閫夋嫨鐨勬槸"瀹朵腑"锛岀瀹よ缃负"鍏跺畠"
-      if (hospital.hospName === '瀹朵腑') {
-        hospitalData.department = '鍏跺畠'
-        hospitalData.departmentId = null
-      }
-      
-      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);
     },
     
 
@@ -388,45 +323,13 @@
         ...this.value,
         address: fullAddress
       })
+      this.$emit('address-selected', {
+        address: fullAddress,
+        location: item.location
+      })
           
       this.showAddressSuggestions = false
       this.addressSuggestions = []
-    },
-    
-    // 绉戝閫夋嫨鍙樺寲锛坧icker锛�
-    onDepartmentChange(e) {
-      const index = e.detail.value
-      const selected = this.departmentOptions[index]
-      const updatedValue = {
-        ...this.value,
-        department: selected.text,
-        departmentId: selected.id
-      }
-      this.$emit('input', updatedValue)
-      this.$emit('department-change', {
-        department: selected.text,
-        departmentId: selected.id
-      })
-    },
-    
-    // 绉戝杈撳叆锛堟墜鍔ㄨ緭鍏ワ級
-    onDepartmentInput(e) {
-      const department = e.detail.value
-      this.$emit('input', {
-        ...this.value,
-        department: department
-      })
-      this.$emit('department-change', department)
-    },
-    
-    // 搴婂彿杈撳叆
-    onBedNumberInput(e) {
-      const bedNumber = e.detail.value
-      this.$emit('input', {
-        ...this.value,
-        bedNumber: bedNumber
-      })
-      this.$emit('bed-number-change', bedNumber)
     }
   }
 }

--
Gitblit v1.9.1