浏览代码

网页端:修改绩效审批打印及流程取消

余思翰 16 小时前
父节点
当前提交
2c9ed45f1a

+ 2
- 2
oa-ui/src/utils/deleteResource.js 查看文件

2
  * @Author: ysh
2
  * @Author: ysh
3
  * @Date: 2024-06-13 17:07:59
3
  * @Date: 2024-06-13 17:07:59
4
  * @LastEditors: Please set LastEditors
4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2025-05-29 14:29:39
5
+ * @LastEditTime: 2025-06-09 09:32:10
6
  */
6
  */
7
 import request from '@/utils/request'
7
 import request from '@/utils/request'
8
 
8
 
117
     procDefName: '绩效审批',
117
     procDefName: '绩效审批',
118
     apiUrl: [
118
     apiUrl: [
119
       '/oa/performance/:id',
119
       '/oa/performance/:id',
120
-      '/oa/wage/batch/:id'
120
+      '/oa/performanceStaff/:id'
121
     ]
121
     ]
122
   },
122
   },
123
   {
123
   {

+ 11
- 10
oa-ui/src/views/flowable/form/components/print/performancePrint.vue 查看文件

2
  * @Author: ysh
2
  * @Author: ysh
3
  * @Date: 2024-09-29 17:20:07
3
  * @Date: 2024-09-29 17:20:07
4
  * @LastEditors: Please set LastEditors
4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2025-06-06 16:27:32
5
+ * @LastEditTime: 2025-06-09 09:58:25
6
 -->
6
 -->
7
 <template>
7
 <template>
8
   <div>
8
   <div>
24
         </tr>
24
         </tr>
25
         <tr>
25
         <tr>
26
           <td :colspan="9">
26
           <td :colspan="9">
27
-            <table border="1" style="width:100%;">
28
-              <tr>
29
-                <td style="width:50px;">序号</td>
27
+            <table border="1" style="width:100%;text-align: center;">
28
+              <tr style="font-weight: bold;">
29
+                <td style="width:70px;">序号</td>
30
                 <td>姓名</td>
30
                 <td>姓名</td>
31
                 <td>部门</td>
31
                 <td>部门</td>
32
                 <td>生产绩效</td>
32
                 <td>生产绩效</td>
38
                 <td>{{ index + 1 }}</td>
38
                 <td>{{ index + 1 }}</td>
39
                 <td>{{ item.nickName }}</td>
39
                 <td>{{ item.nickName }}</td>
40
                 <td>{{ item.dept.deptName }}</td>
40
                 <td>{{ item.dept.deptName }}</td>
41
-                <td style="text-align: right;">{{ item.producePerformance }}</td>
42
-                <td style="text-align: right;">{{ item.managePerformance }}</td>
43
-                <td style="text-align: right;">{{ (item.producePerformance + item.managePerformance).toFixed(2) }}</td>
41
+                <td style="text-align: right;">{{ item.producePerformance.toFixed(2) }}</td>
42
+                <td style="text-align: right;">{{ item.managePerformance.toFixed(2) }}</td>
43
+                <td style="text-align: right;">{{ (Number(item.producePerformance) + Number(item.managePerformance)).toFixed(2) }}</td>
44
                 <td>{{ parseTime(item.performanceMonth, '{y}-{m}') }}</td>
44
                 <td>{{ parseTime(item.performanceMonth, '{y}-{m}') }}</td>
45
               </tr>
45
               </tr>
46
               <tr v-if="!performanceTableData || performanceTableData.length === 0">
46
               <tr v-if="!performanceTableData || performanceTableData.length === 0">
49
               <tr>
49
               <tr>
50
                 <td colspan="3">总计</td>
50
                 <td colspan="3">总计</td>
51
                 <td style="text-align: right;">
51
                 <td style="text-align: right;">
52
-                  {{ performanceTableData.reduce((acc, curr) => acc + Number(curr.producePerformance), 0).toFixed(2) }}
52
+                  {{ performanceTableData.reduce((acc, curr) => acc + Number(curr.producePerformance || 0), 0).toFixed(2) }}
53
                 </td>
53
                 </td>
54
                 <td style="text-align: right;">
54
                 <td style="text-align: right;">
55
-                  {{ performanceTableData.reduce((acc, curr) => acc + Number(curr.managePerformance), 0).toFixed(2) }}
55
+                  {{ performanceTableData.reduce((acc, curr) => acc + Number(curr.managePerformance || 0), 0).toFixed(2) }}
56
                 </td>
56
                 </td>
57
                 <td style="text-align: right;">
57
                 <td style="text-align: right;">
58
-                  {{ performanceTableData.reduce((acc, curr) => acc + Number(curr.producePerformance) + Number(curr.managePerformance), 0).toFixed(2) }}
58
+                  {{ performanceTableData.reduce((acc, curr) => acc + Number(curr.producePerformance || 0) + Number(curr.managePerformance || 0), 0).toFixed(2) }}
59
                 </td>
59
                 </td>
60
+                <td></td>
60
               </tr>
61
               </tr>
61
             </table>
62
             </table>
62
           </td>
63
           </td>

+ 46
- 3
oa-ui/src/views/flowable/form/performance/performanceForm.vue 查看文件

267
       </div>
267
       </div>
268
     </el-dialog>
268
     </el-dialog>
269
     <el-dialog title="打印绩效统计表" :visible.sync="printDialogVisible" width="800px" append-to-body>
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
         @cancel="printDialogVisible = false" />
289
         @cancel="printDialogVisible = false" />
272
     </el-dialog>
290
     </el-dialog>
273
     <el-dialog title="退回" :visible.sync="returnOpen" width="40%" append-to-body>
291
     <el-dialog title="退回" :visible.sync="returnOpen" width="40%" append-to-body>
283
 import { listPerformanceStaff, getPerformanceStaff, updatePerformanceStaff, getMonthPerformanceList } from "@/api/oa/performance/performanceStaff";
301
 import { listPerformanceStaff, getPerformanceStaff, updatePerformanceStaff, getMonthPerformanceList } from "@/api/oa/performance/performanceStaff";
284
 import { getUsersDeptLeaderByDept, getUsersManageLeaderByDept, getUserByPost } from '@/api/system/post'
302
 import { getUsersDeptLeaderByDept, getUsersManageLeaderByDept, getUserByPost } from '@/api/system/post'
285
 import { listProject } from "@/api/oa/project/project";
303
 import { listProject } from "@/api/oa/project/project";
304
+import { downloadTemplate } from "@/api/file/project";
286
 import { getUserByRole } from "@/api/system/role";
305
 import { getUserByRole } from "@/api/system/role";
287
 import { getToken } from "@/utils/auth";
306
 import { getToken } from "@/utils/auth";
288
 import PerformancePrint from '../components/print/performancePrint.vue';
307
 import PerformancePrint from '../components/print/performancePrint.vue';
353
       returnOpen: false,
372
       returnOpen: false,
354
       showAlter: true,
373
       showAlter: true,
355
       groupedPerformanceData: [],
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
   created() {
390
   created() {
537
     },
569
     },
538
     /* 下载模板 */
570
     /* 下载模板 */
539
     importTemplate() {
571
     importTemplate() {
540
-      const path = '/profile/upload/template/userWage.xlsx'
572
+      const path = '/profile/upload/template/绩效模版.xlsx'
541
       downloadTemplate(path).then(res => {
573
       downloadTemplate(path).then(res => {
542
         const blob = new Blob([res])
574
         const blob = new Blob([res])
543
-        saveAs(blob, '社保公积金模版.xlsx');
575
+        saveAs(blob, '绩效模版.xlsx');
544
       });
576
       });
545
     },
577
     },
546
     handleEdit(row, type) {
578
     handleEdit(row, type) {
637
       this.showAlter = val
669
       this.showAlter = val
638
     },
670
     },
639
     printPerformanceTable() {
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
       this.printDialogVisible = true;
683
       this.printDialogVisible = true;
641
     },
684
     },
642
   }
685
   }

正在加载...
取消
保存