123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883 |
- var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- var clickNum = 0;
- $(function(){
- //重设高度
- // $(parent.document.body).find("iframe").height($(window.document.body).height()+30);
- // $(top.document.body).find("iframe").height($(window.document.body).height()+30);
- //初始加载
- /** 下拉框加载 */
- // $('#IS_SNSTAFF_260').initCanstSelect('BM_YesNo');
- // $('#EXPERT_SEX_260').initCanstSelect('BM_Gender');
- // $('#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');
-
- //初始加载
- // getChildInfo();
-
- // var AreaSql = "select DEPT_ID,PARENT_ID,DEPT_NAME from SYS_DEPARTMENT";//sys_department_0827
-
- //所属公司
- // 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":"'+ deptId +'"}');
- // //异步加载请求地址
- // $("#AcceptUserTree").attr('url',deptUrl);
- // //初始化单位树
- // $.post(deptUrl,{"id":deptId},function(data){
- // $("#AcceptUserTree").data("data",data);
- // $("#AcceptUserTree").render();
- // }, "json");
-
- /** 绑定更多的按钮点击事件 */
- $more = $("#more"); // 更多按钮
- $more.bind('click', function() {
- more();
- /*$(parent.document.body).find("iframe").height($(window.document.body).height()+30);
- $(top.document.body).find("iframe").height($(window.document.body).height()+30);*/
- });
- // $searchButt = $("#searchButt");// 更多查询按钮
- // $searchButt.live('click', function() {
- // searchHandler();
- // });
- $searchOne = $("#searchOne");//查询图标绑定查询事件
- $searchOne.bind('click', function() {
- searchHandler2();
- });
- });
- function getChildInfo(){
- var url = $.pathname() + '/ws/PlanHuiZong/ContingencyPlanHuiZong/getresourXj/';
- var params = {
- id : deptId,
- value:"EXPERT_UNIT"
- };
- $.ajax({
- url : url,
- type : 'post',
- timeout : 60000,
- data : params,
- dataType : 'json',
- success : function(data){
- var conditionData3 = JSON.stringify(data);
- var test = eval("("+conditionData3+")");
- if(conditionData3!='{"list":[{"name":"查询单位","className":"EXPERT_UNIT","equalType":"equal","list":[]}]}'){
- conditionData.list.push(test.list[0]);
- }
- createConditionsDom(conditionData);
- $(".item").unbind("click").bind("click",bindSelectOne);
- },
- error : function(e){
- $.messager.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
- }
- var g;
- /**定义变量**/
- var condition = "IS_DEL='0' AND EXPERT_UNIT IN ('"+ deptId +"')";
- //列表加载参数
- var loadParams = {
- "listId" : '260',
- "condition" : condition,
- direction:'DESC',
- sort: 'UPDATEDATE'
- };
- function initComplete(){
- /**
- * 工具条
- */
- var roleCons = roleButtonArr();
- var toolBarOpt1 = {
- items:[
- {text: '新增', click: "addUnit", iconClass: 'add1_tem' ,id:"rcxz"},
- {text: '删除', click: "deleteUnit", iconClass: 'delete_tem' ,id:"rcsc"},
- {text: '修改', click: "updateUnit", iconClass: 'update_tem' ,id:"rcxg"},
- // {text: '查看', click: "onView", iconClass: 'view_tem' ,id:"10003"},
- {text: '导入', click: "showImportDialog", iconClass: 'import_tem' ,id:"rcdr"},
- {text: '导出', click: "exportTotalData", iconClass: 'export_tem' ,id:"10006"},
- //{text: '历史维护记录', click: "historyUnit", iconClass: 'history_tem' ,id:"10201"},
- //{text: '下载', click: "onDownload", iconClass: 'download_tem' ,id:"10007"},
- {text: '统计', click: "sumUnit", iconClass: 'poll_tem' ,id:"10200"},
- {text: '查看本级单位专家', click: "showSameLevel", iconClass: 'poll_tem' ,id:"10007"}
- // {text: '横向查看', click: "tempValue", iconClass: 'history_tem',id:"10206"}
- ],
- roleCons:roleCons
- };
- /**
- * 树形列
- */
- var grid_option1 = {
- columns: [
- //{ name: 'FD_OBJECTID260', hide : true},
- // { display: '序号', name: 'EXPERT_ID_260', align: 'center', width: "5%"},
- { display: '姓名', name: 'EXPERT_NAME_260', align: 'center', width: "10%",isPrimaryKey:true,
- // render : function(rowdata, value) {
- // return '<a href="javascript:void(0)" '
- // + 'onclick=jumpPage("'
- // + rowdata.FD_OBJECTID260
- // +'")>'+ rowdata.EXPERT_NAME_260 +'</a>';
- // }
- render : function(rowdata, rowindex, value, column) {
- return "<a href='javascript:;' style='width:100%;height:100%;display:block' title='" + value + "' onclick='openDetail(" + rowindex + ")'>" + value + "</a>";
- }
- },
- { display: '性别', name: 'EXPERT_SEX_260_SHOW', align: 'center', width: "10%",showTitle:true},
- // { display: '出生年月', name: 'EXPERT_BIRTHDAY_260', align: 'center', width: "5%",showTitle:true},
- // { display: '座机', name: 'EXPERT_TEL_260', align: 'center', width: "10%",showTitle:true},
- { display: '手机', name: 'EXPERT_CAL_260', align: 'center' , width: "10%",showTitle:true},
- // { display: 'Email', name: 'EXPERT_EMAIL_260', align: 'center', width: "5%",showTitle:true},
- // { display: '学历', name: 'EDUCATION_260_SHOW', align: 'center', width: "5%",showTitle:true},
- { display: '所属区域', name: 'EXPERT_AREA_260', align: 'center' , width: "10%",showTitle:true},
- { display: '所属单位', name: 'EXPERT_UNIT_260_SHOW', align: 'center', width: "10%" ,showTitle:true},
- { display: '是否南网员工', name: 'IS_SNSTAFF_260_SHOW', align: 'center', width: "10%" ,showTitle:true},
- // { display: '参加工作时间', name: 'WORK_TIME_260', align: 'center', width: "10%",showTitle:true},
- { display: '职称', name: 'EXPERT_TYPE_260_SHOW', align: 'center', width: "10%",showTitle:true},
- { display: '职务', name: 'EXPERT_POST_260_SHOW', align: 'center', width: "10%",showTitle:true},
- // { display: '住址', name: 'EXPERT_ADDRESS_260', align: 'center', width: "5%" ,showTitle:true},
- // { display: '住址邮编', name: 'EXPERT_POSTALCODE_260', align: 'center', width: "5%",showTitle:true},
- { display: '专业特长', name: 'EXPERT_SPECIALTY_260_SHOW', align: 'center', width: "10%" ,showTitle:true},
- // { display: '应急处理经验', name: 'EXPERT_EXP_260', align: 'center', width: "5%",showTitle:true},
- // { display: '变更说明', name: 'CHANGE_DESCRIPTION_260', align: 'center', width: "5%",showTitle:true},
- { display: '变更类型', name: 'CHANGE_TYPE_260_SHOW', align: 'center', width: "10%",showTitle:true}
- // { display: '认定时间', name: 'IDENTIFICATION_TIME_260', align: 'center', width: "5%",showTitle:true},
- //{ display: '工作简历', name: 'EXPERT_RESUME_260', align: 'center', width: "150px",showTitle:true}
- ],
- rownumbers : true,
- checkbox : true,
- pageSize : 10,
- percentWidthMode : true,
- onAfterShowData:function(data){
- setHt();
- }
- };
- var options1={
- url :'/nwyj/ws/crud/CRUDService/queryQui',
- params:loadParams,
- height: '100%',
- width:"100%",
- gridOptions:grid_option1,
- singleRecodeOptions:{a:"aa"},
- paperOpration:{showInput:"true"},
- toolBarOptions:toolBarOpt1
- };
- g=gridAndSingleRecode=$("#maingrid").quickgridAndSingleRecode(options1);
- }
- //下载
- function onDownload(){
- var rows = g.getSelectedRows();
- if (rows.length == 0) {
- top.Dialog.alert("请选择一条记录");
- return;
- }
- if (rows.length > 1) {
- top.Dialog.alert("只能选择一条记录");
- return;
- }
- var fd_id = rows[0].FD_OBJECTID260;
- showFile(fd_id);
-
- }
- function showFile(fd_id){
- var diag = new top.Dialog();// 定义一个窗口对象
- diag.Title = "下载";// 窗口标题
- diag.URL = $.pathname() +"/page/business/am/base/showDownloadFile.html?fd_id="+fd_id;// 窗口对应的页面
- diag.Height = 400;
- diag.ShowOkButton=false;// 不显示确认按钮
- diag.ShowCancelButton=false;// 不显示取消按钮
- diag.ButtonAlign="center";// 按钮居中
- diag.show();// 显示窗口
- }
-
- //点击查看
- function jumpPage(id){
- window.location.href="expertinfo.jsp?"+id;
- }
- function showPrimaryKey(obj,index){
- var fd_id = obj.FD_OBJECTID260;
- // window.location.href="expertinfo.jsp?"+fd_id;
- $.indexOpenNextWindow("/nwyj/page/business/am/resource/expert/expertinfo.jsp?"+fd_id);
- }
- //查询
- // function searchHandler(){
- //
- // var name = $('#EXPERT_NAME_260').val();//专家姓名
- // var isstaff = $('#IS_SNSTAFF_260').val();//是否南网
- // var sex = $('#EXPERT_SEX_260').val();//性别
- // var education = $('#EDUCATION_260').val();//学历
- // var area = $('#EXPERT_AREA_260').val();//区域
- // var unit = $('#AcceptUserTree').attr('relValue');//单位
- // var type = $('#EXPERT_TYPE_260').val();//职称
- // var post = $('#EXPERT_POST_260').val();//职务
- // var specialty = $('#EXPERT_SPECIALTY_260').val();//专业
- // var change = $('#CHANGE_TYPE_260').val();//更改类型
- //
- // //时间区间
- // var birthday1 = $('#BIRTHDAY1').val();
- // var birthday2 = $('#BIRTHDAY2').val();
- // var worktime1 = $('#WORK_TIME1').val();
- // var worktime2 = $('#WORK_TIME2').val();
- // var identification1 = $('#IDENTIFICATION1').val();
- // var identification2 = $('#IDENTIFICATION2').val();
- //
- //
- // var condition = "IS_DEL='0'";
- // if(name!=""){
- // condition += " AND EXPERT_NAME LIKE '%" +name+"%'";
- // }
- // if(isstaff != ""){
- // condition += " AND IS_SNSTAFF = '" +isstaff+"' ";
- // }
- // if(sex != ""){
- // condition += " AND EXPERT_SEX = '" +sex+"' ";
- // }
- // if(education != ""){
- // condition += " AND EDUCATION = '" + education +"' ";
- // }
- // if(area != ""){
- // condition += " AND EXPERT_AREA LIKE '%" + area +"%'";
- // }
- // if(unit !=""){
- // condition += " AND EXPERT_UNIT = '" + unit + "' ";
- // }
- //
- // if(type !=""){
- // condition += " AND EXPERT_TYPE = '" + type + "' ";
- // }
- // if(post !=""){
- // condition += " AND EXPERT_POST = '" + post + "' ";
- // }
- // if(specialty !=""){
- // condition += " AND EXPERT_SPECIALTY = '" + specialty + "' ";
- // }
- // if(change !=""){
- // condition += " AND CHANGE_TYPE = '" + change + "' ";
- // }
- // //生日
- // if(birthday1!="" && birthday2!=""){
- // condition += " AND EXPERT_BIRTHDAY BETWEEN '" + birthday1 +"' AND '" + birthday2 + "' ";
- // }
- // if(birthday1!="" && birthday2==""){
- // condition += " AND EXPERT_BIRTHDAY >= '" + birthday1 +"' " ;
- // }
- // if(birthday1=="" && birthday2!=""){
- // condition += " AND EXPERT_BIRTHDAY <= '" + birthday2 + "' ";
- // }
- // //工作日期
- // if(worktime1!="" && worktime2!=""){
- // condition += " AND EXPERT_BIRTHDAY BETWEEN '" + worktime1 +"' AND '" + worktime2 + "' ";
- // }
- // if(worktime1!="" && worktime2==""){
- // condition += " AND EXPERT_BIRTHDAY >= '" + worktime1 +"' " ;
- // }
- // if(worktime1=="" && worktime2!=""){
- // condition += " AND EXPERT_BIRTHDAY <= '" + worktime2 + "' ";
- // }
- // //认证日期
- // if(identification1!="" && identification2!=""){
- // condition += " AND EXPERT_BIRTHDAY BETWEEN '" + identification1 +"' AND '" + identification2 + "' ";
- // }
- // if(identification1!="" && identification2==""){
- // condition += " AND EXPERT_BIRTHDAY >= '" + identification1 +"' " ;
- // }
- // if(identification1=="" && identification2!=""){
- // condition += " AND EXPERT_BIRTHDAY <= '" + identification2 + "' ";
- // }
- // if(unit==""){
- // condition += " AND EXPERT_UNIT IN ('"+ deptId +"')"; //不能用全局变量
- // }
- //
- // g.setOptions({//重置加载列表的参数
- //
- // params : {
- // "listId" :'260' ,
- // "condition" : condition,
- // direction:'DESC',
- // sort: 'UPDATEDATE'
- // }
- // });
- //
- //// g.setNewPage(1);回到第一页 等俊鹏那边重写完善
- // g.rend();//重新加载
- // }
-
-
- function showSameLevel(){
- if(zTreeCompId == ""){
- top.Dialog.alert("请在左侧菜单选择单位再查看专家信息!");
- return;
- }
- clickNum++;
- if(clickNum % 2 !=0){
- $("#10007").addClass("blue");
- $("#10007 span").text("查看本级单位专家(含下级)");
- var condition = "IS_DEL='0' AND EXPERT_UNIT IN ('"+ zTreeCompId +"')";
- g.setOptions({//重置加载列表的参数
- params : {
- "listId" :'260' ,
- "condition" : condition,
- direction:'DESC',
- sort: 'UPDATEDATE'
- }
- });
- }else{
- $("#10007").removeClass("blue");
- $("#10007 span").text("查看本级单位专家");
- var condition="EXPERT_UNIT IN (select dept_id from sys_department where dept_path like '%"+zTreeCompId+"%') and IS_DEL = '0'";
- g.setOptions({//重置加载列表的参数
- params : {
- "listId" :'260' ,
- "condition" : condition,
- direction:'DESC',
- sort: 'UPDATEDATE'
- }
- });
- }
- g.rend();
- }
-
- function searchHandler(){
-
- $queryForm = $("#queryForm");
- if($("#EXPERT_NAME_260").val()=="请输入专家姓名"){
- $("#EXPERT_NAME_260").val("");
- }
- $queryForm.serialize();
- var $comp_id = $("#selectConditions").find(".EXPERT_UNIT");
- var loadParams11;
- //判断是否有用单位做查询条件
- if(!!$comp_id.prop("outerHTML")){
-
- loadParams11 = {
- "listId" : '260',
- "condition" : " IS_DEL='0'",
- direction:'DESC',
- sort: 'UPDATEDATE'
- };
- }else{
-
- loadParams11 = $.extend({},loadParams,loadParams);
- }
- //获取选中的值
- var searchCondition = getSelectCon(conditionData);
- var queryParams = getQueryFormParams($queryForm);//拼接出来的条件
- var params=$.extend({},loadParams11,queryParams);// 默认
- //与之前参数条件拼接
- params.condition = searchCondition.condition + params.condition;
- // alert(JSON.stringify(params));
- g.setOptions({"params":params});
- //加载数据
- g.rend();
- }
- function searchHandler2(){
-
- $queryForm = $("#queryForm");
- if($("#EXPERT_NAME_260").val()=="请输入专家姓名"){
- $("#EXPERT_NAME_260").val("");
- }
-
- var EXPERT_NAME_260 = $("#EXPERT_NAME_260").val();
- var BIRTHDAY_DATE1 = $('#BIRTHDAY_DATE1').val();
- var BIRTHDAY_DATE2 = $('#BIRTHDAY_DATE2').val();
- var TAKE_DATE1 = $('#TAKE_DATE1').val();
- var TAKE_DATE2 = $('#TAKE_DATE2').val();
- var ISSUE_DATE1 = $('#ISSUE_DATE1').val();
- var ISSUE_DATE2 = $('#ISSUE_DATE2').val();
-
-
- var condition = "";
- if(zTreeCompId==""){
- condition = "IS_DEL='0' AND EXPERT_UNIT IN ('"+ deptId +"')";
- }else{
- condition = "IS_DEL='0' AND EXPERT_UNIT IN ('"+ zTreeCompId +"')";
- }
-
- if(EXPERT_NAME_260!=""){
- condition += " AND EXPERT_NAME LIKE '%" +EXPERT_NAME_260+"%'";
- }
- /***************************************时间****************************************/
- if((BIRTHDAY_DATE1!=""&&BIRTHDAY_DATE2=="")||(BIRTHDAY_DATE1==""&&BIRTHDAY_DATE2!="")){
- top.Dialog.alert("出生年月的开始日期或结束日期不能为空");
- return;
- }else if(BIRTHDAY_DATE1>BIRTHDAY_DATE2){
- top.Dialog.alert("出生年月的开始日期不能晚于结束日期");
- return;
- }else if(BIRTHDAY_DATE1!=""&&BIRTHDAY_DATE2!=""){
- condition += " AND EXPERT_BIRTHDAY BETWEEN '"+BIRTHDAY_DATE1+"' AND '"+BIRTHDAY_DATE2+"' ";
- }
-
- if((TAKE_DATE1!=""&&TAKE_DATE2=="")||(TAKE_DATE1==""&&TAKE_DATE2!="")){
- top.Dialog.alert("参加工作时间的开始日期或结束日期不能为空");
- return;
- }else if(TAKE_DATE1>TAKE_DATE2){
- top.Dialog.alert("参加工作时间的开始日期不能晚于结束日期");
- return;
- }else if(TAKE_DATE1!=""&&TAKE_DATE2!=""){
- condition += " AND WORK_TIME BETWEEN '"+TAKE_DATE1+"' AND '"+TAKE_DATE2+"' ";
- }
-
- if((ISSUE_DATE1!=""&&ISSUE_DATE2=="")||(ISSUE_DATE1==""&&ISSUE_DATE2!="")){
- top.Dialog.alert("认定时间的开始日期或结束日期不能为空");
- return;
- }else if(ISSUE_DATE1>ISSUE_DATE2){
- top.Dialog.alert("认定时间的开始日期不能晚于结束日期");
- return;
- }else if(ISSUE_DATE1!=""&&ISSUE_DATE2!=""){
- condition += " AND IDENTIFICATION_TIME BETWEEN '"+ISSUE_DATE1+"' AND '"+ISSUE_DATE2+"' ";
- }
- /************************************************************************/
-
- /****************************************复选框查询******************************************/
- //是否南网员工
- var IS_SNSTAFF = "";
- $("input:checkbox[name=IS_SNSTAFF]").each(function(){
- if($(this).attr("checked")){
- if($(this).val()=="0000"){
- IS_SNSTAFF += " IS_SNSTAFF = '1' or IS_SNSTAFF = '0' or ";
- }else{
- IS_SNSTAFF += "IS_SNSTAFF = '" + $(this).val() +"' or ";
- }
- }
- });
- if(IS_SNSTAFF!=""){
- IS_SNSTAFF = IS_SNSTAFF.substring(0,IS_SNSTAFF.lastIndexOf("or"));
- condition += " and ("+IS_SNSTAFF+") ";
- }
-
- //性别
- var EXPERT_SEX = "";
- $("input:checkbox[name=EXPERT_SEX]").each(function(){
- if($(this).attr("checked")){
- if($(this).val()=="0000"){
- EXPERT_SEX += " EXPERT_SEX = '1' or EXPERT_SEX = '0' or ";
- }else{
- EXPERT_SEX += "EXPERT_SEX = '" + $(this).val() +"' or ";
- }
- }
- });
- if(EXPERT_SEX!=""){
- EXPERT_SEX = EXPERT_SEX.substring(0,EXPERT_SEX.lastIndexOf("or"));
- condition += " and ("+EXPERT_SEX+") ";
- }
-
- //学历
- var EDUCATION = "";
- $("input:checkbox[name=EDUCATION]").each(function(){
- if($(this).attr("checked")){
- if($(this).val()=="0000"){
- EDUCATION += " EDUCATION = '1' or EDUCATION = '2' or EDUCATION = '3' or EDUCATION = '4' or ";
- }else{
- EDUCATION += "EDUCATION = '" + $(this).val() +"' or ";
- }
- }
- });
- if(EDUCATION!=""){
- EDUCATION = EDUCATION.substring(0,EDUCATION.lastIndexOf("or"));
- condition += " and ("+EDUCATION+") ";
- }
-
- //职称
- var EXPERT_TYPE = "";
- $("input:checkbox[name=EXPERT_TYPE]").each(function(){
- if($(this).attr("checked")){
- if($(this).val()=="0000"){
- EXPERT_TYPE += " EXPERT_TYPE = '1' or EXPERT_TYPE = '2' or EXPERT_TYPE = '3' or ";
- }else{
- EXPERT_TYPE += "EXPERT_TYPE = '" + $(this).val() +"' or ";
- }
- }
- });
- if(EXPERT_TYPE!=""){
- EXPERT_TYPE = EXPERT_TYPE.substring(0,EXPERT_TYPE.lastIndexOf("or"));
- condition += " and ("+EXPERT_TYPE+") ";
- }
-
- //职务
- var EXPERT_POST = "";
- $("input:checkbox[name=EXPERT_POST]").each(function(){
- if($(this).attr("checked")){
- if($(this).val()=="0000"){
- EXPERT_POST += " EXPERT_POST = '1' or EXPERT_POST = '2' or EXPERT_POST = '3' or EXPERT_POST = '4' or ";
- }else{
- EXPERT_POST += "EXPERT_POST = '" + $(this).val() +"' or ";
- }
- }
- });
- if(EXPERT_POST!=""){
- EXPERT_POST = EXPERT_POST.substring(0,EXPERT_POST.lastIndexOf("or"));
- condition += " and ("+EXPERT_POST+") ";
- }
-
- //专业特长
- var EXPERT_SPECIALTY = "";
- $("input:checkbox[name=EXPERT_SPECIALTY]").each(function(){
- if($(this).attr("checked")){
- if($(this).val()=="0000"){
- EXPERT_SPECIALTY += " EXPERT_SPECIALTY = '1' or EXPERT_SPECIALTY = '2' or EXPERT_SPECIALTY = '3' or EXPERT_SPECIALTY = '4' or EXPERT_SPECIALTY = '5' or EXPERT_SPECIALTY = '6' or " +
- "EXPERT_SPECIALTY = '7' or EXPERT_SPECIALTY = '8' or EXPERT_SPECIALTY = '9' or EXPERT_SPECIALTY = '10' or EXPERT_SPECIALTY = '11' or EXPERT_SPECIALTY = '12' or ";
- }else{
- EXPERT_SPECIALTY += "EXPERT_SPECIALTY = '" + $(this).val() +"' or ";
- }
- }
- });
- if(EXPERT_SPECIALTY!=""){
- EXPERT_SPECIALTY = EXPERT_SPECIALTY.substring(0,EXPERT_SPECIALTY.lastIndexOf("or"));
- condition += " and ("+EXPERT_SPECIALTY+") ";
- }
-
- //变更类型
- var CHANGE_TYPE = "";
- $("input:checkbox[name=CHANGE_TYPE]").each(function(){
- if($(this).attr("checked")){
- if($(this).val()=="0000"){
- CHANGE_TYPE += " CHANGE_TYPE = '1' or CHANGE_TYPE = '2' or ";
- }else{
- CHANGE_TYPE += "CHANGE_TYPE = '" + $(this).val() +"' or ";
- }
- }
- });
- if(CHANGE_TYPE!=""){
- CHANGE_TYPE = CHANGE_TYPE.substring(0,CHANGE_TYPE.lastIndexOf("or"));
- condition += " and ("+CHANGE_TYPE+") ";
- }
- /**********************************************************************************/
-
- // $queryForm.serialize();
- // var $comp_id = $("#selectConditions").find(".EXPERT_UNIT");
- // var loadParams11;
- // //判断是否有用单位做查询条件
- // if(!!$comp_id.prop("outerHTML")){
- //
- // loadParams11 = {
- // "listId" : '260',
- // "condition" : " IS_DEL='0'",
- // direction:'DESC',
- // sort: 'UPDATEDATE'
- // };
- // }else{
- //
- // loadParams11 = $.extend({},loadParams,loadParams);
- // }
- // //获取选中的值
- // var searchCondition = getSelectCon(conditionData);
- // var queryParams = getQueryFormParams($queryForm);//拼接出来的条件
- // var params=$.extend({},loadParams11,queryParams);// 默认
- // //与之前参数条件拼接
- // params.condition = searchCondition.condition + params.condition;
- //// alert(JSON.stringify(params));
- // g.setOptions({"params":params});
-
- g.setOptions({//重置加载列表的参数
- params : {
- "listId" :'260' ,
- "condition" : condition,
- direction:'DESC',
- sort: 'UPDATEDATE'
- }
- });
- //加载数据
- g.rend();
- }
-
- function resetSearch(){
- $('#EXPERT_NAME_260').val("");
- $('#BIRTHDAY_DATE1').val("");
- $('#BIRTHDAY_DATE2').val("");
- $('#TAKE_DATE1').val("");
- $('#TAKE_DATE2').val("");
- $('#ISSUE_DATE1').val("");
- $('#ISSUE_DATE2').val("");
- $("input:checkbox[name=IS_SNSTAFF]").attr("checked",false);
- $("input:checkbox[name=EXPERT_SEX]").attr("checked",false);
- $("input:checkbox[name=EDUCATION]").attr("checked",false);
- $("input:checkbox[name=EXPERT_TYPE]").attr("checked",false);
- $("input:checkbox[name=EXPERT_POST]").attr("checked",false);
- $("input:checkbox[name=EXPERT_SPECIALTY]").attr("checked",false);
- $("input:checkbox[name=CHANGE_TYPE]").attr("checked",false);
- }
-
- //监控模糊查询框
- // function check(){
- // var tValue="";
- // setInterval(function(event){
- // if(tValue!=$("#EXPERT_NAME_260").val()){
- // tValue=$("#EXPERT_NAME_260").val();
- // searchHandler();
- // }
- // },100);
- //
- // }
- //新增
- function addUnit(){
- window.location.href="expertadd.jsp";
- }
-
- //修改
- function updateUnit(){
- var rows = g.getSelectedRows();
- if(rows.length==0){
- top.Dialog.alert("请选择一条记录");
- return;
- }
- if(rows.length>1){
- top.Dialog.alert("只能选择一条记录");
- return;
- }
-
- var EXPERT_UNIT =rows[0].EXPERT_UNIT_260;
- if(deptId!=EXPERT_UNIT){
- top.Dialog.alert("只能维护本级单位的专家信息!");
- return;
- }
-
- var sys_is= rows[0].IS_SNSTAFF_260;
- var fd_id = rows[0].FD_OBJECTID260;
- var fd_id1 = rows[0].COLUMN_1_260;
- if(sys_is=="0")
- window.location.href="expertupdate.jsp?"+fd_id+"?"+fd_id1;
- else
- window.location.href="expertupdate-out.jsp?"+fd_id+"?"+fd_id1;
- }
-
- //删除
- function deleteUnit(){
- var rows = g.getSelectedRows();
- var rowsLength = rows.length;
- if (rowsLength == 0) {
- top.Dialog.alert("请选中要删除的记录!");
- return;
- }
- var ids = "";
- for ( var i = 0; i < rowsLength; i++) {
- ids += rows[i].FD_OBJECTID260 + ",";
- var EXPERT_UNIT =rows[i].EXPERT_UNIT_260;
- if(deptId!=EXPERT_UNIT){
- top.Dialog.alert("只能删除本级单位的专家信息!");
- return;
- }
- }
- top.Dialog.confirm("确定要删除吗?|删除", function() {
- // 删除记录
- $.post($.pathname() +"/ws/crud/CRUDService/delete/", {
- "objectIDs" : ids,
- classid : 260
- }, function(result) {
- if (result.Msg.sucsess == true) {
- $.messager.alert("删除成功",null,null,null,1);
- // 刷新表格数据
- g.rend();
- } else {
- top.Dialog.alert("删除失败!");
- }
- }, "json");
-
- });
- }
-
- //导入
- function showImportDialog(){
- window.location.href="expert-import.jsp";
- }
-
- //导出
- function exportTotalData(){
- var rows = g.getSelectedRows();
- var rowsLength = rows.length;
- if (rowsLength == 0) {
- top.Dialog.confirm("是否导出所有的应急专家信息?|确定", function() {
- excelExport(260,loadParams,"应急专家信息","IS_DEL,UPDATEDATE,FD_OBJECTID,EXPERT_RESUME,COLUMN_1,COLUMN_2,COLUMN_3");});
- return;
- }
- var ids = "";
- for ( var i = 0; i < rowsLength; i++) {
- ids += "'"+rows[i].FD_OBJECTID260+"'" + ",";
- }
- var temp = ids.substring(0,ids.length-1);
- var condition = " IS_DEL='0' ";
- condition += " AND FD_OBJECTID IN (" + temp + ") " ;
- var sql = {
- "listId" :'260' ,
- "condition" : condition,
- direction:'DESC',
- sort: 'UPDATEDATE'
- };
- excelExport(260,sql,"应急专家信息","IS_DEL,UPDATEDATE,FD_OBJECTID,EXPERT_RESUME,COLUMN_1,COLUMN_2,COLUMN_3");
-
- }
-
- //详情
- function onView(){
- var rows = g.getSelectedRows();
- if(rows.length==0){
- top.Dialog.alert("请选择一条记录");
- return;
- }
- if(rows.length>1){
- top.Dialog.alert("只能选择一条记录");
- return;
- }
- var fd_id = rows[0].FD_OBJECTID260;
- window.location.href="expertinfo.jsp?"+fd_id;
- }
- //点击主键跳转详细信息页面
- this.openDetail = function(rowindex) {
- var row = g.getRow(rowindex);
- var fd_id = row.FD_OBJECTID260;
- // window.location.href="expertinfo.jsp?"+fd_id;
- $.indexOpenNextWindow("/nwyj/page/business/am/resource/expert/expertinfo.jsp?"+fd_id);
- };
-
- //历史记录
- function historyUnit(){
- var rows = g.getSelectedRows();
- if(rows.length==0){
- top.Dialog.alert("请选择一条记录");
- return;
- }
- if(rows.length>1){
- top.Dialog.alert("只能选择一条记录");
- return;
- }
- //上一个版本的预案ID
- var fd_id = rows[0].COLUMN_1_260;
- var fd_id1 = rows[0].FD_OBJECTID260;
-
- window.location.href="expert-version.jsp?"+fd_id+"?"+fd_id1;
- }
- //专家统计
- function sumUnit(){
- window.location.href="expert-poll.jsp";
- }
-
-
- function more() {
- $('#moreDiv').toggle(400,function(){
- // $("#emptyCondition").click();
- // $(parent.document.body).find("iframe").height($(window.document.body).height()+30);
- // $(top.document.body).find("iframe").height($(window.document.body).height()+30);
- // setHt();
- checkAndSetHeight();//changeFormat.js
- });
- }
-
- function setHt(){
- /* alert($("#layout1 .padding_right5").height())
- alert($("#layout1 .selDiv").height());
- alert($(".l-layout-left").height()); */
- var leftHeight = $(".layout_content").height()+70;
- var rightHeight = $("#layout1 .adding_right5").height()+$("#layout1 #moreDiv").height()+70;
- var height = leftHeight>rightHeight?leftHeight:rightHeight;
- // $(window.document.body).height(height);
- $(top.document.body).find("#frmright").height($(window.document.body).height(height)+30);
- }
-
- $.messager=top.Dialog;
-
-
- //横向查看功能
- function tempValue(){
- var diag = new top.Dialog();
- diag.Title = "应急组织";
- diag.URL = $.pathname() + '/page/business/am/resource/ledger/readDept.jsp';
- diag.Width = 700;
- diag.Height = 500;
- diag.Top = "80%";
- diag.Left = "50%";
- diag.ShowButtonRow=true;
- diag.ButtonAlign = 'center';
- diag.OkButtonText="确 定";
- diag.OKEvent = function(){
- Validate(diag);
- };
- diag.show();
- }
- function Validate(diag){
-
- var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id()+""; //登录人ID
- var dept_name = top.com.sinosoft.lz.system.user.LoginInfo.getDeptnames(); //申请单位的名称
- var time1=diag.innerFrame.contentWindow.$("#time1").val();
- var time2=diag.innerFrame.contentWindow.$("#time2").val();
- var yuanyin=diag.innerFrame.contentWindow.$("#yuanyin").val();
- //获取zTree对象
- var zTree = diag.innerFrame.contentWindow.$.fn.zTree.getZTreeObj("tree-1");
- //得到选中的数据集
- var checkedNodes = zTree.getCheckedNodes(true);
- if(time1==""||time2==""){
- $.messager.alert('请选择申请查看权限的时间!');
- return;
- }
- if(time1>time2){
- $.messager.alert('请选择正确的申请查看权限的时间!');
- return;
- }
- if(yuanyin==""){
- $.messager.alert('请输入申请查看权限的原因!');
- return;
- }
- if(checkedNodes==""){
- $.messager.alert('请选择要申请查看的单位!');
- return;
- }
- var compValue="";
- var compValue2="";
- for(var i = 0; i < checkedNodes.length; i++){
- //机构名称
- compValue += checkedNodes[i].id + ",";
- compValue2 += checkedNodes[i].name+",";
- }
- var compid = compValue.substring(0,compValue.length-1);
- var compname = compValue2.substring(0,compValue2.length-1);
- //给第二个form的字段设置值
- $("#APPLY_PERSION_216").val(getUser_id);
- $("#COMPNAME_216").val(dept_name);
- $("#APPROVE_PERSION_216").val("暂时数据");
- $("#START_TIME_216").val(time1);
- $("#END_TIME_216").val(time2);
- $("#APPLY_CAUSE_216").val(yuanyin);
- $("#APPLY_COMPID_216").val(compid);//查看单位的ID
- $("#APPLY_COMPNAME_216").val(compname); //查看单位的名称
-
- var $form = $('#fillForm1');
- var url = $.pathname() + '/ws/crud/CRUDService/create';
- $.ajax({
- url : url,
- type : 'post',
- data : $form.serialize(),
- dataType : 'text',
- timeout : 60000,
- success : function(data){
- $.messager.alert("申请提交成功",null,null,null,-1);
- },
- error : function(){
- $.messager.alert('操作失败');
- }
- });
-
- top.Dialog.close();//关闭新增窗口
- }
-
-
|