From eeb57a1e73a1bc8cc4dd5f78c283c69cfbc633e4 Mon Sep 17 00:00:00 2001
From: BAOLH <baolh@yhzhg.cn>
Date: Wed, 15 Jul 2026 02:13:45 +0000
Subject: [PATCH] 工资详情页添加出差和调休相关跳转功能

---
 eladmin-web-master/src/views/attendance/attendanceOvertime/index.vue       |   12 +++++++++++-
 eladmin-web-master/src/views/salary/newSalary/index.vue                    |   21 +++++++++++++++++++--
 eladmin-web-master/src/views/attendance/attendanceBusinessTravel/index.vue |   13 ++++++++++++-
 3 files changed, 42 insertions(+), 4 deletions(-)

diff --git a/eladmin-web-master/src/views/attendance/attendanceBusinessTravel/index.vue b/eladmin-web-master/src/views/attendance/attendanceBusinessTravel/index.vue
index 8bd12ed..3096e50 100644
--- a/eladmin-web-master/src/views/attendance/attendanceBusinessTravel/index.vue
+++ b/eladmin-web-master/src/views/attendance/attendanceBusinessTravel/index.vue
@@ -715,7 +715,8 @@
       url: 'api/attendanceBusinessTravel',
       idField: 'id',
       sort: 'travelStartTime,desc',
-      crudMethod: { ...crudAttendanceBusinessTravel }
+      crudMethod: { ...crudAttendanceBusinessTravel },
+      queryOnPresenterCreated: false
     })
   },
   // 数据字典constant
@@ -799,6 +800,16 @@
         that.wecomApprovalVisible = true
       }
     })
+
+    // 从路由中获取参数
+    const { userId, travelStartTime, travelEndTime } = that.$route.query
+    // 将参数注入到查询参数中
+    userId && (that.$set(that.crud.query, 'userId', Number(userId)))
+    travelStartTime && (that.$set(that.crud.query, 'travelStartTime', travelStartTime))
+    travelEndTime && (that.$set(that.crud.query, 'travelEndTime', travelEndTime))
+    // 执行查询
+    that.crud.toQuery()
+    that.$router.replace({ path: that.$route.path, query: {}})
   },
   methods: {
     // 钩子:在获取表格数据之前执行,false 则代表不获取数据
diff --git a/eladmin-web-master/src/views/attendance/attendanceOvertime/index.vue b/eladmin-web-master/src/views/attendance/attendanceOvertime/index.vue
index 055fba8..7e27b55 100644
--- a/eladmin-web-master/src/views/attendance/attendanceOvertime/index.vue
+++ b/eladmin-web-master/src/views/attendance/attendanceOvertime/index.vue
@@ -301,7 +301,7 @@
   components: { pagination, crudOperation, rrOperation, udOperation, approvalLine, cpApprovalDelDialog },
   mixins: [presenter(), header(), form(defaultForm), crud()],
   cruds() {
-    return CRUD({ title: '考勤加班', url: 'api/attendanceOvertime', idField: 'id', sort: 'id,desc', crudMethod: { ...crudAttendanceOvertime }})
+    return CRUD({ title: '考勤加班', url: 'api/attendanceOvertime', idField: 'id', sort: 'id,desc', crudMethod: { ...crudAttendanceOvertime }, queryOnPresenterCreated: false })
   },
   dicts: [constant.OVERTIME_STATUS, constant.APPROVAL_SITE_TYPE],
   data() {
@@ -375,6 +375,16 @@
         that.wecomApprovalVisible = true
       }
     })
+
+    // 从路由中获取参数
+    const { userId, overtimeStartTime, overtimeEndTime } = that.$route.query
+    // 将参数注入到查询参数中
+    userId && (that.$set(that.crud.query, 'userId', Number(userId)))
+    overtimeStartTime && overtimeEndTime && (that.$set(that.crud.query, 'overtimeStartTime', [overtimeStartTime, overtimeEndTime]))
+    overtimeStartTime && overtimeEndTime && (that.$set(that.crud.query, 'overtimeEndTime', [overtimeStartTime, overtimeEndTime]))
+    // 执行查询
+    that.crud.toQuery()
+    that.$router.replace({ path: that.$route.path, query: {}})
   },
   methods: {
     // 钩子:在获取表格数据之前执行,false 则代表不获取数据
diff --git a/eladmin-web-master/src/views/salary/newSalary/index.vue b/eladmin-web-master/src/views/salary/newSalary/index.vue
index c5e2fab..eea41b3 100644
--- a/eladmin-web-master/src/views/salary/newSalary/index.vue
+++ b/eladmin-web-master/src/views/salary/newSalary/index.vue
@@ -292,7 +292,9 @@
         </el-table-column>
         <el-table-column :show-overflow-tooltip="true" prop="travelAllowance" label="其他补助(出差)" width="110">
           <template slot-scope="scope">
-            {{ crud.toMoney((scope.row.travelAllowance == null ? 0 : scope.row.travelAllowance)) }}
+            <el-link type="primary" class="fs-12" @click="$router.push({ path: '/attendance/attendanceBusinessTravel', query: { userId: scope.row.userId, travelStartTime: scope.row.salaryYearMonth, travelEndTime: getMonthLastDay(scope.row.salaryYearMonth) } })">
+              {{ crud.toMoney((scope.row.travelAllowance == null ? 0 : scope.row.travelAllowance)) }}
+            </el-link>
           </template>
         </el-table-column>
         <el-table-column :show-overflow-tooltip="true" prop="overtimeAllowance" label="其他补助(加班)" width="110">
@@ -302,7 +304,9 @@
         </el-table-column>
         <el-table-column :show-overflow-tooltip="true" prop="comptimeAllowance" label="其他补助(调休)" width="110">
           <template slot-scope="scope">
-            {{ crud.toMoney((scope.row.comptimeAllowance == null ? 0 : scope.row.comptimeAllowance)) }}
+            <el-link type="primary" class="fs-12" @click="$router.push({ path: '/attendance/attendanceOvertime', query: { userId: scope.row.userId, overtimeStartTime: scope.row.salaryYearMonth, overtimeEndTime: getMonthLastDay(scope.row.salaryYearMonth) } })">
+              {{ crud.toMoney((scope.row.comptimeAllowance == null ? 0 : scope.row.comptimeAllowance)) }}
+            </el-link>
           </template>
         </el-table-column>
         <el-table-column :show-overflow-tooltip="true" prop="preTaxAmount" label="税前金额" width="100">
@@ -1158,6 +1162,16 @@
         tempList.push(temp[e[i].length - 1])
       }
       this.selval = tempList
+    },
+    // 获取当月最后一天
+    getMonthLastDay(dateStr) {
+      const date = new Date(dateStr)
+      // 获取当月最后一天
+      const lastDay = new Date(date.getFullYear(), date.getMonth() + 1, 0)
+      // 设置为 23:59:59
+      lastDay.setHours(23, 59, 59, 999)
+      // 格式化为字符串
+      return this.parseTime(lastDay, '{y}-{m}-{d} {h}:{i}:{s}')
     }
   }
 }
@@ -1169,4 +1183,7 @@
     color: red;
     font-size: 12px;
   }
+  .fs-12 {
+    font-size: 12px;
+  }
 </style>

--
Gitblit v1.9.3