From 4f2e4041b6ccb2591d713927e2fc4d09e39922bf Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Fri, 30 Jan 2026 17:30:00 +0800
Subject: [PATCH] feat: 查总数

---
 applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/FormDiaLog.vue |   24 -----------
 applications/task-work-order/src/views/orderView/orderManage/orderManage/index.vue            |   46 ++++++++++++----------
 applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/index.vue      |   30 +++++++++++++--
 applications/task-work-order/src/views/orderView/orderManage/orderManage/FormDiaLog.vue       |   13 +++++-
 4 files changed, 63 insertions(+), 50 deletions(-)

diff --git a/applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/FormDiaLog.vue b/applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/FormDiaLog.vue
index c83c0c7..408579a 100644
--- a/applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/FormDiaLog.vue
+++ b/applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/FormDiaLog.vue
@@ -246,9 +246,7 @@
 	deviceId: null,
 	taskDesc: '',
 })
-// todo 时间线
 const dictObj = inject('dictObj')
-
 const emit = defineEmits(['success'])
 const visible = defineModel() // 弹框显隐
 const dialogMode = ref('add') // 弹框模式
@@ -326,14 +324,6 @@
 	workOrderList.value = res?.data?.data?.records ?? []
 }
 
-// 处理巡查任务类型变化
-async function handlePatrolTaskTypeChange(index, skilledTaskType) {
-	// 清空该行已选择的飞手
-	taskList.value[index].recommendFlyerName = ''
-	// 获取对应的飞手列表
-	await getFlyerList(index, skilledTaskType)
-}
-
 // 获取飞手列表
 async function getFlyerList(index, skilledTaskType) {
 	const res = await gdFlyerPageApi({
@@ -363,18 +353,6 @@
 // 判断一行是否已填写(至少填写了任务名称)
 function isTaskRowFilled(task) {
 	return !!(task.patrolTaskName || task.executeTime || task.patrolRouteUrl || task.recommendFlyerName || task.deviceId)
-}
-
-// 判断一行是否完整填写(所有必填项都有值)
-function isTaskRowComplete(task) {
-	return !!(
-		task.patrolTaskName &&
-		task.patrolTaskType &&
-		task.executeTime &&
-		task.patrolRouteUrl &&
-		task.recommendFlyerName &&
-		task.deviceId
-	)
 }
 
 // 提交新增
@@ -480,6 +458,6 @@
 }
 
 .grayText {
-	color: #9f9f9f;
+	color: #9f9f9f !important;
 }
 </style>
diff --git a/applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/index.vue b/applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/index.vue
index e4b90d0..e50d0aa 100644
--- a/applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/index.vue
+++ b/applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/index.vue
@@ -1,8 +1,8 @@
 <template>
 	<basic-container>
 		<el-tabs class="gd-tabs" v-model="activeName" @tab-click="tabsClick">
-			<el-tab-pane label="全部 " name="all"></el-tab-pane>
-			<el-tab-pane label="我的巡查任务" name="my"></el-tab-pane>
+			<el-tab-pane :label="`全部(${allTotal})`" name="all"></el-tab-pane>
+			<el-tab-pane :label="`我的巡查任务(${myTotal})`" name="my"></el-tab-pane>
 		</el-tabs>
 		<el-form ref="queryParamsRef" :model="searchParams" class="gd-search-form">
 			<el-form-item label="任务名称" prop="patrolTaskName">
@@ -72,7 +72,9 @@
 		</el-form>
 
 		<div class="gd-table-toolbar">
-			<el-button v-if="permission.flyOrder_add" :icon="Plus" color="#4C34FF" type="primary" @click="openForm('add')">拆分工单</el-button>
+			<el-button v-if="permission.flyOrder_add" :icon="Plus" color="#4C34FF" type="primary" @click="openForm('add')">
+				拆分工单
+			</el-button>
 		</div>
 
 		<div class="gd-table-container" v-loading="loading">
@@ -98,7 +100,7 @@
 					<el-table-column prop="taskDesc" show-overflow-tooltip label="巡查任务描述" />
 					<el-table-column label="操作" class-name="operation-btns">
 						<template v-slot="{ row }">
-							<el-link  type="primary"  @click="viewDiaLogView(row)">查看</el-link>
+							<el-link type="primary" @click="viewDiaLogView(row)">查看</el-link>
 						</template>
 					</el-table-column>
 				</el-table>
@@ -154,6 +156,8 @@
 const searchParams = ref(initSearchParams()) // 查询参数
 const dateRange = ref([]) // 执行时间范围
 const total = ref(0) // 总条数
+const allTotal = ref(0) // 全部tab总条数
+const myTotal = ref(0) // 我的巡查任务tab总条数
 const loading = ref(true) // 列表加载中
 const list = ref([]) // 列表数据
 const selectedIds = ref([]) // 勾选的ID列表
@@ -258,7 +262,25 @@
 	})
 }
 
+// 获取两个tab的总条数
+async function getTabTotals() {
+	const allRes = await gdPatrolTaskPageApi({
+		current: 1,
+		size: 1,
+		createUser: '',
+	})
+	allTotal.value = allRes?.data?.data?.total ?? 0
+
+	const myRes = await gdPatrolTaskPageApi({
+		current: 1,
+		size: 1,
+		createUser: store.state.user.userInfo.user_id,
+	})
+	myTotal.value = myRes?.data?.data?.total ?? 0
+}
+
 onMounted(() => {
+	getTabTotals()
 	getList()
 	getDictList()
 	getAirList()
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 d7bc9c3..b1f6689 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
@@ -90,6 +90,7 @@
 					:disabled="dialogReadonly"
 					label-width="90px"
 				>
+					<div class="detail-title">工单详情</div>
 					<el-row>
 						<el-col :span="12">
 							<el-form-item label="工单名称" prop="workOrderName">
@@ -161,7 +162,10 @@
 						</el-col>
 					</el-row>
 				</el-form>
-				<div class="detail-title" :style="{ marginTop: pxToRem(20) }">工单执行范围</div>
+				<div class="detail-title" :style="{ marginTop: pxToRem(20) }">
+					<span class="required-star" v-if="!dialogReadonly">*</span>
+					工单执行范围
+				</div>
 				<CommonCesiumMap
 					ref="mapRef"
 					class="gd-cesium"
@@ -175,7 +179,7 @@
 				/>
 			</div>
 			<div class="rightBox" v-if="!dialogReadonly">
-				<div class="detail-title">推荐设备</div>
+				<div class="detail-title"><span class="required-star" v-if="!dialogReadonly">*</span>推荐设备</div>
 				<el-table
 					class="separateTable"
 					:empty-text="(formData.deviceLoadDemand && pointList.length) ? '暂无数据' : '请先选择设备需求并在地图上绘制工单范围'"
@@ -701,4 +705,9 @@
 	height: 200px;
 	line-height: 200px;
 }
+
+.required-star {
+	color: #f56c6c;
+	margin-right: 4px;
+}
 </style>
diff --git a/applications/task-work-order/src/views/orderView/orderManage/orderManage/index.vue b/applications/task-work-order/src/views/orderView/orderManage/orderManage/index.vue
index cde7336..7a07a85 100644
--- a/applications/task-work-order/src/views/orderView/orderManage/orderManage/index.vue
+++ b/applications/task-work-order/src/views/orderView/orderManage/orderManage/index.vue
@@ -1,8 +1,8 @@
 <template>
 	<basic-container>
 		<el-tabs class="gd-tabs" v-model="activeName" @tab-click="tabsClick">
-			<el-tab-pane label="全部 " name="all"></el-tab-pane>
-			<el-tab-pane label="我的任务工单" name="my"></el-tab-pane>
+			<el-tab-pane :label="`全部(${allTotal})`" name="all"></el-tab-pane>
+			<el-tab-pane :label="`我的任务工单(${myTotal})`" name="my"></el-tab-pane>
 		</el-tabs>
 		<el-form ref="queryParamsRef" :model="searchParams" class="gd-search-form">
 			<el-form-item label="工单名称" prop="workOrderName">
@@ -72,25 +72,9 @@
 		</el-form>
 
 		<div class="gd-table-toolbar">
-
-			<el-button
-				v-if="permission.order_release"
-				:icon="Plus"
-				color="#4C34FF"
-				type="primary"
-				@click="openForm('add')"
-			>
+			<el-button v-if="permission.order_release" :icon="Plus" color="#4C34FF" type="primary" @click="openForm('add')">
 				新增工单
 			</el-button>
-<!--			<el-button
-				:icon="Delete"
-				color="#4C34FF"
-				:disabled="!selectedIds.length"
-				@click="handleDelete()"
-				v-if="permission.order_delete"
-			>
-				删除
-			</el-button>-->
 		</div>
 
 		<div class="gd-table-container" v-loading="loading">
@@ -126,8 +110,6 @@
 					<el-table-column label="操作" class-name="operation-btns">
 						<template v-slot="{ row }">
 							<el-link type="primary" @click="openFormChange(row)">查看</el-link>
-							<!--<el-link  type="primary"  @click="openForm('edit', row)">编辑</el-link>-->
-<!--							<el-link type="primary" @click="handleDelete(row)" v-if="permission.order_delete">删除</el-link>-->
 						</template>
 					</el-table-column>
 				</el-table>
@@ -182,6 +164,8 @@
 const searchParams = ref(initSearchParams()) // 查询参数
 const dateRange = ref([]) // 执行时间范围
 const total = ref(0) // 总条数
+const allTotal = ref(0) // 全部tab总条数
+const myTotal = ref(0) // 我的任务工单tab总条数
 const loading = ref(true) // 列表加载中
 const list = ref([]) // 列表数据
 const selectedIds = ref([]) // 勾选的ID列表
@@ -281,7 +265,27 @@
 	})
 }
 
+// 获取两个tab的总条数
+async function getTabTotals() {
+	// 获取全部tab的总数
+	const allRes = await gdWorkOrderPageApi({
+		current: 1,
+		size: 1,
+		createUser: '',
+	})
+	allTotal.value = allRes?.data?.data?.total ?? 0
+
+	// 获取我的任务工单tab的总数
+	const myRes = await gdWorkOrderPageApi({
+		current: 1,
+		size: 1,
+		createUser: store.state.user.userInfo.user_id,
+	})
+	myTotal.value = myRes?.data?.data?.total ?? 0
+}
+
 onMounted(() => {
+	getTabTotals()
 	getList()
 	getDictList()
 })

--
Gitblit v1.9.3