吉安感知网项目-前端
罗广辉
8 days ago 1d552a3bad95caae4af15322df28e6240b797693
applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/FormDiaLog.vue
@@ -161,8 +161,7 @@
                           v-model="row.deviceFlyerId"
                           placeholder="请选择"
                           filterable
                           :disabled="dialogReadonly || !hasTaskTypeValue(taskList[$index].patrolTaskType)"
                           :disabled="dialogReadonly || !taskList[$index].patrolTaskType"
                        >
                           <el-option
                              v-for="item in flyerListMap[$index] || []"
@@ -172,7 +171,7 @@
                           >
                              <template #default>
                              <!-- 匹配区域=1 显示红星号 -->
                              <span v-if="item.areaMatchFlag === 1" style="color: #f56c6c; margin-right: 4px;">*</span>
                              <span v-if="item.taskTypeMatchFlag === 1" style="color: #f56c6c; margin-right: 4px;">*</span>
                              <span>{{ item.flyerName }}</span>
                              </template>
                           </el-option>
@@ -274,8 +273,6 @@
import {
   getTaskTypeLabel,
   taskTypeCascaderProps,
   toTaskTypeCascaderValue,
   toTaskTypeRequestValue,
} from '../taskTypeOptions'
// 初始化任务行
@@ -341,14 +338,13 @@
      // 将工单类型赋值给所有子任务行
      const workOrderType = selectedWorkOrder.value?.workOrderType
      if (workOrderType) {
         const patrolTaskType = toTaskTypeCascaderValue(workOrderType)
         taskList.value.forEach((task, index) => {
            taskList.value[index] = {
               ...initTaskRow(),
               patrolTaskType,
               patrolTaskType: workOrderType,
            }
            // 获取对应的飞手列表
            getFlyerList(index, patrolTaskType)
            getFlyerList(index, workOrderType)
         })
      }
   } else {
@@ -376,7 +372,7 @@
   const newTask = initTaskRow()
   // 如果已选择工单,自动填充工单类型
   if (selectedWorkOrder.value?.workOrderType) {
      newTask.patrolTaskType = toTaskTypeCascaderValue(selectedWorkOrder.value.workOrderType)
      newTask.patrolTaskType = selectedWorkOrder.value.workOrderType
   }
   const newIndex = taskList.value.length
   taskList.value.push(newTask)
@@ -475,7 +471,6 @@
function isTaskRowFilled(task) {
   return !!(
      task.patrolTaskName ||
      hasTaskTypeValue(task.patrolTaskType) ||
      task.executeTime ||
      task.patrolRouteUrl ||
      task.deviceFlyerId ||
@@ -483,9 +478,6 @@
   )
}
function hasTaskTypeValue(value) {
   return !!toTaskTypeRequestValue(value).length
}
// 提交新增
async function handleSubmit() {
@@ -507,10 +499,6 @@
      // 已填写的行需要校验完整性
      if (!task.patrolTaskName) {
         ElMessage.warning(`第${i + 1}行: 请输入巡查任务名称`)
         return
      }
      if (!hasTaskTypeValue(task.patrolTaskType)) {
         ElMessage.warning(`第${i + 1}行: 请选择巡查任务类型`)
         return
      }
      if (!task.executeTime) {
@@ -536,7 +524,6 @@
      // 只提交已填写的任务行
      const dataList = filledTasks.map(item => ({
         ...item,
         patrolTaskType: toTaskTypeRequestValue(item.patrolTaskType),
         workOrderId: selectedWorkOrderId.value,
         id: undefined,
      }))
@@ -565,7 +552,7 @@
      // 编辑/查看模式 - 加载已有数据
      selectedWorkOrderId.value = row?.workOrderId
      handleWorkOrderChange(row?.workOrderId)
      taskList.value = [{ ...row, patrolTaskType: toTaskTypeCascaderValue(row?.patrolTaskType) }]
      taskList.value = [{ ...row, patrolTaskType: row?.patrolTaskType || [] }]
      flyerListMap.value = {}
      // 如果有巡查类型,加载对应的飞手列表
      if (row?.patrolTaskType) {