|
- /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
- * Copyright (c) 2013-2018 北京泉江科技有限公司
- * 创建人:超级管理员
- * 日 期:2019-07-17 11:20
- * 描 述:新生资助变更管理
- */
- var refreshGirdData;
- var NowGrade;
- var processId = '';
- var bootstrap = function ($, learun) {
- "use strict";
- var page = {
- init: function () {
- var data_grade = learun.httpGet(top.$.rootUrl + '/EducationalAdministration/StuEnroll/GetYearListByMaxClass',
- {});
- NowGrade = data_grade.info;
-
- page.initGird();
- page.bind();
- //page.refreshMoney();
- },
- bind: function () {
- $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
- page.search(queryJson);
- //page.refreshMoney();
- }, 380, 400);
-
- $("#IsSubsidize1").lrDataItemSelect({ code: "jyYewOrNot" });
- $('#Grade').lrselect({
- url: top.$.rootUrl + '/EducationalAdministration/StuEnroll/GetYearListByClass',
- value: "year",
- text: "year",
- });
- $('#Grade').lrselectSet(NowGrade);
-
- $('#DeptNo').lrselect({
- allowSearch: true,
- value: "deptno",
- text: "deptname",
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo',
- select: function (item) {
- if (item) {
- $('#MajorNo').lrselectRefresh({
- allowSearch: true,
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
- param: { strWhere: "DeptNo='" + item.deptno + "' AND CheckMark=1" }
- });
- } else {
- $('#MajorNo').lrselectRefresh({
- allowSearch: true,
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
- param: { strWhere: "1=1 AND CheckMark=1" }
- });
- }
-
- }
- });
- $('#MajorNo').lrselect({
- allowSearch: true,
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
- value: "majorno",
- text: "majorname",
- param: { strWhere: "1=1 AND CheckMark=1" },
- select: function (item) {
- if (item) {
- $('#ClassNo').lrselectRefresh({
- allowSearch: true,
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
- param: { strWhere: "majorno='" + item.majorno + "' AND CheckMark=1" }
- });
- } else {
- $('#ClassNo').lrselectRefresh({
- allowSearch: true,
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
- param: { strWhere: "1=1 AND CheckMark=1" }
- });
- }
- }
- });
- $('#ClassNo').lrselect({
- allowSearch: true,
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
- param: { strWhere: "1=1 AND CheckMark=1" },
- value: "classno",
- text: "classname"
- });
- // 刷新
- $('#lr_refresh').on('click', function () {
- location.reload();
- });
- // 打印
- $('#lr_print').on('click', function () {
- $('#gridtable').jqprintTable();
- });
- //查看
- $('#lr_view').on('click', function () {
- page.eye();
-
- //var keyValue = $('#gridtable').jfGridValue('StuId');
- //if (learun.checkrow(keyValue)) {
- // learun.layerForm({
- // id: 'form',
- // title: '查看',
- // url: top.$.rootUrl + '/EducationalAdministration/StuEnroll/FormView?keyValue=' + keyValue,
- // width: 800,
- // height: 600,
- // btn: null
- // });
- //}
- });
- //编辑
- $('#lr_edit').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('StuId');
- var status = $('#gridtable').jfGridValue('SupportStatus');
- if (status != 0) {
- learun.alert.warning("选中记录中已提交,不可编辑!");
- return;
- }
- if (learun.checkrow(keyValue)) {
- learun.layerForm({
- id: 'form',
- title: '编辑',
- url: top.$.rootUrl + '/EducationalAdministration/StuEnroll/HelpChange?keyValue=' + keyValue,
- width: 600,
- height: 400,
- callBack: function (id) {
- top[id].save();
- return refreshGirdData('', '');
- }
- });
- }
- });
- // 提交
- $('#lr_submit').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('StuId');
- if (learun.checkrow(keyValue)) {
- var status = $('#gridtable').jfGridValue('SupportStatus');
- if (status != 0) {
- learun.alert.warning("当前项目已提交,请耐心等待审批!");
- return;
- }
- learun.layerConfirm('是否确认提交该项!', function (res) {
- if (res) {
- processId = learun.newGuid();
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuEnroll/ChangeStatusById', { keyValue: keyValue, processId: processId }, function (res) {
- refreshGirdData(res, {});
- });
- }
- });
- }
- });
-
- },
- // 初始化列表
- initGird: function () {
- $('#gridtable').jfGrid({
- url: top.$.rootUrl + '/EducationalAdministration/StuEnroll/GetPageList',
- headData: [
- { label: "姓名", name: "StuName", width: 100, align: "left" },
- {
- label: "班级", name: "ClassNo", width: 150, 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: "SupportBank", width: 100, align: "left" },
- { label: "银行卡号", name: "SupportBankCard", width: 100, align: "left" },
- { label: "金额", name: "SupportAmount", width: 100, align: "left" },
- { label: "联系电话", name: "SecondMobile", width: 100, align: "left" },
- { label: "创建时间", name: "SupportChangeTime", width: 200, align: "left" },
- { label: "操作人", name: "SupportChangeUserName", width: 100, align: "left" },
- { label: "备注信息", name: "SupportChangeRemark", width: 200, align: "left" },
- {
- label: "审批状态", name: "SupportStatus", width: 100, align: "left",
- formatter: function (cellvalue, row) {
- if (cellvalue === 1) {
- return '<span class=\"label label-warning\">进行中</span>';
- } else if (cellvalue === 2) {
- return '<span class=\"label label-success\">审批通过</span>';
- } else {
- return '<span class=\"label label-default\" >草稿</span>';
- }
- }
- }
- ],
- //isMultiselect: true,
- mainId: 'StuId',
- isPage: true,
- sord: 'desc',
- sidx: 'SupportChangeTime'
- });
- page.search();
- },
- refreshMoney: function () {
- //var deptNo = $("#DeptNo").lrselectGet();
- //var majorNo = $("#MajorNo").lrselectGet();
- //var classNo = $("#ClassNo").lrselectGet();
- //$.post(
- // top.$.rootUrl + '/EducationalAdministration/StuEnroll/GetHelpStatistics',
- // {
- // DeptNo: deptNo,
- // MajorNo: majorNo,
- // ClassNo: classNo
- // },
- // function (res) {
- // $("#allAmount").html(res.data.aa);
- // $("#isAmount").html(res.data.bb);
- // }, "json");
- },
- search: function (param) {
- param = param || {};
- param.SqlParameter = ' AND IsReport=1 AND IsSupportChange=1';
-
- if (!param.Grade && param.Grade == undefined) {
- param.Grade = NowGrade;
- }
- $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
- },
- eye: function () {
- var processId = $('#gridtable').jfGridValue('SupportProcessId') || '';
- var title = $('#gridtable').jfGridValue('StuName');
- var SupportStatus = $('#gridtable').jfGridValue('SupportStatus');
- if (SupportStatus == '0') {
- return learun.alert.warning('该项目暂无流程进度!');
- }
- if (learun.checkrow(processId)) {
- learun.frameTab.open({
- F_ModuleId: 'monitor' + processId,
- F_FullName: '查看-' + title,
- F_UrlAddress: '/LR_NewWorkFlow/NWFProcess/MonitorDetailsIndex?processId=' + processId
- });
- }
- }
-
- };
-
- refreshGirdData = function (res, postData) {
- if (res && res.code && res.code == 200) {
- // 发起流程
- var postData = {
- schemeCode: 'HelpChange',// 填写流程对应模板编号
- processId: processId,
- level: '1',
- };
- learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function (data) {
- learun.loading(false);
- });
-
- }
- page.search();
- };
-
- page.init();
- }
|