|
@@ -267,7 +267,25 @@
|
267
|
267
|
</div>
|
268
|
268
|
</el-dialog>
|
269
|
269
|
<el-dialog title="打印绩效统计表" :visible.sync="printDialogVisible" width="800px" append-to-body>
|
270
|
|
- <performance-print :form="form" :performanceTableData="performanceTableData"
|
|
270
|
+ <div class="mb20">
|
|
271
|
+ <el-radio-group v-model="selectedPrintType">
|
|
272
|
+ <el-radio label="all">打印全部部门</el-radio>
|
|
273
|
+ <el-radio label="selected">选择部门打印</el-radio>
|
|
274
|
+ </el-radio-group>
|
|
275
|
+ <div v-if="selectedPrintType === 'selected'" class="mt10">
|
|
276
|
+ <el-select v-model="selectedDepts" multiple placeholder="请选择要打印的部门" style="width: 100%">
|
|
277
|
+ <el-option
|
|
278
|
+ v-for="dept,index in availableDepts"
|
|
279
|
+ :key="index + dept.deptName"
|
|
280
|
+ :label="dept.deptName"
|
|
281
|
+ :value="dept.deptName">
|
|
282
|
+ </el-option>
|
|
283
|
+ </el-select>
|
|
284
|
+ </div>
|
|
285
|
+ </div>
|
|
286
|
+ <performance-print
|
|
287
|
+ :form="form"
|
|
288
|
+ :performanceTableData="filteredPerformanceData"
|
271
|
289
|
@cancel="printDialogVisible = false" />
|
272
|
290
|
</el-dialog>
|
273
|
291
|
<el-dialog title="退回" :visible.sync="returnOpen" width="40%" append-to-body>
|
|
@@ -283,6 +301,7 @@ import { listPerformance, getPerformance, addPerformance, updatePerformance, del
|
283
|
301
|
import { listPerformanceStaff, getPerformanceStaff, updatePerformanceStaff, getMonthPerformanceList } from "@/api/oa/performance/performanceStaff";
|
284
|
302
|
import { getUsersDeptLeaderByDept, getUsersManageLeaderByDept, getUserByPost } from '@/api/system/post'
|
285
|
303
|
import { listProject } from "@/api/oa/project/project";
|
|
304
|
+import { downloadTemplate } from "@/api/file/project";
|
286
|
305
|
import { getUserByRole } from "@/api/system/role";
|
287
|
306
|
import { getToken } from "@/utils/auth";
|
288
|
307
|
import PerformancePrint from '../components/print/performancePrint.vue';
|
|
@@ -353,6 +372,19 @@ export default {
|
353
|
372
|
returnOpen: false,
|
354
|
373
|
showAlter: true,
|
355
|
374
|
groupedPerformanceData: [],
|
|
375
|
+ selectedPrintType: 'all',
|
|
376
|
+ selectedDepts: [],
|
|
377
|
+ availableDepts: [],
|
|
378
|
+ }
|
|
379
|
+ },
|
|
380
|
+ computed: {
|
|
381
|
+ filteredPerformanceData() {
|
|
382
|
+ if (this.selectedPrintType === 'all') {
|
|
383
|
+ return this.performanceTableData;
|
|
384
|
+ }
|
|
385
|
+ return this.performanceTableData.filter(item =>
|
|
386
|
+ this.selectedDepts.includes(item.dept?.deptName)
|
|
387
|
+ );
|
356
|
388
|
}
|
357
|
389
|
},
|
358
|
390
|
created() {
|
|
@@ -537,10 +569,10 @@ export default {
|
537
|
569
|
},
|
538
|
570
|
/* 下载模板 */
|
539
|
571
|
importTemplate() {
|
540
|
|
- const path = '/profile/upload/template/userWage.xlsx'
|
|
572
|
+ const path = '/profile/upload/template/绩效模版.xlsx'
|
541
|
573
|
downloadTemplate(path).then(res => {
|
542
|
574
|
const blob = new Blob([res])
|
543
|
|
- saveAs(blob, '社保公积金模版.xlsx');
|
|
575
|
+ saveAs(blob, '绩效模版.xlsx');
|
544
|
576
|
});
|
545
|
577
|
},
|
546
|
578
|
handleEdit(row, type) {
|
|
@@ -637,6 +669,17 @@ export default {
|
637
|
669
|
this.showAlter = val
|
638
|
670
|
},
|
639
|
671
|
printPerformanceTable() {
|
|
672
|
+ // Get unique departments from performance data
|
|
673
|
+ const deptMap = new Map();
|
|
674
|
+ this.performanceTableData.forEach(item => {
|
|
675
|
+ if (item.dept?.deptName) {
|
|
676
|
+ deptMap.set(item.dept.deptName, item.dept);
|
|
677
|
+ }
|
|
678
|
+ });
|
|
679
|
+ console.log(this.performanceTableData);
|
|
680
|
+ this.availableDepts = Array.from(deptMap.values());
|
|
681
|
+ this.selectedDepts = [];
|
|
682
|
+ this.selectedPrintType = 'all';
|
640
|
683
|
this.printDialogVisible = true;
|
641
|
684
|
},
|
642
|
685
|
}
|