|
- /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
- * Copyright (c) 2013-2018 北京泉江科技有限公司
- * 创建人:超级管理员
- * 日 期:2019-01-29 17:31
- * 描 述:教师信息管理
- */
- var refreshGirdData;
- var bootstrap = function ($, learun) {
- "use strict";
- var page = {
- init: function () {
- page.initGird();
- page.bind();
- },
- bind: function () {
- $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
- page.search(queryJson);
- }, 280, 400);
- //$('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' });
- $('#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();
- //政治面貌
- $('#PartyFaceNo').lrDataSourceSelect({ code: 'BCdPartyFace', value: 'partyfaceno', text: 'partyface' });
- //最高学历
- $('#HighestRecord').lrDataSourceSelect({ code: 'BCdCultureDegree', value: 'culturedegreeno', text: 'culturedegree' });
-
-
- //民族
- $('#NationalityNo').lrDataSourceSelect({ code: 'BCdNationality', value: 'nationalityno', text: 'nationality' });
- //性别
- $('#GenderNo').lrDataItemSelect({ code: 'usersexbit' });
- //是否审核
- $('#CheckMark').lrDataItemSelect({ code: 'YesOrNoInt' });
- //学位
- $('#DegreeNo').lrDataSourceSelect({ code: 'BCdDegree', value: 'degreeno', text: 'degreename' });
- //职称
- $('#ProfessionalTitle').lrDataItemSelect({ code: 'jszc' });
- // 部门选择
- $('#F_DepartmentId').lrselect({
- type: 'tree',
- // 是否允许搜索
- allowSearch: true,
- // 访问数据接口地址
- url: top.$.rootUrl + '/LR_OrganizationModule/Department/GetTreeNoCheck',
- // 访问数据接口参数
- });
- // 刷新
- $('#lr_refresh').on('click', function () {
- location.reload();
- });
- // 新增
- $('#lr_add').on('click', function () {
- learun.layerForm({
- id: 'form',
- title: '新增',
- url: top.$.rootUrl + '/EducationalAdministration/EmpInfo/Form',
- width: 1000,
- height: 800,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- });
- // 编辑
- $('#lr_edit').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('EmpId');
- if (learun.checkrow(keyValue)) {
- if (keyValue.indexOf(',') != -1) {
- learun.alert.warning("只能选择一条记录进行编辑!");
- return;
- }
- var CheckMark = $('#gridtable').jfGridValue('CheckMark');
- if (CheckMark === "true") {
- learun.alert.warning("当前项目已审核不能编辑!");
- return;
- }
- learun.layerForm({
- id: 'form',
- title: '编辑',
- url: top.$.rootUrl + '/EducationalAdministration/EmpInfo/Form?keyValue=' + keyValue,
- width: 1000,
- height: 800,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- }
- });
- //导入
- $('#lr_import').on('click', function () {
- learun.layerForm({
- id: 'form',
- title: '导入',
- url: top.$.rootUrl + '/EducationalAdministration/EmpInfo/ImportForm',
- width: 400,
- height: 300,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- })
- //查看
- $('#lr_view').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('EmpId');
- if (learun.checkrow(keyValue)) {
- if (keyValue.indexOf(',') != -1) {
- learun.alert.warning("只能选择一条记录进行查看!");
- return;
- }
- learun.layerForm({
- id: 'formView',
- title: '查看',
- url: top.$.rootUrl + '/EducationalAdministration/EmpInfo/Form?keyValue=' + keyValue + '&isView=' + true,
- width: 1162,
- height: 600,
- btn: null
- });
- }
- });
- // 修改部门、系部
- $('#lr_editDept').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('EmpId');
- if (learun.checkrow(keyValue)) {
- var CheckMark = $('#gridtable').jfGridValue('CheckMark');
- if (CheckMark.indexOf('true') != -1) {
- learun.alert.warning("选中记录中包含已启用项目!");
- return;
- }
- learun.layerForm({
- id: 'formEdit',
- title: '修改部门、系部',
- url: top.$.rootUrl + '/EducationalAdministration/EmpInfo/FormEdit?keyValue=' + keyValue,
- width: 600,
- height: 400,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- }
- });
- // 删除
- $('#lr_delete').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('EmpId');
- if (learun.checkrow(keyValue)) {
- var CheckMark = $('#gridtable').jfGridValue('CheckMark');
- if (CheckMark.indexOf('true') != -1) {
- learun.alert.warning("选中记录中包含已启用项目,已启用不能删除!");
- return;
- }
- //if (CheckMark === true) {
- // learun.alert.warning("当前项目已审核不能删除!");
- // return;
- //}
- learun.layerConfirm('是否确认删除该项!', function (res) {
- if (res) {
- learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/EmpInfo/DeleteForm', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- //审核
- $('#lr_lock').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('EmpId');
- if (learun.checkrow(keyValue)) {
- var CheckMark = $('#gridtable').jfGridValue('CheckMark');
- if (CheckMark.indexOf('true') != -1) {
- learun.alert.warning("选中记录中包含已启用项目!");
- return;
- }
- //if (CheckMark === true) {
- // learun.alert.warning("当前项目已审核无需再审!");
- // return;
- //}
- learun.layerConfirm('是否确认审核该项!', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/EmpInfo/Lock', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- //去审核
- $('#lr_unlock').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('EmpId');
- if (learun.checkrow(keyValue)) {
- var CheckMark = $('#gridtable').jfGridValue('CheckMark');
- if (CheckMark.indexOf('false') != -1) {
- learun.alert.warning("选中记录中包含已停用项目!");
- return;
- }
- //if (CheckMark === false) {
- // learun.alert.warning("当前项目还未审核不需要去审核!");
- // return;
- //}
- learun.layerConfirm('是否确认去审核该项!', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/EmpInfo/UnLock', { keyValue: keyValue }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- $('#checkall').on('click', function () {
- learun.layerConfirm('是否确认全部审核?', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/EmpInfo/CheckAll', {}, function () {
- refreshGirdData();
- });
- }
- });
- });
- //简历
- $('#lr_resume').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('EmpId');
- if (learun.checkrow(keyValue)) {
- if (keyValue.indexOf(',') != -1) {
- learun.alert.warning("只能选择一条记录!");
- return;
- }
- var CheckMark = $('#gridtable').jfGridValue('CheckMark');
- if (CheckMark === "true") {
- learun.alert.warning("当前项目已审核不能编辑!");
- return;
- }
- learun.layerForm({
- id: 'form',
- title: '编辑',
- url: top.$.rootUrl + '/EducationalAdministration/EmpInfo/Form?keyValue=' + keyValue,
- width: 800,
- height: 600,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- }
- });
- //生成帐号
- $('#lr_generate').on('click', function () {
- learun.layerConfirm('是否确认生成帐号!', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/EmpInfo/Generate', {}, function () {
- refreshGirdData();
- });
- }
- });
- });
-
- $("#lr_update").on("click", function () {
- learun.layerConfirm('是否确认更新帐号!', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/EmpInfo/UpdateAccount', {}, function () {
- refreshGirdData();
- })
- }
-
- })
-
- });
- $("#lr_switch").on("click", function () {
- $.get("/EducationalAdministration/TeachSwitch/GetFirstEntity", function (data) {
- if (data.code == "200") {
- if (data.data.ID) {
- learun.layerForm({
- id: 'form',
- title: '设置',
- url: top.$.rootUrl + '/EducationalAdministration/TeachSwitch/Form?keyValue=' + data.data.ID,
- width: 600,
- height: 400,
- callBack: function (id) {
- return top[id].acceptClick();
- }
- });
-
- } else {
- learun.alert.warning("请在控制注册表中添加一条数据");
- }
- }
- }, "json")
- });
-
- //打印
- $('#lr_print').on('click', function () {
- var keyValue = $('#gridtable').jfGridValue('EmpId');
- if (learun.checkrow(keyValue)) {
- if (keyValue.indexOf(',') != -1) {
- learun.alert.warning("只能选择一条记录进行查看!");
- return;
- }
- learun.layerForm({
- id: 'print',
- title: '教职工基本信息登记表',
- url: top.$.rootUrl + '/EducationalAdministration/EmpInfo/Print?keyValue=' + keyValue,
- width: 1100,
- height: 800,
- btn: null
- });
- }
- });
- },
- // 初始化列表
- initGird: function () {
- $('#gridtable').lrAuthorizeJfGrid({
- url: top.$.rootUrl + '/EducationalAdministration/EmpInfo/GetPageList',
- headData: [
- {
- label: "审核标志", name: "CheckMark", width: 80, align: "center",
- formatter: function (cellvalue) {
- //return cellvalue == true ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
- return cellvalue == true ? "<span class=\"label label-success\">已审核</span>" : "<span class=\"label label-danger\">未审核</span>";
-
- }
- },
- { label: "职工编号", name: "EmpNo", width: 100, align: "left" },
- { label: "姓名", name: "EmpName", width: 100, align: "left" },
-
- {
- label: "校区", name: "F_CompanyId", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company',
- key: value,
- keyId: 'f_companyid',
- callback: function (_data) {
- callback(_data['f_fullname']);
- }
- });
- }
- },
- {
- label: "部门", name: "F_DepartmentId", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata',
- key: value,
- keyId: 'f_departmentid',
- callback: function (_data) {
- callback(_data['f_fullname']);
- }
- });
- }
- },
- //{
- // label: "系部", name: "DeptNo", width: 100, align: "left",
- // formatterAsync: function (callback, value, row, op, $cell) {
- // learun.clientdata.getAsync('custmerData', {
- // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
- // key: value,
- // keyId: 'deptno',
- // callback: function (_data) {
- // callback(_data['deptname']);
- // }
- // });
- // }
- //},
- {
- label: "性别", name: "GenderNo", width: 80, align: "left",
- formatter: function (cellvalue) {
- return cellvalue == true ? "男" : "女";
- }
- },
- { label: "是否授课", name: "IsHasLesson", width: 100, align: "left", formatter: function (cellvalue) { return cellvalue == true ? "是" : "否" } },
- { label: "出生日期", name: "Birthday", width: 100, align: "left" },
- {
- label: "民族", name: "NationalityNo", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BCdNationality',
- key: value,
- keyId: 'nationalityno',
- callback: function (_data) {
- callback(_data['nationality']);
- }
- });
- }
- },
- {
- label: "政治面貌", name: "PartyFaceNo", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BCdPartyFace',
- key: value,
- keyId: 'partyfaceno',
- callback: function (_data) {
- callback(_data['partyface']);
- }
- });
- }
- },
- { label: "身份证号", name: "IdentityCardNo", width: 150, align: "left" },
-
- {
- label: "最高学历", name: "HighestRecord", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BCdCultureDegree',
- key: value,
- keyId: 'culturedegreeno',
- callback: function (_data) {
- callback(_data['culturedegree']);
- }
- });
- }
- },
- {
- label: "最高学位", name: "DegreeNo", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BCdDegree',
- key: value,
- keyId: 'degreeno',
- callback: function (_data) {
- callback(_data['degreename']);
- }
- });
- }
- },
- { label: "联系电话", name: "mobile", width: 100, align: "left" },
- { label: "电子邮箱", name: "EMail", width: 100, align: "left" },
- {
- label: "户籍省份", name: "ProvinceNo", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'DIC_PROVINCE',
- key: value,
- keyId: 'pcode',
- callback: function (_data) {
- callback(_data['pname']);
- }
- });
- }
- },
- {
- label: "户籍县区", name: "RegionNo", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'DIC_AREA',
- key: value,
- keyId: 'acode',
- callback: function (_data) {
- callback(_data['aname']);
- }
- });
- }
- },
- {
- label: "港澳台侨", name: "OverseasChineseNo", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BCdOverseasChinese',
- key: value,
- keyId: 'overseaschineseno',
- callback: function (_data) {
- callback(_data['overseaschinesename']);
- }
- });
- }
- },
- {
- label: "健康状况", name: "HealthStatusNo", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BCdHealthStatus',
- key: value,
- keyId: 'healthstatusno',
- callback: function (_data) {
- callback(_data['healthstatus']);
- }
- });
- }
- },
-
- {
- label: "家庭出身", name: "FamilyOriginNo", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BCdFamilyOrigin',
- key: value,
- keyId: 'familyoriginno',
- callback: function (_data) {
- callback(_data['familyorigin']);
- }
- });
- }
- },
- { label: "毕业学校", name: "GraduateSchoolName", width: 100, align: "left" },
- {
- label: "学科门类", name: "SubjectSpeciesNo", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BCdSubjectSpecies',
- key: value,
- keyId: 'subjectspeciesno',
- callback: function (_data) {
- callback(_data['subjectspecies']);
- }
- });
- }
- },
- {
- label: "岗位类别", name: "EmpSortNo", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('dataItem', {
- key: value,
- code: 'jsgw',
- callback: function (_data) {
- callback(_data.text);
- }
- });
- }
- },
- {
- label: "专职兼职", name: "EmpFullTimeNo", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('dataItem', {
- key: value,
- code: 'EmpFullTime',
- callback: function (_data) {
- callback(_data.text);
- }
- });
- }
- },
- {
- label: "岗位名称", name: "TitleOfTechPostNo", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BCdTitleOfTechPost',
- key: value,
- keyId: 'titleoftechpostno',
- callback: function (_data) {
- callback(_data['titleoftechpost']);
- }
- });
- }
- },
- {
- label: "编制类别", name: "CompilationCategory", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('dataItem', {
- key: value,
- code: 'CompilationCategory',
- callback: function (_data) {
- callback(_data.text);
- }
- });
- }
- },
- { label: "来校时间", name: "InSchoolDate", width: 100, align: "left" },
- { label: "紧急联系人", name: "Linkman", width: 100, align: "left" },
- { label: "联系人关系", name: "RelationOfLinkman", width: 100, align: "left" },
- { label: "联系人电话", name: "PhoneOfLinkman", width: 100, align: "left" },
-
- ],
- mainId: 'EmpId',
- isPage: true,
- isMultiselect: true
- });
- page.search();
- },
- search: function (param) {
- param = param || {};
- $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
- }
- };
- refreshGirdData = function () {
- page.search();
- };
- page.init();
- }
|