|
- /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
- * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
- * 创建人:超级管理员
- * 日 期:2021-09-24 10:33
- * 描 述:AwardAndPunishment
- */
- 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);
- //$('#AwardType').lrDataItemSelect({ code: 'EncouragementDegree' });
- $('#NatureType').lrselect({
- data: [{ text: "集体", value: "0" }, { text: "个人", value: "1" }],
- text: "text",
- value: "value"
- })
- $('#IsValid').lrselect({
- data: [{ text: "启用", value: "0" }, { text: "禁用", value: "1" }],
- text: "text",
- value: "value"
- })
- // 刷新
- $('#lr_refresh').on('click', function () {
- location.reload();
- });
- // 新增
- $('#lr_add').on('click', function () {
- learun.layerForm({
- id: 'form',
- title: '新增',
- url: top.$.rootUrl + '/EducationalAdministration/AwardAndPunishment/Form',
- width: 400,
- height: 250,
- 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 + '/EducationalAdministration/AwardAndPunishment/Form?keyValue=' + keyValue,
- width: 400,
- height: 250,
- 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 + '/EducationalAdministration/AwardAndPunishment/DeleteForm', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- //启用
- $('#lr_enabled').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Id');
- if (learun.checkrow(keyValue)) {
- learun.layerConfirm('是否确认启用选择项!', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/AwardAndPunishment/EnableDisable', { keyValue: keyValue, status: "0" }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- //禁用
- $('#lr_disabled').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Id');
- if (learun.checkrow(keyValue)) {
- learun.layerConfirm('是否确认禁用选择项!', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/AwardAndPunishment/EnableDisable', { keyValue: keyValue, status: "1" }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- },
- // 初始化列表
- initGird: function () {
- $('#gridtable').lrAuthorizeJfGrid({
- url: top.$.rootUrl + '/EducationalAdministration/AwardAndPunishment/GetPageList',
- headData: [
- { label: "惩罚名称", name: "AwardName", width: 100, align: "left" },
- { label: "惩罚代码", name: "CodePrize", width: 100, align: "left" },
- {
- label: '状态', name: 'IsValid', width: 100, align: "left",
- formatter: function (cellvalue) {
- return cellvalue == "0" ? "<span class=\"label label-success\">启用</span>" :
- "<span class=\"label label-danger\">禁用</span>";
- }
- },
- ],
- mainId: 'Id',
- isMultiselect: true,
- isPage: true,
- sord: 'desc'
- });
- page.search();
- },
- search: function (param) {
- param = param || {};
- param.IsAward = '1'
- $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
- }
- };
- refreshGirdData = function () {
- $('#gridtable').jfGridSet('reload');
- };
- page.init();
- }
|