Преглед изворни кода

考勤功能-修复打卡后班次详情没刷新数据的bug

zhonghuizhen пре 1 година
родитељ
комит
5752a8b6e3
2 измењених фајлова са 11 додато и 2 уклоњено
  1. 0 1
      src/views/system/dashboard/components/util.js
  2. 11 1
      src/views/system/homepage/index.vue

+ 0 - 1
src/views/system/dashboard/components/util.js

@@ -729,7 +729,6 @@ export function buildComponent (name, column, preview, vm) {
                         this.$message.warning('考勤数据异常!')
                         return
                     }
-                    debugger
                     // 更新打卡请求
                     attendanceDetailClockIn({ id: attendance.id_ }).then(() => {
                         this.$message.success('打卡成功!')

+ 11 - 1
src/views/system/homepage/index.vue

@@ -711,7 +711,17 @@ export default {
                 case 'banci':
                 {
                     this.banciInfo = dateArr
-                    this.banciDialogVisible = true
+                    // 更新考勤数据
+                    const self = this
+                    const sql = `select * from t_attendance_detail where id_ = '${dateArr.attendance?.id_}' `
+                    this.$common.request('sql', sql).then((res) => {
+                        const obj = res.variables.data[0] || dateArr.attendance
+                        self.banciInfo = {
+                            ...self.banciInfo, // 保留其他属性
+                            attendance: obj // 更新 attendance
+                        }
+                        self.banciDialogVisible = true
+                    })
                     break
                 }
                 case 'buka':