|
- /* * 版 本 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 isTeacher = request('isTeacher');
- var colDataItemArr = ['OverseasChineseNo', 'FamilyOriginNo', 'HealthStatusNo', 'PartyFaceNo', 'NationalityNo', 'GenderNo', 'IsInActiveStatus', 'CompilationCategory', 'HighestRecord', 'ObtainWayOfHighestRecord', 'CultureDegreeNo', 'DegreeNo', 'ObtainWayOfHighestDegree', 'InitialDegree', 'ObtainWayOfInitialDegree', 'JobRank', 'WorkLevel', 'EmpFullTimeNo', 'IsHasLesson', 'SubjectSpeciesNo','ForeignLanguageNo'];
- var colDataItemCode = ['BCdOverseasChinese', 'BCdFamilyOrigin', 'BCdHealthStatus', 'PolityStatus', 'National', 'usersexbit', 'JobStatus', 'CompilationCategory', 'RecordInSchool', 'ObtainWayOfDegree', 'RecordInSchool', 'DegreeInSchool', 'ObtainWayOfDegree', 'DegreeInSchool', 'ObtainWayOfDegree', 'TechnicalPost', 'TechnicalLevelOfWorker', 'EmpFullTime', 'YesOrNoBit', 'BCdSubjectSpecies','BCdForeignLanguage'];
- var colDataSourceArr = [ 'F_CompanyId', 'F_DepartmentId'];
- var colDataSourceCode = ['company', 'classdata'];
- var colDataSourceValue = [ 'f_companyid', 'f_departmentid'];
- var colDataSourceText = ['f_fullname', 'f_fullname'];
- var bootstrap = function ($, learun) {
- "use strict";
- var ue;
- var page = {
- init: function () {
- $('.lr-form-wrap').lrscroll();
- 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();
- $("#EmpFullTimeNo").parent().hide();
- $("#resume").parent().hide();
- $("#Photo").parent().hide();
- }
- },
- bind: function () {
- // 显示信息选项卡
- $('#tablist').lrFormTabEx();
- $('#tablist li').eq(0).trigger('click');
-
- $('#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();
- $('#Photo').lrUploader();
-
- //内容编辑器
- 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_save_btn').on('click', function () {
- if (!$('body').lrValidform()) {
- return false;
- }
- var postData = $('body').lrGetFormData();
- postData["resume"] = ue.getContent(null, null, true);
- var postDatas = {
- strEntity: JSON.stringify(postData)
- };
- $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/EmpInfo/SaveFormModify?keyValue=' + keyValue, postDatas, function (res) {
- if (res.code == 200) {
- window.location.href = top.$.rootUrl + "/UserCenter/IndexInTeacher";
- }
- });
- return false;
- });
- //返回
- $('#lr_back_btn').on('click', function () {
- window.location.href = top.$.rootUrl + "/UserCenter/IndexInTeacher";
- });
- },
- 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]);
- }
- else {
- $('[data-table="' + id + '"]').lrSetFormData(data[id]);
-
- }
- ue.ready(function () {
- ue.setContent(data[id].resume);
- });
- //赋值
- $.each(data[id], function (key, value) {
- var dom = $('#' + key)[0];
- if (dom) {
- if (dom.tagName.toLowerCase() == "span") {
- $('#' + key).html(value);
- //数据字典
- if ($.inArray(key, colDataItemArr) >= 0) {
- learun.clientdata.getAsync('dataItem', {
- code: colDataItemCode[$.inArray(key, colDataItemArr)],
- key: '' + value + '',
- callback: function (data, op) {
- $('#' + key).html(data.text);
- }
- });
- }
- //数据源
- if ($.inArray(key, colDataSourceArr) >= 0) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + colDataSourceCode[$.inArray(key, colDataSourceArr)],
- key: value,
- keyId: colDataSourceValue[$.inArray(key, colDataSourceArr)],
- callback: function (data) {
- var txt = data['' + colDataSourceText[$.inArray(key, colDataSourceArr)] + ''];
- $('#' + key).html(txt).attr('title', txt);
- }
- });
- }
- }
- }
- });
- }
- });
- }
- }
- };
- page.init();
- }
|