From f08739f46afe856f60ebb1d21ab23d72947629ed Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期日, 21 十二月 2025 00:03:12 +0800
Subject: [PATCH] feat:优化任务搜索查询 app

---
 app/pages/index.vue |   99 ++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 72 insertions(+), 27 deletions(-)

diff --git a/app/pages/index.vue b/app/pages/index.vue
index 6579435..d86d564 100644
--- a/app/pages/index.vue
+++ b/app/pages/index.vue
@@ -101,7 +101,8 @@
             <view class="task-header">
               <view class="task-title">
                 {{ getTaskTypeText(task.type) }} - {{ task.vehicle }}
-                <text v-if="task.isHeadPush === '1'" class="head-push-tag">鎬�</text>
+                <text v-if="task.emergencyInfo && task.emergencyInfo.serviceOrdVip === '1'" class="vip-tag">VIP</text>
+                <text v-if="task.emergencyInfo && task.emergencyInfo.fromHq2Is === '1'" class="hq-tag">骞挎��</text>
               </view>
               <view
                 class="task-status"
@@ -127,9 +128,10 @@
               </view>
             </view>
 
-            <!-- 浠诲姟缂栧彿鍗曠嫭涓�琛� -->
+            <!-- 浠诲姟缂栧彿鍜屽紑濮嬫椂闂村湪鍚屼竴琛屾樉绀猴紝浣嗗垎寮�涓�浜� -->
             <view class="task-code-row">
               <text class="task-code">{{ task.showTaskCode }}</text>
+              <text class="task-time">{{ task.startTime }}</text>
             </view>
 
             <!-- 浠诲姟璇︾粏淇℃伅 -->
@@ -137,18 +139,18 @@
               <view class="info-row">
                 <view class="info-item">
                   <view class="label">鍑哄彂鍦�:</view>
-                  <view class="value">{{ task.startLocation }}</view>
+                  <view class="value">{{ getStartLocationDisplay(task) }}</view>
                 </view>
-                <view class="info-item">
-                  <view class="label">鐩殑鍦�:</view>
-                  <view class="value">{{ task.endLocation }}</view>
-                </view>
+                
               </view>
               <view class="info-row">
                 <view class="info-item">
-                  <view class="label">鍑哄彂鏃堕棿:</view>
-                  <view class="value">{{ task.startTime }}</view>
+                  <view class="label">鐩殑鍦�:</view>
+                  <view class="value">{{ getEndLocationDisplay(task) }}</view>
                 </view>
+              </view>
+              <view class="info-row">
+               
                 <view class="info-item">
                   <view class="label">鎵ц浜哄憳:</view>
                   <view class="value">{{ task.assignee }}</view>
@@ -505,12 +507,8 @@
                 type: task.taskType,
                 vehicle: vehicleInfo,
                 vehicleList: task.assignedVehicles || [],
-                startLocation: this.formatAddress(
-                  task.departureAddress || task.startLocation || "鏈缃�"
-                ),
-                endLocation: this.formatAddress(
-                  task.destinationAddress || task.endLocation || "鏈缃�"
-                ),
+                startLocation: task.departureAddress || task.startLocation || "鏈缃�",
+                endLocation: task.destinationAddress || task.endLocation || "鏈缃�",
                 startTime: task.plannedStartTime
                   ? formatDateTime(task.plannedStartTime, "YYYY-MM-DD HH:mm")
                   : "鏈缃�",
@@ -553,6 +551,33 @@
         return address.substring(0, dashIndex);
       }
       return address;
+    },
+
+    // 鑾峰彇鍑哄彂鍦版樉绀哄唴瀹癸紙杞繍浠诲姟鏄剧ず杞嚭鍖婚櫌鍚嶇О锛�
+    getStartLocationDisplay(task) {
+      // 濡傛灉鏄浆杩愪换鍔′笖鏈塭mergencyInfo淇℃伅
+      if (task.taskType === 'EMERGENCY_TRANSFER' && task.emergencyInfo && task.emergencyInfo.hospitalOutName) {
+        return task.emergencyInfo.hospitalOutName;
+      }
+      // 鍏朵粬鎯呭喌浣跨敤鍘熸潵鐨剆tartLocation
+      return this.formatAddress(task.startLocation || "鏈缃�");
+    },
+
+    // 鑾峰彇鐩殑鍦版樉绀哄唴瀹癸紙杞繍浠诲姟鏄剧ず杞叆鍖婚櫌鍚嶇О鎴栬缁嗗湴鍧�锛�
+    getEndLocationDisplay(task) {
+      // 濡傛灉鏄浆杩愪换鍔′笖鏈塭mergencyInfo淇℃伅
+      if (task.taskType === 'EMERGENCY_TRANSFER' && task.emergencyInfo) {
+        // 浼樺厛鏄剧ず杞叆鍖婚櫌鍚嶇О
+        if (task.emergencyInfo.hospitalInName) {
+          if(task.emergencyInfo.hospitalInName.includes("瀹朵腑")){
+            return task.emergencyInfo.destinationAddress;
+          }
+          return task.emergencyInfo.hospitalInName;
+        }
+      
+      }
+      // 鍏朵粬鎯呭喌浣跨敤鍘熸潵鐨別ndLocation
+      return this.formatAddress(task.endLocation || "鏈缃�");
     },
 
     // 杞崲鐘舵�佹牸寮忥紙灏嗘暟鎹簱鐘舵�佽浆鎹负UI浣跨敤鐨勭姸鎬侊級
@@ -824,17 +849,6 @@
   * {
     -ms-overflow-style: none; /* IE 10+ */
   }
-}
-
-// 鎬婚儴鎺ㄩ�佹爣璁版牱寮�
-.head-push-tag {
-  color: #ff0000;
-  font-size: 24rpx;
-  font-weight: bold;
-  margin-left: 10rpx;
-  padding: 2rpx 8rpx;
-  border: 1rpx solid #ff0000;
-  border-radius: 4rpx;
 }
 
 // 鐢ㄦ埛淇℃伅鍖哄煙
@@ -1115,13 +1129,22 @@
           }
         }
 
-        // 浠诲姟缂栧彿鍗曠嫭涓�琛�
+        // 浠诲姟缂栧彿鍜屾椂闂村湪鍚屼竴琛屾樉绀�
         .task-code-row {
           margin-bottom: 15rpx;
           padding: 10rpx 0;
           border-bottom: 1rpx dashed #e0e0e0;
+          display: flex;
+          justify-content: space-between;
 
           .task-code {
+            font-size: 28rpx;
+            color: #333;
+            font-weight: 500;
+            font-family: monospace;
+          }
+          
+          .task-time {
             font-size: 28rpx;
             color: #333;
             font-weight: 500;
@@ -1220,6 +1243,28 @@
         color: #666;
       }
     }
+    
+    .vip-tag {
+      display: inline-block;
+      padding: 2rpx 8rpx;
+      font-size: 20rpx;
+      color: #fff;
+      background-color: #ff0000;
+      border-radius: 4rpx;
+      margin-left: 10rpx;
+      vertical-align: middle;
+    }
+    
+    .hq-tag {
+      display: inline-block;
+      padding: 2rpx 8rpx;
+      font-size: 20rpx;
+      color: #fff;
+      background-color: #5856d6;
+      border-radius: 4rpx;
+      margin-left: 10rpx;
+      vertical-align: middle;
+    }
   }
 }
 </style>
\ No newline at end of file

--
Gitblit v1.9.1