| | |
| | | <view class="label">执行车辆</view> |
| | | <view class="value">{{ getVehicleInfo(taskDetail) }}</view> |
| | | </view> |
| | | <view class="info-item"> |
| | | <view class="label">执行人员</view> |
| | | <view class="value">{{ taskDetail.assigneeName || '未分配' }}</view> |
| | | </view> |
| | | |
| | | <!-- 执行人员列表 --> |
| | | <view class="detail-section"> |
| | | <view class="section-title">执行人员</view> |
| | | <view v-if="taskDetail.assignees && taskDetail.assignees.length > 0" class="assignee-list"> |
| | | <view |
| | | class="assignee-item" |
| | | v-for="(assignee, index) in taskDetail.assignees" |
| | | :key="assignee.userId || index" |
| | | > |
| | | <view class="assignee-index">{{ index + 1 }}</view> |
| | | <view class="assignee-info"> |
| | | <view class="assignee-name"> |
| | | {{ assignee.userName }} |
| | | <view v-if="assignee.isPrimary === '1'" class="primary-badge"> |
| | | <uni-icons type="star-filled" size="12" color="#ff9500"></uni-icons> |
| | | <text>负责人</text> |
| | | </view> |
| | | </view> |
| | | <view class="assignee-role"> |
| | | <view |
| | | class="role-tag" |
| | | :class="{ |
| | | 'role-driver': assignee.userType === 'driver', |
| | | 'role-doctor': assignee.userType === 'doctor', |
| | | 'role-nurse': assignee.userType === 'nurse' |
| | | }" |
| | | > |
| | | {{ getUserTypeLabel(assignee.userType) }} |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view v-else class="empty-assignee"> |
| | | <uni-icons type="info" size="40" color="#ccc"></uni-icons> |
| | | <text>暂无执行人员</text> |
| | | </view> |
| | | </view> |
| | | |
| | | <view class="detail-section"> |
| | | <view class="section-title">时间信息</view> |
| | | <view class="info-item"> |
| | | <view class="label">计划开始时间</view> |
| | | <view class="label">预约时间</view> |
| | | <view class="value">{{ displayPlannedStartTime }}</view> |
| | | </view> |
| | | <view class="info-item"> |
| | | <view class="info-item" v-if="taskDetail.plannedEndTime"> |
| | | <view class="label">计划结束时间</view> |
| | | <view class="value">{{ displayPlannedEndTime }}</view> |
| | | </view> |
| | |
| | | if (!this.taskDetail || !this.taskDetail.plannedStartTime) { |
| | | return '未设置' |
| | | } |
| | | return formatDateTime(this.taskDetail.plannedStartTime, 'YYYY-MM-DD HH:mm') |
| | | const formatted = formatDateTime(this.taskDetail.plannedStartTime, 'YYYY-MM-DD HH:mm') |
| | | // 如果年份是1900,表示无效日期,显示为未设置 |
| | | if (formatted && formatted.startsWith('1900')) { |
| | | return '未设置' |
| | | } |
| | | return formatted |
| | | }, |
| | | // 显示计划结束时间 |
| | | displayPlannedEndTime() { |
| | | if (!this.taskDetail || !this.taskDetail.plannedEndTime) { |
| | | return '未设置' |
| | | } |
| | | return formatDateTime(this.taskDetail.plannedEndTime, 'YYYY-MM-DD HH:mm') |
| | | const formatted = formatDateTime(this.taskDetail.plannedEndTime, 'YYYY-MM-DD HH:mm') |
| | | // 如果年份是1900,表示无效日期,显示为未设置 |
| | | if (formatted && formatted.startsWith('1900')) { |
| | | return '未设置' |
| | | } |
| | | return formatted |
| | | }, |
| | | // 显示实际开始时间 |
| | | displayActualStartTime() { |
| | | if (!this.taskDetail || !this.taskDetail.actualStartTime) { |
| | | return '未设置' |
| | | } |
| | | return formatDateTime(this.taskDetail.actualStartTime, 'YYYY-MM-DD HH:mm') |
| | | const formatted = formatDateTime(this.taskDetail.actualStartTime, 'YYYY-MM-DD HH:mm') |
| | | // 如果年份是1900,表示无效日期,显示为未设置 |
| | | if (formatted && formatted.startsWith('1900')) { |
| | | return '未设置' |
| | | } |
| | | return formatted |
| | | }, |
| | | // 显示实际结束时间 |
| | | displayActualEndTime() { |
| | | if (!this.taskDetail || !this.taskDetail.actualEndTime) { |
| | | return '未设置' |
| | | } |
| | | return formatDateTime(this.taskDetail.actualEndTime, 'YYYY-MM-DD HH:mm') |
| | | const formatted = formatDateTime(this.taskDetail.actualEndTime, 'YYYY-MM-DD HH:mm') |
| | | // 如果年份是1900,表示无效日期,显示为未设置 |
| | | if (formatted && formatted.startsWith('1900')) { |
| | | return '未设置' |
| | | } |
| | | return formatted |
| | | } |
| | | }, |
| | | onLoad(options) { |
| | |
| | | getTask(this.taskId).then(response => { |
| | | this.taskDetail = response.data || response |
| | | // 调试:打印返回的数据 |
| | | console.log('任务详情完整数据:', JSON.stringify(this.taskDetail, null, 2)) |
| | | console.log('任务类型字段值:', this.taskDetail.taskType) |
| | | console.log('任务状态字段值:', this.taskDetail.taskStatus) |
| | | console.log('出发地址:', this.taskDetail.departureAddress) |
| | | console.log('目的地址:', this.taskDetail.destinationAddress) |
| | | console.log('转运任务信息 (emergencyInfo):', this.taskDetail.emergencyInfo) |
| | | // console.log('任务详情完整数据:', JSON.stringify(this.taskDetail, null, 2)) |
| | | // console.log('任务类型字段值:', this.taskDetail.taskType) |
| | | // console.log('任务状态字段值:', this.taskDetail.taskStatus) |
| | | // console.log('出发地址:', this.taskDetail.departureAddress) |
| | | // console.log('目的地址:', this.taskDetail.destinationAddress) |
| | | // console.log('转运任务信息 (emergencyInfo):', this.taskDetail.emergencyInfo) |
| | | |
| | | // 如果是转运任务,加载支付信息 |
| | | if (this.taskDetail.taskType === 'EMERGENCY_TRANSFER') { |
| | |
| | | return remaining > 0 ? remaining.toFixed(2) : '0.00' |
| | | }, |
| | | |
| | | // 获取车辆信息 |
| | | // 获取车辆信息(修复:防止 assignedVehicles 为 null) |
| | | getVehicleInfo(task) { |
| | | if (task.assignedVehicles && task.assignedVehicles.length > 0) { |
| | | if (task.assignedVehicles && Array.isArray(task.assignedVehicles) && task.assignedVehicles.length > 0) { |
| | | const firstVehicle = task.assignedVehicles[0] |
| | | let vehicleInfo = firstVehicle.vehicleNo || '未知车牌' |
| | | if (task.assignedVehicles.length > 1) { |
| | |
| | | return typeMap[type] || '未知类型' |
| | | }, |
| | | |
| | | // 获取用户类型标签 |
| | | getUserTypeLabel(userType) { |
| | | const typeMap = { |
| | | 'driver': '司机', |
| | | 'doctor': '医生', |
| | | 'nurse': '护士' |
| | | } |
| | | return typeMap[userType] || userType || '未知' |
| | | }, |
| | | |
| | | // 处理结算 |
| | | handleSettlement() { |
| | | uni.navigateTo({ |
| | |
| | | |
| | | const activeTasks = response.data || []; |
| | | |
| | | // 过滤掉当前任务本身 |
| | | const otherActiveTasks = activeTasks.filter(task => task.taskId !== this.taskId); |
| | | // 过滤掉当前任务本身(修复:防止 activeTasks 为 null) |
| | | const otherActiveTasks = (activeTasks && Array.isArray(activeTasks)) ? activeTasks.filter(task => task.taskId !== this.taskId) : []; |
| | | |
| | | if (otherActiveTasks.length > 0) { |
| | | // 车辆有其他正在进行中的任务 |
| | |
| | | } |
| | | } |
| | | |
| | | // 执行人员列表样式 |
| | | .assignee-list { |
| | | .assignee-item { |
| | | display: flex; |
| | | align-items: center; |
| | | padding: 20rpx; |
| | | margin-bottom: 15rpx; |
| | | background-color: #f9f9f9; |
| | | border-radius: 10rpx; |
| | | |
| | | &:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | |
| | | .assignee-index { |
| | | width: 50rpx; |
| | | height: 50rpx; |
| | | border-radius: 50%; |
| | | background-color: #007AFF; |
| | | color: white; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | font-size: 24rpx; |
| | | font-weight: bold; |
| | | margin-right: 20rpx; |
| | | flex-shrink: 0; |
| | | } |
| | | |
| | | .assignee-info { |
| | | flex: 1; |
| | | display: flex; |
| | | flex-direction: column; |
| | | gap: 10rpx; |
| | | |
| | | .assignee-name { |
| | | display: flex; |
| | | align-items: center; |
| | | font-size: 30rpx; |
| | | color: #333; |
| | | font-weight: 500; |
| | | |
| | | .primary-badge { |
| | | display: inline-flex; |
| | | align-items: center; |
| | | gap: 4rpx; |
| | | margin-left: 12rpx; |
| | | padding: 4rpx 12rpx; |
| | | background-color: #fff3e0; |
| | | border-radius: 6rpx; |
| | | |
| | | text { |
| | | font-size: 20rpx; |
| | | color: #ff9500; |
| | | font-weight: normal; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .assignee-role { |
| | | .role-tag { |
| | | display: inline-block; |
| | | padding: 4rpx 12rpx; |
| | | border-radius: 6rpx; |
| | | font-size: 22rpx; |
| | | color: white; |
| | | |
| | | &.role-driver { |
| | | background-color: #007AFF; |
| | | } |
| | | |
| | | &.role-doctor { |
| | | background-color: #34C759; |
| | | } |
| | | |
| | | &.role-nurse { |
| | | background-color: #AF52DE; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | .empty-assignee { |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | justify-content: center; |
| | | padding: 60rpx 0; |
| | | color: #999; |
| | | |
| | | text { |
| | | margin-top: 20rpx; |
| | | font-size: 28rpx; |
| | | } |
| | | } |
| | | |
| | | .info-item { |
| | | display: flex; |
| | | margin-bottom: 20rpx; |