/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)  * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司  * 创建人:超级管理员  * 日  期:2021-06-15 17:30  * 描  述:新生报名  */ var acceptClick; var keyValue = request('keyValue'); var MajorNo; var bootstrap = function ($, learun) { "use strict"; var page = { init: function () { $('.lr-form-wrap').lrscroll(); page.bind(); page.initData(); }, bind: function () { $('#IdCardPto1').lrUploader(); $('#IdCardPto2').lrUploader(); $('#MidDiplomaPto').lrUploader(); $('#MidAchievementPto').lrUploader(); $('#Gender').lrDataItemSelect({ code: 'usersexbit' }); $('#Nationals').lrDataItemSelect({ code: 'National' }); $('#SubjectNo').lrselect({ type: 'multiple', url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=' + 'ExamSubject', value: 'subjectno', text: 'subjectname', maxHeight: 200 }); //地市 $('#City').lrselect({ allowSearch: true, //type: 'multiple', url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DIC_CITY', param: { strWhere: "1=1 and cparent='650000'" }, value: "ccode", text: "cname", maxHeight: 200, //select: function (item) { // if (item) { // var code = $("#City").lrselectGet(); // //县区 // $('#County').lrselectRefresh({ // allowSearch: true, // //type: 'multiple', // url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DIC_AREA', // param: { strWhere: "1=1 and charindex(aparent,('" + code + "'))>0 " }, // value: "acode", // text: "aname", // maxHeight: 200, // }); // } //} }); //县区 $('#County').lrselect({ allowSearch: true, //type: 'multiple', url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DIC_AREA', param: { strWhere: "1=1 " }, value: "acode", text: "aname", maxHeight: 200, //select: function (item) { // if (item) { // var countyCode = $("#County").lrselectGet(); // //专业 // $('#MajorNo').lrselectRefresh({ // url: top.$.rootUrl + // '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', // param: { // //strWhere: "1=1 and Area='" + countyCode + "'" // strWhere: "1=1" // }, // value: "id", // text: "majorname", // maxHeight: 200, // }); // if (MajorNo) { // $('#MajorNo').lrselectSet(MajorNo); // MajorNo = ''; // } // } //} }); //专业 $('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'id', text: 'majorname' }); $('#EmpNo').lrDataSourceSelect({ code: 'EmpInfo', value: 'empno', text: 'empname' }); //计算中考总分 $('#scoreDiv').on('change', '.SEMidExamScore', function () { var scoreSum = 0; $.each($("#scoreDiv .SEMidExamScore"), function (i, item) { if (!!item.value) { scoreSum += parseFloat(item.value); } }); if (scoreSum > 0) { $('#MidTermExam').val(scoreSum.toFixed(2)); } }); }, initData: function () { if (!!keyValue) { $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuEnroll/GetFormData?keyValue=' + keyValue, function (data) { for (var id in data) { if (!!data[id].length && data[id].length > 0) { $('#' + id).jfGridSet('refreshdata', data[id]); } else { $('#form').lrSetFormData(data[id]); } } MajorNo = data.StuEnroll.MajorNo; var str = ''; if (!!data.StuEnrollMidExamScore) { $.each(data.StuEnrollMidExamScore, function (i, item) { var score = item.score > 0 ? item.score : ''; str += '
'; str += '
' + item.subjectName + '
'; str += ''; str += '
'; }); $('#scoreDiv').html(str); } }); } } }; // 保存数据 acceptClick = function (callBack) { if (!$('body').lrValidform()) { return false; } var scoreList = []; $.each($("#scoreDiv .SEMidExamScore"), function (i, item) { var entity = { Id: item.id, score: item.value }; scoreList.push(entity); }); var entity = $('body').lrGetFormData(); //entity.MajorName = $('#MajorNo').lrselectGetText(); var postData = { strEntity: JSON.stringify(entity), scoreList: JSON.stringify(scoreList) }; $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuEnrollPhone/SaveForm?keyValue=' + keyValue, postData, function (res) { // 保存成功后才回调 if (!!callBack) { callBack(); } }); }; page.init(); }