123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268 |
- var deptName = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- $(function(){
- //初始加载
- /** 下拉框加载 */
- $('#EXPERT_SPECIALTY_260').initCanstSelect('BM_MAJOR');
- $('#CHANGE_TYPE_260').initCanstSelect('BM_CHANGETYPE');
- $('#EDUCATION_260').initCanstSelect('BM_EDUCATION');
- $('#EXPERT_TYPE_260').initCanstSelect('BM_JOBTITLE');
- $('#EXPERT_POST_260').initCanstSelect('BM_DUTIES');
-
- $('#EXPERT_UNIT_260').val(deptName);
-
- // var AreaSql = "select DEPT_ID,PARENT_ID,DEPT_NAME from SYS_DEPARTMENT";
-
- //所属公司
- // var treeUrl = $.pathname() + '/ws/sys/constantService/getTreeCanst/';
- // var params = {
- // sql:AreaSql
- // };
- // $.post(treeUrl,params,function(data){
- // $("#AcceptUserTree").data("data",data[0].constlist);
- // $("#AcceptUserTree").render();
- // }, "json");
- // //部门树的请求地址
- // var deptUrl =$.pathname() + '/ws/orgInDeptService/OrgInDeptService/getDeptRootById';
- // //添加额外属性主要用于最初的初始节点
- // $("#AcceptUserTree").attr('params','{"deptId":"'+deptName+'"}');
- // //异步加载请求地址
- // $("#AcceptUserTree").attr('url',deptUrl);
- // //初始化单位树
- // $.post(deptUrl,{"id":deptName},function(data){
- // $("#AcceptUserTree").data("data",data);
- // $("#AcceptUserTree").render();
- // }, "json");
-
-
-
- // var opts = {
- // fileNumLimit: 1,
- // fileSizeLimit: 200 * 1024 * 1024, // 200 M
- // fileSingleSizeLimit: 50 * 1024 * 1024, // 50 M
- // pick: {
- // id: '#filePicker',
- // label: '点击选择文件',
- // name : 'file'
- // },
- // dnd: '#dndArea',
- // paste: '#uploader',
- // chunked: false,
- // chunkSize: 512 * 1024,
- // disableGlobalDnd: true
- // };
- //
- // $('#fileDiv').getAsyncUploadFileContent(opts);
-
- /******************录入人信息start********************/
- /* 页面展示用 */
- //取登录用户信息
- //登录用户姓名 要调整,还是要用id
- var userName = top.com.sinosoft.lz.system.user.LoginInfo.getReal_name();
- $("#TYPEIN_PEOPLE").html(userName);
- //用户手机号
- var getMobile = top.com.sinosoft.lz.system.user.LoginInfo.getMobile();
- if(getMobile==undefined){
- $("#TYPEIN_PEOPLE_PHONE_NUM").html("暂无手机号码");
- }else{
- $("#TYPEIN_PEOPLE_PHONE_NUM").html(getMobile);
- }
- //用户所属单位
- var getCorp_names = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_names();
- $("#UNITE").html(getCorp_names);
- //用户所属部门
- var getDeptnames = top.com.sinosoft.lz.system.user.LoginInfo.getDeptnames();
- $("#DEPT").html(getDeptnames);
- /*****************录入人信息end*********************/
-
- $('#fileDiv').newAsyncFileUpload("",null,1);
-
- $("#goback").hover(function(){
- $(this).attr("src","/nwyj/images/temp/back_hover.png");
- },function(){
- $(this).attr("src","/nwyj/images/temp/back.png");
- });
- });
- //表单验证
- function validateForm(containerId){
- var seletedValue;
- if(document.getElementById("radio-1").checked){
- seletedValue = document.getElementById("radio-1").value;
- }else if(document.getElementById("radio-2").checked){
- seletedValue = document.getElementById("radio-2").value;
- }
- $('#EXPERT_SEX_260').val(seletedValue);
-
- var name = $("#EXPERT_NAME_260").val();
- var sex = $("#EXPERT_SEX_260").val();
- var birthday1 = $("#EXPERT_BIRTHDAY_260").val();
- var cal = $("#EXPERT_CAL_260").val();
- // var area = $("#EXPERT_AREA_260").val();
- // var unit = $("#AcceptUserTree").attr('relValue');
- var comp = $("#EXPERT_UNIT_260").val();
- var worktime = $("#WORK_TIME_260").val();
- // var type = $("#EXPERT_TYPE_260").val();
- // var post = $("#EXPERT_POST_260").val();
- // var address = $("#EXPERT_ADDRESS_260").val();
- var specialty = $("#EXPERT_SPECIALTY_260").val();
- var ident = $("#IDENTIFICATION_TIME_260").val();
-
- /* var file = $("#uploaderFileName").val();
- var tempFile = file.split(",");
- if(tempFile.length>1){
- top.Dialog.alert("只允许上传一个附件,请检查是否只上传了一个附件。");
- return;
- }
-
- if(file.length>300){
- top.Dialog.alert("您上传的附件名称太长,请重命名后上传。");
- return;
- }
-
- var d=/\.[^\.]+$/.exec(file);
- if(file!=""){
- if(d!=".doc"&&d!=".pdf"&&d!=".zip"&&d!=".docx"){
- top.Dialog.alert('您上传的文件格式不合法,请上传.doc、.pdf或.zip格式的文件!');
- return;
- }
- }*/
- //取文件的名称
- var files = document.getElementsByName("uploaderFileName");
- //取文件的类型
- var filetype = document.getElementsByName("uploaderFileExt");
-
- if(files.length>0){
- for(var i=0 ;i<files.length;i++ ){
- var d = filetype[i].value;
- if(d!="doc"&&d!="pdf"&&d!="zip"&&d!="docx"){
- top.Dialog.alert('您上传的文件格式不合法,请上传.doc、.pdf或.zip格式的文件!');
- return;
- }
- }
- }
-
- var valid = $(containerId).validationEngine({returnIsValid: true});
- if(valid == true){
-
- var birthday = $('#EXPERT_BIRTHDAY_260').val();
- var work = $('#WORK_TIME_260').val();
- var time =$('#IDENTIFICATION_TIME_260').val();
-
- if(birthday > work){
- $.messager.alert('生日不能比参加工作时间晚');
- return ;
- }
- if(work > time){
- $.messager.alert('参加工作时间不能比认证时间晚');
- return ;
- }
-
- // var file = $("#uploaderFileName").val();
- if(files.length>0){
- $('#COLUMN_2_260').val("1");
- }else{
- $('#COLUMN_2_260').val("0");
- }
- //录入人id
- var userId = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
- $('#EXPERT_RESUME_260').val(userId);
- add();
- }else{
- if(name==""){
- top.Dialog.alert("姓名不能为空!");
- return;
- }
- if(sex==""){
- top.Dialog.alert("请选择性别!");
- return;
- }
- if(birthday1==""){
- top.Dialog.alert("出生年月不能为空!");
- return;
- }
- if(cal==""){
- top.Dialog.alert("手机不能为空!");
- return;
- }
- // if(area==""){
- // top.Dialog.alert("所属区域不能为空!");
- // return;
- // }
- if(comp==""){
- top.Dialog.alert("原所属单位不能为空!");
- return;
- }
- if(worktime==""){
- top.Dialog.alert("参加工作时间不能为空!");
- return;
- }
- // if(type==""){
- // top.Dialog.alert("职称不能为空!");
- // return;
- // }
- // if(post==""){
- // top.Dialog.alert("职务不能为空!");
- // return;
- // }
- // if(address==""){
- // top.Dialog.alert("住址不能为空!");
- // return;
- // }
- if(specialty==""){
- top.Dialog.alert("专业特长不能为空!");
- return;
- }
- if(ident==""){
- top.Dialog.alert("认定时间不能为空!");
- return;
- }
- top.Dialog.alert('请检查标红输入框!');
- }
- }
- //新增
- function add(){
- $("body").eq(0).showLoading();
- var $form=$("#fillForm");
- var formValue = $form.serialize();
- var url = $.pathname() +"/ws/uploadForm/FileUpDownService/asyncFileUpLoad";
- $.request.add(url,formValue,function(data){
- $("body").eq(0).hideLoading();
- top.Dialog.alert(data.Msg.info);
- var url = "/nwyj/page/business/am/resource/expert/"+"expert-maintenance.jsp";
- top.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
- });
- }
-
-
-
-
- //重置
- function resetSearch(){
- document.location.reload();
- }
- //返回
- function goBack() {
- // top.Dialog.confirm("您已修改了表单,是否需要离开?|离开", function() {
- var url = "/nwyj/page/business/am/resource/expert/"+"expert-maintenance.jsp";
-
- var len = $(parent.parent.window.document).find("#frmrightChild").length;
- if(len===0){
-
- top.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
-
- }else{
- $(parent.parent.window.document).find("#frmrightChild").attr("src",""+encodeURI(url));
- }
- // });
- }
-
- $.messager=top.Dialog;
|