/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 * 创建人:超级管理员 * 日 期:2023-01-10 23:53 * 描 述:打卡时间管理 */ var refreshGirdData; var bootstrap = function ($, learun) { "use strict"; var page = { init: function () { page.initGird(); page.bind(); }, bind: function () { $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { page.search(queryJson); }, 220, 400); $('#IsUse').lrRadioCheckbox({ type: 'radio', code: 'YesOrNoBit', }); // 刷新 $('#lr_refresh').on('click', function () { location.reload(); }); // 新增 $('#lr_add').on('click', function () { learun.layerForm({ id: 'form', title: '新增', url: top.$.rootUrl + '/PersonnelManagement/PunchTime/Form', width: 600, height: 400, 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/PunchTime/Form?keyValue=' + keyValue, width: 600, height: 400, 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/PunchTime/DeleteForm', { keyValue: keyValue}, function () { refreshGirdData(); }); } }); } }); // 打印 $('#lr_print').on('click', function () { $('#gridtable').jqprintTable(); }); }, // 初始化列表 initGird: function () { $('#gridtable').lrAuthorizeJfGrid({ url: top.$.rootUrl + '/PersonnelManagement/PunchTime/GetPageList', headData: [ { label: "上班/下班", name: "PunchType", width: 100, align: "left"}, { label: "时间点", name: "TimePoint", width: 100, align: "left"}, { label: "误差(分钟)", name: "TimeError", width: 100, align: "left"}, { label: "班次", name: "ShiftType", width: 100, align: "left"}, { label: "启用", name: "IsUse", width: 100, align: "left", formatterAsync: function (callback, value, row, op,$cell) { learun.clientdata.getAsync('dataItem', { key: value, code: 'YesOrNoBit', callback: function (_data) { callback(_data.text); } }); }}, { label: "备注", name: "Remark", width: 100, align: "left"}, ], 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(); }