mirror of
https://github.com/FatttSnake/Pinnacle-OA.git
synced 2026-04-05 15:01:23 +08:00
handle view
This commit is contained in:
@@ -33,16 +33,22 @@ public class AttendanceController {
|
|||||||
List<Attendance> attendances = attendanceService.getAllAttendanceAndUser();
|
List<Attendance> attendances = attendanceService.getAllAttendanceAndUser();
|
||||||
return ResponseResult.build(ResponseCode.DATABASE_SELECT_OK, "success", attendances);
|
return ResponseResult.build(ResponseCode.DATABASE_SELECT_OK, "success", attendances);
|
||||||
}
|
}
|
||||||
|
//查询个人考勤
|
||||||
//模糊时间查询
|
@GetMapping("/selectAttendance")
|
||||||
|
public ResponseResult findAttendanceAndUser() {
|
||||||
|
Long userId = WebUtil.getLoginUser().getUser().getId();
|
||||||
|
List<Attendance> attendances = attendanceService.getAttendanceAndUserByid(userId);
|
||||||
|
return ResponseResult.build(ResponseCode.DATABASE_SELECT_OK, "success", attendances);
|
||||||
|
}
|
||||||
|
//模糊时间查询所有考勤信息
|
||||||
@GetMapping("/findAttendanceByTime")
|
@GetMapping("/findAttendanceByTime")
|
||||||
public ResponseResult findAttendanceAndUser(String startTime,String endTime) {
|
public ResponseResult findAttendanceAndUserByTime(String startTime,String endTime) {
|
||||||
List<Attendance> attendances = attendanceService.selectByTime(startTime, endTime);
|
List<Attendance> attendances = attendanceService.selectByTime(startTime, endTime);
|
||||||
return ResponseResult.build(ResponseCode.DATABASE_SELECT_OK, "success", attendances);
|
return ResponseResult.build(ResponseCode.DATABASE_SELECT_OK, "success", attendances);
|
||||||
}
|
}
|
||||||
//用户个人模糊时间查询
|
//用户个人模糊时间查询
|
||||||
@GetMapping("/findOneAttendanceByTime")
|
@GetMapping("/findOneAttendanceByTime")
|
||||||
public ResponseResult findOneAttendanceAndUser(String startTime,String endTime) {
|
public ResponseResult findOneAttendanceAndUserByTime(String startTime,String endTime) {
|
||||||
Long userId = WebUtil.getLoginUser().getUser().getId();
|
Long userId = WebUtil.getLoginUser().getUser().getId();
|
||||||
List<Attendance> attendances = attendanceService.selectOneByTime(startTime, endTime,userId);
|
List<Attendance> attendances = attendanceService.selectOneByTime(startTime, endTime,userId);
|
||||||
System.out.println(attendances);
|
System.out.println(attendances);
|
||||||
@@ -86,13 +92,7 @@ public class AttendanceController {
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
//查询个人考勤
|
|
||||||
@GetMapping("/selectAttendance")
|
|
||||||
public ResponseResult findAttendanceAndUser() {
|
|
||||||
Long userId = WebUtil.getLoginUser().getUser().getId();
|
|
||||||
List<Attendance> attendances = attendanceService.getAttendanceAndUserByid(userId);
|
|
||||||
return ResponseResult.build(ResponseCode.DATABASE_SELECT_OK, "success", attendances);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//删除考勤信息
|
//删除考勤信息
|
||||||
|
|||||||
@@ -88,13 +88,18 @@ export default {
|
|||||||
},
|
},
|
||||||
cancel() {
|
cancel() {
|
||||||
this.resetForm()
|
this.resetForm()
|
||||||
|
ElMessage({
|
||||||
|
message: '取消操作',
|
||||||
|
type: 'warning'
|
||||||
|
})
|
||||||
this.$emit('setDialogVisible', false)
|
this.$emit('setDialogVisible', false)
|
||||||
},
|
},
|
||||||
resetForm() {
|
resetForm() {
|
||||||
|
this.$nextTick(() => {
|
||||||
this.$refs.ruleForm.resetFields()
|
this.$refs.ruleForm.resetFields()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
if (this.formData) {
|
if (this.formData) {
|
||||||
this.form = this.formData
|
this.form = this.formData
|
||||||
|
|||||||
@@ -128,7 +128,21 @@
|
|||||||
|
|
||||||
<div>
|
<div>
|
||||||
<el-dialog
|
<el-dialog
|
||||||
v-model="dialogFormVisible"
|
v-model="addDialogFormVisible"
|
||||||
|
title="考勤信息"
|
||||||
|
width="25% "
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
:show-close="false"
|
||||||
|
>
|
||||||
|
<edit-attendance
|
||||||
|
:users="users"
|
||||||
|
:isDisabled="isDisabled"
|
||||||
|
@addAttendance="addAttendance"
|
||||||
|
@setDialogVisible="setDialogVisible"
|
||||||
|
></edit-attendance>
|
||||||
|
</el-dialog>
|
||||||
|
<el-dialog
|
||||||
|
v-model="editDialogFormVisible"
|
||||||
title="考勤信息"
|
title="考勤信息"
|
||||||
width="25% "
|
width="25% "
|
||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
@@ -170,7 +184,8 @@ export default {
|
|||||||
value1: '',
|
value1: '',
|
||||||
users: [],
|
users: [],
|
||||||
tableData: [],
|
tableData: [],
|
||||||
dialogFormVisible: false,
|
addDialogFormVisible: false,
|
||||||
|
editDialogFormVisible: false,
|
||||||
form: {
|
form: {
|
||||||
userId: '',
|
userId: '',
|
||||||
userName: '',
|
userName: '',
|
||||||
@@ -281,13 +296,14 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
setDialogVisible(dialogVisible) {
|
setDialogVisible(dialogVisible) {
|
||||||
this.dialogFormVisible = dialogVisible
|
this.addDialogFormVisible = dialogVisible
|
||||||
|
this.editDialogFormVisible = dialogVisible
|
||||||
this.getAttendances()
|
this.getAttendances()
|
||||||
},
|
},
|
||||||
// 打开添加弹窗
|
// 打开添加弹窗
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.getFormData()
|
this.getFormData()
|
||||||
this.dialogFormVisible = true
|
this.addDialogFormVisible = true
|
||||||
this.isDisabled = false
|
this.isDisabled = false
|
||||||
},
|
},
|
||||||
// 处理保存
|
// 处理保存
|
||||||
@@ -305,14 +321,15 @@ export default {
|
|||||||
// 获取更改数据
|
// 获取更改数据
|
||||||
viewUpdate(row) {
|
viewUpdate(row) {
|
||||||
this.getFormData()
|
this.getFormData()
|
||||||
this.dialogFormVisible = true
|
this.editDialogFormVisible = true
|
||||||
this.isDisabled = true
|
this.isDisabled = true
|
||||||
this.form = row
|
this.form = row
|
||||||
|
this.form.userId = row.user.username
|
||||||
this.form.status = row.status + ''
|
this.form.status = row.status + ''
|
||||||
},
|
},
|
||||||
addAttendance(formData) {
|
addAttendance(formData) {
|
||||||
this.doSave(formData)
|
this.doSave(formData)
|
||||||
this.dialogFormVisible = false
|
this.addDialogFormVisible = false
|
||||||
},
|
},
|
||||||
// 点击取消
|
// 点击取消
|
||||||
cancel() {
|
cancel() {
|
||||||
|
|||||||
Reference in New Issue
Block a user