Kaynağa Gözat

feat(blockingData): 添加筛选参数传递和漏检物品树形选择功能

- 在各模块组件中添加filterParams参数接收
- 将漏检物品输入框改为树形选择组件
- 重构筛选参数结构,使用标准ID字段
- 添加API接口文件支持数据大屏功能
huoyi 1 ay önce
ebeveyn
işleme
d62c6c7aeb

+ 382 - 0
src/api/blockingData/blockingDataScreen.js

@@ -0,0 +1,382 @@
1
+import request from '@/utils/request'
2
+
3
+
4
+//查询查堵总数
5
+export function totalCount(query) {
6
+    return request({
7
+        url: '/blocked/dashboard/totalCount',
8
+        method: 'get',
9
+        params: query
10
+    })
11
+}
12
+
13
+// 查询查堵总数柱状图
14
+export function brigadeChart(query) {
15
+    return request({
16
+        url: '/blocked/dashboard/brigadeChart',
17
+        method: 'get',
18
+        params: query
19
+    })
20
+}
21
+
22
+//查询总查堵万分率
23
+export function totalRate(query) {
24
+    return request({
25
+        url: '/blocked/dashboard/totalRate',
26
+        method: 'get',
27
+        params: query
28
+    })
29
+}
30
+//查询查堵万分率条形图
31
+export function brigadeRateChart(query) {
32
+    return request({
33
+        url: '/blocked/dashboard/brigadeRateChart',
34
+        method: 'get',
35
+        params: query
36
+    })
37
+}
38
+//每日查堵数量(总表)
39
+export function dailyTrend(query) {
40
+    return request({
41
+        url: '/blocked/dashboard/dailyTrend',
42
+        method: 'get',
43
+        params: query
44
+    })
45
+}
46
+//每日查堵数量(大队对比)
47
+export function dailyBrigadeComparison(query) {
48
+    return request({
49
+        url: '/blocked/dashboard/dailyBrigadeComparison',
50
+        method: 'get',
51
+        params: query
52
+    })
53
+}
54
+//每日查堵万分率(总表)
55
+export function dailyRateTrend(query) {
56
+    return request({
57
+        url: '/blocked/dashboard/dailyRateTrend',
58
+        method: 'get',
59
+        params: query
60
+    })
61
+}
62
+//每日查堵万分率(大队对比)
63
+export function dailyBrigadeRateComparison(query) {
64
+    return request({
65
+        url: '/blocked/dashboard/dailyBrigadeRateComparison',
66
+        method: 'get',
67
+        params: query
68
+    })
69
+}
70
+//每日过检图像数(行检+旅检总表)
71
+export function dailyLuggageTrend(query) {
72
+    return request({
73
+        url: '/blocked/dashboard/dailyLuggageTrend',
74
+        method: 'get',
75
+        params: query
76
+    })
77
+}
78
+
79
+//每日过检图像数(行检+旅检 大队对比)
80
+export function dailyBrigadeLuggageComparison(query) {
81
+    return request({
82
+        url: '/blocked/dashboard/dailyBrigadeLuggageComparison',
83
+        method: 'get',
84
+        params: query
85
+    })
86
+}
87
+//查堵物品分布
88
+export function itemDistribution(query) {
89
+    return request({
90
+        url: '/blocked/dashboard/itemDistribution',
91
+        method: 'get',
92
+        params: query
93
+    })
94
+}
95
+//区域查堵数量分布
96
+export function areaDistribution(query) {
97
+    return request({
98
+        url: '/blocked/dashboard/areaDistribution',
99
+        method: 'get',
100
+        params: query
101
+    })
102
+}
103
+//查堵类型分布
104
+export function discriminationDistribution(query) {
105
+    return request({
106
+        url: '/blocked/dashboard/discriminationDistribution',
107
+        method: 'get',
108
+        params: query
109
+    })
110
+}
111
+//查堵时间段过检行李数及万分率
112
+export function timePeriodStats(query) {
113
+    return request({
114
+        url: '/blocked/dashboard/timePeriodStats',
115
+        method: 'get',
116
+        params: query
117
+    })
118
+}
119
+//每日过检行李数及万分率
120
+export function dailyLuggageAndRate(query) {
121
+    return request({
122
+        url: '/blocked/dashboard/dailyLuggageAndRate',
123
+        method: 'get',
124
+        params: query
125
+    })
126
+}
127
+//查堵-AI复查图像总数
128
+export function aiImageStats(query) {
129
+    return request({
130
+        url: '/blocked/dashboard/aiImageStats',
131
+        method: 'get',
132
+        params: query
133
+    })
134
+}
135
+//查堵-AI漏判图像总数
136
+export function aiMissImageStats(query) {
137
+    return request({
138
+        url: '/blocked/dashboard/aiMissImageStats',
139
+        method: 'get',
140
+        params: query
141
+    })
142
+}
143
+//查堵-AI误判图像总数
144
+export function aiErrorImageStats(query) {
145
+    return request({
146
+        url: '/blocked/dashboard/aiErrorImageStats',
147
+        method: 'get',
148
+        params: query
149
+    })
150
+}
151
+//查堵-主管排行榜
152
+export function supervisorRanking(query) {
153
+    return request({
154
+        url: '/blocked/dashboard/supervisorRanking',
155
+        method: 'get',
156
+        params: query
157
+    })
158
+}
159
+//查堵-班组排行榜
160
+export function teamLeaderRanking(query) {
161
+    return request({
162
+        url: '/blocked/dashboard/teamLeaderRanking',
163
+        method: 'get',
164
+        params: query
165
+    })
166
+}
167
+//查堵-人员排行榜
168
+export function reviewedUserRanking(query) {
169
+    return request({
170
+        url: '/blocked/dashboard/reviewedUserRanking',
171
+        method: 'get',
172
+        params: query
173
+    })
174
+}
175
+//查堵-物品位置分布
176
+export function itemLocationDistribution(query) {
177
+    return request({
178
+        url: '/blocked/dashboard/itemLocationDistribution',
179
+        method: 'get',
180
+        params: query
181
+    })
182
+}
183
+//查堵-原因分类分布
184
+export function missCheckReasonDistribution(query) {
185
+    return request({
186
+        url: '/blocked/dashboard/missCheckReasonDistribution',
187
+        method: 'get',
188
+        params: query
189
+    })
190
+}
191
+//查堵-图像难易程度分布
192
+export function difficultyDistribution(query) {
193
+    return request({
194
+        url: '/blocked/dashboard/difficultyDistribution',
195
+        method: 'get',
196
+        params: query
197
+    })
198
+}
199
+//查堵-开机人员持证比例
200
+export function certificateDistribution(query) {
201
+    return request({
202
+        url: '/blocked/dashboard/certificateDistribution',
203
+        method: 'get',
204
+        params: query
205
+    })
206
+}
207
+//大队开机人员证书分布
208
+export function brigadeCertificateDistribution(query) {
209
+    return request({
210
+        url: '/blocked/dashboard/brigadeCertificateDistribution',
211
+        method: 'get',
212
+        params: query
213
+    })
214
+}
215
+//T1速率统计数据
216
+export function t1RateStats(query) {
217
+    return request({
218
+        url: '/blocked/rate/screen/t1',
219
+        method: 'get',
220
+        params: query
221
+    })
222
+}
223
+//T2速率统计数据
224
+export function t2RateStats(query) {
225
+    return request({
226
+        url: '/blocked/rate/screen/t2',
227
+        method: 'get',
228
+        params: query
229
+    })
230
+}
231
+//国内速率统计数据
232
+export function insideRateStats(query) {
233
+    return request({
234
+        url: '/blocked/rate/screen/domestic',
235
+        method: 'get',
236
+        params: query
237
+    })
238
+}
239
+//国际速率统计数据
240
+export function outsideRateStats(query) {
241
+    return request({
242
+        url: '/blocked/rate/screen/international',
243
+        method: 'get',
244
+        params: query
245
+    })
246
+}
247
+//查询两楼每日查堵走势
248
+export function dailyTerminalTrend(query) {
249
+    return request({
250
+        url: '/blocked/dashboard/brigade/dailyTerminalTrend',
251
+        method: 'get',
252
+        params: query
253
+    })
254
+}
255
+//查询两楼每日过检图像数
256
+export function dailyTerminalLuggageTrend(query) {
257
+    return request({
258
+        url: '/blocked/dashboard/brigade/dailyTerminalLuggageTrend',
259
+        method: 'get',
260
+        params: query
261
+    })
262
+}
263
+//查询两楼查堵数(包含行检)
264
+export function terminalBlockedStats(query) {
265
+    return request({
266
+        url: '/blocked/dashboard/brigade/terminalBlockedStats',
267
+        method: 'get',
268
+        params: query
269
+    })
270
+}
271
+//查询查堵时间段过检行李数
272
+export function timePeriodLuggageStats(query) {
273
+    return request({
274
+        url: '/blocked/dashboard/brigade/timePeriodLuggageStats',
275
+        method: 'get',
276
+        params: query
277
+    })
278
+}
279
+//查询两楼每日查堵万分率
280
+export function dailyTerminalRateTrend(query) {
281
+    return request({
282
+        url: '/blocked/dashboard/brigade/dailyTerminalRateTrend',
283
+        method: 'get',
284
+        params: query
285
+    })
286
+}
287
+//查询查堵物品分布
288
+export function brigadeItemDistribution(query) {
289
+    return request({
290
+        url: '/blocked/dashboard/brigade/itemDistribution',
291
+        method: 'get',
292
+        params: query
293
+    })
294
+}
295
+//查堵-主管排行榜
296
+export function brigadeSupervisorRanking(query) {
297
+    return request({
298
+        url: '/blocked/dashboard/brigade/supervisorRanking',
299
+        method: 'get',
300
+        params: query
301
+    })
302
+}
303
+//查堵-班组排行榜
304
+export function brigadeTeamLeaderRanking(query) {
305
+    return request({
306
+        url: '/blocked/dashboard/brigade/teamLeaderRanking',
307
+        method: 'get',
308
+        params: query
309
+    })
310
+}
311
+//查堵-人员排行榜
312
+export function brigadeReviewedUserRanking(query) {
313
+    return request({
314
+        url: '/blocked/dashboard/brigade/reviewedUserRanking',
315
+        method: 'get',
316
+        params: query
317
+    })
318
+}
319
+//查询查堵男女比例
320
+export function brigadeGenderDistribution(query) {
321
+    return request({
322
+        url: '/blocked/dashboard/brigade/genderDistribution',
323
+        method: 'get',
324
+        params: query
325
+    })
326
+}
327
+//查询查堵人员证书级别分布
328
+export function brigadeCertificateDistributionDetail(query) {
329
+    return request({
330
+        url: '/blocked/dashboard/brigade/certificateLevelDistribution',
331
+        method: 'get',
332
+        params: query
333
+    })
334
+}
335
+//查询证书级别人员基数
336
+export function personnelCertificateBase(query) {
337
+    return request({
338
+        url: '/blocked/dashboard/brigade/personnelCertificateBase',
339
+        method: 'get',
340
+        params: query
341
+    })
342
+}
343
+//查询查堵物品位置分布
344
+export function brigadeItemLocationDistribution(query) {
345
+    return request({
346
+        url: '/blocked/dashboard/brigade/itemLocationDistribution',
347
+        method: 'get',
348
+        params: query
349
+    })
350
+}
351
+//查询查堵-简单/困难图像数
352
+export function brigadeDifficultyDistribution(query) {
353
+    return request({
354
+        url: '/blocked/dashboard/brigade/difficultyDistribution',
355
+        method: 'get',
356
+        params: query
357
+    })
358
+}
359
+//查询查堵-主管分管次数分布
360
+export function brigadeSupervisorDistribution(query) {
361
+    return request({
362
+        url: '/blocked/dashboard/brigade/supervisorDistribution',
363
+        method: 'get',
364
+        params: query
365
+    })
366
+}
367
+//查询查堵原因分类分布
368
+export function brigadeMissCheckReasonDistribution(query) {
369
+    return request({
370
+        url: '/blocked/dashboard/brigade/missCheckReasonDistribution',
371
+        method: 'get',
372
+        params: query
373
+    })
374
+}
375
+//查询查堵人员开机年限分布
376
+export function brigadeOperatingYearsDistribution(query) {
377
+    return request({
378
+        url: '/blocked/dashboard/brigade/operatingYearsDistribution',
379
+        method: 'get',
380
+        params: query
381
+    })
382
+}

+ 8 - 0
src/views/blockingData/blockingDataScreen/components/ModuleBrigadeOne.vue

@@ -52,6 +52,14 @@ import * as echarts from 'echarts'
52
 import ModuleContainer from './ModuleContainer.vue'
52
 import ModuleContainer from './ModuleContainer.vue'
53
 import { useEcharts } from '@/hooks/chart.js'
53
 import { useEcharts } from '@/hooks/chart.js'
54
 
54
 
55
+// 接收筛选参数
56
+const props = defineProps({
57
+  filterParams: {
58
+    type: Object,
59
+    default: () => ({})
60
+  }
61
+})
62
+
55
 const chart1 = ref(null)
63
 const chart1 = ref(null)
56
 const chart2 = ref(null)
64
 const chart2 = ref(null)
57
 const chart3 = ref(null)
65
 const chart3 = ref(null)

+ 8 - 0
src/views/blockingData/blockingDataScreen/components/ModuleBrigadeThree.vue

@@ -21,6 +21,14 @@ import * as echarts from 'echarts'
21
 import ModuleContainer from './ModuleContainer.vue'
21
 import ModuleContainer from './ModuleContainer.vue'
22
 import { useEcharts } from '@/hooks/chart.js'
22
 import { useEcharts } from '@/hooks/chart.js'
23
 
23
 
24
+// 接收筛选参数
25
+const props = defineProps({
26
+  filterParams: {
27
+    type: Object,
28
+    default: () => ({})
29
+  }
30
+})
31
+
24
 const chart1 = ref(null)
32
 const chart1 = ref(null)
25
 const chart2 = ref(null)
33
 const chart2 = ref(null)
26
 
34
 

+ 8 - 0
src/views/blockingData/blockingDataScreen/components/ModuleBrigadeTwo.vue

@@ -84,6 +84,14 @@ import ModuleContainer from './ModuleContainer.vue'
84
 import RankList from './RankList.vue'
84
 import RankList from './RankList.vue'
85
 import { useEcharts } from '@/hooks/chart.js'
85
 import { useEcharts } from '@/hooks/chart.js'
86
 
86
 
87
+// 接收筛选参数
88
+const props = defineProps({
89
+  filterParams: {
90
+    type: Object,
91
+    default: () => ({})
92
+  }
93
+})
94
+
87
 const chart4 = ref(null)
95
 const chart4 = ref(null)
88
 const chart5 = ref(null)
96
 const chart5 = ref(null)
89
 const chart6 = ref(null)
97
 const chart6 = ref(null)

+ 8 - 0
src/views/blockingData/blockingDataScreen/components/ModuleFour.vue

@@ -31,6 +31,14 @@ import * as echarts from 'echarts'
31
 import ModuleContainer from './ModuleContainer.vue'
31
 import ModuleContainer from './ModuleContainer.vue'
32
 import { useEcharts } from '@/hooks/chart.js'
32
 import { useEcharts } from '@/hooks/chart.js'
33
 
33
 
34
+// 接收筛选参数
35
+const props = defineProps({
36
+  filterParams: {
37
+    type: Object,
38
+    default: () => ({})
39
+  }
40
+})
41
+
34
 const chart1 = ref(null)
42
 const chart1 = ref(null)
35
 const chart2 = ref(null)
43
 const chart2 = ref(null)
36
 const chart3 = ref(null)
44
 const chart3 = ref(null)

+ 8 - 0
src/views/blockingData/blockingDataScreen/components/ModuleOne.vue

@@ -130,6 +130,14 @@ import * as echarts from 'echarts'
130
 import ModuleContainer from './ModuleContainer.vue'
130
 import ModuleContainer from './ModuleContainer.vue'
131
 import { useEcharts } from '@/hooks/chart.js'
131
 import { useEcharts } from '@/hooks/chart.js'
132
 
132
 
133
+// 接收筛选参数
134
+const props = defineProps({
135
+  filterParams: {
136
+    type: Object,
137
+    default: () => ({})
138
+  }
139
+})
140
+
133
 // 图表引用
141
 // 图表引用
134
 const chart0a = ref(null)
142
 const chart0a = ref(null)
135
 const chart0b = ref(null)
143
 const chart0b = ref(null)

+ 8 - 0
src/views/blockingData/blockingDataScreen/components/ModuleThree.vue

@@ -19,6 +19,14 @@ import * as echarts from 'echarts'
19
 import ModuleContainer from './ModuleContainer.vue'
19
 import ModuleContainer from './ModuleContainer.vue'
20
 import { useEcharts } from '@/hooks/chart.js'
20
 import { useEcharts } from '@/hooks/chart.js'
21
 
21
 
22
+// 接收筛选参数
23
+const props = defineProps({
24
+  filterParams: {
25
+    type: Object,
26
+    default: () => ({})
27
+  }
28
+})
29
+
22
 const chart1 = ref(null)
30
 const chart1 = ref(null)
23
 const chart2 = ref(null)
31
 const chart2 = ref(null)
24
 
32
 

+ 8 - 0
src/views/blockingData/blockingDataScreen/components/ModuleTwo.vue

@@ -63,6 +63,14 @@ import ModuleContainer from './ModuleContainer.vue'
63
 import RankList from './RankList.vue'
63
 import RankList from './RankList.vue'
64
 import { useEcharts } from '@/hooks/chart.js'
64
 import { useEcharts } from '@/hooks/chart.js'
65
 
65
 
66
+// 接收筛选参数
67
+const props = defineProps({
68
+  filterParams: {
69
+    type: Object,
70
+    default: () => ({})
71
+  }
72
+})
73
+
66
 const chart1 = ref(null)
74
 const chart1 = ref(null)
67
 const chart2 = ref(null)
75
 const chart2 = ref(null)
68
 const chart3 = ref(null)
76
 const chart3 = ref(null)

+ 115 - 59
src/views/blockingData/blockingDataScreen/index.vue

@@ -15,39 +15,40 @@
15
 
15
 
16
         <div class="filter-item">
16
         <div class="filter-item">
17
           <span class="filter-label">分管主管:</span>
17
           <span class="filter-label">分管主管:</span>
18
-          <el-select v-model="filterParams.supervisor" placeholder="请选择主管" filterable clearable style="width: 200px">
18
+          <el-select v-model="filterParams.supervisorId" placeholder="请选择主管" filterable clearable style="width: 200px">
19
             <el-option v-for="item in supervisorOptions" :key="item.value" :label="item.label" :value="item.value" />
19
             <el-option v-for="item in supervisorOptions" :key="item.value" :label="item.label" :value="item.value" />
20
           </el-select>
20
           </el-select>
21
         </div>
21
         </div>
22
 
22
 
23
         <div class="filter-item">
23
         <div class="filter-item">
24
           <span class="filter-label">分管班组长:</span>
24
           <span class="filter-label">分管班组长:</span>
25
-          <el-select v-model="filterParams.teamLeader" placeholder="请选择班组长" filterable clearable style="width: 200px">
25
+          <el-select v-model="filterParams.teamLeaderId" placeholder="请选择班组长" filterable clearable style="width: 200px">
26
             <el-option v-for="item in teamLeaderOptions" :key="item.value" :label="item.label" :value="item.value" />
26
             <el-option v-for="item in teamLeaderOptions" :key="item.value" :label="item.label" :value="item.value" />
27
           </el-select>
27
           </el-select>
28
         </div>
28
         </div>
29
         <div class="filter-item">
29
         <div class="filter-item">
30
-          <span class="filter-label">区域:</span>
31
-          <el-select v-model="filterParams.area" placeholder="请选择区域" clearable style="width: 200px">
32
-            <el-option label="整体" value="整体" />
33
-            <el-option label="T1" value="T1" />
34
-            <el-option label="T2" value="T2" />
30
+          <span class="filter-label">航站楼:</span>
31
+          <el-select v-model="filterParams.terminal" placeholder="请选择区域" clearable style="width: 200px">
32
+            <el-option v-for="item in terminalOptions" :key="item.value" :label="item.label" :value="item.value" />
35
           </el-select>
33
           </el-select>
36
         </div>
34
         </div>
37
 
35
 
38
         <div class="filter-item">
36
         <div class="filter-item">
39
           <span class="filter-label">漏检物品:</span>
37
           <span class="filter-label">漏检物品:</span>
40
-          <el-select v-model="filterParams.missedItem" placeholder="请选择漏检物品" clearable style="width: 200px">
41
-            <el-option v-for="item in missedItemOptions" :key="item.value" :label="item.label" :value="item.value" />
42
-          </el-select>
38
+          <el-tree-select
39
+            v-model="filterParams.missCheckItem"
40
+            :data="missedItemOptions"
41
+            :props="{ value: 'id', label: 'name', children: 'children' }"
42
+            value-key="id"
43
+            placeholder="请选择漏检物品"
44
+            check-strictly
45
+            style="width: 200px"
46
+          />
43
         </div>
47
         </div>
44
         <div class="filter-item">
48
         <div class="filter-item">
45
           <span class="filter-label">分大队:</span>
49
           <span class="filter-label">分大队:</span>
46
-          <el-select v-model="filterParams.brigade" placeholder="请选择大队" clearable style="width: 200px">
47
-            <el-option label="全站" value="全站" />
48
-            <el-option label="安检一大队" value="安检一大队" />
49
-            <el-option label="安检二大队" value="安检二大队" />
50
-            <el-option label="安检三大队" value="安检三大队" />
50
+          <el-select v-model="filterParams.brigadeId" placeholder="请选择大队" clearable style="width: 200px">
51
+            <el-option v-for="item in brigadeOptions" :key="item.value" :label="item.label" :value="item.value" />
51
           </el-select>
52
           </el-select>
52
         </div>
53
         </div>
53
         <div class="filter-actions">
54
         <div class="filter-actions">
@@ -60,29 +61,29 @@
60
     </div>
61
     </div>
61
 
62
 
62
     <div class="screen-content">
63
     <div class="screen-content">
63
-      <div v-if="filterParams.brigade === '全站'" class="grid-layout">
64
+      <div v-if="filterParams.brigadeId" class="grid-layout">
64
         <div class="grid-item">
65
         <div class="grid-item">
65
-          <module-one />
66
+          <module-one :filter-params="filterParams" />
66
         </div>
67
         </div>
67
         <div class="grid-item">
68
         <div class="grid-item">
68
-          <module-two />
69
+          <module-two :filter-params="filterParams" />
69
         </div>
70
         </div>
70
         <div class="grid-item">
71
         <div class="grid-item">
71
-          <module-three />
72
+          <module-three :filter-params="filterParams" />
72
         </div>
73
         </div>
73
         <div class="grid-item">
74
         <div class="grid-item">
74
-          <module-four />
75
+          <module-four :filter-params="filterParams" />
75
         </div>
76
         </div>
76
       </div>
77
       </div>
77
       <div v-else class="grid-layout">
78
       <div v-else class="grid-layout">
78
         <div class="grid-item">
79
         <div class="grid-item">
79
-          <module-brigade-one />
80
+          <module-brigade-one :filter-params="filterParams" />
80
         </div>
81
         </div>
81
         <div class="grid-item">
82
         <div class="grid-item">
82
-          <module-brigade-two />
83
+          <module-brigade-two :filter-params="filterParams" />
83
         </div>
84
         </div>
84
         <div class="grid-item">
85
         <div class="grid-item">
85
-          <module-brigade-three />
86
+          <module-brigade-three :filter-params="filterParams" />
86
         </div>
87
         </div>
87
       </div>
88
       </div>
88
     </div>
89
     </div>
@@ -92,6 +93,9 @@
92
 <script setup>
93
 <script setup>
93
 import { ref, reactive, onMounted } from 'vue'
94
 import { ref, reactive, onMounted } from 'vue'
94
 import { listDept } from '@/api/system/dept'
95
 import { listDept } from '@/api/system/dept'
96
+import { selectUserLeaderListByCondition } from '@/api/system/user'
97
+import { listCategory } from '@/api/system/category'
98
+import { listPosition } from '@/api/system/position'
95
 import ModuleOne from './components/ModuleOne.vue'
99
 import ModuleOne from './components/ModuleOne.vue'
96
 import ModuleTwo from './components/ModuleTwo.vue'
100
 import ModuleTwo from './components/ModuleTwo.vue'
97
 import ModuleThree from './components/ModuleThree.vue'
101
 import ModuleThree from './components/ModuleThree.vue'
@@ -109,43 +113,91 @@ const defaultTime = [
109
 // 筛选参数
113
 // 筛选参数
110
 const filterParams = reactive({
114
 const filterParams = reactive({
111
   dateRange: [],
115
   dateRange: [],
112
-  supervisor: '',
113
-  teamLeader: '',
114
-  area: '',
115
-  missedItem: '',
116
-  brigade: '全站'
116
+  supervisorId: '',
117
+  teamLeaderId: '',
118
+  terminal: '',
119
+  missCheckItem: '',
120
+  brigadeId: '全站'
117
 })
121
 })
118
 
122
 
119
 // 选项数据
123
 // 选项数据
120
 const supervisorOptions = ref([])
124
 const supervisorOptions = ref([])
121
 const teamLeaderOptions = ref([])
125
 const teamLeaderOptions = ref([])
122
-const missedItemOptions = ref([
123
-  { label: '物品A', value: '1' },
124
-  { label: '物品B', value: '2' },
125
-  { label: '物品C', value: '3' }
126
-])
127
-
128
-// 获取所有用户数据并筛选主管和班组长
129
-const fetchUserData = async () => {
130
-  try {
131
-    listDept({}).then(response => {
132
-      const deptList = response.data || []
133
-     
134
-      teamLeaderOptions.value = deptList.filter(item => item.deptType === 'TEAMS').map(item => ({
135
-        value: item.deptId,
136
-        label: item.deptName
137
-      }))
138
-      supervisorOptions.value = deptList.filter(item => item.deptType === 'MANAGER').map(item => ({
139
-        value: item.deptId,
140
-        label: item.deptName
141
-      }))
142
-    })
143
-  } catch (error) {
144
-    console.error('获取用户数据失败:', error)
145
-  }
126
+const brigadeOptions = ref([])
127
+const missedItemOptions = ref([])
128
+const terminalOptions = ref([])
129
+
130
+// 获取漏检物品树状选项
131
+function getMissedItemOptions() {
132
+  listCategory().then(response => {
133
+    missedItemOptions.value = handleTree(response.data, "id", "parentId")
134
+  })
135
+}
136
+
137
+// 树形数据处理函数
138
+function handleTree(data, id, parentId) {
139
+  const result = []
140
+  const map = {}
141
+  
142
+  data.forEach(item => {
143
+    map[item[id]] = { ...item, children: [] }
144
+  })
145
+  
146
+  data.forEach(item => {
147
+    const parent = map[item[parentId]]
148
+    if (parent) {
149
+      parent.children.push(map[item[id]])
150
+    } else {
151
+      result.push(map[item[id]])
152
+    }
153
+  })
154
+  
155
+  return result
156
+}
157
+
158
+// 获取航站楼选项
159
+function getTerminalOptions() {
160
+  listPosition({ positionType: 'TERMINL' }).then(response => {
161
+    terminalOptions.value = (response.data || []).map(item => ({
162
+      value: item.id,
163
+      label: item.name
164
+    }))
165
+    // 添加"整体"选项到最前面
166
+    terminalOptions.value.unshift({ label: '整体', value: null })
167
+  })
168
+}
169
+function getTeamLeaderOptions() {
170
+  selectUserLeaderListByCondition({ roleKeyList: ['banzuzhang'] }).then(response => {
171
+    teamLeaderOptions.value = (response.data || []).map(item => ({
172
+      value: item.userId,
173
+      label: item.nickName
174
+    }))
175
+  })
146
 }
176
 }
147
 
177
 
148
-// 设置默认日期范围(从年初1月1日到现在)
178
+// 获取主管选项
179
+function getSupervisorOptions() {
180
+  selectUserLeaderListByCondition({ roleKeyList: ['kezhang'] }).then(response => {
181
+    supervisorOptions.value = (response.data || []).map(item => ({
182
+      value: item.userId,
183
+      label: item.nickName
184
+    }))
185
+  })
186
+}
187
+
188
+// 获取大队选项
189
+function getBrigadeOptions() {
190
+  listDept({}).then(response => {
191
+    const deptList = response.data || []
192
+    // 筛选类型为 BRIGADE 的部门,并过滤特定的大队ID
193
+    brigadeOptions.value = deptList.filter(item => item.deptType === 'BRIGADE' && [311, 314, 315].includes(item.deptId)).map(item => ({
194
+      value: item.deptId,
195
+      label: item.deptName
196
+    }))
197
+    // 添加"全站"选项到最前面
198
+    brigadeOptions.value.unshift({ label: '全站', value: null })
199
+  })
200
+}
149
 const setDefaultDateRange = () => {
201
 const setDefaultDateRange = () => {
150
   const now = new Date()
202
   const now = new Date()
151
   const startOfYear = new Date(now.getFullYear(), 0, 1, 0, 0, 0)
203
   const startOfYear = new Date(now.getFullYear(), 0, 1, 0, 0, 0)
@@ -164,11 +216,11 @@ const handleFilter = () => {
164
 const resetFilter = () => {
216
 const resetFilter = () => {
165
   Object.assign(filterParams, {
217
   Object.assign(filterParams, {
166
     dateRange: [],
218
     dateRange: [],
167
-    supervisor: '',
168
-    teamLeader: '',
169
-    area: '',
170
-    missedItem: '',
171
-    brigade: '全站'
219
+    supervisorId: '',
220
+    teamLeaderId: '',
221
+    terminal: '',
222
+    missCheckItem: '',
223
+    brigadeId: '全站'
172
   })
224
   })
173
   setDefaultDateRange()
225
   setDefaultDateRange()
174
 }
226
 }
@@ -176,7 +228,11 @@ const resetFilter = () => {
176
 // 组件挂载时设置默认日期和获取用户数据
228
 // 组件挂载时设置默认日期和获取用户数据
177
 onMounted(() => {
229
 onMounted(() => {
178
   setDefaultDateRange()
230
   setDefaultDateRange()
179
-  fetchUserData()
231
+  getTeamLeaderOptions()
232
+  getSupervisorOptions()
233
+  getBrigadeOptions()
234
+  getMissedItemOptions()
235
+  getTerminalOptions()
180
 })
236
 })
181
 </script>
237
 </script>
182
 
238
 

+ 19 - 2
src/views/blockingData/missedInspectionList/index.vue

@@ -163,7 +163,15 @@
163
           </el-col>
163
           </el-col>
164
           <el-col :span="12">
164
           <el-col :span="12">
165
             <el-form-item label="漏检物品" prop="missCheckItem">
165
             <el-form-item label="漏检物品" prop="missCheckItem">
166
-              <el-input v-model="form.missCheckItem" placeholder="请输入漏检物品" />
166
+              <el-tree-select
167
+                v-model="form.missCheckItem"
168
+                :data="missCheckItemOptions"
169
+                :props="{ value: 'name', label: 'name', children: 'children' }"
170
+                value-key="name"
171
+                placeholder="请选择漏检物品"
172
+                check-strictly
173
+                style="width: 100%"
174
+              />
167
             </el-form-item>
175
             </el-form-item>
168
           </el-col>
176
           </el-col>
169
 
177
 
@@ -335,6 +343,7 @@ import { listPosition } from '@/api/system/position'
335
 import { listMissedInspection, getMissedInspection, delMissedInspection, addMissedInspection, updateMissedInspection, exportMissedInspection, downloadTemplate } from '@/api/blockingData/missedInspection'
343
 import { listMissedInspection, getMissedInspection, delMissedInspection, addMissedInspection, updateMissedInspection, exportMissedInspection, downloadTemplate } from '@/api/blockingData/missedInspection'
336
 import { listDept } from '@/api/system/dept'
344
 import { listDept } from '@/api/system/dept'
337
 import { listUser, selectUserLeaderListByCondition } from '@/api/system/user'
345
 import { listUser, selectUserLeaderListByCondition } from '@/api/system/user'
346
+import { listCategory } from '@/api/system/category'
338
 import { useDict } from '@/utils/dict'
347
 import { useDict } from '@/utils/dict'
339
 import { getToken } from '@/utils/auth'
348
 import { getToken } from '@/utils/auth'
340
 import { UploadFilled } from '@element-plus/icons-vue'
349
 import { UploadFilled } from '@element-plus/icons-vue'
@@ -361,6 +370,8 @@ const title = ref('')
361
 const open = ref(false)
370
 const open = ref(false)
362
 // 日期范围
371
 // 日期范围
363
 const dateRange = ref([])
372
 const dateRange = ref([])
373
+// 漏检物品树状选项
374
+const missCheckItemOptions = ref([])
364
 
375
 
365
 const upload = reactive({
376
 const upload = reactive({
366
   open: false,
377
   open: false,
@@ -481,7 +492,12 @@ function getDeptList() {
481
   })
492
   })
482
 }
493
 }
483
 
494
 
484
-/** 获取班组长选项 */
495
+/** 获取漏检物品树状选项 */
496
+function getMissCheckItemOptions() {
497
+  listCategory().then(response => {
498
+    missCheckItemOptions.value = proxy.handleTree(response.data, "id", "parentId")
499
+  })
500
+}
485
 function getTeamLeaderOptions() {
501
 function getTeamLeaderOptions() {
486
   selectUserLeaderListByCondition({ roleKeyList: ['banzuzhang'] }).then(response => {
502
   selectUserLeaderListByCondition({ roleKeyList: ['banzuzhang'] }).then(response => {
487
     teamLeaderOptions.value = (response.data || []).map(item => ({
503
     teamLeaderOptions.value = (response.data || []).map(item => ({
@@ -743,6 +759,7 @@ onMounted(() => {
743
   getPositionList()
759
   getPositionList()
744
   getTeamLeaderOptions()
760
   getTeamLeaderOptions()
745
   getSupervisorOptions()
761
   getSupervisorOptions()
762
+  getMissCheckItemOptions()
746
 })
763
 })
747
 </script>
764
 </script>
748
 
765