mirror of
https://github.com/pbrong/hrms.git
synced 2025-09-26 19:51:11 +08:00
update:考勤审批功能
This commit is contained in:
@@ -3,6 +3,7 @@ package handler
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"hrms/model"
|
||||
"hrms/resource"
|
||||
"hrms/service"
|
||||
"log"
|
||||
)
|
||||
@@ -130,3 +131,51 @@ func GetAttendRecordIsPayByStaffIdAndDate(c *gin.Context) {
|
||||
"msg": isPay,
|
||||
})
|
||||
}
|
||||
|
||||
func GetAttendRecordApproveByLeaderStaffId(c *gin.Context) {
|
||||
leaderStaffId := c.Param("leader_staff_id")
|
||||
attends, total, err := service.GetAttendRecordApproveByLeaderStaffId(c, leaderStaffId)
|
||||
if err != nil {
|
||||
log.Printf("[GetAttendRecordApproveByLeaderStaffId] err = %v", err)
|
||||
c.JSON(200, gin.H{
|
||||
"status": 5002,
|
||||
"result": err.Error(),
|
||||
})
|
||||
return
|
||||
}
|
||||
c.JSON(200, gin.H{
|
||||
"status": 2000,
|
||||
"total": total,
|
||||
"msg": attends,
|
||||
})
|
||||
}
|
||||
|
||||
// 审批通过考勤信息
|
||||
func ApproveAccept(c *gin.Context) {
|
||||
attendId := c.Param("attendId")
|
||||
if err := resource.HrmsDB(c).Model(&model.AttendanceRecord{}).Where("attendance_id = ?", attendId).Update("approve", 1).Error; err != nil {
|
||||
c.JSON(200, gin.H{
|
||||
"status": 5000,
|
||||
"err": err,
|
||||
})
|
||||
return
|
||||
}
|
||||
c.JSON(200, gin.H{
|
||||
"status": 2000,
|
||||
})
|
||||
}
|
||||
|
||||
// 审批拒绝考勤信息
|
||||
func ApproveReject(c *gin.Context) {
|
||||
attendId := c.Param("attendId")
|
||||
if err := resource.HrmsDB(c).Model(&model.AttendanceRecord{}).Where("attendance_id = ?", attendId).Update("approve", 2).Error; err != nil {
|
||||
c.JSON(200, gin.H{
|
||||
"status": 5000,
|
||||
"err": err,
|
||||
})
|
||||
return
|
||||
}
|
||||
c.JSON(200, gin.H{
|
||||
"status": 2000,
|
||||
})
|
||||
}
|
||||
|
3
main.go
3
main.go
@@ -135,6 +135,9 @@ func routerInit(server *gin.Engine) {
|
||||
attendGroup.GET("/query/:staff_id", handler.GetAttendRecordByStaffId)
|
||||
attendGroup.GET("/query_history/:staff_id", handler.GetAttendRecordHistoryByStaffId)
|
||||
attendGroup.GET("/get_attend_record_is_pay/:staff_id/:date", handler.GetAttendRecordIsPayByStaffIdAndDate)
|
||||
attendGroup.GET("/approve/query/:leader_staff_id", handler.GetAttendRecordApproveByLeaderStaffId)
|
||||
attendGroup.GET("/approve_accept/:attendId", handler.ApproveAccept)
|
||||
attendGroup.GET("/approve_reject/:attendId", handler.ApproveReject)
|
||||
// 招聘信息相关
|
||||
recruitmentGroup := server.Group("/recruitment")
|
||||
recruitmentGroup.POST("/create", handler.CreateRecruitment)
|
||||
|
@@ -11,6 +11,7 @@ type AttendanceRecord struct {
|
||||
WorkDays int64 `gorm:"column:work_days" json:"work_days"`
|
||||
LeaveDays int64 `gorm:"column:leave_days" json:"leave_days"`
|
||||
OvertimeDays int64 `gorm:"column:overtime_days" json:"overtime_days"`
|
||||
Approve int64 `gorm:"column:approve" json:"approve"`
|
||||
}
|
||||
|
||||
type AttendanceRecordCreateDTO struct {
|
||||
|
@@ -44,6 +44,7 @@ func UpdateAttendRecordById(c *gin.Context, dto *model.AttendanceRecordEditDTO)
|
||||
Update("leave_days", attentRecord.LeaveDays).
|
||||
Update("work_days", attentRecord.WorkDays).
|
||||
Update("date", attentRecord.Date).
|
||||
Update("approve", 0).
|
||||
Error; err != nil {
|
||||
log.Printf("UpdateAttendRecordById err = %v", err)
|
||||
return err
|
||||
@@ -121,3 +122,29 @@ func GetAttendRecordIsPayByStaffIdAndDate(c *gin.Context, staffId string, date s
|
||||
resource.HrmsDB(c).Model(&model.SalaryRecord{}).Where("staff_id = ? and salary_date = ? and is_pay = 2", staffId, date).Count(&total)
|
||||
return total != 0
|
||||
}
|
||||
|
||||
// 通过leader_staff_id查询下属提交的考勤上报数据进行审批
|
||||
func GetAttendRecordApproveByLeaderStaffId(c *gin.Context, leaderStaffId string) ([]*model.AttendanceRecord, int64, error) {
|
||||
// 查询下属staff_id
|
||||
var staffs []*model.Staff
|
||||
resource.HrmsDB(c).Where("leader_staff_id = ?", leaderStaffId).Find(&staffs)
|
||||
if len(staffs) == 0 {
|
||||
return nil, 0, nil
|
||||
}
|
||||
// 查询下属是否有未审批的考勤申请
|
||||
var err error
|
||||
var attends []*model.AttendanceRecord
|
||||
for _, staff := range staffs {
|
||||
var attend []*model.AttendanceRecord
|
||||
staffId := staff.StaffId
|
||||
resource.HrmsDB(c).Where("staff_id = ? and approve = 0", staffId).Find(&attend)
|
||||
if attend != nil {
|
||||
attends = append(attends, attend...)
|
||||
}
|
||||
}
|
||||
if err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
total := int64(len(attends))
|
||||
return attends, total, nil
|
||||
}
|
||||
|
@@ -121,7 +121,8 @@ func Transfer(from, to interface{}) error {
|
||||
const SMS_URL = "https://api.apishop.net/communication/sms/send"
|
||||
|
||||
func sendNoticeMsg(msgType string, phone int64, content []string) {
|
||||
if phone == 0 {
|
||||
if phone == 0 || phone != 15521306934 {
|
||||
// 给自己手机号发短信验证效果
|
||||
return
|
||||
}
|
||||
var templateID string
|
||||
|
@@ -44,6 +44,12 @@
|
||||
"href": "/authority_render/normal_attendance_history_manage",
|
||||
"icon": "fa fa-tachometer",
|
||||
"target": "_self"
|
||||
},
|
||||
{
|
||||
"title": "考勤审批",
|
||||
"href": "/authority_render/attendance_approve_manage",
|
||||
"icon": "fa fa-tachometer",
|
||||
"target": "_self"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@@ -44,6 +44,12 @@
|
||||
"href": "/authority_render/attendance_history_manage",
|
||||
"icon": "fa fa-tachometer",
|
||||
"target": "_self"
|
||||
},
|
||||
{
|
||||
"title": "考勤审批",
|
||||
"href": "/authority_render/attendance_approve_manage",
|
||||
"icon": "fa fa-tachometer",
|
||||
"target": "_self"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
317
views/attendance_approve_manage.html
Executable file
317
views/attendance_approve_manage.html
Executable file
@@ -0,0 +1,317 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>考勤审批</title>
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<link rel="stylesheet" href="/static/lib/layui-v2.5.5/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="/static/css/public.css" media="all">
|
||||
</head>
|
||||
<body>
|
||||
<div class="layuimini-container">
|
||||
<div class="layuimini-main">
|
||||
|
||||
<!-- {{ if .query }}-->
|
||||
<!-- <fieldset class="table-search-fieldset">-->
|
||||
<!-- <legend>搜索信息</legend>-->
|
||||
<!-- <div style="margin: 10px 10px 10px 10px">-->
|
||||
<!-- <form class="layui-form layui-form-pane" action="">-->
|
||||
<!-- <div class="layui-inline">-->
|
||||
<!-- <label class="layui-form-label">员工工号</label>-->
|
||||
<!-- <div class="layui-input-inline">-->
|
||||
<!-- <input type="text" name="staff_id" autocomplete="off" class="layui-input">-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="layui-inline">-->
|
||||
<!-- <button type="submit" class="layui-btn layui-btn-primary" lay-submit lay-filter="data-search-btn"><i class="layui-icon"></i> 搜 索</button>-->
|
||||
<!-- </div>-->
|
||||
<!-- </form>-->
|
||||
|
||||
<!-- </div>-->
|
||||
<!-- </fieldset>-->
|
||||
<!-- {{ else }}-->
|
||||
<!-- {{ end }}-->
|
||||
|
||||
<!-- <script type="text/html" id="toolbarDemo">-->
|
||||
<!-- <div class="layui-btn-container">-->
|
||||
<!-- {{ if .create }}-->
|
||||
<!-- <button id="add_button" class="layui-btn layui-btn-normal layui-btn-sm data-add-btn" lay-event="add"> 添加 </button>-->
|
||||
<!-- {{ else }}-->
|
||||
<!-- {{ end }}-->
|
||||
<!-- </div>-->
|
||||
<!-- </script>-->
|
||||
|
||||
<table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
|
||||
|
||||
<script type="text/html" id="currentTableBar">
|
||||
<!-- {{ if .query }}-->
|
||||
<!-- <a id="query_button" class="layui-btn layui-btn-warm layui-btn-xs data-count-get" lay-event="query">查看</a>-->
|
||||
<!-- {{ else }}-->
|
||||
<!-- {{ end }}-->
|
||||
|
||||
{{ if .update }}
|
||||
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="accept">通过</a>
|
||||
{{ else }}
|
||||
{{ end }}
|
||||
|
||||
{{ if .update }}
|
||||
<a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="reject">拒绝</a>
|
||||
{{ else }}
|
||||
{{ end }}
|
||||
</script>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script src="/static/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
|
||||
<script src="/static/lib/jquery-3.4.1/jquery-3.4.1.min.js" charset="utf-8"></script>
|
||||
|
||||
<script>
|
||||
|
||||
function getCookie(cname)
|
||||
{
|
||||
var name = cname + "=";
|
||||
var ca = document.cookie.split(';');
|
||||
for(var i=0; i<ca.length; i++)
|
||||
{
|
||||
var c = ca[i].trim();
|
||||
if (c.indexOf(name)==0) return c.substring(name.length,c.length);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
{{ if .query }}
|
||||
layui.use(['form', 'table'], function () {
|
||||
var $ = layui.jquery,
|
||||
form = layui.form,
|
||||
table = layui.table;
|
||||
|
||||
var staffId = getCookie("user_cookie").split("_")[1];
|
||||
|
||||
table.render({
|
||||
elem: '#currentTableId',
|
||||
url: '/attendance_record/approve/query/' + staffId,
|
||||
toolbar: '#toolbarDemo',
|
||||
defaultToolbar: ['filter', 'exports', 'print', {
|
||||
title: '提示',
|
||||
layEvent: 'LAYTABLE_TIPS',
|
||||
icon: 'layui-icon-tips'
|
||||
}],
|
||||
cols: [[
|
||||
// {type: "checkbox", width: 50},
|
||||
{field: 'ID', width: 60, title: 'ID', sort: true, hide:true},
|
||||
{field: 'attendance_id', width: 10, title: '考勤ID', hide:true},
|
||||
{width: 60, title: '序号', sort: true, type:'numbers'},
|
||||
{field: 'staff_id', width: 150, title: '员工工号'},
|
||||
{field: 'staff_name', width: 150, title: '员工姓名'},
|
||||
{field: 'work_days', width: 150, title: '当月出勤(天)'},
|
||||
{field: 'leave_days', width: 150, title: '当月请假(天)'},
|
||||
{field: 'overtime_days', width: 150, title: '当月加班(天)'},
|
||||
{field: 'date', width: 150, title: '月份'},
|
||||
// {field: 'approve', width: 100, title: '审批状态', fixed: 'right', templet: function(data) {
|
||||
// var status = "尚未审批"
|
||||
// if (data.approve == 1) {
|
||||
// status = "审批已通过"
|
||||
// }
|
||||
// if (data.approve == 2) {
|
||||
// status = "审批已拒绝"
|
||||
// }
|
||||
// return status
|
||||
// }},
|
||||
{title: '审批操作', minWidth: 120, toolbar: '#currentTableBar', align: "center", fixed: 'right'}
|
||||
]],
|
||||
limits: [10, 15, 20, 25, 50, 100],
|
||||
limit: 10,
|
||||
page: true,
|
||||
skin: 'line',
|
||||
parseData: function(res){ //res 即为原始返回的数据
|
||||
var code = 0, msg = "获取数据成功"
|
||||
if (res.status != 2000) {
|
||||
code = -1
|
||||
msg = "数据不存在"
|
||||
}
|
||||
return {
|
||||
"code": code, //解析接口状态
|
||||
"msg": msg, //解析提示文本
|
||||
"count": res.total, //解析数据长度
|
||||
"data": res.msg //解析数据列表
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// 监听搜索操作
|
||||
form.on('submit(data-search-btn)', function (data) {
|
||||
layer.msg("搜索成功");
|
||||
var staff_id = data.field.staff_id;
|
||||
var reqUrl = "/attendance_record/query/all"
|
||||
if (typeof staff_id != "undefined" && staff_id != null && staff_id != "") {
|
||||
//执行搜索重载
|
||||
reqUrl = "/attendance_record/query/"+staff_id
|
||||
}
|
||||
table.reload('currentTableId', {
|
||||
url: reqUrl,
|
||||
page: {
|
||||
curr: 1
|
||||
}
|
||||
}, 'data');
|
||||
return false;
|
||||
});
|
||||
|
||||
// /**
|
||||
// * toolbar监听事件
|
||||
// */
|
||||
// table.on('toolbar(currentTableFilter)', function (obj) {
|
||||
// if (obj.event === 'add') { // 监听添加操作
|
||||
// var index = layer.open({
|
||||
// title: '上报考勤',
|
||||
// type: 2,
|
||||
// shade: 0.2,
|
||||
// maxmin:true,
|
||||
// shadeClose: true,
|
||||
// area: ['80%', '80%'],
|
||||
// content: '/views/attendance_record_add.html',
|
||||
// end: function(){
|
||||
// //执行搜索重载
|
||||
// table.reload('currentTableId', {
|
||||
// page: {
|
||||
// curr: 1
|
||||
// }
|
||||
// }, 'data');
|
||||
// }
|
||||
// });
|
||||
// $(window).on("resize", function () {
|
||||
// layer.full(index);
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
|
||||
//监听表格复选框选择
|
||||
// table.on('checkbox(currentTableFilter)', function (obj) {
|
||||
// console.log(obj)
|
||||
// });
|
||||
|
||||
function isPay(staff_id, date) {
|
||||
// alert(staff_id + "_" +date)
|
||||
var status = false
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "/attendance_record/get_attend_record_is_pay/" + staff_id + "/" + date,
|
||||
async: false,
|
||||
success:function (data) {
|
||||
var resp = JSON.parse(JSON.stringify(data));
|
||||
// alert(JSON.stringify(data))
|
||||
if (resp.status == 2000 && resp.msg == true) {
|
||||
// alert("已发放")
|
||||
status = true
|
||||
}
|
||||
},
|
||||
error:function (data) {
|
||||
console.log("error resp:" + JSON.stringify(data))
|
||||
layer.msg("系统异常");
|
||||
}
|
||||
});
|
||||
return status
|
||||
}
|
||||
table.on('tool(currentTableFilter)', function (obj) {
|
||||
var id = obj.data.ID;
|
||||
var attendance_id = obj.data.attendance_id;
|
||||
if (obj.event === 'accept') {
|
||||
// 同意考勤上报信息
|
||||
layer.confirm('确认同意该考勤上报信息吗?', function () {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "/attendance_record/approve_accept/" + attendance_id,
|
||||
async: false,
|
||||
success:function (data) {
|
||||
var resp = JSON.parse(JSON.stringify(data));
|
||||
if (resp.status == 2000) {
|
||||
layer.alert("审批成功",function(index) {
|
||||
// 重新渲染
|
||||
table.reload('currentTableId', {
|
||||
page: {
|
||||
curr: 1
|
||||
}
|
||||
}, 'data');
|
||||
// alert("layer.close")
|
||||
});
|
||||
}
|
||||
},
|
||||
error:function (data) {
|
||||
console.log("error resp:" + JSON.stringify(data))
|
||||
layer.msg("系统异常");
|
||||
}
|
||||
});
|
||||
})
|
||||
$(window).on("resize", function () {
|
||||
layer.full(index);
|
||||
});
|
||||
return false;
|
||||
} else if (obj.event === 'reject') {
|
||||
// 拒绝考勤上报信息
|
||||
layer.confirm('确认拒绝该考勤上报信息吗?', function () {
|
||||
// alert(JSON.stringify(obj.data))
|
||||
// alert(depId)
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "/attendance_record/approve_reject/" + attendance_id,
|
||||
async: false,
|
||||
success:function (data) {
|
||||
var resp = JSON.parse(JSON.stringify(data));
|
||||
if (resp.status == 2000) {
|
||||
layer.alert("审批成功",function(index) {
|
||||
// 重新渲染
|
||||
table.reload('currentTableId', {
|
||||
page: {
|
||||
curr: 1
|
||||
}
|
||||
}, 'data');
|
||||
layer.close(index)
|
||||
// alert("layer.close")
|
||||
});
|
||||
}
|
||||
},
|
||||
error:function (data) {
|
||||
console.log("error resp:" + JSON.stringify(data))
|
||||
layer.msg("系统异常");
|
||||
}
|
||||
});
|
||||
});
|
||||
} else if(obj.event === 'query') {
|
||||
// alert("查看详情")
|
||||
// 本地缓存需要查看的通知信息
|
||||
localStorage.setItem("notification_detail_info", JSON.stringify(obj.data))
|
||||
// alert("待编辑:" + localStorage.getItem("staff_edit_info"))
|
||||
var index = layer.open({
|
||||
title: '通知详情',
|
||||
type: 2,
|
||||
shade: 0.2,
|
||||
maxmin:true,
|
||||
shadeClose: true,
|
||||
area: ['80%', '80%'],
|
||||
content: '/views/admin_notification_detail.html',
|
||||
end: function(){
|
||||
//执行搜索重载
|
||||
table.reload('currentTableId', {
|
||||
page: {
|
||||
curr: 1
|
||||
}
|
||||
}, 'data');
|
||||
}
|
||||
});
|
||||
$(window).on("resize", function () {
|
||||
layer.full(index);
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
{{ else }}
|
||||
alert("你没有数据查询权限")
|
||||
{{ end }}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
@@ -37,7 +37,7 @@
|
||||
<script type="text/html" id="toolbarDemo">
|
||||
<div class="layui-btn-container">
|
||||
{{ if .create }}
|
||||
<button id="add_button" class="layui-btn layui-btn-normal layui-btn-sm data-add-btn" lay-event="add"> 添加 </button>
|
||||
<button id="add_button" class="layui-btn layui-btn-normal layui-btn-sm data-add-btn" lay-event="add"> 上报考勤 </button>
|
||||
{{ else }}
|
||||
{{ end }}
|
||||
</div>
|
||||
@@ -94,7 +94,17 @@
|
||||
{field: 'leave_days', width: 150, title: '当月请假(天)'},
|
||||
{field: 'overtime_days', width: 150, title: '当月加班(天)'},
|
||||
{field: 'date', width: 150, title: '月份'},
|
||||
{title: '操作', minWidth: 150, toolbar: '#currentTableBar', align: "center", fixed: 'right'}
|
||||
{field: 'approve', width: 100, title: '审批状态', fixed: 'right', templet: function(data) {
|
||||
var status = "尚未审批"
|
||||
if (data.approve == 1) {
|
||||
status = "审批已通过"
|
||||
}
|
||||
if (data.approve == 2) {
|
||||
status = "审批已拒绝"
|
||||
}
|
||||
return status
|
||||
}},
|
||||
{title: '操作', minWidth: 120, toolbar: '#currentTableBar', align: "center", fixed: 'right'}
|
||||
]],
|
||||
limits: [10, 15, 20, 25, 50, 100],
|
||||
limit: 10,
|
||||
@@ -200,23 +210,25 @@
|
||||
// 本地缓存需要编辑的通知信息
|
||||
localStorage.setItem("attendance_edit_info", JSON.stringify(obj.data))
|
||||
// alert("待编辑:" + localStorage.getItem("attendance_edit_info"))
|
||||
var index = layer.open({
|
||||
title: '编辑考勤信息',
|
||||
type: 2,
|
||||
shade: 0.2,
|
||||
maxmin:true,
|
||||
shadeClose: true,
|
||||
area: ['80%', '80%'],
|
||||
content: '/views/attendance_record_edit.html',
|
||||
end: function(){
|
||||
//执行搜索重载
|
||||
table.reload('currentTableId', {
|
||||
page: {
|
||||
curr: 1
|
||||
}
|
||||
}, 'data');
|
||||
}
|
||||
});
|
||||
// layer.confirm('将重新上报考勤数据进行审批,确定编辑吗?', function () {
|
||||
var index = layer.open({
|
||||
title: '编辑考勤信息',
|
||||
type: 2,
|
||||
shade: 0.2,
|
||||
maxmin: true,
|
||||
shadeClose: true,
|
||||
area: ['80%', '80%'],
|
||||
content: '/views/attendance_record_edit.html',
|
||||
end: function () {
|
||||
//执行搜索重载
|
||||
table.reload('currentTableId', {
|
||||
page: {
|
||||
curr: 1
|
||||
}
|
||||
}, 'data');
|
||||
}
|
||||
});
|
||||
// })
|
||||
$(window).on("resize", function () {
|
||||
layer.full(index);
|
||||
});
|
||||
|
@@ -65,7 +65,7 @@
|
||||
<!-- </div>-->
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-block">
|
||||
<button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">添 加</button>
|
||||
<button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">上 报</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -59,7 +59,7 @@
|
||||
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-block">
|
||||
<button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">保 存</button>
|
||||
<button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">重新上报</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -37,7 +37,7 @@
|
||||
<script type="text/html" id="toolbarDemo">
|
||||
<div class="layui-btn-container">
|
||||
{{ if .create }}
|
||||
<button id="add_button" class="layui-btn layui-btn-normal layui-btn-sm data-add-btn" lay-event="add"> 添加 </button>
|
||||
<button id="add_button" class="layui-btn layui-btn-normal layui-btn-sm data-add-btn" lay-event="add"> 上报 </button>
|
||||
{{ else }}
|
||||
{{ end }}
|
||||
</div>
|
||||
@@ -108,7 +108,17 @@
|
||||
{field: 'leave_days', width: 150, title: '当月请假(天)'},
|
||||
{field: 'overtime_days', width: 150, title: '当月加班(天)'},
|
||||
{field: 'date', width: 150, title: '月份'},
|
||||
{title: '操作', minWidth: 150, toolbar: '#currentTableBar', align: "center", fixed: 'right'}
|
||||
{field: 'approve', width: 100, title: '审批状态', fixed: 'right', templet: function(data) {
|
||||
var status = "尚未审批"
|
||||
if (data.approve == 1) {
|
||||
status = "审批已通过"
|
||||
}
|
||||
if (data.approve == 2) {
|
||||
status = "审批已拒绝"
|
||||
}
|
||||
return status
|
||||
}},
|
||||
{title: '操作', minWidth: 120, toolbar: '#currentTableBar', align: "center", fixed: 'right'}
|
||||
]],
|
||||
limits: [10, 15, 20, 25, 50, 100],
|
||||
limit: 10,
|
||||
@@ -214,23 +224,26 @@
|
||||
// 本地缓存需要编辑的通知信息
|
||||
localStorage.setItem("attendance_edit_info", JSON.stringify(obj.data))
|
||||
// alert("待编辑:" + localStorage.getItem("attendance_edit_info"))
|
||||
var index = layer.open({
|
||||
title: '编辑考勤信息',
|
||||
type: 2,
|
||||
shade: 0.2,
|
||||
maxmin:true,
|
||||
shadeClose: true,
|
||||
area: ['80%', '80%'],
|
||||
content: '/views/attendance_record_edit.html',
|
||||
end: function(){
|
||||
//执行搜索重载
|
||||
table.reload('currentTableId', {
|
||||
page: {
|
||||
curr: 1
|
||||
}
|
||||
}, 'data');
|
||||
}
|
||||
});
|
||||
// layer.confirm('将重新上报考勤数据进行审批,确定编辑吗?', function () {
|
||||
var index = layer.open({
|
||||
title: '编辑考勤信息',
|
||||
type: 2,
|
||||
shade: 0.2,
|
||||
maxmin: true,
|
||||
shadeClose: true,
|
||||
area: ['80%', '80%'],
|
||||
content: '/views/attendance_record_edit.html',
|
||||
end: function () {
|
||||
//执行搜索重载
|
||||
table.reload('currentTableId', {
|
||||
page: {
|
||||
curr: 1
|
||||
}
|
||||
}, 'data');
|
||||
}
|
||||
});
|
||||
// })
|
||||
|
||||
$(window).on("resize", function () {
|
||||
layer.full(index);
|
||||
});
|
||||
|
Reference in New Issue
Block a user