/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 * 创建人:超级管理员 * 日 期:2021-09-27 10:33 * 描 述:学金类型 */ 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); $('#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/Scholarship/FormZxj', 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)) { if (keyValue.indexOf(',') != -1) { learun.alert.warning("只能选择一条记录进行编辑!"); return; } learun.layerForm({ id: 'form', title: '编辑', url: top.$.rootUrl + '/EducationalAdministration/Scholarship/FormZxj?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 + '/EducationalAdministration/Scholarship/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/Scholarship/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/Scholarship/EnableDisable', { keyValue: keyValue, status: "1" }, function () { refreshGirdData(); }); } }); } }); }, // 初始化列表 initGird: function () { $('#gridtable').lrAuthorizeJfGrid({ url: top.$.rootUrl + '/EducationalAdministration/Scholarship/GetPageList', headData: [ { label: "助学金名称", name: "ItemName", width: 200, align: "left" }, { label: "助学金代码", name: "ItemCode", width: 200, align: "left" }, { label: '状态', name: 'IsValid', width: 200, align: "left", formatter: function (cellvalue) { return cellvalue == "0" ? "启用" : "禁用"; } }, ], mainId: 'Id', isMultiselect: true,//复选框 isPage: true }); page.search(); }, search: function (param) { param = param || {}; param.IsType = '1' $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; refreshGirdData = function () { $('#gridtable').jfGridSet('reload'); }; page.init(); }