|
- /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
- * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
- * 创建人:超级管理员
- * 日 期:2021-09-24 17:38
- * 描 述:奖励惩罚管理
- */
- 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);
- $('#NatureType').lrGirdSelect({
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=AwardSource',
- selectWord: 'id',
- value: 'id',
- text: 'awardname',
- headData:
- [
- { label: "奖励类型", name: "awardname", width: 100, align: "left" },
- {
- label: '奖励属性', name: 'naturetype', width: 100, align: "left",
- formatter: function (val) {
- if (val == '0') {
- return '集体';
- } else {
- return '个人';
- }
- }
- },
- {
- label: "奖励级别",name: "awardtype",width: 100,align: "left",
- formatterAsync: function(callback, value, row, op, $cell) {
- learun.clientdata.getAsync('dataItem',
- {
- key: value,
- code: 'EncouragementDegree',
- callback: function(_data) {
- callback(_data.text);
- }
- });
- },
- }
- ],
- select: function (item) {
- $("#NatureType").val(item.awardname);
- $("#shuxing").val(item.naturetype);
- $("#awardtype").val(item.awardtype);
- }
- });
- $('#StuName').lrGirdSelect({
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=StuInfoBasic',
- selectWord: 'stuno',
- value: 'stuno',
- text: 'stuname',
- headData:
- [
- { label: "学号", name: "stuno", width: 100, align: "left" },
- { label: "姓名", name: "stuname", width: 100, align: "left" },
- {
- label: "班级", name: "classno", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
- key: value,
- keyId: 'classno',
- callback: function (_data) {
- callback(_data['classname']);
- }
- });
- }
- },
- ],
- select: function (item) {
- $("#StuId").val(item.stuno);
- $("#RewardObjects").val(item.stuname);
- $("#ClassNo").val(item.classno);
- }
- });
- //$('#FileAddress').lrUploader();
- // 刷新
- $('#lr_refresh').on('click', function () {
- location.reload();
- });
- // 新增
- $('#lr_add').on('click', function () {
- learun.layerForm({
- id: 'form',
- title: '新增',
- url: top.$.rootUrl + '/EducationalAdministration/AwardPunishInfo/AwardForm',
- 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 + '/EducationalAdministration/AwardPunishInfo/AwardForm?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/AwardPunishInfo/DeleteForm', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- },
- // 初始化列表
- initGird: function () {
- $('#gridtable').lrAuthorizeJfGrid({
- url: top.$.rootUrl + '/EducationalAdministration/AwardPunishInfo/GetPageList',
- headData: [
- {
- label: "获奖对象", name: "RewardObjects", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'StuInfoBasic',
- key: value,
- keyId: 'stuno',
- callback: function (_data) {
- callback(_data['stuname']);
- }
- });
- }
- },
- {
- label: "班级", name: "ClassNo", width: 200, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
- key: value,
- keyId: 'classno',
- callback: function (_data) {
- callback(_data['classname']);
- }
- });
- }
- },
- {
- label: "奖励类型", name: "NatureType", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'AwardSource',
- key: value,
- keyId: 'id',
- callback: function (_data) {
- callback(_data['awardname']);
- }
- });
- }
- },
- {
- label: '奖励属性', name: 'NatureType', width: 100, align: "left",
- formatter: function (val) {
- if (val == '0') {
- return '集体';
- } else {
- return '个人';
- }
- }
- },
- { label: "获奖时间", name: "WinningTime", width: 100, align: "left" },
- ],
- mainId: 'Id',
- isMultiselect: true,
- isPage: true
- });
- page.search();
- },
- search: function (param) {
- param = param || {};
- param.IsVaild = '0'
- $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
- },
- downLoad: function (fileId) {
- top.learun.download({ url: top.$.rootUrl + '/LR_SystemModule/Annexes/DownAnnexesFile', param: { fileId: fileId, __RequestVerificationToken: top.$.lrToken }, method: 'POST' });
- }
- };
- refreshGirdData = function () {
- $('#gridtable').jfGridSet('reload');
- };
- page.init();
- }
-
- function downLoad(fileId, fileTwo) {
- if (fileTwo) {
-
- top.learun.postFormSilence(top.$.rootUrl + '/PersonnelManagement/MP_QualityObjectives/AddRecord', { fileId: fileTwo }, function () {
-
- });
- }
- top.learun.download({ url: top.$.rootUrl + '/LR_SystemModule/Annexes/DownAnnexesFile', param: { fileId: fileId, __RequestVerificationToken: $.lrToken }, method: 'POST' });
- }
|