/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) * Copyright (c) 2013-2018 北京泉江科技有限公司 * 创建人:超级管理员 * 日 期:2019-01-29 17:31 * 描 述:教师信息管理 */ var acceptClick; var keyValue = request('keyValue'); var isView = request('isView'); if (!!keyValue) { NewEmpId = keyValue; } var isTeacher = request('isTeacher'); var bootstrap = function ($, learun) { "use strict"; var ue; var page = { init: function () { $('.lr-form-wrap').lrscroll(); if (isView) { $.each($("[data-table=EmpInfo]"), function (i, item) { $(item).children('div,input').attr('readonly', 'readonly'); }); //选项卡显示证书信息、培训信息、 $('.lr-form-tabs').find('li.showInViewLi').removeClass(); } page.bind(); page.initData(); page.hide(); }, hide: function () { if (isTeacher == "1") { $("#EmpNo").parent().hide(); //$("#EmpName").parent().hide(); $("#F_CompanyId").parent().hide(); $("#F_DepartmentId").parent().hide(); $("#SpellBrief").parent().hide(); //$("#IdentityCardNo").parent().hide(); $("#ProvinceNo").parent().hide(); $("#CityNo").parent().hide(); $("#RegionNo").parent().hide(); $("#LocusOfArchives").parent().hide(); $("#OverseasChineseNo").parent().hide(); $("#HealthStatusNo").parent().hide(); $("#CultureDegreeNo").parent().hide(); //$("#DegreeNo").parent().hide(); $("#FamilyOriginNo").parent().hide(); $("#GraduateSchoolName").parent().hide(); $("#SubjectSpeciesNo").parent().hide(); $("#ForeignLanguageNo").parent().hide(); //$("#EmpSortNo").parent().hide(); $("#EmpFullTimeNo").parent().hide(); //$("#DeptNo").parent().hide(); //$("#TitleOfTechPostNo").parent().hide(); //$("#InSchoolDate").parent().hide(); $("#resume").parent().hide(); //$("#Photo").parent().hide(); } }, bind: function () { //选项卡 $("#PM_EducationExperience").attr("src", "/EducationalAdministration/PM_EducationExperience/Index?empId=" + NewEmpId); $("#PM_TechnicalPost").attr("src", "/EducationalAdministration/PM_TechnicalPost/Index?empId=" + NewEmpId); $("#PM_WorkerTechnology").attr("src", "/EducationalAdministration/PM_WorkerTechnology/Index?empId=" + NewEmpId); $("#PM_Resume").attr("src", "/EducationalAdministration/PM_Resume/Index?empId=" + NewEmpId); $("#PM_FamilySituation").attr("src", "/EducationalAdministration/PM_FamilySituation/Index?empId=" + NewEmpId); $("#TeacherCertificate").attr("src", "/PersonnelManagement/TeacherCertificate/Index?empId=" + NewEmpId); $("#TeacherTrain").attr("src", "/PersonnelManagement/TeacherTrain/Index?empId=" + NewEmpId); $('#lr_form_tabs').lrFormTab(); $('#lr_form_tabs ul li').eq(0).trigger('click'); //校区 $('#F_CompanyId').lrDataSourceSelect({ code: 'company', value: 'f_companyid', text: 'f_fullname', select: function (item) { if (!!item) { // 部门 $('#F_DepartmentId').lrselectRefresh({ type: 'tree', // 是否允许搜索 allowSearch: true, // 访问数据接口地址 url: top.$.rootUrl + '/LR_OrganizationModule/Department/GetTree', // 访问数据接口参数 param: { companyId: item.f_companyid, parentId: '0' } }); } } }); $('#F_DepartmentId').lrselect({ allowSearch:true}); $('#GenderNo').lrDataItemSelect({ code: 'usersexbit' }); $('#IsHasLesson').lrDataItemSelect({ code: 'YesOrNoBit' }); $('#NationalityNo').lrDataItemSelect({ code: 'National' }); $('#PartyFaceNo').lrDataItemSelect({ code: 'PolityStatus' }); $('#ProvinceNo').lrDataSourceSelect({ code: 'DIC_PROVINCE', value: 'pcode', text: 'pname', select: function (item) { if (!!item) { $('#CityNo').lrselectRefresh({ url: "/DIC_CITY/GetListByProvinceCode", param: { ProvinceCode: item.pcode }, value: 'CCODE', text: 'CNAME' }); $('#RegionNo').lrselectRefresh({ url: "", data: [] }); } } }); $('#CityNo').lrselect({ select: function (item) { if (!!item) { $('#RegionNo').lrselectRefresh({ url: top.$.rootUrl + "/DIC_AREA/GetAreasListByCityCode", param: { cityCode: item.CCODE }, value: 'ACODE', text: 'ANAME' }); } } }); $('#RegionNo').lrselect(); $('#OverseasChineseNo').lrDataItemSelect({ code: 'BCdOverseasChinese', allowSearch: true }); $('#HealthStatusNo').lrDataItemSelect({ code: 'BCdHealthStatus', allowSearch: true }); //初始学历 $('#CultureDegreeNo').lrDataItemSelect({ code: 'CollegeType', allowSearch: true }); $('#DegreeNo').lrDataItemSelect({ code: 'BCdDegree', allowSearch: true }); $('#FamilyOriginNo').lrDataItemSelect({ code: 'BCdFamilyOrigin', allowSearch: true }); $('#SubjectSpeciesNo').lrDataItemSelect({ code: 'BCdSubjectSpecies', allowSearch: true }); $('#ForeignLanguageNo').lrDataItemSelect({ code: 'BCdForeignLanguage', allowSearch: true }); $('#EmpSortNo').lrDataItemSelect({ code: 'jsgw' }); $('#EmpFullTimeNo').lrDataItemSelect({ code: 'EmpFullTime' }); //$('#ObtainWay').lrDataItemSelect({ code: 'ObtainWay' }); //$('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' }); $('#PostRank').lrDataItemSelect({ code: 'BCdTitleOfTechPost', allowSearch: true }); $('#Photo').lrUploader(); //$('#HighestRecord').lrDataSourceSelect({ code: 'BCdCultureDegree', value: 'culturedegreeno', text: 'culturedegree' }); $('#HighestRecord').lrDataItemSelect({ code: 'HighestEducation'}); //$('#ObtainWayOfHighestRecord').lrDataItemSelect({ code: 'ObtainWay' }); $('#ObtainWayOfHighestRecord').lrDataItemSelect({ code: 'HighestEducationAcquisitionMode' }); $('#InitialDegree').lrDataSourceSelect({ code: 'BCdDegree', value: 'degreeno', text: 'degreename' }); $('#ObtainWayOfInitialDegree').lrDataItemSelect({ code: 'ObtainWayOfDegree' }); $('#ObtainWayOfHighestDegree').lrDataItemSelect({ code: 'ObtainWayOfDegree' }); //$('#PositionLevel').lrDataItemSelect({ code: 'PositionLevel' }); $('#JobRank').lrDataItemSelect({ code: 'TechnicalPost' }); $('#WorkLevel').lrDataItemSelect({ code: 'TechnicalLevelOfWorker' }); $('#CompilationCategory').lrDataItemSelect({ code: 'CompilationCategory' }); $('#IsInActiveStatus').lrDataItemSelect({ code: 'JobStatus' }); $('#ProfessionalTitle').lrDataItemSelect({ code: 'jszc' }); //$('#ProfessionalTitleLevel').lrDataItemSelect({ code: 'TeacherTitlePostLevel' }); //内容编辑器 ue = UE.getEditor('editor'); //监听身份证号,绑定出生日期 $("#IdentityCardNo").blur(function () { var cardNo = $(this).val().trim(); if (cardNo) { var date = cardNo.slice(6, 10) + "-" + cardNo.slice(10, 12) + "-" + cardNo.slice(12, 14); $("#Birthday").val(date); } }); $('#lr_print').on('click',function() { $('#tab1').print(); }) }, initData: function () { if (!!keyValue) { $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/EmpInfo/GetFormData?keyValue=' + keyValue, function (data) { for (var id in data) { if (!!data[id].length && data[id].length > 0) { $('#' + id).jfGridSet('refreshdata', data[id]); console.log(2); } else { $('[data-table="' + id + '"]').lrSetFormData(data[id]); } ue.ready(function () { ue.setContent(data[id].resume); }); } $("#EmpNo").attr("disabled", "disabled"); }); } } }; // 保存数据 acceptClick = function (callBack) { if (!$('body').lrValidform()) { return false; } var postData = $('body').lrGetFormData(); postData["resume"] = ue.getContent(null, null, true); postData["EmpId"] = NewEmpId; var postDatas = { strEntity: JSON.stringify(postData) }; //姓名重复提示 var EmpName = $('#EmpName').val(); $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/EmpInfo/GetEmpInfoEntitiesByEmpName?empName=' + EmpName, function (data) { if (!!data.length && data.length > 0) { var num = data.length; if (!!keyValue) { for (var i = 0; i < data.length; i++) { if (data[i].EmpId == keyValue) { num = num - 1; break; } } } if (num > 0) { learun.layerConfirm('系统中姓名为' + EmpName + '的教师已经有' + num + '名,是否确认保存?', function (res) { if (res) { $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/EmpInfo/SaveForm?keyValue=' + keyValue, postDatas, function (res) { // 保存成功后才回调 if (!!callBack) { callBack(); } }); } }); return; } } $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/EmpInfo/SaveForm?keyValue=' + keyValue, postDatas, function (res) { // 保存成功后才回调 if (!!callBack) { callBack(); } }); }); }; page.init(); }