|
- /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
- * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
- * 创建人:超级管理员
- * 日 期:2022-08-30 11:05
- * 描 述:学生证书管理
- */
- 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);
- }, 240, 400);
- $('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo',value: 'deptno',text: 'deptname' });
- $('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo',value: 'majorno',text: 'majorname' });
- $('#ClassNo').lrDataSourceSelect({ code: 'bjsj',value: 'classno',text: 'classname' });
- // 刷新
- $('#lr_refresh').on('click', function () {
- location.reload();
- });
- // 新增
- $('#lr_add').on('click', function () {
- learun.layerForm({
- id: 'form',
- title: '新增',
- url: top.$.rootUrl + '/EducationalAdministration/StudentCertificate/Form',
- width: 720,
- height: 550,
- callBack: function (id) {
- var res = false;
- // 验证数据
- res = top[id].validForm();
- // 保存数据
- if (res) {
- processId = learun.newGuid();
- res = top[id].save(processId, refreshGirdData);
- }
- return res;
- }
- });
- });
- // 编辑
- $('#lr_edit').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Id');
- if (learun.checkrow(keyValue)) {
- learun.layerForm({
- id: 'form',
- title: '编辑',
- url: top.$.rootUrl + '/EducationalAdministration/StudentCertificate/Form?keyValue=' + keyValue,
- width: 720,
- height: 550,
- callBack: function (id) {
- var res = false;
- // 验证数据
- res = top[id].validForm();
- // 保存数据
- if (res) {
- res = top[id].save('', function () {
- page.search();
- });
- }
- return res;
- }
- });
- }
- });
- //复制
- $('#lr_copy').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('Id');
- if (learun.checkrow(keyValue)) {
- learun.layerForm({
- id: 'form',
- title: '新增',
- url: top.$.rootUrl + '/EducationalAdministration/StudentCertificate/Form?keyValue=' + keyValue+'&type=copy',
- width: 720,
- height: 550,
- 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)) {
- learun.layerConfirm('是否确认删除该项!', function (res) {
- if (res) {
- learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/StudentCertificate/DeleteForm', { keyValue: keyValue}, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- // 打印
- $('#lr_print').on('click', function () {
- $('#gridtable').jqprintTable();
- });
- },
- // 初始化列表
- initGird: function () {
- $('#gridtable').lrAuthorizeJfGrid({
- url: top.$.rootUrl + '/EducationalAdministration/StudentCertificate/GetPageList',
- headData: [
- { label: "学生学号", name: "StuNo", width: 100, align: "left"},
- { label: "学生姓名", name: "StuName", 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: "SCName", width: 100, align: "left"},
- { label: "证书级别", name: "SCLevel", width: 100, align: "left"},
- { label: "证书种类", name: "SCType", width: 100, align: "left"},
- { label: "分值", name: "SCScore", width: 100, align: "left"},
- { label: "获取时间", name: "SCTime", width: 100, align: "left"},
- ],
- mainId:'Id',
- isPage: true
- });
- 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:'',// 填写流程对应模板编号
- processId:processId,
- level:'1',
- };
- learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function(data) {
- learun.loading(false);
- });
- }
- page.search();
- }
- };
- page.init();
- }
|