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/orderManage/FormDiaLog.vue | 208 ++++++++++++++++++++++++++++++++--------------------
1 files changed, 128 insertions(+), 80 deletions(-)
diff --git a/applications/task-work-order/src/views/orderView/orderManage/orderManage/FormDiaLog.vue b/applications/task-work-order/src/views/orderView/orderManage/orderManage/FormDiaLog.vue
index 467f20a..c635df7 100644
--- a/applications/task-work-order/src/views/orderView/orderManage/orderManage/FormDiaLog.vue
+++ b/applications/task-work-order/src/views/orderView/orderManage/orderManage/FormDiaLog.vue
@@ -10,9 +10,22 @@
>
<div class="content" style="display: flex">
<div class="processBox" v-if="dialogMode !== 'add' && processList.length">
- <el-steps direction="vertical" :active="processList.length">
- <el-step v-for="item in processList" :title="item.flowName" :description="item.flowDesc" />
- </el-steps>
+ <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 v-if="dialogReadonly">
@@ -63,13 +76,8 @@
</template>
</el-table-column>
<el-table-column prop="executeTime" show-overflow-tooltip label="任务执行时间" />
- <el-table-column prop="feishou" show-overflow-tooltip label="选择飞手" />
- <el-table-column prop="deviceId" show-overflow-tooltip label="选择设备" />
- <el-table-column label="操作" class-name="operation-btns">
- <template v-slot="{ row }">
- <el-link type="primary" @click="">查看</el-link>
- </template>
- </el-table-column>
+ <el-table-column prop="recommendFlyerName" show-overflow-tooltip label="选择飞手" />
+ <el-table-column prop="deviceName" show-overflow-tooltip label="选择设备" />
</el-table>
</template>
</div>
@@ -141,7 +149,14 @@
</el-col>
<el-col :span="24">
<el-form-item label="工单备注" prop="remark">
- <el-input class="gd-input" type="textarea" v-model="formData.remark" placeholder="请输入" clearable />
+ <el-input
+ class="gd-input"
+ type="textarea"
+ :rows="4"
+ v-model="formData.remark"
+ placeholder="请输入"
+ clearable
+ />
</el-form-item>
</el-col>
</el-row>
@@ -174,53 +189,40 @@
<el-table-column prop="devicePayload" label="设备负载" />
</el-table>
</template>
- <div v-else>请先选择设备需求并绘制范围</div>
+ <div v-else class="tipSelect">请先选择设备需求并在地图上绘制工单范围</div>
</div>
</div>
<template #footer>
- <!-- <el-button color="#F2F3F5" @click="visible = false">{{ dialogReadonly ? '关闭' : '取消' }}</el-button>-->
- <el-button
- class="save-btn"
- color="#4C34FF"
- v-if="(!dialogReadonly && !formData.id) || suddenlyEdit"
- :loading="submitting"
- :disabled="submitting"
- @click="handleSubmit"
- >
- 发布
- </el-button>
+ <template v-if="requester">
+ <el-button
+ v-if="['11'].includes(gdStatus) || suddenlyEdit || (!dialogReadonly && !formData.id)"
+ :loading="submitting"
+ :disabled="submitting"
+ @click="handleSubmit"
+ >
+ {{ gdStatus === '11' || !gdStatus ? '发布' : '提交修改' }}
+ </el-button>
+ <el-button v-if="['11', '21', '23', '24', '25', '31', '60'].includes(gdStatus)" @click="viewDescription">
+ {{ gdStatusObj[gdStatus].reason }}
+ </el-button>
+ <el-button @click="addDescription" v-if="['20', '24', '25', '50'].includes(gdStatus)">
+ {{ gdStatus === '50' ? '结算' : '申请取消' }}
+ </el-button>
+ <el-button @click="requestModification" v-if="['20', '25'].includes(gdStatus)">申请修改</el-button>
+ </template>
<template v-else>
- <template v-if="requester">
- <el-button
- class="save-btn"
- color="#4C34FF"
- v-if="editStatus.includes(gdStatus)"
- :loading="submitting"
- :disabled="submitting"
- @click="handleSubmit"
- >
- 发布
- </el-button>
- <el-button color="#F2F3F5" v-if="gdStatus === '11'" @click="addDescription(2, 'view')">拒单原因</el-button>
- <el-button color="#F2F3F5" @click="statusChange(3)" v-if="gdStatus === '20'">申请取消</el-button>
- <el-button color="#4C34FF" @click="requestModification" v-if="gdStatus === '20'" class="save-btn">
- 申请修改
- </el-button>
- </template>
- <template v-else>
- <el-button color="#F2F3F5" v-if="gdStatus === '10'" @click="addDescription(2)">拒绝接单</el-button>
- <el-button color="#4C34FF" v-if="gdStatus === '10'" @click="statusChange(1)" class="save-btn">接单</el-button>
- <el-button color="#F2F3F5" v-if="gdStatus === '22'" @click="statusChange(7)">同意修改</el-button>
- <el-button color="#4C34FF" v-if="gdStatus === '22'" @click="statusChange(8)" class="save-btn">
- 不同意修改
- </el-button>
- <el-button color="#F2F3F5" v-if="gdStatus === '21'" @click="statusChange(5)">同意取消</el-button>
- <el-button color="#4C34FF" v-if="gdStatus === '21'" @click="statusChange(6)" class="save-btn">
- 不同意取消
- </el-button>
- <el-button color="#F2F3F5" v-if="gdStatus === '30'" @click="addDescription(9)">协商修改</el-button>
- </template>
+ <el-button v-if="['21', '23'].includes(gdStatus)" @click="viewDescription">
+ {{ gdStatusObj[gdStatus].reason }}
+ </el-button>
+ <el-button v-if="gdStatus === '10'" @click="addDescription">拒绝接单</el-button>
+ <el-button v-if="gdStatus === '10'" @click="statusChange(1)">接单</el-button>
+ <el-button v-if="gdStatus === '22'" @click="statusChange(8)">不同意修改</el-button>
+ <el-button v-if="gdStatus === '22'" @click="statusChange(7)">同意修改</el-button>
+ <el-button v-if="gdStatus === '21'" @click="addDescription">不同意取消</el-button>
+ <el-button v-if="gdStatus === '21'" @click="statusChange(5)">同意取消</el-button>
+ <el-button v-if="gdStatus === '30'" @click="addDescription">协商修改</el-button>
+ <el-button v-if="gdStatus === '31'" @click="statusChange(10)">同意</el-button>
</template>
</template>
@@ -252,7 +254,7 @@
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'
// 初始化表单数据
const initForm = () => ({
workOrderName: '',
@@ -286,11 +288,26 @@
let drawPolygonExample
let pointList = ref([])
const requester = inject('requester')
-const editStatus = inject('editStatus')
const suddenlyEdit = ref(false)
const processList = ref([])
let viewPlane
const hasPatrolTaskList = computed(() => ['30', '40', '50', '60'].includes(String(formData.value.workOrderStatus)))
+
+const gdStatusObj = {
+ '10': { reason: '拒绝原因', operationType: '2' },
+ '11': { reason: '拒绝原因' },
+ '20': { reason: '取消原因', operationType: '3' },
+ '21': { reason: '原因', operationType: '6' },
+ '22': { reason: '驳回原因' },
+ '23': { reason: '取消原因' },
+ '24': { reason: '驳回原因', operationType: '3' },
+ '25': { reason: '驳回原因', operationType: '3' },
+ '30': { reason: '修改原因', operationType: '9' },
+ '31': { reason: '修改原因' },
+ '40': { reason: '' },
+ '50': { reason: '情况说明', operationType: '11' },
+ '60': { reason: '情况说明' },
+}
// 工单状态:0草稿、10发布中_接单中、11发布中_拒绝接单、20响应中_待拆分、21响应中_申请取消、22响应中_申请修改、23响应中_已取消、
// 24响应中_拒绝取消、25响应中_拒绝修改 30执行中_待全部完成、31执行中_协商修改、40完成待验_待全部验收、50验收通过_待结算、60结算完成_已结算
@@ -302,9 +319,14 @@
executeStartTime: fieldRules(true),
deviceLoadDemand: fieldRules(true),
}
-// 操作类型:1接单,2拒接接单,3申请取消,4申请修改, 5同意取消 6不同意取消 7.同意修改 8.不同意修改 9.协商修改
+
+// 操作类型:1接单,2拒接接单,3申请取消,4申请修改, 5同意取消
+// 6不同意取消 7.同意修改 8.不同意修改 9.协商修改,10:同意协商修改,11.结算
function statusChange(operationType) {
- gdWorkOrderHandleStatusApi({ operationType: operationType, workOrderId: formData.value.id }).then(res => {
+ gdWorkOrderHandleStatusApi({
+ operationType: operationType,
+ workOrderId: formData.value.id,
+ }).then(res => {
visible.value = false
emit('success')
})
@@ -326,23 +348,26 @@
}
// 填写说明
-function addDescription(type, mode = 'add') {
- let formLabel = ''
- switch (type) {
- case 2:
- formLabel = '拒绝原因'
- break
- case 9:
- formLabel = '修改原因'
- break
- }
+function addDescription() {
rejectVisible.value = true
nextTick(() => {
refuseOrderDialogRef.value.open({
- mode,
+ mode: 'add',
row: formData.value,
- type,
- formLabel,
+ type: gdStatusObj[gdStatus.value].operationType,
+ formLabel: gdStatusObj[gdStatus.value].reason,
+ })
+ })
+}
+
+// 查看说明
+function viewDescription() {
+ rejectVisible.value = true
+ nextTick(() => {
+ refuseOrderDialogRef.value.open({
+ mode: 'view',
+ row: formData.value,
+ formLabel: gdStatusObj[gdStatus.value].reason,
})
})
}
@@ -353,7 +378,7 @@
const str = [...pointList.value, pointList.value[0]].map(item => `${item.longitude} ${item.latitude}`).join(',')
let geom = `POLYGON((${str}))`
const res = await gdManageDeviceListApi({
- ids: formData.value.recommendDeviceIds,
+ deviceIds: formData.value.recommendDeviceIds,
devicePayload: dialogMode.value === 'add' ? formData.value.deviceLoadDemand : '',
geom: dialogMode.value === 'add' ? geom : '',
})
@@ -363,8 +388,10 @@
}
}
+// 设备需求变化
function loadDemandChange() {
formData.value.recommendDeviceIds = ''
+ selectedDevices.value = []
getDeviceList()
syncSelection()
}
@@ -380,8 +407,10 @@
const isValid = await formRef.value?.validate().catch(() => false)
if (!isValid) return
if (!pointList.value.length) {
- ElMessage.warning('请绘制范围')
- return
+ return ElMessage.warning('请绘制范围')
+ }
+ if (!formData.value.recommendDeviceIds) {
+ return ElMessage.warning('请选择设备')
}
submitting.value = true
try {
@@ -408,8 +437,9 @@
}
)
+// 加载时间线list
function loadList() {
- gdWorkOrderFlowListApi({ workOrderId: formData.value.id }).then(res => {
+ gdWorkOrderFlowListApi({ workOrderId: formData.value.id,type: '0' }).then(res => {
processList.value = res.data.data
})
}
@@ -436,6 +466,8 @@
const val = cartesian3Convert(item, viewer)
return { ...val, lng: val.longitude, lat: val.latitude }
})
+ formData.value.recommendDeviceIds = ''
+ selectedDevices.value = []
await getDeviceList()
syncSelection()
}
@@ -502,10 +534,11 @@
}
import droneIcon from '@/assets/images/orderView/orderManage/drone.png'
+
function renderingDevice(list) {
- // 渲染红点
+ // 渲染红点
list.forEach(item => {
- const position = Cesium.Cartesian3.fromDegrees(item.longitude || 115.00, item.latitude || 27.11)
+ const position = Cesium.Cartesian3.fromDegrees(item.longitude || 115.0, item.latitude || 27.11)
viewer.entities.add({
position: position,
billboard: {
@@ -530,10 +563,10 @@
hasPatrolTaskList.value && gdPatrolTaskPage()
dialogMode.value === 'edit' ? editPolygon() : viewPolygon()
}
- await getDeviceList()
// setMapDevice()
await nextTick()
syncSelection()
+ getDeviceList()
}
// 初始化地图实例
@@ -554,30 +587,45 @@
.content {
display: flex;
gap: 0 20px;
+
.leftBox {
width: 0;
flex: 1;
display: flex;
flex-direction: column;
+
.gd-cesium {
width: 100%;
height: 423px;
}
}
+
.rightBox {
+ width: 350px;
.title {
font-weight: 500;
font-size: 14px;
color: #272e37;
}
}
+
.processBox {
width: 312px;
+ .item-content {
+ position: relative;
+ .flowName {
+ width: 80px;
+ position: absolute;
+ left: -120px;
+ top: 0px;
+ }
+ }
}
}
-.setHeight {
- //max-height: 300px;
- //min-height: 200px;
+.tipSelect {
+ text-align: center;
+ height: 200px;
+ line-height: 200px;
}
</style>
--
Gitblit v1.9.3