From beb95fb5fc166804056abafd70fc01ac27de7621 Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Mon, 26 Jan 2026 09:11:00 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/ViewDiaLog.vue | 213 ++++++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 193 insertions(+), 20 deletions(-)
diff --git a/applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/ViewDiaLog.vue b/applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/ViewDiaLog.vue
index c88ee5a..8d7bd7b 100644
--- a/applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/ViewDiaLog.vue
+++ b/applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/ViewDiaLog.vue
@@ -4,14 +4,33 @@
v-model="visible"
:title="titleEnum[dialogMode]"
@closed="visible = false"
- :style="{ width: pxToRem(1216) }"
destroy-on-close
+ :close-on-click-modal="false"
>
<div class="content" style="display: flex">
+ <div class="processBox" v-if="dialogMode !== 'add' && processList.length">
+ <el-timeline class="gd-timeline">
+ <el-timeline-item
+ v-for="(activity, index) in processList"
+ :key="index"
+ :icon="Check"
+ :type="index === processList.length - 1 ? 'success' : 'info'"
+ :color="activity.color"
+ :hollow="activity.hollow"
+ :timestamp="activity.flowDesc.split(' ')[1]"
+ >
+ <div class="item-content">
+ <div>{{ activity.flowDesc.split(' ')[0] }}</div>
+ <div class="flowName">{{ activity.flowName }}</div>
+ </div>
+ </el-timeline-item>
+ </el-timeline>
+ </div>
<div class="leftBox">
<!-- 查看模式 -->
<div class="detail-container" v-if="dialogReadonly">
- <el-row>
+ <div class="detail-title">工单详情</div>
+ <el-row class="detail-row-view">
<el-col :span="12">
<div class="label">巡查任务名称</div>
<div class="val">{{ formData.patrolTaskName }}</div>
@@ -45,6 +64,20 @@
<div class="val">{{ formData.taskDesc }}</div>
</el-col>
</el-row>
+ <template v-if="['6', '7', '8'].includes(taskStatus)">
+ <div class="detail-title" :style="{ marginTop: pxToRem(10) }">任务成功({{ list.length || 0 }}条)</div>
+ <div class="imgBox">
+ <div v-for="item in list">
+ <el-image
+ v-if="item.resultUrl"
+ :src="item.resultUrl"
+ :preview-src-list="[item.resultUrl]"
+ fit="cover"
+ preview-teleported
+ />
+ </div>
+ </div>
+ </template>
</div>
<!-- 编辑模式 -->
@@ -133,7 +166,14 @@
</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>
@@ -142,30 +182,52 @@
<!-- 地图组件 -->
<CommonCesiumMap
ref="mapRef"
- class="leftMap gd-cesium"
+ class="gd-cesium"
:active="visible"
:flat-mode="false"
:terrain="true"
:layer-mode="4"
:boundary="false"
:zoomToBoundary="false"
+ @ready="() => mapRef.flyBoundary()"
/>
</div>
</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>
@@ -173,11 +235,15 @@
import { computed, ref, onMounted } from 'vue'
import { ElMessage } from 'element-plus'
import { fieldRules, getDictLabel } from '@ztzf/utils'
-import { gdPatrolTaskRepublish, gdFlyerPageApi } from './inspectionRequestApi'
-import { gdWorkOrderPageApi } from '../orderManage/orderManageApi'
+import { gdPatrolTaskRepublish, gdFlyerPageApi, gdPatrolTaskAuditApi } from './inspectionRequestApi'
+import { gdWorkOrderFlowListApi, 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'
+import { Check } from '@element-plus/icons-vue'
// 初始化表单数据
const initForm = () => ({
@@ -192,9 +258,11 @@
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()
@@ -202,6 +270,8 @@
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([])
@@ -213,6 +283,18 @@
{ 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
// 校验规则
@@ -223,6 +305,35 @@
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,
+ })
+ })
}
// 获取航线名称
@@ -255,10 +366,31 @@
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()
deviceList.value = res?.data?.data ?? []
+}
+
+const processList = ref([])
+// 加载时间线list
+function loadList() {
+ gdWorkOrderFlowListApi({ workOrderId: formData.value.id,type: '1' }).then(res => {
+ processList.value = res.data.data
+ })
}
// 提交编辑
@@ -276,10 +408,24 @@
}
}
+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 }
+ console.log(row)
+ ;['6', '7', '8'].includes(row.taskStatus) && getList()
+ loadList()
initMap()
}
@@ -304,12 +450,39 @@
display: flex;
gap: 0 20px;
.leftBox {
- width: 0;
- flex: 1;
+ width: 920px;
.gd-cesium {
+ padding-top: 10px;
width: 100%;
height: 423px;
}
+
+ }
+ .processBox {
+ width: 312px;
+ .item-content {
+ position: relative;
+ .flowName {
+ width: 80px;
+ position: absolute;
+ left: -120px;
+ top: 0px;
+ }
+ }
+ }
+ .imgBox {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 10px;
+ > div {
+ width: calc((100% - 40px) / 5); /* 5列布局,减去4个10px间隙 */
+ height: 110px;
+ flex-shrink: 0;
+ }
+ .el-image {
+ width: 100%;
+ height: 100%;
+ }
}
}
</style>
--
Gitblit v1.9.3