吉安感知网项目-前端
shuishen
6 days ago 6e88705bd5b443a259b24c17c8a299765d059d96
applications/task-work-order/src/views/orderView/flyingHand/FlyingHandDialog.vue
@@ -30,7 +30,7 @@
      </el-col>
     <el-col :span="12">
        <div class="label">擅长任务类型</div>
        <div class="val">{{ getDictLabel(formData.skilledTaskType, dictObj.workOrderType) }}</div>
        <div class="val">{{ getTaskTypeLabel(formData.skilledTaskType, workOrderTypeXT) }}</div>
      </el-col>
     <el-col :span="12">
        <div class="label">项目经验</div>
@@ -60,23 +60,37 @@
         :model="formData"
         :rules="rules"
         class="gd-dialog-form"
         label-width="160px"
         label-width="auto"
         v-else
      >
         <el-row>
            <el-col :span="12">
               <el-form-item label="飞手姓名" prop="flyerId">
                  <el-select
                  <el-select v-if="dialogType === 'add'"
                     class="gd-select"
                     popper-class="gd-select-popper"
                     v-model="formData.flyerId"
                     placeholder="请选择"
                     clearable
                     @change="handleChange"
                     :disabled="dialogType === 'view'"
                  >
                     <el-option
                        v-for="item in flyingHandList"
                        :key="item.id"
                        :label="item.name"
                        :value="item.id"
                     />
                  </el-select>
                  <el-select v-else
                     class="gd-select"
                     popper-class="gd-select-popper"
                     v-model="formData.flyerId"
                     placeholder="请选择"
                     clearable
                     :disabled="dialogType === 'edit'"
                  >
                     <el-option
                        v-for="item in flyingHandEditList"
                        :key="item.id"
                        :label="item.name"
                        :value="item.id"
@@ -145,20 +159,17 @@
            </el-col>
            <el-col :span="12">
               <el-form-item label="擅长任务类型" prop="skilledTaskType">
                  <el-select
                     class="gd-select"
                     popper-class="gd-select-popper"
                  <el-cascader
                     class="gd-cascader"
                     popper-class="gd-cascader-popper"
                     v-model="formData.skilledTaskType"
                     :options="workOrderTypeXT"
                     :props="{ ...taskTypeCascaderProps, multiple: true }"
                     placeholder="请选择"
                     :disabled="dialogType === 'view'"
                  >
                     <el-option
                        v-for="item in dictObj.workOrderType"
                        :key="item.dictKey"
                        :label="item.dictValue"
                        :value="item.dictKey"
                     />
                  </el-select>
                     clearable
                     collapse-tags
                  />
               </el-form-item>
            </el-col>
            <el-col :span="24">
@@ -193,6 +204,10 @@
import { submitFlyingHand } from './flyingHandApi'
import { ElMessage } from 'element-plus'
import { getDictLabel } from '@ztzf/utils'
import {
   getTaskTypeLabel,
   taskTypeCascaderProps,
} from '../orderManage/taskTypeOptions'
import { fieldRules } from '@ztzf/utils'
@@ -213,8 +228,11 @@
})
const dictObj = inject('dictObj') // 擅长任务类型
const workOrderTypeXT = inject('workOrderTypeXT', ref([]))
const flyingHandList = inject('flyingHandList') // 飞手列表
const flyingHandEditList = inject('flyingHandEditList') // 飞手建档列表
const emit = defineEmits(['update:modelValue', 'confirm'])
@@ -246,8 +264,10 @@
   projectExperience: '',
   technicalStrength: '',
   skilledUavType: '',
   skilledTaskType: [],
   certification: [], // 证书
   regionCode: '', // 区域编码
   flyerAddress: '', // 飞手地址
})
const formData = ref(initForm()) // 表单数据
@@ -301,6 +321,7 @@
      if (newData) {
         Object.assign(formData.value, newData)
         formData.value.flightHours = Number(newData.flightHours)
         formData.value.skilledTaskType = newData.skilledTaskType || []
      }
   },
   { deep: true, immediate: true }
@@ -319,6 +340,7 @@
   formData.value.regionCode = result.regionCode
   formData.value.flyerPhone = result.phone
   formData.value.flightHours = result.duration || 0
   formData.value.flyerAddress = result.address
   // formData.value.certification = formData.value.certification.concat(result.licenseFrontFileUrl || [], result.licenseBackFileUrl || [])
}
@@ -335,7 +357,7 @@
      projectExperience: '',
      technicalStrength: '',
      skilledUavType: '',
      skilledTaskType: ''
      skilledTaskType: []
   })
}