|
|
@@ -12,8 +12,8 @@
|
|
12
|
12
|
<!-- 查询条件 -->
|
|
13
|
13
|
<div class="filter-container">
|
|
14
|
14
|
<el-form :model="queryParams" ref="queryFormRef" :inline="true" class="search-form">
|
|
15
|
|
- <el-form-item label="姓名" prop="name">
|
|
16
|
|
- <el-input v-model="queryParams.name" placeholder="请输入姓名" clearable style="width: 200px" />
|
|
|
15
|
+ <el-form-item label="姓名" prop="userName">
|
|
|
16
|
+ <el-input v-model="queryParams.userName" placeholder="请输入姓名" clearable style="width: 200px" />
|
|
17
|
17
|
</el-form-item>
|
|
18
|
18
|
|
|
19
|
19
|
<el-form-item label="考核月份" prop="assessmentMonth">
|
|
|
@@ -21,6 +21,28 @@
|
|
21
|
21
|
value-format="YYYY-MM" style="width: 200px" />
|
|
22
|
22
|
</el-form-item>
|
|
23
|
23
|
|
|
|
24
|
+ <template v-if="currentTab === 'non-cadre'">
|
|
|
25
|
+ <el-form-item label="岗位" prop="post">
|
|
|
26
|
+ <el-select v-model="queryParams.post" placeholder="请选择岗位" clearable style="width: 200px">
|
|
|
27
|
+ <el-option v-for="item in post" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
28
|
+ </el-select>
|
|
|
29
|
+ </el-form-item>
|
|
|
30
|
+
|
|
|
31
|
+ <el-form-item label="考核组" prop="assessmentTeam">
|
|
|
32
|
+ <el-select v-model="queryParams.assessmentTeam" placeholder="请选择考核组" clearable style="width: 200px">
|
|
|
33
|
+ <el-option v-for="item in assessment_team" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
34
|
+ </el-select>
|
|
|
35
|
+ </el-form-item>
|
|
|
36
|
+
|
|
|
37
|
+ <el-form-item label="考核结果" prop="assessmentResult">
|
|
|
38
|
+ <el-input v-model="queryParams.assessmentResult" placeholder="请输入考核结果" clearable style="width: 200px" />
|
|
|
39
|
+ </el-form-item>
|
|
|
40
|
+
|
|
|
41
|
+ <el-form-item label="豁免" prop="exemption">
|
|
|
42
|
+ <el-input v-model="queryParams.exemption" placeholder="请输入豁免" clearable style="width: 200px" />
|
|
|
43
|
+ </el-form-item>
|
|
|
44
|
+ </template>
|
|
|
45
|
+
|
|
24
|
46
|
<el-form-item>
|
|
25
|
47
|
<el-button type="primary" icon="Search" @click="handleQuery">查询</el-button>
|
|
26
|
48
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
|
|
@@ -39,7 +61,7 @@
|
|
39
|
61
|
<div v-else class="left-buttons"></div>
|
|
40
|
62
|
|
|
41
|
63
|
<div class="right-buttons">
|
|
42
|
|
- <el-button type="primary" @click="generateMonthlyAssessment">生成本月考核表</el-button>
|
|
|
64
|
+ <el-button type="primary" :disabled="!queryParams.assessmentMonth" @click="generateMonthlyAssessment">生成本月考核表</el-button>
|
|
43
|
65
|
</div>
|
|
44
|
66
|
</div>
|
|
45
|
67
|
|
|
|
@@ -171,9 +193,9 @@
|
|
171
|
193
|
|
|
172
|
194
|
<!-- 编辑/新增弹窗 -->
|
|
173
|
195
|
<el-dialog :title="dialog.title" v-model="dialog.visible" width="80%" :close-on-click-modal="false"
|
|
174
|
|
- destroy-on-close>
|
|
|
196
|
+ destroy-on-close >
|
|
175
|
197
|
<!-- 非干部表单 -->
|
|
176
|
|
- <el-form v-if="dialog.type === 'non-cadre'" :model="nonCadreForm" ref="formRef" :rules="nonCadreRules"
|
|
|
198
|
+ <el-form v-loading="dialog.loading" v-if="dialog.type === 'non-cadre'" :model="nonCadreForm" ref="formRef" :rules="nonCadreRules"
|
|
177
|
199
|
label-width="380px" class="form-container">
|
|
178
|
200
|
<!-- 第一部分:基础信息 -->
|
|
179
|
201
|
<el-row :gutter="20">
|
|
|
@@ -596,8 +618,12 @@ watch(() => currentTab.value, () => {
|
|
596
|
618
|
const queryParams = reactive({
|
|
597
|
619
|
pageNum: 1,
|
|
598
|
620
|
pageSize: 10,
|
|
599
|
|
- name: '',
|
|
600
|
|
- assessmentMonth: ''
|
|
|
621
|
+ userName: '',
|
|
|
622
|
+ assessmentMonth: '',
|
|
|
623
|
+ post: '',
|
|
|
624
|
+ assessmentTeam: '',
|
|
|
625
|
+ assessmentResult: '',
|
|
|
626
|
+ exemption: ''
|
|
601
|
627
|
})
|
|
602
|
628
|
|
|
603
|
629
|
const currentMonthDefault = `${new Date().getFullYear()}-${String(new Date().getMonth() + 1).padStart(2, '0')}`
|
|
|
@@ -840,7 +866,8 @@ function findIndicatorById(tree, targetId) {
|
|
840
|
866
|
const dialog = reactive({
|
|
841
|
867
|
visible: false,
|
|
842
|
868
|
title: '',
|
|
843
|
|
- type: 'non-cadre'
|
|
|
869
|
+ type: 'non-cadre',
|
|
|
870
|
+ loading: false
|
|
844
|
871
|
})
|
|
845
|
872
|
|
|
846
|
873
|
// 详情模态框
|
|
|
@@ -886,11 +913,14 @@ const nonCadreRules = {
|
|
886
|
913
|
|
|
887
|
914
|
|
|
888
|
915
|
async function loadUserList(month) {
|
|
|
916
|
+ dialog.loading = true
|
|
889
|
917
|
try {
|
|
890
|
918
|
const res = await listUserPerformance({ month })
|
|
891
|
919
|
userList.value = res.data || []
|
|
892
|
920
|
} catch (error) {
|
|
893
|
921
|
console.error('获取员工列表失败:', error)
|
|
|
922
|
+ } finally {
|
|
|
923
|
+ dialog.loading = false
|
|
894
|
924
|
}
|
|
895
|
925
|
}
|
|
896
|
926
|
|
|
|
@@ -1240,22 +1270,23 @@ const handleExport = async () => {
|
|
1240
|
1270
|
const generateMonthlyAssessment = async () => {
|
|
1241
|
1271
|
try {
|
|
1242
|
1272
|
const tabText = currentTab.value === 'non-cadre' ? '非干部' : '干部'
|
|
1243
|
|
- ElMessageBox.confirm(`是否生成本月${tabText}考核数据?`, '提示', {
|
|
|
1273
|
+ ElMessageBox.confirm(`是否生成${queryParams.assessmentMonth}考核数据?`, '提示', {
|
|
1244
|
1274
|
confirmButtonText: '确定',
|
|
1245
|
1275
|
cancelButtonText: '取消',
|
|
1246
|
1276
|
type: 'warning'
|
|
1247
|
1277
|
}).then(async () => {
|
|
1248
|
1278
|
loading.value = true
|
|
1249
|
|
- const now = new Date()
|
|
1250
|
|
- const currentMonth = `${now.getFullYear()}${String(now.getMonth() + 1).padStart(2, '0')}`
|
|
|
1279
|
+ const queryMonth = queryParams.assessmentMonth.replace('-', '')
|
|
|
1280
|
+ const queryYear = parseInt(queryMonth.substring(0, 4))
|
|
|
1281
|
+ const queryMonthNum = parseInt(queryMonth.substring(4, 6))
|
|
1251
|
1282
|
|
|
1252
|
1283
|
if (currentTab.value === 'non-cadre') {
|
|
1253
|
|
- const res = await generateNonCadreAssessment({ month: currentMonth })
|
|
|
1284
|
+ const res = await generateNonCadreAssessment({ month: queryMonth })
|
|
1254
|
1285
|
ElMessage.success('生成成功')
|
|
1255
|
1286
|
} else {
|
|
1256
|
1287
|
const params = {
|
|
1257
|
|
- year: now.getFullYear(),
|
|
1258
|
|
- month: now.getMonth() + 1
|
|
|
1288
|
+ year: queryYear,
|
|
|
1289
|
+ month: queryMonthNum
|
|
1259
|
1290
|
}
|
|
1260
|
1291
|
const res = await generateCadreAssessment(params)
|
|
1261
|
1292
|
ElMessage.success('生成成功')
|