/* * 版 本 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);
}, 250, 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();
//校区
$('#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();
// 刷新
$('#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_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/FormView?keyValue=' + keyValue,
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 ? "" : "";
return cellvalue == true ? "已审核" : "未审核";
}
},
{ label: "职工编号", name: "EmpNo", width: 100, align: "left" },
{ label: "姓名", name: "EmpName", width: 100, align: "left" },
{
label: "民族", name: "NationalityNo", width: 100, align: "left",
formatterAsync: function (callback, value, row, op, $cell) {
learun.clientdata.getAsync('dataItem', {
key: value,
code: 'National',
callback: function (_data) {
callback(_data.text);
}
});
}
},
{
label: "性别", name: "GenderNo", width: 80, align: "left",
formatter: function (cellvalue) {
return cellvalue == true ? "男" : "女";
}
},
{
label: "政治面貌", name: "PartyFaceNo", width: 100, align: "left",
formatterAsync: function (callback, value, row, op, $cell) {
learun.clientdata.getAsync('dataItem', {
key: value,
code: 'BCdPartyFace',
callback: function (_data) {
callback(_data.text);
}
});
}
},
{ label: "入党时间", name: "JoinPartyTime", width: 100, align: "left" },
{ label: "出生年月", name: "Birthday", width: 100, align: "left" },
{ label: "是否授课", name: "IsHasLesson", width: 100, align: "left", formatter: function (cellvalue) { return cellvalue == true ? "是" : "否" } },
{
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: 'id',
callback: function (_data) {
callback(_data['name']);
}
});
}
},
{
label: "原始学历", name: "CultureDegreeNo", 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: "GraduateSchoolName", width: 120, align: "left" },
{ label: "原始学历专业", name: "Major1", width: 120, align: "left" },
{ label: "原始学历毕业时间", name: "GraduateDate1", width: 120, 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: "GraduateSchoolName2", width: 120, align: "left" },
{ label: "最高学历专业", name: "Major2", width: 120, align: "left" },
{ label: "最高学历毕业时间", name: "GraduateDate2", width: 120, align: "left" },
{ label: "参加工作时间", name: "AddWorkDate", width: 100, align: "left" },
{ label: "进入本单位时间", name: "SchoolDate", width: 100, align: "left" },
{ label: "任现职时间", name: "InSchoolDate", width: 100, align: "left" },
{ label: "任同职级职务时间", name: "InRankDate", width: 120, align: "left" },
{ label: "籍贯", name: "LocusOfArchives", width: 100, align: "left" },
{ label: "户籍所在地", name: "LocusOfResidence", width: 100, align: "left" },
{ label: "家庭住址", name: "Homeaddress", width: 100, align: "left" },
{ label: "联系电话", name: "mobile", width: 100, align: "left" },
{ label: "身份证号", name: "IdentityCardNo", width: 150, align: "left" },
{ label: "职称", name: "TitleOfTechPostNo", width: 100, align: "left" },
{
label: "职级", name: "PostRank", width: 100, align: "left",
formatterAsync: function (callback, value, row, op, $cell) {
learun.clientdata.getAsync('dataItem', {
key: value,
code: 'BCdTitleOfTechPost',
callback: function (_data) {
callback(_data.text);
}
});
}
},
{ label: "评审通过日期", name: "ReviewDate", width: 100, align: "left" },
{ label: "改评通过日期", name: "ReviewDate2", width: 100, align: "left" },
{ label: "教师资格证名称", name: "TeacherCertificateName", width: 100, align: "left" },
{ label: "教师资格证号", name: "TeacherCertificateNo", width: 100, align: "left" },
{ label: "评审单位", name: "ReviewUnit", width: 100, align: "left" },
{ label: "护照/港澳台通行证", name: "PassPort", width: 120, 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();
}