| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153 |
- var count = 0;
- var temp = 10;
- function addSubject(){
- count ++;
- //增加<tr/>
- //var index = $("#tab tr").length;
- $("#tab").append("<tr id=tabtr"+count+" >"
- +"<td style=\"width: 85px;\"> </td>"
- +"<td ><input type=\"text\" id=\"construction_subject" +count+ "\" name=\"construction_subject" + count + "\" ><a href=\"#\" onclick=\"delSubject(" + count +
- ")\"> <img src=\"/ynet/liger/lib/ligerUI/skins/ynet/images/index/jian.png\"></a></td>"
- +"<td > </td>"
- +"<td><input type=\"text\" id=\"construction_effective_date" +count+ "\" name=\"construction_effective_date" + count + "\"></td>"
- +"</tr>");
- $("#construction_effective_date"+count).ligerDateEditor({
- labelWidth : 100,
- labelAlign : 'right',
- initValue : ''
- });
- $("#count").val(count);
- }
- function delSubject(index){
- //var _len = $("#tab tr").length;
- $("tr[id='tabtr"+index+"']").remove();//删除当前行
- }
- $(function() {
- $("#tab1").ligerTab({
- onBeforeSelectTabItem : function(tabid) {
- },
- onAfterSelectTabItem : function(tabid) {
- showBorrow(tabid);
- resetForm();
- }
- });
- /*员工信息日期控件加载********start********/
-
- $("#staff_birthday").ligerDateEditor({
- labelWidth : 100,
- labelAlign : 'right',
- initValue : ''
- });
- $("#register_time").ligerDateEditor({
- labelWidth : 100,
- labelAlign : 'right',
- initValue : ''
- });
- $("#agreement_time").ligerDateEditor({
- labelWidth : 100,
- labelAlign : 'right',
- initValue : ''
- });
- $("#social_time").ligerDateEditor({
- labelWidth : 100,
- labelAlign : 'right',
- initValue : ''
- });
- $("#health_time").ligerDateEditor({
- labelWidth : 100,
- labelAlign : 'right',
- initValue : ''
- });
- $("#fund_time").ligerDateEditor({
- labelWidth : 100,
- labelAlign : 'right',
- initValue : ''
- });
- /*员工信息日期控件加载********end********/
-
- /*职称日期控件加载********start********/
- $("#issue_date").ligerDateEditor({
- labelWidth : 100,
- labelAlign : 'right',
- initValue : ''
- });
-
- /*职称日期控件加载********end********/
-
- /*建造师日期控件加载********start********/
- $("#construction_effective_date0").ligerDateEditor({
- labelWidth : 100,
- labelAlign : 'right',
- initValue : ''
- });
-
- $("#continuing_education_time").ligerDateEditor({
- labelWidth : 100,
- labelAlign : 'right',
- initValue : ''
- });
-
- $("#send_card_time").ligerDateEditor({
- labelWidth : 100,
- labelAlign : 'right',
- initValue : ''
- });
-
- /*建造师日期控件加载********end********/
-
- /*八大员日期控件加载********start********/
- $("#eight_type_date").ligerDateEditor({
- labelWidth : 100,
- labelAlign : 'right',
- initValue : ''
- });
-
- $("#eight_type_effective_date").ligerDateEditor({
- labelWidth : 100,
- labelAlign : 'right',
- initValue : ''
- });
- /*八大员日期控件加载********end********/
-
- /*三类人员日期控件加载********start********/
- $("#provide_certificate_time").ligerDateEditor({
- labelWidth : 100,
- labelAlign : 'right',
- initValue : ''
- });
-
- $("#b_three_type_effective_date").ligerDateEditor({
- labelWidth : 100,
- labelAlign : 'right',
- initValue : ''
- });
- /*三类人员日期控件加载********end********/
-
- /*特种工日期控件加载********start********/
- $("#special_work_start_certificate_time").ligerDateEditor({
- labelWidth : 100,
- labelAlign : 'right',
- initValue : ''
- });
-
- $("#special_work_effective_date").ligerDateEditor({
- labelWidth : 100,
- labelAlign : 'right',
- initValue : ''
- });
- /*特种工日期控件加载********end********/
-
- /*其他日期控件加载********start********/
- $("#other_effective_date").ligerDateEditor({
- labelWidth : 100,
- labelAlign : 'right',
- initValue : ''
- });
- /*其他日期控件加载********end********/
- });
- /**********************************修改回填AJAX**********************************/
- /**
- * 学历回填
- */
- function toEditEducation(id){
- $.ajax({
- type:"POST",
- url:"hrStaffAction.do?task=toEditEducationInfo&universalid="+id+"&time=" + new Date().getTime(),
- cache:false,
- dataType:'json',
- success:function(data){
- $("#educationId").val(data[0].universalid);
- $("#study_type").val(data[0].study_type);
- $("#study_school_name").val(data[0].study_school_name);
- $("#study_subject").val(data[0].study_subject);
- $("#study_degree").val(data[0].study_degree);
- $("#study_start_end_time").val(data[0].study_start_end_time);
- $("#isEdit").val(data[0].isEdit);
- editViewFileHtml(data[0].t_file_id, "study_affix",true,5);
- $("#study_educational_background").val(data[0].study_educational_background);
-
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }
- /**
- * 工作经历回填
- */
- function toEditExperience(id){
- $.ajax({
- type:"POST",
- url:"hrStaffAction.do?task=toEditExperienceInfo&universalid="+id+"&time=" + new Date().getTime(),
- cache:false,
- dataType:'json',
- success:function(data){
- $("#experienceId").val(data[0].universalid);
- $("#work_company").val(data[0].work_company);
- $("#work_position").val(data[0].work_position);
- $("#work_start_end_time").val(data[0].work_start_end_time);
- $("#work_resignation_reason").val(data[0].work_resignation_reason);
- $("#isEdit").val(data[0].isEdit);
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }
- /**
- * 家庭成员回填
- */
- function toEditFamily(id){
- $.ajax({
- type:"POST",
- url:"hrStaffAction.do?task=toEditFamilyMember&universalid="+id+"&time=" + new Date().getTime(),
- cache:false,
- dataType:'json',
- success:function(data){
- $("#familyId").val(data[0].universalid);
- $("#member_name").val(data[0].member_name);
- $("#member_relation").val(data[0].member_relation);
- $("#member_company").val(data[0].member_company);
- $("#member_position").val(data[0].member_position);
- $("#member_phone").val(data[0].member_phone);
- $("#member_remark").val(data[0].member_remark);
- $("#isEdit").val(data[0].isEdit);
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }
- /**
- * 职称回填
- */
- function toEditPosition(id){
- $.ajax({
- type:"POST",
- url:"hrStaffCardAction.do?task=toEditPosition&universalid="+id+"&time=" + new Date().getTime(),
- cache:false,
- dataType:'json',
- success:function(data){
- $("#positionId").val(data[0].universalid);
- var ss = $("input:radio[name='position_type_id']");
- for ( var int = 0; int < ss.length; int++) {
- if(ss[int].value==data[0].position_type_id){
- ss[int].checked=true;
- break;
- }
- }
- $("#position_name").val(data[0].position_name);
- $("#position_subject").val(data[0].position_subject);
- $("#send_unit").val(subDate(data[0].send_unit));
- $("#card_num").val(data[0].card_num);
- $("#refe_num").val(data[0].refe_num);
- $("#issue_date").val(subDate(data[0].issue_date));
- $("#position_remark").val(data[0].position_remark);
- editViewFileHtml(data[0].t_file_id, "position_affix",true,5);
- $("#isEdit").val(data[0].isEdit);
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }
- function toEditReWards(id){
- $.ajax({
- type:"POST",
- url:"hrStaffAction.do?task=viewRewards&rewards_id="+id+"&time=" + new Date().getTime(),
- cache:false,
- dataType:'json',
- success:function(data){
- $("#rewards_id").val(data[0].universalid);
- $("#class_id option[value="+data[0].class_id+"]").attr("selected",true);
- initReWardsType();
- $("#type_id option[value="+data[0].type_id+"]").attr("selected",true);
- $("#dept_name").val(data[0].groupname);
- $("#dept_id").val(data[0].dept_id);
- $("#rewards_date").val(data[0].rewards_date);
- if(null!=data[0].descript)
- $("#descript").val(data[0].descript);
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }
- function delReWards(id){
- $.ajax({
- type:"POST",
- url:"hrStaffAction.do?task=delRewards&rewards_id="+id+"&time=" + new Date().getTime(),
- cache:false,
- dataType:'json',
- success:function(data){
- if(data.i>0){
- resetReWardsForm();
- getReWards();
- addInfo("删除成功!");
- }else{
- addInfo("删除失败!");
- }
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }
- function backToPosition(){
- var type_id = "";
- var ss = $("input:radio[name='position_type_id']");
- for ( var int = 0; int < ss.length; int++) {
- if(ss[int].checked){
- type_id = ss[int].title;
- break;
- }
- }
- $("#position_name").val(type_id);
- }
- /**
- * 建造师回填
- */
- function toEditConstruction(id){
- $.ajax({
- type:"POST",
- url:"hrStaffCardAction.do?task=toEditConstructionEngineer&universalid="+id+"&time=" + new Date().getTime(),
- cache:false,
- dataType:'json',
- success:function(data){
- resetForm();//重置表单
- $("#constructionId").val(data[0].universalid);
- var ss = $("input:radio[name='construction_engineer_type_id']");
- for ( var int = 0; int < ss.length; int++) {
- if(ss[int].value==data[0].construction_engineer_type_id){
- ss[int].checked=true;
- break;
- }
- }
- $("#registration_number").val(data[0].registration_number);
- $("#registration_certificate_id").val(data[0].registration_certificate_id);
- $("#operation_certificate").val(data[0].operation_certificate);
- if(data[0].continuing_education_time == null){
- $("#continuing_education_time").val("");
- }else{
- $("#continuing_education_time").val(subDate(data[0].continuing_education_time));
- }
- $("#continuing_education_subject").val(data[0].continuing_education_subject);
- $("#person_system_password").val(data[0].person_system_password);
- $("#lock_system").val(data[0].lock_system);
- $("#send_card_time").val(subDate(data[0].send_card_time));
- $("#construction_engineer_remark").val(data[0].construction_engineer_remark);
- editViewFileHtml(data[0].t_file_id, "construction_engineer_affix",true,5);
- $("#isEdit").val(data[0].isEdit);
-
- for ( var i = 0; i < data[0].constructionEngineerSubjectList.length; i++) {
- if(i==0){
- $("#construction_subject0").val(data[0].constructionEngineerSubjectList[0].construction_subject);
- $("#construction_effective_date0").val(data[0].constructionEngineerSubjectList[0].construction_effective_date);
- }else{
- $("#tab").append("<tr id=tabtr"+(i+count+temp)+" >"
- +"<td style=\"width: 80px;\"> </td>"
- +"<td><input type=\"text\" id=\"construction_subject" +(i+count+temp)+ "\" name=\"construction_subject" + (i+count+temp) + "\" value="+data[0].constructionEngineerSubjectList[i].construction_subject+"><a href=\"#\" onclick=\"delSubject(" + (i+count+temp) +
- ")\"> <img src=\"/ynet/liger/lib/ligerUI/skins/ynet/images/index/jian.png\"></a></td>"
- +"<td> </td>"
- +"<td><input type=\"text\" id=\"construction_effective_date" + (i+count+temp)+ "\" name=\"construction_effective_date" + (i+count+temp) + "\" value="+data[0].constructionEngineerSubjectList[i].construction_effective_date+"></td>"
- +"</tr>");
- $("#construction_effective_date"+(i+count+temp)).ligerDateEditor({
- labelWidth : 100,
- labelAlign : 'right',
- initValue : ''
- });
- temp +=5;
- $("#temp").val(temp);
- $("#count").val((i+count+temp));
- }
- }
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }
- /**
- * 八大员回填
- */
- function toEditEightType(id){
- $.ajax({
- type:"POST",
- url:"hrStaffCardAction.do?task=toEditEightType&universalid="+id+"&time=" + new Date().getTime(),
- cache:false,
- dataType:'json',
- success:function(data){
- $("#eightTypeId").val(data[0].universalid);
- var ss = $("input:radio[name='eight_type_id']");
- for ( var int = 0; int < ss.length; int++) {
- if(ss[int].value==data[0].eight_type_id){
- ss[int].checked=true;
- break;
- }
- }
- $("#eight_post_job").val(data[0].eight_post_job);
- $("#eight_other_job").val(data[0].eight_other_job);
- $("#eight_card_id").val(data[0].eight_card_id);
- $("#eight_type_date").val(subDate(data[0].eight_type_date));
- $("#eight_type_effective_date").val(subDate(data[0].eight_type_effective_date));
- $("#eight_type_remark").val(data[0].eight_type_remark);
- editViewFileHtml(data[0].t_file_id, "eight_type_affix",true,5);
- $("#isEdit").val(data[0].isEdit);
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }
- /**
- * 三类人员回填
- */
- function toEditThreeType(id){
- $.ajax({
- type:"POST",
- url:"hrStaffCardAction.do?task=toEditThreeType&universalid="+id+"&time=" + new Date().getTime(),
- cache:false,
- dataType:'json',
- success:function(data){
- $("#threeTypeId").val(data[0].universalid);
- var ss = $("input:radio[name='three_type_id']");
- for ( var int = 0; int < ss.length; int++) {
- if(ss[int].value==data[0].three_type_id){
- ss[int].checked=true;
- break;
- }
- }
- $("#three_type_safety_check_id").val(data[0].three_type_safety_check_id);
- $("#provide_certificate_time").val(subDate(data[0].provide_certificate_time));
- $("#three_type_position").val(data[0].three_type_position);
- $("#b_three_type_effective_date").val(subDate(data[0].b_three_type_effective_date));
- $("#three_type_technology_position").val(data[0].three_type_technology_position);
- $("#three_type_remark").val(data[0].three_type_remark);
- editViewFileHtml(data[0].t_file_id, "three_type_affix",true,5);
- $("#isEdit").val(data[0].isEdit);
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }
- /**
- * 特种工回填
- */
- function toEditSpecialWork(id){
- $.ajax({
- type:"POST",
- url:"hrStaffCardAction.do?task=toEditSpecialWork&universalid="+id+"&time=" + new Date().getTime(),
- cache:false,
- dataType:'json',
- success:function(data){
- $("#specialWorkId").val(data[0].universalid);
- var ss = $("input:radio[name='special_work_type_id']");
- for ( var int = 0; int < ss.length; int++) {
- if(ss[int].value==data[0].special_work_type_id){
- ss[int].checked=true;
- break;
- }
- }
- $("#certificate_id").val(data[0].certificate_id);
- $("#work_type").val(data[0].work_type);
- $("#special_work_send_unit").val(data[0].special_work_send_unit);
- $("#special_work_start_certificate_time").val(subDate(data[0].special_work_start_certificate_time));
- $("#special_work_effective_date").val(subDate(data[0].special_work_effective_date));
- $("#first_check_time").val(data[0].first_check_time);
- $("#second_check_time").val(data[0].second_check_time);
- $("#special_work_remark").val(data[0].special_work_remark);
- editViewFileHtml(data[0].t_file_id, "special_work_affix",true,5);
- $("#isEdit").val(data[0].isEdit);
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }
- /**
- * 其他回填
- */
- function toEditOther(id){
- $.ajax({
- type:"POST",
- url:"hrStaffCardAction.do?task=toEditOther&universalid="+id+"&time=" + new Date().getTime(),
- cache:false,
- dataType:'json',
- success:function(data){
- $("#otherCardId").val(data[0].universalid);
- var ss = $("input:radio[name='other_type_id']");
- for ( var int = 0; int < ss.length; int++) {
- if(ss[int].value==data[0].other_type_id){
- ss[int].checked=true;
- break;
- }
- }
- $("#other_card_name").val(data[0].other_card_name);
- $("#other_card_id").val(data[0].other_card_id);
- $("#other_major").val(data[0].other_major);
- $("#other_effective_date").val(subDate(data[0].other_effective_date));
- $("#other_remark").val(data[0].other_remark);
- editViewFileHtml(data[0].t_file_id, "other_affix",true,5);
- $("#isEdit").val(data[0].isEdit);
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }
- /**********************************增删改AJAX**********************************/
- /**
- * 修改员工信息
- */
- function submitStaff(){
- var isPass = checkStaffForm();
- if(isPass == true){
- var isFollow = $("input[name='isFollow']:checked").parent().parent();
- var isLogin = $("input[name='isLogin']:checked").parent().parent();
- var seleceFollowValue = $("[name='branch_company_id']",isFollow).val();
- var seleceFollowPosition = $("[name='otherposname']",isFollow).val();
- var ids = document.getElementsByName("branch_company_id");
- var followGroups = "${followGroups}";
- for ( var i = 0; i < ids.length; i++) {
- if($("#gid_"+i).val() == ""){
- if(followGroups != ""){
- addFieldError("dept-position"+i,"请设定部门!");
- }else{
- if(i == 0){
- addFieldError("dept-position","请设定部门!");
- }else{
- addFieldError("dept-position"+i,"请设定部门!");
- }
- }
- return;
- }
- if($("#otherposname_"+i).val() == ""){
- if(followGroups != ""){
- addFieldError("dept-position"+i,"请设定职位!");
- }else{
- if(i == 0){
- addFieldError("dept-position","请设定职位!");
- }else{
- addFieldError("dept-position"+i,"请设定职位!");
- }
- }
- return;
- }
- }
- //判断工号是否存在
- var param = {"job_number":$("#job_number").val(),"staff_id":$("#staff_id").val()};
- sendAjaxParam(param, "hrStaffAction.do?task=checkJobNum&time="
- + new Date().getTime(), "json", function(data){
- if(data != '0'){
- $("#jobNumSpan").html("<font color='red'>该工号已存在!</font>");
- $("#jobNumCheck").val("1");
- }else{
- $("#jobNumSpan").html("");
- $("#jobNumCheck").val("0");
- }
- });
- if($("#jobNumCheck").val() != '0'){
- return false;
- }
-
- //判断考勤编号是否存在
- var attUserId = $("#att_user_id").val();
- if(attUserId && attUserId.trim() !== '') {
- var param = {"att_user_id":attUserId,"staff_id":$("#staff_id").val()};
- sendAjaxParam(param, "hrStaffAction.do?task=checkAttUserNum&time="
- + new Date().getTime(), "json", function(data){
- if(data != '0'){
- $("#attUserNumSpan").html("<font color='red'>考勤用户号已存在!</font>");
- $("#attUserNumCheck").val("1");
- }else{
- $("#attUserNumSpan").html("");
- $("#attUserNumCheck").val("0");
- }
- });
- } else {
- // 如果考勤编号为空,清除错误提示并允许保存
- $("#attUserNumSpan").html("");
- $("#attUserNumCheck").val("0");
- }
- if($("#attUserNumCheck").val() != '0'){
- return false;
- }
- var seleceLoginValue = $("[name='branch_company_id']",isLogin).val();
- var seleceLoginPosition = $("[name='otherposname']",isLogin).val();
- $("input[name='isFollow']:checked").val(seleceFollowValue+"_"+seleceFollowPosition);
- $("input[name='isLogin']:checked").val(seleceLoginValue+"_"+seleceLoginPosition);
- var branch_company_id = document.getElementsByName("branch_company_id");
- var branch_company_id_arry = new Array(branch_company_id.length);
- for(var i=0;i<branch_company_id.length;i++){
- branch_company_id_arry[i] = branch_company_id[i].value;
- }
- var branch_company_name = document.getElementsByName("branch_company_name");
- var branch_company_name_arry = new Array(branch_company_name.length);
- for(var j=0;j<branch_company_name.length;j++){
- branch_company_name_arry[j] = branch_company_name[j].value;
- }
- var isFollow = document.getElementsByName("isFollow");
- var isFollow_arry = new Array(1);
- for(var k=0;k<isFollow.length;k++){
- if(isFollow[k].checked){
- isFollow_arry[k] = isFollow[k].value;
- }
- }
- var isLogin = document.getElementsByName("isLogin");
- var isLogin_arry = new Array(1);
- for(var b=0;b<isLogin.length;b++){
- if(isLogin[b].checked){
- isLogin_arry[b] = isLogin[b].value;
- }
- }
- var otherposname = document.getElementsByName("otherposname");
- var otherposname_arry = new Array(otherposname.length);
- for(var q=0;q<otherposname.length;q++){
- otherposname_arry[q] = otherposname[q].value;
- }
- var check_active = "";
- if($("#checkbox_active").attr("checked")==true){
- check_active = "checked";
- }
- var staffJson = {staff_id:$("#staff_id").val(),
- old_is_active_eu:$("#old_is_active_eu").val(),
- checkbox_active:check_active,
- username:encodeURI($("#username").val()),
- branch_company_id:branch_company_id_arry,
- branch_company_name:encodeURI(branch_company_name_arry),
- isFollow:isFollow_arry,
- isLogin:isLogin_arry,
- otherposname:otherposname_arry,
- job_number:encodeURI($("#job_number").val()),
- is_party:$("#is_party").val(),
- anmelden_pro:encodeURI($("#anmelden_pro").val()),
- att_user_id:encodeURI($("#att_user_id").val()),
- att_shit_id:encodeURI($("#att_shit_id").val()),
- file_num:$("#file_num").val(),
- staff_name:encodeURI($("#staff_name").val()),
- staff_sex:$("#staff_sex").val(),
- staff_birthday:$("#staff_birthday").val(),
- ethnic_group:encodeURI($("#ethnic_group").val()),
- blood_type:encodeURI($("#blood_type").val()),
- body_height:encodeURI($("#body_height").val()),
- body_weight:encodeURI($("#body_weight").val()),
- marital_status:encodeURI($("#marital_status").val()),
- native:encodeURI($("#native").val()),
- political_landscape:encodeURI($("#political_landscape").val()),
- job_title:encodeURI($("#job_title").val()),
- census_address:encodeURI($("#census_address").val()),
- home_address:encodeURI($("#home_address").val()),
- self_phone:encodeURI($("#self_phone").val()),
- id_number_affix:$("#id_number_affix").val(),
- id_number:$("#id_number").val(),
- agreement_affix:$("#agreement_affix").val(),
- is_dimission:$("#is_dimission").val(),
- register_time:$("#register_time").val(),
- agreement_time:$("#agreement_time").val(),
- social_time:$("#social_time").val(),
- health_time:$("#health_time").val(),
- fund_time:$("#fund_time").val(),
- craft_type:$("#craft_type").val(),
- //branch_company_id:encodeURI($("#branch_company_id").val()),
- //branch_company_name:encodeURI($("#branch_company_name").val()),
- contact_person:encodeURI($("#contact_person").val()),
- contact_person_phone:encodeURI($("#contact_person_phone").val()),
- staff_photo:document.getElementsByName("staff_photo")[0].value};
- $.ajax({
- type:"POST",
- url:"hrStaffAction.do?task=editStaffBasicInfo&time=" + new Date().getTime(),
- cache:false,
- data:staffJson,
- success:function(data){
- // refreshWindow(getCurWindowId());
- addInfo("保存成功!");
- if (old_tabid.length > 0) {
- var tabid = getCurrentTabId();
- window.parent.f_selectTab(old_tabid);
- window.parent.f_reloadTab(old_tabid);
- window.parent.f_closeTab(tabid);
- }
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }
- }
- /**
- * 保存学历信息
- */
- function submitSaveEducation(){
- var isPass = checkEducationForm();
- var isEdit = $("#isEdit").val();
- if(isPass == true){
- var educationJson = {staff_id:$("#staff_id").val(),
- universalid:$("#educationId").val(),
- study_type:encodeURI($("#study_type").val()),
- study_school_name:encodeURI($("#study_school_name").val()),
- study_subject:encodeURI($("#study_subject").val()),
- study_educational_background:encodeURI($("#study_educational_background").val()),
- study_degree:encodeURI($("#study_degree").val()),
- study_start_end_time:encodeURI($("#study_start_end_time").val()),
- study_affix_id:getMoreDocId(document.getElementsByName("study_affix"))};
- if(isEdit !=""){
- $.ajax({
- type:"POST",
- url:"hrStaffAction.do?task=editEducationInfo&time=" + new Date().getTime(),
- cache:false,
- data:educationJson,
- success:function(data){
- resetForm();
- getEducation();
- addInfo("保存成功!");
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }else{
- $.ajax({
- type:"POST",
- url:"hrStaffAction.do?task=addEducationInfo&time=" + new Date().getTime(),
- cache:false,
- data:educationJson,
- success:function(data){
- resetForm();
- getEducation();
- addInfo("保存成功!");
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }
- }
- }
- /**
- *删除学历信息
- */
- function delEducation(id){
- if(confirm("确定要删除该学历吗?")){
- $.ajax({
- type:"POST",
- url:"hrStaffAction.do?task=delEducationInfo&universalid="+id+"&time=" + new Date().getTime(),
- cache:false,
- success:function(data){
- resetForm();
- getEducation();
- addInfo("删除成功!");
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }
- }
- /**
- * 保存工作经历信息
- */
- function submitSaveExperience(){
- var isPass = checkExperienceForm();
- var isEdit = $("#isEdit").val();
- if(isPass == true){
- var experienceJson = {staff_id:$("#staff_id").val(),
- universalid:$("#experienceId").val(),
- work_company:encodeURI($("#work_company").val()),
- work_position:encodeURI($("#work_position").val()),
- work_start_end_time:encodeURI($("#work_start_end_time").val()),
- work_resignation_reason:encodeURI($("#work_resignation_reason").val())};
- if(isEdit !=""){
- $.ajax({
- type:"POST",
- url:"hrStaffAction.do?task=editExperienceInfo&time=" + new Date().getTime(),
- cache:false,
- data:experienceJson,
- success:function(data){
- resetForm();
- getExperience();
- addInfo("保存成功!");
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }else{
- $.ajax({
- type:"POST",
- url:"hrStaffAction.do?task=addExperienceInfo&time=" + new Date().getTime(),
- cache:false,
- data:experienceJson,
- success:function(data){
- resetForm();
- getExperience();
- addInfo("保存成功!");
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }
- }
- }
- /**
- *删除工作经历
- */
- function delExperience(id){
- if(confirm("确定要删除该工作经历吗?")){
- $.ajax({
- type:"POST",
- url:"hrStaffAction.do?task=delExperienceInfo&universalid="+id+"&time=" + new Date().getTime(),
- cache:false,
- success:function(data){
- resetForm();
- getExperience();
- addInfo("删除成功!");
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }
- }
- /**
- * 保存家庭成员信息
- */
- function submitSaveFamily(){
- var isPass = checkFamilyForm();
- var isEdit = $("#isEdit").val();
- if(isPass == true){
- var familyJson = {staff_id:$("#staff_id").val(),
- universalid:$("#familyId").val(),
- member_name:encodeURI($("#member_name").val()),
- member_relation:encodeURI($("#member_relation").val()),
- member_company:encodeURI($("#member_company").val()),
- member_position:encodeURI($("#member_position").val()),
- member_phone:encodeURI($("#member_phone").val()),
- member_remark:encodeURI($("#member_remark").val())};
- if(isEdit !=""){
- $.ajax({
- type:"POST",
- url:"hrStaffAction.do?task=editFamilyMember&time=" + new Date().getTime(),
- cache:false,
- data:familyJson,
- success:function(data){
- resetForm();
- getFamily();
- addInfo("保存成功!");
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }else{
- $.ajax({
- type:"POST",
- url:"hrStaffAction.do?task=addFamilyMember&time=" + new Date().getTime(),
- cache:false,
- data:familyJson,
- success:function(data){
- resetForm();
- getFamily();
- addInfo("保存成功!");
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }
- }
- }
- //奖惩
- function saveRewards(){
- var isPass =checkReWardsForm();
- if(isPass){
- var rewardsjson={
- class_id:$("#class_id").val(),
- rewards_id:$("#rewards_id").val(),
- type_id:$("#type_id").val(),
- dept_id:$("#dept_id").val(),
- rewards_date:$("#rewards_date").val(),
- staff_id:$("#staff_id").val(),
- descript:encodeURI($("#descript").val())
- };
- if($("#rewards_id").val() !=""){
- $.ajax({
- type:"POST",
- url:"hrStaffAction.do?task=editRewards&time=" + new Date().getTime(),
- cache:false,
- data:rewardsjson,
- dataType:'json',
- success:function(data){
- if(data.i>0){
- resetReWardsForm();
- getReWards();
- addInfo("保存成功!");
- }else{
- addInfo("保存失败!");
- }
-
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }else{
- $.ajax({
- type:"POST",
- url:"hrStaffAction.do?task=addRewards&time=" + new Date().getTime(),
- cache:false,
- data:rewardsjson,
- dataType:'json',
- success:function(data){
- if(data.i>0){
- resetReWardsForm();
- getReWards();
- addInfo("保存成功!");
- }else{
- addInfo("保存失败!");
- }
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }
- }
- }
- /**
- *删除家庭成员
- */
- function delFamily(id){
- if(confirm("确定要删除该成员吗?")){
- $.ajax({
- type:"POST",
- url:"hrStaffAction.do?task=delFamilyMember&universalid="+id+"&time=" + new Date().getTime(),
- cache:false,
- success:function(data){
- resetForm();
- getFamily();
- addInfo("删除成功!");
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }
- }
- /**
- * 保存职称信息
- */
- function submitSavePosition(){
- // var isPass = checkPositionForm();
- // var isPass=true;
- var rs = $.validate({
- name : "position_name",
- model : [ {
- type : "require",
- msg : "职称不能为空!"
- }]
- });
- var isEdit = $("#isEdit").val();
- if(rs){
- // var type_id = getTypeId("position_type_id");
- var positionJson = {staff_id:$("#staff_id").val(),
- universalid:$("#positionId").val(),
- // position_type_id:type_id,
- // position_type_id:encodeURI($("#position_type_id").val()),
- position_name:encodeURI($("#position_name").val()),
- position_subject:encodeURI($("#position_subject").val()),
- send_unit:encodeURI($("#send_unit").val()),
- card_num:encodeURI($("#card_num").val()),
- refe_num:encodeURI($("#refe_num").val()),
- issue_date:$("#issue_date").val(),
- position_remark:encodeURI($("#position_remark").val()),
- position_affix_id:getMoreDocId(document.getElementsByName("position_affix"))};
- if(isEdit !=""){
- $.ajax({
- type:"POST",
- url:"hrStaffCardAction.do?task=editPosition&time=" + new Date().getTime(),
- cache:false,
- data:positionJson,
- success:function(data){
- resetForm();
- getPosition();
- addInfo("保存成功!");
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }else{
- $.ajax({
- type:"POST",
- url:"hrStaffCardAction.do?task=addPosition&time=" + new Date().getTime(),
- cache:false,
- data:positionJson,
- success:function(data){
- resetForm();
- getPosition();
- addInfo("保存成功!");
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }
- }
- }
- /**
- *删除职称
- */
- function delPosition(id){
- if(confirm("确定要删除该职称吗?")){
- $.ajax({
- type:"POST",
- url:"hrStaffCardAction.do?task=delPosition&universalid="+id+"&time=" + new Date().getTime(),
- cache:false,
- success:function(data){
- resetForm();
- getPosition();
- addInfo("删除成功!");
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }
- }
- /**
- * 保存建造师信息
- */
- function submitSaveConstruction(){
- var isPass = checkConstructionForm();
- var isEdit = $("#isEdit").val();
- if(isPass == true){
- var type_id = getTypeId("construction_engineer_type_id");
- var count = $("#count").val();
- var constructionJson = {count:$("#count").val(),
- staff_id:$("#staff_id").val(),
- universalid:$("#constructionId").val(),
- construction_engineer_type_id:type_id,
- registration_number:encodeURI($("#registration_number").val()),
- registration_certificate_id:encodeURI($("#registration_certificate_id").val()),
- operation_certificate:encodeURI($("#operation_certificate").val()),
- continuing_education_time:$("#continuing_education_time").val(),
- continuing_education_subject:encodeURI($("#continuing_education_subject").val()),
- person_system_passowrd:encodeURI($("#person_system_passowrd").val()),
- lock_system:encodeURI($("#lock_system").val()),
- send_card_time:$("#send_card_time").val(),
- construction_engineer_remark:encodeURI($("#construction_engineer_remark").val()),
- construction_engineer_affix_id:getMoreDocId(document.getElementsByName("construction_engineer_affix"))};
-
- var urlStr = "";
- for ( var i = 0; i <= count; i++) {
- urlStr += "&construction_subject"+i+"="+$("#construction_subject"+i).val();
- urlStr += "&construction_effective_date"+i+"="+$("#construction_effective_date"+i).val();
- }
- if(isEdit !=""){
- $.ajax({
- type:"POST",
- url:"hrStaffCardAction.do?task=editConstructionEngineer"+urlStr+"&time=" + new Date().getTime(),
- cache:false,
- data:constructionJson,
- success:function(data){
- resetForm();
- getConstruction();
- addInfo("保存成功!");
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }else{
- $.ajax({
- type:"POST",
- url:"hrStaffCardAction.do?task=addConstructionEngineer"+urlStr+"&time=" + new Date().getTime(),
- cache:false,
- data:constructionJson,
- success:function(data){
- resetForm();
- getConstruction();
- addInfo("保存成功!");
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }
- }
- }
- /**
- *删除建造师
- */
- function delConstruction(id){
- if(confirm("确定要删除该建造师信息吗?")){
- $.ajax({
- type:"POST",
- url:"hrStaffCardAction.do?task=delConstructionEngineer&universalid="+id+"&time=" + new Date().getTime(),
- cache:false,
- success:function(data){
- resetForm();
- getConstruction();
- addInfo("删除成功!");
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }
- }
- /**
- * 保存八大员信息
- */
- function submitSaveEightType(){
- var isPass = checkEightTypeForm();
- var isEdit = $("#isEdit").val();
- if(isPass == true){
- var type_id = getTypeId("eight_type_id");
- var eighttypeJson = {staff_id:$("#staff_id").val(),
- universalid:$("#eightTypeId").val(),
- eight_type_id:type_id,
- eight_post_job:encodeURI($("#eight_post_job").val()),
- eight_other_job:encodeURI($("#eight_other_job").val()),
- eight_card_id:encodeURI($("#eight_card_id").val()),
- eight_type_date:$("#eight_type_date").val(),
- eight_type_effective_date:$("#eight_type_effective_date").val(),
- eight_type_remark:encodeURI($("#eight_type_remark").val()),
- eight_type_affix_id:getMoreDocId(document.getElementsByName("eight_type_affix"))};
- if(isEdit !=""){
- $.ajax({
- type:"POST",
- url:"hrStaffCardAction.do?task=editEightType&time=" + new Date().getTime(),
- cache:false,
- data:eighttypeJson,
- success:function(data){
- resetForm();
- getEightType();
- addInfo("保存成功!");
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }else{
- $.ajax({
- type:"POST",
- url:"hrStaffCardAction.do?task=addEightType&time=" + new Date().getTime(),
- cache:false,
- data:eighttypeJson,
- success:function(data){
- resetForm();
- getEightType();
- alert("保存成功!");
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }
- }
- }
- /**
- *删除八大员
- */
- function delEightType(id){
- if(confirm("确定要删除该八大员信息吗?")){
- $.ajax({
- type:"POST",
- url:"hrStaffCardAction.do?task=delEightType&universalid="+id+"&time=" + new Date().getTime(),
- cache:false,
- success:function(data){
- resetForm();
- getEightType();
- addInfo("删除成功!");
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }
- }
- /**
- * 保存三类人员信息
- */
- function submitSaveThreeType(){
- var isPass = checkThreeTypeForm();
- var isEdit = $("#isEdit").val();
- if(isPass == true){
- var type_id = getTypeId("three_type_id");
- var threetypeJson = {staff_id:$("#staff_id").val(),
- universalid:$("#threeTypeId").val(),
- three_type_id:type_id,
- three_type_safety_check_id:encodeURI($("#three_type_safety_check_id").val()),
- provide_certificate_time:$("#provide_certificate_time").val(),
- three_type_position:encodeURI($("#three_type_position").val()),
- b_three_type_effective_date:$("#b_three_type_effective_date").val(),
- three_type_technology_position:encodeURI($("#three_type_technology_position").val()),
- three_type_remark:encodeURI($("#three_type_remark").val()),
- three_type_affix_id:getMoreDocId(document.getElementsByName("three_type_affix"))};
- if(isEdit !=""){
- $.ajax({
- type:"POST",
- url:"hrStaffCardAction.do?task=editThreeType&time=" + new Date().getTime(),
- cache:false,
- data:threetypeJson,
- success:function(data){
- resetForm();
- getThreeType();
- addInfo("保存成功!");
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }else{
- $.ajax({
- type:"POST",
- url:"hrStaffCardAction.do?task=addThreeType&time=" + new Date().getTime(),
- cache:false,
- data:threetypeJson,
- success:function(data){
- resetForm();
- getThreeType();
- addInfo("保存成功!");
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }
- }
- }
- /**
- *删除三类人员
- */
- function delThreeType(id){
- if(confirm("确定要删除该三类人员信息吗?")){
- $.ajax({
- type:"POST",
- url:"hrStaffCardAction.do?task=delThreeType&universalid="+id+"&time=" + new Date().getTime(),
- cache:false,
- success:function(data){
- resetForm();
- getThreeType();
- addInfo("删除成功!");
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }
- }
- /**
- * 保存特种工信息
- */
- function submitSaveSpecialWork(){
- var isPass = checkSpecialWorkForm();
- var isEdit = $("#isEdit").val();
- if(isPass == true){
- var type_id = getTypeId("special_work_type_id");
- var workJson = {staff_id:$("#staff_id").val(),
- universalid:$("#specialWorkId").val(),
- special_work_type_id:type_id,
- special_work_send_unit:encodeURI($("#special_work_send_unit").val()),
- certificate_id:encodeURI($("#certificate_id").val()),
- work_type:encodeURI($("#work_type").val()),
- special_work_start_certificate_time:$("#special_work_start_certificate_time").val(),
- special_work_effective_date:$("#special_work_effective_date").val(),
- first_check_time:encodeURI($("#first_check_time").val()),
- second_check_time:encodeURI($("#second_check_time").val()),
- special_work_remark:encodeURI($("#special_work_remark").val()),
- special_work_affix_id:getMoreDocId(document.getElementsByName("special_work_affix"))};
- if(isEdit !=""){
- $.ajax({
- type:"POST",
- url:"hrStaffCardAction.do?task=editSpecialWork&time=" + new Date().getTime(),
- cache:false,
- data:workJson,
- success:function(data){
- resetForm();
- getSpecialWork();
- addInfo("保存成功!");
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }else{
- $.ajax({
- type:"POST",
- url:"hrStaffCardAction.do?task=addSpecialWork&time=" + new Date().getTime(),
- cache:false,
- data:workJson,
- success:function(data){
- resetForm();
- getSpecialWork();
- addInfo("保存成功!");
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }
- }
- }
- /**
- *删除特种工
- */
- function delSpecialWork(id){
- if(confirm("确定要删除该特种工信息吗?")){
- $.ajax({
- type:"POST",
- url:"hrStaffCardAction.do?task=delSpecialWork&universalid="+id+"&time=" + new Date().getTime(),
- cache:false,
- success:function(data){
- resetForm();
- getSpecialWork();
- addInfo("删除成功!");
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }
- }
- /**
- * 保存其他信息
- */
- function submitSaveOther(){
- var isPass = checkOtherForm();
- var isEdit = $("#isEdit").val();
- if(isPass){
- // var type_id = getTypeId("other_type_id");
- var workJson = {staff_id:$("#staff_id").val(),
- universalid:$("#otherCardId").val(),
- // other_type_id:type_id,
- // other_type_id:encodeURI($("#other_type_id").val()),
- other_card_name:encodeURI($("#other_card_name").val()),
- other_card_id:encodeURI($("#other_card_id").val()),
- other_major:encodeURI($("#other_major").val()),
- other_effective_date:$("#other_effective_date").val(),
- other_remark:encodeURI($("#other_remark").val()),
- other_affix_id:getMoreDocId(document.getElementsByName("other_affix"))};
- if(isEdit !=""){
- $.ajax({
- type:"POST",
- url:"hrStaffCardAction.do?task=editOther&time=" + new Date().getTime(),
- cache:false,
- data:workJson,
- success:function(data){
- resetForm();
- getOther();
- addInfo("保存成功!");
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }else{
- $.ajax({
- type:"POST",
- url:"hrStaffCardAction.do?task=addOther&time=" + new Date().getTime(),
- cache:false,
- data:workJson,
- success:function(data){
- resetForm();
- getOther();
- addInfo("保存成功!");
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }
- }
- }
- /**
- *删除其他
- */
- function delOther(id){
- if(confirm("确定要删除该其他证件信息吗?")){
- $.ajax({
- type:"POST",
- url:"hrStaffCardAction.do?task=delOther&universalid="+id+"&time=" + new Date().getTime(),
- cache:false,
- success:function(data){
- resetForm();
- getOther();
- addInfo("删除成功!");
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }
- }
- /**********************************验证信息**********************************/
- /**
- * 验证员身份证是否存在
- */
- function checkIdNumber(obj){
- var staff_id = $("#staff_id").val();
- if(obj.value ==""){
- document.getElementById("subBtu").disabled=false;
- document.getElementById("id_number_div").innerHTML="";
- }else{
- $.ajax({
- type:"POST",
- url:"hrStaffAction.do?task=checkIdNumber&id_number="+obj.value+"&staff_id="+staff_id+"&time=" + new Date().getTime(),
- cache:false,
- dataType:'json',
- success:function(data){
- if(data[0].count_id >0){
- document.getElementById("subBtu").disabled=true;
- document.getElementById("id_number_div").innerHTML = "<span style=\"color: red;\">身份证号已存在!</span>";
- }else{
- document.getElementById("subBtu").disabled=false;
- document.getElementById("id_number_div").innerHTML="";
- }
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }
- }
- function checkuserhide(is_username){
- var username = $("#username").val();
- var s="";
- if(is_username=="is_username"){
- s="&is_username="+is_username;
- }
- $.ajax({
- type:"POST",
- url:"hrStaffAction.do?task=checkStaffName&staff_name="+encodeURI(encodeURI(username))+"&time=" + new Date().getTime()+s,
- cache:false,
- dataType:'json',
- success:function(data){
- var user_name=data[0]['name'];
- var i=user_name.indexOf("*");
- if(i !=-1){
- document.getElementById("username").style.display="block";
- document.getElementById("subBtu").disabled=true;
- document.getElementById("username").value = data[0]['name'];
- document.getElementById("staff_name_div").innerHTML = "<span style=\"color: red;\">用户名不能带有*!</span>";
- return ;
- }
- if(data.length==2){
- document.getElementById("username").style.display="block";
- document.getElementById("subBtu").disabled=true;
- document.getElementById("username").value = data[0]['name'];
- document.getElementById("staff_name_div").innerHTML = "<span style=\"color: red;\">用户名已存在!</span>";
- }else{
- document.getElementById("staff_name_div").innerHTML = data[0]['name'];
- document.getElementById("subBtu").disabled=false;
- document.getElementById("username").style.display="none";
- document.getElementById("username").value =data[0]['name'];
- }
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }
- /**
- * 验证员用户名是否存在
- */
- function checkUserName(){
- if(document.getElementById("checkbox_active").checked){
- var staff_name = $("#staff_name").val();
- if(staff_name ==""){
- document.getElementById("subBtu").disabled=false;
- document.getElementById("staff_name_div").innerHTML="";
- document.getElementById("username").style.display="none";
- document.getElementById("username").value ="";
- }else{
- $.ajax({
- type:"POST",
- url:"hrStaffAction.do?task=checkStaffName&staff_name="+encodeURI(encodeURI(staff_name))+"&time=" + new Date().getTime(),
- cache:false,
- dataType:'json',
- success:function(data){
- var user_name=data[0]['name'];
- var i=user_name.indexOf("*");
- if(i !=-1){
- document.getElementById("username").style.display="block";
- document.getElementById("subBtu").disabled=true;
- document.getElementById("username").value = data[0]['name'];
- document.getElementById("staff_name_div").innerHTML = "<span style=\"color: red;\">用户名不能带有*!</span>";
- return ;
- }
- if(data.length==2){
- document.getElementById("username").style.display="block";
- document.getElementById("subBtu").disabled=true;
- document.getElementById("username").value = data[0]['name'];
- document.getElementById("staff_name_div").innerHTML = "<span style=\"color: red;\">用户名已存在!</span>";
- }else{
- document.getElementById("staff_name_div").innerHTML = data[0]['name'];
- document.getElementById("subBtu").disabled=false;
- document.getElementById("username").style.display="none";
- document.getElementById("username").value ="";
- }
- },
- error:function(err){
- showAjaxError(err);
- }
- });
- }
- }else{
- document.getElementById("subBtu").disabled=false;
- document.getElementById("staff_name_div").innerHTML="";
- document.getElementById("username").style.display="none";
- document.getElementById("username").value="";
- }
- }
- /**
- * 验证员工信息
- */
- function checkStaffForm() {
- var rs = $.validate({
- name : "job_number",
- model : [ {
- type : "require",
- msg : "工号不能为空!"
- } ]
- });
- rs = $.validate({
- name : "staff_name",
- model : [ {
- type : "require",
- msg : "姓名不能为空!"
- }]
- }) && rs;
- /*rs = $.validate({
- name : "att_user_id",
- model : [ {
- type : "require",
- msg : "考勤用户号不能为空!"
- }]
- }) && rs;*/
-
- rs = $.validate({
- name : "id_number",
- model : [ {
- type : "require",
- msg : "身份证号码不能为空!"
- }, {
- type : "len",
- min : 1,
- max : 18,
- msg : "身份证号码长度不能超过18!"
- },{
- type : "regex",
- //regex : /^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{4}$/,
- regex : /^(\d{15}$|^\d{18}$|^\d{17}(\d|X|x))$/,
- msg : "身份证号码输入不合法!"
- } ]
- }) && rs;
- if(rs){
- var isFollow_flag=false;
- $.each($("input[name='isFollow']"),function(index,obj){
- var flag=$(obj).attr("checked");
- if(flag){
- isFollow_flag=true;
- return;
- }
- });
- if(!isFollow_flag){
- $.ligerDialog.warn("请选定主岗!");
- return ;
- }
- var isLogin_flag=false;
- $.each($("input[name='isLogin']"),function(index,obj){
- var flag=$(obj).attr("checked");
- if(flag){
- isLogin_flag=true;
- return ;
- }
- });
- if(!isLogin_flag){
- $.ligerDialog.warn("请选定默认登录!");
- return ;
- }
- var isFollow = $("input[name='isFollow']:checked").parent().parent();
- var seleceFollowValue = $("[name='branch_company_id']",isFollow).val();
- $.each($("[name='otherposname']"),function(i,obj){
- var seleceFollowPosition=$(obj).val;
- if(seleceFollowPosition==""){
- addFieldError($(isFollow).attr("id"),"请设定主岗部门岗位!");
- return;
- }
- });
-
- // var seleceFollowPosition = $("[name='otherposname']",isFollow).val();
- if(seleceFollowValue==""){
- addFieldError($(isFollow).attr("id"),"请设定主岗部门!");
- return;
- }
- // if(seleceFollowPosition==""){
- // addFieldError($(isFollow).attr("id"),"请设定主岗部门岗位!");
- // return;
- // }
- getDocId("sfzDocumentId","id_number_affix");
- getDocId("htDocumentId","agreement_affix");
- return true;
- }
- return false;
- }
- /**
- * 验证学历信息
- */
- function checkEducationForm(){
- var rs = $.validate({
- name : "study_school_name",
- model : [ {
- type : "require",
- msg : "学校名称不能为空!"
- } ]
- });
- if(rs){
- return true;
- }
- return false;
- }
- /**
- * 验证工作经历信息
- */
- function checkExperienceForm(){
- var rs = $.validate({
- name : "work_company",
- model : [ {
- type : "require",
- msg : "工作单位不能为空!"
- } ]
- });
- if(rs){
- return true;
- }
- return false;
- }
- /**
- * 验证家庭成员信息
- */
- function checkFamilyForm(){
- var rs = $.validate({
- name : "member_name",
- model : [ {
- type : "require",
- msg : "姓名不能为空!"
- } ]
- });
- if(rs){
- return true;
- }
- return false;
- }
- function checkReWardsForm(){
- var rs = $.validate({
- name : "type_id",
- model : [ {
- type : "require",
- msg : "奖惩形式不能为空!"
- } ]
- }) ;
- rs = $.validate({
- name : "dept_name",
- model : [ {
- type : "require",
- msg : "执行部门不能为空!"
- } ]
- }) && rs;
- rs = $.validate({
- name : "rewards_date",
- model : [ {
- type : "require",
- msg : "奖惩日期不能为空!"
- } ]
- }) && rs;
- if(rs){
- return true;
- }
- return false;
- }
- /**
- * 验证职称信息
- */
- function checkPositionForm(){
- var rs = $.validate({
- name : "position_name",
- model : [ {
- type : "require",
- msg : "职称不能为空!"
- } ]
- });
- var type_id = getTypeId("position_name");
- if(type_id==""){
- rs = $.validate({
- name : "positionCheck",
- model : [ {
- type : "require",
- msg : "请选择职称类型!"
- } ]
- })&& rs;
- }else{
- $("#positionCheck").val("val");
- rs = $.validate({
- name : "positionCheck",
- model : [ {
- type : "require",
- msg : "请选择职称类型!"
- } ]
- }) && rs;
- }
-
- if(rs){
- return true;
- }
- return false;
- }
- /**
- * 验证建造师信息
- */
- function checkConstructionForm(){
- var rs = $.validate({
- name : "registration_certificate_id",
- model : [ {
- type : "require",
- msg : "注册证书编号不能为空!"
- } ]
- });
- // rs = $.validate({
- // name : "construction_effective_date",
- // model : [ {
- // type : "require",
- // msg : "请选择有效期!"
- // } ]
- // })&& rs;
- rs = $.validate({
- name : "send_card_time",
- model : [ {
- type : "require",
- msg : "请选择发证日期!"
- } ]
- })&& rs;
- var type_id = getTypeId("construction_engineer_type_id");
- if(type_id==""){
- rs = $.validate({
- name : "constructionCheck",
- model : [ {
- type : "require",
- msg : "请选择建造师类型!"
- } ]
- }) && rs;
- }else{
- $("#constructionCheck").val("val");
- rs = $.validate({
- name : "constructionCheck",
- model : [ {
- type : "require",
- msg : "请选择建造师类型!"
- } ]
- }) && rs;
- }
- if(rs){
- return true;
- }
- return false;
- }
- /**
- * 验证八大员信息
- */
- function checkEightTypeForm(){
- var rs = $.validate({
- name : "eight_type_date",
- model : [ {
- type : "require",
- msg : "请选择发证日期!"
- } ]
- });
- rs = $.validate({
- name : "eight_type_effective_date",
- model : [ {
- type : "require",
- msg : "请选择有效期!"
- } ]
- })&& rs;
- var type_id = getTypeId("eight_type_id");
- if(type_id==""){
- rs = $.validate({
- name : "eightTypeCheck",
- model : [ {
- type : "require",
- msg : "请选择八大员类型!"
- } ]
- }) && rs;
- }else{
- $("#eightTypeCheck").val("val");
- rs = $.validate({
- name : "eightTypeCheck",
- model : [ {
- type : "require",
- msg : "请选择八大员类型!"
- } ]
- }) && rs;
- }
- if(rs){
- return true;
- }
- return false;
- }
- /**
- * 验证三类人员信息
- */
- function checkThreeTypeForm(){
- var rs = $.validate({
- name : "three_type_safety_check_id",
- model : [ {
- type : "require",
- msg : "安全考核证号不能为空!"
- } ]
- });
- rs = $.validate({
- name : "provide_certificate_time",
- model : [ {
- type : "require",
- msg : "请选择发证日期!"
- } ]
- })&& rs;
- rs = $.validate({
- name : "b_three_type_effective_date",
- model : [ {
- type : "require",
- msg : "请选择B证有效期!"
- } ]
- })&& rs;
- var type_id = getTypeId("three_type_id");
- if(type_id==""){
- rs = $.validate({
- name : "threeTypeCheck",
- model : [ {
- type : "require",
- msg : "请选择三类人员类型!"
- } ]
- }) && rs;
- }else{
- $("#threeTypeCheck").val("val");
- rs = $.validate({
- name : "threeTypeCheck",
- model : [ {
- type : "require",
- msg : "请选择三类人员类型!"
- } ]
- }) && rs;
- }
- if(rs){
- return true;
- }
- return false;
- }
- /**
- * 验证特种工信息
- */
- function checkSpecialWorkForm(){
- var rs = $.validate({
- name : "certificate_id",
- model : [ {
- type : "require",
- msg : "证书编号不能为空!"
- } ]
- });
- rs = $.validate({
- name : "special_work_start_certificate_time",
- model : [ {
- type : "require",
- msg : "请选择发证日期!"
- } ]
- })&& rs;
- rs = $.validate({
- name : "special_work_effective_date",
- model : [ {
- type : "require",
- msg : "请选择有效期!"
- } ]
- })&& rs;
- var type_id = getTypeId("special_work_type_id");
- if(type_id==""){
- rs = $.validate({
- name : "specialWorkCheck",
- model : [ {
- type : "require",
- msg : "请选择特种工类型!"
- } ]
- }) && rs;
- }else{
- $("#specialWorkCheck").val("val");
- rs = $.validate({
- name : "specialWorkCheck",
- model : [ {
- type : "require",
- msg : "请选择特种工类型!"
- } ]
- }) && rs;
- }
- if(rs){
- return true;
- }
- return false;
- }
- /**
- * 验证其他证件信息
- */
- function checkOtherForm(){
- var rs = $.validate({
- name : "other_card_name",
- model : [ {
- type : "require",
- msg : "证书名称不能为空!"
- } ]
- });
- rs = $.validate({
- name : "other_effective_date",
- model : [ {
- type : "require",
- msg : "请选择有效期!"
- } ]
- })&& rs;
- // var type_id = getTypeId("other_card_name");
- // if(type_id==""){
- // rs = $.validate({
- // name : "otherCardCheck",
- // model : [ {
- // type : "require",
- // msg : "请选择其他证件类型!"
- // } ]
- // }) && rs;
- // }
- // else{
- // $("#otherCardCheck").val("val");
- // rs = $.validate({
- // name : "otherCardCheck",
- // model : [ {
- // type : "require",
- // msg : "请选择其他证件类型!"
- // } ]
- // }) && rs;
- // }
- if(rs){
- return true;
- }
- return false;
- }
- /**********************************重置表单**********************************/
- function resetReWardsForm(){
- $("#rewards_id").val("");
- $("#class_id option[value=1]").attr("selected",true);
- initReWardsType();
- $("#dept_name").val("");
- $("#dept_id").val("");
- $("#rewards_date").val("");
- $("#descript").val("");
- }
- function resetForm(){
- $("#isEdit").val("");
-
- /*学历*/
- $("#educationId").val("");
- $("#study_type").val("");
- $("#study_school_name").val("");
- $("#study_subject").val("");
- $("#study_educational_background").val("");
- $("#study_degree").val("");
- $("#study_start_end_time").val("");
- // 附件控件状态
- editViewFileHtml("", "study_affix");
-
- /*工作经历*/
- $("#experienceId").val("");
- $("#work_company").val("");
- $("#work_position").val("");
- $("#work_start_end_time").val("");
- $("#work_resignation_reason").val("");
-
- /*家庭成员*/
- $("#familyId").val("");
- $("#member_name").val("");
- $("#member_relation").val("");
- $("#member_company").val("");
- $("#member_position").val("");
- $("#member_phone").val("");
- $("#member_remark").val("");
-
- /*职称*/
- $("#positionId").val("");
- $("input:radio[name='position_type_id']").attr("checked",false);
- $("#positionCheck").val("");
- $("#position_name").val("");
- $("#position_subject").val("");
- $("#send_unit").val("");
- $("#card_num").val("");
- $("#refe_num").val("");
- $("#issue_date").val("");
- $("#position_remark").val("");
- editViewFileHtml("", "position_affix");
-
- /*建造师*/
- $("#constructionId").val("");
- $("input:radio[name='construction_engineer_type_id']").attr("checked",false);
- $("#constructionCheck").val("");
- $("#registration_number").val("");
- $("#registration_certificate_id").val("");
- $("#operation_certificate").val("");
- $("#construction_subject0").val("");
- $("#construction_effective_date0").val("");
- $("#continuing_education_time").val("");
- $("#continuing_education_subject").val("");
- $("#person_system_passowrd").val("");
- $("#lock_system").val("");
- $("#send_card_time").val("");
- $("#construction_engineer_remark").val("");
- editViewFileHtml("", "construction_engineer_affix");
- //showBorrow("tabitem6");
- for ( var i = 0; i <= $("#count").val(); i++) {
- if(i != 0){
- $("tr[id='tabtr"+i+"']").remove();//删除当前行
- }
- }
- $("#count").val("0");
-
- /*八大员*/
- $("#eightTypeId").val("");
- $("input:radio[name='eight_type_id']").attr("checked",false);
- $("#eightTypeCheck").val("");
- $("#eight_post_job").val("");
- $("#eight_other_job").val("");
- $("#eight_card_id").val("");
- $("#eight_type_date").val("");
- $("#eight_type_effective_date").val("");
- $("#eight_type_remark").val("");
- editViewFileHtml("", "eight_type_affix");
-
- /*三类人员*/
- $("#threeTypeId").val("");
- $("input:radio[name='three_type_id']").attr("checked",false);
- $("#threeTypeCheck").val("");
- $("#three_type_safety_check_id").val("");
- $("#provide_certificate_time").val("");
- $("#three_type_position").val("");
- $("#b_three_type_effective_date").val("");
- $("#three_type_technology_position").val("");
- $("#three_type_remark").val("");
- editViewFileHtml("", "three_type_affix");
-
- /*特种工*/
- $("#specialWorkId").val("");
- $("input:radio[name='special_work_type_id']").attr("checked",false);
- $("#specialWorkCheck").val("");
- $("#certificate_id").val("");
- $("#work_type").val("");
- $("#special_work_send_unit").val("");
- $("#special_work_start_certificate_time").val("");
- $("#special_work_effective_date").val("");
- $("#first_check_time").val("");
- $("#second_check_time").val("");
- $("#special_work_remark").val("");
- editViewFileHtml("", "special_work_affix");
-
- /*其他*/
- $("#otherCardId").val("");
- $("input:radio[name='other_type_id']").attr("checked",false);
- $("#otherCardCheck").val("");
- $("#other_card_name").val("");
- $("#other_card_id").val("");
- $("#other_major").val("");
- $("#other_effective_date").val("");
- $("#other_remark").val("");
- editViewFileHtml("", "other_affix");
-
- }
- /***********************************公共方法************************************/
- //获取证件类型id
- function getTypeId(obj){
- var type_id = "";
- var ss = $("input:radio[name='"+obj+"']");
- for ( var int = 0; int < ss.length; int++) {
- if(ss[int].checked){
- type_id = ss[int].value;
- break;
- }
- }
- return type_id;
- }
- //合同及身份证多附件处理
- function getDocId(valObj,hiddenObj){
- var val = document.getElementsByName(valObj);
- var Evalue = "";
- for(var i=0;i<val.length;i++){
- if(""!=val[i].value){
- Evalue=Evalue + val[i].value +",";
- }
- }
- $("#"+hiddenObj).val(Evalue);
- }
|