From 89380e6260a75d1d3b94de687ebcc2f50d50659d Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Tue, 03 Feb 2026 15:44:33 +0800
Subject: [PATCH] feat:环境变量配置调整
---
applications/task-work-order/src/views/orderView/orderManage/inspectionRequest/index.vue | 152 +++++++++++++++++++++++++++++++-------------------
1 files changed, 94 insertions(+), 58 deletions(-)
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 c38557f..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,9 +1,13 @@
<template>
<basic-container>
+ <el-tabs class="gd-tabs" v-model="activeName" @tab-click="tabsClick">
+ <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">
<el-input
- class="gd-input"
+ class="gd-input gray"
v-model="searchParams.patrolTaskName"
placeholder="请输入"
clearable
@@ -13,7 +17,7 @@
<el-form-item label="任务类型" prop="patrolTaskType">
<el-select
- class="gd-select"
+ class="gd-select gray"
popper-class="gd-select-popper"
v-model="searchParams.patrolTaskType"
placeholder="请选择"
@@ -21,7 +25,7 @@
@change="handleSearch"
>
<el-option
- v-for="item in dictObj.patrolTaskType"
+ v-for="item in dictObj.workOrderType"
:key="item.dictKey"
:label="item.dictValue"
:value="item.dictKey"
@@ -31,20 +35,25 @@
<el-form-item label="任务状态" prop="taskStatus">
<el-select
- class="gd-select"
+ class="gd-select gray"
popper-class="gd-select-popper"
v-model="searchParams.taskStatus"
placeholder="请选择"
clearable
@change="handleSearch"
>
- <el-option v-for="item in taskStatusOptions" :key="item.value" :label="item.label" :value="item.value" />
+ <el-option
+ v-for="item in dictObj.taskStatus"
+ :key="item.dictKey"
+ :label="item.dictValue"
+ :value="item.dictKey"
+ />
</el-select>
</el-form-item>
<el-form-item label="执行时间" prop="executeTime">
<el-date-picker
- class="gd-date-picker"
+ class="gd-date-picker gray"
popper-class="gd-date-picker-popper"
v-model="dateRange"
type="daterange"
@@ -63,25 +72,26 @@
</el-form>
<div class="gd-table-toolbar">
- <el-button :icon="Plus" color="#4C34FF" type="primary" @click="openForm('add')">新增</el-button>
- <el-button :icon="Delete" color="#4C34FF" :disabled="!selectedIds.length" @click="handleDelete()">删除</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">
<div class="gd-table-content gd-table-content-bg">
<el-table class="gd-table" :data="list" @selection-change="handleSelectionChange">
- <el-table-column type="selection" width="46" />
+ <!-- <el-table-column type="selection" width="46" />-->
<el-table-column type="index" width="64" label="序号" />
<el-table-column prop="patrolTaskName" show-overflow-tooltip label="巡查任务名称" />
<el-table-column prop="taskNo" show-overflow-tooltip label="巡查任务编号" />
<el-table-column prop="patrolTaskType" show-overflow-tooltip label="巡查任务类型">
<template v-slot="{ row }">
- {{ getDictLabel(row.patrolTaskType, dictObj.patrolTaskType) }}
+ {{ getDictLabel(row.patrolTaskType, dictObj.workOrderType) }}
</template>
</el-table-column>
<el-table-column prop="taskStatus" show-overflow-tooltip label="巡查任务状态">
<template v-slot="{ row }">
- {{ getTaskStatusLabel(row.taskStatus) }}
+ {{ getDictLabel(row.taskStatus, dictObj.taskStatus) }}
</template>
</el-table-column>
<el-table-column prop="executeTime" show-overflow-tooltip label="任务执行时间" />
@@ -90,9 +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 @click="viewDiaLogView('view', row)">查看</el-link>
- <el-link @click="openForm('edit', row)">编辑</el-link>
- <el-link @click="handleDelete(row)">删除</el-link>
+ <el-link type="primary" @click="viewDiaLogView(row)">查看</el-link>
</template>
</el-table-column>
</el-table>
@@ -111,7 +119,13 @@
</div>
<FormDiaLog ref="dialogRef" @success="getList" v-if="dialogVisible" v-model="dialogVisible" />
- <ViewDiaLog ref="viewDiaLogRef" @success="getList" v-if="viewDiaLogVisible" v-model="viewDiaLogVisible" />
+ <ViewDiaLog
+ ref="viewDiaLogRef"
+ @success="getList"
+ @refusalAccept="refusalAccept"
+ v-if="viewDiaLogVisible"
+ v-model="viewDiaLogVisible"
+ />
</basic-container>
</template>
<script setup>
@@ -123,6 +137,11 @@
import FormDiaLog from './FormDiaLog.vue'
import { gdPatrolTaskPageApi, gdPatrolTaskRemoveApi } from './inspectionRequestApi'
import ViewDiaLog from '@/views/orderView/orderManage/inspectionRequest/ViewDiaLog.vue'
+import { useStore } from 'vuex'
+import { airlineListApi } from '@/api/zkxt'
+
+const store = useStore()
+const permission = computed(() => store.state.user.permission)
// 初始化查询参数
const initSearchParams = () => ({
@@ -137,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列表
@@ -145,47 +166,36 @@
const viewDiaLogRef = ref(null)
const dialogVisible = ref(false)
const viewDiaLogVisible = ref(false)
-const requester = ref(true)
const dictObj = ref({
- patrolTaskType: [], // 巡查任务类型
workOrderType: [], // 工单类型
deviceLoadDemand: [], // 设备负载需求
+ taskStatus: [], // 巡查任务状态
})
-
-// 任务状态选项
-const taskStatusOptions = [
- { label: '待签收', value: '0' },
- { label: '拒绝签收', value: '1' },
- { label: '已撤回', value: '2' },
- { label: '待审核', value: '3' },
- { label: '审核驳回', value: '4' },
- { label: '审核通过', value: '5' },
- { label: '待验收', value: '6' },
- { label: '拒绝验收', value: '7' },
- { label: '验收通过', value: '8' },
-]
-
+const activeName = ref('all')
provide('dictObj', dictObj)
-provide('taskStatusOptions', taskStatusOptions)
-provide('requester', requester)
-
-// 获取任务状态标签
-function getTaskStatusLabel(value) {
- const item = taskStatusOptions.find(item => item.value === value)
- return item ? item.label : value
-}
// 获取列表
async function getList() {
const range = dateRangeFormat(dateRange.value)
loading.value = true
try {
- const res = await gdPatrolTaskPageApi({ ...searchParams.value, startTime: range[0], endTime: range[1] })
+ const res = await gdPatrolTaskPageApi({
+ ...searchParams.value,
+ startTime: range[0],
+ endTime: range[1],
+ createUser: activeName.value === 'my' ? store.state.user.userInfo.user_id : '',
+ })
list.value = res?.data?.data?.records ?? []
total.value = res?.data?.data?.total ?? 0
} finally {
loading.value = false
}
+}
+
+function tabsClick(tab, event) {
+ activeName.value = tab.props.name
+ resetForm()
+ handleSearch()
}
// 查询
@@ -210,27 +220,14 @@
})
}
-function viewDiaLogView(mode, row) {
+// 状态:0待签收、1拒绝签收、2已撤回、3待审核、4审核驳回
+// 5审核通过、6待验收、7拒绝验收、8验收通过
+function viewDiaLogView(row) {
viewDiaLogVisible.value = true
nextTick(() => {
+ let mode = ['1', '4'].includes(row.taskStatus) && permission.value.flyOrder_add ? 'edit' : 'view'
viewDiaLogRef.value?.open({ mode, row })
})
-}
-
-// 删除
-async function handleDelete(row) {
- const tips = row ? '该条' : '选中的项'
- await ElMessageBox.confirm(`确认删除${tips}吗?`, '提示', {
- type: 'warning',
- customClass: 'gd-confirm-custom',
- confirmButtonClass: 'gd-confirm-button',
- cancelButtonClass: 'gd-confirm-cancel-button',
- })
- const ids = row ? row.id : selectedIds.value.join(',')
- await gdPatrolTaskRemoveApi({ ids })
- ElMessage.success('删除成功')
- selectedIds.value = []
- getList()
}
// 勾选值设置
@@ -238,16 +235,55 @@
selectedIds.value = rows.map(item => item.id)
}
+const routeOptions = ref([])
+const getAirName = id => {
+ const item = routeOptions.value.find(item => item.id === id)
+ return item ? item.name : id
+}
+provide('routeOptions', routeOptions)
+provide('getAirName', getAirName)
+function getAirList() {
+ airlineListApi({}).then(res => {
+ routeOptions.value = res.data.data || []
+ })
+}
+
// 获取字典
function getDictList() {
- getDictionaryByCode('patrolTaskType,workOrderType,deviceLoadDemand').then(res => {
+ getDictionaryByCode('workOrderType,deviceLoadDemand,taskStatus').then(res => {
dictObj.value = res.data.data
})
}
+function refusalAccept(row) {
+ dialogVisible.value = true
+ nextTick(() => {
+ dialogRef.value?.open({ mode: 'edit', row })
+ })
+}
+
+// 获取两个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()
})
</script>
<style scoped lang="scss"></style>
--
Gitblit v1.9.3