| | |
| | | <template> |
| | | <el-dialog |
| | | class="gd-dialog" |
| | | class="gd-dialog orderManageFormDlg" |
| | | v-model="visible" |
| | | :title="titleEnum[dialogMode]" |
| | | @closed="visible = false" |
| | |
| | | destroy-on-close |
| | | :close-on-click-modal="false" |
| | | > |
| | | <div class="content" style="display: flex"> |
| | | <el-tabs class="gd-tabs" v-model="activeName" @tab-click="tabsClick" v-if="dialogReadonly && formData.workOrderStatus >= '30'"> |
| | | <el-tab-pane label="基础信息" name="basic"></el-tab-pane> |
| | | <el-tab-pane label="成果数据" name="result"> |
| | | <OutcomeData :workOrderId="formData.id" /> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | <div class="content" style="display: flex" v-if="activeName === 'basic'"> |
| | | <div class="processBox" v-if="dialogMode !== 'add'"> |
| | | <div class="detail-title">工单记录</div> |
| | | <div class="process"> |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <div class="label">工单类型</div> |
| | | <div class="val">{{ getDictLabel(formData.workOrderType, dictObj.workOrderType) }}</div> |
| | | <div class="val">{{ getTaskTypeLabel(formData.workOrderType, workOrderTypeXT) }}</div> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <div class="label">执行时间范围</div> |
| | |
| | | <el-table-column prop="patrolTaskName" show-overflow-tooltip label="巡查任务名称" /> |
| | | <el-table-column prop="patrolTaskType" show-overflow-tooltip label="巡查任务类型"> |
| | | <template v-slot="{ row }"> |
| | | {{ getDictLabel(row.patrolTaskType, dictObj.workOrderType) }} |
| | | {{ getTaskTypeLabel(row.patrolTaskType, workOrderTypeXT) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="taskStatus" show-overflow-tooltip label="任务状态"> |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="工单类型" prop="workOrderType"> |
| | | <el-select |
| | | <el-cascader |
| | | class="gd-select" |
| | | popper-class="gd-select-popper" |
| | | v-model="formData.workOrderType" |
| | | :options="workOrderTypeXT" |
| | | :props="taskTypeCascaderProps" |
| | | placeholder="请选择" |
| | | clearable |
| | | > |
| | | <el-option |
| | | v-for="item in dictObj.workOrderType" |
| | | :key="item.dictKey" |
| | | :label="item.dictValue" |
| | | :value="item.dictKey" |
| | | /> |
| | | </el-select> |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <div class="detail-title" :style="{ marginTop: pxToRem(20) }"> |
| | | <div class="detail-title" :style="{ marginTop: pxToRem(10) }"> |
| | | <span class="required-star" v-if="!dialogReadonly">*</span> |
| | | 工单执行范围 |
| | | </div> |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | <template #footer> |
| | | <template #footer v-if="activeName === 'basic' && detailLoaded"> |
| | | <el-button v-if="['11', '21', '23', '31', '60'].includes(gdStatus)" @click="viewDescription" color="#F2F3F5"> |
| | | {{ gdStatusObj[gdStatus]?.reason }} |
| | | </el-button> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { computed, ref, nextTick } from 'vue' |
| | | import { computed, ref, nextTick, inject } from 'vue' |
| | | import { ElMessage } from 'element-plus' |
| | | import { dateRangeFormat, fieldRules, flyVisual, geomAnalysis, getDictLabel } from '@ztzf/utils' |
| | | import { |
| | |
| | | import RefuseOrderDialog from '@/views/orderView/orderManage/orderManage/RefuseOrderDialog.vue' |
| | | import CommonCesiumMap from '@/components/map-container/common-cesium-map.vue' |
| | | import { gdPatrolTaskPageApi } from '@/views/orderView/orderManage/inspectionRequest/inspectionRequestApi' |
| | | import { Check } from '@element-plus/icons-vue' |
| | | import { Check, Search, RefreshRight } from '@element-plus/icons-vue' |
| | | import droneIcon from '@/assets/images/orderView/orderManage/drone.png' |
| | | import droneActiveIcon from '@/assets/images/orderView/orderManage/droneActive.png' |
| | | import { useStore } from 'vuex' |
| | | import OrderStepBar from '@/views/orderView/orderManage/orderManage/OrderStepBar.vue' |
| | | import OutcomeData from './outcomeData.vue' |
| | | import { getDictListApi } from '@/api/zkxt' |
| | | import { getTaskTypeLabel, taskTypeCascaderProps, toTaskTypeCascaderValue, toTaskTypeRequestValue } from '../taskTypeOptions' |
| | | const store = useStore() |
| | | const permission = computed(() => store.state.user.permission) |
| | | const activeName = ref('basic') |
| | | |
| | | // 初始化表单数据 |
| | | const initForm = () => ({ |
| | | workOrderName: '', |
| | | workOrderType: '', |
| | | workOrderType: [], |
| | | executeStartTime: '', |
| | | executeEndTime: '', |
| | | deviceLoadDemand: '', |
| | |
| | | const mapRef = ref(null) |
| | | const rejectVisible = ref(false) |
| | | const dictObj = inject('dictObj') |
| | | const workOrderTypeXT = inject('workOrderTypeXT', ref([])) |
| | | const dateRange = ref([]) |
| | | const patrolTaskList = ref([]) |
| | | const emit = defineEmits(['success']) |
| | |
| | | const visible = defineModel() // 弹框显隐 |
| | | const dialogMode = ref('add') // 弹框模式 |
| | | const submitting = ref(false) // 提交中 |
| | | const detailLoaded = ref(false) // 详情加载完成 |
| | | const dialogReadonly = computed(() => dialogMode.value === 'view') |
| | | const titleEnum = ref({ edit: '编辑', view: '查看', add: '新增' }) |
| | | const deviceList = ref([]) // 设备列表 |
| | |
| | | async function getDeviceList() { |
| | | try { |
| | | const str = [...pointList.value, pointList.value[0]].map(item => `${item.longitude} ${item.latitude}`).join(',') |
| | | let geom = `POLYGON((${str}))` |
| | | let geom = `POLYGON((${str}))` |
| | | const res = await gdManageDeviceListApi({ |
| | | deviceIds: dialogMode.value === 'add' ? '' : formData.value.recommendDeviceIds, |
| | | devicePayload: formData.value?.deviceLoadDemand, |
| | |
| | | if (!formData.value.id) { |
| | | formData.value.workOrderStatus = '10' |
| | | } |
| | | await gdWorkOrderSaveApi(formData.value) |
| | | const payload = { |
| | | ...formData.value, |
| | | workOrderType: toTaskTypeRequestValue(formData.value.workOrderType), |
| | | } |
| | | await gdWorkOrderSaveApi(payload) |
| | | ElMessage.success(dialogMode.value === 'add' ? '新增成功' : '更新成功') |
| | | visible.value = false |
| | | emit('success') |
| | |
| | | loadList() |
| | | const res = await gdWorkOrderDetailApi({ id: formData.value.id }) |
| | | formData.value = res?.data?.data ?? {} |
| | | formData.value.workOrderType = toTaskTypeCascaderValue(formData.value.workOrderType) |
| | | dateRange.value = [formData.value.executeStartTime, formData.value.executeEndTime] |
| | | } |
| | | |
| | |
| | | |
| | | // 打开弹框 |
| | | async function open({ mode = 'add', row } = {}) { |
| | | detailLoaded.value = false |
| | | dialogMode.value = mode |
| | | getPayloadList() |
| | | initMap() |
| | |
| | | hasPatrolTaskList.value && gdPatrolTaskPage() |
| | | dialogMode.value === 'edit' ? editPolygon() : viewPolygon() |
| | | } |
| | | detailLoaded.value = true |
| | | |
| | | await nextTick() |
| | | await getDeviceList() |
| | |
| | | defineExpose({ open }) |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | <style lang="scss"> |
| | | .orderManageFormDlg{ |
| | | .el-dialog__body{ |
| | | display: flex; |
| | | flex-direction: column; |
| | | .content{ |
| | | height: 0; |
| | | flex: 1; |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | | |
| | | <style scoped lang="scss"> |
| | | .separateTable { |
| | | height: 0; |
| | | flex: 1; |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | .content { |
| | | display: flex; |
| | | gap: 0 20px; |
| | | height: 680px; |
| | | //height: 630px; |
| | | |
| | | .leftBox { |
| | | width: 0; |
| | |
| | | |
| | | .gd-cesium { |
| | | position: relative; |
| | | overflow: hidden; |
| | | //overflow: hidden; |
| | | width: 100%; |
| | | min-height: 360px; |
| | | flex: 1; |
| | | height: 390px; |
| | | } |
| | | } |
| | | |