/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) * Copyright (c) 2013-2018 北京泉江科技有限公司 * 创建人:超级管理员 * 日 期:2019-08-08 17:21 * 描 述:新生信息管理 */ 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 () { $('#DepositBank').lrDataItemSelect({ code: 'DepositBank' }); $("#GenderNo").lrDataItemSelect({ code: 'usersex' }); $("#PartyFaceNo").lrDataItemSelect({ code: 'PolityStatus' }); $("#FamilyOriginNo").lrDataItemSelect({ code: 'ExamineeCategory' }); $("#NationalityNo").lrDataItemSelect({ code: 'National' }); $("#TestStuSortNo").lrDataItemSelect({ code: 'ExamineeType' }); $("#TestStuSubjectNo").lrDataItemSelect({ code: 'SubjectType' }); $("#HighTestSortNo").lrDataItemSelect({ code: 'GraduateCategory' }); $("#MatriculateSort").lrDataItemSelect({ code: 'EnrollStyle' }); $('#ResidenceNo').lrDataItemSelect({ code: 'ResidenceNo' }); $('#IsPoor').lrDataItemSelect({ code: 'YesOrNoInt' }); $('#GraduateType').lrDataItemSelect({ code: 'GraduateType' }); $('#Province').lrselect({ url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=' + 'DIC_PROVINCE', //param: { strWhere: " cparent= 650000 " }, value: 'pcode', text: 'pname', maxHeight: 200, allowSearch: true, select: function (item) { var Citys = $("#Province").lrselectGet(); if (Citys != null && Citys != "" && Citys != undefined) { $('#City').lrselectRefresh({ url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DIC_CITY', param: { strWhere: " 1=1 and cparent in (" + Citys + ")" }, allowSearch: true, value: "ccode", text: "cname", maxHeight: 200 }); } else { $('#City').lrselectRefresh({ url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DIC_CITY', param: { strWhere: " 1=1 and cparent ='' " }, value: "ccode", text: "cname", maxHeight: 200 }); } } }) $("#City").lrselect(); $('#StuInfoFreshFamily').jfGrid({ headData: [ { label: '姓名', name: 'Name', width: 100, align: 'left' , edit: { type: 'input' } }, { label: '与本人关系', name: 'Relation', width: 100, align: 'left' , edit: { type: 'select', datatype: 'dataItem', code: 'FamilyRelation' } }, { label: '性别', name: 'Sex', width: 100, align: 'left' , edit: { type: 'select', datatype: 'dataItem', code: 'usersex' } }, { label: '年龄', name: 'Age', width: 100, align: 'left' , edit: { type: 'input' } }, { label: '政治面貌', name: 'Politicy', width: 100, align: 'left' , edit: { type: 'select', datatype: 'dataItem', code: 'PolityStatus' } }, //{ // label: '身份证号', name: 'IdCard', width: 100, align: 'left' // , edit: { // type: 'input' // } //}, ], isEdit: true, height: 200 }); $('#StuInfoFreshEmergePeople').jfGrid({ headData: [ { label: '姓名', name: 'Name', width: 100, align: 'left' , edit: { type: 'input' } }, { label: '与本人关系', name: 'Relation', width: 100, align: 'left' , edit: { type: 'input' } }, { label: '手机号码', name: 'Mobile', width: 100, align: 'left' , edit: { type: 'input' } }, { label: '座机电话', name: 'Telephone', width: 100, align: 'left' , edit: { type: 'input' } }, { label: '联系地址', name: 'Address', width: 100, align: 'left' , edit: { type: 'input' } }, ], isEdit: true, height: 200 }); //拍照 $("#photoBtn").on('click', function () { takeImg(); }); }, initData: function () { if (!!keyValue) { $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/GetFormData?keyValue=' + keyValue, function (data) { for (var id in data) { if (id == 'Url') { //头像地址 $('#photoBox').find('img').attr('src', data[id]); } else { 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 Score1 = $('#ChineseScore').val(); var Score2 = $('#MathScore').val(); var Score3 = $('#ForeignLangScore').val(); var Score4 = $('#ComprehensiveScore').val(); $('#HighAmountScore').val(Number(Score1) + Number(Score2) + Number(Score3) + Number(Score4)); var postData = {}; postData.strEntity = JSON.stringify($('[data-table="StuInfoFresh"]').lrGetFormData()); postData.strstuInfoFreshEmergePeopleList = JSON.stringify($('#StuInfoFreshEmergePeople').jfGridGet('rowdatas')); postData.strstuInfoFreshFamilyList = JSON.stringify($('#StuInfoFreshFamily').jfGridGet('rowdatas')); $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/SaveForm?keyValue=' + keyValue, postData, function (res) { // 保存成功后才回调 if (!!callBack) { callBack(); } }); }; page.init(); }