Parcourir la source

pms 瑞鹰日报 组织树等多条件搜索

zhangcl il y a 13 heures
Parent
commit
2cddc58142

+ 17 - 1
src/views/pms/iotrhdailyreport/DeptTree2.vue

@@ -52,6 +52,15 @@ const firstLevelKeys = ref([])
 let selectedNode = null;
 const treeStore = useTreeStore();
 
+// props 定义,接收 deptId 参数
+interface Props {
+  deptId?: number
+}
+
+const props = withDefaults(defineProps<Props>(), {
+  deptId: 157 // 可以设置默认值,但建议父组件必须传递
+})
+
 const handleRightClick = (event, { node, data }) => {
   event.preventDefault();
   menuX.value = event.clientX;
@@ -82,7 +91,7 @@ const handleMenuClick = (action) => {
 };
 /** 获得部门树 */
 const getTree = async () => {
-  const res = await DeptApi.specifiedSimpleDepts(157)
+  const res = await DeptApi.specifiedSimpleDepts(props.deptId)
   deptList.value = []
   deptList.value.push(...handleTree(res))
   firstLevelKeys.value = deptList.value.map(node => node.id);
@@ -106,6 +115,13 @@ watch(deptName, (val) => {
   treeRef.value!.filter(val)
 })
 
+// 监听 deptId 变化,当父组件改变 deptId 时重新加载树
+watch(() => props.deptId, (newVal, oldVal) => {
+  if (newVal !== oldVal) {
+    getTree()
+  }
+})
+
 /** 初始化 */
 onMounted(async () => {
   await getTree()

+ 2 - 1
src/views/pms/iotrhdailyreport/index.vue

@@ -2,7 +2,7 @@
   <el-row :gutter="20">
     <el-col :span="4" :xs="24">
       <ContentWrap class="h-1/1">
-        <DeptTree2 @node-click="handleDeptNodeClick" />
+        <DeptTree2 :deptId="rootDeptId" @node-click="handleDeptNodeClick" />
       </ContentWrap>
     </el-col>
     <el-col :span="20" :xs="24">
@@ -252,6 +252,7 @@ const queryParams = reactive({
 const queryFormRef = ref() // 搜索的表单
 const exportLoading = ref(false) // 导出的加载中
 
+const rootDeptId = ref(157)
 
 // 表格引用
 const tableRef = ref()

+ 210 - 187
src/views/pms/iotrydailyreport/index.vue

@@ -1,199 +1,209 @@
 <template>
-  <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"
-        />
-      </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-ry-daily-report:create']"
-        >
-          <Icon icon="ep:plus" class="mr-5px" /> 新增
-        </el-button>
-        <el-button
-          type="success"
-          plain
-          @click="handleExport"
-          :loading="exportLoading"
-          v-hasPermi="['pms:iot-ry-daily-report:export']"
+  <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"
         >
-          <Icon icon="ep:download" class="mr-5px" /> 导出
-        </el-button>
-      </el-form-item>
-    </el-form>
-  </ContentWrap>
-
-  <ContentWrap class="mb-15px">
-    <div class="color-legend">
-      <div class="legend-item">
-        <span class="color-indicator orange"></span>
-        <span>进尺工作时间+其它生产时间+非生产时间=24H&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;否则橙色预警</span>
-      </div>
-    </div>
-  </ContentWrap>
-
-  <!-- 列表 -->
-  <ContentWrap ref="tableContainerRef">
-    <div class="table-container">
-      <el-table ref="tableRef" v-loading="loading" :data="list" :stripe="true"
-                style="width: 100%" :cell-style="cellStyle">
-        <el-table-column :label="t('iotDevice.serial')" width="70" align="center">
-          <template #default="scope">
-            {{ scope.$index + 1 }}
-          </template>
-        </el-table-column>
-        <el-table-column
-          label="日期"
-          align="center"
-          prop="createTime"
-          :formatter="dateFormatter2"
-          :width="columnWidths.createTime"
-        />
-        <el-table-column label="施工队伍" align="center" prop="deptName" :width="columnWidths.deptName"/>
-        <el-table-column label="项目" align="center" prop="contractName" :width="columnWidths.contractName"/>
-        <el-table-column label="任务" align="center" prop="taskName" :width="columnWidths.taskName"/>
-        <el-table-column label="设备型号" align="center" prop="equipmentType" :width="columnWidths.equipmentType"/>
-        <el-table-column :label="t('project.status')" align="center" prop="rigStatus" :width="columnWidths.rigStatus">
-          <template #default="scope">
-            <dict-tag :type="DICT_TYPE.PMS_PROJECT_TASK_RY_SCHEDULE" :value="scope.row.rigStatus" />
-          </template>
-        </el-table-column>
-        <el-table-column label="上井次完井时间" align="center" prop="latestWellDoneTime" :width="columnWidths.latestWellDoneTime" :formatter="dateFormatter2"/>
-        <el-table-column label="设计井深(m)" align="center" prop="designWellDepth" :width="columnWidths.designWellDepth"/>
-        <el-table-column label="当前井深(m)" align="center" prop="currentDepth" :width="columnWidths.currentDepth" />
-        <el-table-column label="日进尺(m)" align="center" prop="dailyFootage" :width="columnWidths.dailyFootage" />
-        <el-table-column label="月进尺(m)" align="center" prop="monthlyFootage" :width="columnWidths.monthlyFootage"/>
-        <el-table-column label="年累计进尺(m)" align="center" prop="annualFootage" :width="columnWidths.annualFootage"/>
-        <el-table-column label="总施工井数" align="center" prop="totalConstructionWells" :width="columnWidths.totalConstructionWells"/>
-        <el-table-column label="完工井数" align="center" prop="completedWells" :width="columnWidths.completedWells"/>
-        <el-table-column label="泥浆性能-密度(g/cm³)" align="center" prop="mudDensity" :width="columnWidths.mudDensity"/>
-        <el-table-column label="泥浆性能-粘度(S)" align="center" prop="mudViscosity" :width="columnWidths.mudViscosity"/>
-        <el-table-column
-          label="施工开始日期"
-          align="center"
-          prop="constructionStartDate"
-          :formatter="dateFormatter"
-          :width="columnWidths.constructionStartDate"
-        />
-        <el-table-column
-          label="施工结束日期"
-          align="center"
-          prop="constructionEndDate"
-          :formatter="dateFormatter"
-          :width="columnWidths.constructionEndDate"
-        />
-        <el-table-column label="水平段长度(m)" align="center" prop="lateralLength" :width="columnWidths.lateralLength" />
-        <el-table-column label="井斜(°)" align="center" prop="wellInclination" :width="columnWidths.wellInclination"/>
-        <el-table-column label="方位(°)" align="center" prop="azimuth" :width="columnWidths.azimuth"/>
-        <el-table-column label="设计井身结构" align="center" :width="columnWidths.designWellStruct" fixed-width>
-          <template #default="scope">
-            <el-tooltip
-              effect="light"
-              :content="scope.row.designWellStruct"
-              placement="top"
-              popper-class="design-well-struct-tooltip"
-              :disabled="!scope.row.designWellStruct || scope.row.designWellStruct.length <= 30"
-            >
-              <span class="design-well-struct-text">{{ formatDesignWellStruct(scope.row.designWellStruct) }}</span>
-            </el-tooltip>
-          </template>
-        </el-table-column>
-        <el-table-column label="生产动态" align="center" :width="columnWidths.productionStatus" fixed-width>
-          <template #default="scope">
-            <el-tooltip
-              effect="light"
-              :content="scope.row.productionStatus"
-              placement="top"
-              popper-class="design-well-struct-tooltip"
-              :disabled="!scope.row.productionStatus || scope.row.productionStatus.length <= 30"
-            >
-              <span class="design-well-struct-text">{{ formatDesignWellStruct(scope.row.productionStatus) }}</span>
-            </el-tooltip>
-          </template>
-        </el-table-column>
-        <el-table-column label="进尺工作时间(H)" align="center" prop="drillingWorkingTime" :width="columnWidths.drillingWorkingTime"/>
-        <el-table-column label="其它生产时间(H)" align="center" prop="otherProductionTime" :width="columnWidths.otherProductionTime"/>
-        <el-table-column label="非生产时间" align="center">
-          <el-table-column label="事故(H)" align="center" prop="accidentTime" :width="columnWidths.nonProductionTime"/>
-          <el-table-column label="修理(H)" align="center" prop="repairTime" :width="columnWidths.nonProductionTime"/>
-          <el-table-column label="自停(H)" align="center" prop="selfStopTime" :width="columnWidths.nonProductionTime"/>
-          <el-table-column label="复杂(H)" align="center" prop="complexityTime" :width="columnWidths.nonProductionTime"/>
-          <el-table-column label="搬迁(H)" align="center" prop="relocationTime" :width="columnWidths.nonProductionTime"/>
-          <el-table-column label="整改(H)" align="center" prop="rectificationTime" :width="columnWidths.nonProductionTime"/>
-          <el-table-column label="等停(H)" align="center" prop="waitingStopTime" :width="columnWidths.nonProductionTime"/>
-          <el-table-column label="冬休(H)" align="center" prop="winterBreakTime" :width="columnWidths.nonProductionTime"/>
-        </el-table-column>
-        <el-table-column label="操作" align="center" :width="columnWidths.operation" fixed="right">
-          <template #default="scope">
+          <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"
+            />
+          </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
-              link
               type="primary"
-              @click="openForm('update', scope.row.id, scope.row)"
-              v-hasPermi="['pms:iot-ry-daily-report:update']"
+              plain
+              @click="openForm('create')"
+              v-hasPermi="['pms:iot-ry-daily-report:create']"
             >
-              编辑
+              <Icon icon="ep:plus" class="mr-5px" /> 新增
             </el-button>
             <el-button
-              link
-              type="danger"
-              @click="handleDelete(scope.row.id)"
-              v-hasPermi="['pms:iot-ry-daily-report:delete']"
+              type="success"
+              plain
+              @click="handleExport"
+              :loading="exportLoading"
+              v-hasPermi="['pms:iot-ry-daily-report:export']"
             >
-              删除
+              <Icon icon="ep:download" class="mr-5px" /> 导出
             </el-button>
-          </template>
-        </el-table-column>
-      </el-table>
-    </div>
-    <!-- 分页 -->
-    <Pagination
-      :total="total"
-      v-model:page="queryParams.pageNo"
-      v-model:limit="queryParams.pageSize"
-      @pagination="getList"
-    />
-  </ContentWrap>
-
-  <!-- 表单弹窗:添加/修改 -->
-  <IotRyDailyReportForm ref="formRef" @success="getList" :row-data="selectedRowData"/>
+          </el-form-item>
+        </el-form>
+      </ContentWrap>
+
+      <ContentWrap class="mb-15px">
+        <div class="color-legend">
+          <div class="legend-item">
+            <span class="color-indicator orange"></span>
+            <span>进尺工作时间+其它生产时间+非生产时间=24H&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;否则橙色预警</span>
+          </div>
+        </div>
+      </ContentWrap>
+
+      <!-- 列表 -->
+      <ContentWrap ref="tableContainerRef">
+        <div class="table-container">
+          <el-table ref="tableRef" v-loading="loading" :data="list" :stripe="true"
+                    style="width: 100%" :cell-style="cellStyle">
+            <el-table-column :label="t('iotDevice.serial')" width="70" align="center">
+              <template #default="scope">
+                {{ scope.$index + 1 }}
+              </template>
+            </el-table-column>
+            <el-table-column
+              label="日期"
+              align="center"
+              prop="createTime"
+              :formatter="dateFormatter2"
+              :width="columnWidths.createTime"
+            />
+            <el-table-column label="施工队伍" align="center" prop="deptName" :width="columnWidths.deptName"/>
+            <el-table-column label="项目" align="center" prop="contractName" :width="columnWidths.contractName"/>
+            <el-table-column label="任务" align="center" prop="taskName" :width="columnWidths.taskName"/>
+            <el-table-column label="设备型号" align="center" prop="equipmentType" :width="columnWidths.equipmentType"/>
+            <el-table-column :label="t('project.status')" align="center" prop="rigStatus" :width="columnWidths.rigStatus">
+              <template #default="scope">
+                <dict-tag :type="DICT_TYPE.PMS_PROJECT_TASK_RY_SCHEDULE" :value="scope.row.rigStatus" />
+              </template>
+            </el-table-column>
+            <el-table-column label="上井次完井时间" align="center" prop="latestWellDoneTime" :width="columnWidths.latestWellDoneTime" :formatter="dateFormatter2"/>
+            <el-table-column label="设计井深(m)" align="center" prop="designWellDepth" :width="columnWidths.designWellDepth"/>
+            <el-table-column label="当前井深(m)" align="center" prop="currentDepth" :width="columnWidths.currentDepth" />
+            <el-table-column label="日进尺(m)" align="center" prop="dailyFootage" :width="columnWidths.dailyFootage" />
+            <el-table-column label="月进尺(m)" align="center" prop="monthlyFootage" :width="columnWidths.monthlyFootage"/>
+            <el-table-column label="年累计进尺(m)" align="center" prop="annualFootage" :width="columnWidths.annualFootage"/>
+            <el-table-column label="总施工井数" align="center" prop="totalConstructionWells" :width="columnWidths.totalConstructionWells"/>
+            <el-table-column label="完工井数" align="center" prop="completedWells" :width="columnWidths.completedWells"/>
+            <el-table-column label="泥浆性能-密度(g/cm³)" align="center" prop="mudDensity" :width="columnWidths.mudDensity"/>
+            <el-table-column label="泥浆性能-粘度(S)" align="center" prop="mudViscosity" :width="columnWidths.mudViscosity"/>
+            <el-table-column
+              label="施工开始日期"
+              align="center"
+              prop="constructionStartDate"
+              :formatter="dateFormatter"
+              :width="columnWidths.constructionStartDate"
+            />
+            <el-table-column
+              label="施工结束日期"
+              align="center"
+              prop="constructionEndDate"
+              :formatter="dateFormatter"
+              :width="columnWidths.constructionEndDate"
+            />
+            <el-table-column label="水平段长度(m)" align="center" prop="lateralLength" :width="columnWidths.lateralLength" />
+            <el-table-column label="井斜(°)" align="center" prop="wellInclination" :width="columnWidths.wellInclination"/>
+            <el-table-column label="方位(°)" align="center" prop="azimuth" :width="columnWidths.azimuth"/>
+            <el-table-column label="设计井身结构" align="center" :width="columnWidths.designWellStruct" fixed-width>
+              <template #default="scope">
+                <el-tooltip
+                  effect="light"
+                  :content="scope.row.designWellStruct"
+                  placement="top"
+                  popper-class="design-well-struct-tooltip"
+                  :disabled="!scope.row.designWellStruct || scope.row.designWellStruct.length <= 30"
+                >
+                  <span class="design-well-struct-text">{{ formatDesignWellStruct(scope.row.designWellStruct) }}</span>
+                </el-tooltip>
+              </template>
+            </el-table-column>
+            <el-table-column label="生产动态" align="center" :width="columnWidths.productionStatus" fixed-width>
+              <template #default="scope">
+                <el-tooltip
+                  effect="light"
+                  :content="scope.row.productionStatus"
+                  placement="top"
+                  popper-class="design-well-struct-tooltip"
+                  :disabled="!scope.row.productionStatus || scope.row.productionStatus.length <= 30"
+                >
+                  <span class="design-well-struct-text">{{ formatDesignWellStruct(scope.row.productionStatus) }}</span>
+                </el-tooltip>
+              </template>
+            </el-table-column>
+            <el-table-column label="进尺工作时间(H)" align="center" prop="drillingWorkingTime" :width="columnWidths.drillingWorkingTime"/>
+            <el-table-column label="其它生产时间(H)" align="center" prop="otherProductionTime" :width="columnWidths.otherProductionTime"/>
+            <el-table-column label="非生产时间" align="center">
+              <el-table-column label="事故(H)" align="center" prop="accidentTime" :width="columnWidths.nonProductionTime"/>
+              <el-table-column label="修理(H)" align="center" prop="repairTime" :width="columnWidths.nonProductionTime"/>
+              <el-table-column label="自停(H)" align="center" prop="selfStopTime" :width="columnWidths.nonProductionTime"/>
+              <el-table-column label="复杂(H)" align="center" prop="complexityTime" :width="columnWidths.nonProductionTime"/>
+              <el-table-column label="搬迁(H)" align="center" prop="relocationTime" :width="columnWidths.nonProductionTime"/>
+              <el-table-column label="整改(H)" align="center" prop="rectificationTime" :width="columnWidths.nonProductionTime"/>
+              <el-table-column label="等停(H)" align="center" prop="waitingStopTime" :width="columnWidths.nonProductionTime"/>
+              <el-table-column label="冬休(H)" align="center" prop="winterBreakTime" :width="columnWidths.nonProductionTime"/>
+            </el-table-column>
+            <el-table-column label="操作" align="center" :width="columnWidths.operation" fixed="right">
+              <template #default="scope">
+                <el-button
+                  link
+                  type="primary"
+                  @click="openForm('update', scope.row.id, scope.row)"
+                  v-hasPermi="['pms:iot-ry-daily-report:update']"
+                >
+                  编辑
+                </el-button>
+                <el-button
+                  link
+                  type="danger"
+                  @click="handleDelete(scope.row.id)"
+                  v-hasPermi="['pms:iot-ry-daily-report:delete']"
+                >
+                  删除
+                </el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+        <!-- 分页 -->
+        <Pagination
+          :total="total"
+          v-model:page="queryParams.pageNo"
+          v-model:limit="queryParams.pageSize"
+          @pagination="getList"
+        />
+      </ContentWrap>
+
+      <!-- 表单弹窗:添加/修改 -->
+      <IotRyDailyReportForm ref="formRef" @success="getList" :row-data="selectedRowData"/>
+    </el-col>
+  </el-row>
+
 </template>
 
 <script setup lang="ts">
@@ -203,6 +213,7 @@ import { IotRyDailyReportApi, IotRyDailyReportVO } from '@/api/pms/iotrydailyrep
 import IotRyDailyReportForm from './IotRyDailyReportForm.vue'
 import {DICT_TYPE, getDictLabel} from "@/utils/dict";
 import { ref, reactive, onMounted, nextTick, watch, onUnmounted } from 'vue'
+import DeptTree2 from "@/views/pms/iotrhdailyreport/DeptTree2.vue";
 
 /** 瑞鹰日报 列表 */
 defineOptions({ name: 'IotRyDailyReport' })
@@ -213,6 +224,8 @@ const { t } = useI18n() // 国际化
 // 添加 selectedRowData 响应式变量
 const selectedRowData = ref<Record<string, any> | null>(null)
 
+const rootDeptId = ref(158)
+
 const loading = ref(true) // 列表的加载中
 const list = ref<IotRyDailyReportVO[]>([]) // 列表的数据
 const total = ref(0) // 列表的总页数
@@ -544,6 +557,16 @@ const handleDelete = async (id: number) => {
   } catch {}
 }
 
+// 响应式变量存储选中的部门
+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 handleExport = async () => {
   try {

+ 225 - 202
src/views/pms/iotrydailyreport/xjindex.vue

@@ -1,214 +1,224 @@
 <template>
-  <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"
-        />
-      </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-rh-daily-report:create']"
-        >
-          <Icon icon="ep:plus" class="mr-5px" /> 新增
-        </el-button>
-        <el-button
-          type="success"
-          plain
-          @click="handleExport"
-          :loading="exportLoading"
-          v-hasPermi="['pms:iot-rh-daily-report:export']"
+  <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"
         >
-          <Icon icon="ep:download" class="mr-5px" /> 导出
-        </el-button>
-      </el-form-item>
-    </el-form>
-  </ContentWrap>
-
-  <ContentWrap class="mb-15px">
-    <div class="color-legend">
-      <div class="legend-item">
-        <span class="color-indicator red"></span>
-        <span>运行时效=生产时间/额定生产时间&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;超过100%红色预警</span>
-      </div>
-      <div class="legend-item">
-        <span class="color-indicator orange"></span>
-        <span>生产时间+非生产时间=额定生产时间&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;否则橙色预警</span>
-      </div>
-    </div>
-  </ContentWrap>
-
-  <!-- 列表 -->
-  <ContentWrap ref="tableContainerRef">
-    <div class="table-container">
-      <el-table ref="tableRef" v-loading="loading" :data="list" :stripe="true"
-                style="width: 100%" :cell-style="cellStyle">
-        <el-table-column :label="t('iotDevice.serial')" width="70" align="center">
-          <template #default="scope">
-            {{ scope.$index + 1 }}
-          </template>
-        </el-table-column>
-        <el-table-column
-          label="日期"
-          align="center"
-          prop="createTime"
-          :formatter="dateFormatter2"
-          :width="columnWidths.createTime"
-        />
-        <el-table-column label="施工队伍" align="center" prop="deptName" :width="columnWidths.deptName"/>
-        <el-table-column label="项目" align="center" prop="contractName" :width="columnWidths.contractName"/>
-        <el-table-column label="任务" align="center" prop="taskName" :width="columnWidths.taskName"/>
-        <el-table-column :label="t('project.status')" align="center" prop="rigStatus" :width="columnWidths.rigStatus">
-          <template #default="scope">
-            <dict-tag :type="DICT_TYPE.PMS_PROJECT_TASK_RY_SCHEDULE" :value="scope.row.rigStatus" />
-          </template>
-        </el-table-column>
-
-        <!--
-        <el-table-column label="上井次完井时间" align="center" prop="latestWellDoneTime" :width="columnWidths.latestWellDoneTime" :formatter="dateFormatter2"/>
-        <el-table-column label="设计井深(m)" align="center" prop="designWellDepth" :width="columnWidths.designWellDepth"/>
-        <el-table-column label="当前井深(m)" align="center" prop="currentDepth" :width="columnWidths.currentDepth" />
-        <el-table-column label="日进尺(m)" align="center" prop="dailyFootage" :width="columnWidths.dailyFootage" />
-        <el-table-column label="月进尺(m)" align="center" prop="monthlyFootage" :width="columnWidths.monthlyFootage"/>
-        <el-table-column label="年累计进尺(m)" align="center" prop="annualFootage" :width="columnWidths.annualFootage"/> -->
-        <el-table-column label="总施工井数" align="center" prop="totalConstructionWells" :width="columnWidths.totalConstructionWells"/>
-        <el-table-column label="完工井数" align="center" prop="completedWells" :width="columnWidths.completedWells"/>
-        <el-table-column :label="t('project.technology')" align="center" prop="technique" :width="columnWidths.technique">
-          <template #default="scope">
-            <dict-tag :type="DICT_TYPE.PMS_PROJECT_RY_TECHNOLOGY" :value="scope.row.technique" />
-          </template>
-        </el-table-column>
-        <el-table-column label="井别" align="center" prop="wellCategory" :width="columnWidths.wellCategory"/>
-        <el-table-column label="井深(m)" align="center" prop="designWellDepth" :width="columnWidths.designWellDepth"/>
-        <el-table-column label="套生段产管尺寸(mm)" align="center" prop="casingPipeSize" :width="columnWidths.casingPipeSize"/>
-        <el-table-column label="井控级别" align="center" prop="wellControlLevel" :width="columnWidths.wellControlLevel"/>
-        <!--
-        <el-table-column label="泥浆性能-密度(g/cm³)" align="center" prop="mudDensity" :width="columnWidths.mudDensity"/>
-        <el-table-column label="泥浆性能-粘度(S)" align="center" prop="mudViscosity" :width="columnWidths.mudViscosity"/> -->
-        <el-table-column
-          label="施工开始日期"
-          align="center"
-          prop="constructionStartDate"
-          :formatter="dateFormatter"
-          :width="columnWidths.constructionStartDate"
-        />
-        <el-table-column
-          label="施工结束日期"
-          align="center"
-          prop="constructionEndDate"
-          :formatter="dateFormatter"
-          :width="columnWidths.constructionEndDate"
-        />
-        <!--
-        <el-table-column label="水平段长度(m)" align="center" prop="lateralLength" :width="columnWidths.lateralLength" />
-        <el-table-column label="井斜(°)" align="center" prop="wellInclination" :width="columnWidths.wellInclination"/>
-        <el-table-column label="方位(°)" align="center" prop="azimuth" :width="columnWidths.azimuth"/>
-        <el-table-column label="设计井身结构" align="center" :width="columnWidths.designWellStruct" fixed-width>
-          <template #default="scope">
-            <el-tooltip
-              effect="light"
-              :content="scope.row.designWellStruct"
-              placement="top"
-              popper-class="design-well-struct-tooltip"
-              :disabled="!scope.row.designWellStruct || scope.row.designWellStruct.length <= 30"
-            >
-              <span class="design-well-struct-text">{{ formatDesignWellStruct(scope.row.designWellStruct) }}</span>
-            </el-tooltip>
-          </template>
-        </el-table-column> -->
-        <el-table-column label="目前工序" align="center" prop="currentOperation" :width="columnWidths.currentOperation"/>
-        <el-table-column label="下部工序" align="center" prop="nextPlan" :width="columnWidths.nextPlan"/>
-        <el-table-column label="运行时效" align="center" prop="transitTime" :width="columnWidths.transitTime" :formatter="percentageFormatter"/>
-        <el-table-column label="额定生产时间(H)" align="center" prop="ratedProductionTime" :width="columnWidths.ratedProductionTime"/>
-        <el-table-column label="生产时间(H)" align="center" prop="productionTime" :width="columnWidths.productionTime"/>
-        <el-table-column label="非生产时间(H)" align="center" prop="nonProductionTime" :width="columnWidths.nonProductionTime"/>
-        <el-table-column :label="t('project.nptReason')" align="center" prop="ryNptReason" :width="columnWidths.ryNptReason">
-          <template #default="scope">
-            <dict-tag :type="DICT_TYPE.PMS_PROJECT_RY_NPT_REASON" :value="scope.row.ryNptReason" />
-          </template>
-        </el-table-column>
-        <el-table-column label="生产动态" align="center" :width="columnWidths.productionStatus" fixed-width>
-          <template #default="scope">
-            <el-tooltip
-              effect="light"
-              :content="scope.row.productionStatus"
-              placement="top"
-              popper-class="design-well-struct-tooltip"
-              :disabled="!scope.row.productionStatus || scope.row.productionStatus.length <= 30"
-            >
-              <span class="design-well-struct-text">{{ formatDesignWellStruct(scope.row.productionStatus) }}</span>
-            </el-tooltip>
-          </template>
-        </el-table-column>
-        <el-table-column label="操作" align="center" :width="columnWidths.operation" fixed="right">
-          <template #default="scope">
+          <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"
+            />
+          </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
-              link
               type="primary"
-              @click="openForm('update', scope.row.id, scope.row)"
-              v-hasPermi="['pms:iot-rh-daily-report:update']"
+              plain
+              @click="openForm('create')"
+              v-hasPermi="['pms:iot-rh-daily-report:create']"
             >
-              编辑
+              <Icon icon="ep:plus" class="mr-5px" /> 新增
             </el-button>
             <el-button
-              link
-              type="danger"
-              @click="handleDelete(scope.row.id)"
-              v-hasPermi="['pms:iot-rh-daily-report:delete']"
+              type="success"
+              plain
+              @click="handleExport"
+              :loading="exportLoading"
+              v-hasPermi="['pms:iot-rh-daily-report:export']"
             >
-              删除
+              <Icon icon="ep:download" class="mr-5px" /> 导出
             </el-button>
-          </template>
-        </el-table-column>
-      </el-table>
-    </div>
-    <!-- 分页 -->
-    <Pagination
-      :total="total"
-      v-model:page="queryParams.pageNo"
-      v-model:limit="queryParams.pageSize"
-      @pagination="getList"
-    />
-  </ContentWrap>
-
-  <!-- 表单弹窗:添加/修改 -->
-  <IotRyDailyReportForm ref="formRef" @success="getList" :row-data="selectedRowData"/>
+          </el-form-item>
+        </el-form>
+      </ContentWrap>
+
+      <ContentWrap class="mb-15px">
+        <div class="color-legend">
+          <div class="legend-item">
+            <span class="color-indicator red"></span>
+            <span>运行时效=生产时间/额定生产时间&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;超过100%红色预警</span>
+          </div>
+          <div class="legend-item">
+            <span class="color-indicator orange"></span>
+            <span>生产时间+非生产时间=额定生产时间&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;否则橙色预警</span>
+          </div>
+        </div>
+      </ContentWrap>
+
+      <!-- 列表 -->
+      <ContentWrap ref="tableContainerRef">
+        <div class="table-container">
+          <el-table ref="tableRef" v-loading="loading" :data="list" :stripe="true"
+                    style="width: 100%" :cell-style="cellStyle">
+            <el-table-column :label="t('iotDevice.serial')" width="70" align="center">
+              <template #default="scope">
+                {{ scope.$index + 1 }}
+              </template>
+            </el-table-column>
+            <el-table-column
+              label="日期"
+              align="center"
+              prop="createTime"
+              :formatter="dateFormatter2"
+              :width="columnWidths.createTime"
+            />
+            <el-table-column label="施工队伍" align="center" prop="deptName" :width="columnWidths.deptName"/>
+            <el-table-column label="项目" align="center" prop="contractName" :width="columnWidths.contractName"/>
+            <el-table-column label="任务" align="center" prop="taskName" :width="columnWidths.taskName"/>
+            <el-table-column :label="t('project.status')" align="center" prop="rigStatus" :width="columnWidths.rigStatus">
+              <template #default="scope">
+                <dict-tag :type="DICT_TYPE.PMS_PROJECT_TASK_RY_SCHEDULE" :value="scope.row.rigStatus" />
+              </template>
+            </el-table-column>
+
+            <!--
+            <el-table-column label="上井次完井时间" align="center" prop="latestWellDoneTime" :width="columnWidths.latestWellDoneTime" :formatter="dateFormatter2"/>
+            <el-table-column label="设计井深(m)" align="center" prop="designWellDepth" :width="columnWidths.designWellDepth"/>
+            <el-table-column label="当前井深(m)" align="center" prop="currentDepth" :width="columnWidths.currentDepth" />
+            <el-table-column label="日进尺(m)" align="center" prop="dailyFootage" :width="columnWidths.dailyFootage" />
+            <el-table-column label="月进尺(m)" align="center" prop="monthlyFootage" :width="columnWidths.monthlyFootage"/>
+            <el-table-column label="年累计进尺(m)" align="center" prop="annualFootage" :width="columnWidths.annualFootage"/> -->
+            <el-table-column label="总施工井数" align="center" prop="totalConstructionWells" :width="columnWidths.totalConstructionWells"/>
+            <el-table-column label="完工井数" align="center" prop="completedWells" :width="columnWidths.completedWells"/>
+            <el-table-column :label="t('project.technology')" align="center" prop="technique" :width="columnWidths.technique">
+              <template #default="scope">
+                <dict-tag :type="DICT_TYPE.PMS_PROJECT_RY_TECHNOLOGY" :value="scope.row.technique" />
+              </template>
+            </el-table-column>
+            <el-table-column label="井别" align="center" prop="wellCategory" :width="columnWidths.wellCategory"/>
+            <el-table-column label="井深(m)" align="center" prop="designWellDepth" :width="columnWidths.designWellDepth"/>
+            <el-table-column label="套生段产管尺寸(mm)" align="center" prop="casingPipeSize" :width="columnWidths.casingPipeSize"/>
+            <el-table-column label="井控级别" align="center" prop="wellControlLevel" :width="columnWidths.wellControlLevel"/>
+            <!--
+            <el-table-column label="泥浆性能-密度(g/cm³)" align="center" prop="mudDensity" :width="columnWidths.mudDensity"/>
+            <el-table-column label="泥浆性能-粘度(S)" align="center" prop="mudViscosity" :width="columnWidths.mudViscosity"/> -->
+            <el-table-column
+              label="施工开始日期"
+              align="center"
+              prop="constructionStartDate"
+              :formatter="dateFormatter"
+              :width="columnWidths.constructionStartDate"
+            />
+            <el-table-column
+              label="施工结束日期"
+              align="center"
+              prop="constructionEndDate"
+              :formatter="dateFormatter"
+              :width="columnWidths.constructionEndDate"
+            />
+            <!--
+            <el-table-column label="水平段长度(m)" align="center" prop="lateralLength" :width="columnWidths.lateralLength" />
+            <el-table-column label="井斜(°)" align="center" prop="wellInclination" :width="columnWidths.wellInclination"/>
+            <el-table-column label="方位(°)" align="center" prop="azimuth" :width="columnWidths.azimuth"/>
+            <el-table-column label="设计井身结构" align="center" :width="columnWidths.designWellStruct" fixed-width>
+              <template #default="scope">
+                <el-tooltip
+                  effect="light"
+                  :content="scope.row.designWellStruct"
+                  placement="top"
+                  popper-class="design-well-struct-tooltip"
+                  :disabled="!scope.row.designWellStruct || scope.row.designWellStruct.length <= 30"
+                >
+                  <span class="design-well-struct-text">{{ formatDesignWellStruct(scope.row.designWellStruct) }}</span>
+                </el-tooltip>
+              </template>
+            </el-table-column> -->
+            <el-table-column label="目前工序" align="center" prop="currentOperation" :width="columnWidths.currentOperation"/>
+            <el-table-column label="下部工序" align="center" prop="nextPlan" :width="columnWidths.nextPlan"/>
+            <el-table-column label="运行时效" align="center" prop="transitTime" :width="columnWidths.transitTime" :formatter="percentageFormatter"/>
+            <el-table-column label="额定生产时间(H)" align="center" prop="ratedProductionTime" :width="columnWidths.ratedProductionTime"/>
+            <el-table-column label="生产时间(H)" align="center" prop="productionTime" :width="columnWidths.productionTime"/>
+            <el-table-column label="非生产时间(H)" align="center" prop="nonProductionTime" :width="columnWidths.nonProductionTime"/>
+            <el-table-column :label="t('project.nptReason')" align="center" prop="ryNptReason" :width="columnWidths.ryNptReason">
+              <template #default="scope">
+                <dict-tag :type="DICT_TYPE.PMS_PROJECT_RY_NPT_REASON" :value="scope.row.ryNptReason" />
+              </template>
+            </el-table-column>
+            <el-table-column label="生产动态" align="center" :width="columnWidths.productionStatus" fixed-width>
+              <template #default="scope">
+                <el-tooltip
+                  effect="light"
+                  :content="scope.row.productionStatus"
+                  placement="top"
+                  popper-class="design-well-struct-tooltip"
+                  :disabled="!scope.row.productionStatus || scope.row.productionStatus.length <= 30"
+                >
+                  <span class="design-well-struct-text">{{ formatDesignWellStruct(scope.row.productionStatus) }}</span>
+                </el-tooltip>
+              </template>
+            </el-table-column>
+            <el-table-column label="操作" align="center" :width="columnWidths.operation" fixed="right">
+              <template #default="scope">
+                <el-button
+                  link
+                  type="primary"
+                  @click="openForm('update', scope.row.id, scope.row)"
+                  v-hasPermi="['pms:iot-rh-daily-report:update']"
+                >
+                  编辑
+                </el-button>
+                <el-button
+                  link
+                  type="danger"
+                  @click="handleDelete(scope.row.id)"
+                  v-hasPermi="['pms:iot-rh-daily-report:delete']"
+                >
+                  删除
+                </el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+        <!-- 分页 -->
+        <Pagination
+          :total="total"
+          v-model:page="queryParams.pageNo"
+          v-model:limit="queryParams.pageSize"
+          @pagination="getList"
+        />
+      </ContentWrap>
+
+      <!-- 表单弹窗:添加/修改 -->
+      <IotRyDailyReportForm ref="formRef" @success="getList" :row-data="selectedRowData"/>
+    </el-col>
+  </el-row>
+
 </template>
 
 <script setup lang="ts">
@@ -218,6 +228,7 @@ import { IotRyDailyReportApi, IotRyDailyReportVO } from '@/api/pms/iotrydailyrep
 import IotRyDailyReportForm from './IotRyDailyReportForm.vue'
 import {DICT_TYPE, getDictLabel} from "@/utils/dict";
 import { ref, reactive, onMounted, nextTick, watch, onUnmounted } from 'vue'
+import DeptTree2 from "@/views/pms/iotrhdailyreport/DeptTree2.vue";
 
 /** 瑞鹰日报 列表 */
 defineOptions({ name: 'IotRyXjDailyReport' })
@@ -274,6 +285,8 @@ const queryParams = reactive({
 const queryFormRef = ref() // 搜索的表单
 const exportLoading = ref(false) // 导出的加载中
 
+const rootDeptId = ref(158)
+
 // 表格引用
 const tableRef = ref()
 // 表格容器引用
@@ -631,6 +644,16 @@ const handleDelete = async (id: number) => {
   } catch {}
 }
 
+// 响应式变量存储选中的部门
+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 handleExport = async () => {
   try {