吉安感知网项目-前端
罗广辉
2026-01-30 4f2e4041b6ccb2591d713927e2fc4d09e39922bf
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()
})