|
- /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
- * Copyright (c) 2013-2018 北京泉江科技有限公司
- * 创建人:超级管理员
- * 日 期:2020-03-27 17:38
- * 描 述:工资模板管理
- */
- 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/Sal_SalaryTemplate/Form',
- width: 600,
- height: 400,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- });
- // 编辑
- $('#lr_edit').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('STId');
- if (learun.checkrow(keyValue)) {
- learun.layerForm({
- id: 'form',
- title: '编辑',
- url: top.$.rootUrl + '/PersonnelManagement/Sal_SalaryTemplate/Form?keyValue=' + keyValue,
- width: 600,
- height: 400,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- }
- });
- // 删除
- $('#lr_delete').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('STId');
- if (learun.checkrow(keyValue)) {
- learun.layerConfirm('是否确认删除该项!', function (res) {
- if (res) {
- learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/Sal_SalaryTemplate/DeleteForm', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- //启用
- $('#lr_enable').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('STId');
- if (learun.checkrow(keyValue)) {
- learun.layerConfirm('是否确认启用该项!', function (res) {
- if (res) {
- learun.httpAsync('post', top.$.rootUrl + '/PersonnelManagement/Sal_SalaryTemplate/EnableTemplate', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
-
- //模板列编辑
- $('#lr_columnset').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('STId');
- var enable = $("#gridtable").jfGridValue('F_EnabledMark');
- if (learun.checkrow(keyValue)) {
- learun.layerFormForPercent({
- id: 'columnform',
- title: '模板列编辑',
- url: top.$.rootUrl + '/PersonnelManagement/Sal_SalaryTemplateItem/Index?enable=' + enable + '&keyValue=' + keyValue,
- width: '80%',
- height: '80%',
- btn: null
-
- });
- }
- });
- },
- // 初始化列表
- initGird: function () {
- $('#gridtable').lrAuthorizeJfGrid({
- url: top.$.rootUrl + '/PersonnelManagement/Sal_SalaryTemplate/GetPageList',
- headData: [
- { label: "模板名称", name: "STName", width: 100, align: "left" },
- {
- label: "是否启用", name: "F_EnabledMark", width: 100, align: "left",
- formatter: function (cellvalue) {
- return cellvalue == '1' ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
- }
- },
- { label: "创建人", name: "F_CreateUserId", width: 100, align: "left" },
- { label: "创建时间", name: "F_CreateDate", width: 100, align: "left" },
- { label: "创建人名字", name: "F_CreateUserName", width: 100, align: "left" },
- { label: "修改时间", name: "F_ModifyDate", width: 100, align: "left" },
- { label: "修改人名字", name: "F_ModifyUserName", width: 100, align: "left" },
- ],
- mainId: 'STId',
- isPage: true
- });
- page.search();
- },
- search: function (param) {
- param = param || {};
- $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
- }
- };
- refreshGirdData = function () {
- page.search();
- };
- page.init();
- }
|