| | |
| | | @closed="visible = false" |
| | | :style="{ width: pxToRem(1216) }" |
| | | destroy-on-close |
| | | :close-on-click-modal="false" |
| | | > |
| | | <div class="content" style="display: flex"> |
| | | <div class="leftBox"> |
| | | <!-- 查看模式 --> |
| | | <div class="detail-container" v-if="dialogReadonly"> |
| | | <el-row> |
| | | <el-row class="detail-row-view"> |
| | | <el-col :span="12"> |
| | | <div class="label">巡查任务名称</div> |
| | | <div class="val">{{ formData.patrolTaskName }}</div> |
| | |
| | | <div class="val">{{ formData.taskDesc }}</div> |
| | | </el-col> |
| | | </el-row> |
| | | <template v-if="['6', '7', '8'].includes(taskStatus)"> |
| | | <div>任务成功({{ list.length || 0 }}条)</div> |
| | | <div style="display: flex"> |
| | | <div v-for="item in list"> |
| | | <el-image |
| | | v-if="item.resultUrl" |
| | | :src="item.resultUrl" |
| | | :preview-src-list="[item.resultUrl]" |
| | | fit="cover" |
| | | style="width: 80px; height: 60px" |
| | | preview-teleported |
| | | /> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | </div> |
| | | |
| | | <!-- 编辑模式 --> |
| | |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="巡查任务描述" prop="taskDesc"> |
| | | <el-input class="gd-input" type="textarea" v-model="formData.taskDesc" placeholder="请输入" clearable /> |
| | | <el-input class="gd-input" type="textarea" :rows="4" v-model="formData.taskDesc" placeholder="请输入" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </div> |
| | | |
| | | <template #footer> |
| | | <el-button color="#F2F3F5" @click="visible = false">{{ dialogReadonly ? '关闭' : '取消' }}</el-button> |
| | | <el-button |
| | | class="save-btn" |
| | | color="#4C34FF" |
| | | v-if="!dialogReadonly" |
| | | :loading="submitting" |
| | | :disabled="submitting" |
| | | @click="handleSubmit" |
| | | > |
| | | 确认 |
| | | </el-button> |
| | | <template v-if="requester"> |
| | | <el-button |
| | | v-if="!dialogReadonly || ['1', '4'].includes(taskStatus)" |
| | | :loading="submitting" |
| | | :disabled="submitting" |
| | | @click="handleSubmit" |
| | | > |
| | | 提交 |
| | | </el-button> |
| | | <el-button v-if="['1', '4'].includes(taskStatus)" @click="viewDescription"> |
| | | {{ gdStatusObj[taskStatus].reason }} |
| | | </el-button> |
| | | <el-button @click="statusChange(3)" v-if="taskStatus === '3'">撤回任务</el-button> |
| | | <el-button @click="refusalToAccept" v-if="taskStatus === '6'">拒绝验收</el-button> |
| | | <el-button @click="statusChange(6)" v-if="taskStatus === '6'">验收通过</el-button> |
| | | </template> |
| | | <template v-else> |
| | | <el-button v-if="['7'].includes(taskStatus)" @click="viewDescription"> |
| | | {{ gdStatusObj[taskStatus].reason }} |
| | | </el-button> |
| | | <el-button v-if="taskStatus === '0'" @click="addDescription">拒绝签收</el-button> |
| | | <el-button v-if="taskStatus === '0'" @click="statusChange(1)">签收</el-button> |
| | | <el-button v-if="taskStatus === '3'" @click="addDescription">驳回</el-button> |
| | | <el-button v-if="taskStatus === '3'" @click="statusChange(4)">同意</el-button> |
| | | </template> |
| | | </template> |
| | | |
| | | <RefuseOrderDialog1 |
| | | ref="refuseOrderDialogRef" |
| | | v-if="rejectVisible" |
| | | v-model="rejectVisible" |
| | | @success="rejectSuccess" |
| | | /> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | |
| | | import { computed, ref, onMounted } from 'vue' |
| | | import { ElMessage } from 'element-plus' |
| | | import { fieldRules, getDictLabel } from '@ztzf/utils' |
| | | import { gdPatrolTaskRepublish, gdFlyerPageApi } from './inspectionRequestApi' |
| | | import { gdPatrolTaskRepublish, gdFlyerPageApi, gdPatrolTaskAuditApi } from './inspectionRequestApi' |
| | | import { gdWorkOrderPageApi } from '../orderManage/orderManageApi' |
| | | import { gdManageDeviceListApi } from '../orderManage/gdManageDeviceApi' |
| | | import { pxToRem } from '@/utils/rem' |
| | | import CommonCesiumMap from '@/components/map-container/common-cesium-map.vue' |
| | | import { gdTaskResultListApi } from '@/views/orderView/orderManage/clueEvents/achievementApi' |
| | | import RefuseOrderDialog from '@/views/orderView/orderManage/orderManage/RefuseOrderDialog.vue' |
| | | import RefuseOrderDialog1 from '@/views/orderView/orderManage/inspectionRequest/RefuseOrderDialog1.vue' |
| | | |
| | | // 初始化表单数据 |
| | | const initForm = () => ({ |
| | |
| | | workOrderId: null, |
| | | }) |
| | | |
| | | const rejectVisible = ref(false) |
| | | const mapRef = ref(null) |
| | | const dictObj = inject('dictObj') |
| | | const emit = defineEmits(['success']) |
| | | const requester = inject('requester') |
| | | const emit = defineEmits(['success', 'refusalAccept']) |
| | | const formRef = ref(null) |
| | | const formData = ref(initForm()) |
| | | const visible = defineModel() |
| | |
| | | const submitting = ref(false) |
| | | const dialogReadonly = computed(() => dialogMode.value === 'view') |
| | | const titleEnum = ref({ edit: '编辑', view: '查看' }) |
| | | const taskStatus = computed(() => formData.value.taskStatus) |
| | | const refuseOrderDialogRef = ref(null) |
| | | |
| | | // 下拉选项 |
| | | const flyerList = ref([]) |
| | |
| | | { name: '航线3', id: '3' }, |
| | | ]) |
| | | |
| | | const gdStatusObj = { |
| | | '0': { reason: '拒绝原因', operationType: '2' }, |
| | | '1': { reason: '拒绝原因' }, |
| | | '2': { reason: '' }, |
| | | '3': { reason: '驳回原因', operationType: '5' }, |
| | | '4': { reason: '驳回原因' }, |
| | | '5': { reason: '' }, |
| | | '6': { reason: '拒绝原因' }, |
| | | '7': { reason: '拒绝原因' }, |
| | | '8': { reason: '' }, |
| | | } |
| | | |
| | | let viewer |
| | | |
| | | // 校验规则 |
| | |
| | | patrolRouteUrl: fieldRules(true), |
| | | recommendFlyerName: fieldRules(true), |
| | | deviceId: fieldRules(true), |
| | | } |
| | | |
| | | function rejectSuccess() { |
| | | visible.value = false |
| | | emit('success') |
| | | } |
| | | |
| | | // 填写说明 |
| | | function addDescription() { |
| | | rejectVisible.value = true |
| | | nextTick(() => { |
| | | refuseOrderDialogRef.value.open({ |
| | | mode: 'add', |
| | | row: formData.value, |
| | | type: gdStatusObj[taskStatus.value].operationType, |
| | | formLabel: gdStatusObj[taskStatus.value].reason, |
| | | }) |
| | | }) |
| | | } |
| | | // 查看说明 |
| | | function viewDescription() { |
| | | rejectVisible.value = true |
| | | nextTick(() => { |
| | | refuseOrderDialogRef.value.open({ |
| | | mode: 'view', |
| | | row: formData.value, |
| | | formLabel: gdStatusObj[taskStatus.value].reason, |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | // 获取航线名称 |
| | |
| | | flyerList.value = res?.data?.data?.records ?? [] |
| | | } |
| | | |
| | | // 操作类型:1.同意签收、2.拒绝签收 、3.撤回任务 、4.同意审核、 5.拒绝审核、 6.验收通过、 7.验收拒绝 |
| | | function statusChange(auditStatus) { |
| | | gdPatrolTaskAuditApi({ auditStatus, id: formData.value.id }).then(res => { |
| | | visible.value = false |
| | | emit('success') |
| | | }) |
| | | } |
| | | |
| | | function refusalToAccept() { |
| | | emit('refusalAccept', formData.value) |
| | | visible.value = false |
| | | } |
| | | |
| | | // 获取设备列表 |
| | | async function getDeviceList() { |
| | | const res = await gdManageDeviceListApi() |
| | |
| | | } |
| | | } |
| | | |
| | | let list = ref([]) |
| | | // 获取成果列表 |
| | | async function getList() { |
| | | if (!formData.value?.id) return |
| | | try { |
| | | const res = await gdTaskResultListApi({ patrolTaskId: formData.value.id }) |
| | | list.value = res?.data?.data ?? [] |
| | | } finally { |
| | | } |
| | | } |
| | | |
| | | // 打开弹框 |
| | | async function open({ mode = 'view', row } = {}) { |
| | | dialogMode.value = mode |
| | | formData.value = { ...initForm(), ...row } |
| | | ;['6', '7', '8'].includes(row.taskStatus) && getList() |
| | | initMap() |
| | | } |
| | | |