|
|
@@ -15,20 +15,19 @@
|
|
15
|
15
|
</el-form-item>
|
|
16
|
16
|
<el-form-item label="队室/班组" prop="teamId">
|
|
17
|
17
|
<el-select v-model="queryParams.teamId" placeholder="请选择队室/班组" style="width:150px" clearable filterable
|
|
18
|
|
- :disabled="queryParams.org < 2" @change="handleQueryTeamChange">
|
|
|
18
|
+ @change="handleQueryTeamChange">
|
|
19
|
19
|
<el-option v-for="t in queryTeamOptions" :key="t.id" :label="t.label" :value="t.id" />
|
|
20
|
20
|
</el-select>
|
|
21
|
21
|
</el-form-item>
|
|
22
|
22
|
<el-form-item label="通道/小组" prop="groupId">
|
|
23
|
23
|
<el-select v-model="queryParams.groupId" placeholder="请选择通道/小组" style="width:150px" clearable filterable
|
|
24
|
|
- :disabled="queryParams.org < 3" @change="handleQueryGroupChange">
|
|
|
24
|
+ @change="handleQueryGroupChange">
|
|
25
|
25
|
<el-option v-for="g in queryGroupOptions" :key="g.id" :label="g.label" :value="g.id" />
|
|
26
|
26
|
</el-select>
|
|
27
|
27
|
</el-form-item>
|
|
28
|
28
|
<el-form-item label="责任人" prop="personId">
|
|
29
|
|
- <el-select v-model="queryParams.personId" placeholder="请选择责任人" style="width:150px" clearable filterable
|
|
30
|
|
- :disabled="queryParams.org < 4">
|
|
31
|
|
- <el-option v-for="p in queryPersonOptions" :key="p.userId" :label="p.nickName" :value="p.userId" />
|
|
|
29
|
+ <el-select v-model="queryParams.personId" placeholder="请选择责任人" style="width:150px" clearable filterable>
|
|
|
30
|
+ <el-option v-for="p in searchPersonOptions" :key="p.userId" :label="p.nickName" :value="p.userId" />
|
|
32
|
31
|
</el-select>
|
|
33
|
32
|
</el-form-item>
|
|
34
|
33
|
<el-form-item label="维度" prop="dimensionId">
|
|
|
@@ -188,7 +187,7 @@
|
|
188
|
187
|
<el-col :span="12">
|
|
189
|
188
|
<el-form-item label="部门名称" prop="deptId" :rules="rules.deptId">
|
|
190
|
189
|
<el-select v-model="form.deptId" placeholder="请选择部门" style="width:100%" clearable filterable
|
|
191
|
|
- @change="handleBrigadeChange">
|
|
|
190
|
+ @change="handleBrigadeChange">
|
|
192
|
191
|
<el-option v-for="d in deptOptions" :key="d.deptId" :label="d.deptName" :value="d.deptId" />
|
|
193
|
192
|
</el-select>
|
|
194
|
193
|
</el-form-item>
|
|
|
@@ -196,7 +195,7 @@
|
|
196
|
195
|
<el-col :span="12">
|
|
197
|
196
|
<el-form-item label="队室/班组" prop="teamId" :rules="rules.teamId">
|
|
198
|
197
|
<el-select v-model="form.teamId" placeholder="请选择队室/班组" style="width:100%" clearable filterable
|
|
199
|
|
- @change="handleDepartmentChange">
|
|
|
198
|
+ @change="handleDepartmentChange">
|
|
200
|
199
|
<el-option v-for="t in teamOptions" :key="t.id" :label="t.label" :value="t.id" />
|
|
201
|
200
|
</el-select>
|
|
202
|
201
|
</el-form-item>
|
|
|
@@ -212,7 +211,7 @@
|
|
212
|
211
|
<el-col :span="12">
|
|
213
|
212
|
<el-form-item label="责任人" prop="personId" :rules="rules.personId">
|
|
214
|
213
|
<el-select v-model="form.personId" placeholder="请选择责任人" style="width:100%" clearable filterable
|
|
215
|
|
- @change="handlePersonChange">
|
|
|
214
|
+ @change="handlePersonChange">
|
|
216
|
215
|
<el-option v-for="p in personOptions" :key="p.userId" :label="p.nickName" :value="p.userId" />
|
|
217
|
216
|
</el-select>
|
|
218
|
217
|
</el-form-item>
|
|
|
@@ -248,8 +247,9 @@
|
|
248
|
247
|
</template>
|
|
249
|
248
|
|
|
250
|
249
|
<script setup>
|
|
251
|
|
-import { ref, reactive, computed, onMounted, getCurrentInstance } from 'vue'
|
|
|
250
|
+import { ref, reactive, computed, watch, onMounted, getCurrentInstance } from 'vue'
|
|
252
|
251
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
252
|
+import { useRoute } from 'vue-router'
|
|
253
|
253
|
import { listUser, getDeptOrgInfo, getUserOrgInfo } from '@/api/system/user'
|
|
254
|
254
|
import {
|
|
255
|
255
|
listScoreEvent, addScoreEvent, updateScoreEvent, delScoreEvent,
|
|
|
@@ -298,7 +298,13 @@ const rules = computed(() => {
|
|
298
|
298
|
}
|
|
299
|
299
|
})
|
|
300
|
300
|
|
|
301
|
|
-
|
|
|
301
|
+// 搜索表单责任人选项:未选择部门/班组/小组时使用全量人员,否则使用过滤后的人员
|
|
|
302
|
+const searchPersonOptions = computed(() => {
|
|
|
303
|
+ if (queryParams.deptId || queryParams.teamId || queryParams.groupId) {
|
|
|
304
|
+ return queryPersonOptions.value
|
|
|
305
|
+ }
|
|
|
306
|
+ return personOptions.value
|
|
|
307
|
+})
|
|
302
|
308
|
|
|
303
|
309
|
async function loadDimensions() {
|
|
304
|
310
|
const r = await allDimension()
|
|
|
@@ -580,5 +586,24 @@ async function handleImportFile(file) {
|
|
580
|
586
|
}
|
|
581
|
587
|
}
|
|
582
|
588
|
|
|
583
|
|
-onMounted(() => { loadDimensions(); loadDepts(); loadQueryDepts(); getList() })
|
|
|
589
|
+const route = useRoute()
|
|
|
590
|
+
|
|
|
591
|
+let isInit = true
|
|
|
592
|
+
|
|
|
593
|
+// 监听路由参数,从员工画像跳转时回填查询条件
|
|
|
594
|
+watch(() => route.query, (query) => {
|
|
|
595
|
+ if (query.id) {
|
|
|
596
|
+ queryParams.personId = Number(query.id)
|
|
|
597
|
+ }
|
|
|
598
|
+ if (query.startDate && query.endDate) {
|
|
|
599
|
+ dateRange.value = [query.startDate, query.endDate]
|
|
|
600
|
+ }
|
|
|
601
|
+ // 非初始化时(即路由参数后续变化),主动刷新数据
|
|
|
602
|
+ if (!isInit && (query.id || query.startDate || query.endDate)) {
|
|
|
603
|
+ handleQuery()
|
|
|
604
|
+ }
|
|
|
605
|
+ isInit = false
|
|
|
606
|
+}, { immediate: true })
|
|
|
607
|
+
|
|
|
608
|
+onMounted(() => { loadDimensions(); loadDepts(); loadQueryDepts(); loadAllPersons(); getList() })
|
|
584
|
609
|
</script>
|