Просмотр исходного кода

fix(performanceSearch): 调整查询条件逻辑和表格列显示

修复主管查询和班组查询的参数传递问题,优化表格列的动态显示条件
huoyi недель назад: 4
Родитель
Сommit
19ac8ed053
1 измененных файлов с 8 добавлено и 12 удалено
  1. 8 12
      src/views/performanceManage/performanceSearch/index.vue

+ 8 - 12
src/views/performanceManage/performanceSearch/index.vue

@@ -38,7 +38,7 @@
38 38
         </el-form-item>
39 39
         
40 40
         <!-- 主管下拉框 -->
41
-        <el-form-item label="主管" prop="deptId" v-if="queryType === '2' || queryType === '1'">
41
+        <el-form-item label="主管" prop="deptId" v-if="queryType === '3' || queryType === '2' || queryType === '1'">
42 42
           <el-select v-model="queryParams.deptId" placeholder="请选择主管" clearable style="width: 200px"
43 43
             @change="handleQuery">
44 44
             <el-option v-for="item in departmentOptions" :key="item.value" :label="item.text" :value="item.value" />
@@ -46,7 +46,7 @@
46 46
         </el-form-item>
47 47
         
48 48
         <!-- 班组下拉框 -->
49
-        <el-form-item label="班组" prop="teamId" v-if="queryType === '1'">
49
+        <el-form-item label="班组" prop="teamId" v-if="queryType === '2' || queryType === '1'">
50 50
           <el-select v-model="queryParams.teamId" placeholder="请选择班组" clearable style="width: 200px"
51 51
             @change="handleQuery">
52 52
             <el-option v-for="item in teamOptions" :key="item.value" :label="item.text" :value="item.value" />
@@ -73,8 +73,8 @@
73 73
       <el-table v-loading="loading" :data="performanceList" border fit highlight-current-row
74 74
         style="width: 100%; margin-top: 20px;">
75 75
        <!-- 动态列 -->
76
-        <el-table-column v-if="queryType === '4'" label="主管"
77
-          prop="name" align="center" min-width="120" />
76
+        <el-table-column v-if="queryType === '4'||queryType === '3'" label="大队"
77
+          :prop="queryType === '4'?'name':'brigadeName'" align="center" min-width="120" />
78 78
         <!-- 动态列 -->
79 79
         <el-table-column v-if="queryType === '3' || queryType === '2' || queryType === '1'" label="主管"
80 80
           :prop="queryType === '3' ? 'name' : 'deptName'" align="center" min-width="120" />
@@ -349,13 +349,11 @@ const getList = async () => {
349 349
 
350 350
     // 根据查询类型清理不必要的参数
351 351
     if (queryType.value === '3') {
352
-      // 主管查询:只传递大队参数
353
-      params.deptId = ''
352
+      // 主管查询:传递大队和主管参数
354 353
       params.teamId = ''
355 354
       params.userName = ''
356 355
     } else if (queryType.value === '2') {
357
-      // 班组查询:传递大队和主管参数
358
-      params.teamId = ''
356
+      // 班组查询:传递大队、主管和班组参数
359 357
       params.userName = ''
360 358
     } else if (queryType.value === '1') {
361 359
       // 个人查询:传递所有参数
@@ -406,13 +404,11 @@ const handleExport = () => {
406 404
 
407 405
     // 根据查询类型清理不必要的参数
408 406
     if (queryType.value === '3') {
409
-      // 主管查询:只传递大队参数
410
-      params.deptId = ''
407
+      // 主管查询:传递大队和主管参数
411 408
       params.teamId = ''
412 409
       params.userName = ''
413 410
     } else if (queryType.value === '2') {
414
-      // 班组查询:传递大队和主管参数
415
-      params.teamId = ''
411
+      // 班组查询:传递大队、主管和班组参数
416 412
       params.userName = ''
417 413
     } else if (queryType.value === '1') {
418 414
       // 个人查询:传递所有参数