|
|
@@ -170,22 +170,23 @@
|
|
170
|
170
|
|
|
171
|
171
|
|
|
172
|
172
|
<!-- 编辑/新增弹窗 -->
|
|
173
|
|
- <el-dialog :title="dialog.title" v-model="dialog.visible" width="80%" :close-on-click-modal="false">
|
|
|
173
|
+ <el-dialog :title="dialog.title" v-model="dialog.visible" width="80%" :close-on-click-modal="false"
|
|
|
174
|
+ destroy-on-close>
|
|
174
|
175
|
<!-- 非干部表单 -->
|
|
175
|
176
|
<el-form v-if="dialog.type === 'non-cadre'" :model="nonCadreForm" ref="formRef" :rules="nonCadreRules"
|
|
176
|
|
- label-width="180px" class="form-container">
|
|
|
177
|
+ label-width="380px" class="form-container">
|
|
177
|
178
|
<!-- 第一部分:基础信息 -->
|
|
178
|
179
|
<el-row :gutter="20">
|
|
179
|
180
|
<el-col :span="8">
|
|
180
|
|
- <el-form-item label="姓名" prop="userName">
|
|
181
|
|
- <el-select v-model="nonCadreForm.userName" placeholder="请选择姓名" style="width: 100%" clearable filterable
|
|
|
181
|
+ <el-form-item label="姓名" prop="userId" label-width="100px">
|
|
|
182
|
+ <el-select v-model="nonCadreForm.userId" placeholder="请选择姓名" style="width: 100%" clearable filterable
|
|
182
|
183
|
@change="handleUserChange">
|
|
183
|
|
- <el-option v-for="user in userList" :key="user.userId" :label="user.userName" :value="user.userName" />
|
|
|
184
|
+ <el-option v-for="user in userList" :key="user.userId" :label="user.nickName" :value="user.userId" />
|
|
184
|
185
|
</el-select>
|
|
185
|
186
|
</el-form-item>
|
|
186
|
187
|
</el-col>
|
|
187
|
188
|
<el-col :span="8">
|
|
188
|
|
- <el-form-item label="考核月份" prop="assessmentMonth">
|
|
|
189
|
+ <el-form-item label="考核月份" prop="assessmentMonth" label-width="100px">
|
|
189
|
190
|
<el-date-picker v-model="nonCadreForm.assessmentMonth" type="month" placeholder="请选择考核月份"
|
|
190
|
191
|
value-format="YYYY-MM" style="width: 100%" />
|
|
191
|
192
|
</el-form-item>
|
|
|
@@ -201,23 +202,22 @@
|
|
201
|
202
|
|
|
202
|
203
|
<el-row :gutter="20">
|
|
203
|
204
|
<el-col :span="8">
|
|
204
|
|
- <el-form-item label="用工形式" prop="employmentType">
|
|
|
205
|
+ <el-form-item label="用工形式" prop="employmentType" label-width="100px">
|
|
205
|
206
|
<el-select v-model="nonCadreForm.employmentType" placeholder="请选择用工形式" style="width: 100%" disabled>
|
|
206
|
207
|
<el-option v-for="item in employment_type" :key="item.value" :label="item.label" :value="item.value" />
|
|
207
|
208
|
</el-select>
|
|
208
|
209
|
</el-form-item>
|
|
209
|
210
|
</el-col>
|
|
210
|
211
|
<el-col :span="8">
|
|
211
|
|
- <el-form-item label="角色" prop="roleName">
|
|
|
212
|
+ <el-form-item label="角色" prop="roleName" label-width="100px">
|
|
212
|
213
|
<el-input v-model="nonCadreForm.roleName" disabled placeholder="角色" />
|
|
213
|
214
|
</el-form-item>
|
|
214
|
215
|
</el-col>
|
|
215
|
216
|
<el-col :span="8">
|
|
216
|
|
- <el-form-item label="分管班组长" prop="deputyTeamLeaderName">
|
|
217
|
|
- <el-select v-model="nonCadreForm.deputyTeamLeaderName" placeholder="请选择分管班组长" style="width: 100%"
|
|
218
|
|
- clearable>
|
|
219
|
|
- <el-option v-for="leader in teamLeaderOptions" :key="leader.userId" :label="leader.userName"
|
|
220
|
|
- :value="leader.userName" />
|
|
|
217
|
+ <el-form-item label="分管班组长" prop="deputyTeamLeaderId" label-width="100px">
|
|
|
218
|
+ <el-select v-model="nonCadreForm.deputyTeamLeaderId" placeholder="请选择分管班组长" style="width: 100%" clearable>
|
|
|
219
|
+ <el-option v-for="leader in teamLeaderOptions" :key="leader.userId" :label="leader.nickName"
|
|
|
220
|
+ :value="leader.userId" />
|
|
221
|
221
|
</el-select>
|
|
222
|
222
|
</el-form-item>
|
|
223
|
223
|
</el-col>
|
|
|
@@ -227,28 +227,30 @@
|
|
227
|
227
|
|
|
228
|
228
|
<el-row :gutter="20">
|
|
229
|
229
|
<el-col :span="8">
|
|
230
|
|
- <el-form-item label="分管主管" prop="deputySupervisorName">
|
|
231
|
|
- <el-select v-model="nonCadreForm.deputySupervisorName" placeholder="请选择分管主管" style="width: 100%"
|
|
232
|
|
- clearable>
|
|
233
|
|
- <el-option v-for="supervisor in supervisorOptions" :key="supervisor.userId" :label="supervisor.userName"
|
|
234
|
|
- :value="supervisor.userName" />
|
|
|
230
|
+ <el-form-item label="分管主管" prop="deputySupervisorId" label-width="100px">
|
|
|
231
|
+ <el-select v-model="nonCadreForm.deputySupervisorId" placeholder="请选择分管主管" style="width: 100%" clearable>
|
|
|
232
|
+ <el-option v-for="supervisor in supervisorOptions" :key="supervisor.userId" :label="supervisor.nickName"
|
|
|
233
|
+ :value="supervisor.userId" />
|
|
235
|
234
|
</el-select>
|
|
236
|
235
|
</el-form-item>
|
|
237
|
236
|
</el-col>
|
|
238
|
237
|
<el-col :span="8">
|
|
239
|
|
- <el-form-item label="分管经理" prop="deputyManagerName">
|
|
240
|
|
- <el-input v-model="nonCadreForm.deputyManagerName" placeholder="请输入分管经理" />
|
|
|
238
|
+ <el-form-item label="分管经理" prop="deputyManagerId" label-width="100px">
|
|
|
239
|
+ <el-select v-model="nonCadreForm.deputyManagerId" placeholder="请选择分管经理" style="width: 100%" clearable>
|
|
|
240
|
+ <el-option v-for="manager in managerOptions" :key="manager.userId" :label="manager.nickName"
|
|
|
241
|
+ :value="manager.userId" />
|
|
|
242
|
+ </el-select>
|
|
241
|
243
|
</el-form-item>
|
|
242
|
244
|
</el-col>
|
|
243
|
245
|
<el-col :span="8">
|
|
244
|
|
- <el-form-item label="考核组" prop="assessmentTeam">
|
|
|
246
|
+ <el-form-item label="考核组" prop="assessmentTeam" label-width="100px">
|
|
245
|
247
|
<el-select v-model="nonCadreForm.assessmentTeam" placeholder="请选择考核组" style="width: 100%">
|
|
246
|
248
|
<el-option v-for="item in assessment_team" :key="item.value" :label="item.label" :value="item.value" />
|
|
247
|
249
|
</el-select>
|
|
248
|
250
|
</el-form-item>
|
|
249
|
251
|
</el-col>
|
|
250
|
252
|
<el-col :span="8">
|
|
251
|
|
- <el-form-item label="岗位" prop="post">
|
|
|
253
|
+ <el-form-item label="岗位" prop="post" label-width="100px">
|
|
252
|
254
|
<el-select v-model="nonCadreForm.post" placeholder="请选择岗位" style="width: 100%">
|
|
253
|
255
|
<el-option v-for="item in post" :key="item.value" :label="item.label" :value="item.value" />
|
|
254
|
256
|
</el-select>
|
|
|
@@ -262,11 +264,11 @@
|
|
262
|
264
|
<div v-for="(group, groupIndex) in nonCadreForm.indicatorGroups" :key="groupIndex" class="indicator-group">
|
|
263
|
265
|
<div class="indicator-group-title">{{ group.title }}</div>
|
|
264
|
266
|
<div v-for="(item, itemIndex) in group.items" :key="itemIndex" class="indicator-item">
|
|
265
|
|
- <div class="indicator-name">{{ item.name }}</div>
|
|
|
267
|
+ <div class="indicator-name">{{ item.indicatorName }}</div>
|
|
266
|
268
|
<div class="indicator-value">{{ item.score }}/次</div>
|
|
267
|
|
- <div class="indicator-count">{{ item.count }}次</div>
|
|
268
|
|
- <div class="indicator-source">{{ item.source }}</div>
|
|
269
|
|
- <div class="indicator-total">{{ item.total }}</div>
|
|
|
269
|
+ <div class="indicator-count">{{ item.occurCount }}次</div>
|
|
|
270
|
+ <div class="indicator-qcDeptType">{{ item.qcDeptType }}</div>
|
|
|
271
|
+ <div class="indicator-total">{{ item.scoreResult }}</div>
|
|
270
|
272
|
<div class="indicator-actions">
|
|
271
|
273
|
<el-button type="primary" link icon="Edit" @click="editIndicator(groupIndex, itemIndex)"></el-button>
|
|
272
|
274
|
<el-button type="danger" link icon="Delete" @click="deleteIndicator(groupIndex, itemIndex)"></el-button>
|
|
|
@@ -286,8 +288,9 @@
|
|
286
|
288
|
</el-col>
|
|
287
|
289
|
<el-col :span="12">
|
|
288
|
290
|
<el-form-item label="红线指标依据">
|
|
289
|
|
- <span class="detail-link" @click="showDetailModal('红线指标依据', nonCadreForm.redLineBasis)">
|
|
290
|
|
- {{ nonCadreForm.redLineBasis || '查看详情' }}
|
|
|
291
|
+ <span class="detail-link"
|
|
|
292
|
+ @click="showDetailModal('红线指标依据', formatAccordList(nonCadreForm.redLineIndexAccordList))">
|
|
|
293
|
+ {{ formatAccordList(nonCadreForm.redLineIndexAccordList) || '查看详情' }}
|
|
291
|
294
|
</span>
|
|
292
|
295
|
</el-form-item>
|
|
293
|
296
|
</el-col>
|
|
|
@@ -301,8 +304,9 @@
|
|
301
|
304
|
</el-col>
|
|
302
|
305
|
<el-col :span="12">
|
|
303
|
306
|
<el-form-item label="核心指标依据">
|
|
304
|
|
- <span class="detail-link" @click="showDetailModal('核心指标依据', nonCadreForm.coreIndicatorBasis)">
|
|
305
|
|
- {{ nonCadreForm.coreIndicatorBasis || '查看详情' }}
|
|
|
307
|
+ <span class="detail-link"
|
|
|
308
|
+ @click="showDetailModal('核心指标依据', formatAccordList(nonCadreForm.coreIndexAccordList))">
|
|
|
309
|
+ {{ formatAccordList(nonCadreForm.coreIndexAccordList) || '查看详情' }}
|
|
306
|
310
|
</span>
|
|
307
|
311
|
</el-form-item>
|
|
308
|
312
|
</el-col>
|
|
|
@@ -316,8 +320,9 @@
|
|
316
|
320
|
</el-col>
|
|
317
|
321
|
<el-col :span="12">
|
|
318
|
322
|
<el-form-item label="其他指标中的安全指标(仅含SOC/站品控检查扣分)依据">
|
|
319
|
|
- <span class="detail-link" @click="showDetailModal('其他指标中的安全指标依据', nonCadreForm.safetyWithSocBasis)">
|
|
320
|
|
- {{ nonCadreForm.safetyWithSocBasis || '查看详情' }}
|
|
|
323
|
+ <span class="detail-link"
|
|
|
324
|
+ @click="showDetailModal('其他指标中的安全指标依据', formatAccordList(nonCadreForm.otherIndexSafetyScoreWithSocStationQcAccordList))">
|
|
|
325
|
+ {{ formatAccordList(nonCadreForm.otherIndexSafetyScoreWithSocStationQcAccordList) || '查看详情' }}
|
|
321
|
326
|
</span>
|
|
322
|
327
|
</el-form-item>
|
|
323
|
328
|
</el-col>
|
|
|
@@ -331,8 +336,9 @@
|
|
331
|
336
|
</el-col>
|
|
332
|
337
|
<el-col :span="12">
|
|
333
|
338
|
<el-form-item label="其他指标中的非安全指标依据">
|
|
334
|
|
- <span class="detail-link" @click="showDetailModal('其他指标中的非安全指标依据', nonCadreForm.nonSafetyIndicatorBasis)">
|
|
335
|
|
- {{ nonCadreForm.nonSafetyIndicatorBasis || '查看详情' }}
|
|
|
339
|
+ <span class="detail-link"
|
|
|
340
|
+ @click="showDetailModal('其他指标中的非安全指标依据', formatAccordList(nonCadreForm.otherIndexNonSafetyAccordList))">
|
|
|
341
|
+ {{ formatAccordList(nonCadreForm.otherIndexNonSafetyAccordList) || '查看详情' }}
|
|
336
|
342
|
</span>
|
|
337
|
343
|
</el-form-item>
|
|
338
|
344
|
</el-col>
|
|
|
@@ -346,8 +352,9 @@
|
|
346
|
352
|
</el-col>
|
|
347
|
353
|
<el-col :span="12">
|
|
348
|
354
|
<el-form-item label="SOC/站品控检查的涉及核心、安全指标扣分依据">
|
|
349
|
|
- <span class="detail-link" @click="showDetailModal('SOC/站品控检查的涉及核心、安全指标扣分依据', nonCadreForm.socSafetyCoreDeductionBasis)">
|
|
350
|
|
- {{ nonCadreForm.socSafetyCoreDeductionBasis || '查看详情' }}
|
|
|
355
|
+ <span class="detail-link"
|
|
|
356
|
+ @click="showDetailModal('SOC/站品控检查的涉及核心、安全指标扣分依据', formatAccordList(nonCadreForm.socStationQcInvolvedCoreSafetyAccordList))">
|
|
|
357
|
+ {{ formatAccordList(nonCadreForm.socStationQcInvolvedCoreSafetyAccordList) || '查看详情' }}
|
|
351
|
358
|
</span>
|
|
352
|
359
|
</el-form-item>
|
|
353
|
360
|
</el-col>
|
|
|
@@ -382,15 +389,17 @@
|
|
382
|
389
|
<el-row :gutter="20">
|
|
383
|
390
|
<el-col :span="12">
|
|
384
|
391
|
<el-form-item label="奖励明细">
|
|
385
|
|
- <span class="detail-link" @click="showDetailModal('奖励明细', nonCadreForm.rewardDetailsSummary)">
|
|
386
|
|
- {{ nonCadreForm.rewardDetailsSummary || '查看详情' }}
|
|
|
392
|
+ <span class="detail-link"
|
|
|
393
|
+ @click="showDetailModal('奖励明细', formatAccordList(nonCadreForm.rewardAccordList))">
|
|
|
394
|
+ {{ formatAccordList(nonCadreForm.rewardAccordList) || '查看详情' }}
|
|
387
|
395
|
</span>
|
|
388
|
396
|
</el-form-item>
|
|
389
|
397
|
</el-col>
|
|
390
|
398
|
<el-col :span="12">
|
|
391
|
399
|
<el-form-item label="惩罚明细">
|
|
392
|
|
- <span class="detail-link" @click="showDetailModal('惩罚明细', nonCadreForm.penaltyDetailsSummary)">
|
|
393
|
|
- {{ nonCadreForm.penaltyDetailsSummary || '查看详情' }}
|
|
|
400
|
+ <span class="detail-link"
|
|
|
401
|
+ @click="showDetailModal('惩罚明细', formatAccordList(nonCadreForm.punishmentAccordList))">
|
|
|
402
|
+ {{ formatAccordList(nonCadreForm.punishmentAccordList) || '查看详情' }}
|
|
394
|
403
|
</span>
|
|
395
|
404
|
</el-form-item>
|
|
396
|
405
|
</el-col>
|
|
|
@@ -473,13 +482,13 @@
|
|
473
|
482
|
<!-- 第二个模态框:添加/编辑扣分指标 -->
|
|
474
|
483
|
<el-dialog :title="indicatorDialog.title" v-model="indicatorDialog.visible" width="60%">
|
|
475
|
484
|
<el-form label-width="150px" class="indicator-form">
|
|
476
|
|
- <el-form-item label="指标名称">
|
|
|
485
|
+ <el-form-item label="指标名称" prop="indicatorId">
|
|
477
|
486
|
<div style="display: flex; align-items: center; gap: 10px; width: 100%;">
|
|
478
|
|
- <el-select v-model="indicatorDialog.form.name" placeholder="搜索指标名称" filterable remote reserve-keyword
|
|
|
487
|
+ <el-select v-model="indicatorDialog.form.indicatorId" placeholder="搜索指标名称" filterable remote reserve-keyword
|
|
479
|
488
|
:remote-method="searchIndicators" :loading="indicatorDialog.loading" style="flex: 1;"
|
|
480
|
489
|
@change="onIndicatorNameChange">
|
|
481
|
490
|
<el-option v-for="item in indicatorDialog.indicatorOptions" :key="item.id" :label="item.name"
|
|
482
|
|
- :value="item.name" />
|
|
|
491
|
+ :value="item.id" />
|
|
483
|
492
|
</el-select>
|
|
484
|
493
|
</div>
|
|
485
|
494
|
</el-form-item>
|
|
|
@@ -493,14 +502,14 @@
|
|
493
|
502
|
|
|
494
|
503
|
<el-form-item label="发生次数">
|
|
495
|
504
|
<div style="display: flex; align-items: center; gap: 10px;">
|
|
496
|
|
- <el-input-number v-model="indicatorDialog.form.count" :min="1" style="width: 200px;"
|
|
|
505
|
+ <el-input-number v-model="indicatorDialog.form.occurCount" :min="1" style="width: 200px;"
|
|
497
|
506
|
@change="updateTotal" />
|
|
498
|
507
|
|
|
499
|
508
|
</div>
|
|
500
|
509
|
</el-form-item>
|
|
501
|
510
|
|
|
502
|
511
|
<el-form-item label="检查部门">
|
|
503
|
|
- <el-select v-model="indicatorDialog.form.source" placeholder="请选择" style="width: 200px;">
|
|
|
512
|
+ <el-select v-model="indicatorDialog.form.qcDeptType" placeholder="请选择" style="width: 200px;">
|
|
504
|
513
|
<el-option v-for="item in base_performance_indicator_qc_dept_type" :key="item.value" :label="item.label"
|
|
505
|
514
|
:value="item.value" />
|
|
506
|
515
|
</el-select>
|
|
|
@@ -540,7 +549,7 @@
|
|
540
|
549
|
<!-- 详情模态框 -->
|
|
541
|
550
|
<el-dialog :title="detailModal.title" v-model="detailModal.visible" width="60%">
|
|
542
|
551
|
<div class="detail-content">
|
|
543
|
|
- {{ detailModal.content || '暂无内容' }}
|
|
|
552
|
+ {{ detailModal?.content || '暂无内容' }}
|
|
544
|
553
|
</div>
|
|
545
|
554
|
<template #footer>
|
|
546
|
555
|
<div class="dialog-footer">
|
|
|
@@ -556,8 +565,8 @@ import { ref, reactive, onMounted, getCurrentInstance, watch } from 'vue'
|
|
556
|
565
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
557
|
566
|
|
|
558
|
567
|
// API导入(需要根据实际API路径调整)
|
|
559
|
|
-import { listCadreAssessment, generateCadreAssessment, listNonCadreAssessment, addNonCadreAssessment, updateNonCadreAssessment, deleteNonCadreAssessment, exportNonCadreAssessment } from '@/api/performance/monthlyAssess.js'
|
|
560
|
|
-import { selectUserLeaderListByCondition, listAllUser } from '@/api/system/user.js'
|
|
|
568
|
+import { listCadreAssessment, generateCadreAssessment, listNonCadreAssessment, addNonCadreAssessment, updateNonCadreAssessment, deleteNonCadreAssessment, exportNonCadreAssessment, generateNonCadreAssessment, getNonCadreAssessment } from '@/api/performance/monthlyAssess.js'
|
|
|
569
|
+import { selectUserLeaderListByCondition, listUserPerformance } from '@/api/system/user.js'
|
|
561
|
570
|
import { listIndicator } from '@/api/system/classificationAssess.js'
|
|
562
|
571
|
|
|
563
|
572
|
const { proxy } = getCurrentInstance()
|
|
|
@@ -575,6 +584,8 @@ watch(() => currentTab.value, () => {
|
|
575
|
584
|
getList()
|
|
576
|
585
|
})
|
|
577
|
586
|
|
|
|
587
|
+
|
|
|
588
|
+
|
|
578
|
589
|
// 查询参数
|
|
579
|
590
|
const queryParams = reactive({
|
|
580
|
591
|
pageNum: 1,
|
|
|
@@ -583,18 +594,24 @@ const queryParams = reactive({
|
|
583
|
594
|
assessmentMonth: ''
|
|
584
|
595
|
})
|
|
585
|
596
|
|
|
586
|
|
-// 非干部表单数据
|
|
587
|
|
-const nonCadreForm = reactive({
|
|
|
597
|
+const currentMonthDefault = `${new Date().getFullYear()}-${String(new Date().getMonth() + 1).padStart(2, '0')}`
|
|
|
598
|
+
|
|
|
599
|
+const getEmptyNonCadreForm = () => ({
|
|
|
600
|
+ id: '',
|
|
588
|
601
|
userId: '',
|
|
589
|
602
|
userName: '',
|
|
|
603
|
+ roleKey: '',
|
|
|
604
|
+ roleId: '',
|
|
|
605
|
+ roleName: '',
|
|
590
|
606
|
employmentType: '',
|
|
591
|
607
|
post: '',
|
|
592
|
|
- assessmentMonth: '',
|
|
|
608
|
+ assessmentMonth: currentMonthDefault,
|
|
593
|
609
|
assessmentTeam: '',
|
|
594
|
610
|
deputyTeamLeaderId: '',
|
|
595
|
611
|
deputyTeamLeaderName: '',
|
|
596
|
612
|
deputySupervisorId: '',
|
|
597
|
613
|
deputySupervisorName: '',
|
|
|
614
|
+ deputyManagerId: '',
|
|
598
|
615
|
deputyManagerName: '',
|
|
599
|
616
|
inChargeEmployeeCount: 0,
|
|
600
|
617
|
totalScore: 0,
|
|
|
@@ -607,14 +624,64 @@ const nonCadreForm = reactive({
|
|
607
|
624
|
punishmentAmount: 0,
|
|
608
|
625
|
assessmentRemark: '',
|
|
609
|
626
|
applicationMethodRemark: '',
|
|
610
|
|
- indicatorGroups: []
|
|
|
627
|
+ indicatorGroups: [],
|
|
|
628
|
+ redLineTriggerCount: '',
|
|
|
629
|
+ coreIndicatorScore: '',
|
|
|
630
|
+ safetyWithSocScore: '',
|
|
|
631
|
+ nonSafetyIndicatorScore: '',
|
|
|
632
|
+ socSafetyCoreDeduction: '',
|
|
|
633
|
+ nonCoreSafetyCoreDeduction: '',
|
|
|
634
|
+ averageDeduction: '',
|
|
|
635
|
+ rewardDetailsSummary: '',
|
|
|
636
|
+ penaltyDetailsSummary: '',
|
|
|
637
|
+ redLineIndexAccordList: [],
|
|
|
638
|
+ coreIndexAccordList: [],
|
|
|
639
|
+ otherIndexSafetyScoreWithSocStationQcAccordList: [],
|
|
|
640
|
+ otherIndexNonSafetyAccordList: [],
|
|
|
641
|
+ socStationQcInvolvedCoreSafetyAccordList: [],
|
|
|
642
|
+ rewardAccordList: [],
|
|
|
643
|
+ punishmentAccordList: []
|
|
611
|
644
|
})
|
|
612
|
645
|
|
|
|
646
|
+const nonCadreForm = reactive(getEmptyNonCadreForm())
|
|
|
647
|
+
|
|
|
648
|
+watch(() => nonCadreForm.assessmentMonth, (newVal) => {
|
|
|
649
|
+ if (newVal) {
|
|
|
650
|
+ const month = newVal.replace('-', '')
|
|
|
651
|
+ loadUserList(month)
|
|
|
652
|
+ }
|
|
|
653
|
+})
|
|
|
654
|
+
|
|
|
655
|
+watch(() => nonCadreForm.deputyTeamLeaderId, (newVal) => {
|
|
|
656
|
+ if (newVal) {
|
|
|
657
|
+ const leader = teamLeaderOptions.value.find(u => u.userId === newVal)
|
|
|
658
|
+ nonCadreForm.deputyTeamLeaderName = leader?.nickName || ''
|
|
|
659
|
+ } else {
|
|
|
660
|
+ nonCadreForm.deputyTeamLeaderName = ''
|
|
|
661
|
+ }
|
|
|
662
|
+})
|
|
|
663
|
+
|
|
|
664
|
+watch(() => nonCadreForm.deputySupervisorId, (newVal) => {
|
|
|
665
|
+ if (newVal) {
|
|
|
666
|
+ const supervisor = supervisorOptions.value.find(u => u.userId === newVal)
|
|
|
667
|
+ nonCadreForm.deputySupervisorName = supervisor?.nickName || ''
|
|
|
668
|
+ } else {
|
|
|
669
|
+ nonCadreForm.deputySupervisorName = ''
|
|
|
670
|
+ }
|
|
|
671
|
+})
|
|
|
672
|
+
|
|
|
673
|
+watch(() => nonCadreForm.deputyManagerId, (newVal) => {
|
|
|
674
|
+ if (newVal) {
|
|
|
675
|
+ const manager = managerOptions.value.find(u => u.userId === newVal)
|
|
|
676
|
+ nonCadreForm.deputyManagerName = manager?.nickName || ''
|
|
|
677
|
+ } else {
|
|
|
678
|
+ nonCadreForm.deputyManagerName = ''
|
|
|
679
|
+ }
|
|
|
680
|
+})
|
|
613
|
681
|
|
|
614
|
682
|
|
|
615
|
683
|
function addIndicatorToGroup(item) {
|
|
616
|
684
|
const categoryName = item.categoryNameOne || '未分类'
|
|
617
|
|
-
|
|
618
|
685
|
let group = nonCadreForm.indicatorGroups.length == 0 ? null : nonCadreForm.indicatorGroups.find(g => g.title === categoryName);
|
|
619
|
686
|
|
|
620
|
687
|
if (!group) {
|
|
|
@@ -638,11 +705,12 @@ const indicatorDialog = reactive({
|
|
638
|
705
|
loading: false,
|
|
639
|
706
|
indicatorOptions: [],
|
|
640
|
707
|
form: {
|
|
|
708
|
+ indicatorId: '',
|
|
641
|
709
|
name: '',
|
|
642
|
|
- score: -3,
|
|
643
|
|
- count: 1,
|
|
644
|
|
- source: '',
|
|
645
|
|
- total: 0,
|
|
|
710
|
+ score: 0,
|
|
|
711
|
+ occurCount: 1,
|
|
|
712
|
+ qcDeptType: '',
|
|
|
713
|
+ scoreResult: 0,
|
|
646
|
714
|
rewardDetails: '',
|
|
647
|
715
|
reward: 0,
|
|
648
|
716
|
penaltyDetails: '',
|
|
|
@@ -668,24 +736,7 @@ async function searchIndicators(query) {
|
|
668
|
736
|
}
|
|
669
|
737
|
}
|
|
670
|
738
|
|
|
671
|
|
-// 干部表单数据
|
|
672
|
|
-const cadreForm = reactive({
|
|
673
|
|
- employeeName: '',
|
|
674
|
|
- position: '',
|
|
675
|
|
- area: '',
|
|
676
|
|
- assessmentMonth: '',
|
|
677
|
|
- redLineDeduction: 0,
|
|
678
|
|
- redLineExemption: '',
|
|
679
|
|
- violationRankingDeduction: 0,
|
|
680
|
|
- violationRankingExemption: '',
|
|
681
|
|
- skillRankingDeduction: 0,
|
|
682
|
|
- skillRankingExemption: '',
|
|
683
|
|
- totalScore: 0,
|
|
684
|
|
- assessmentResult: '',
|
|
685
|
|
- applicationMethod: '',
|
|
686
|
|
- assessmentResultRemark: '',
|
|
687
|
|
- applicationMethodRemark: ''
|
|
688
|
|
-})
|
|
|
739
|
+
|
|
689
|
740
|
|
|
690
|
741
|
// 弹窗配置
|
|
691
|
742
|
const dialog = reactive({
|
|
|
@@ -708,6 +759,16 @@ const showDetailModal = (title, content) => {
|
|
708
|
759
|
detailModal.visible = true
|
|
709
|
760
|
}
|
|
710
|
761
|
|
|
|
762
|
+const formatAccordList = (list) => {
|
|
|
763
|
+ if (!list || !Array.isArray(list) || list.length === 0) return ''
|
|
|
764
|
+ return list.map(item => {
|
|
|
765
|
+ const name = item.indicatorName || item.name || ''
|
|
|
766
|
+ const score = item.score !== undefined ? item.score : ''
|
|
|
767
|
+ const count = item.occurCount !== undefined ? item.occurCount : ''
|
|
|
768
|
+ return `${name} ${score}分 x ${count}次`
|
|
|
769
|
+ }).join('\n')
|
|
|
770
|
+}
|
|
|
771
|
+
|
|
711
|
772
|
// 数据列表
|
|
712
|
773
|
const nonCadreList = ref([])
|
|
713
|
774
|
const cadreList = ref([])
|
|
|
@@ -715,22 +776,20 @@ const cadreList = ref([])
|
|
715
|
776
|
const userList = ref([])
|
|
716
|
777
|
const teamLeaderOptions = ref([])
|
|
717
|
778
|
const supervisorOptions = ref([])
|
|
|
779
|
+const managerOptions = ref([])
|
|
718
|
780
|
|
|
719
|
781
|
|
|
720
|
782
|
|
|
721
|
783
|
// 非干部表单验证规则
|
|
722
|
784
|
const nonCadreRules = {
|
|
723
|
|
- userName: [{ required: true, message: '员工姓名不能为空', trigger: 'change' }],
|
|
724
|
|
- employmentType: [{ required: true, message: '用工形式不能为空', trigger: 'change' }],
|
|
725
|
|
- assessmentTeam: [{ required: true, message: '考核组不能为空', trigger: 'change' }],
|
|
726
|
|
- assessmentMonth: [{ required: true, message: '考核月份不能为空', trigger: 'change' }]
|
|
|
785
|
+ userId: [{ required: true, message: '姓名不能为空', trigger: 'change' }]
|
|
727
|
786
|
}
|
|
728
|
787
|
|
|
729
|
788
|
|
|
730
|
789
|
|
|
731
|
|
-async function loadUserList() {
|
|
|
790
|
+async function loadUserList(month) {
|
|
732
|
791
|
try {
|
|
733
|
|
- const res = await listAllUser()
|
|
|
792
|
+ const res = await listUserPerformance({ month })
|
|
734
|
793
|
userList.value = res.data || []
|
|
735
|
794
|
} catch (error) {
|
|
736
|
795
|
console.error('获取员工列表失败:', error)
|
|
|
@@ -755,23 +814,52 @@ async function loadSupervisorOptions(userId) {
|
|
755
|
814
|
}
|
|
756
|
815
|
}
|
|
757
|
816
|
|
|
758
|
|
-async function handleUserChange(userName) {
|
|
759
|
|
- if (!userName) {
|
|
|
817
|
+async function loadManagerOptions(userId) {
|
|
|
818
|
+ try {
|
|
|
819
|
+ const res = await selectUserLeaderListByCondition({ roleKeyList: ['jingli'], userId })
|
|
|
820
|
+ managerOptions.value = res.data || []
|
|
|
821
|
+ } catch (error) {
|
|
|
822
|
+ console.error('获取经理列表失败:', error)
|
|
|
823
|
+ }
|
|
|
824
|
+}
|
|
|
825
|
+
|
|
|
826
|
+async function handleUserChange(userId) {
|
|
|
827
|
+ if (!userId) {
|
|
760
|
828
|
teamLeaderOptions.value = []
|
|
761
|
829
|
supervisorOptions.value = []
|
|
|
830
|
+ managerOptions.value = []
|
|
|
831
|
+ nonCadreForm.deputyTeamLeaderId = ''
|
|
762
|
832
|
nonCadreForm.deputyTeamLeaderName = ''
|
|
|
833
|
+ nonCadreForm.deputySupervisorId = ''
|
|
763
|
834
|
nonCadreForm.deputySupervisorName = ''
|
|
|
835
|
+ nonCadreForm.deputyManagerId = ''
|
|
|
836
|
+ nonCadreForm.deputyManagerName = ''
|
|
764
|
837
|
return
|
|
765
|
838
|
}
|
|
766
|
839
|
|
|
767
|
|
- const user = userList.value.find(u => u.userName === userName)
|
|
768
|
|
- if (user && user.userId) {
|
|
|
840
|
+ const user = userList.value.find(u => u.userId === userId)
|
|
|
841
|
+ if (user && user.nickName) {
|
|
769
|
842
|
await Promise.all([
|
|
770
|
843
|
loadTeamLeaderOptions(user.userId),
|
|
771
|
|
- loadSupervisorOptions(user.userId)
|
|
|
844
|
+ loadSupervisorOptions(user.userId),
|
|
|
845
|
+ loadManagerOptions(user.userId)
|
|
772
|
846
|
])
|
|
|
847
|
+ const role = user.roles && user.roles[0] || {}
|
|
|
848
|
+ nonCadreForm.userName = user.nickName
|
|
|
849
|
+ nonCadreForm.roleName = role?.roleName
|
|
|
850
|
+ nonCadreForm.roleKey = role?.roleKey
|
|
|
851
|
+ nonCadreForm.roleId = role?.roleId
|
|
|
852
|
+ nonCadreForm.employmentType = user.employmentType
|
|
|
853
|
+ nonCadreForm.post = user.post
|
|
|
854
|
+ nonCadreForm.assessmentTeam = user.assessmentTeam
|
|
|
855
|
+ nonCadreForm.assessmentTeamDesc = user.assessmentTeamDesc
|
|
|
856
|
+
|
|
|
857
|
+ nonCadreForm.deputyTeamLeaderId = ''
|
|
773
|
858
|
nonCadreForm.deputyTeamLeaderName = ''
|
|
|
859
|
+ nonCadreForm.deputySupervisorId = ''
|
|
774
|
860
|
nonCadreForm.deputySupervisorName = ''
|
|
|
861
|
+ nonCadreForm.deputyManagerId = ''
|
|
|
862
|
+ nonCadreForm.deputyManagerName = ''
|
|
775
|
863
|
}
|
|
776
|
864
|
}
|
|
777
|
865
|
|
|
|
@@ -832,40 +920,67 @@ const handleAdd = () => {
|
|
832
|
920
|
dialog.title = currentTab.value === 'non-cadre' ? '新增非干部月度考核' : '新增干部月度考核'
|
|
833
|
921
|
|
|
834
|
922
|
if (currentTab.value === 'non-cadre') {
|
|
835
|
|
- loadUserList()
|
|
|
923
|
+ const emptyForm = getEmptyNonCadreForm()
|
|
|
924
|
+ Object.keys(emptyForm).forEach(key => {
|
|
|
925
|
+ nonCadreForm[key] = emptyForm[key]
|
|
|
926
|
+ })
|
|
|
927
|
+ const month = nonCadreForm.assessmentMonth.replace('-', '')
|
|
|
928
|
+ loadUserList(month)
|
|
836
|
929
|
teamLeaderOptions.value = []
|
|
837
|
930
|
supervisorOptions.value = []
|
|
838
|
|
- }
|
|
839
|
|
-
|
|
840
|
|
- // 重置表单数据
|
|
841
|
|
- if (currentTab.value === 'non-cadre') {
|
|
842
|
|
-
|
|
843
|
|
- nonCadreForm.indicatorGroups = []
|
|
|
931
|
+ managerOptions.value = []
|
|
844
|
932
|
}
|
|
845
|
933
|
}
|
|
846
|
934
|
|
|
847
|
935
|
// 编辑
|
|
848
|
|
-const handleEdit = (row, type) => {
|
|
|
936
|
+const handleEdit = async (row, type) => {
|
|
849
|
937
|
dialog.visible = true
|
|
850
|
938
|
dialog.type = type
|
|
851
|
939
|
dialog.title = '编辑非干部月度考核'
|
|
852
|
940
|
|
|
853
|
941
|
if (type === 'non-cadre') {
|
|
854
|
|
- loadUserList().then(() => {
|
|
855
|
|
- if (row.userName) {
|
|
856
|
|
- loadTeamLeaderOptions(row.userId)
|
|
857
|
|
- loadSupervisorOptions(row.userId)
|
|
858
|
|
- }
|
|
859
|
|
- })
|
|
860
|
|
- }
|
|
861
|
|
-
|
|
862
|
|
- // 填充表单数据
|
|
863
|
|
- if (type === 'non-cadre') {
|
|
864
|
|
- Object.keys(nonCadreForm).forEach(key => {
|
|
865
|
|
- if (row[key] !== undefined) {
|
|
866
|
|
- nonCadreForm[key] = row[key]
|
|
867
|
|
- }
|
|
868
|
|
- })
|
|
|
942
|
+ const month = nonCadreForm.assessmentMonth.replace('-', '')
|
|
|
943
|
+ loadUserList(month)
|
|
|
944
|
+ loadTeamLeaderOptions(row.userId)
|
|
|
945
|
+ loadSupervisorOptions(row.userId)
|
|
|
946
|
+ loadManagerOptions(row.userId)
|
|
|
947
|
+
|
|
|
948
|
+ try {
|
|
|
949
|
+ const res = await getNonCadreAssessment(row.id)
|
|
|
950
|
+
|
|
|
951
|
+ const detailList = res.data.personnelMonthlyAssessmentIndicatorDetailList || []
|
|
|
952
|
+ const indicatorGroupsMap = {}
|
|
|
953
|
+ detailList.forEach(item => {
|
|
|
954
|
+ const categoryKey = item.categoryCodeOne || item.categoryNameOne || '未分类'
|
|
|
955
|
+ if (!indicatorGroupsMap[categoryKey]) {
|
|
|
956
|
+ indicatorGroupsMap[categoryKey] = {
|
|
|
957
|
+ title: item.categoryNameOne || '未分类',
|
|
|
958
|
+ items: []
|
|
|
959
|
+ }
|
|
|
960
|
+ }
|
|
|
961
|
+ indicatorGroupsMap[categoryKey].items.push({
|
|
|
962
|
+ ...item
|
|
|
963
|
+ })
|
|
|
964
|
+ })
|
|
|
965
|
+ const indicatorGroups = Object.values(indicatorGroupsMap)
|
|
|
966
|
+
|
|
|
967
|
+ Object.keys(res.data).forEach(key => {
|
|
|
968
|
+ if (key === 'assessmentMonth' && res.data[key]) {
|
|
|
969
|
+ const val = res.data[key]
|
|
|
970
|
+ if (typeof val === 'string' && val.length === 6 && /^\d+$/.test(val)) {
|
|
|
971
|
+ nonCadreForm[key] = val.substring(0, 4) + '-' + val.substring(4, 6)
|
|
|
972
|
+ } else {
|
|
|
973
|
+ nonCadreForm[key] = val
|
|
|
974
|
+ }
|
|
|
975
|
+ } else if (key !== 'personnelMonthlyAssessmentIndicatorDetailList') {
|
|
|
976
|
+ nonCadreForm[key] = res.data[key]
|
|
|
977
|
+ }
|
|
|
978
|
+ })
|
|
|
979
|
+ nonCadreForm.indicatorGroups = indicatorGroups
|
|
|
980
|
+ } catch (error) {
|
|
|
981
|
+ console.error('获取详情失败:', error)
|
|
|
982
|
+ ElMessage.error('获取详情失败')
|
|
|
983
|
+ }
|
|
869
|
984
|
}
|
|
870
|
985
|
}
|
|
871
|
986
|
|
|
|
@@ -895,15 +1010,29 @@ const submitForm = async () => {
|
|
895
|
1010
|
|
|
896
|
1011
|
try {
|
|
897
|
1012
|
if (dialog.type === 'non-cadre') {
|
|
|
1013
|
+ const submitData = { ...nonCadreForm }
|
|
|
1014
|
+
|
|
|
1015
|
+ if (submitData.assessmentMonth) {
|
|
|
1016
|
+ submitData.assessmentMonth = submitData.assessmentMonth.replace('-', '')
|
|
|
1017
|
+ }
|
|
|
1018
|
+
|
|
|
1019
|
+ if (submitData.indicatorGroups && submitData.indicatorGroups.length > 0) {
|
|
|
1020
|
+ submitData.personnelMonthlyAssessmentIndicatorDetailList = submitData.indicatorGroups.flatMap(group =>
|
|
|
1021
|
+ group.items.map(item => ({
|
|
|
1022
|
+ ...item
|
|
|
1023
|
+ }))
|
|
|
1024
|
+ )
|
|
|
1025
|
+ delete submitData.indicatorGroups
|
|
|
1026
|
+ }
|
|
|
1027
|
+
|
|
898
|
1028
|
if (dialog.title === '新增非干部月度考核') {
|
|
899
|
|
- await addNonCadreAssessment(nonCadreForm)
|
|
|
1029
|
+ await addNonCadreAssessment(submitData)
|
|
900
|
1030
|
ElMessage.success('新增成功')
|
|
901
|
1031
|
} else {
|
|
902
|
|
- await updateNonCadreAssessment(nonCadreForm)
|
|
|
1032
|
+ await updateNonCadreAssessment(submitData)
|
|
903
|
1033
|
ElMessage.success('更新成功')
|
|
904
|
1034
|
}
|
|
905
|
1035
|
} else {
|
|
906
|
|
- // 干部数据API(待实现)
|
|
907
|
1036
|
ElMessage.success('操作成功')
|
|
908
|
1037
|
}
|
|
909
|
1038
|
|
|
|
@@ -941,20 +1070,27 @@ const handleExport = async () => {
|
|
941
|
1070
|
// 生成本月考核表
|
|
942
|
1071
|
const generateMonthlyAssessment = async () => {
|
|
943
|
1072
|
try {
|
|
944
|
|
- ElMessageBox.confirm('是否生成本月干部考核数据?', '提示', {
|
|
|
1073
|
+ const tabText = currentTab.value === 'non-cadre' ? '非干部' : '干部'
|
|
|
1074
|
+ ElMessageBox.confirm(`是否生成本月${tabText}考核数据?`, '提示', {
|
|
945
|
1075
|
confirmButtonText: '确定',
|
|
946
|
1076
|
cancelButtonText: '取消',
|
|
947
|
1077
|
type: 'warning'
|
|
948
|
1078
|
}).then(async () => {
|
|
949
|
1079
|
loading.value = true
|
|
950
|
|
- // 使用当前年月的日期
|
|
951
|
1080
|
const now = new Date()
|
|
952
|
|
- const params = {
|
|
953
|
|
- year: now.getFullYear(),
|
|
954
|
|
- month: now.getMonth() + 1
|
|
|
1081
|
+ const currentMonth = `${now.getFullYear()}${String(now.getMonth() + 1).padStart(2, '0')}`
|
|
|
1082
|
+
|
|
|
1083
|
+ if (currentTab.value === 'non-cadre') {
|
|
|
1084
|
+ const res = await generateNonCadreAssessment({ month: currentMonth })
|
|
|
1085
|
+ ElMessage.success('生成成功')
|
|
|
1086
|
+ } else {
|
|
|
1087
|
+ const params = {
|
|
|
1088
|
+ year: now.getFullYear(),
|
|
|
1089
|
+ month: now.getMonth() + 1
|
|
|
1090
|
+ }
|
|
|
1091
|
+ const res = await generateCadreAssessment(params)
|
|
|
1092
|
+ ElMessage.success('生成成功')
|
|
955
|
1093
|
}
|
|
956
|
|
- const res = await generateCadreAssessment(params)
|
|
957
|
|
- ElMessage.success('生成成功')
|
|
958
|
1094
|
getList()
|
|
959
|
1095
|
}).catch(() => { })
|
|
960
|
1096
|
} catch (error) {
|
|
|
@@ -986,9 +1122,9 @@ const addIndicator = () => {
|
|
986
|
1122
|
indicatorDialog.form = {
|
|
987
|
1123
|
name: '',
|
|
988
|
1124
|
score: -3,
|
|
989
|
|
- count: 1,
|
|
990
|
|
- source: '',
|
|
991
|
|
- total: 0,
|
|
|
1125
|
+ occurCount: 1,
|
|
|
1126
|
+ qcDeptType: '',
|
|
|
1127
|
+ scoreResult: 0,
|
|
992
|
1128
|
rewardDetails: '',
|
|
993
|
1129
|
reward: 0,
|
|
994
|
1130
|
penaltyDetails: '',
|
|
|
@@ -1021,20 +1157,26 @@ const deleteIndicator = (groupIndex, itemIndex) => {
|
|
1021
|
1157
|
|
|
1022
|
1158
|
// 指标名称变化时更新分值
|
|
1023
|
1159
|
const onIndicatorNameChange = (value) => {
|
|
1024
|
|
- const selected = indicatorDialog.indicatorOptions.find(item => item.name === value)
|
|
|
1160
|
+ console.log(value, indicatorDialog.indicatorOptions, "indicatorDialog.indicatorOptions")
|
|
|
1161
|
+ const selected = indicatorDialog.indicatorOptions.find(item => item.id === value)
|
|
1025
|
1162
|
if (selected) {
|
|
1026
|
|
- indicatorDialog.form = { ...selected, count: 1 }
|
|
|
1163
|
+ indicatorDialog.form = { ...selected, occurCount: 1 }
|
|
1027
|
1164
|
updateTotal()
|
|
1028
|
1165
|
}
|
|
1029
|
1166
|
}
|
|
1030
|
1167
|
|
|
1031
|
1168
|
// 更新总分
|
|
1032
|
1169
|
const updateTotal = () => {
|
|
1033
|
|
- indicatorDialog.form.total = indicatorDialog.form.score * indicatorDialog.form.count
|
|
|
1170
|
+ indicatorDialog.form.scoreResult = indicatorDialog.form.score * indicatorDialog.form.occurCount
|
|
1034
|
1171
|
}
|
|
1035
|
1172
|
|
|
1036
|
1173
|
// 保存指标
|
|
1037
|
1174
|
const saveIndicator = () => {
|
|
|
1175
|
+ if (!indicatorDialog.form.indicatorId) {
|
|
|
1176
|
+ ElMessage.error('请选择指标名称')
|
|
|
1177
|
+ return
|
|
|
1178
|
+ }
|
|
|
1179
|
+
|
|
1038
|
1180
|
if (indicatorDialog.mode === 'add') {
|
|
1039
|
1181
|
addIndicatorToGroup({ ...indicatorDialog.form })
|
|
1040
|
1182
|
ElMessage.success('添加成功')
|
|
|
@@ -1186,7 +1328,7 @@ onMounted(() => {
|
|
1186
|
1328
|
|
|
1187
|
1329
|
.indicator-value,
|
|
1188
|
1330
|
.indicator-count,
|
|
1189
|
|
-.indicator-source,
|
|
|
1331
|
+.indicator-qcDeptType,
|
|
1190
|
1332
|
.indicator-total {
|
|
1191
|
1333
|
flex: 1;
|
|
1192
|
1334
|
font-size: 16px;
|