| | |
| | | <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"> |
| | |
| | | @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" |
| | |
| | | </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"> |
| | |
| | | <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="巡查任务状态"> |
| | |
| | | <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> |
| | |
| | | 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列表 |
| | |
| | | const dialogVisible = ref(false) |
| | | const viewDiaLogVisible = ref(false) |
| | | const dictObj = ref({ |
| | | patrolTaskType: [], // 巡查任务类型 |
| | | workOrderType: [], // 工单类型 |
| | | deviceLoadDemand: [], // 设备负载需求 |
| | | taskStatus: [], // 巡查任务状态 |
| | |
| | | |
| | | // 获取字典 |
| | | function getDictList() { |
| | | getDictionaryByCode('patrolTaskType,workOrderType,deviceLoadDemand,taskStatus').then(res => { |
| | | getDictionaryByCode('workOrderType,deviceLoadDemand,taskStatus').then(res => { |
| | | dictObj.value = res.data.data |
| | | }) |
| | | } |
| | |
| | | }) |
| | | } |
| | | |
| | | // 获取两个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() |