@@ -52,6 +52,7 @@ var bootstrap = function ($, learun) {
$("#TitleOfTechPostNo").parent().hide();
$("#InSchoolDate").parent().hide();
$("#resume").parent().hide();
$("#SalaryNumber").parent().hide();
//$("#Photo").parent().hide();
}
},
@@ -182,7 +183,7 @@ var bootstrap = function ($, learun) {
}
};
// 保存数据
acceptClick = function (callBack) {
acceptClick = function(callBack) {
if (!$('body').lrValidform()) {
return false;
}
@@ -194,38 +195,56 @@ var bootstrap = function ($, learun) {
};
//姓名重复提示
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;
$.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();
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();
}
});
return;
}
}
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/EmpInfo/SaveForm?keyValue=' + keyValue, postDatas, function (res) {
// 保存成功后才回调
if (!!callBack) {
callBack();
}
});
});
//工资编号重复判断
/*var s = $("#SalaryNumber").val();
var sn = s.sort();
for (var j = 0; j <s.length; j++) {
if (sn[j] == sn[j+1]
) {
alert("工资编号重复:" + sn[j]);
}
}*/
};