| | |
| | | width="75%" |
| | | :close-on-click-modal="false" |
| | | > |
| | | <div class="gd-dialog-form"> |
| | | <div> |
| | | <!-- 关联工单选择 --> |
| | | <div class="work-order-section"> |
| | | <div class="detail-title" :style="{ marginBottom: 0, marginRight: pxToRem(10) }">选择工单</div> |
| | |
| | | <el-table-column width="50" label=""> |
| | | <template v-slot="{ $index }">{{ $index + 1 }}</template> |
| | | </el-table-column> |
| | | <el-table-column prop="patrolTaskName" min-width="120"> |
| | | <el-table-column prop="patrolTaskName" min-width="100"> |
| | | <template #header> |
| | | <span class="required-star">*</span> |
| | | 巡查任务名称 |
| | |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="patrolTaskType" min-width="140"> |
| | | <el-table-column prop="patrolTaskType" min-width="100"> |
| | | <template #header> |
| | | <span class="required-star">*</span> |
| | | 巡查任务类型 |
| | |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="executeTime" min-width="180"> |
| | | <el-table-column prop="executeTime" width="100"> |
| | | <template #header> |
| | | <span class="required-star">*</span> |
| | | 任务执行时间 |
| | |
| | | <template v-slot="{ row }"> |
| | | <!-- gd-date-picker-popper--> |
| | | <el-date-picker |
| | | :style="{width: pxToRem(160)}" |
| | | :style="{width: pxToRem(165)}" |
| | | class="gd-date-picker" |
| | | popper-class="" |
| | | v-model="row.executeTime" |
| | |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="patrolRouteUrl" min-width="120"> |
| | | <el-table-column prop="patrolRouteUrl" min-width="100"> |
| | | <template #header> |
| | | <span class="required-star">*</span> |
| | | 巡查任务航线 |
| | |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="recommendFlyerName" min-width="120"> |
| | | <el-table-column prop="deviceFlyerId" min-width="100"> |
| | | <template #header> |
| | | <span class="required-star">*</span> |
| | | 推荐飞手 |
| | |
| | | no-data-text="暂无推荐飞手" |
| | | class="gd-select" |
| | | popper-class="gd-select-popper" |
| | | v-model="row.recommendFlyerName" |
| | | v-model="row.deviceFlyerId" |
| | | placeholder="请选择" |
| | | filterable |
| | | :disabled="dialogReadonly || !taskList[$index].patrolTaskType" |
| | | @change="handleFlyerChange($index, $event)" |
| | | > |
| | | <el-option |
| | | v-for="item in flyerListMap[$index] || []" |
| | | :key="item.id" |
| | | :key="item.flyerId" |
| | | :label="item.flyerName" |
| | | :value="item.flyerName" |
| | | :value="item.flyerId" |
| | | > |
| | | <template #default> |
| | | <!-- 匹配区域=1 显示红星号 --> |
| | |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="deviceId" min-width="120"> |
| | | <el-table-column prop="deviceId" min-width="100"> |
| | | <template #header> |
| | | <span class="required-star">*</span> |
| | | 选择设备 |
| | |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="taskDesc" label="巡查任务描述" min-width="120"> |
| | | <el-table-column prop="taskDesc" label="巡查任务描述"> |
| | | <template v-slot="{ row }"> |
| | | <el-input class="gd-input" v-model="row.taskDesc" placeholder="请输入" :disabled="dialogReadonly" /> |
| | | </template> |
| | |
| | | patrolTaskType: '', |
| | | executeTime: '', |
| | | patrolRouteUrl: '', |
| | | deviceFlyerId: '', |
| | | recommendFlyerName: '', |
| | | deviceId: null, |
| | | taskDesc: '', |
| | |
| | | // 处理巡查任务类型变化 |
| | | async function handlePatrolTaskTypeChange(index, skilledTaskType) { |
| | | // 清空该行已选择的飞手 |
| | | taskList.value[index].deviceFlyerId = '' |
| | | taskList.value[index].recommendFlyerName = '' |
| | | // 获取对应的飞手列表 |
| | | await getFlyerList(index, skilledTaskType) |
| | | } |
| | | |
| | | function handleFlyerChange(index, flyerId) { |
| | | const selectedFlyer = (flyerListMap.value[index] || []).find(item => item.flyerId === flyerId) |
| | | taskList.value[index].recommendFlyerName = selectedFlyer?.flyerName || '' |
| | | } |
| | | |
| | | import * as turf from '@turf/turf' |
| | |
| | | |
| | | // 判断一行是否已填写(至少填写了任务名称) |
| | | function isTaskRowFilled(task) { |
| | | return !!(task.patrolTaskName || task.executeTime || task.patrolRouteUrl || task.recommendFlyerName || task.deviceId) |
| | | return !!(task.patrolTaskName || task.executeTime || task.patrolRouteUrl || task.deviceFlyerId || task.deviceId) |
| | | } |
| | | |
| | | // 提交新增 |
| | |
| | | ElMessage.warning(`第${i + 1}行: 请选择巡查任务航线`) |
| | | return |
| | | } |
| | | if (!task.recommendFlyerName) { |
| | | if (!task.deviceFlyerId) { |
| | | ElMessage.warning(`第${i + 1}行: 请选择推荐飞手`) |
| | | return |
| | | } |