From faff7314b240922d20fdd2fbc455c61dbc297cd5 Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期一, 29 十二月 2025 23:38:00 +0800
Subject: [PATCH] feat: 优化变更状态

---
 app/pagesTask/create-emergency.vue |   36 +++++++++++++++++++++++-------------
 1 files changed, 23 insertions(+), 13 deletions(-)

diff --git a/app/pagesTask/create-emergency.vue b/app/pagesTask/create-emergency.vue
index 8d590d5..d3db251 100644
--- a/app/pagesTask/create-emergency.vue
+++ b/app/pagesTask/create-emergency.vue
@@ -567,11 +567,7 @@
       console.log('杞嚭鍖婚櫌鍙樺寲:', hospitalData)
       // 缁勪欢宸茬粡閫氳繃 v-model 鏇存柊浜� taskForm.hospitalOut
       
-      // 濡傛灉閫夋嫨鐨勬槸"瀹朵腑"锛岃嚜鍔ㄨ缃瀹や负"鍏跺畠"
-      if (hospitalData.name === '瀹朵腑') {
-        this.taskForm.hospitalOut.department = '鍏跺畠'
-        this.taskForm.hospitalOut.departmentId = null
-      }
+      // 绉戝鐨勮缃敱 DepartmentSelector 缁勪欢鑷姩澶勭悊锛堥�氳繃 isHome 灞炴�э級
       
       // 濡傛灉杞叆鍦板潃宸插~鍐�,鑷姩璁$畻璺濈
       if (this.taskForm.hospitalIn.address) {
@@ -597,11 +593,7 @@
       console.log('杞叆鍖婚櫌鍙樺寲:', hospitalData)
       // 缁勪欢宸茬粡閫氳繃 v-model 鏇存柊浜� taskForm.hospitalIn
       
-      // 濡傛灉閫夋嫨鐨勬槸"瀹朵腑"锛岃嚜鍔ㄨ缃瀹や负"鍏跺畠"
-      if (hospitalData.name === '瀹朵腑') {
-        this.taskForm.hospitalIn.department = '鍏跺畠'
-        this.taskForm.hospitalIn.departmentId = null
-      }
+      // 绉戝鐨勮缃敱 DepartmentSelector 缁勪欢鑷姩澶勭悊锛堥�氳繃 isHome 灞炴�э級
       
       // 濡傛灉杞嚭鍦板潃宸插~鍐�,鑷姩璁$畻璺濈
       if (this.taskForm.hospitalOut.address) {
@@ -813,6 +805,18 @@
         return false
       }
       
+      // 濡傛灉杞叆鍖婚櫌鏄�滃涓�濓紝蹇呴』濉啓鍦板潃
+      if (this.taskForm.hospitalIn.name === '瀹朵腑' && !this.taskForm.hospitalIn.address) {
+        this.$modal.showToast('璇疯緭鍏ヨ浆鍏ュ湴鍧�锛堝涓級')
+        return false
+      }
+      
+      // 濡傛灉杞嚭鍖婚櫌鏄�滃涓�濓紝蹇呴』濉啓鍦板潃
+      if (this.taskForm.hospitalOut.name === '瀹朵腑' && !this.taskForm.hospitalOut.address) {
+        this.$modal.showToast('璇疯緭鍏ヨ浆鍑哄湴鍧�锛堝涓級')
+        return false
+      }
+      
       if (!this.taskForm.transferDistance) {
         this.$modal.showToast('璇疯緭鍏ヨ浆杩愬叕閲屾暟')
         return false
@@ -846,6 +850,10 @@
           conditionText = this.taskForm.patient.condition
         }
       }
+      
+      // 璋冭瘯鏃ュ織锛氭鏌ヨ浆鍏ュ尰闄㈠湴鍧�
+      console.log('鏋勫缓鎻愪氦鏁版嵁 - 杞叆鍖婚櫌:', this.taskForm.hospitalIn.name)
+      console.log('鏋勫缓鎻愪氦鏁版嵁 - 杞叆鍖婚櫌鍦板潃:', this.taskForm.hospitalIn.address)
       
       const submitData = {
         taskType: 'EMERGENCY_TRANSFER',
@@ -908,8 +916,11 @@
       if (!this.validateForm()) {
         return
       }
-      
-      // 鑾峰彇褰撳墠鏃ユ湡锛堟牸寮廦YYY-MM-DD锛�
+      this.doSubmitTask();
+   
+    },
+    checkTaskDp(){
+   // 鑾峰彇褰撳墠鏃ユ湡锛堟牸寮廦YYY-MM-DD锛�
       const today = new Date()
       const createDate = today.getFullYear() + '-' + 
                         String(today.getMonth() + 1).padStart(2, '0') + '-' + 
@@ -938,7 +949,6 @@
         this.$modal.showToast('妫�鏌ュけ璐ワ紝璇烽噸璇�')
       })
     },
-    
     // 鎵ц瀹為檯鐨勬彁浜ゆ搷浣�
     doSubmitTask() {
       this.$modal.confirm('纭畾瑕佷繚瀛樹换鍔″悧锛�').then(() => {

--
Gitblit v1.9.1