Zimo 1 روز پیش
والد
کامیت
20838034e7
2فایلهای تغییر یافته به همراه1119 افزوده شده و 978 حذف شده
  1. 996 0
      src/views/pms/iotrddailyreport/index copy.vue
  2. 123 978
      src/views/pms/iotrddailyreport/index.vue

+ 996 - 0
src/views/pms/iotrddailyreport/index copy.vue

@@ -0,0 +1,996 @@
+<template>
+  <el-row :gutter="20">
+    <el-col :span="4" :xs="24">
+      <ContentWrap class="h-1/1">
+        <DeptTree2 :deptId="rootDeptId" @node-click="handleDeptNodeClick" />
+      </ContentWrap>
+    </el-col>
+    <el-col :span="20" :xs="24">
+      <ContentWrap>
+        <!-- 搜索工作栏 -->
+        <el-form
+          class="-mb-15px"
+          :model="queryParams"
+          ref="queryFormRef"
+          :inline="true"
+          label-width="68px"
+        >
+          <el-form-item label="项目" prop="contractName">
+            <el-input
+              v-model="queryParams.contractName"
+              placeholder="请输入项目"
+              clearable
+              @keyup.enter="handleQuery"
+              class="!w-240px"
+            />
+          </el-form-item>
+          <el-form-item label="任务" prop="taskName">
+            <el-input
+              v-model="queryParams.taskName"
+              placeholder="请输入任务"
+              clearable
+              @keyup.enter="handleQuery"
+              class="!w-240px"
+            />
+          </el-form-item>
+          <el-form-item label="创建时间" prop="createTime">
+            <el-date-picker
+              v-model="queryParams.createTime"
+              value-format="YYYY-MM-DD HH:mm:ss"
+              type="daterange"
+              start-placeholder="开始日期"
+              end-placeholder="结束日期"
+              :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
+              class="!w-220px"
+              :shortcuts="rangeShortcuts"
+            />
+          </el-form-item>
+          <el-form-item>
+            <el-button @click="handleQuery"
+              ><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button
+            >
+            <el-button @click="resetQuery"
+              ><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button
+            >
+            <el-button
+              type="primary"
+              plain
+              @click="openForm('create')"
+              v-hasPermi="['pms:iot-rd-daily-report:create']"
+            >
+              <Icon icon="ep:plus" class="mr-5px" /> 新增
+            </el-button>
+            <el-button type="success" plain @click="handleExport" :loading="exportLoading">
+              <Icon icon="ep:download" class="mr-5px" /> 导出
+            </el-button>
+          </el-form-item>
+        </el-form>
+      </ContentWrap>
+      <!-- 列表 -->
+      <ContentWrap ref="tableContainerRef">
+        <el-table
+          ref="tableRef"
+          v-loading="loading"
+          :data="list"
+          :stripe="true"
+          :style="{ width: '100%' }"
+          max-height="600"
+          show-overflow-tooltip
+          border
+        >
+          <el-table-column
+            label="创建时间"
+            align="center"
+            prop="createTime"
+            :formatter="dateFormatter2"
+            :min-width="columnWidths.createTime.width"
+            resizable
+          />
+          <el-table-column
+            label="施工队伍"
+            align="center"
+            prop="deptName"
+            :min-width="columnWidths.deptName.width"
+            resizable
+          />
+
+          <el-table-column
+            label="任务"
+            align="center"
+            prop="taskName"
+            :min-width="columnWidths.taskName.width"
+            resizable
+          />
+
+          <el-table-column
+            :label="t('project.status')"
+            align="center"
+            prop="rdStatus"
+            :min-width="columnWidths.rdStatus.width"
+            resizable
+          >
+            <template #default="scope">
+              <dict-tag :type="DICT_TYPE.PMS_PROJECT_RD_STATUS" :value="scope.row.rdStatus" />
+            </template>
+          </el-table-column>
+
+          <el-table-column
+            label="当日生产动态"
+            align="center"
+            prop="productionStatus"
+            :min-width="columnWidths.productionStatus.width"
+            resizable
+          />
+          <el-table-column
+            label="下步工作计划"
+            align="center"
+            prop="nextPlan"
+            :min-width="columnWidths.nextPlan.width"
+            fixed-width
+          />
+
+          <!--
+          <el-table-column label="项目类别(钻井 修井 注氮 酸化压裂... )" align="center" prop="projectClassification" />
+          <el-table-column label="施工工艺" align="center" prop="techniqueIds" /> -->
+          <!--
+          <el-table-column label="施工设备" align="center" prop="deviceIds" /> -->
+          <!--
+          <el-table-column label="时间节点-结束" align="center" prop="endTime" /> -->
+          <el-table-column align="center" label="当日">
+            <el-table-column
+              label="施工井"
+              align="center"
+              prop="cumulativeWorkingWell"
+              :min-width="columnWidths.cumulativeWorkingWell.width"
+              resizable
+            />
+            <el-table-column
+              label="施工层"
+              align="center"
+              prop="cumulativeWorkingLayers"
+              :min-width="columnWidths.cumulativeWorkingLayers.width"
+              resizable
+            />
+            <el-table-column
+              label="泵车台次"
+              align="center"
+              prop="dailyPumpTrips"
+              :min-width="columnWidths.dailyPumpTrips.width"
+              resizable
+            />
+            <el-table-column
+              label="仪表/混砂"
+              align="center"
+              prop="dailyToolsSand"
+              :min-width="columnWidths.dailyToolsSand.width"
+              resizable
+            />
+          </el-table-column>
+          <el-table-column
+            label="趟数"
+            align="center"
+            prop="runCount"
+            :min-width="columnWidths.runCount.width"
+            resizable
+          />
+          <el-table-column
+            label="桥塞"
+            align="center"
+            prop="bridgePlug"
+            :min-width="columnWidths.bridgePlug.width"
+            resizable
+          />
+          <el-table-column
+            label="水方量"
+            align="center"
+            prop="waterVolume"
+            :min-width="columnWidths.waterVolume.width"
+            resizable
+          />
+          <el-table-column
+            label="时间H"
+            align="center"
+            prop="hourCount"
+            :min-width="columnWidths.hourCount.width"
+            resizable
+          />
+          <el-table-column
+            label="油耗(L)"
+            align="center"
+            prop="dailyFuel"
+            :min-width="columnWidths.dailyFuel.width"
+            resizable
+          />
+
+          <el-table-column
+            label="外租设备"
+            align="center"
+            prop="externalRental"
+            :min-width="columnWidths.externalRental.width"
+            resizable
+          />
+          <el-table-column
+            label="故障情况"
+            align="center"
+            prop="malfunction"
+            :min-width="columnWidths.malfunction.width"
+            resizable
+          />
+          <el-table-column
+            label="故障误工H"
+            align="center"
+            prop="faultDowntime"
+            :min-width="columnWidths.faultDowntime.width"
+            resizable
+          />
+          <el-table-column label="非生产时间" align="center">
+            <el-table-column
+              label="工程质量"
+              align="center"
+              prop="accidentTime"
+              :min-width="columnWidths.accidentTime.width"
+              resizable
+            />
+            <el-table-column
+              label="设备故障"
+              align="center"
+              prop="repairTime"
+              :min-width="columnWidths.repairTime.width"
+              resizable
+            />
+            <el-table-column
+              label="设备保养"
+              align="center"
+              prop="selfStopTime"
+              :min-width="columnWidths.selfStopTime.width"
+              resizable
+            />
+            <el-table-column
+              label="技术受限"
+              align="center"
+              prop="complexityTime"
+              :min-width="columnWidths.complexityTime.width"
+              resizable
+            />
+            <el-table-column
+              label="生产配合"
+              align="center"
+              prop="relocationTime"
+              :min-width="columnWidths.relocationTime.width"
+              resizable
+            />
+            <el-table-column
+              label="生产组织"
+              align="center"
+              prop="rectificationTime"
+              :min-width="columnWidths.rectificationTime.width"
+              resizable
+            />
+            <el-table-column
+              label="不可抗力"
+              align="center"
+              prop="waitingStopTime"
+              :min-width="columnWidths.waitingStopTime.width"
+              resizable
+            />
+            <el-table-column
+              label="待命"
+              align="center"
+              prop="winterBreakTime"
+              :min-width="columnWidths.winterBreakTime.width"
+              resizable
+            />
+            <el-table-column
+              label="甲方设计"
+              align="center"
+              prop="partyaDesign"
+              :min-width="columnWidths.partyaDesign.width"
+              resizable
+            />
+            <el-table-column
+              label="甲方准备"
+              align="center"
+              prop="partyaPrepare"
+              :min-width="columnWidths.partyaPrepare.width"
+              resizable
+            />
+            <el-table-column
+              label="甲方资源"
+              align="center"
+              prop="partyaResource"
+              :min-width="columnWidths.partyaResource.width"
+              resizable
+            />
+            <el-table-column
+              label="其它非生产时间"
+              align="center"
+              prop="otherNptTime"
+              :min-width="columnWidths.otherNptTime.width"
+              resizable
+            />
+          </el-table-column>
+          <el-table-column
+            label="其他非生产时间原因"
+            align="center"
+            prop="otherNptReason"
+            :min-width="columnWidths.otherNptReason.width"
+            resizable
+          />
+          <el-table-column
+            label="非生产时间填写"
+            align="center"
+            prop="nonProductFlag"
+            :min-width="110"
+          >
+            <template #default="scope">
+              <el-tag
+                :type="
+                  scope.row.nonProductFlag || scope.row.processInstanceId === '2'
+                    ? 'success'
+                    : 'danger'
+                "
+              >
+                {{
+                  scope.row.nonProductFlag || scope.row.processInstanceId === '2'
+                    ? '已填写'
+                    : '未填写'
+                }}
+              </el-tag>
+            </template>
+          </el-table-column>
+          <el-table-column
+            label="非生产时效"
+            align="center"
+            prop="nonProductionRate"
+            :min-width="80"
+            resizable
+            :formatter="(row) => (Number(row.nonProductionRate ?? 0) * 100).toFixed(2) + '%'"
+          />
+          <el-table-column
+            label="项目"
+            align="center"
+            prop="contractName"
+            :min-width="columnWidths.contractName.width"
+            resizable
+          />
+          <el-table-column
+            label="时间节点"
+            align="center"
+            prop="timeRange"
+            :min-width="columnWidths.timeRange.width"
+            resizable
+          />
+          <el-table-column label="审批状态" align="center" prop="auditStatus" :min-width="84">
+            <template #default="scope">
+              <el-tag v-if="scope.row.auditStatus === 0" type="info">
+                {{ '待提交' }}
+              </el-tag>
+              <el-tag v-else-if="scope.row.auditStatus === 10">
+                {{ '待审批' }}
+              </el-tag>
+              <el-tag v-else-if="scope.row.auditStatus === 20" type="success">
+                {{ '审批通过' }}
+              </el-tag>
+              <el-tag v-else-if="scope.row.auditStatus === 30" type="danger">
+                {{ '审批拒绝' }}
+              </el-tag>
+            </template>
+          </el-table-column>
+
+          <el-table-column label="操作" align="center" min-width="120px" fixed="right">
+            <template #default="scope">
+              <el-button
+                link
+                type="success"
+                @click="handleDetail(scope.row.id)"
+                v-hasPermi="['pms:iot-rd-daily-report:query']"
+              >
+                查看
+              </el-button>
+              <el-button
+                link
+                type="warning"
+                @click="handleApprove(scope.row.id)"
+                v-hasPermi="['pms:iot-rd-daily-report:update']"
+                v-if="scope.row.auditStatus === 10"
+              >
+                审批
+              </el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+        <!-- 分页 -->
+        <Pagination
+          :total="total"
+          v-model:page="queryParams.pageNo"
+          v-model:limit="queryParams.pageSize"
+          @pagination="getList"
+        />
+      </ContentWrap>
+
+      <!-- 表单弹窗:添加/修改 -->
+      <IotRdDailyReportForm ref="formRef" @success="getList" />
+    </el-col>
+  </el-row>
+</template>
+
+<script setup lang="ts">
+import { dateFormatter, dateFormatter2 } from '@/utils/formatTime'
+import { IotRdDailyReportApi, IotRdDailyReportVO } from '@/api/pms/iotrddailyreport'
+import IotRdDailyReportForm from './IotRdDailyReportForm.vue'
+import { DICT_TYPE } from '@/utils/dict'
+import { useRoute } from 'vue-router'
+import DeptTree2 from '@/views/pms/iotrhdailyreport/DeptTree2.vue'
+import { useDebounceFn } from '@vueuse/core'
+
+import dayjs from 'dayjs'
+import quarterOfYear from 'dayjs/plugin/quarterOfYear'
+import download from '@/utils/download'
+
+dayjs.extend(quarterOfYear)
+
+const rangeShortcuts = [
+  {
+    text: '今天',
+    value: () => {
+      const today = dayjs()
+      return [today.startOf('day').toDate(), today.endOf('day').toDate()]
+    }
+  },
+  {
+    text: '昨天',
+    value: () => {
+      const yesterday = dayjs().subtract(1, 'day')
+      return [yesterday.startOf('day').toDate(), yesterday.endOf('day').toDate()]
+    }
+  },
+  {
+    text: '本周',
+    value: () => {
+      return [dayjs().startOf('week').toDate(), dayjs().endOf('week').toDate()]
+    }
+  },
+  {
+    text: '上周',
+    value: () => {
+      const lastWeek = dayjs().subtract(1, 'week')
+      return [lastWeek.startOf('week').toDate(), lastWeek.endOf('week').toDate()]
+    }
+  },
+  {
+    text: '本月',
+    value: () => {
+      return [dayjs().startOf('month').toDate(), dayjs().endOf('month').toDate()]
+    }
+  },
+  {
+    text: '上月',
+    value: () => {
+      const lastMonth = dayjs().subtract(1, 'month')
+      return [lastMonth.startOf('month').toDate(), lastMonth.endOf('month').toDate()]
+    }
+  },
+  {
+    text: '本季度',
+    value: () => {
+      return [dayjs().startOf('quarter').toDate(), dayjs().endOf('quarter').toDate()]
+    }
+  },
+  {
+    text: '上季度',
+    value: () => {
+      const lastQuarter = dayjs().subtract(1, 'quarter')
+      return [lastQuarter.startOf('quarter').toDate(), lastQuarter.endOf('quarter').toDate()]
+    }
+  },
+  {
+    text: '今年',
+    value: () => {
+      return [dayjs().startOf('year').toDate(), dayjs().endOf('year').toDate()]
+    }
+  },
+  {
+    text: '去年',
+    value: () => {
+      const lastYear = dayjs().subtract(1, 'year')
+      return [lastYear.startOf('year').toDate(), lastYear.endOf('year').toDate()]
+    }
+  },
+  {
+    text: '最近7天',
+    value: () => {
+      return [dayjs().subtract(6, 'day').toDate(), dayjs().toDate()]
+    }
+  },
+  {
+    text: '最近30天',
+    value: () => {
+      return [dayjs().subtract(29, 'day').toDate(), dayjs().toDate()]
+    }
+  },
+  {
+    text: '最近90天',
+    value: () => {
+      return [dayjs().subtract(89, 'day').toDate(), dayjs().toDate()]
+    }
+  },
+  {
+    text: '最近一年',
+    value: () => {
+      return [dayjs().subtract(1, 'year').toDate(), dayjs().toDate()]
+    }
+  }
+]
+
+/** 瑞都日报 列表 */
+defineOptions({ name: 'IotRdDailyReport' })
+
+const message = useMessage() // 消息弹窗
+const { t } = useI18n() // 国际化
+const { push } = useRouter() // 路由跳转
+const loading = ref(true) // 列表的加载中
+const list = ref<IotRdDailyReportVO[]>([]) // 列表的数据
+const total = ref(0) // 列表的总页数
+
+const route = useRoute() // 路由信息
+
+const queryParams = reactive({
+  pageNo: 1,
+  pageSize: 10,
+  deptId: undefined,
+  projectId: undefined,
+  contractName: undefined,
+  taskId: undefined,
+  taskName: undefined,
+  projectClassification: undefined,
+  techniqueIds: undefined,
+  deviceIds: undefined,
+  startTime: [],
+  endTime: [],
+  cumulativeWorkingWell: undefined,
+  cumulativeWorkingLayers: undefined,
+  dailyPumpTrips: undefined,
+  dailyToolsSand: undefined,
+  runCount: undefined,
+  bridgePlug: undefined,
+  waterVolume: undefined,
+  hourCount: undefined,
+  dailyFuel: undefined,
+  dailyPowerUsage: undefined,
+  productionTime: [],
+  nonProductionTime: [],
+  rdNptReason: undefined,
+  constructionStartDate: [],
+  constructionEndDate: [],
+  productionStatus: undefined,
+  externalRental: undefined,
+  nextPlan: undefined,
+  rdStatus: undefined,
+  malfunction: undefined,
+  faultDowntime: [],
+  personnel: undefined,
+  totalStaffNum: undefined,
+  leaveStaffNum: undefined,
+  extProperty: undefined,
+  sort: undefined,
+  remark: undefined,
+  status: undefined,
+  processInstanceId: undefined,
+  auditStatus: undefined,
+  createTime: []
+})
+const queryFormRef = ref() // 搜索的表单
+
+const rootDeptId = ref(163)
+
+// 表格引用
+const tableRef = ref()
+// 表格容器引用
+const tableContainerRef = ref()
+
+const columnWidths = ref<
+  Record<
+    string,
+    { label: string; prop: string; width: string; fn?: (row: IotRdDailyReportVO) => string }
+  >
+>({
+  createTime: {
+    label: '创建时间',
+    prop: 'createTime',
+    width: '120px',
+    fn: (row: IotRdDailyReportVO) => dateFormatter(null, null, row.createTime)
+  },
+  deptName: {
+    label: '施工队伍',
+    prop: 'deptName',
+    width: '120px'
+  },
+  contractName: {
+    label: '项目',
+    prop: 'contractName',
+    width: '120px'
+  },
+  taskName: {
+    label: '任务',
+    prop: 'taskName',
+    width: '120px'
+  },
+  timeRange: {
+    label: '时间节点',
+    prop: 'timeRange',
+    width: '120px'
+  },
+  rdStatus: {
+    label: '施工状态',
+    prop: 'rdStatus',
+    width: '120px'
+  },
+  cumulativeWorkingWell: {
+    label: '施工井',
+    prop: 'cumulativeWorkingWell',
+    width: '120px'
+  },
+  cumulativeWorkingLayers: {
+    label: '施工层',
+    prop: 'cumulativeWorkingLayers',
+    width: '120px'
+  },
+  dailyPumpTrips: {
+    label: '泵车台次',
+    prop: 'dailyPumpTrips',
+    width: '120px'
+  },
+  dailyToolsSand: {
+    label: '仪表/混砂',
+    prop: 'dailyToolsSand',
+    width: '120px'
+  },
+  runCount: {
+    label: '趟数',
+    prop: 'runCount',
+    width: '120px'
+  },
+  bridgePlug: {
+    label: '桥塞',
+    prop: 'bridgePlug',
+    width: '120px'
+  },
+  waterVolume: {
+    label: '水方量',
+    prop: 'waterVolume',
+    width: '120px'
+  },
+  hourCount: {
+    label: '时间H',
+    prop: 'hourCount',
+    width: '120px'
+  },
+  dailyFuel: {
+    label: '油耗(L)',
+    prop: 'dailyFuel',
+    width: '120px'
+  },
+  productionStatus: {
+    label: '当日生产动态',
+    prop: 'productionStatus',
+    width: '120px'
+  },
+  nextPlan: {
+    label: '下步工作计划',
+    prop: 'nextPlan',
+    width: '120px'
+  },
+  externalRental: {
+    label: '外租设备',
+    prop: 'externalRental',
+    width: '120px'
+  },
+  malfunction: {
+    label: '故障情况',
+    prop: 'malfunction',
+    width: '120px'
+  },
+  faultDowntime: {
+    label: '故障误工H',
+    prop: 'faultDowntime',
+    width: '120px'
+  },
+  accidentTime: {
+    label: '工程质量',
+    prop: 'accidentTime',
+    width: '120px'
+  },
+  repairTime: {
+    label: '设备故障',
+    prop: 'repairTime',
+    width: '120px'
+  },
+  selfStopTime: {
+    label: '设备保养',
+    prop: 'selfStopTime',
+    width: '120px'
+  },
+  complexityTime: {
+    label: '技术受限',
+    prop: 'complexityTime',
+    width: '120px'
+  },
+  relocationTime: {
+    label: '生产配合',
+    prop: 'relocationTime',
+    width: '120px'
+  },
+  rectificationTime: {
+    label: '生产组织',
+    prop: 'rectificationTime',
+    width: '120px'
+  },
+  waitingStopTime: {
+    label: '不可抗力',
+    prop: 'waitingStopTime',
+    width: '120px'
+  },
+  winterBreakTime: {
+    label: '待命',
+    prop: 'winterBreakTime',
+    width: '120px'
+  },
+  partyaDesign: {
+    label: '甲方设计',
+    prop: 'partyaDesign',
+    width: '120px'
+  },
+  partyaPrepare: {
+    label: '甲方资源',
+    prop: 'partyaPrepare',
+    width: '120px'
+  },
+  partyaResource: {
+    label: '甲方准备',
+    prop: 'partyaResource',
+    width: '120px'
+  },
+  otherNptTime: {
+    label: '其它非生产时间',
+    prop: 'otherNptTime',
+    width: '120px'
+  },
+  otherNptReason: {
+    label: '其他非生产时间原因',
+    prop: 'otherNptReason',
+    width: '120px'
+  }
+})
+
+// 计算文本宽度
+const getTextWidth = (text: string, fontSize = 12) => {
+  const span = document.createElement('span')
+  span.style.visibility = 'hidden'
+  span.style.position = 'absolute'
+  span.style.whiteSpace = 'nowrap'
+  span.style.fontSize = `${fontSize}px`
+  span.style.fontFamily = 'PingFang SC'
+  span.innerText = text
+
+  document.body.appendChild(span)
+  const width = span.offsetWidth
+  document.body.removeChild(span)
+
+  return width
+}
+
+const calculateColumnWidths = useDebounceFn(() => {
+  if (!tableContainerRef.value?.$el) return
+  Object.values(columnWidths.value).forEach(({ fn, prop, label, width }) => {
+    width =
+      Math.min(
+        ...[
+          Math.max(
+            ...[
+              getTextWidth(label),
+              ...list.value.map((v) => {
+                return getTextWidth(fn ? fn(v) : v[prop])
+              })
+            ]
+          ) + (label === '施工状态' ? 35 : 20),
+          200
+        ]
+      ) + 'px'
+
+    console.log('width :>> ', width)
+
+    columnWidths.value[prop].width = width
+  })
+}, 1000)
+
+/** 查询列表 */
+const getList = async () => {
+  loading.value = true
+  try {
+    const data = await IotRdDailyReportApi.getIotRdDailyReportPage(queryParams)
+    list.value = data.list
+    total.value = data.total
+    // 获取数据后计算列宽
+    nextTick(() => {
+      calculateColumnWidths()
+    })
+  } finally {
+    loading.value = false
+  }
+}
+
+/** 搜索按钮操作 */
+const handleQuery = () => {
+  queryParams.pageNo = 1
+  getList()
+}
+
+/** 重置按钮操作 */
+const resetQuery = () => {
+  queryFormRef.value.resetFields()
+  handleQuery()
+}
+
+/** 添加/修改操作 */
+const formRef = ref()
+const openForm = (type: string, id?: number) => {
+  formRef.value.open(type, id)
+}
+
+/** 查看日报详情 */
+const handleDetail = async (id: number) => {
+  try {
+    // 跳转到 FillDailyReportForm 页面,传递审批模式和ID
+    push({
+      name: 'FillDailyReportForm',
+      params: {
+        id: id.toString(),
+        mode: 'detail' // 添加详情模式标识
+      }
+    })
+  } catch (error) {
+    console.error('跳转详情页面失败:', error)
+  }
+}
+
+// 响应式变量存储选中的部门
+const selectedDept = ref<{ id: number; name: string }>()
+/** 处理部门被点击 */
+const handleDeptNodeClick = async (row) => {
+  // 记录选中的部门信息
+  selectedDept.value = { id: row.id, name: row.name }
+  queryParams.deptId = row.id
+  await getList()
+}
+
+/** 审批按钮操作 */
+const handleApprove = async (id: number) => {
+  try {
+    // 跳转到 FillDailyReportForm 页面,传递审批模式和ID
+    push({
+      name: 'FillDailyReportForm',
+      params: {
+        id: id.toString(),
+        mode: 'approval' // 添加审批模式标识
+      }
+    })
+  } catch (error) {
+    console.error('跳转审批页面失败:', error)
+  }
+}
+
+/** 删除按钮操作 */
+const handleDelete = async (id: number) => {
+  try {
+    // 删除的二次确认
+    await message.delConfirm()
+    // 发起删除
+    await IotRdDailyReportApi.deleteIotRdDailyReport(id)
+    message.success(t('common.delSuccess'))
+    // 刷新列表
+    await getList()
+  } catch {}
+}
+
+const exportLoading = ref(false)
+
+const handleExport = async () => {
+  const res = await IotRdDailyReportApi.exportIotRdDailyReportDetails(queryParams)
+
+  download.excel(res, '瑞都日报明细.xlsx')
+}
+
+// 声明 ResizeObserver 实例
+let resizeObserver: ResizeObserver | null = null
+
+/** 初始化 **/
+onMounted(() => {
+  // 检查是否有路由参数传递过来的 wellName
+  if (route.query.wellName) {
+    queryParams.taskName = route.query.wellName as string
+  }
+  if (route.query.taskId) {
+    queryParams.taskId = route.query.taskId as number
+  }
+  getList()
+  // 创建 ResizeObserver 监听表格容器尺寸变化
+  if (tableContainerRef.value?.$el) {
+    resizeObserver = new ResizeObserver(() => {
+      // 使用防抖避免频繁触发
+      clearTimeout((window as any).resizeTimer)
+      ;(window as any).resizeTimer = setTimeout(() => {
+        calculateColumnWidths()
+      }, 100)
+    })
+    resizeObserver.observe(tableContainerRef.value.$el)
+  }
+})
+
+onUnmounted(() => {
+  // 清除 ResizeObserver
+  if (resizeObserver && tableContainerRef.value?.$el) {
+    resizeObserver.unobserve(tableContainerRef.value.$el)
+    resizeObserver = null
+  }
+
+  // 清除定时器
+  if ((window as any).resizeTimer) {
+    clearTimeout((window as any).resizeTimer)
+  }
+})
+
+// 监听列表数据变化重新计算列宽
+watch(
+  list,
+  () => {
+    nextTick(calculateColumnWidths)
+  },
+  { deep: true }
+)
+</script>
+
+<style scoped>
+/* 确保表格单元格内容不换行 */
+
+/* :deep(.el-table .cell) {
+  white-space: nowrap;
+} */
+
+/* 确保表格列标题不换行 */
+
+/* :deep(.el-table th > .cell) {
+  white-space: nowrap;
+} */
+
+/* 调整表格最小宽度,确保内容完全显示 */
+:deep(.el-table) {
+  min-width: 100%;
+}
+
+/* 长文本样式 - 多行显示并添加省略号 */
+.long-text {
+  display: -webkit-box;
+  max-height: 3em; /* 两行文本的高度 */
+  overflow: hidden;
+  line-height: 1.5;
+  text-overflow: ellipsis;
+  -webkit-box-orient: vertical;
+  -webkit-line-clamp: 2;
+}
+
+/* 确保固定宽度列不参与自动调整 */
+:deep(.el-table__header-wrapper .el-table__cell.fixed-width),
+:deep(.el-table__body-wrapper .el-table__cell.fixed-width) {
+  flex-shrink: 0;
+  flex-grow: 0;
+}
+</style>
+
+<style>
+/* 长文本 tooltip 样式 - 保留换行符 */
+.long-text-tooltip {
+  max-width: 500px;
+  line-height: 1.5;
+  white-space: pre-line;
+}
+</style>

+ 123 - 978
src/views/pms/iotrddailyreport/index.vue

@@ -1,996 +1,141 @@
-<template>
-  <el-row :gutter="20">
-    <el-col :span="4" :xs="24">
-      <ContentWrap class="h-1/1">
-        <DeptTree2 :deptId="rootDeptId" @node-click="handleDeptNodeClick" />
-      </ContentWrap>
-    </el-col>
-    <el-col :span="20" :xs="24">
-      <ContentWrap>
-        <!-- 搜索工作栏 -->
-        <el-form
-          class="-mb-15px"
-          :model="queryParams"
-          ref="queryFormRef"
-          :inline="true"
-          label-width="68px"
-        >
-          <el-form-item label="项目" prop="contractName">
-            <el-input
-              v-model="queryParams.contractName"
-              placeholder="请输入项目"
-              clearable
-              @keyup.enter="handleQuery"
-              class="!w-240px"
-            />
-          </el-form-item>
-          <el-form-item label="任务" prop="taskName">
-            <el-input
-              v-model="queryParams.taskName"
-              placeholder="请输入任务"
-              clearable
-              @keyup.enter="handleQuery"
-              class="!w-240px"
-            />
-          </el-form-item>
-          <el-form-item label="创建时间" prop="createTime">
-            <el-date-picker
-              v-model="queryParams.createTime"
-              value-format="YYYY-MM-DD HH:mm:ss"
-              type="daterange"
-              start-placeholder="开始日期"
-              end-placeholder="结束日期"
-              :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
-              class="!w-220px"
-              :shortcuts="rangeShortcuts"
-            />
-          </el-form-item>
-          <el-form-item>
-            <el-button @click="handleQuery"
-              ><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button
-            >
-            <el-button @click="resetQuery"
-              ><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button
-            >
-            <el-button
-              type="primary"
-              plain
-              @click="openForm('create')"
-              v-hasPermi="['pms:iot-rd-daily-report:create']"
-            >
-              <Icon icon="ep:plus" class="mr-5px" /> 新增
-            </el-button>
-            <el-button type="success" plain @click="handleExport" :loading="exportLoading">
-              <Icon icon="ep:download" class="mr-5px" /> 导出
-            </el-button>
-          </el-form-item>
-        </el-form>
-      </ContentWrap>
-      <!-- 列表 -->
-      <ContentWrap ref="tableContainerRef">
-        <el-table
-          ref="tableRef"
-          v-loading="loading"
-          :data="list"
-          :stripe="true"
-          :style="{ width: '100%' }"
-          max-height="600"
-          show-overflow-tooltip
-          border
-        >
-          <el-table-column
-            label="创建时间"
-            align="center"
-            prop="createTime"
-            :formatter="dateFormatter2"
-            :min-width="columnWidths.createTime.width"
-            resizable
-          />
-          <el-table-column
-            label="施工队伍"
-            align="center"
-            prop="deptName"
-            :min-width="columnWidths.deptName.width"
-            resizable
-          />
+<script lang="ts" setup>
+import { useUserStore } from '@/store/modules/user'
+import { rangeShortcuts } from '@/utils/formatTime'
 
-          <el-table-column
-            label="任务"
-            align="center"
-            prop="taskName"
-            :min-width="columnWidths.taskName.width"
-            resizable
-          />
+const { t } = useI18n()
 
-          <el-table-column
-            :label="t('project.status')"
-            align="center"
-            prop="rdStatus"
-            :min-width="columnWidths.rdStatus.width"
-            resizable
-          >
-            <template #default="scope">
-              <dict-tag :type="DICT_TYPE.PMS_PROJECT_RD_STATUS" :value="scope.row.rdStatus" />
-            </template>
-          </el-table-column>
+const id = useUserStore().getUser.deptId
 
-          <el-table-column
-            label="当日生产动态"
-            align="center"
-            prop="productionStatus"
-            :min-width="columnWidths.productionStatus.width"
-            resizable
-          />
-          <el-table-column
-            label="下步工作计划"
-            align="center"
-            prop="nextPlan"
-            :min-width="columnWidths.nextPlan.width"
-            fixed-width
-          />
-
-          <!--
-          <el-table-column label="项目类别(钻井 修井 注氮 酸化压裂... )" align="center" prop="projectClassification" />
-          <el-table-column label="施工工艺" align="center" prop="techniqueIds" /> -->
-          <!--
-          <el-table-column label="施工设备" align="center" prop="deviceIds" /> -->
-          <!--
-          <el-table-column label="时间节点-结束" align="center" prop="endTime" /> -->
-          <el-table-column align="center" label="当日">
-            <el-table-column
-              label="施工井"
-              align="center"
-              prop="cumulativeWorkingWell"
-              :min-width="columnWidths.cumulativeWorkingWell.width"
-              resizable
-            />
-            <el-table-column
-              label="施工层"
-              align="center"
-              prop="cumulativeWorkingLayers"
-              :min-width="columnWidths.cumulativeWorkingLayers.width"
-              resizable
-            />
-            <el-table-column
-              label="泵车台次"
-              align="center"
-              prop="dailyPumpTrips"
-              :min-width="columnWidths.dailyPumpTrips.width"
-              resizable
-            />
-            <el-table-column
-              label="仪表/混砂"
-              align="center"
-              prop="dailyToolsSand"
-              :min-width="columnWidths.dailyToolsSand.width"
-              resizable
-            />
-          </el-table-column>
-          <el-table-column
-            label="趟数"
-            align="center"
-            prop="runCount"
-            :min-width="columnWidths.runCount.width"
-            resizable
-          />
-          <el-table-column
-            label="桥塞"
-            align="center"
-            prop="bridgePlug"
-            :min-width="columnWidths.bridgePlug.width"
-            resizable
-          />
-          <el-table-column
-            label="水方量"
-            align="center"
-            prop="waterVolume"
-            :min-width="columnWidths.waterVolume.width"
-            resizable
-          />
-          <el-table-column
-            label="时间H"
-            align="center"
-            prop="hourCount"
-            :min-width="columnWidths.hourCount.width"
-            resizable
-          />
-          <el-table-column
-            label="油耗(L)"
-            align="center"
-            prop="dailyFuel"
-            :min-width="columnWidths.dailyFuel.width"
-            resizable
-          />
+const deptId = id
 
-          <el-table-column
-            label="外租设备"
-            align="center"
-            prop="externalRental"
-            :min-width="columnWidths.externalRental.width"
-            resizable
-          />
-          <el-table-column
-            label="故障情况"
-            align="center"
-            prop="malfunction"
-            :min-width="columnWidths.malfunction.width"
-            resizable
-          />
-          <el-table-column
-            label="故障误工H"
-            align="center"
-            prop="faultDowntime"
-            :min-width="columnWidths.faultDowntime.width"
-            resizable
-          />
-          <el-table-column label="非生产时间" align="center">
-            <el-table-column
-              label="工程质量"
-              align="center"
-              prop="accidentTime"
-              :min-width="columnWidths.accidentTime.width"
-              resizable
-            />
-            <el-table-column
-              label="设备故障"
-              align="center"
-              prop="repairTime"
-              :min-width="columnWidths.repairTime.width"
-              resizable
-            />
-            <el-table-column
-              label="设备保养"
-              align="center"
-              prop="selfStopTime"
-              :min-width="columnWidths.selfStopTime.width"
-              resizable
-            />
-            <el-table-column
-              label="技术受限"
-              align="center"
-              prop="complexityTime"
-              :min-width="columnWidths.complexityTime.width"
-              resizable
-            />
-            <el-table-column
-              label="生产配合"
-              align="center"
-              prop="relocationTime"
-              :min-width="columnWidths.relocationTime.width"
-              resizable
-            />
-            <el-table-column
-              label="生产组织"
-              align="center"
-              prop="rectificationTime"
-              :min-width="columnWidths.rectificationTime.width"
-              resizable
-            />
-            <el-table-column
-              label="不可抗力"
-              align="center"
-              prop="waitingStopTime"
-              :min-width="columnWidths.waitingStopTime.width"
-              resizable
-            />
-            <el-table-column
-              label="待命"
-              align="center"
-              prop="winterBreakTime"
-              :min-width="columnWidths.winterBreakTime.width"
-              resizable
-            />
-            <el-table-column
-              label="甲方设计"
-              align="center"
-              prop="partyaDesign"
-              :min-width="columnWidths.partyaDesign.width"
-              resizable
-            />
-            <el-table-column
-              label="甲方准备"
-              align="center"
-              prop="partyaPrepare"
-              :min-width="columnWidths.partyaPrepare.width"
-              resizable
-            />
-            <el-table-column
-              label="甲方资源"
-              align="center"
-              prop="partyaResource"
-              :min-width="columnWidths.partyaResource.width"
-              resizable
-            />
-            <el-table-column
-              label="其它非生产时间"
-              align="center"
-              prop="otherNptTime"
-              :min-width="columnWidths.otherNptTime.width"
-              resizable
-            />
-          </el-table-column>
-          <el-table-column
-            label="其他非生产时间原因"
-            align="center"
-            prop="otherNptReason"
-            :min-width="columnWidths.otherNptReason.width"
-            resizable
-          />
-          <el-table-column
-            label="非生产时间填写"
-            align="center"
-            prop="nonProductFlag"
-            :min-width="110"
-          >
-            <template #default="scope">
-              <el-tag
-                :type="
-                  scope.row.nonProductFlag || scope.row.processInstanceId === '2'
-                    ? 'success'
-                    : 'danger'
-                "
-              >
-                {{
-                  scope.row.nonProductFlag || scope.row.processInstanceId === '2'
-                    ? '已填写'
-                    : '未填写'
-                }}
-              </el-tag>
-            </template>
-          </el-table-column>
-          <el-table-column
-            label="非生产时效"
-            align="center"
-            prop="nonProductionRate"
-            :min-width="80"
-            resizable
-            :formatter="(row) => (Number(row.nonProductionRate ?? 0) * 100).toFixed(2) + '%'"
-          />
-          <el-table-column
-            label="项目"
-            align="center"
-            prop="contractName"
-            :min-width="columnWidths.contractName.width"
-            resizable
-          />
-          <el-table-column
-            label="时间节点"
-            align="center"
-            prop="timeRange"
-            :min-width="columnWidths.timeRange.width"
-            resizable
-          />
-          <el-table-column label="审批状态" align="center" prop="auditStatus" :min-width="84">
-            <template #default="scope">
-              <el-tag v-if="scope.row.auditStatus === 0" type="info">
-                {{ '待提交' }}
-              </el-tag>
-              <el-tag v-else-if="scope.row.auditStatus === 10">
-                {{ '待审批' }}
-              </el-tag>
-              <el-tag v-else-if="scope.row.auditStatus === 20" type="success">
-                {{ '审批通过' }}
-              </el-tag>
-              <el-tag v-else-if="scope.row.auditStatus === 30" type="danger">
-                {{ '审批拒绝' }}
-              </el-tag>
-            </template>
-          </el-table-column>
-
-          <el-table-column label="操作" align="center" min-width="120px" fixed="right">
-            <template #default="scope">
-              <el-button
-                link
-                type="success"
-                @click="handleDetail(scope.row.id)"
-                v-hasPermi="['pms:iot-rd-daily-report:query']"
-              >
-                查看
-              </el-button>
-              <el-button
-                link
-                type="warning"
-                @click="handleApprove(scope.row.id)"
-                v-hasPermi="['pms:iot-rd-daily-report:update']"
-                v-if="scope.row.auditStatus === 10"
-              >
-                审批
-              </el-button>
-            </template>
-          </el-table-column>
-        </el-table>
-        <!-- 分页 -->
-        <Pagination
-          :total="total"
-          v-model:page="queryParams.pageNo"
-          v-model:limit="queryParams.pageSize"
-          @pagination="getList"
-        />
-      </ContentWrap>
-
-      <!-- 表单弹窗:添加/修改 -->
-      <IotRdDailyReportForm ref="formRef" @success="getList" />
-    </el-col>
-  </el-row>
-</template>
-
-<script setup lang="ts">
-import { dateFormatter, dateFormatter2 } from '@/utils/formatTime'
-import { IotRdDailyReportApi, IotRdDailyReportVO } from '@/api/pms/iotrddailyreport'
-import IotRdDailyReportForm from './IotRdDailyReportForm.vue'
-import { DICT_TYPE } from '@/utils/dict'
-import { useRoute } from 'vue-router'
-import DeptTree2 from '@/views/pms/iotrhdailyreport/DeptTree2.vue'
-import { useDebounceFn } from '@vueuse/core'
-
-import dayjs from 'dayjs'
-import quarterOfYear from 'dayjs/plugin/quarterOfYear'
-import download from '@/utils/download'
-
-dayjs.extend(quarterOfYear)
-
-const rangeShortcuts = [
-  {
-    text: '今天',
-    value: () => {
-      const today = dayjs()
-      return [today.startOf('day').toDate(), today.endOf('day').toDate()]
-    }
-  },
-  {
-    text: '昨天',
-    value: () => {
-      const yesterday = dayjs().subtract(1, 'day')
-      return [yesterday.startOf('day').toDate(), yesterday.endOf('day').toDate()]
-    }
-  },
-  {
-    text: '本周',
-    value: () => {
-      return [dayjs().startOf('week').toDate(), dayjs().endOf('week').toDate()]
-    }
-  },
-  {
-    text: '上周',
-    value: () => {
-      const lastWeek = dayjs().subtract(1, 'week')
-      return [lastWeek.startOf('week').toDate(), lastWeek.endOf('week').toDate()]
-    }
-  },
-  {
-    text: '本月',
-    value: () => {
-      return [dayjs().startOf('month').toDate(), dayjs().endOf('month').toDate()]
-    }
-  },
-  {
-    text: '上月',
-    value: () => {
-      const lastMonth = dayjs().subtract(1, 'month')
-      return [lastMonth.startOf('month').toDate(), lastMonth.endOf('month').toDate()]
-    }
-  },
-  {
-    text: '本季度',
-    value: () => {
-      return [dayjs().startOf('quarter').toDate(), dayjs().endOf('quarter').toDate()]
-    }
-  },
-  {
-    text: '上季度',
-    value: () => {
-      const lastQuarter = dayjs().subtract(1, 'quarter')
-      return [lastQuarter.startOf('quarter').toDate(), lastQuarter.endOf('quarter').toDate()]
-    }
-  },
-  {
-    text: '今年',
-    value: () => {
-      return [dayjs().startOf('year').toDate(), dayjs().endOf('year').toDate()]
-    }
-  },
-  {
-    text: '去年',
-    value: () => {
-      const lastYear = dayjs().subtract(1, 'year')
-      return [lastYear.startOf('year').toDate(), lastYear.endOf('year').toDate()]
-    }
-  },
-  {
-    text: '最近7天',
-    value: () => {
-      return [dayjs().subtract(6, 'day').toDate(), dayjs().toDate()]
-    }
-  },
-  {
-    text: '最近30天',
-    value: () => {
-      return [dayjs().subtract(29, 'day').toDate(), dayjs().toDate()]
-    }
-  },
-  {
-    text: '最近90天',
-    value: () => {
-      return [dayjs().subtract(89, 'day').toDate(), dayjs().toDate()]
-    }
-  },
-  {
-    text: '最近一年',
-    value: () => {
-      return [dayjs().subtract(1, 'year').toDate(), dayjs().toDate()]
-    }
-  }
-]
-
-/** 瑞都日报 列表 */
-defineOptions({ name: 'IotRdDailyReport' })
-
-const message = useMessage() // 消息弹窗
-const { t } = useI18n() // 国际化
-const { push } = useRouter() // 路由跳转
-const loading = ref(true) // 列表的加载中
-const list = ref<IotRdDailyReportVO[]>([]) // 列表的数据
-const total = ref(0) // 列表的总页数
-
-const route = useRoute() // 路由信息
+interface Query {
+  deptId?: number
+  contractName?: string
+  taskName?: string
+  createTime?: string[]
+  pageNo: number
+  pageSize: number
+}
 
-const queryParams = reactive({
+const query = ref<Query>({
   pageNo: 1,
-  pageSize: 10,
-  deptId: undefined,
-  projectId: undefined,
-  contractName: undefined,
-  taskId: undefined,
-  taskName: undefined,
-  projectClassification: undefined,
-  techniqueIds: undefined,
-  deviceIds: undefined,
-  startTime: [],
-  endTime: [],
-  cumulativeWorkingWell: undefined,
-  cumulativeWorkingLayers: undefined,
-  dailyPumpTrips: undefined,
-  dailyToolsSand: undefined,
-  runCount: undefined,
-  bridgePlug: undefined,
-  waterVolume: undefined,
-  hourCount: undefined,
-  dailyFuel: undefined,
-  dailyPowerUsage: undefined,
-  productionTime: [],
-  nonProductionTime: [],
-  rdNptReason: undefined,
-  constructionStartDate: [],
-  constructionEndDate: [],
-  productionStatus: undefined,
-  externalRental: undefined,
-  nextPlan: undefined,
-  rdStatus: undefined,
-  malfunction: undefined,
-  faultDowntime: [],
-  personnel: undefined,
-  totalStaffNum: undefined,
-  leaveStaffNum: undefined,
-  extProperty: undefined,
-  sort: undefined,
-  remark: undefined,
-  status: undefined,
-  processInstanceId: undefined,
-  auditStatus: undefined,
-  createTime: []
+  pageSize: 12,
+  deptId: id
 })
-const queryFormRef = ref() // 搜索的表单
-
-const rootDeptId = ref(163)
-
-// 表格引用
-const tableRef = ref()
-// 表格容器引用
-const tableContainerRef = ref()
-
-const columnWidths = ref<
-  Record<
-    string,
-    { label: string; prop: string; width: string; fn?: (row: IotRdDailyReportVO) => string }
-  >
->({
-  createTime: {
-    label: '创建时间',
-    prop: 'createTime',
-    width: '120px',
-    fn: (row: IotRdDailyReportVO) => dateFormatter(null, null, row.createTime)
-  },
-  deptName: {
-    label: '施工队伍',
-    prop: 'deptName',
-    width: '120px'
-  },
-  contractName: {
-    label: '项目',
-    prop: 'contractName',
-    width: '120px'
-  },
-  taskName: {
-    label: '任务',
-    prop: 'taskName',
-    width: '120px'
-  },
-  timeRange: {
-    label: '时间节点',
-    prop: 'timeRange',
-    width: '120px'
-  },
-  rdStatus: {
-    label: '施工状态',
-    prop: 'rdStatus',
-    width: '120px'
-  },
-  cumulativeWorkingWell: {
-    label: '施工井',
-    prop: 'cumulativeWorkingWell',
-    width: '120px'
-  },
-  cumulativeWorkingLayers: {
-    label: '施工层',
-    prop: 'cumulativeWorkingLayers',
-    width: '120px'
-  },
-  dailyPumpTrips: {
-    label: '泵车台次',
-    prop: 'dailyPumpTrips',
-    width: '120px'
-  },
-  dailyToolsSand: {
-    label: '仪表/混砂',
-    prop: 'dailyToolsSand',
-    width: '120px'
-  },
-  runCount: {
-    label: '趟数',
-    prop: 'runCount',
-    width: '120px'
-  },
-  bridgePlug: {
-    label: '桥塞',
-    prop: 'bridgePlug',
-    width: '120px'
-  },
-  waterVolume: {
-    label: '水方量',
-    prop: 'waterVolume',
-    width: '120px'
-  },
-  hourCount: {
-    label: '时间H',
-    prop: 'hourCount',
-    width: '120px'
-  },
-  dailyFuel: {
-    label: '油耗(L)',
-    prop: 'dailyFuel',
-    width: '120px'
-  },
-  productionStatus: {
-    label: '当日生产动态',
-    prop: 'productionStatus',
-    width: '120px'
-  },
-  nextPlan: {
-    label: '下步工作计划',
-    prop: 'nextPlan',
-    width: '120px'
-  },
-  externalRental: {
-    label: '外租设备',
-    prop: 'externalRental',
-    width: '120px'
-  },
-  malfunction: {
-    label: '故障情况',
-    prop: 'malfunction',
-    width: '120px'
-  },
-  faultDowntime: {
-    label: '故障误工H',
-    prop: 'faultDowntime',
-    width: '120px'
-  },
-  accidentTime: {
-    label: '工程质量',
-    prop: 'accidentTime',
-    width: '120px'
-  },
-  repairTime: {
-    label: '设备故障',
-    prop: 'repairTime',
-    width: '120px'
-  },
-  selfStopTime: {
-    label: '设备保养',
-    prop: 'selfStopTime',
-    width: '120px'
-  },
-  complexityTime: {
-    label: '技术受限',
-    prop: 'complexityTime',
-    width: '120px'
-  },
-  relocationTime: {
-    label: '生产配合',
-    prop: 'relocationTime',
-    width: '120px'
-  },
-  rectificationTime: {
-    label: '生产组织',
-    prop: 'rectificationTime',
-    width: '120px'
-  },
-  waitingStopTime: {
-    label: '不可抗力',
-    prop: 'waitingStopTime',
-    width: '120px'
-  },
-  winterBreakTime: {
-    label: '待命',
-    prop: 'winterBreakTime',
-    width: '120px'
-  },
-  partyaDesign: {
-    label: '甲方设计',
-    prop: 'partyaDesign',
-    width: '120px'
-  },
-  partyaPrepare: {
-    label: '甲方资源',
-    prop: 'partyaPrepare',
-    width: '120px'
-  },
-  partyaResource: {
-    label: '甲方准备',
-    prop: 'partyaResource',
-    width: '120px'
-  },
-  otherNptTime: {
-    label: '其它非生产时间',
-    prop: 'otherNptTime',
-    width: '120px'
-  },
-  otherNptReason: {
-    label: '其他非生产时间原因',
-    prop: 'otherNptReason',
-    width: '120px'
-  }
-})
-
-// 计算文本宽度
-const getTextWidth = (text: string, fontSize = 12) => {
-  const span = document.createElement('span')
-  span.style.visibility = 'hidden'
-  span.style.position = 'absolute'
-  span.style.whiteSpace = 'nowrap'
-  span.style.fontSize = `${fontSize}px`
-  span.style.fontFamily = 'PingFang SC'
-  span.innerText = text
-
-  document.body.appendChild(span)
-  const width = span.offsetWidth
-  document.body.removeChild(span)
 
-  return width
+interface ListItem {
+  createTime: string
+  deptName: string
+  taskName: string
+  rdStatus: string
+  productionStatus: string
+  nextPlan: string
+  cumulativeWorkingWell: number
+  cumulativeWorkingLayers: number
+  dailyPumpTrips: number
+  dailyToolsSand: number
+  runCount: number
+  bridgePlug: number
+  waterVolume: number
+  hourCount: number
+  dailyFuel: number
+  externalRental: string
+  malfunction: string
+  faultDowntime: number
+  accidentTime: number
+  repairTime: number
+  selfStopTime: number
+  complexityTime: number
+  relocationTime: number
+  rectificationTime: number
+  waitingStopTime: number
+  winterBreakTime: number
+  partyaDesign: number
+  partyaPrepare: number
+  partyaResource: number
+  otherNptTime: number
+  auditStatus: number
 }
 
-const calculateColumnWidths = useDebounceFn(() => {
-  if (!tableContainerRef.value?.$el) return
-  Object.values(columnWidths.value).forEach(({ fn, prop, label, width }) => {
-    width =
-      Math.min(
-        ...[
-          Math.max(
-            ...[
-              getTextWidth(label),
-              ...list.value.map((v) => {
-                return getTextWidth(fn ? fn(v) : v[prop])
-              })
-            ]
-          ) + (label === '施工状态' ? 35 : 20),
-          200
-        ]
-      ) + 'px'
+const handleQuery = () => {}
 
-    console.log('width :>> ', width)
+const resetQuery = () => {}
 
-    columnWidths.value[prop].width = width
-  })
-}, 1000)
-
-/** 查询列表 */
-const getList = async () => {
-  loading.value = true
-  try {
-    const data = await IotRdDailyReportApi.getIotRdDailyReportPage(queryParams)
-    list.value = data.list
-    total.value = data.total
-    // 获取数据后计算列宽
-    nextTick(() => {
-      calculateColumnWidths()
-    })
-  } finally {
-    loading.value = false
-  }
-}
-
-/** 搜索按钮操作 */
-const handleQuery = () => {
-  queryParams.pageNo = 1
-  getList()
-}
-
-/** 重置按钮操作 */
-const resetQuery = () => {
-  queryFormRef.value.resetFields()
-  handleQuery()
-}
-
-/** 添加/修改操作 */
-const formRef = ref()
-const openForm = (type: string, id?: number) => {
-  formRef.value.open(type, id)
-}
-
-/** 查看日报详情 */
-const handleDetail = async (id: number) => {
-  try {
-    // 跳转到 FillDailyReportForm 页面,传递审批模式和ID
-    push({
-      name: 'FillDailyReportForm',
-      params: {
-        id: id.toString(),
-        mode: 'detail' // 添加详情模式标识
-      }
-    })
-  } catch (error) {
-    console.error('跳转详情页面失败:', error)
-  }
-}
-
-// 响应式变量存储选中的部门
-const selectedDept = ref<{ id: number; name: string }>()
-/** 处理部门被点击 */
-const handleDeptNodeClick = async (row) => {
-  // 记录选中的部门信息
-  selectedDept.value = { id: row.id, name: row.name }
-  queryParams.deptId = row.id
-  await getList()
-}
-
-/** 审批按钮操作 */
-const handleApprove = async (id: number) => {
-  try {
-    // 跳转到 FillDailyReportForm 页面,传递审批模式和ID
-    push({
-      name: 'FillDailyReportForm',
-      params: {
-        id: id.toString(),
-        mode: 'approval' // 添加审批模式标识
-      }
-    })
-  } catch (error) {
-    console.error('跳转审批页面失败:', error)
-  }
-}
-
-/** 删除按钮操作 */
-const handleDelete = async (id: number) => {
-  try {
-    // 删除的二次确认
-    await message.delConfirm()
-    // 发起删除
-    await IotRdDailyReportApi.deleteIotRdDailyReport(id)
-    message.success(t('common.delSuccess'))
-    // 刷新列表
-    await getList()
-  } catch {}
-}
+const openForm = (type: 'create' | 'detail') => {}
 
 const exportLoading = ref(false)
 
-const handleExport = async () => {
-  const res = await IotRdDailyReportApi.exportIotRdDailyReportDetails(queryParams)
-
-  download.excel(res, '瑞都日报明细.xlsx')
-}
-
-// 声明 ResizeObserver 实例
-let resizeObserver: ResizeObserver | null = null
-
-/** 初始化 **/
-onMounted(() => {
-  // 检查是否有路由参数传递过来的 wellName
-  if (route.query.wellName) {
-    queryParams.taskName = route.query.wellName as string
-  }
-  if (route.query.taskId) {
-    queryParams.taskId = route.query.taskId as number
-  }
-  getList()
-  // 创建 ResizeObserver 监听表格容器尺寸变化
-  if (tableContainerRef.value?.$el) {
-    resizeObserver = new ResizeObserver(() => {
-      // 使用防抖避免频繁触发
-      clearTimeout((window as any).resizeTimer)
-      ;(window as any).resizeTimer = setTimeout(() => {
-        calculateColumnWidths()
-      }, 100)
-    })
-    resizeObserver.observe(tableContainerRef.value.$el)
-  }
-})
-
-onUnmounted(() => {
-  // 清除 ResizeObserver
-  if (resizeObserver && tableContainerRef.value?.$el) {
-    resizeObserver.unobserve(tableContainerRef.value.$el)
-    resizeObserver = null
-  }
-
-  // 清除定时器
-  if ((window as any).resizeTimer) {
-    clearTimeout((window as any).resizeTimer)
-  }
-})
-
-// 监听列表数据变化重新计算列宽
-watch(
-  list,
-  () => {
-    nextTick(calculateColumnWidths)
-  },
-  { deep: true }
-)
+async function handleExport() {}
 </script>
 
-<style scoped>
-/* 确保表格单元格内容不换行 */
-
-/* :deep(.el-table .cell) {
-  white-space: nowrap;
-} */
-
-/* 确保表格列标题不换行 */
-
-/* :deep(.el-table th > .cell) {
-  white-space: nowrap;
-} */
-
-/* 调整表格最小宽度,确保内容完全显示 */
-:deep(.el-table) {
-  min-width: 100%;
-}
-
-/* 长文本样式 - 多行显示并添加省略号 */
-.long-text {
-  display: -webkit-box;
-  max-height: 3em; /* 两行文本的高度 */
-  overflow: hidden;
-  line-height: 1.5;
-  text-overflow: ellipsis;
-  -webkit-box-orient: vertical;
-  -webkit-line-clamp: 2;
-}
-
-/* 确保固定宽度列不参与自动调整 */
-:deep(.el-table__header-wrapper .el-table__cell.fixed-width),
-:deep(.el-table__body-wrapper .el-table__cell.fixed-width) {
-  flex-shrink: 0;
-  flex-grow: 0;
-}
-</style>
+<template>
+  <div
+    class="grid grid-cols-[15%_1fr] grid-rows-[62px_1fr] gap-4 h-[calc(100vh-20px-var(--top-tool-height)-var(--tags-view-height)-var(--app-footer-height))]"
+  >
+    <div class="p-4 bg-white dark:bg-[#1d1e1f] shadow rounded-lg row-span-2">
+      <DeptTreeSelect
+        :top-id="156"
+        :deptId="deptId"
+        v-model="query.deptId"
+        :init-select="false"
+        :show-title="false"
+      />
+    </div>
+    <el-form
+      size="default"
+      class="bg-white dark:bg-[#1d1e1f] rounded-lg shadow px-8 gap-8 flex items-center justify-between"
+    >
+      <div class="flex items-center gap-8">
+        <el-form-item label="项目">
+          <el-input
+            v-model="query.contractName"
+            placeholder="请输入项目"
+            clearable
+            @keyup.enter="handleQuery()"
+            class="!w-240px"
+          />
+        </el-form-item>
+        <el-form-item label="任务">
+          <el-input
+            v-model="query.taskName"
+            placeholder="请输入任务"
+            clearable
+            @keyup.enter="handleQuery()"
+            class="!w-240px"
+          />
+        </el-form-item>
+        <el-form-item label="创建时间" prop="createTime">
+          <el-date-picker
+            v-model="query.createTime"
+            value-format="YYYY-MM-DD HH:mm:ss"
+            type="daterange"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
+            class="!w-220px"
+            :shortcuts="rangeShortcuts"
+          />
+        </el-form-item>
+      </div>
+      <el-form-item>
+        <el-button type="primary" @click="handleQuery()">
+          <Icon icon="ep:search" class="mr-5px" /> 搜索
+        </el-button>
+        <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" />重置</el-button>
+        <el-button
+          type="primary"
+          plain
+          @click="openForm('create')"
+          v-hasPermi="['pms:iot-rd-daily-report:create']"
+        >
+          <Icon icon="ep:plus" class="mr-5px" /> 新增
+        </el-button>
+        <el-button type="success" plain @click="handleExport" :loading="exportLoading">
+          <Icon icon="ep:download" class="mr-5px" /> 导出
+        </el-button>
+      </el-form-item>
+    </el-form>
+  </div>
+</template>
 
-<style>
-/* 长文本 tooltip 样式 - 保留换行符 */
-.long-text-tooltip {
-  max-width: 500px;
-  line-height: 1.5;
-  white-space: pre-line;
-}
-</style>
+<style></style>