|
- /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
- * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
- * 创建人:超级管理员
- * 日 期:2023-03-10 14:48
- * 描 述:团员评优申请管理
- */
- 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);
- // 刷新
- $('#lr_refresh').on('click', function () {
- location.reload();
- });
- // 新增
- $('#lr_add').on('click', function () {
- learun.layerForm({
- id: 'form',
- title: '新增',
- url: top.$.rootUrl + '/PersonnelManagement/LeagueMemberAppraise/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)) {
- var ApplyStatus = $('#gridtable').jfGridValue('ApplyStatus');
- if (ApplyStatus == "1") {
- learun.alert.warning("当前项申请中!");
- return false;
- } else if (ApplyStatus == "2") {
- learun.alert.warning("当前项已审核!");
- return false;
- } else if (ApplyStatus == "3") {
- learun.alert.warning("当前项未通过审核!");
- return false;
- }
- learun.layerForm({
- id: 'form',
- title: '编辑',
- url: top.$.rootUrl + '/PersonnelManagement/LeagueMemberAppraise/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)) {
- var ApplyStatus = $('#gridtable').jfGridValue('ApplyStatus');
- if (ApplyStatus == "1") {
- learun.alert.warning("当前项申请中!");
- return false;
- } else if (ApplyStatus == "2") {
- learun.alert.warning("当前项已审核!");
- return false;
- } else if (ApplyStatus == "3") {
- learun.alert.warning("当前项未通过审核!");
- return false;
- }
- learun.layerConfirm('是否确认删除该项!', function (res) {
- if (res) {
- learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/LeagueMemberAppraise/DeleteForm', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- // 提交申请
- $('#lr_apply').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Id');
- if (learun.checkrow(keyValue)) {
- var ApplyStatus = $('#gridtable').jfGridValue('ApplyStatus');
- if (ApplyStatus == "1") {
- learun.alert.warning("当前项申请中!");
- return false;
- } else if (ApplyStatus == "2") {
- learun.alert.warning("当前项已审核!");
- return false;
- } else if (ApplyStatus == "3") {
- learun.alert.warning("当前项未通过审核!");
- return false;
- }
- learun.layerConfirm('是否确认申请该项!', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/PersonnelManagement/LeagueMemberAppraise/DoSubmit', { keyValue: keyValue }, function (res) {
- refreshGirdData();
- });
- }
- });
- }
- });
- // 审核通过
- $('#lr_check').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Id');
- if (learun.checkrow(keyValue)) {
- var ApplyStatus = $('#gridtable').jfGridValue('ApplyStatus');
- if (ApplyStatus != "1") {
- learun.alert.warning("当前项不在申请中!");
- return false;
- }
- learun.layerConfirm('是否确认审核通过该项!', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/PersonnelManagement/LeagueMemberAppraise/DoCheck', { keyValue: keyValue, status: '2' }, function (res) {
- refreshGirdData();
- });
- }
- });
- }
- });
- // 审核不通过
- $('#lr_checkno').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Id');
- if (learun.checkrow(keyValue)) {
- var ApplyStatus = $('#gridtable').jfGridValue('ApplyStatus');
- if (ApplyStatus != "1") {
- learun.alert.warning("当前项不在申请中!");
- return false;
- }
- learun.layerConfirm('是否确认审核不通过该项!', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/PersonnelManagement/LeagueMemberAppraise/DoCheck', { keyValue: keyValue, status: '3' }, function (res) {
- refreshGirdData();
- });
- }
- });
- }
- });
- },
- // 初始化列表
- initGird: function () {
- $('#gridtable').lrAuthorizeJfGrid({
- url: top.$.rootUrl + '/PersonnelManagement/LeagueMemberAppraise/GetPageList',
- headData: [
- { label: "团员", name: "LeagueMember", width: 100, align: "left" },
- { label: "理由", name: "Reason", width: 100, align: "left" },
- { label: "证明", name: "Prove", width: 100, align: "left" },
- { label: "申请时间", name: "ApplyTime", width: 130, align: "left" },
- {
- label: "申请状态", name: "ApplyStatus", width: 100, align: "left", formatter: function (cellvalue) {
- return cellvalue == "1" ? "申请中" : cellvalue == "2" ? "申请已通过" : cellvalue == "3" ? "申请未通过" : "草稿";
- }
- },
- {
- label: "申请人", name: "CreateUserId", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('user', {
- key: value,
- callback: function (_data) {
- callback(_data.name);
- }
- });
- }
- },
- { label: "审核时间", name: "CheckTime", width: 130, align: "left" },
- {
- label: "审核人", name: "CheckUserId", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('user', {
- key: value,
- callback: function (_data) {
- callback(_data.name);
- }
- });
- }
- },
- ],
- mainId: 'Id',
- isPage: true,
- sidx: 'CreateTime'
- });
- page.search();
- },
- search: function (param) {
- param = param || {};
- $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
- }
- };
- refreshGirdData = function () {
- $('#gridtable').jfGridSet('reload');
- };
- page.init();
- }
|