| | |
| | | </div> |
| | | |
| | | <!-- 子任务表格表单 --> |
| | | <div class="task-table-section" v-if="selectedWorkOrderId"> |
| | | <div |
| | | class="task-table-section" |
| | | :class="{ 'disabled-section': !selectedWorkOrderId }" |
| | | @click="handleTaskSectionClick" |
| | | > |
| | | <div class="detail-title" :style="{ marginTop: pxToRem(10) }">添加子任务</div> |
| | | <div class="task-table-container"> |
| | | <el-table :data="taskList"> |
| | |
| | | <span class="required-star">*</span> |
| | | 巡查任务类型 |
| | | </template> |
| | | <template v-slot="{ row }"> |
| | | <template v-slot="{ row, $index }"> |
| | | <el-select |
| | | class="gd-select" |
| | | popper-class="gd-select-popper" |
| | | v-model="row.patrolTaskType" |
| | | placeholder="请选择" |
| | | disabled |
| | | @change="handlePatrolTaskTypeChange($index, $event)" |
| | | > |
| | | <el-option |
| | | v-for="item in dictObj.workOrderType" |
| | |
| | | 任务执行时间 |
| | | </template> |
| | | <template v-slot="{ row }"> |
| | | <!-- gd-date-picker-popper--> |
| | | <el-date-picker |
| | | class="gd-date-picker" |
| | | popper-class="gd-date-picker-popper" |
| | | popper-class="" |
| | | v-model="row.executeTime" |
| | | type="datetime" |
| | | placeholder="请选择" |
| | |
| | | </template> |
| | | <template v-slot="{ row, $index }"> |
| | | <el-select |
| | | no-data-text="暂无推荐飞手" |
| | | class="gd-select" |
| | | popper-class="gd-select-popper" |
| | | v-model="row.recommendFlyerName" |
| | |
| | | } |
| | | } |
| | | |
| | | // 处理任务区域点击事件(未选择工单时提示) |
| | | function handleTaskSectionClick() { |
| | | if (!selectedWorkOrderId.value) { |
| | | ElMessage.warning('请先选择工单') |
| | | } |
| | | } |
| | | |
| | | // 获取工单列表 |
| | | async function getWorkOrderList() { |
| | | const res = await gdWorkOrderPageApi({ size: 999, workOrderStatus: dialogMode.value === 'add' ? '20' : '' }) |
| | | workOrderList.value = res?.data?.data?.records ?? [] |
| | | } |
| | | |
| | | // 处理巡查任务类型变化 |
| | | async function handlePatrolTaskTypeChange(index, skilledTaskType) { |
| | | // 清空该行已选择的飞手 |
| | | taskList.value[index].recommendFlyerName = '' |
| | | // 获取对应的飞手列表 |
| | | await getFlyerList(index, skilledTaskType) |
| | | } |
| | | |
| | | // 获取飞手列表 |
| | |
| | | color: #f56c6c; |
| | | margin-right: 4px; |
| | | } |
| | | :deep(.el-table__header th) { |
| | | font-weight: normal !important; |
| | | } |
| | | |
| | | .grayText { |
| | | color: #9f9f9f !important; |
| | | } |
| | | |
| | | // 禁用区域样式 - 使用 pointer-events: none 禁用所有子元素的点击 |
| | | .disabled-section { |
| | | .task-table-container { |
| | | * { |
| | | pointer-events: none; |
| | | } |
| | | } |
| | | opacity: 0.6; |
| | | cursor: not-allowed; |
| | | } |
| | | </style> |