wlzboy
2025-10-26 1626d13ec8b1a63676e63cf95c5004c4118da3b3
app/pages/task/index.vue
@@ -220,6 +220,7 @@
  import uniDatetimePicker from '@/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue'
  import { listTask, changeTaskStatus } from '@/api/task'
  import { mapState } from 'vuex'
  import { formatDateTime } from '@/utils/common'
  
  export default {
    components: {
@@ -359,7 +360,7 @@
              vehicleList: task.assignedVehicles || [],
              startLocation: this.formatAddress(task.departureAddress || task.startLocation || '未设置'),
              endLocation: this.formatAddress(task.destinationAddress || task.endLocation || '未设置'),
              startTime: task.plannedStartTime ? this.formatDateTime(task.plannedStartTime) : '未设置',
              startTime: task.plannedStartTime ? formatDateTime(task.plannedStartTime, 'YYYY-MM-DD HH:mm') : '未设置',
              assignee: task.assigneeName || '未分配'
            }
          })
@@ -367,19 +368,6 @@
          this.loading = false
          console.error('加载任务列表失败:', error)
          this.$modal.showToast('加载任务列表失败')
        })
      },
      // 格式化日期时间
      formatDateTime(dateTime) {
        if (!dateTime) return ''
        const date = new Date(dateTime)
        return date.toLocaleString('zh-CN', {
          year: 'numeric',
          month: '2-digit',
          day: '2-digit',
          hour: '2-digit',
          minute: '2-digit'
        })
      },
      
@@ -587,7 +575,7 @@
          'MAINTENANCE': '维修保养',
          'FUEL': '加油',
          'OTHER': '其他',
          'EMERGENCY_TRANSFER': '急救转运',
          'EMERGENCY_TRANSFER': '转运任务',
          'WELFARE': '福祉车'
        }
        return typeMap[type] || '未知类型'