|
@@ -5,9 +5,11 @@ import { useDebounceFn } from '@vueuse/core'
|
|
|
import dayjs from 'dayjs'
|
|
import dayjs from 'dayjs'
|
|
|
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
|
|
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
|
|
|
import { useUserStore } from '@/store/modules/user'
|
|
import { useUserStore } from '@/store/modules/user'
|
|
|
|
|
+import { resolveDailyReportDeptId } from '@/utils/dailyReportDept'
|
|
|
import download from '@/utils/download'
|
|
import download from '@/utils/download'
|
|
|
|
|
+import CountTo from '@/components/count-to1.vue'
|
|
|
|
|
|
|
|
-defineOptions({ name: 'DailyReport' })
|
|
|
|
|
|
|
+defineOptions({ name: 'RdDailyReport' })
|
|
|
|
|
|
|
|
const tab = ref('井')
|
|
const tab = ref('井')
|
|
|
const tabOptions = ['井', '队伍']
|
|
const tabOptions = ['井', '队伍']
|
|
@@ -268,7 +270,8 @@ function rowClassName(data: { row: List; rowIndex: number }) {
|
|
|
return ''
|
|
return ''
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const id = useUserStore().getUser.deptId ?? 157
|
|
|
|
|
|
|
+const TOP_DEPT_ID = 163
|
|
|
|
|
+const id = resolveDailyReportDeptId(useUserStore().getUser.deptId, TOP_DEPT_ID)
|
|
|
|
|
|
|
|
const deptId = id
|
|
const deptId = id
|
|
|
|
|
|
|
@@ -291,6 +294,14 @@ const query = ref<Query>({
|
|
|
]
|
|
]
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
+const taskName = computed({
|
|
|
|
|
+ get: () => query.value.taskName,
|
|
|
|
|
+ set: (value: string | undefined) => {
|
|
|
|
|
+ query.value.taskName = value
|
|
|
|
|
+ query.value.wellName = value
|
|
|
|
|
+ }
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
function handleSizeChange(val: number) {
|
|
function handleSizeChange(val: number) {
|
|
|
query.value.pageSize = val
|
|
query.value.pageSize = val
|
|
|
handleQuery()
|
|
handleQuery()
|
|
@@ -306,6 +317,114 @@ const loading = ref(false)
|
|
|
const list = ref<List[]>([])
|
|
const list = ref<List[]>([])
|
|
|
const total = ref(0)
|
|
const total = ref(0)
|
|
|
|
|
|
|
|
|
|
+const totalWorkKeys: [string, string | undefined, string, string, number][] = [
|
|
|
|
|
+ [
|
|
|
|
|
+ 'cumulativeBridgePlug',
|
|
|
|
|
+ undefined,
|
|
|
|
|
+ '桥塞',
|
|
|
|
|
+ 'i-material-symbols:check-circle-outline-rounded text-emerald',
|
|
|
|
|
+ 0
|
|
|
|
|
+ ],
|
|
|
|
|
+ [
|
|
|
|
|
+ 'cumulativeRunCount',
|
|
|
|
|
+ undefined,
|
|
|
|
|
+ '趟数',
|
|
|
|
|
+ 'i-material-symbols:check-circle-outline-rounded text-emerald',
|
|
|
|
|
+ 0
|
|
|
|
|
+ ],
|
|
|
|
|
+ [
|
|
|
|
|
+ 'cumulativeWorkingWell',
|
|
|
|
|
+ undefined,
|
|
|
|
|
+ '井数',
|
|
|
|
|
+ 'i-material-symbols:check-circle-outline-rounded text-emerald',
|
|
|
|
|
+ 0
|
|
|
|
|
+ ],
|
|
|
|
|
+ [
|
|
|
|
|
+ 'cumulativeWorkingLayers',
|
|
|
|
|
+ undefined,
|
|
|
|
|
+ '段数',
|
|
|
|
|
+ 'i-material-symbols:check-circle-outline-rounded text-emerald',
|
|
|
|
|
+ 0
|
|
|
|
|
+ ],
|
|
|
|
|
+ [
|
|
|
|
|
+ 'cumulativeHourCount',
|
|
|
|
|
+ undefined,
|
|
|
|
|
+ '小时(H)',
|
|
|
|
|
+ 'i-material-symbols:nest-clock-farsight-analog-outline-rounded text-emerald',
|
|
|
|
|
+ 2
|
|
|
|
|
+ ],
|
|
|
|
|
+ [
|
|
|
|
|
+ 'cumulativeWaterVolume',
|
|
|
|
|
+ '方',
|
|
|
|
|
+ '水方量',
|
|
|
|
|
+ 'i-material-symbols:water-drop-outline-rounded text-sky',
|
|
|
|
|
+ 2
|
|
|
|
|
+ ],
|
|
|
|
|
+ ['taici', undefined, '台次', 'i-material-symbols:check-circle-outline-rounded text-emerald', 0],
|
|
|
|
|
+ [
|
|
|
|
|
+ 'utilizationRate',
|
|
|
|
|
+ '%',
|
|
|
|
|
+ '设备利用率',
|
|
|
|
|
+ 'i-material-symbols:check-circle-outline-rounded text-emerald',
|
|
|
|
|
+ 0
|
|
|
|
|
+ ],
|
|
|
|
|
+ [
|
|
|
|
|
+ 'cumulativeFuels',
|
|
|
|
|
+ '万升',
|
|
|
|
|
+ '累计油耗',
|
|
|
|
|
+ 'i-material-symbols:directions-car-outline-rounded text-sky',
|
|
|
|
|
+ 2
|
|
|
|
|
+ ]
|
|
|
|
|
+]
|
|
|
|
|
+
|
|
|
|
|
+const totalWork = ref<Record<string, number>>({
|
|
|
|
|
+ cumulativeFuels: 0,
|
|
|
|
|
+ taici: 0,
|
|
|
|
|
+ cumulativeBridgePlug: 0,
|
|
|
|
|
+ cumulativeRunCount: 0,
|
|
|
|
|
+ cumulativeWorkingWell: 0,
|
|
|
|
|
+ cumulativeWorkingLayers: 0,
|
|
|
|
|
+ cumulativeHourCount: 0,
|
|
|
|
|
+ cumulativeWaterVolume: 0,
|
|
|
|
|
+ utilizationRate: 0
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
|
|
+const totalLoading = ref(false)
|
|
|
|
|
+
|
|
|
|
|
+const loadTotalWorkload = useDebounceFn(async () => {
|
|
|
|
|
+ totalLoading.value = true
|
|
|
|
|
+ try {
|
|
|
|
|
+ const {
|
|
|
|
|
+ pageNo: _pageNo,
|
|
|
|
|
+ pageSize: _pageSize,
|
|
|
|
|
+ wellName: _wellName,
|
|
|
|
|
+ ...totalWorkloadQuery
|
|
|
|
|
+ } = query.value
|
|
|
|
|
+
|
|
|
|
|
+ void _pageNo
|
|
|
|
|
+ void _pageSize
|
|
|
|
|
+ void _wellName
|
|
|
|
|
+
|
|
|
|
|
+ const data = await IotRdDailyReportApi.totalWorkload(totalWorkloadQuery)
|
|
|
|
|
+
|
|
|
|
|
+ totalWork.value = {
|
|
|
|
|
+ ...totalWork.value,
|
|
|
|
|
+ taici: data.taici || 0,
|
|
|
|
|
+ cumulativeBridgePlug: data.cumulativeBridgePlug || 0,
|
|
|
|
|
+ cumulativeRunCount: data.cumulativeRunCount || 0,
|
|
|
|
|
+ cumulativeWorkingWell: data.cumulativeWorkingWell || 0,
|
|
|
|
|
+ cumulativeWorkingLayers: data.cumulativeWorkingLayers || 0,
|
|
|
|
|
+ cumulativeHourCount: data.cumulativeHourCount || 0,
|
|
|
|
|
+ cumulativeWaterVolume: data.cumulativeWaterVolume || 0,
|
|
|
|
|
+ ...data,
|
|
|
|
|
+ cumulativeFuels: (data.cumulativeFuels || 0) / 10000,
|
|
|
|
|
+ utilizationRate: Number(((data.utilizationRate || 0) * 100).toFixed(2))
|
|
|
|
|
+ }
|
|
|
|
|
+ } finally {
|
|
|
|
|
+ totalLoading.value = false
|
|
|
|
|
+ }
|
|
|
|
|
+}, 500)
|
|
|
|
|
+
|
|
|
const loadList = useDebounceFn(async function () {
|
|
const loadList = useDebounceFn(async function () {
|
|
|
loading.value = true
|
|
loading.value = true
|
|
|
try {
|
|
try {
|
|
@@ -336,15 +455,17 @@ function handleQuery(setPage = true) {
|
|
|
query.value.pageNo = 1
|
|
query.value.pageNo = 1
|
|
|
}
|
|
}
|
|
|
loadList()
|
|
loadList()
|
|
|
|
|
+ loadTotalWorkload()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function resetQuery() {
|
|
function resetQuery() {
|
|
|
query.value = {
|
|
query.value = {
|
|
|
pageNo: 1,
|
|
pageNo: 1,
|
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
|
- deptId: 157,
|
|
|
|
|
|
|
+ deptId: id,
|
|
|
contractName: '',
|
|
contractName: '',
|
|
|
taskName: '',
|
|
taskName: '',
|
|
|
|
|
+ wellName: '',
|
|
|
createTime: [
|
|
createTime: [
|
|
|
...rangeShortcuts[2].value().map((item) => dayjs(item).format('YYYY-MM-DD HH:mm:ss'))
|
|
...rangeShortcuts[2].value().map((item) => dayjs(item).format('YYYY-MM-DD HH:mm:ss'))
|
|
|
]
|
|
]
|
|
@@ -390,12 +511,10 @@ const handleExport = () => {
|
|
|
|
|
|
|
|
<template>
|
|
<template>
|
|
|
<div
|
|
<div
|
|
|
- class="daily-report-page grid grid-cols-[auto_1fr] gap-4 h-[calc(100vh-20px-var(--top-tool-height)-var(--tags-view-height)-var(--app-footer-height))]"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ class="daily-report-page grid grid-cols-[auto_1fr] gap-4 h-[calc(100vh-20px-var(--top-tool-height)-var(--tags-view-height)-var(--app-footer-height))]">
|
|
|
<el-form
|
|
<el-form
|
|
|
size="default"
|
|
size="default"
|
|
|
- class="col-span-2 bg-white dark:bg-[#1d1e1f] rounded-lg shadow px-8 gap-8 flex items-center"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ class="col-span-2 bg-white dark:bg-[#1d1e1f] rounded-lg shadow px-8 gap-8 flex items-center">
|
|
|
<div class="flex items-center gap-8">
|
|
<div class="flex items-center gap-8">
|
|
|
<el-segmented class="h-12" v-model="tab" :options="tabOptions" @change="handleQuery()" />
|
|
<el-segmented class="h-12" v-model="tab" :options="tabOptions" @change="handleQuery()" />
|
|
|
</div>
|
|
</div>
|
|
@@ -406,17 +525,15 @@ const handleExport = () => {
|
|
|
placeholder="请输入项目"
|
|
placeholder="请输入项目"
|
|
|
clearable
|
|
clearable
|
|
|
@keyup.enter="handleQuery()"
|
|
@keyup.enter="handleQuery()"
|
|
|
- class="!w-240px"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ class="!w-240px" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item v-show="tab !== '井'" label="任务">
|
|
<el-form-item v-show="tab !== '井'" label="任务">
|
|
|
<el-input
|
|
<el-input
|
|
|
- v-model="query.taskName"
|
|
|
|
|
|
|
+ v-model="taskName"
|
|
|
placeholder="请输入任务"
|
|
placeholder="请输入任务"
|
|
|
clearable
|
|
clearable
|
|
|
@keyup.enter="handleQuery()"
|
|
@keyup.enter="handleQuery()"
|
|
|
- class="!w-240px"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ class="!w-240px" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="创建时间">
|
|
<el-form-item label="创建时间">
|
|
|
<el-date-picker
|
|
<el-date-picker
|
|
@@ -427,8 +544,7 @@ const handleExport = () => {
|
|
|
end-placeholder="结束日期"
|
|
end-placeholder="结束日期"
|
|
|
:shortcuts="rangeShortcuts"
|
|
:shortcuts="rangeShortcuts"
|
|
|
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
|
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
|
|
- class="!w-220px"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ class="!w-220px" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</div>
|
|
</div>
|
|
|
<el-form-item class="ml-auto">
|
|
<el-form-item class="ml-auto">
|
|
@@ -445,25 +561,43 @@ const handleExport = () => {
|
|
|
<!-- 第二行左侧:自动落入第 2 行第 1 列 -->
|
|
<!-- 第二行左侧:自动落入第 2 行第 1 列 -->
|
|
|
<DeptTreeSelect
|
|
<DeptTreeSelect
|
|
|
v-show="tab === '队伍'"
|
|
v-show="tab === '队伍'"
|
|
|
- :top-id="163"
|
|
|
|
|
- :deptId="deptId"
|
|
|
|
|
|
|
+ :top-id="TOP_DEPT_ID"
|
|
|
|
|
+ :dept-id="deptId"
|
|
|
v-model="query.deptId"
|
|
v-model="query.deptId"
|
|
|
|
|
+ :init-select="false"
|
|
|
title="队伍"
|
|
title="队伍"
|
|
|
- class="daily-report-side"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ class="daily-report-side row-span-2" />
|
|
|
<WellSelect
|
|
<WellSelect
|
|
|
v-show="tab === '井'"
|
|
v-show="tab === '井'"
|
|
|
- :deptId="163"
|
|
|
|
|
- v-model="query.wellName"
|
|
|
|
|
|
|
+ :dept-id="deptId"
|
|
|
|
|
+ v-model="taskName"
|
|
|
v-model:contract-name="query.contractName"
|
|
v-model:contract-name="query.contractName"
|
|
|
- class="daily-report-side"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ class="daily-report-side row-span-2" />
|
|
|
<!-- <div class="p-4 bg-white dark:bg-[#1d1e1f] shadow rounded-lg h-full"> </div> -->
|
|
<!-- <div class="p-4 bg-white dark:bg-[#1d1e1f] shadow rounded-lg h-full"> </div> -->
|
|
|
|
|
|
|
|
|
|
+ <div class="grid grid-cols-9 gap-4" v-loading="totalLoading">
|
|
|
|
|
+ <div
|
|
|
|
|
+ v-for="info in totalWorkKeys"
|
|
|
|
|
+ :key="info[0]"
|
|
|
|
|
+ class="bg-white dark:bg-[#1d1e1f] rounded-lg shadow px-1 py-2 flex flex-col items-center justify-center gap-0.5 min-w-0">
|
|
|
|
|
+ <div class="size-6.5" :class="info[3]"></div>
|
|
|
|
|
+ <count-to
|
|
|
|
|
+ class="text-xl font-medium leading-6"
|
|
|
|
|
+ :start-val="0"
|
|
|
|
|
+ :end-val="totalWork[info[0]]"
|
|
|
|
|
+ :decimals="info[4]">
|
|
|
|
|
+ <span class="text-xs leading-8 text-[var(--el-text-color-regular)]">暂无数据</span>
|
|
|
|
|
+ </count-to>
|
|
|
|
|
+ <div
|
|
|
|
|
+ class="text-xs font-medium leading-5 text-[var(--el-text-color-regular)] whitespace-nowrap">
|
|
|
|
|
+ {{ info[1] ? info[2] + '(' + info[1] + ')' : info[2] }}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
<!-- 第二行右侧:自动落入第 2 行第 2 列 -->
|
|
<!-- 第二行右侧:自动落入第 2 行第 2 列 -->
|
|
|
<div
|
|
<div
|
|
|
- class="daily-report-table-card bg-white dark:bg-[#1d1e1f] shadow rounded-lg p-4 flex flex-col min-h-0"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ class="daily-report-table-card bg-white dark:bg-[#1d1e1f] shadow rounded-lg p-4 flex flex-col min-h-0">
|
|
|
<div class="flex-1 relative min-h-0">
|
|
<div class="flex-1 relative min-h-0">
|
|
|
<el-auto-resizer class="absolute">
|
|
<el-auto-resizer class="absolute">
|
|
|
<template #default="{ width, height }">
|
|
<template #default="{ width, height }">
|
|
@@ -481,13 +615,11 @@ const handleExport = () => {
|
|
|
row-key="id"
|
|
row-key="id"
|
|
|
scrollbar-always-on
|
|
scrollbar-always-on
|
|
|
:expand-row-keys="expandRowKeys"
|
|
:expand-row-keys="expandRowKeys"
|
|
|
- border
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ border>
|
|
|
<el-table-column type="expand" fixed="left">
|
|
<el-table-column type="expand" fixed="left">
|
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
|
<div
|
|
<div
|
|
|
- class="flex items-center gap-8 h-10 px-14 sticky left-0 w-fit box-border bg-[var(--el-bg-color)]"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ class="flex items-center gap-8 h-10 px-14 sticky left-0 w-fit box-border bg-[var(--el-bg-color)]">
|
|
|
<el-tag>桥塞: {{ row.groupIdBridgePlug }} </el-tag>
|
|
<el-tag>桥塞: {{ row.groupIdBridgePlug }} </el-tag>
|
|
|
<el-tag>趟数: {{ row.groupIdRunCount }} </el-tag>
|
|
<el-tag>趟数: {{ row.groupIdRunCount }} </el-tag>
|
|
|
<el-tag>井数: {{ row.groupIdCumulativeWorkingWell }} </el-tag>
|
|
<el-tag>井数: {{ row.groupIdCumulativeWorkingWell }} </el-tag>
|
|
@@ -531,8 +663,7 @@ const handleExport = () => {
|
|
|
:total="total"
|
|
:total="total"
|
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
|
@size-change="handleSizeChange"
|
|
@size-change="handleSizeChange"
|
|
|
- @current-change="handleCurrentChange"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ @current-change="handleCurrentChange" />
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -540,7 +671,7 @@ const handleExport = () => {
|
|
|
|
|
|
|
|
<style scoped>
|
|
<style scoped>
|
|
|
.daily-report-page {
|
|
.daily-report-page {
|
|
|
- grid-template-rows: 62px minmax(0, 1fr);
|
|
|
|
|
|
|
+ grid-template-rows: 62px 96px minmax(0, 1fr);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.daily-report-side {
|
|
.daily-report-side {
|