/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 * 创建人:超级管理员 * 日 期:2021-03-26 15:23 * 描 述:学生违纪管理 */ var refreshGirdData; var bootstrap = function ($, learun) { "use strict"; var processId = ''; var page = { init: function () { page.initGird(); page.bind(); }, bind: function () { $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { page.search(queryJson); }, 220, 400); $('#StuNo').lrselect({ allowSearch: true, url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/GetAllList', param: { strWhere: "1=1 " }, value: "StuNo", text: "StuName" }); //$('#StuNo').lrDataSourceSelect({ code: 'StuInfoBasic',value: 'stuno',text: 'stuname' }); $('#EmpNo').lrDataSourceSelect({ code: 'EmpInfo', value: 'empno', text: 'empname' }); // 刷新 $('#lr_refresh').on('click', function () { location.reload(); }); // 新增 $('#lr_add').on('click', function () { learun.layerForm({ id: 'form', title: '新增', url: top.$.rootUrl + '/EducationalAdministration/StuDisciplineManagement/Form', width: 1000, height: 800, callBack: function (id) { var res = false; // 验证数据 res = top[id].validForm(); // 保存数据 if (res) { res = top[id].save('', function () { page.search(); }); } return res; } }); }); // 编辑 $('#lr_edit').on('click', function () { var keyValue = $('#gridtable').jfGridValue('Id'); if (learun.checkrow(keyValue)) { var CheckStatus = $('#gridtable').jfGridValue('CheckStatus'); if (CheckStatus != "0") { learun.alert.warning("当前项已提交!"); return false; } learun.layerForm({ id: 'form', title: '编辑', url: top.$.rootUrl + '/EducationalAdministration/StuDisciplineManagement/Form?keyValue=' + keyValue, width: 1000, height: 800, callBack: function (id) { var res = false; // 验证数据 res = top[id].validForm(); // 保存数据 if (res) { res = top[id].save('', function () { page.search(); }); } return res; } }); } }); // 删除 $('#lr_delete').on('click', function () { var keyValue = $('#gridtable').jfGridValue('Id'); if (learun.checkrow(keyValue)) { var CheckStatus = $('#gridtable').jfGridValue('CheckStatus'); if (CheckStatus != "0") { learun.alert.warning("当前项已提交!"); return false; } learun.layerConfirm('是否确认删除该项!', function (res) { if (res) { learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/StuDisciplineManagement/DeleteForm', { keyValue: keyValue }, function () { refreshGirdData(); }); } }); } }); //  查看 $('#lr_view').on('click', function () { var keyValue = $('#gridtable').jfGridValue('Id'); if (learun.checkrow(keyValue)) { learun.layerForm({ id: 'formview', title: '查看', url: top.$.rootUrl + '/EducationalAdministration/StuDisciplineManagement/FormView?keyValue=' + keyValue, width: 1000, height: 600, btn: null }); } }); //  提交 $('#lr_submit').on('click', function () { var keyValue = $('#gridtable').jfGridValue('Id'); if (learun.checkrow(keyValue)) { var CheckStatus = $('#gridtable').jfGridValue('CheckStatus'); if (CheckStatus != "0") { learun.alert.warning("当前项已提交!"); return false; } learun.layerConfirm('是否确认提交该项!', function (res) { if (res) { processId = learun.newGuid(); learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuDisciplineManagement/DoSubmit', { keyValue: keyValue, status: "1", processId: processId }, function (res) { refreshGirdData(res, {}); }); } }); } }); }, // 初始化列表 initGird: function () { $('#gridtable').jfGrid({ url: top.$.rootUrl + '/EducationalAdministration/StuDisciplineManagement/GetPageList', headData: [ { label: "学号", name: "StuNo", width: 100, align: "left" }, { label: "处分类别", name: "SType", width: 80, align: "left" , formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('dataItem', { key: value, code: 'DisType', callback: function (_data) { callback(_data.text); } }); } }, { label: "违纪学生", name: "StuNo", 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: "GenderNo", width: 50, align: "left", formatter: function (cellvalue) { return cellvalue == true ? "男" : "女"; } }, { label: "电话", name: "Mobile", width: 100, align: "left" }, { label: "院系", name: "DeptNo", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', key: value, keyId: 'deptno', callback: function (_data) { callback(_data['deptname']); } }); } }, { label: "专业", name: "majorno", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', key: value, keyId: 'majorno', callback: function (_data) { callback(_data['majorname']); } }); } }, { 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']); } }); } }, { label: "处理老师", name: "EmpNo", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo', key: value, keyId: 'empno', callback: function (_data) { callback(_data['empname']); } }); } }, { label: "处理时间", name: "DealTime", width: 120, align: "left" }, { label: "事情经过", name: "Things", width: 200, align: "left" }, { label: "学生态度", name: "StudentAttitude", width: 100, align: "left" }, { label: "班主任意见", name: "TeacherOpinion", width: 100, align: "left" }, { label: "家长意见", name: "ParentsOpinion", width: 100, align: "left" }, { label: "学院意见", name: "SchoolOpinion", width: 100, align: "left" }, { label: "审核状态", name: "CheckStatus", width: 100, align: "left", formatter: function (cellvalue) { return cellvalue == "1" ? "审核中" : cellvalue == "2" ? "审核通过" : cellvalue == "3" ? "审核未通过" : "草稿"; } }, ], mainId: 'Id', isPage: true, sidx: "CreateTime desc" }); page.search(); }, search: function (param) { param = param || {}; $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; refreshGirdData = function (res, postData) { if (!!res) { if (res.code == 200) { // 发起流程 var postData = { schemeCode: 'StuDisciplineManagement',// 填写流程对应模板编号 processId: processId, level: '1', }; learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function (data) { learun.loading(false); }); } page.search(); } }; page.init(); }