|
|
@@ -15,39 +15,40 @@
|
|
15
|
15
|
|
|
16
|
16
|
<div class="filter-item">
|
|
17
|
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
|
19
|
<el-option v-for="item in supervisorOptions" :key="item.value" :label="item.label" :value="item.value" />
|
|
20
|
20
|
</el-select>
|
|
21
|
21
|
</div>
|
|
22
|
22
|
|
|
23
|
23
|
<div class="filter-item">
|
|
24
|
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
|
26
|
<el-option v-for="item in teamLeaderOptions" :key="item.value" :label="item.label" :value="item.value" />
|
|
27
|
27
|
</el-select>
|
|
28
|
28
|
</div>
|
|
29
|
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
|
33
|
</el-select>
|
|
36
|
34
|
</div>
|
|
37
|
35
|
|
|
38
|
36
|
<div class="filter-item">
|
|
39
|
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
|
47
|
</div>
|
|
44
|
48
|
<div class="filter-item">
|
|
45
|
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
|
52
|
</el-select>
|
|
52
|
53
|
</div>
|
|
53
|
54
|
<div class="filter-actions">
|
|
|
@@ -60,29 +61,29 @@
|
|
60
|
61
|
</div>
|
|
61
|
62
|
|
|
62
|
63
|
<div class="screen-content">
|
|
63
|
|
- <div v-if="filterParams.brigade === '全站'" class="grid-layout">
|
|
|
64
|
+ <div v-if="filterParams.brigadeId" class="grid-layout">
|
|
64
|
65
|
<div class="grid-item">
|
|
65
|
|
- <module-one />
|
|
|
66
|
+ <module-one :filter-params="filterParams" />
|
|
66
|
67
|
</div>
|
|
67
|
68
|
<div class="grid-item">
|
|
68
|
|
- <module-two />
|
|
|
69
|
+ <module-two :filter-params="filterParams" />
|
|
69
|
70
|
</div>
|
|
70
|
71
|
<div class="grid-item">
|
|
71
|
|
- <module-three />
|
|
|
72
|
+ <module-three :filter-params="filterParams" />
|
|
72
|
73
|
</div>
|
|
73
|
74
|
<div class="grid-item">
|
|
74
|
|
- <module-four />
|
|
|
75
|
+ <module-four :filter-params="filterParams" />
|
|
75
|
76
|
</div>
|
|
76
|
77
|
</div>
|
|
77
|
78
|
<div v-else class="grid-layout">
|
|
78
|
79
|
<div class="grid-item">
|
|
79
|
|
- <module-brigade-one />
|
|
|
80
|
+ <module-brigade-one :filter-params="filterParams" />
|
|
80
|
81
|
</div>
|
|
81
|
82
|
<div class="grid-item">
|
|
82
|
|
- <module-brigade-two />
|
|
|
83
|
+ <module-brigade-two :filter-params="filterParams" />
|
|
83
|
84
|
</div>
|
|
84
|
85
|
<div class="grid-item">
|
|
85
|
|
- <module-brigade-three />
|
|
|
86
|
+ <module-brigade-three :filter-params="filterParams" />
|
|
86
|
87
|
</div>
|
|
87
|
88
|
</div>
|
|
88
|
89
|
</div>
|
|
|
@@ -92,6 +93,9 @@
|
|
92
|
93
|
<script setup>
|
|
93
|
94
|
import { ref, reactive, onMounted } from 'vue'
|
|
94
|
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
|
99
|
import ModuleOne from './components/ModuleOne.vue'
|
|
96
|
100
|
import ModuleTwo from './components/ModuleTwo.vue'
|
|
97
|
101
|
import ModuleThree from './components/ModuleThree.vue'
|
|
|
@@ -109,43 +113,91 @@ const defaultTime = [
|
|
109
|
113
|
// 筛选参数
|
|
110
|
114
|
const filterParams = reactive({
|
|
111
|
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
|
124
|
const supervisorOptions = ref([])
|
|
121
|
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
|
201
|
const setDefaultDateRange = () => {
|
|
150
|
202
|
const now = new Date()
|
|
151
|
203
|
const startOfYear = new Date(now.getFullYear(), 0, 1, 0, 0, 0)
|
|
|
@@ -164,11 +216,11 @@ const handleFilter = () => {
|
|
164
|
216
|
const resetFilter = () => {
|
|
165
|
217
|
Object.assign(filterParams, {
|
|
166
|
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
|
225
|
setDefaultDateRange()
|
|
174
|
226
|
}
|
|
|
@@ -176,7 +228,11 @@ const resetFilter = () => {
|
|
176
|
228
|
// 组件挂载时设置默认日期和获取用户数据
|
|
177
|
229
|
onMounted(() => {
|
|
178
|
230
|
setDefaultDateRange()
|
|
179
|
|
- fetchUserData()
|
|
|
231
|
+ getTeamLeaderOptions()
|
|
|
232
|
+ getSupervisorOptions()
|
|
|
233
|
+ getBrigadeOptions()
|
|
|
234
|
+ getMissedItemOptions()
|
|
|
235
|
+ getTerminalOptions()
|
|
180
|
236
|
})
|
|
181
|
237
|
</script>
|
|
182
|
238
|
|