/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) * Copyright (c) 2013-2018 北京泉江科技有限公司 * 创建人:超级管理员 * 日 期:2019-02-21 16:53 * 描 述:学生学籍 */ var acceptClick; var keyValue = request('keyValue'); var isStudent = request('isStudent'); var bootstrap = function ($, learun) { "use strict"; var page = { init: function () { $('.lr-form-wrap').lrscroll(); page.bind(); page.initData(); page.hide(); }, hide: function () { if (isStudent == "1") { $("#StuName").parent().hide(); $("#IdentityCardNo").parent().hide(); $("#StuNo").parent().hide(); $("#ClassNo").parent().hide(); $("#MajorNo").parent().hide(); $("#EduSystem").parent().hide(); $("#F_SchoolId").parent().hide(); $("#StuCode").parent().hide(); $("#ksh").parent().hide(); $("#NoticeNo").parent().hide(); $("#HealthStatusNo").parent().hide(); $("#ResidenceNo").parent().hide(); $("#F_ProvinceId").parent().parent().hide(); $("#Photo").parent().hide(); $("#DeptNo").parent().hide(); $("#FamilyOriginNo").parent().hide(); $("#OverseasChineseNo").parent().hide(); $("#Grade").parent().hide(); $("#GraduateNo").parent().hide(); $("#EduSystem").parent().hide(); $("#RegisterDate").parent().hide(); $("#StudyModality").parent().hide(); $("#GraduateYear").parent().hide(); $("#EntranceDate").parent().hide(); $("#JoinPartyDate").parent().hide(); $("#JoinLeagueDate").parent().hide(); $("#InSchoolAddress").parent().hide(); $("#InSchoolTelephone").parent().hide(); $("#Remark").parent().hide(); $("#DiplomaRemark").parent().hide(); $("#GoodAt").parent().hide(); $("#InSchoolAddress").parent().hide(); $("#InSchoolTelephone").parent().hide(); $("#JoinLeagueDate").parent().hide(); } }, bind: function () { $('#DepositBank').lrDataItemSelect({ code: 'DepositBank' }); $('#F_ProvinceId').lrDataSourceSelect({ code: 'DIC_PROVINCE', value: 'pcode', text: 'pname', select: function (item) { if (item) { $('#F_CityId').lrselectRefresh({ url: top.$.rootUrl + "/DIC_CITY/GetListByProvinceCode", param: { ProvinceCode: item.pcode }, value: 'CCODE', text: 'CNAME' }); } else { $('#F_CityId').lrselectRefresh({ url: "", data: [] }); } $('#F_CountyId').lrselectRefresh({ url: "", data: [] }); } }); $('#F_CityId').lrselect({ value: 'ccode', text: 'cname', select: function (item) { if (item) { $('#F_CountyId').lrselectRefresh({ url: top.$.rootUrl + "/DIC_AREA/GetAreasListByCityCode", param: { cityCode: item.CCODE }, value: 'ACODE', text: 'ANAME' }); } } }); $('#F_CountyId').lrselect({ value: 'ACODE', text: 'ANAME' }); $('#ClassNo').lrselect({ value: "classno", text: "classname" }); $('#Grade').lrselect({ url: top.$.rootUrl + '/EducationalAdministration/ClassInfo/GenerateNearByYear', value: 'value', text: 'text' }); $('#HealthStatus').lrDataItemSelect({ code: 'QRCodeHealthStatus' }); $('#F_SchoolId').lrDataSourceSelect({ code: 'company', value: 'f_companyid', text: 'f_fullname' }); $('#NationalityNo').lrDataItemSelect({ code: 'National' }); $('#GenderNo').lrDataItemSelect({ code: 'usersexbit' }); $('#PartyFaceNo').lrDataItemSelect({ code: 'BCdPartyFace' }); $('#HealthStatusNo').lrDataItemSelect({ code: 'BCdHealthStatus' }); $('#Photo').lrUploader(); $('#FamilyOriginNo').lrDataItemSelect({ code: 'BCdFamilyOrigin' }); $('#OverseasChineseNo').lrDataItemSelect({ code: 'BCdOverseasChinese' }); $('#GraduateNo').lrDataItemSelect({ code: 'CollegeType' }); $('#EduSystem').lrDataItemSelect({ code: 'EduSystem' }); $('#StudyModality').lrDataItemSelect({ code: 'StudyModality' }); $('#ResidenceNo').lrDataItemSelect({ code: 'ResidenceNo' }); $('#DeptNo').lrselect({ value: "deptno", text: "deptname", url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo', select: function (item) { if (item) { $('#MajorNo').lrselectRefresh({ url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable', param: { code: "CdMajorInfo", strWhere: "DeptNo='" + item.deptno + "'" } }); } else { $('#MajorNo').lrselectRefresh({ url: "", data: [] }); } $('#ClassNo').lrselectRefresh({ url: "", data: [] }); } }); $('#MajorNo').lrselect({ value: "majorno", text: "majorname", select: function (item) { if (item) { $('#ClassNo').lrselectRefresh({ url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable', param: { code: "bjsj", strWhere: "DeptNo='" + item.deptno + "' and majorno='" + item.majorno + "'" } }); } } }); $('#MajorNo').on("click", function () { var data = $('#DeptNo').lrselectGet(); if (!data) { learun.alert.error('请先选择系'); } }); $('#ClassNo').on("click", function () { var data1 = $('#DeptNo').lrselectGet(); var data2 = $('#MajorNo').lrselectGet(); if (!data1 || !data2) { learun.alert.error('请先选择系和专业'); } }); }, initData: function () { if (!!keyValue) { $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/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 (!$('body').lrValidform()) { return false; } var postData = { strEntity: JSON.stringify($('body').lrGetFormData()) }; $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/SaveForm?keyValue=' + keyValue, postData, function (res) { // 保存成功后才回调 if (!!callBack) { callBack(); } }); }; page.init(); }