| | |
| | | <view class="title">任务详情</view> |
| | | <view class="edit-btn" @click="handleEdit" v-if="taskDetail && !isTaskFinished"> |
| | | <uni-icons type="compose" size="20" color="#007AFF"></uni-icons> |
| | | <text class="edit-text">修改</text> |
| | | </view> |
| | | </view> |
| | | |
| | |
| | | <view class="action-buttons" v-if="taskDetail"> |
| | | <!-- 待处理状态: 显示出发、取消、强制完成 --> |
| | | <template v-if="taskDetail.taskStatus === 'PENDING'"> |
| | | <template v-if="isCurrentUserAssignee()"> |
| | | <button |
| | | class="action-btn primary" |
| | | @click="handleDepartAction()" |
| | | > |
| | | 出发 |
| | | </button> |
| | | <button |
| | | class="action-btn cancel" |
| | | @click="handleTaskAction('cancel')" |
| | | > |
| | | 取消 |
| | | </button> |
| | | <button |
| | | class="action-btn force-complete" |
| | | @click="showForceCompleteTimeDialog()" |
| | | > |
| | | 强制完成 |
| | | </button> |
| | | </template> |
| | | <button |
| | | v-if="isCurrentUserAssignee()" |
| | | class="action-btn primary" |
| | | @click="handleDepartAction()" |
| | | > |
| | | 出发 |
| | | </button> |
| | | <button |
| | | class="action-btn cancel" |
| | | @click="handleTaskAction('cancel')" |
| | | > |
| | | 取消 |
| | | </button> |
| | | <button |
| | | v-if="isCurrentUserAssignee() && showForceCompleteFeature()" |
| | | class="action-btn force-complete" |
| | | @click="showForceCompleteTimeDialog()" |
| | | > |
| | | 强制完成 |
| | | </button> |
| | | </template> |
| | | |
| | | <!-- 出发中状态: 显示已到达、强制结束 --> |
| | |
| | | break; |
| | | |
| | | case 'forceCancel': |
| | | // 强制结束 -> 状态变为已取消 |
| | | this.$modal.confirm('确定要强制结束此任务吗?').then(() => { |
| | | this.updateTaskStatus('CANCELLED', '任务已强制结束') |
| | | }).catch(() => {}); |
| | | // 强制结束 -> 显示取消原因选择对话框 |
| | | this.showCancelReasonDialog(); |
| | | break; |
| | | |
| | | case 'return': |
| | |
| | | console.log('附件删除成功:', attachmentId) |
| | | }, |
| | | |
| | | // 是否显示“就绪”功能(配置开关) |
| | | // 是否显示"就绪"功能(配置开关) |
| | | showAssigneeReadyFeature() { |
| | | return !!(config && config.features && config.features.showAssigneeReadyButton) |
| | | }, |
| | | |
| | | // 是否显示"强制完成"功能(配置开关) |
| | | showForceCompleteFeature() { |
| | | return !!(config && config.features && config.features.showForceCompleteButton) |
| | | }, |
| | | |
| | | // 当前用户是否为该执行人 |
| | |
| | | } |
| | | |
| | | .edit-btn { |
| | | width: 60rpx; |
| | | width: 120rpx; |
| | | height: 60rpx; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | cursor: pointer; |
| | | |
| | | .edit-text { |
| | | margin-left: 8rpx; |
| | | font-size: 28rpx; |
| | | color: #007AFF; |
| | | } |
| | | } |
| | | } |
| | | |