|
- /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
- * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
- * 创建人:超级管理员
- * 日 期:2023-10-13 10:31
- * 描 述:教材管理学生收费
- */
- var acceptClick;
- var keyValue = request('keyValue');
- var bootstrap = function ($, learun) {
- "use strict";
- var page = {
- init: function () {
- page.initData();
- page.bind();
- },
- bind: function () {
- $('#AcademicYearNo').lrselect({
- placeholder: "请选择学年",
- allowSearch: true,
- url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo',
- value: 'value',
- text: 'text'
- });
- $('#Semester').lrDataItemSelect({ code: 'Semester' });
- $('#IsPay').lrDataItemSelect({ code: 'YesOrNoBit' });
- $('#StuNo').lrGirdSelect({
- // 字段
- url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=StuInfoBasic',
- selectWord: 'stuname',
- value: 'stuno',
- text: 'stuno',
- headData: [
- { label: "学号", name: "stuno", width: 100, align: "left" },
- { label: "姓名", name: "stuname", width: 100, align: "left" },
- {
- label: "性别", name: "genderno", width: 80, align: "left",
- formatter: function (cellvalue) {
- return cellvalue == true ? "男" : "女";
- }
- },
- {
- 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: "grade", width: 100, align: "left" }
- ],
- select: function (item) {
- $("#StuNo").val(item.stuno);
- $("#StuName").val(item.stuname);
- $("#DeptNo").lrselectSet(item.deptno);
- $("#MajorNo").lrselectSet(item.majorno);
- $("#ClassNo").lrselectSet(item.classno);
- $("#Grade").lrselectSet(item.grade);
- }
- });
- $('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' });
- $('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorno', text: 'majorname' });
- $('#ClassNo').lrDataSourceSelect({ code: 'bjsj', value: 'classno', text: 'classname' });
- $('#Grade').lrselect({
- url: top.$.rootUrl + '/EducationalAdministration/ClassInfo/GenerateNearByYear',
- value: 'value',
- text: 'text'
- });
- },
- initData: function () {
- if (!!keyValue) {
- $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/BookPayDetail/GetFormData?keyValue=' + keyValue, function (data) {
- for (var id in data) {
- if (!!data[id].length && data[id].length > 0) {
- $('#' + id).jfGridSet('refreshdata', data[id]);
- }
- else {
- $('[data-table="' + id + '"]').lrSetFormData(data[id]);
- }
- }
- });
- }
- }
- };
- // 保存数据
- acceptClick = function (callBack) {
- if (!$('#form').lrValidform()) {
- return false;
- }
- var postData = $('#form').lrGetFormData();
- $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/BookPayDetail/SaveForm?keyValue=' + keyValue, postData, function (res) {
- // 保存成功后才回调
- if (!!callBack) {
- callBack();
- }
- });
- };
- page.init();
- }
|