|
- /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
- * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
- * 创建人:超级管理员
- * 日 期:2022-03-09 15:33
- * 描 述:学生证打印
- */
- var acceptClick;
- var keyValue = request('keyValue');
- var bootstrap = function ($, learun) {
- "use strict";
- var page = {
- init: function () {
- $('.lr-form-wrap').lrscroll();
- page.bind();
- page.initData();
- },
- bind: function () {
- //监听学号
- $("#StuNo").on('blur', function () {
- var StuNo = $(this).val();
- if (StuNo) {
- learun.httpAsync('get', top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/GetStuInfo?Account=' + StuNo, '', function (data) {
- if (data) {
- $("#StuNo").val(data.StuNo);
- $("#StuName").val(data.StuName);
- $("#Gender").lrselectSet(data.GenderNo);
- $("#Birthday").val(data.Birthday);
- $("#DeptNo").lrselectSet(data.DeptNo);
- $("#Major").lrselectSet(data.MajorNo);
- $("#ClassNo").lrselectSet(data.ClassNo);
- } else {
- learun.alert.warning("学生不存在!");
- }
- });
- }
- });
- $('#Gender').lrDataItemSelect({ code: 'usersexbit' });
- $('#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" }
- });
- }
-
- }
- });
- $('#Major').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"
- });
- $('#Destination').lrDataSourceSelect({ code: 'DIC_CITY', value: 'ccode', text: 'cname' });
- $('#CreateUserId')[0].lrvalue = learun.clientdata.get(['userinfo']).userId;
- $('#CreateUserId').val(learun.clientdata.get(['userinfo']).realName);
- $('#CreateTime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss'));
- },
- initData: function () {
- if (!!keyValue) {
- $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuCardInfo/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]);
- }
- }
- });
- }
- $('#Status').val('0');
- }
- };
- // 保存数据
- acceptClick = function (callBack) {
- if (!$('body').lrValidform()) {
- return false;
- }
- var postData = {
- strEntity: JSON.stringify($('body').lrGetFormData())
- };
- $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuCardInfo/SaveForm?keyValue=' + keyValue, postData, function (res) {
- // 保存成功后才回调
- if (!!callBack) {
- callBack();
- }
- });
- };
- page.init();
- }
|