Quellcode durchsuchen

pms 项目任务列表 添加 公司 搜索 条件

zhangcl vor 2 Tagen
Ursprung
Commit
a8010b4ba9
2 geänderte Dateien mit 42 neuen und 2 gelöschten Zeilen
  1. 20 0
      src/views/pms/iotprojectinfo/index.vue
  2. 22 2
      src/views/pms/iotprojecttask/index.vue

+ 20 - 0
src/views/pms/iotprojectinfo/index.vue

@@ -8,6 +8,21 @@
       :inline="true"
       label-width="68px"
     >
+      <el-form-item label="公司" prop="companyDeptId">
+        <el-select
+          v-model="queryParams.companyDeptId"
+          placeholder="请选择公司"
+          clearable
+          class="!w-240px"
+        >
+          <el-option
+            v-for="item in companyDeptList"
+            :key="item.id"
+            :label="item.name"
+            :value="item.id"
+          />
+        </el-select>
+      </el-form-item>
       <!--
       <el-form-item label="客户名称" prop="manufactureName">
         <el-input
@@ -318,6 +333,7 @@ const taskLoading = ref(false) // 任务列表的加载中
 const taskList = ref([]) // 任务列表的数据
 const selectedProject = ref(null) // 当前选中的项目
 const deptList = ref([]) // 部门列表
+const companyDeptList = ref<any[]>([])  // 在公司级部门列表
 const deviceMap = ref({}) // 设备映射表
 const responsiblePersonList = ref([]) // 责任人列表
 
@@ -346,6 +362,7 @@ const queryParams = reactive({
   pageNo: 1,
   pageSize: 10,
   deptId: undefined,
+  companyDeptId: undefined,
   deptName: undefined,
   contractName: undefined,
   contractCode: undefined,
@@ -923,6 +940,9 @@ let resizeObserver: ResizeObserver | null = null;
 
 /** 初始化 **/
 onMounted(async () => {
+  // 获取公司级的部门 用于 公司 筛选 管理员使用
+  companyDeptList.value = await DeptApi.companyLevelDepts()
+
   deptList.value = handleTree(await DeptApi.companyLevelChildrenDepts());
   getList()
   // 预加载任务进度字典

+ 22 - 2
src/views/pms/iotprojecttask/index.vue

@@ -8,6 +8,21 @@
       :inline="true"
       label-width="68px"
     >
+      <el-form-item label="公司" prop="companyId">
+        <el-select
+          v-model="queryParams.companyId"
+          placeholder="请选择公司"
+          clearable
+          class="!w-240px"
+        >
+          <el-option
+            v-for="item in companyDeptList"
+            :key="item.id"
+            :label="item.name"
+            :value="item.id"
+          />
+        </el-select>
+      </el-form-item>
       <el-form-item label="客户名称" prop="project_name">
         <el-input
           v-model="queryParams.projectId"
@@ -246,6 +261,7 @@ import dayjs from 'dayjs'
 import { DICT_TYPE, getIntDictOptions, getStrDictOptions } from '@/utils/dict'
 import { ref, reactive, onMounted, computed, nextTick, watch, onUnmounted } from 'vue'
 import { useRouter } from 'vue-router'
+import * as DeptApi from "@/api/system/dept"; // 引入部门API
 
 /** 项目信息任务拆分 列表 */
 defineOptions({ name: 'IotProjectTask' })
@@ -259,6 +275,7 @@ const total = ref(0) // 列表的总页数
 const queryParams = reactive({
   pageNo: 1,
   pageSize: 10,
+  companyId: undefined,
   projectId: undefined,
   wellName: undefined,
   wellType: undefined,
@@ -330,7 +347,7 @@ const planList = ref<Array<{id?: number, status: string, startTime: string, endT
 const saveLoading = ref(false)
 const currentRow = ref<IotProjectTaskVO | null>(null)
 const workProgressDictOptions = ref<any[]>([]) // 施工进度字典选项
-
+const companyDeptList = ref<any[]>([])  // 在公司级部门列表
 const wellTypeDictOptions = ref<any[]>([]) // 井型字典选项
 const technologyDictOptions = ref<any[]>([]) // 施工工艺字典选项
 
@@ -663,7 +680,10 @@ const handleExport = async () => {
 let resizeObserver: ResizeObserver | null = null;
 
 /** 初始化 **/
-onMounted(() => {
+onMounted(async () => {
+  // 获取公司级的部门 用于 公司 筛选 管理员使用
+  companyDeptList.value = await DeptApi.companyLevelDepts()
+
   getList()
   // 预加载字典数据
   getWorkProgressDictOptions()