/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 * 创建人:超级管理员 * 日 期:2020-09-03 14:57 * 描 述:考勤限制 */ var refreshGirdData; var bootstrap = function ($, learun) { "use strict"; var page = { init: function () { page.initGird(); page.bind(); }, bind: function () { // 刷新 $('#lr_refresh').on('click', function () { location.reload(); }); // 新增 $('#lr_add').on('click', function () { learun.layerForm({ id: 'form', title: '新增', url: top.$.rootUrl + '/PersonnelManagement/ADR_Restriction/Form', width: 600, height: 520, callBack: function (id) { return top[id].acceptClick(refreshGirdData); } }); }); // 编辑 $('#lr_edit').on('click', function () { var keyValue = $('#gridtable').jfGridValue('ID'); if (learun.checkrow(keyValue)) { learun.layerForm({ id: 'form', title: '编辑', url: top.$.rootUrl + '/PersonnelManagement/ADR_Restriction/Form?keyValue=' + keyValue, width: 600, height: 520, callBack: function (id) { return top[id].acceptClick(refreshGirdData); } }); } }); // 删除 $('#lr_delete').on('click', function () { var keyValue = $('#gridtable').jfGridValue('ID'); if (learun.checkrow(keyValue)) { learun.layerConfirm('是否确认删除该项!', function (res) { if (res) { learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/ADR_Restriction/DeleteForm', { keyValue: keyValue }, function () { refreshGirdData(); }); } }); } }); // 启用 $('#lr_enable').on('click', function () { var keyValue = $('#gridtable').jfGridValue('ID'); if (learun.checkrow(keyValue)) { learun.layerConfirm('是否确认启用!', function (res) { if (res) { learun.postForm(top.$.rootUrl + '/PersonnelManagement/ADR_Restriction/Enable', { keyValue: keyValue }, function () { refreshGirdData(); }); } }); } }); }, // 初始化列表 initGird: function () { $('#gridtable').lrAuthorizeJfGrid({ url: top.$.rootUrl + '/PersonnelManagement/ADR_Restriction/GetPageList', headData: [ { label: "上班时间", name: "WorkTime", width: 100, align: "left" }, //{ label: "签到开始时间", name: "SignInStartTime", width: 100, align: "left" }, //{ label: "签到结束时间", name: "SignInEndTime", width: 100, align: "left" }, { label: "下班时间", name: "CloseTime", width: 100, align: "left" }, //{ label: "签退开始时间", name: "SignOutStartTime", width: 100, align: "left" }, //{ label: "签退结束时间", name: "SignOutEndTime", width: 100, align: "left" }, { label: "打卡次数", name: "ClockTime", width: 100, align: "left" }, { label: "中午签退时间", name: "NoonCloseTime", width: 100, align: "left" }, { label: "中午签退开始时间", name: "SignOutStartTime2", width: 150, align: "left" }, { label: "中午签退结束时间", name: "SignOutEndTime2", width: 150, align: "left" }, { label: "中午签到时间", name: "NoonWorkTime", width: 100, align: "left" }, { label: "中午签到开始时间", name: "SignInStartTime2", width: 150, align: "left" }, { label: "中午签到结束时间", name: "SignInEndTime2", width: 150, align: "left" }, { label: "允许迟到范围(分)", name: "LateOvertime", width: 100, align: "left" }, { label: "允许早退范围(分)", name: "LeaveOverTime", width: 100, align: "left" }, { label: "未签到,记为", name: "NoSignIn", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('dataItem', { key: value, code: 'ADStatus', callback: function (_data) { callback(_data.text); } }); } }, { label: "未签退,记为", name: "NoSignOut", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('dataItem', { key: value, code: 'ADStatus', callback: function (_data) { callback(_data.text); } }); } }, { label: "是否启用", name: "REnable", width: 100, align: "left", formatter: function (val) { return val ? "" : ""; } }, ], mainId: 'ID', isPage: true }); page.search(); }, search: function (param) { param = param || {}; $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; refreshGirdData = function () { $('#gridtable').jfGridSet('reload'); }; page.init(); }