|
|
@@ -73,6 +73,7 @@
|
|
73
|
73
|
<el-table v-loading="loading" :data="nonCadreList" border fit highlight-current-row
|
|
74
|
74
|
style="width: 100%; margin-top: 20px;" @selection-change="handleSelectionChange">
|
|
75
|
75
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
76
|
+ <el-table-column label="大队" prop="brigadeName" align="center" min-width="120" />
|
|
76
|
77
|
<el-table-column label="用工形式" prop="employmentType" align="center" min-width="100">
|
|
77
|
78
|
<template #default="scope">
|
|
78
|
79
|
<dict-tag :options="employment_type" :value="scope.row.employmentType" />
|
|
|
@@ -291,8 +292,9 @@
|
|
291
|
292
|
<div class="indicator-group-title">{{ group.title }}</div>
|
|
292
|
293
|
<div v-for="(item, itemIndex) in group.items" :key="itemIndex" class="indicator-item">
|
|
293
|
294
|
<div class="indicator-name">{{ item.indicatorName }}</div>
|
|
294
|
|
- <div class="indicator-value" v-if="item.categoryNameOne != '红线指标'">{{ item.score > 0 ? '+' : '' }}{{ item.score
|
|
295
|
|
- }}/次
|
|
|
295
|
+ <div class="indicator-value" v-if="item.categoryNameOne != '红线指标'">{{ item.score > 0 ? '+' : '' }}{{
|
|
|
296
|
+ item.score
|
|
|
297
|
+ }}/次
|
|
296
|
298
|
</div>
|
|
297
|
299
|
<div class="indicator-count">{{ item.occurCount }}次</div>
|
|
298
|
300
|
<div class="indicator-total">{{ item.scoreResult > 0 ? '+' : '' }}{{ item.scoreResult }}</div>
|
|
|
@@ -536,42 +538,54 @@
|
|
536
|
538
|
</div>
|
|
537
|
539
|
</el-form-item>
|
|
538
|
540
|
|
|
539
|
|
- <template
|
|
540
|
|
- v-for="(detail, index) in (indicatorDialog.form.personnelMonthlyAssessmentIndicatorRewardPunishmentDetailList || [])"
|
|
541
|
|
- :key="index">
|
|
542
|
|
- <div style="display: flex; align-items: center; gap: 10px; margin-bottom: 10px;">
|
|
543
|
|
- <h4 style="margin-left: 80px;">明细{{ index + 1 }}</h4>
|
|
544
|
|
- <el-button type="danger" size="small" @click="removeRewardPunishmentDetail(index)">删除</el-button>
|
|
545
|
|
- </div>
|
|
546
|
|
- <el-form-item label="检查部门">
|
|
547
|
|
- <div style="display: flex; align-items: center; gap: 10px; width: 100%;">
|
|
548
|
|
- <el-select v-model="detail.qcDeptType" placeholder="请选择" style="width: 200px;">
|
|
549
|
|
- <el-option v-for="item in base_performance_indicator_qc_dept_type" :key="item.value" :label="item.label"
|
|
550
|
|
- :value="item.value" />
|
|
551
|
|
- </el-select>
|
|
552
|
|
- </div>
|
|
553
|
|
- </el-form-item>
|
|
554
|
|
- <el-form-item v-if="indicatorDialog.form.score > 0" label="奖励明细">
|
|
555
|
|
- <el-input v-model="detail.rewardPunishmentDetail" type="textarea" :rows="2" />
|
|
556
|
|
- </el-form-item>
|
|
557
|
|
- <el-form-item v-if="indicatorDialog.form.score > 0" label="奖励">
|
|
558
|
|
- <div style="display: flex; align-items: center; gap: 10px;">
|
|
559
|
|
- <el-input-number v-model="detail.amount" :min="0" :precision="2" style="width: 200px;"
|
|
560
|
|
- @change="updateTotal" />
|
|
561
|
|
- <span>元</span>
|
|
562
|
|
- </div>
|
|
563
|
|
- </el-form-item>
|
|
564
|
|
- <el-form-item v-if="indicatorDialog.form.score < 0" label="惩罚明细">
|
|
565
|
|
- <el-input v-model="detail.rewardPunishmentDetail" type="textarea" :rows="2" />
|
|
566
|
|
- </el-form-item>
|
|
567
|
|
- <el-form-item v-if="indicatorDialog.form.score < 0" label="扣罚">
|
|
568
|
|
- <div style="display: flex; align-items: center; gap: 10px;">
|
|
569
|
|
- <el-input-number v-model="detail.amount" :min="0" :precision="2" style="width: 200px;"
|
|
570
|
|
- @change="updateTotal" />
|
|
571
|
|
- <span>元</span>
|
|
572
|
|
- </div>
|
|
573
|
|
- </el-form-item>
|
|
574
|
|
- </template>
|
|
|
541
|
+ <el-form-item label="记录明细">
|
|
|
542
|
+ <el-table :data="indicatorDialog.form.personnelMonthlyAssessmentIndicatorRewardPunishmentDetailList" border
|
|
|
543
|
+ max-height="400">
|
|
|
544
|
+ <el-table-column label="序号" type="index" width="60" align="center" />
|
|
|
545
|
+ <el-table-column label="日期" width="180">
|
|
|
546
|
+ <template #default="scope">
|
|
|
547
|
+ <el-date-picker v-model="scope.row.recordDate" type="date" value-format="YYYY-MM-DD" placeholder="选择日期"
|
|
|
548
|
+ style="width: 100%" />
|
|
|
549
|
+ </template>
|
|
|
550
|
+ </el-table-column>
|
|
|
551
|
+ <el-table-column label="检查部门">
|
|
|
552
|
+ <template #default="scope">
|
|
|
553
|
+ <el-select v-model="scope.row.qcDeptType" placeholder="请选择" clearable>
|
|
|
554
|
+ <el-option v-for="item in base_performance_indicator_qc_dept_type" :key="item.value"
|
|
|
555
|
+ :label="item.label" :value="item.value" />
|
|
|
556
|
+ </el-select>
|
|
|
557
|
+ </template>
|
|
|
558
|
+ </el-table-column>
|
|
|
559
|
+ <el-table-column label="扣罚明细" v-if="indicatorDialog.form.score < 0">
|
|
|
560
|
+ <template #default="scope">
|
|
|
561
|
+ <el-input v-model="scope.row.rewardPunishmentDetail" type="textarea" :rows="1" placeholder="请输入扣罚明细" />
|
|
|
562
|
+ </template>
|
|
|
563
|
+ </el-table-column>
|
|
|
564
|
+ <el-table-column label="扣罚(元)" v-if="indicatorDialog.form.score < 0">
|
|
|
565
|
+ <template #default="scope">
|
|
|
566
|
+ <el-input-number v-model="scope.row.amount" :max="0" :precision="2" style="width: 170px;"
|
|
|
567
|
+ @change="updateTotal" />
|
|
|
568
|
+ </template>
|
|
|
569
|
+ </el-table-column>
|
|
|
570
|
+ <el-table-column label="奖励明细" v-if="indicatorDialog.form.score > 0">
|
|
|
571
|
+ <template #default="scope">
|
|
|
572
|
+ <el-input v-model="scope.row.rewardPunishmentDetail" type="textarea" :rows="1" placeholder="请输入奖励明细" />
|
|
|
573
|
+ </template>
|
|
|
574
|
+ </el-table-column>
|
|
|
575
|
+ <el-table-column label="奖励(元)" v-if="indicatorDialog.form.score > 0">
|
|
|
576
|
+ <template #default="scope">
|
|
|
577
|
+ <el-input-number v-model="scope.row.amount" :min="0" :precision="2" style="width: 170px;"
|
|
|
578
|
+ @change="updateTotal" />
|
|
|
579
|
+ </template>
|
|
|
580
|
+ </el-table-column>
|
|
|
581
|
+ <el-table-column label="操作" align="center">
|
|
|
582
|
+ <template #default="scope">
|
|
|
583
|
+ <el-button type="danger" link icon="Delete" @click="removeRewardPunishmentDetail(scope.$index)" />
|
|
|
584
|
+ </template>
|
|
|
585
|
+ </el-table-column>
|
|
|
586
|
+ </el-table>
|
|
|
587
|
+
|
|
|
588
|
+ </el-form-item>
|
|
575
|
589
|
</el-form>
|
|
576
|
590
|
|
|
577
|
591
|
<template #footer>
|
|
|
@@ -751,7 +765,7 @@ const indicatorDialog = reactive({
|
|
751
|
765
|
value: 'id',
|
|
752
|
766
|
label: 'name',
|
|
753
|
767
|
children: 'indicatorList',
|
|
754
|
|
- checkStrictly: false,
|
|
|
768
|
+
|
|
755
|
769
|
emitPath: false
|
|
756
|
770
|
},
|
|
757
|
771
|
rules: {
|
|
|
@@ -823,7 +837,7 @@ function transformIndicatorTree(treeData) {
|
|
823
|
837
|
|
|
824
|
838
|
if (child.indicatorList && child.indicatorList.length > 0) {
|
|
825
|
839
|
transformedChild.indicatorList = child.indicatorList.map(indicator => ({
|
|
826
|
|
- ...indicator, name: indicator.name, id: indicator.id, indicatorId: indicator.id, indicatorName: indicator.name, occurCount: 1, personnelMonthlyAssessmentIndicatorRewardPunishmentDetailList: []
|
|
|
840
|
+ ...indicator, name: indicator.name, id: indicator.id, indicatorId: indicator.indicatorId, indicatorName: indicator.name, occurCount: 1, personnelMonthlyAssessmentIndicatorRewardPunishmentDetailList: []
|
|
827
|
841
|
}))
|
|
828
|
842
|
}
|
|
829
|
843
|
|
|
|
@@ -833,7 +847,7 @@ function transformIndicatorTree(treeData) {
|
|
833
|
847
|
|
|
834
|
848
|
if (node.indicatorList && node.indicatorList.length > 0) {
|
|
835
|
849
|
transformed.indicatorList = node.indicatorList.map(indicator => ({
|
|
836
|
|
- ...indicator, name: indicator.name, id: indicator.id, indicatorId: indicator.id, indicatorName: indicator.name, occurCount: 1, personnelMonthlyAssessmentIndicatorRewardPunishmentDetailList: []
|
|
|
850
|
+ ...indicator, name: indicator.name, id: indicator.id, indicatorId: indicator.indicatorId, indicatorName: indicator.name, occurCount: 1, personnelMonthlyAssessmentIndicatorRewardPunishmentDetailList: []
|
|
837
|
851
|
}))
|
|
838
|
852
|
}
|
|
839
|
853
|
|
|
|
@@ -843,6 +857,7 @@ function transformIndicatorTree(treeData) {
|
|
843
|
857
|
|
|
844
|
858
|
function onIndicatorCascaderChange(value) {
|
|
845
|
859
|
const selected = findIndicatorById(indicatorDialog.cascaderOptions, value)
|
|
|
860
|
+
|
|
846
|
861
|
if (selected) {
|
|
847
|
862
|
indicatorDialog.form = {
|
|
848
|
863
|
...selected,
|
|
|
@@ -897,10 +912,12 @@ const showDetailModal = (title, content) => {
|
|
897
|
912
|
const formatAccordList = (list) => {
|
|
898
|
913
|
if (!list || !Array.isArray(list) || list.length === 0) return ''
|
|
899
|
914
|
return list.map(item => {
|
|
|
915
|
+ const detail = item.personnelMonthlyAssessmentIndicatorRewardPunishmentDetailList[0] || {};
|
|
|
916
|
+ const date = detail.recordDate || ''
|
|
900
|
917
|
const name = item.indicatorName || item.name || ''
|
|
901
|
918
|
const score = item.score !== undefined ? item.score : ''
|
|
902
|
919
|
const count = item.occurCount !== undefined ? item.occurCount : ''
|
|
903
|
|
- return `${name} ${score}分 x ${count}次`
|
|
|
920
|
+ return `${date} ${name} ${score}分 x ${count}次`
|
|
904
|
921
|
}).join('\n')
|
|
905
|
922
|
}
|
|
906
|
923
|
|
|
|
@@ -1253,19 +1270,19 @@ const submitForm = async () => {
|
|
1253
|
1270
|
group.items.map(item => ({
|
|
1254
|
1271
|
...item,
|
|
1255
|
1272
|
indicatorName: item.name || item.indicatorName,
|
|
1256
|
|
- indicatorId: item.id || item.indicatorId,
|
|
|
1273
|
+ indicatorId: item.indicatorId ,
|
|
1257
|
1274
|
indicatorCode: item.code || item.indicatorCode,
|
|
1258
|
1275
|
}))
|
|
1259
|
1276
|
)
|
|
1260
|
1277
|
delete submitData.indicatorGroups
|
|
1261
|
1278
|
}
|
|
1262
|
1279
|
|
|
1263
|
|
- if (dialog.title === '新增非干部月度考核') {
|
|
1264
|
|
- await addNonCadreAssessment(submitData)
|
|
1265
|
|
- ElMessage.success('新增成功')
|
|
1266
|
|
- } else {
|
|
|
1280
|
+ if (nonCadreForm.id) {
|
|
1267
|
1281
|
await updateNonCadreAssessment(submitData)
|
|
1268
|
1282
|
ElMessage.success('更新成功')
|
|
|
1283
|
+ } else {
|
|
|
1284
|
+ await addNonCadreAssessment(submitData)
|
|
|
1285
|
+ ElMessage.success('新增成功')
|
|
1269
|
1286
|
}
|
|
1270
|
1287
|
} else {
|
|
1271
|
1288
|
ElMessage.success('操作成功')
|
|
|
@@ -1337,16 +1354,7 @@ const generateMonthlyAssessment = async () => {
|
|
1337
|
1354
|
}
|
|
1338
|
1355
|
}
|
|
1339
|
1356
|
|
|
1340
|
|
-// 获取考核结果文本
|
|
1341
|
|
-const getResultText = (value) => {
|
|
1342
|
|
- const map = {
|
|
1343
|
|
- 'excellent': '优秀',
|
|
1344
|
|
- 'good': '良好',
|
|
1345
|
|
- 'qualified': '合格',
|
|
1346
|
|
- 'unqualified': '不称职'
|
|
1347
|
|
- }
|
|
1348
|
|
- return map[value] || ''
|
|
1349
|
|
-}
|
|
|
1357
|
+
|
|
1350
|
1358
|
|
|
1351
|
1359
|
// 添加指标 - 打开新增模态框
|
|
1352
|
1360
|
const addIndicator = () => {
|
|
|
@@ -1371,6 +1379,7 @@ const addIndicator = () => {
|
|
1371
|
1379
|
|
|
1372
|
1380
|
// 编辑指标 - 打开编辑模态框
|
|
1373
|
1381
|
const editIndicator = async (groupIndex, itemIndex) => {
|
|
|
1382
|
+ await loadIndicatorCascaderOptions()
|
|
1374
|
1383
|
const item = nonCadreForm.indicatorGroups[groupIndex].items[itemIndex]
|
|
1375
|
1384
|
indicatorDialog.visible = true
|
|
1376
|
1385
|
indicatorDialog.title = '编辑扣分指标'
|
|
|
@@ -1378,10 +1387,11 @@ const editIndicator = async (groupIndex, itemIndex) => {
|
|
1378
|
1387
|
indicatorDialog.groupIndex = groupIndex
|
|
1379
|
1388
|
indicatorDialog.itemIndex = itemIndex
|
|
1380
|
1389
|
|
|
1381
|
|
- await loadIndicatorCascaderOptions()
|
|
1382
|
|
- await nextTick()
|
|
1383
|
1390
|
|
|
|
1391
|
+ await nextTick()
|
|
1384
|
1392
|
indicatorDialog.form = { ...item }
|
|
|
1393
|
+ console.log(indicatorDialog.form, "indicatorDialog.form")
|
|
|
1394
|
+
|
|
1385
|
1395
|
if (!indicatorDialog.form.personnelMonthlyAssessmentIndicatorRewardPunishmentDetailList) {
|
|
1386
|
1396
|
indicatorDialog.form.personnelMonthlyAssessmentIndicatorRewardPunishmentDetailList = []
|
|
1387
|
1397
|
}
|
|
|
@@ -1400,15 +1410,7 @@ const deleteIndicator = (groupIndex, itemIndex) => {
|
|
1400
|
1410
|
}).catch(() => { })
|
|
1401
|
1411
|
}
|
|
1402
|
1412
|
|
|
1403
|
|
-// 指标名称变化时更新分值
|
|
1404
|
|
-const onIndicatorNameChange = (value) => {
|
|
1405
|
|
- console.log(value, indicatorDialog.indicatorOptions, "indicatorDialog.indicatorOptions")
|
|
1406
|
|
- const selected = indicatorDialog.indicatorOptions.find(item => item.id === value)
|
|
1407
|
|
- if (selected) {
|
|
1408
|
|
- indicatorDialog.form = { ...selected, indicatorId: selected.id, indicatorName: selected.name, occurCount: 1, personnelMonthlyAssessmentIndicatorRewardPunishmentDetailList: [] }
|
|
1409
|
|
- updateTotal()
|
|
1410
|
|
- }
|
|
1411
|
|
-}
|
|
|
1413
|
+
|
|
1412
|
1414
|
|
|
1413
|
1415
|
// 更新总分
|
|
1414
|
1416
|
const updateTotal = () => {
|
|
|
@@ -1420,12 +1422,18 @@ const updateTotal = () => {
|
|
1420
|
1422
|
return
|
|
1421
|
1423
|
}
|
|
1422
|
1424
|
const targetCount = indicatorDialog.form.occurCount
|
|
|
1425
|
+ const today = `${new Date().getFullYear()}-${String(new Date().getMonth() + 1).padStart(2, '0')}-${String(new Date().getDate()).padStart(2, '0')}`
|
|
1423
|
1426
|
if (list.length < targetCount) {
|
|
1424
|
1427
|
for (let i = list.length; i < targetCount; i++) {
|
|
|
1428
|
+ const isCoreIndicator = indicatorDialog.form.categoryNameOne === '核心指标'
|
|
|
1429
|
+ const defaultAmount = isCoreIndicator
|
|
|
1430
|
+ ? (indicatorDialog.form.score * 100)
|
|
|
1431
|
+ : (indicatorDialog.form.score * 50)
|
|
1425
|
1432
|
list.push({
|
|
|
1433
|
+ recordDate: today,
|
|
1426
|
1434
|
qcDeptType: '',
|
|
1427
|
1435
|
rewardPunishmentDetail: '',
|
|
1428
|
|
- amount: 0
|
|
|
1436
|
+ amount: defaultAmount
|
|
1429
|
1437
|
})
|
|
1430
|
1438
|
}
|
|
1431
|
1439
|
}
|