editStaff.js 58 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153
  1. var count = 0;
  2. var temp = 10;
  3. function addSubject(){
  4. count ++;
  5. //增加<tr/>
  6. //var index = $("#tab tr").length;
  7. $("#tab").append("<tr id=tabtr"+count+" >"
  8. +"<td style=\"width: 85px;\">&nbsp;</td>"
  9. +"<td ><input type=\"text\" id=\"construction_subject" +count+ "\" name=\"construction_subject" + count + "\" ><a href=\"#\" onclick=\"delSubject(" + count +
  10. ")\">&nbsp;<img src=\"/ynet/liger/lib/ligerUI/skins/ynet/images/index/jian.png\"></a></td>"
  11. +"<td >&nbsp;</td>"
  12. +"<td><input type=\"text\" id=\"construction_effective_date" +count+ "\" name=\"construction_effective_date" + count + "\"></td>"
  13. +"</tr>");
  14. $("#construction_effective_date"+count).ligerDateEditor({
  15. labelWidth : 100,
  16. labelAlign : 'right',
  17. initValue : ''
  18. });
  19. $("#count").val(count);
  20. }
  21. function delSubject(index){
  22. //var _len = $("#tab tr").length;
  23. $("tr[id='tabtr"+index+"']").remove();//删除当前行
  24. }
  25. $(function() {
  26. $("#tab1").ligerTab({
  27. onBeforeSelectTabItem : function(tabid) {
  28. },
  29. onAfterSelectTabItem : function(tabid) {
  30. showBorrow(tabid);
  31. resetForm();
  32. }
  33. });
  34. /*员工信息日期控件加载********start********/
  35. $("#staff_birthday").ligerDateEditor({
  36. labelWidth : 100,
  37. labelAlign : 'right',
  38. initValue : ''
  39. });
  40. $("#register_time").ligerDateEditor({
  41. labelWidth : 100,
  42. labelAlign : 'right',
  43. initValue : ''
  44. });
  45. $("#agreement_time").ligerDateEditor({
  46. labelWidth : 100,
  47. labelAlign : 'right',
  48. initValue : ''
  49. });
  50. $("#social_time").ligerDateEditor({
  51. labelWidth : 100,
  52. labelAlign : 'right',
  53. initValue : ''
  54. });
  55. $("#health_time").ligerDateEditor({
  56. labelWidth : 100,
  57. labelAlign : 'right',
  58. initValue : ''
  59. });
  60. $("#fund_time").ligerDateEditor({
  61. labelWidth : 100,
  62. labelAlign : 'right',
  63. initValue : ''
  64. });
  65. /*员工信息日期控件加载********end********/
  66. /*职称日期控件加载********start********/
  67. $("#issue_date").ligerDateEditor({
  68. labelWidth : 100,
  69. labelAlign : 'right',
  70. initValue : ''
  71. });
  72. /*职称日期控件加载********end********/
  73. /*建造师日期控件加载********start********/
  74. $("#construction_effective_date0").ligerDateEditor({
  75. labelWidth : 100,
  76. labelAlign : 'right',
  77. initValue : ''
  78. });
  79. $("#continuing_education_time").ligerDateEditor({
  80. labelWidth : 100,
  81. labelAlign : 'right',
  82. initValue : ''
  83. });
  84. $("#send_card_time").ligerDateEditor({
  85. labelWidth : 100,
  86. labelAlign : 'right',
  87. initValue : ''
  88. });
  89. /*建造师日期控件加载********end********/
  90. /*八大员日期控件加载********start********/
  91. $("#eight_type_date").ligerDateEditor({
  92. labelWidth : 100,
  93. labelAlign : 'right',
  94. initValue : ''
  95. });
  96. $("#eight_type_effective_date").ligerDateEditor({
  97. labelWidth : 100,
  98. labelAlign : 'right',
  99. initValue : ''
  100. });
  101. /*八大员日期控件加载********end********/
  102. /*三类人员日期控件加载********start********/
  103. $("#provide_certificate_time").ligerDateEditor({
  104. labelWidth : 100,
  105. labelAlign : 'right',
  106. initValue : ''
  107. });
  108. $("#b_three_type_effective_date").ligerDateEditor({
  109. labelWidth : 100,
  110. labelAlign : 'right',
  111. initValue : ''
  112. });
  113. /*三类人员日期控件加载********end********/
  114. /*特种工日期控件加载********start********/
  115. $("#special_work_start_certificate_time").ligerDateEditor({
  116. labelWidth : 100,
  117. labelAlign : 'right',
  118. initValue : ''
  119. });
  120. $("#special_work_effective_date").ligerDateEditor({
  121. labelWidth : 100,
  122. labelAlign : 'right',
  123. initValue : ''
  124. });
  125. /*特种工日期控件加载********end********/
  126. /*其他日期控件加载********start********/
  127. $("#other_effective_date").ligerDateEditor({
  128. labelWidth : 100,
  129. labelAlign : 'right',
  130. initValue : ''
  131. });
  132. /*其他日期控件加载********end********/
  133. });
  134. /**********************************修改回填AJAX**********************************/
  135. /**
  136. * 学历回填
  137. */
  138. function toEditEducation(id){
  139. $.ajax({
  140. type:"POST",
  141. url:"hrStaffAction.do?task=toEditEducationInfo&universalid="+id+"&time=" + new Date().getTime(),
  142. cache:false,
  143. dataType:'json',
  144. success:function(data){
  145. $("#educationId").val(data[0].universalid);
  146. $("#study_type").val(data[0].study_type);
  147. $("#study_school_name").val(data[0].study_school_name);
  148. $("#study_subject").val(data[0].study_subject);
  149. $("#study_degree").val(data[0].study_degree);
  150. $("#study_start_end_time").val(data[0].study_start_end_time);
  151. $("#isEdit").val(data[0].isEdit);
  152. editViewFileHtml(data[0].t_file_id, "study_affix",true,5);
  153. $("#study_educational_background").val(data[0].study_educational_background);
  154. },
  155. error:function(err){
  156. showAjaxError(err);
  157. }
  158. });
  159. }
  160. /**
  161. * 工作经历回填
  162. */
  163. function toEditExperience(id){
  164. $.ajax({
  165. type:"POST",
  166. url:"hrStaffAction.do?task=toEditExperienceInfo&universalid="+id+"&time=" + new Date().getTime(),
  167. cache:false,
  168. dataType:'json',
  169. success:function(data){
  170. $("#experienceId").val(data[0].universalid);
  171. $("#work_company").val(data[0].work_company);
  172. $("#work_position").val(data[0].work_position);
  173. $("#work_start_end_time").val(data[0].work_start_end_time);
  174. $("#work_resignation_reason").val(data[0].work_resignation_reason);
  175. $("#isEdit").val(data[0].isEdit);
  176. },
  177. error:function(err){
  178. showAjaxError(err);
  179. }
  180. });
  181. }
  182. /**
  183. * 家庭成员回填
  184. */
  185. function toEditFamily(id){
  186. $.ajax({
  187. type:"POST",
  188. url:"hrStaffAction.do?task=toEditFamilyMember&universalid="+id+"&time=" + new Date().getTime(),
  189. cache:false,
  190. dataType:'json',
  191. success:function(data){
  192. $("#familyId").val(data[0].universalid);
  193. $("#member_name").val(data[0].member_name);
  194. $("#member_relation").val(data[0].member_relation);
  195. $("#member_company").val(data[0].member_company);
  196. $("#member_position").val(data[0].member_position);
  197. $("#member_phone").val(data[0].member_phone);
  198. $("#member_remark").val(data[0].member_remark);
  199. $("#isEdit").val(data[0].isEdit);
  200. },
  201. error:function(err){
  202. showAjaxError(err);
  203. }
  204. });
  205. }
  206. /**
  207. * 职称回填
  208. */
  209. function toEditPosition(id){
  210. $.ajax({
  211. type:"POST",
  212. url:"hrStaffCardAction.do?task=toEditPosition&universalid="+id+"&time=" + new Date().getTime(),
  213. cache:false,
  214. dataType:'json',
  215. success:function(data){
  216. $("#positionId").val(data[0].universalid);
  217. var ss = $("input:radio[name='position_type_id']");
  218. for ( var int = 0; int < ss.length; int++) {
  219. if(ss[int].value==data[0].position_type_id){
  220. ss[int].checked=true;
  221. break;
  222. }
  223. }
  224. $("#position_name").val(data[0].position_name);
  225. $("#position_subject").val(data[0].position_subject);
  226. $("#send_unit").val(subDate(data[0].send_unit));
  227. $("#card_num").val(data[0].card_num);
  228. $("#refe_num").val(data[0].refe_num);
  229. $("#issue_date").val(subDate(data[0].issue_date));
  230. $("#position_remark").val(data[0].position_remark);
  231. editViewFileHtml(data[0].t_file_id, "position_affix",true,5);
  232. $("#isEdit").val(data[0].isEdit);
  233. },
  234. error:function(err){
  235. showAjaxError(err);
  236. }
  237. });
  238. }
  239. function toEditReWards(id){
  240. $.ajax({
  241. type:"POST",
  242. url:"hrStaffAction.do?task=viewRewards&rewards_id="+id+"&time=" + new Date().getTime(),
  243. cache:false,
  244. dataType:'json',
  245. success:function(data){
  246. $("#rewards_id").val(data[0].universalid);
  247. $("#class_id option[value="+data[0].class_id+"]").attr("selected",true);
  248. initReWardsType();
  249. $("#type_id option[value="+data[0].type_id+"]").attr("selected",true);
  250. $("#dept_name").val(data[0].groupname);
  251. $("#dept_id").val(data[0].dept_id);
  252. $("#rewards_date").val(data[0].rewards_date);
  253. if(null!=data[0].descript)
  254. $("#descript").val(data[0].descript);
  255. },
  256. error:function(err){
  257. showAjaxError(err);
  258. }
  259. });
  260. }
  261. function delReWards(id){
  262. $.ajax({
  263. type:"POST",
  264. url:"hrStaffAction.do?task=delRewards&rewards_id="+id+"&time=" + new Date().getTime(),
  265. cache:false,
  266. dataType:'json',
  267. success:function(data){
  268. if(data.i>0){
  269. resetReWardsForm();
  270. getReWards();
  271. addInfo("删除成功!");
  272. }else{
  273. addInfo("删除失败!");
  274. }
  275. },
  276. error:function(err){
  277. showAjaxError(err);
  278. }
  279. });
  280. }
  281. function backToPosition(){
  282. var type_id = "";
  283. var ss = $("input:radio[name='position_type_id']");
  284. for ( var int = 0; int < ss.length; int++) {
  285. if(ss[int].checked){
  286. type_id = ss[int].title;
  287. break;
  288. }
  289. }
  290. $("#position_name").val(type_id);
  291. }
  292. /**
  293. * 建造师回填
  294. */
  295. function toEditConstruction(id){
  296. $.ajax({
  297. type:"POST",
  298. url:"hrStaffCardAction.do?task=toEditConstructionEngineer&universalid="+id+"&time=" + new Date().getTime(),
  299. cache:false,
  300. dataType:'json',
  301. success:function(data){
  302. resetForm();//重置表单
  303. $("#constructionId").val(data[0].universalid);
  304. var ss = $("input:radio[name='construction_engineer_type_id']");
  305. for ( var int = 0; int < ss.length; int++) {
  306. if(ss[int].value==data[0].construction_engineer_type_id){
  307. ss[int].checked=true;
  308. break;
  309. }
  310. }
  311. $("#registration_number").val(data[0].registration_number);
  312. $("#registration_certificate_id").val(data[0].registration_certificate_id);
  313. $("#operation_certificate").val(data[0].operation_certificate);
  314. if(data[0].continuing_education_time == null){
  315. $("#continuing_education_time").val("");
  316. }else{
  317. $("#continuing_education_time").val(subDate(data[0].continuing_education_time));
  318. }
  319. $("#continuing_education_subject").val(data[0].continuing_education_subject);
  320. $("#person_system_password").val(data[0].person_system_password);
  321. $("#lock_system").val(data[0].lock_system);
  322. $("#send_card_time").val(subDate(data[0].send_card_time));
  323. $("#construction_engineer_remark").val(data[0].construction_engineer_remark);
  324. editViewFileHtml(data[0].t_file_id, "construction_engineer_affix",true,5);
  325. $("#isEdit").val(data[0].isEdit);
  326. for ( var i = 0; i < data[0].constructionEngineerSubjectList.length; i++) {
  327. if(i==0){
  328. $("#construction_subject0").val(data[0].constructionEngineerSubjectList[0].construction_subject);
  329. $("#construction_effective_date0").val(data[0].constructionEngineerSubjectList[0].construction_effective_date);
  330. }else{
  331. $("#tab").append("<tr id=tabtr"+(i+count+temp)+" >"
  332. +"<td style=\"width: 80px;\">&nbsp;</td>"
  333. +"<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) +
  334. ")\">&nbsp;<img src=\"/ynet/liger/lib/ligerUI/skins/ynet/images/index/jian.png\"></a></td>"
  335. +"<td>&nbsp;</td>"
  336. +"<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>"
  337. +"</tr>");
  338. $("#construction_effective_date"+(i+count+temp)).ligerDateEditor({
  339. labelWidth : 100,
  340. labelAlign : 'right',
  341. initValue : ''
  342. });
  343. temp +=5;
  344. $("#temp").val(temp);
  345. $("#count").val((i+count+temp));
  346. }
  347. }
  348. },
  349. error:function(err){
  350. showAjaxError(err);
  351. }
  352. });
  353. }
  354. /**
  355. * 八大员回填
  356. */
  357. function toEditEightType(id){
  358. $.ajax({
  359. type:"POST",
  360. url:"hrStaffCardAction.do?task=toEditEightType&universalid="+id+"&time=" + new Date().getTime(),
  361. cache:false,
  362. dataType:'json',
  363. success:function(data){
  364. $("#eightTypeId").val(data[0].universalid);
  365. var ss = $("input:radio[name='eight_type_id']");
  366. for ( var int = 0; int < ss.length; int++) {
  367. if(ss[int].value==data[0].eight_type_id){
  368. ss[int].checked=true;
  369. break;
  370. }
  371. }
  372. $("#eight_post_job").val(data[0].eight_post_job);
  373. $("#eight_other_job").val(data[0].eight_other_job);
  374. $("#eight_card_id").val(data[0].eight_card_id);
  375. $("#eight_type_date").val(subDate(data[0].eight_type_date));
  376. $("#eight_type_effective_date").val(subDate(data[0].eight_type_effective_date));
  377. $("#eight_type_remark").val(data[0].eight_type_remark);
  378. editViewFileHtml(data[0].t_file_id, "eight_type_affix",true,5);
  379. $("#isEdit").val(data[0].isEdit);
  380. },
  381. error:function(err){
  382. showAjaxError(err);
  383. }
  384. });
  385. }
  386. /**
  387. * 三类人员回填
  388. */
  389. function toEditThreeType(id){
  390. $.ajax({
  391. type:"POST",
  392. url:"hrStaffCardAction.do?task=toEditThreeType&universalid="+id+"&time=" + new Date().getTime(),
  393. cache:false,
  394. dataType:'json',
  395. success:function(data){
  396. $("#threeTypeId").val(data[0].universalid);
  397. var ss = $("input:radio[name='three_type_id']");
  398. for ( var int = 0; int < ss.length; int++) {
  399. if(ss[int].value==data[0].three_type_id){
  400. ss[int].checked=true;
  401. break;
  402. }
  403. }
  404. $("#three_type_safety_check_id").val(data[0].three_type_safety_check_id);
  405. $("#provide_certificate_time").val(subDate(data[0].provide_certificate_time));
  406. $("#three_type_position").val(data[0].three_type_position);
  407. $("#b_three_type_effective_date").val(subDate(data[0].b_three_type_effective_date));
  408. $("#three_type_technology_position").val(data[0].three_type_technology_position);
  409. $("#three_type_remark").val(data[0].three_type_remark);
  410. editViewFileHtml(data[0].t_file_id, "three_type_affix",true,5);
  411. $("#isEdit").val(data[0].isEdit);
  412. },
  413. error:function(err){
  414. showAjaxError(err);
  415. }
  416. });
  417. }
  418. /**
  419. * 特种工回填
  420. */
  421. function toEditSpecialWork(id){
  422. $.ajax({
  423. type:"POST",
  424. url:"hrStaffCardAction.do?task=toEditSpecialWork&universalid="+id+"&time=" + new Date().getTime(),
  425. cache:false,
  426. dataType:'json',
  427. success:function(data){
  428. $("#specialWorkId").val(data[0].universalid);
  429. var ss = $("input:radio[name='special_work_type_id']");
  430. for ( var int = 0; int < ss.length; int++) {
  431. if(ss[int].value==data[0].special_work_type_id){
  432. ss[int].checked=true;
  433. break;
  434. }
  435. }
  436. $("#certificate_id").val(data[0].certificate_id);
  437. $("#work_type").val(data[0].work_type);
  438. $("#special_work_send_unit").val(data[0].special_work_send_unit);
  439. $("#special_work_start_certificate_time").val(subDate(data[0].special_work_start_certificate_time));
  440. $("#special_work_effective_date").val(subDate(data[0].special_work_effective_date));
  441. $("#first_check_time").val(data[0].first_check_time);
  442. $("#second_check_time").val(data[0].second_check_time);
  443. $("#special_work_remark").val(data[0].special_work_remark);
  444. editViewFileHtml(data[0].t_file_id, "special_work_affix",true,5);
  445. $("#isEdit").val(data[0].isEdit);
  446. },
  447. error:function(err){
  448. showAjaxError(err);
  449. }
  450. });
  451. }
  452. /**
  453. * 其他回填
  454. */
  455. function toEditOther(id){
  456. $.ajax({
  457. type:"POST",
  458. url:"hrStaffCardAction.do?task=toEditOther&universalid="+id+"&time=" + new Date().getTime(),
  459. cache:false,
  460. dataType:'json',
  461. success:function(data){
  462. $("#otherCardId").val(data[0].universalid);
  463. var ss = $("input:radio[name='other_type_id']");
  464. for ( var int = 0; int < ss.length; int++) {
  465. if(ss[int].value==data[0].other_type_id){
  466. ss[int].checked=true;
  467. break;
  468. }
  469. }
  470. $("#other_card_name").val(data[0].other_card_name);
  471. $("#other_card_id").val(data[0].other_card_id);
  472. $("#other_major").val(data[0].other_major);
  473. $("#other_effective_date").val(subDate(data[0].other_effective_date));
  474. $("#other_remark").val(data[0].other_remark);
  475. editViewFileHtml(data[0].t_file_id, "other_affix",true,5);
  476. $("#isEdit").val(data[0].isEdit);
  477. },
  478. error:function(err){
  479. showAjaxError(err);
  480. }
  481. });
  482. }
  483. /**********************************增删改AJAX**********************************/
  484. /**
  485. * 修改员工信息
  486. */
  487. function submitStaff(){
  488. var isPass = checkStaffForm();
  489. if(isPass == true){
  490. var isFollow = $("input[name='isFollow']:checked").parent().parent();
  491. var isLogin = $("input[name='isLogin']:checked").parent().parent();
  492. var seleceFollowValue = $("[name='branch_company_id']",isFollow).val();
  493. var seleceFollowPosition = $("[name='otherposname']",isFollow).val();
  494. var ids = document.getElementsByName("branch_company_id");
  495. var followGroups = "${followGroups}";
  496. for ( var i = 0; i < ids.length; i++) {
  497. if($("#gid_"+i).val() == ""){
  498. if(followGroups != ""){
  499. addFieldError("dept-position"+i,"请设定部门!");
  500. }else{
  501. if(i == 0){
  502. addFieldError("dept-position","请设定部门!");
  503. }else{
  504. addFieldError("dept-position"+i,"请设定部门!");
  505. }
  506. }
  507. return;
  508. }
  509. if($("#otherposname_"+i).val() == ""){
  510. if(followGroups != ""){
  511. addFieldError("dept-position"+i,"请设定职位!");
  512. }else{
  513. if(i == 0){
  514. addFieldError("dept-position","请设定职位!");
  515. }else{
  516. addFieldError("dept-position"+i,"请设定职位!");
  517. }
  518. }
  519. return;
  520. }
  521. }
  522. //判断工号是否存在
  523. var param = {"job_number":$("#job_number").val(),"staff_id":$("#staff_id").val()};
  524. sendAjaxParam(param, "hrStaffAction.do?task=checkJobNum&time="
  525. + new Date().getTime(), "json", function(data){
  526. if(data != '0'){
  527. $("#jobNumSpan").html("<font color='red'>该工号已存在!</font>");
  528. $("#jobNumCheck").val("1");
  529. }else{
  530. $("#jobNumSpan").html("");
  531. $("#jobNumCheck").val("0");
  532. }
  533. });
  534. if($("#jobNumCheck").val() != '0'){
  535. return false;
  536. }
  537. //判断考勤编号是否存在
  538. var attUserId = $("#att_user_id").val();
  539. if(attUserId && attUserId.trim() !== '') {
  540. var param = {"att_user_id":attUserId,"staff_id":$("#staff_id").val()};
  541. sendAjaxParam(param, "hrStaffAction.do?task=checkAttUserNum&time="
  542. + new Date().getTime(), "json", function(data){
  543. if(data != '0'){
  544. $("#attUserNumSpan").html("<font color='red'>考勤用户号已存在!</font>");
  545. $("#attUserNumCheck").val("1");
  546. }else{
  547. $("#attUserNumSpan").html("");
  548. $("#attUserNumCheck").val("0");
  549. }
  550. });
  551. } else {
  552. // 如果考勤编号为空,清除错误提示并允许保存
  553. $("#attUserNumSpan").html("");
  554. $("#attUserNumCheck").val("0");
  555. }
  556. if($("#attUserNumCheck").val() != '0'){
  557. return false;
  558. }
  559. var seleceLoginValue = $("[name='branch_company_id']",isLogin).val();
  560. var seleceLoginPosition = $("[name='otherposname']",isLogin).val();
  561. $("input[name='isFollow']:checked").val(seleceFollowValue+"_"+seleceFollowPosition);
  562. $("input[name='isLogin']:checked").val(seleceLoginValue+"_"+seleceLoginPosition);
  563. var branch_company_id = document.getElementsByName("branch_company_id");
  564. var branch_company_id_arry = new Array(branch_company_id.length);
  565. for(var i=0;i<branch_company_id.length;i++){
  566. branch_company_id_arry[i] = branch_company_id[i].value;
  567. }
  568. var branch_company_name = document.getElementsByName("branch_company_name");
  569. var branch_company_name_arry = new Array(branch_company_name.length);
  570. for(var j=0;j<branch_company_name.length;j++){
  571. branch_company_name_arry[j] = branch_company_name[j].value;
  572. }
  573. var isFollow = document.getElementsByName("isFollow");
  574. var isFollow_arry = new Array(1);
  575. for(var k=0;k<isFollow.length;k++){
  576. if(isFollow[k].checked){
  577. isFollow_arry[k] = isFollow[k].value;
  578. }
  579. }
  580. var isLogin = document.getElementsByName("isLogin");
  581. var isLogin_arry = new Array(1);
  582. for(var b=0;b<isLogin.length;b++){
  583. if(isLogin[b].checked){
  584. isLogin_arry[b] = isLogin[b].value;
  585. }
  586. }
  587. var otherposname = document.getElementsByName("otherposname");
  588. var otherposname_arry = new Array(otherposname.length);
  589. for(var q=0;q<otherposname.length;q++){
  590. otherposname_arry[q] = otherposname[q].value;
  591. }
  592. var check_active = "";
  593. if($("#checkbox_active").attr("checked")==true){
  594. check_active = "checked";
  595. }
  596. var staffJson = {staff_id:$("#staff_id").val(),
  597. old_is_active_eu:$("#old_is_active_eu").val(),
  598. checkbox_active:check_active,
  599. username:encodeURI($("#username").val()),
  600. branch_company_id:branch_company_id_arry,
  601. branch_company_name:encodeURI(branch_company_name_arry),
  602. isFollow:isFollow_arry,
  603. isLogin:isLogin_arry,
  604. otherposname:otherposname_arry,
  605. job_number:encodeURI($("#job_number").val()),
  606. is_party:$("#is_party").val(),
  607. anmelden_pro:encodeURI($("#anmelden_pro").val()),
  608. att_user_id:encodeURI($("#att_user_id").val()),
  609. att_shit_id:encodeURI($("#att_shit_id").val()),
  610. file_num:$("#file_num").val(),
  611. staff_name:encodeURI($("#staff_name").val()),
  612. staff_sex:$("#staff_sex").val(),
  613. staff_birthday:$("#staff_birthday").val(),
  614. ethnic_group:encodeURI($("#ethnic_group").val()),
  615. blood_type:encodeURI($("#blood_type").val()),
  616. body_height:encodeURI($("#body_height").val()),
  617. body_weight:encodeURI($("#body_weight").val()),
  618. marital_status:encodeURI($("#marital_status").val()),
  619. native:encodeURI($("#native").val()),
  620. political_landscape:encodeURI($("#political_landscape").val()),
  621. job_title:encodeURI($("#job_title").val()),
  622. census_address:encodeURI($("#census_address").val()),
  623. home_address:encodeURI($("#home_address").val()),
  624. self_phone:encodeURI($("#self_phone").val()),
  625. id_number_affix:$("#id_number_affix").val(),
  626. id_number:$("#id_number").val(),
  627. agreement_affix:$("#agreement_affix").val(),
  628. is_dimission:$("#is_dimission").val(),
  629. register_time:$("#register_time").val(),
  630. agreement_time:$("#agreement_time").val(),
  631. social_time:$("#social_time").val(),
  632. health_time:$("#health_time").val(),
  633. fund_time:$("#fund_time").val(),
  634. craft_type:$("#craft_type").val(),
  635. //branch_company_id:encodeURI($("#branch_company_id").val()),
  636. //branch_company_name:encodeURI($("#branch_company_name").val()),
  637. contact_person:encodeURI($("#contact_person").val()),
  638. contact_person_phone:encodeURI($("#contact_person_phone").val()),
  639. staff_photo:document.getElementsByName("staff_photo")[0].value};
  640. $.ajax({
  641. type:"POST",
  642. url:"hrStaffAction.do?task=editStaffBasicInfo&time=" + new Date().getTime(),
  643. cache:false,
  644. data:staffJson,
  645. success:function(data){
  646. // refreshWindow(getCurWindowId());
  647. addInfo("保存成功!");
  648. if (old_tabid.length > 0) {
  649. var tabid = getCurrentTabId();
  650. window.parent.f_selectTab(old_tabid);
  651. window.parent.f_reloadTab(old_tabid);
  652. window.parent.f_closeTab(tabid);
  653. }
  654. },
  655. error:function(err){
  656. showAjaxError(err);
  657. }
  658. });
  659. }
  660. }
  661. /**
  662. * 保存学历信息
  663. */
  664. function submitSaveEducation(){
  665. var isPass = checkEducationForm();
  666. var isEdit = $("#isEdit").val();
  667. if(isPass == true){
  668. var educationJson = {staff_id:$("#staff_id").val(),
  669. universalid:$("#educationId").val(),
  670. study_type:encodeURI($("#study_type").val()),
  671. study_school_name:encodeURI($("#study_school_name").val()),
  672. study_subject:encodeURI($("#study_subject").val()),
  673. study_educational_background:encodeURI($("#study_educational_background").val()),
  674. study_degree:encodeURI($("#study_degree").val()),
  675. study_start_end_time:encodeURI($("#study_start_end_time").val()),
  676. study_affix_id:getMoreDocId(document.getElementsByName("study_affix"))};
  677. if(isEdit !=""){
  678. $.ajax({
  679. type:"POST",
  680. url:"hrStaffAction.do?task=editEducationInfo&time=" + new Date().getTime(),
  681. cache:false,
  682. data:educationJson,
  683. success:function(data){
  684. resetForm();
  685. getEducation();
  686. addInfo("保存成功!");
  687. },
  688. error:function(err){
  689. showAjaxError(err);
  690. }
  691. });
  692. }else{
  693. $.ajax({
  694. type:"POST",
  695. url:"hrStaffAction.do?task=addEducationInfo&time=" + new Date().getTime(),
  696. cache:false,
  697. data:educationJson,
  698. success:function(data){
  699. resetForm();
  700. getEducation();
  701. addInfo("保存成功!");
  702. },
  703. error:function(err){
  704. showAjaxError(err);
  705. }
  706. });
  707. }
  708. }
  709. }
  710. /**
  711. *删除学历信息
  712. */
  713. function delEducation(id){
  714. if(confirm("确定要删除该学历吗?")){
  715. $.ajax({
  716. type:"POST",
  717. url:"hrStaffAction.do?task=delEducationInfo&universalid="+id+"&time=" + new Date().getTime(),
  718. cache:false,
  719. success:function(data){
  720. resetForm();
  721. getEducation();
  722. addInfo("删除成功!");
  723. },
  724. error:function(err){
  725. showAjaxError(err);
  726. }
  727. });
  728. }
  729. }
  730. /**
  731. * 保存工作经历信息
  732. */
  733. function submitSaveExperience(){
  734. var isPass = checkExperienceForm();
  735. var isEdit = $("#isEdit").val();
  736. if(isPass == true){
  737. var experienceJson = {staff_id:$("#staff_id").val(),
  738. universalid:$("#experienceId").val(),
  739. work_company:encodeURI($("#work_company").val()),
  740. work_position:encodeURI($("#work_position").val()),
  741. work_start_end_time:encodeURI($("#work_start_end_time").val()),
  742. work_resignation_reason:encodeURI($("#work_resignation_reason").val())};
  743. if(isEdit !=""){
  744. $.ajax({
  745. type:"POST",
  746. url:"hrStaffAction.do?task=editExperienceInfo&time=" + new Date().getTime(),
  747. cache:false,
  748. data:experienceJson,
  749. success:function(data){
  750. resetForm();
  751. getExperience();
  752. addInfo("保存成功!");
  753. },
  754. error:function(err){
  755. showAjaxError(err);
  756. }
  757. });
  758. }else{
  759. $.ajax({
  760. type:"POST",
  761. url:"hrStaffAction.do?task=addExperienceInfo&time=" + new Date().getTime(),
  762. cache:false,
  763. data:experienceJson,
  764. success:function(data){
  765. resetForm();
  766. getExperience();
  767. addInfo("保存成功!");
  768. },
  769. error:function(err){
  770. showAjaxError(err);
  771. }
  772. });
  773. }
  774. }
  775. }
  776. /**
  777. *删除工作经历
  778. */
  779. function delExperience(id){
  780. if(confirm("确定要删除该工作经历吗?")){
  781. $.ajax({
  782. type:"POST",
  783. url:"hrStaffAction.do?task=delExperienceInfo&universalid="+id+"&time=" + new Date().getTime(),
  784. cache:false,
  785. success:function(data){
  786. resetForm();
  787. getExperience();
  788. addInfo("删除成功!");
  789. },
  790. error:function(err){
  791. showAjaxError(err);
  792. }
  793. });
  794. }
  795. }
  796. /**
  797. * 保存家庭成员信息
  798. */
  799. function submitSaveFamily(){
  800. var isPass = checkFamilyForm();
  801. var isEdit = $("#isEdit").val();
  802. if(isPass == true){
  803. var familyJson = {staff_id:$("#staff_id").val(),
  804. universalid:$("#familyId").val(),
  805. member_name:encodeURI($("#member_name").val()),
  806. member_relation:encodeURI($("#member_relation").val()),
  807. member_company:encodeURI($("#member_company").val()),
  808. member_position:encodeURI($("#member_position").val()),
  809. member_phone:encodeURI($("#member_phone").val()),
  810. member_remark:encodeURI($("#member_remark").val())};
  811. if(isEdit !=""){
  812. $.ajax({
  813. type:"POST",
  814. url:"hrStaffAction.do?task=editFamilyMember&time=" + new Date().getTime(),
  815. cache:false,
  816. data:familyJson,
  817. success:function(data){
  818. resetForm();
  819. getFamily();
  820. addInfo("保存成功!");
  821. },
  822. error:function(err){
  823. showAjaxError(err);
  824. }
  825. });
  826. }else{
  827. $.ajax({
  828. type:"POST",
  829. url:"hrStaffAction.do?task=addFamilyMember&time=" + new Date().getTime(),
  830. cache:false,
  831. data:familyJson,
  832. success:function(data){
  833. resetForm();
  834. getFamily();
  835. addInfo("保存成功!");
  836. },
  837. error:function(err){
  838. showAjaxError(err);
  839. }
  840. });
  841. }
  842. }
  843. }
  844. //奖惩
  845. function saveRewards(){
  846. var isPass =checkReWardsForm();
  847. if(isPass){
  848. var rewardsjson={
  849. class_id:$("#class_id").val(),
  850. rewards_id:$("#rewards_id").val(),
  851. type_id:$("#type_id").val(),
  852. dept_id:$("#dept_id").val(),
  853. rewards_date:$("#rewards_date").val(),
  854. staff_id:$("#staff_id").val(),
  855. descript:encodeURI($("#descript").val())
  856. };
  857. if($("#rewards_id").val() !=""){
  858. $.ajax({
  859. type:"POST",
  860. url:"hrStaffAction.do?task=editRewards&time=" + new Date().getTime(),
  861. cache:false,
  862. data:rewardsjson,
  863. dataType:'json',
  864. success:function(data){
  865. if(data.i>0){
  866. resetReWardsForm();
  867. getReWards();
  868. addInfo("保存成功!");
  869. }else{
  870. addInfo("保存失败!");
  871. }
  872. },
  873. error:function(err){
  874. showAjaxError(err);
  875. }
  876. });
  877. }else{
  878. $.ajax({
  879. type:"POST",
  880. url:"hrStaffAction.do?task=addRewards&time=" + new Date().getTime(),
  881. cache:false,
  882. data:rewardsjson,
  883. dataType:'json',
  884. success:function(data){
  885. if(data.i>0){
  886. resetReWardsForm();
  887. getReWards();
  888. addInfo("保存成功!");
  889. }else{
  890. addInfo("保存失败!");
  891. }
  892. },
  893. error:function(err){
  894. showAjaxError(err);
  895. }
  896. });
  897. }
  898. }
  899. }
  900. /**
  901. *删除家庭成员
  902. */
  903. function delFamily(id){
  904. if(confirm("确定要删除该成员吗?")){
  905. $.ajax({
  906. type:"POST",
  907. url:"hrStaffAction.do?task=delFamilyMember&universalid="+id+"&time=" + new Date().getTime(),
  908. cache:false,
  909. success:function(data){
  910. resetForm();
  911. getFamily();
  912. addInfo("删除成功!");
  913. },
  914. error:function(err){
  915. showAjaxError(err);
  916. }
  917. });
  918. }
  919. }
  920. /**
  921. * 保存职称信息
  922. */
  923. function submitSavePosition(){
  924. // var isPass = checkPositionForm();
  925. // var isPass=true;
  926. var rs = $.validate({
  927. name : "position_name",
  928. model : [ {
  929. type : "require",
  930. msg : "职称不能为空!"
  931. }]
  932. });
  933. var isEdit = $("#isEdit").val();
  934. if(rs){
  935. // var type_id = getTypeId("position_type_id");
  936. var positionJson = {staff_id:$("#staff_id").val(),
  937. universalid:$("#positionId").val(),
  938. // position_type_id:type_id,
  939. // position_type_id:encodeURI($("#position_type_id").val()),
  940. position_name:encodeURI($("#position_name").val()),
  941. position_subject:encodeURI($("#position_subject").val()),
  942. send_unit:encodeURI($("#send_unit").val()),
  943. card_num:encodeURI($("#card_num").val()),
  944. refe_num:encodeURI($("#refe_num").val()),
  945. issue_date:$("#issue_date").val(),
  946. position_remark:encodeURI($("#position_remark").val()),
  947. position_affix_id:getMoreDocId(document.getElementsByName("position_affix"))};
  948. if(isEdit !=""){
  949. $.ajax({
  950. type:"POST",
  951. url:"hrStaffCardAction.do?task=editPosition&time=" + new Date().getTime(),
  952. cache:false,
  953. data:positionJson,
  954. success:function(data){
  955. resetForm();
  956. getPosition();
  957. addInfo("保存成功!");
  958. },
  959. error:function(err){
  960. showAjaxError(err);
  961. }
  962. });
  963. }else{
  964. $.ajax({
  965. type:"POST",
  966. url:"hrStaffCardAction.do?task=addPosition&time=" + new Date().getTime(),
  967. cache:false,
  968. data:positionJson,
  969. success:function(data){
  970. resetForm();
  971. getPosition();
  972. addInfo("保存成功!");
  973. },
  974. error:function(err){
  975. showAjaxError(err);
  976. }
  977. });
  978. }
  979. }
  980. }
  981. /**
  982. *删除职称
  983. */
  984. function delPosition(id){
  985. if(confirm("确定要删除该职称吗?")){
  986. $.ajax({
  987. type:"POST",
  988. url:"hrStaffCardAction.do?task=delPosition&universalid="+id+"&time=" + new Date().getTime(),
  989. cache:false,
  990. success:function(data){
  991. resetForm();
  992. getPosition();
  993. addInfo("删除成功!");
  994. },
  995. error:function(err){
  996. showAjaxError(err);
  997. }
  998. });
  999. }
  1000. }
  1001. /**
  1002. * 保存建造师信息
  1003. */
  1004. function submitSaveConstruction(){
  1005. var isPass = checkConstructionForm();
  1006. var isEdit = $("#isEdit").val();
  1007. if(isPass == true){
  1008. var type_id = getTypeId("construction_engineer_type_id");
  1009. var count = $("#count").val();
  1010. var constructionJson = {count:$("#count").val(),
  1011. staff_id:$("#staff_id").val(),
  1012. universalid:$("#constructionId").val(),
  1013. construction_engineer_type_id:type_id,
  1014. registration_number:encodeURI($("#registration_number").val()),
  1015. registration_certificate_id:encodeURI($("#registration_certificate_id").val()),
  1016. operation_certificate:encodeURI($("#operation_certificate").val()),
  1017. continuing_education_time:$("#continuing_education_time").val(),
  1018. continuing_education_subject:encodeURI($("#continuing_education_subject").val()),
  1019. person_system_passowrd:encodeURI($("#person_system_passowrd").val()),
  1020. lock_system:encodeURI($("#lock_system").val()),
  1021. send_card_time:$("#send_card_time").val(),
  1022. construction_engineer_remark:encodeURI($("#construction_engineer_remark").val()),
  1023. construction_engineer_affix_id:getMoreDocId(document.getElementsByName("construction_engineer_affix"))};
  1024. var urlStr = "";
  1025. for ( var i = 0; i <= count; i++) {
  1026. urlStr += "&construction_subject"+i+"="+$("#construction_subject"+i).val();
  1027. urlStr += "&construction_effective_date"+i+"="+$("#construction_effective_date"+i).val();
  1028. }
  1029. if(isEdit !=""){
  1030. $.ajax({
  1031. type:"POST",
  1032. url:"hrStaffCardAction.do?task=editConstructionEngineer"+urlStr+"&time=" + new Date().getTime(),
  1033. cache:false,
  1034. data:constructionJson,
  1035. success:function(data){
  1036. resetForm();
  1037. getConstruction();
  1038. addInfo("保存成功!");
  1039. },
  1040. error:function(err){
  1041. showAjaxError(err);
  1042. }
  1043. });
  1044. }else{
  1045. $.ajax({
  1046. type:"POST",
  1047. url:"hrStaffCardAction.do?task=addConstructionEngineer"+urlStr+"&time=" + new Date().getTime(),
  1048. cache:false,
  1049. data:constructionJson,
  1050. success:function(data){
  1051. resetForm();
  1052. getConstruction();
  1053. addInfo("保存成功!");
  1054. },
  1055. error:function(err){
  1056. showAjaxError(err);
  1057. }
  1058. });
  1059. }
  1060. }
  1061. }
  1062. /**
  1063. *删除建造师
  1064. */
  1065. function delConstruction(id){
  1066. if(confirm("确定要删除该建造师信息吗?")){
  1067. $.ajax({
  1068. type:"POST",
  1069. url:"hrStaffCardAction.do?task=delConstructionEngineer&universalid="+id+"&time=" + new Date().getTime(),
  1070. cache:false,
  1071. success:function(data){
  1072. resetForm();
  1073. getConstruction();
  1074. addInfo("删除成功!");
  1075. },
  1076. error:function(err){
  1077. showAjaxError(err);
  1078. }
  1079. });
  1080. }
  1081. }
  1082. /**
  1083. * 保存八大员信息
  1084. */
  1085. function submitSaveEightType(){
  1086. var isPass = checkEightTypeForm();
  1087. var isEdit = $("#isEdit").val();
  1088. if(isPass == true){
  1089. var type_id = getTypeId("eight_type_id");
  1090. var eighttypeJson = {staff_id:$("#staff_id").val(),
  1091. universalid:$("#eightTypeId").val(),
  1092. eight_type_id:type_id,
  1093. eight_post_job:encodeURI($("#eight_post_job").val()),
  1094. eight_other_job:encodeURI($("#eight_other_job").val()),
  1095. eight_card_id:encodeURI($("#eight_card_id").val()),
  1096. eight_type_date:$("#eight_type_date").val(),
  1097. eight_type_effective_date:$("#eight_type_effective_date").val(),
  1098. eight_type_remark:encodeURI($("#eight_type_remark").val()),
  1099. eight_type_affix_id:getMoreDocId(document.getElementsByName("eight_type_affix"))};
  1100. if(isEdit !=""){
  1101. $.ajax({
  1102. type:"POST",
  1103. url:"hrStaffCardAction.do?task=editEightType&time=" + new Date().getTime(),
  1104. cache:false,
  1105. data:eighttypeJson,
  1106. success:function(data){
  1107. resetForm();
  1108. getEightType();
  1109. addInfo("保存成功!");
  1110. },
  1111. error:function(err){
  1112. showAjaxError(err);
  1113. }
  1114. });
  1115. }else{
  1116. $.ajax({
  1117. type:"POST",
  1118. url:"hrStaffCardAction.do?task=addEightType&time=" + new Date().getTime(),
  1119. cache:false,
  1120. data:eighttypeJson,
  1121. success:function(data){
  1122. resetForm();
  1123. getEightType();
  1124. alert("保存成功!");
  1125. },
  1126. error:function(err){
  1127. showAjaxError(err);
  1128. }
  1129. });
  1130. }
  1131. }
  1132. }
  1133. /**
  1134. *删除八大员
  1135. */
  1136. function delEightType(id){
  1137. if(confirm("确定要删除该八大员信息吗?")){
  1138. $.ajax({
  1139. type:"POST",
  1140. url:"hrStaffCardAction.do?task=delEightType&universalid="+id+"&time=" + new Date().getTime(),
  1141. cache:false,
  1142. success:function(data){
  1143. resetForm();
  1144. getEightType();
  1145. addInfo("删除成功!");
  1146. },
  1147. error:function(err){
  1148. showAjaxError(err);
  1149. }
  1150. });
  1151. }
  1152. }
  1153. /**
  1154. * 保存三类人员信息
  1155. */
  1156. function submitSaveThreeType(){
  1157. var isPass = checkThreeTypeForm();
  1158. var isEdit = $("#isEdit").val();
  1159. if(isPass == true){
  1160. var type_id = getTypeId("three_type_id");
  1161. var threetypeJson = {staff_id:$("#staff_id").val(),
  1162. universalid:$("#threeTypeId").val(),
  1163. three_type_id:type_id,
  1164. three_type_safety_check_id:encodeURI($("#three_type_safety_check_id").val()),
  1165. provide_certificate_time:$("#provide_certificate_time").val(),
  1166. three_type_position:encodeURI($("#three_type_position").val()),
  1167. b_three_type_effective_date:$("#b_three_type_effective_date").val(),
  1168. three_type_technology_position:encodeURI($("#three_type_technology_position").val()),
  1169. three_type_remark:encodeURI($("#three_type_remark").val()),
  1170. three_type_affix_id:getMoreDocId(document.getElementsByName("three_type_affix"))};
  1171. if(isEdit !=""){
  1172. $.ajax({
  1173. type:"POST",
  1174. url:"hrStaffCardAction.do?task=editThreeType&time=" + new Date().getTime(),
  1175. cache:false,
  1176. data:threetypeJson,
  1177. success:function(data){
  1178. resetForm();
  1179. getThreeType();
  1180. addInfo("保存成功!");
  1181. },
  1182. error:function(err){
  1183. showAjaxError(err);
  1184. }
  1185. });
  1186. }else{
  1187. $.ajax({
  1188. type:"POST",
  1189. url:"hrStaffCardAction.do?task=addThreeType&time=" + new Date().getTime(),
  1190. cache:false,
  1191. data:threetypeJson,
  1192. success:function(data){
  1193. resetForm();
  1194. getThreeType();
  1195. addInfo("保存成功!");
  1196. },
  1197. error:function(err){
  1198. showAjaxError(err);
  1199. }
  1200. });
  1201. }
  1202. }
  1203. }
  1204. /**
  1205. *删除三类人员
  1206. */
  1207. function delThreeType(id){
  1208. if(confirm("确定要删除该三类人员信息吗?")){
  1209. $.ajax({
  1210. type:"POST",
  1211. url:"hrStaffCardAction.do?task=delThreeType&universalid="+id+"&time=" + new Date().getTime(),
  1212. cache:false,
  1213. success:function(data){
  1214. resetForm();
  1215. getThreeType();
  1216. addInfo("删除成功!");
  1217. },
  1218. error:function(err){
  1219. showAjaxError(err);
  1220. }
  1221. });
  1222. }
  1223. }
  1224. /**
  1225. * 保存特种工信息
  1226. */
  1227. function submitSaveSpecialWork(){
  1228. var isPass = checkSpecialWorkForm();
  1229. var isEdit = $("#isEdit").val();
  1230. if(isPass == true){
  1231. var type_id = getTypeId("special_work_type_id");
  1232. var workJson = {staff_id:$("#staff_id").val(),
  1233. universalid:$("#specialWorkId").val(),
  1234. special_work_type_id:type_id,
  1235. special_work_send_unit:encodeURI($("#special_work_send_unit").val()),
  1236. certificate_id:encodeURI($("#certificate_id").val()),
  1237. work_type:encodeURI($("#work_type").val()),
  1238. special_work_start_certificate_time:$("#special_work_start_certificate_time").val(),
  1239. special_work_effective_date:$("#special_work_effective_date").val(),
  1240. first_check_time:encodeURI($("#first_check_time").val()),
  1241. second_check_time:encodeURI($("#second_check_time").val()),
  1242. special_work_remark:encodeURI($("#special_work_remark").val()),
  1243. special_work_affix_id:getMoreDocId(document.getElementsByName("special_work_affix"))};
  1244. if(isEdit !=""){
  1245. $.ajax({
  1246. type:"POST",
  1247. url:"hrStaffCardAction.do?task=editSpecialWork&time=" + new Date().getTime(),
  1248. cache:false,
  1249. data:workJson,
  1250. success:function(data){
  1251. resetForm();
  1252. getSpecialWork();
  1253. addInfo("保存成功!");
  1254. },
  1255. error:function(err){
  1256. showAjaxError(err);
  1257. }
  1258. });
  1259. }else{
  1260. $.ajax({
  1261. type:"POST",
  1262. url:"hrStaffCardAction.do?task=addSpecialWork&time=" + new Date().getTime(),
  1263. cache:false,
  1264. data:workJson,
  1265. success:function(data){
  1266. resetForm();
  1267. getSpecialWork();
  1268. addInfo("保存成功!");
  1269. },
  1270. error:function(err){
  1271. showAjaxError(err);
  1272. }
  1273. });
  1274. }
  1275. }
  1276. }
  1277. /**
  1278. *删除特种工
  1279. */
  1280. function delSpecialWork(id){
  1281. if(confirm("确定要删除该特种工信息吗?")){
  1282. $.ajax({
  1283. type:"POST",
  1284. url:"hrStaffCardAction.do?task=delSpecialWork&universalid="+id+"&time=" + new Date().getTime(),
  1285. cache:false,
  1286. success:function(data){
  1287. resetForm();
  1288. getSpecialWork();
  1289. addInfo("删除成功!");
  1290. },
  1291. error:function(err){
  1292. showAjaxError(err);
  1293. }
  1294. });
  1295. }
  1296. }
  1297. /**
  1298. * 保存其他信息
  1299. */
  1300. function submitSaveOther(){
  1301. var isPass = checkOtherForm();
  1302. var isEdit = $("#isEdit").val();
  1303. if(isPass){
  1304. // var type_id = getTypeId("other_type_id");
  1305. var workJson = {staff_id:$("#staff_id").val(),
  1306. universalid:$("#otherCardId").val(),
  1307. // other_type_id:type_id,
  1308. // other_type_id:encodeURI($("#other_type_id").val()),
  1309. other_card_name:encodeURI($("#other_card_name").val()),
  1310. other_card_id:encodeURI($("#other_card_id").val()),
  1311. other_major:encodeURI($("#other_major").val()),
  1312. other_effective_date:$("#other_effective_date").val(),
  1313. other_remark:encodeURI($("#other_remark").val()),
  1314. other_affix_id:getMoreDocId(document.getElementsByName("other_affix"))};
  1315. if(isEdit !=""){
  1316. $.ajax({
  1317. type:"POST",
  1318. url:"hrStaffCardAction.do?task=editOther&time=" + new Date().getTime(),
  1319. cache:false,
  1320. data:workJson,
  1321. success:function(data){
  1322. resetForm();
  1323. getOther();
  1324. addInfo("保存成功!");
  1325. },
  1326. error:function(err){
  1327. showAjaxError(err);
  1328. }
  1329. });
  1330. }else{
  1331. $.ajax({
  1332. type:"POST",
  1333. url:"hrStaffCardAction.do?task=addOther&time=" + new Date().getTime(),
  1334. cache:false,
  1335. data:workJson,
  1336. success:function(data){
  1337. resetForm();
  1338. getOther();
  1339. addInfo("保存成功!");
  1340. },
  1341. error:function(err){
  1342. showAjaxError(err);
  1343. }
  1344. });
  1345. }
  1346. }
  1347. }
  1348. /**
  1349. *删除其他
  1350. */
  1351. function delOther(id){
  1352. if(confirm("确定要删除该其他证件信息吗?")){
  1353. $.ajax({
  1354. type:"POST",
  1355. url:"hrStaffCardAction.do?task=delOther&universalid="+id+"&time=" + new Date().getTime(),
  1356. cache:false,
  1357. success:function(data){
  1358. resetForm();
  1359. getOther();
  1360. addInfo("删除成功!");
  1361. },
  1362. error:function(err){
  1363. showAjaxError(err);
  1364. }
  1365. });
  1366. }
  1367. }
  1368. /**********************************验证信息**********************************/
  1369. /**
  1370. * 验证员身份证是否存在
  1371. */
  1372. function checkIdNumber(obj){
  1373. var staff_id = $("#staff_id").val();
  1374. if(obj.value ==""){
  1375. document.getElementById("subBtu").disabled=false;
  1376. document.getElementById("id_number_div").innerHTML="";
  1377. }else{
  1378. $.ajax({
  1379. type:"POST",
  1380. url:"hrStaffAction.do?task=checkIdNumber&id_number="+obj.value+"&staff_id="+staff_id+"&time=" + new Date().getTime(),
  1381. cache:false,
  1382. dataType:'json',
  1383. success:function(data){
  1384. if(data[0].count_id >0){
  1385. document.getElementById("subBtu").disabled=true;
  1386. document.getElementById("id_number_div").innerHTML = "<span style=\"color: red;\">身份证号已存在!</span>";
  1387. }else{
  1388. document.getElementById("subBtu").disabled=false;
  1389. document.getElementById("id_number_div").innerHTML="";
  1390. }
  1391. },
  1392. error:function(err){
  1393. showAjaxError(err);
  1394. }
  1395. });
  1396. }
  1397. }
  1398. function checkuserhide(is_username){
  1399. var username = $("#username").val();
  1400. var s="";
  1401. if(is_username=="is_username"){
  1402. s="&is_username="+is_username;
  1403. }
  1404. $.ajax({
  1405. type:"POST",
  1406. url:"hrStaffAction.do?task=checkStaffName&staff_name="+encodeURI(encodeURI(username))+"&time=" + new Date().getTime()+s,
  1407. cache:false,
  1408. dataType:'json',
  1409. success:function(data){
  1410. var user_name=data[0]['name'];
  1411. var i=user_name.indexOf("*");
  1412. if(i !=-1){
  1413. document.getElementById("username").style.display="block";
  1414. document.getElementById("subBtu").disabled=true;
  1415. document.getElementById("username").value = data[0]['name'];
  1416. document.getElementById("staff_name_div").innerHTML = "<span style=\"color: red;\">用户名不能带有*!</span>";
  1417. return ;
  1418. }
  1419. if(data.length==2){
  1420. document.getElementById("username").style.display="block";
  1421. document.getElementById("subBtu").disabled=true;
  1422. document.getElementById("username").value = data[0]['name'];
  1423. document.getElementById("staff_name_div").innerHTML = "<span style=\"color: red;\">用户名已存在!</span>";
  1424. }else{
  1425. document.getElementById("staff_name_div").innerHTML = data[0]['name'];
  1426. document.getElementById("subBtu").disabled=false;
  1427. document.getElementById("username").style.display="none";
  1428. document.getElementById("username").value =data[0]['name'];
  1429. }
  1430. },
  1431. error:function(err){
  1432. showAjaxError(err);
  1433. }
  1434. });
  1435. }
  1436. /**
  1437. * 验证员用户名是否存在
  1438. */
  1439. function checkUserName(){
  1440. if(document.getElementById("checkbox_active").checked){
  1441. var staff_name = $("#staff_name").val();
  1442. if(staff_name ==""){
  1443. document.getElementById("subBtu").disabled=false;
  1444. document.getElementById("staff_name_div").innerHTML="";
  1445. document.getElementById("username").style.display="none";
  1446. document.getElementById("username").value ="";
  1447. }else{
  1448. $.ajax({
  1449. type:"POST",
  1450. url:"hrStaffAction.do?task=checkStaffName&staff_name="+encodeURI(encodeURI(staff_name))+"&time=" + new Date().getTime(),
  1451. cache:false,
  1452. dataType:'json',
  1453. success:function(data){
  1454. var user_name=data[0]['name'];
  1455. var i=user_name.indexOf("*");
  1456. if(i !=-1){
  1457. document.getElementById("username").style.display="block";
  1458. document.getElementById("subBtu").disabled=true;
  1459. document.getElementById("username").value = data[0]['name'];
  1460. document.getElementById("staff_name_div").innerHTML = "<span style=\"color: red;\">用户名不能带有*!</span>";
  1461. return ;
  1462. }
  1463. if(data.length==2){
  1464. document.getElementById("username").style.display="block";
  1465. document.getElementById("subBtu").disabled=true;
  1466. document.getElementById("username").value = data[0]['name'];
  1467. document.getElementById("staff_name_div").innerHTML = "<span style=\"color: red;\">用户名已存在!</span>";
  1468. }else{
  1469. document.getElementById("staff_name_div").innerHTML = data[0]['name'];
  1470. document.getElementById("subBtu").disabled=false;
  1471. document.getElementById("username").style.display="none";
  1472. document.getElementById("username").value ="";
  1473. }
  1474. },
  1475. error:function(err){
  1476. showAjaxError(err);
  1477. }
  1478. });
  1479. }
  1480. }else{
  1481. document.getElementById("subBtu").disabled=false;
  1482. document.getElementById("staff_name_div").innerHTML="";
  1483. document.getElementById("username").style.display="none";
  1484. document.getElementById("username").value="";
  1485. }
  1486. }
  1487. /**
  1488. * 验证员工信息
  1489. */
  1490. function checkStaffForm() {
  1491. var rs = $.validate({
  1492. name : "job_number",
  1493. model : [ {
  1494. type : "require",
  1495. msg : "工号不能为空!"
  1496. } ]
  1497. });
  1498. rs = $.validate({
  1499. name : "staff_name",
  1500. model : [ {
  1501. type : "require",
  1502. msg : "姓名不能为空!"
  1503. }]
  1504. }) && rs;
  1505. /*rs = $.validate({
  1506. name : "att_user_id",
  1507. model : [ {
  1508. type : "require",
  1509. msg : "考勤用户号不能为空!"
  1510. }]
  1511. }) && rs;*/
  1512. rs = $.validate({
  1513. name : "id_number",
  1514. model : [ {
  1515. type : "require",
  1516. msg : "身份证号码不能为空!"
  1517. }, {
  1518. type : "len",
  1519. min : 1,
  1520. max : 18,
  1521. msg : "身份证号码长度不能超过18!"
  1522. },{
  1523. type : "regex",
  1524. //regex : /^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{4}$/,
  1525. regex : /^(\d{15}$|^\d{18}$|^\d{17}(\d|X|x))$/,
  1526. msg : "身份证号码输入不合法!"
  1527. } ]
  1528. }) && rs;
  1529. if(rs){
  1530. var isFollow_flag=false;
  1531. $.each($("input[name='isFollow']"),function(index,obj){
  1532. var flag=$(obj).attr("checked");
  1533. if(flag){
  1534. isFollow_flag=true;
  1535. return;
  1536. }
  1537. });
  1538. if(!isFollow_flag){
  1539. $.ligerDialog.warn("请选定主岗!");
  1540. return ;
  1541. }
  1542. var isLogin_flag=false;
  1543. $.each($("input[name='isLogin']"),function(index,obj){
  1544. var flag=$(obj).attr("checked");
  1545. if(flag){
  1546. isLogin_flag=true;
  1547. return ;
  1548. }
  1549. });
  1550. if(!isLogin_flag){
  1551. $.ligerDialog.warn("请选定默认登录!");
  1552. return ;
  1553. }
  1554. var isFollow = $("input[name='isFollow']:checked").parent().parent();
  1555. var seleceFollowValue = $("[name='branch_company_id']",isFollow).val();
  1556. $.each($("[name='otherposname']"),function(i,obj){
  1557. var seleceFollowPosition=$(obj).val;
  1558. if(seleceFollowPosition==""){
  1559. addFieldError($(isFollow).attr("id"),"请设定主岗部门岗位!");
  1560. return;
  1561. }
  1562. });
  1563. // var seleceFollowPosition = $("[name='otherposname']",isFollow).val();
  1564. if(seleceFollowValue==""){
  1565. addFieldError($(isFollow).attr("id"),"请设定主岗部门!");
  1566. return;
  1567. }
  1568. // if(seleceFollowPosition==""){
  1569. // addFieldError($(isFollow).attr("id"),"请设定主岗部门岗位!");
  1570. // return;
  1571. // }
  1572. getDocId("sfzDocumentId","id_number_affix");
  1573. getDocId("htDocumentId","agreement_affix");
  1574. return true;
  1575. }
  1576. return false;
  1577. }
  1578. /**
  1579. * 验证学历信息
  1580. */
  1581. function checkEducationForm(){
  1582. var rs = $.validate({
  1583. name : "study_school_name",
  1584. model : [ {
  1585. type : "require",
  1586. msg : "学校名称不能为空!"
  1587. } ]
  1588. });
  1589. if(rs){
  1590. return true;
  1591. }
  1592. return false;
  1593. }
  1594. /**
  1595. * 验证工作经历信息
  1596. */
  1597. function checkExperienceForm(){
  1598. var rs = $.validate({
  1599. name : "work_company",
  1600. model : [ {
  1601. type : "require",
  1602. msg : "工作单位不能为空!"
  1603. } ]
  1604. });
  1605. if(rs){
  1606. return true;
  1607. }
  1608. return false;
  1609. }
  1610. /**
  1611. * 验证家庭成员信息
  1612. */
  1613. function checkFamilyForm(){
  1614. var rs = $.validate({
  1615. name : "member_name",
  1616. model : [ {
  1617. type : "require",
  1618. msg : "姓名不能为空!"
  1619. } ]
  1620. });
  1621. if(rs){
  1622. return true;
  1623. }
  1624. return false;
  1625. }
  1626. function checkReWardsForm(){
  1627. var rs = $.validate({
  1628. name : "type_id",
  1629. model : [ {
  1630. type : "require",
  1631. msg : "奖惩形式不能为空!"
  1632. } ]
  1633. }) ;
  1634. rs = $.validate({
  1635. name : "dept_name",
  1636. model : [ {
  1637. type : "require",
  1638. msg : "执行部门不能为空!"
  1639. } ]
  1640. }) && rs;
  1641. rs = $.validate({
  1642. name : "rewards_date",
  1643. model : [ {
  1644. type : "require",
  1645. msg : "奖惩日期不能为空!"
  1646. } ]
  1647. }) && rs;
  1648. if(rs){
  1649. return true;
  1650. }
  1651. return false;
  1652. }
  1653. /**
  1654. * 验证职称信息
  1655. */
  1656. function checkPositionForm(){
  1657. var rs = $.validate({
  1658. name : "position_name",
  1659. model : [ {
  1660. type : "require",
  1661. msg : "职称不能为空!"
  1662. } ]
  1663. });
  1664. var type_id = getTypeId("position_name");
  1665. if(type_id==""){
  1666. rs = $.validate({
  1667. name : "positionCheck",
  1668. model : [ {
  1669. type : "require",
  1670. msg : "请选择职称类型!"
  1671. } ]
  1672. })&& rs;
  1673. }else{
  1674. $("#positionCheck").val("val");
  1675. rs = $.validate({
  1676. name : "positionCheck",
  1677. model : [ {
  1678. type : "require",
  1679. msg : "请选择职称类型!"
  1680. } ]
  1681. }) && rs;
  1682. }
  1683. if(rs){
  1684. return true;
  1685. }
  1686. return false;
  1687. }
  1688. /**
  1689. * 验证建造师信息
  1690. */
  1691. function checkConstructionForm(){
  1692. var rs = $.validate({
  1693. name : "registration_certificate_id",
  1694. model : [ {
  1695. type : "require",
  1696. msg : "注册证书编号不能为空!"
  1697. } ]
  1698. });
  1699. // rs = $.validate({
  1700. // name : "construction_effective_date",
  1701. // model : [ {
  1702. // type : "require",
  1703. // msg : "请选择有效期!"
  1704. // } ]
  1705. // })&& rs;
  1706. rs = $.validate({
  1707. name : "send_card_time",
  1708. model : [ {
  1709. type : "require",
  1710. msg : "请选择发证日期!"
  1711. } ]
  1712. })&& rs;
  1713. var type_id = getTypeId("construction_engineer_type_id");
  1714. if(type_id==""){
  1715. rs = $.validate({
  1716. name : "constructionCheck",
  1717. model : [ {
  1718. type : "require",
  1719. msg : "请选择建造师类型!"
  1720. } ]
  1721. }) && rs;
  1722. }else{
  1723. $("#constructionCheck").val("val");
  1724. rs = $.validate({
  1725. name : "constructionCheck",
  1726. model : [ {
  1727. type : "require",
  1728. msg : "请选择建造师类型!"
  1729. } ]
  1730. }) && rs;
  1731. }
  1732. if(rs){
  1733. return true;
  1734. }
  1735. return false;
  1736. }
  1737. /**
  1738. * 验证八大员信息
  1739. */
  1740. function checkEightTypeForm(){
  1741. var rs = $.validate({
  1742. name : "eight_type_date",
  1743. model : [ {
  1744. type : "require",
  1745. msg : "请选择发证日期!"
  1746. } ]
  1747. });
  1748. rs = $.validate({
  1749. name : "eight_type_effective_date",
  1750. model : [ {
  1751. type : "require",
  1752. msg : "请选择有效期!"
  1753. } ]
  1754. })&& rs;
  1755. var type_id = getTypeId("eight_type_id");
  1756. if(type_id==""){
  1757. rs = $.validate({
  1758. name : "eightTypeCheck",
  1759. model : [ {
  1760. type : "require",
  1761. msg : "请选择八大员类型!"
  1762. } ]
  1763. }) && rs;
  1764. }else{
  1765. $("#eightTypeCheck").val("val");
  1766. rs = $.validate({
  1767. name : "eightTypeCheck",
  1768. model : [ {
  1769. type : "require",
  1770. msg : "请选择八大员类型!"
  1771. } ]
  1772. }) && rs;
  1773. }
  1774. if(rs){
  1775. return true;
  1776. }
  1777. return false;
  1778. }
  1779. /**
  1780. * 验证三类人员信息
  1781. */
  1782. function checkThreeTypeForm(){
  1783. var rs = $.validate({
  1784. name : "three_type_safety_check_id",
  1785. model : [ {
  1786. type : "require",
  1787. msg : "安全考核证号不能为空!"
  1788. } ]
  1789. });
  1790. rs = $.validate({
  1791. name : "provide_certificate_time",
  1792. model : [ {
  1793. type : "require",
  1794. msg : "请选择发证日期!"
  1795. } ]
  1796. })&& rs;
  1797. rs = $.validate({
  1798. name : "b_three_type_effective_date",
  1799. model : [ {
  1800. type : "require",
  1801. msg : "请选择B证有效期!"
  1802. } ]
  1803. })&& rs;
  1804. var type_id = getTypeId("three_type_id");
  1805. if(type_id==""){
  1806. rs = $.validate({
  1807. name : "threeTypeCheck",
  1808. model : [ {
  1809. type : "require",
  1810. msg : "请选择三类人员类型!"
  1811. } ]
  1812. }) && rs;
  1813. }else{
  1814. $("#threeTypeCheck").val("val");
  1815. rs = $.validate({
  1816. name : "threeTypeCheck",
  1817. model : [ {
  1818. type : "require",
  1819. msg : "请选择三类人员类型!"
  1820. } ]
  1821. }) && rs;
  1822. }
  1823. if(rs){
  1824. return true;
  1825. }
  1826. return false;
  1827. }
  1828. /**
  1829. * 验证特种工信息
  1830. */
  1831. function checkSpecialWorkForm(){
  1832. var rs = $.validate({
  1833. name : "certificate_id",
  1834. model : [ {
  1835. type : "require",
  1836. msg : "证书编号不能为空!"
  1837. } ]
  1838. });
  1839. rs = $.validate({
  1840. name : "special_work_start_certificate_time",
  1841. model : [ {
  1842. type : "require",
  1843. msg : "请选择发证日期!"
  1844. } ]
  1845. })&& rs;
  1846. rs = $.validate({
  1847. name : "special_work_effective_date",
  1848. model : [ {
  1849. type : "require",
  1850. msg : "请选择有效期!"
  1851. } ]
  1852. })&& rs;
  1853. var type_id = getTypeId("special_work_type_id");
  1854. if(type_id==""){
  1855. rs = $.validate({
  1856. name : "specialWorkCheck",
  1857. model : [ {
  1858. type : "require",
  1859. msg : "请选择特种工类型!"
  1860. } ]
  1861. }) && rs;
  1862. }else{
  1863. $("#specialWorkCheck").val("val");
  1864. rs = $.validate({
  1865. name : "specialWorkCheck",
  1866. model : [ {
  1867. type : "require",
  1868. msg : "请选择特种工类型!"
  1869. } ]
  1870. }) && rs;
  1871. }
  1872. if(rs){
  1873. return true;
  1874. }
  1875. return false;
  1876. }
  1877. /**
  1878. * 验证其他证件信息
  1879. */
  1880. function checkOtherForm(){
  1881. var rs = $.validate({
  1882. name : "other_card_name",
  1883. model : [ {
  1884. type : "require",
  1885. msg : "证书名称不能为空!"
  1886. } ]
  1887. });
  1888. rs = $.validate({
  1889. name : "other_effective_date",
  1890. model : [ {
  1891. type : "require",
  1892. msg : "请选择有效期!"
  1893. } ]
  1894. })&& rs;
  1895. // var type_id = getTypeId("other_card_name");
  1896. // if(type_id==""){
  1897. // rs = $.validate({
  1898. // name : "otherCardCheck",
  1899. // model : [ {
  1900. // type : "require",
  1901. // msg : "请选择其他证件类型!"
  1902. // } ]
  1903. // }) && rs;
  1904. // }
  1905. // else{
  1906. // $("#otherCardCheck").val("val");
  1907. // rs = $.validate({
  1908. // name : "otherCardCheck",
  1909. // model : [ {
  1910. // type : "require",
  1911. // msg : "请选择其他证件类型!"
  1912. // } ]
  1913. // }) && rs;
  1914. // }
  1915. if(rs){
  1916. return true;
  1917. }
  1918. return false;
  1919. }
  1920. /**********************************重置表单**********************************/
  1921. function resetReWardsForm(){
  1922. $("#rewards_id").val("");
  1923. $("#class_id option[value=1]").attr("selected",true);
  1924. initReWardsType();
  1925. $("#dept_name").val("");
  1926. $("#dept_id").val("");
  1927. $("#rewards_date").val("");
  1928. $("#descript").val("");
  1929. }
  1930. function resetForm(){
  1931. $("#isEdit").val("");
  1932. /*学历*/
  1933. $("#educationId").val("");
  1934. $("#study_type").val("");
  1935. $("#study_school_name").val("");
  1936. $("#study_subject").val("");
  1937. $("#study_educational_background").val("");
  1938. $("#study_degree").val("");
  1939. $("#study_start_end_time").val("");
  1940. // 附件控件状态
  1941. editViewFileHtml("", "study_affix");
  1942. /*工作经历*/
  1943. $("#experienceId").val("");
  1944. $("#work_company").val("");
  1945. $("#work_position").val("");
  1946. $("#work_start_end_time").val("");
  1947. $("#work_resignation_reason").val("");
  1948. /*家庭成员*/
  1949. $("#familyId").val("");
  1950. $("#member_name").val("");
  1951. $("#member_relation").val("");
  1952. $("#member_company").val("");
  1953. $("#member_position").val("");
  1954. $("#member_phone").val("");
  1955. $("#member_remark").val("");
  1956. /*职称*/
  1957. $("#positionId").val("");
  1958. $("input:radio[name='position_type_id']").attr("checked",false);
  1959. $("#positionCheck").val("");
  1960. $("#position_name").val("");
  1961. $("#position_subject").val("");
  1962. $("#send_unit").val("");
  1963. $("#card_num").val("");
  1964. $("#refe_num").val("");
  1965. $("#issue_date").val("");
  1966. $("#position_remark").val("");
  1967. editViewFileHtml("", "position_affix");
  1968. /*建造师*/
  1969. $("#constructionId").val("");
  1970. $("input:radio[name='construction_engineer_type_id']").attr("checked",false);
  1971. $("#constructionCheck").val("");
  1972. $("#registration_number").val("");
  1973. $("#registration_certificate_id").val("");
  1974. $("#operation_certificate").val("");
  1975. $("#construction_subject0").val("");
  1976. $("#construction_effective_date0").val("");
  1977. $("#continuing_education_time").val("");
  1978. $("#continuing_education_subject").val("");
  1979. $("#person_system_passowrd").val("");
  1980. $("#lock_system").val("");
  1981. $("#send_card_time").val("");
  1982. $("#construction_engineer_remark").val("");
  1983. editViewFileHtml("", "construction_engineer_affix");
  1984. //showBorrow("tabitem6");
  1985. for ( var i = 0; i <= $("#count").val(); i++) {
  1986. if(i != 0){
  1987. $("tr[id='tabtr"+i+"']").remove();//删除当前行
  1988. }
  1989. }
  1990. $("#count").val("0");
  1991. /*八大员*/
  1992. $("#eightTypeId").val("");
  1993. $("input:radio[name='eight_type_id']").attr("checked",false);
  1994. $("#eightTypeCheck").val("");
  1995. $("#eight_post_job").val("");
  1996. $("#eight_other_job").val("");
  1997. $("#eight_card_id").val("");
  1998. $("#eight_type_date").val("");
  1999. $("#eight_type_effective_date").val("");
  2000. $("#eight_type_remark").val("");
  2001. editViewFileHtml("", "eight_type_affix");
  2002. /*三类人员*/
  2003. $("#threeTypeId").val("");
  2004. $("input:radio[name='three_type_id']").attr("checked",false);
  2005. $("#threeTypeCheck").val("");
  2006. $("#three_type_safety_check_id").val("");
  2007. $("#provide_certificate_time").val("");
  2008. $("#three_type_position").val("");
  2009. $("#b_three_type_effective_date").val("");
  2010. $("#three_type_technology_position").val("");
  2011. $("#three_type_remark").val("");
  2012. editViewFileHtml("", "three_type_affix");
  2013. /*特种工*/
  2014. $("#specialWorkId").val("");
  2015. $("input:radio[name='special_work_type_id']").attr("checked",false);
  2016. $("#specialWorkCheck").val("");
  2017. $("#certificate_id").val("");
  2018. $("#work_type").val("");
  2019. $("#special_work_send_unit").val("");
  2020. $("#special_work_start_certificate_time").val("");
  2021. $("#special_work_effective_date").val("");
  2022. $("#first_check_time").val("");
  2023. $("#second_check_time").val("");
  2024. $("#special_work_remark").val("");
  2025. editViewFileHtml("", "special_work_affix");
  2026. /*其他*/
  2027. $("#otherCardId").val("");
  2028. $("input:radio[name='other_type_id']").attr("checked",false);
  2029. $("#otherCardCheck").val("");
  2030. $("#other_card_name").val("");
  2031. $("#other_card_id").val("");
  2032. $("#other_major").val("");
  2033. $("#other_effective_date").val("");
  2034. $("#other_remark").val("");
  2035. editViewFileHtml("", "other_affix");
  2036. }
  2037. /***********************************公共方法************************************/
  2038. //获取证件类型id
  2039. function getTypeId(obj){
  2040. var type_id = "";
  2041. var ss = $("input:radio[name='"+obj+"']");
  2042. for ( var int = 0; int < ss.length; int++) {
  2043. if(ss[int].checked){
  2044. type_id = ss[int].value;
  2045. break;
  2046. }
  2047. }
  2048. return type_id;
  2049. }
  2050. //合同及身份证多附件处理
  2051. function getDocId(valObj,hiddenObj){
  2052. var val = document.getElementsByName(valObj);
  2053. var Evalue = "";
  2054. for(var i=0;i<val.length;i++){
  2055. if(""!=val[i].value){
  2056. Evalue=Evalue + val[i].value +",";
  2057. }
  2058. }
  2059. $("#"+hiddenObj).val(Evalue);
  2060. }