97bdc6365571a550bb33e41f0dece020f8cd97ef.svn-base 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. var deptName = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  2. $(function(){
  3. //初始加载
  4. /** 下拉框加载 */
  5. $('#EXPERT_SPECIALTY_260').initCanstSelect('BM_MAJOR');
  6. $('#CHANGE_TYPE_260').initCanstSelect('BM_CHANGETYPE');
  7. $('#EDUCATION_260').initCanstSelect('BM_EDUCATION');
  8. $('#EXPERT_TYPE_260').initCanstSelect('BM_JOBTITLE');
  9. $('#EXPERT_POST_260').initCanstSelect('BM_DUTIES');
  10. $('#EXPERT_UNIT_260').val(deptName);
  11. // var AreaSql = "select DEPT_ID,PARENT_ID,DEPT_NAME from SYS_DEPARTMENT";
  12. //所属公司
  13. // var treeUrl = $.pathname() + '/ws/sys/constantService/getTreeCanst/';
  14. // var params = {
  15. // sql:AreaSql
  16. // };
  17. // $.post(treeUrl,params,function(data){
  18. // $("#AcceptUserTree").data("data",data[0].constlist);
  19. // $("#AcceptUserTree").render();
  20. // }, "json");
  21. // //部门树的请求地址
  22. // var deptUrl =$.pathname() + '/ws/orgInDeptService/OrgInDeptService/getDeptRootById';
  23. // //添加额外属性主要用于最初的初始节点
  24. // $("#AcceptUserTree").attr('params','{"deptId":"'+deptName+'"}');
  25. // //异步加载请求地址
  26. // $("#AcceptUserTree").attr('url',deptUrl);
  27. // //初始化单位树
  28. // $.post(deptUrl,{"id":deptName},function(data){
  29. // $("#AcceptUserTree").data("data",data);
  30. // $("#AcceptUserTree").render();
  31. // }, "json");
  32. // var opts = {
  33. // fileNumLimit: 1,
  34. // fileSizeLimit: 200 * 1024 * 1024, // 200 M
  35. // fileSingleSizeLimit: 50 * 1024 * 1024, // 50 M
  36. // pick: {
  37. // id: '#filePicker',
  38. // label: '点击选择文件',
  39. // name : 'file'
  40. // },
  41. // dnd: '#dndArea',
  42. // paste: '#uploader',
  43. // chunked: false,
  44. // chunkSize: 512 * 1024,
  45. // disableGlobalDnd: true
  46. // };
  47. //
  48. // $('#fileDiv').getAsyncUploadFileContent(opts);
  49. /******************录入人信息start********************/
  50. /* 页面展示用 */
  51. //取登录用户信息
  52. //登录用户姓名 要调整,还是要用id
  53. var userName = top.com.sinosoft.lz.system.user.LoginInfo.getReal_name();
  54. $("#TYPEIN_PEOPLE").html(userName);
  55. //用户手机号
  56. var getMobile = top.com.sinosoft.lz.system.user.LoginInfo.getMobile();
  57. if(getMobile==undefined){
  58. $("#TYPEIN_PEOPLE_PHONE_NUM").html("暂无手机号码");
  59. }else{
  60. $("#TYPEIN_PEOPLE_PHONE_NUM").html(getMobile);
  61. }
  62. //用户所属单位
  63. var getCorp_names = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_names();
  64. $("#UNITE").html(getCorp_names);
  65. //用户所属部门
  66. var getDeptnames = top.com.sinosoft.lz.system.user.LoginInfo.getDeptnames();
  67. $("#DEPT").html(getDeptnames);
  68. /*****************录入人信息end*********************/
  69. $('#fileDiv').newAsyncFileUpload("",null,1);
  70. $("#goback").hover(function(){
  71. $(this).attr("src","/nwyj/images/temp/back_hover.png");
  72. },function(){
  73. $(this).attr("src","/nwyj/images/temp/back.png");
  74. });
  75. });
  76. //表单验证
  77. function validateForm(containerId){
  78. var seletedValue;
  79. if(document.getElementById("radio-1").checked){
  80. seletedValue = document.getElementById("radio-1").value;
  81. }else if(document.getElementById("radio-2").checked){
  82. seletedValue = document.getElementById("radio-2").value;
  83. }
  84. $('#EXPERT_SEX_260').val(seletedValue);
  85. var name = $("#EXPERT_NAME_260").val();
  86. var sex = $("#EXPERT_SEX_260").val();
  87. var birthday1 = $("#EXPERT_BIRTHDAY_260").val();
  88. var cal = $("#EXPERT_CAL_260").val();
  89. // var area = $("#EXPERT_AREA_260").val();
  90. // var unit = $("#AcceptUserTree").attr('relValue');
  91. var comp = $("#EXPERT_UNIT_260").val();
  92. var worktime = $("#WORK_TIME_260").val();
  93. // var type = $("#EXPERT_TYPE_260").val();
  94. // var post = $("#EXPERT_POST_260").val();
  95. // var address = $("#EXPERT_ADDRESS_260").val();
  96. var specialty = $("#EXPERT_SPECIALTY_260").val();
  97. var ident = $("#IDENTIFICATION_TIME_260").val();
  98. /* var file = $("#uploaderFileName").val();
  99. var tempFile = file.split(",");
  100. if(tempFile.length>1){
  101. top.Dialog.alert("只允许上传一个附件,请检查是否只上传了一个附件。");
  102. return;
  103. }
  104. if(file.length>300){
  105. top.Dialog.alert("您上传的附件名称太长,请重命名后上传。");
  106. return;
  107. }
  108. var d=/\.[^\.]+$/.exec(file);
  109. if(file!=""){
  110. if(d!=".doc"&&d!=".pdf"&&d!=".zip"&&d!=".docx"){
  111. top.Dialog.alert('您上传的文件格式不合法,请上传.doc、.pdf或.zip格式的文件!');
  112. return;
  113. }
  114. }*/
  115. //取文件的名称
  116. var files = document.getElementsByName("uploaderFileName");
  117. //取文件的类型
  118. var filetype = document.getElementsByName("uploaderFileExt");
  119. if(files.length>0){
  120. for(var i=0 ;i<files.length;i++ ){
  121. var d = filetype[i].value;
  122. if(d!="doc"&&d!="pdf"&&d!="zip"&&d!="docx"){
  123. top.Dialog.alert('您上传的文件格式不合法,请上传.doc、.pdf或.zip格式的文件!');
  124. return;
  125. }
  126. }
  127. }
  128. var valid = $(containerId).validationEngine({returnIsValid: true});
  129. if(valid == true){
  130. var birthday = $('#EXPERT_BIRTHDAY_260').val();
  131. var work = $('#WORK_TIME_260').val();
  132. var time =$('#IDENTIFICATION_TIME_260').val();
  133. if(birthday > work){
  134. $.messager.alert('生日不能比参加工作时间晚');
  135. return ;
  136. }
  137. if(work > time){
  138. $.messager.alert('参加工作时间不能比认证时间晚');
  139. return ;
  140. }
  141. // var file = $("#uploaderFileName").val();
  142. if(files.length>0){
  143. $('#COLUMN_2_260').val("1");
  144. }else{
  145. $('#COLUMN_2_260').val("0");
  146. }
  147. //录入人id
  148. var userId = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
  149. $('#EXPERT_RESUME_260').val(userId);
  150. add();
  151. }else{
  152. if(name==""){
  153. top.Dialog.alert("姓名不能为空!");
  154. return;
  155. }
  156. if(sex==""){
  157. top.Dialog.alert("请选择性别!");
  158. return;
  159. }
  160. if(birthday1==""){
  161. top.Dialog.alert("出生年月不能为空!");
  162. return;
  163. }
  164. if(cal==""){
  165. top.Dialog.alert("手机不能为空!");
  166. return;
  167. }
  168. // if(area==""){
  169. // top.Dialog.alert("所属区域不能为空!");
  170. // return;
  171. // }
  172. if(comp==""){
  173. top.Dialog.alert("原所属单位不能为空!");
  174. return;
  175. }
  176. if(worktime==""){
  177. top.Dialog.alert("参加工作时间不能为空!");
  178. return;
  179. }
  180. // if(type==""){
  181. // top.Dialog.alert("职称不能为空!");
  182. // return;
  183. // }
  184. // if(post==""){
  185. // top.Dialog.alert("职务不能为空!");
  186. // return;
  187. // }
  188. // if(address==""){
  189. // top.Dialog.alert("住址不能为空!");
  190. // return;
  191. // }
  192. if(specialty==""){
  193. top.Dialog.alert("专业特长不能为空!");
  194. return;
  195. }
  196. if(ident==""){
  197. top.Dialog.alert("认定时间不能为空!");
  198. return;
  199. }
  200. top.Dialog.alert('请检查标红输入框!');
  201. }
  202. }
  203. //新增
  204. function add(){
  205. $("body").eq(0).showLoading();
  206. var $form=$("#fillForm");
  207. var formValue = $form.serialize();
  208. var url = $.pathname() +"/ws/uploadForm/FileUpDownService/asyncFileUpLoad";
  209. $.request.add(url,formValue,function(data){
  210. $("body").eq(0).hideLoading();
  211. top.Dialog.alert(data.Msg.info);
  212. var url = "/nwyj/page/business/am/resource/expert/"+"expert-maintenance.jsp";
  213. top.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
  214. });
  215. }
  216. //重置
  217. function resetSearch(){
  218. document.location.reload();
  219. }
  220. //返回
  221. function goBack() {
  222. // top.Dialog.confirm("您已修改了表单,是否需要离开?|离开", function() {
  223. var url = "/nwyj/page/business/am/resource/expert/"+"expert-maintenance.jsp";
  224. var len = $(parent.parent.window.document).find("#frmrightChild").length;
  225. if(len===0){
  226. top.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
  227. }else{
  228. $(parent.parent.window.document).find("#frmrightChild").attr("src",""+encodeURI(url));
  229. }
  230. // });
  231. }
  232. $.messager=top.Dialog;