瀏覽代碼

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

余思翰 16 小時之前
父節點
當前提交
2c9ed45f1a

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

@@ -2,7 +2,7 @@
2 2
  * @Author: ysh
3 3
  * @Date: 2024-06-13 17:07:59
4 4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2025-05-29 14:29:39
5
+ * @LastEditTime: 2025-06-09 09:32:10
6 6
  */
7 7
 import request from '@/utils/request'
8 8
 
@@ -117,7 +117,7 @@ const apiEndpoints = [
117 117
     procDefName: '绩效审批',
118 118
     apiUrl: [
119 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,7 +2,7 @@
2 2
  * @Author: ysh
3 3
  * @Date: 2024-09-29 17:20:07
4 4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2025-06-06 16:27:32
5
+ * @LastEditTime: 2025-06-09 09:58:25
6 6
 -->
7 7
 <template>
8 8
   <div>
@@ -24,9 +24,9 @@
24 24
         </tr>
25 25
         <tr>
26 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 30
                 <td>姓名</td>
31 31
                 <td>部门</td>
32 32
                 <td>生产绩效</td>
@@ -38,9 +38,9 @@
38 38
                 <td>{{ index + 1 }}</td>
39 39
                 <td>{{ item.nickName }}</td>
40 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 44
                 <td>{{ parseTime(item.performanceMonth, '{y}-{m}') }}</td>
45 45
               </tr>
46 46
               <tr v-if="!performanceTableData || performanceTableData.length === 0">
@@ -49,14 +49,15 @@
49 49
               <tr>
50 50
                 <td colspan="3">总计</td>
51 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 53
                 </td>
54 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 56
                 </td>
57 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 59
                 </td>
60
+                <td></td>
60 61
               </tr>
61 62
             </table>
62 63
           </td>

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

@@ -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
   }

Loading…
取消
儲存