158b3b1adbebb269e7c8476d00561332afc04aec.svn-base 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883
  1. var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  2. var clickNum = 0;
  3. $(function(){
  4. //重设高度
  5. // $(parent.document.body).find("iframe").height($(window.document.body).height()+30);
  6. // $(top.document.body).find("iframe").height($(window.document.body).height()+30);
  7. //初始加载
  8. /** 下拉框加载 */
  9. // $('#IS_SNSTAFF_260').initCanstSelect('BM_YesNo');
  10. // $('#EXPERT_SEX_260').initCanstSelect('BM_Gender');
  11. // $('#EXPERT_SPECIALTY_260').initCanstSelect('BM_MAJOR');
  12. // $('#CHANGE_TYPE_260').initCanstSelect('BM_CHANGETYPE');
  13. // $('#EDUCATION_260').initCanstSelect('BM_EDUCATION');
  14. // $('#EXPERT_TYPE_260').initCanstSelect('BM_JOBTITLE');
  15. // $('#EXPERT_POST_260').initCanstSelect('BM_DUTIES');
  16. //初始加载
  17. // getChildInfo();
  18. // var AreaSql = "select DEPT_ID,PARENT_ID,DEPT_NAME from SYS_DEPARTMENT";//sys_department_0827
  19. //所属公司
  20. // var treeUrl = $.pathname() + '/ws/sys/constantService/getTreeCanst/';
  21. // var params = {
  22. // sql:AreaSql
  23. // };
  24. // $.post(treeUrl,params,function(data){
  25. // $("#AcceptUserTree").data("data",data[0].constlist);
  26. // $("#AcceptUserTree").render();
  27. // }, "json");
  28. //部门树的请求地址
  29. // var deptUrl =$.pathname() + '/ws/orgInDeptService/OrgInDeptService/getDeptRootById';
  30. // //添加额外属性主要用于最初的初始节点
  31. // $("#AcceptUserTree").attr('params','{"deptId":"'+ deptId +'"}');
  32. // //异步加载请求地址
  33. // $("#AcceptUserTree").attr('url',deptUrl);
  34. // //初始化单位树
  35. // $.post(deptUrl,{"id":deptId},function(data){
  36. // $("#AcceptUserTree").data("data",data);
  37. // $("#AcceptUserTree").render();
  38. // }, "json");
  39. /** 绑定更多的按钮点击事件 */
  40. $more = $("#more"); // 更多按钮
  41. $more.bind('click', function() {
  42. more();
  43. /*$(parent.document.body).find("iframe").height($(window.document.body).height()+30);
  44. $(top.document.body).find("iframe").height($(window.document.body).height()+30);*/
  45. });
  46. // $searchButt = $("#searchButt");// 更多查询按钮
  47. // $searchButt.live('click', function() {
  48. // searchHandler();
  49. // });
  50. $searchOne = $("#searchOne");//查询图标绑定查询事件
  51. $searchOne.bind('click', function() {
  52. searchHandler2();
  53. });
  54. });
  55. function getChildInfo(){
  56. var url = $.pathname() + '/ws/PlanHuiZong/ContingencyPlanHuiZong/getresourXj/';
  57. var params = {
  58. id : deptId,
  59. value:"EXPERT_UNIT"
  60. };
  61. $.ajax({
  62. url : url,
  63. type : 'post',
  64. timeout : 60000,
  65. data : params,
  66. dataType : 'json',
  67. success : function(data){
  68. var conditionData3 = JSON.stringify(data);
  69. var test = eval("("+conditionData3+")");
  70. if(conditionData3!='{"list":[{"name":"查询单位","className":"EXPERT_UNIT","equalType":"equal","list":[]}]}'){
  71. conditionData.list.push(test.list[0]);
  72. }
  73. createConditionsDom(conditionData);
  74. $(".item").unbind("click").bind("click",bindSelectOne);
  75. },
  76. error : function(e){
  77. $.messager.alert('系统提示信息', '访问服务失败!', 'error');
  78. }
  79. });
  80. }
  81. var g;
  82. /**定义变量**/
  83. var condition = "IS_DEL='0' AND EXPERT_UNIT IN ('"+ deptId +"')";
  84. //列表加载参数
  85. var loadParams = {
  86. "listId" : '260',
  87. "condition" : condition,
  88. direction:'DESC',
  89. sort: 'UPDATEDATE'
  90. };
  91. function initComplete(){
  92. /**
  93. * 工具条
  94. */
  95. var roleCons = roleButtonArr();
  96. var toolBarOpt1 = {
  97. items:[
  98. {text: '新增', click: "addUnit", iconClass: 'add1_tem' ,id:"rcxz"},
  99. {text: '删除', click: "deleteUnit", iconClass: 'delete_tem' ,id:"rcsc"},
  100. {text: '修改', click: "updateUnit", iconClass: 'update_tem' ,id:"rcxg"},
  101. // {text: '查看', click: "onView", iconClass: 'view_tem' ,id:"10003"},
  102. {text: '导入', click: "showImportDialog", iconClass: 'import_tem' ,id:"rcdr"},
  103. {text: '导出', click: "exportTotalData", iconClass: 'export_tem' ,id:"10006"},
  104. //{text: '历史维护记录', click: "historyUnit", iconClass: 'history_tem' ,id:"10201"},
  105. //{text: '下载', click: "onDownload", iconClass: 'download_tem' ,id:"10007"},
  106. {text: '统计', click: "sumUnit", iconClass: 'poll_tem' ,id:"10200"},
  107. {text: '查看本级单位专家', click: "showSameLevel", iconClass: 'poll_tem' ,id:"10007"}
  108. // {text: '横向查看', click: "tempValue", iconClass: 'history_tem',id:"10206"}
  109. ],
  110. roleCons:roleCons
  111. };
  112. /**
  113. * 树形列
  114. */
  115. var grid_option1 = {
  116. columns: [
  117. //{ name: 'FD_OBJECTID260', hide : true},
  118. // { display: '序号', name: 'EXPERT_ID_260', align: 'center', width: "5%"},
  119. { display: '姓名', name: 'EXPERT_NAME_260', align: 'center', width: "10%",isPrimaryKey:true,
  120. // render : function(rowdata, value) {
  121. // return '<a href="javascript:void(0)" '
  122. // + 'onclick=jumpPage("'
  123. // + rowdata.FD_OBJECTID260
  124. // +'")>'+ rowdata.EXPERT_NAME_260 +'</a>';
  125. // }
  126. render : function(rowdata, rowindex, value, column) {
  127. return "<a href='javascript:;' style='width:100%;height:100%;display:block' title='" + value + "' onclick='openDetail(" + rowindex + ")'>" + value + "</a>";
  128. }
  129. },
  130. { display: '性别', name: 'EXPERT_SEX_260_SHOW', align: 'center', width: "10%",showTitle:true},
  131. // { display: '出生年月', name: 'EXPERT_BIRTHDAY_260', align: 'center', width: "5%",showTitle:true},
  132. // { display: '座机', name: 'EXPERT_TEL_260', align: 'center', width: "10%",showTitle:true},
  133. { display: '手机', name: 'EXPERT_CAL_260', align: 'center' , width: "10%",showTitle:true},
  134. // { display: 'Email', name: 'EXPERT_EMAIL_260', align: 'center', width: "5%",showTitle:true},
  135. // { display: '学历', name: 'EDUCATION_260_SHOW', align: 'center', width: "5%",showTitle:true},
  136. { display: '所属区域', name: 'EXPERT_AREA_260', align: 'center' , width: "10%",showTitle:true},
  137. { display: '所属单位', name: 'EXPERT_UNIT_260_SHOW', align: 'center', width: "10%" ,showTitle:true},
  138. { display: '是否南网员工', name: 'IS_SNSTAFF_260_SHOW', align: 'center', width: "10%" ,showTitle:true},
  139. // { display: '参加工作时间', name: 'WORK_TIME_260', align: 'center', width: "10%",showTitle:true},
  140. { display: '职称', name: 'EXPERT_TYPE_260_SHOW', align: 'center', width: "10%",showTitle:true},
  141. { display: '职务', name: 'EXPERT_POST_260_SHOW', align: 'center', width: "10%",showTitle:true},
  142. // { display: '住址', name: 'EXPERT_ADDRESS_260', align: 'center', width: "5%" ,showTitle:true},
  143. // { display: '住址邮编', name: 'EXPERT_POSTALCODE_260', align: 'center', width: "5%",showTitle:true},
  144. { display: '专业特长', name: 'EXPERT_SPECIALTY_260_SHOW', align: 'center', width: "10%" ,showTitle:true},
  145. // { display: '应急处理经验', name: 'EXPERT_EXP_260', align: 'center', width: "5%",showTitle:true},
  146. // { display: '变更说明', name: 'CHANGE_DESCRIPTION_260', align: 'center', width: "5%",showTitle:true},
  147. { display: '变更类型', name: 'CHANGE_TYPE_260_SHOW', align: 'center', width: "10%",showTitle:true}
  148. // { display: '认定时间', name: 'IDENTIFICATION_TIME_260', align: 'center', width: "5%",showTitle:true},
  149. //{ display: '工作简历', name: 'EXPERT_RESUME_260', align: 'center', width: "150px",showTitle:true}
  150. ],
  151. rownumbers : true,
  152. checkbox : true,
  153. pageSize : 10,
  154. percentWidthMode : true,
  155. onAfterShowData:function(data){
  156. setHt();
  157. }
  158. };
  159. var options1={
  160. url :'/nwyj/ws/crud/CRUDService/queryQui',
  161. params:loadParams,
  162. height: '100%',
  163. width:"100%",
  164. gridOptions:grid_option1,
  165. singleRecodeOptions:{a:"aa"},
  166. paperOpration:{showInput:"true"},
  167. toolBarOptions:toolBarOpt1
  168. };
  169. g=gridAndSingleRecode=$("#maingrid").quickgridAndSingleRecode(options1);
  170. }
  171. //下载
  172. function onDownload(){
  173. var rows = g.getSelectedRows();
  174. if (rows.length == 0) {
  175. top.Dialog.alert("请选择一条记录");
  176. return;
  177. }
  178. if (rows.length > 1) {
  179. top.Dialog.alert("只能选择一条记录");
  180. return;
  181. }
  182. var fd_id = rows[0].FD_OBJECTID260;
  183. showFile(fd_id);
  184. }
  185. function showFile(fd_id){
  186. var diag = new top.Dialog();// 定义一个窗口对象
  187. diag.Title = "下载";// 窗口标题
  188. diag.URL = $.pathname() +"/page/business/am/base/showDownloadFile.html?fd_id="+fd_id;// 窗口对应的页面
  189. diag.Height = 400;
  190. diag.ShowOkButton=false;// 不显示确认按钮
  191. diag.ShowCancelButton=false;// 不显示取消按钮
  192. diag.ButtonAlign="center";// 按钮居中
  193. diag.show();// 显示窗口
  194. }
  195. //点击查看
  196. function jumpPage(id){
  197. window.location.href="expertinfo.jsp?"+id;
  198. }
  199. function showPrimaryKey(obj,index){
  200. var fd_id = obj.FD_OBJECTID260;
  201. // window.location.href="expertinfo.jsp?"+fd_id;
  202. $.indexOpenNextWindow("/nwyj/page/business/am/resource/expert/expertinfo.jsp?"+fd_id);
  203. }
  204. //查询
  205. // function searchHandler(){
  206. //
  207. // var name = $('#EXPERT_NAME_260').val();//专家姓名
  208. // var isstaff = $('#IS_SNSTAFF_260').val();//是否南网
  209. // var sex = $('#EXPERT_SEX_260').val();//性别
  210. // var education = $('#EDUCATION_260').val();//学历
  211. // var area = $('#EXPERT_AREA_260').val();//区域
  212. // var unit = $('#AcceptUserTree').attr('relValue');//单位
  213. // var type = $('#EXPERT_TYPE_260').val();//职称
  214. // var post = $('#EXPERT_POST_260').val();//职务
  215. // var specialty = $('#EXPERT_SPECIALTY_260').val();//专业
  216. // var change = $('#CHANGE_TYPE_260').val();//更改类型
  217. //
  218. // //时间区间
  219. // var birthday1 = $('#BIRTHDAY1').val();
  220. // var birthday2 = $('#BIRTHDAY2').val();
  221. // var worktime1 = $('#WORK_TIME1').val();
  222. // var worktime2 = $('#WORK_TIME2').val();
  223. // var identification1 = $('#IDENTIFICATION1').val();
  224. // var identification2 = $('#IDENTIFICATION2').val();
  225. //
  226. //
  227. // var condition = "IS_DEL='0'";
  228. // if(name!=""){
  229. // condition += " AND EXPERT_NAME LIKE '%" +name+"%'";
  230. // }
  231. // if(isstaff != ""){
  232. // condition += " AND IS_SNSTAFF = '" +isstaff+"' ";
  233. // }
  234. // if(sex != ""){
  235. // condition += " AND EXPERT_SEX = '" +sex+"' ";
  236. // }
  237. // if(education != ""){
  238. // condition += " AND EDUCATION = '" + education +"' ";
  239. // }
  240. // if(area != ""){
  241. // condition += " AND EXPERT_AREA LIKE '%" + area +"%'";
  242. // }
  243. // if(unit !=""){
  244. // condition += " AND EXPERT_UNIT = '" + unit + "' ";
  245. // }
  246. //
  247. // if(type !=""){
  248. // condition += " AND EXPERT_TYPE = '" + type + "' ";
  249. // }
  250. // if(post !=""){
  251. // condition += " AND EXPERT_POST = '" + post + "' ";
  252. // }
  253. // if(specialty !=""){
  254. // condition += " AND EXPERT_SPECIALTY = '" + specialty + "' ";
  255. // }
  256. // if(change !=""){
  257. // condition += " AND CHANGE_TYPE = '" + change + "' ";
  258. // }
  259. // //生日
  260. // if(birthday1!="" && birthday2!=""){
  261. // condition += " AND EXPERT_BIRTHDAY BETWEEN '" + birthday1 +"' AND '" + birthday2 + "' ";
  262. // }
  263. // if(birthday1!="" && birthday2==""){
  264. // condition += " AND EXPERT_BIRTHDAY >= '" + birthday1 +"' " ;
  265. // }
  266. // if(birthday1=="" && birthday2!=""){
  267. // condition += " AND EXPERT_BIRTHDAY <= '" + birthday2 + "' ";
  268. // }
  269. // //工作日期
  270. // if(worktime1!="" && worktime2!=""){
  271. // condition += " AND EXPERT_BIRTHDAY BETWEEN '" + worktime1 +"' AND '" + worktime2 + "' ";
  272. // }
  273. // if(worktime1!="" && worktime2==""){
  274. // condition += " AND EXPERT_BIRTHDAY >= '" + worktime1 +"' " ;
  275. // }
  276. // if(worktime1=="" && worktime2!=""){
  277. // condition += " AND EXPERT_BIRTHDAY <= '" + worktime2 + "' ";
  278. // }
  279. // //认证日期
  280. // if(identification1!="" && identification2!=""){
  281. // condition += " AND EXPERT_BIRTHDAY BETWEEN '" + identification1 +"' AND '" + identification2 + "' ";
  282. // }
  283. // if(identification1!="" && identification2==""){
  284. // condition += " AND EXPERT_BIRTHDAY >= '" + identification1 +"' " ;
  285. // }
  286. // if(identification1=="" && identification2!=""){
  287. // condition += " AND EXPERT_BIRTHDAY <= '" + identification2 + "' ";
  288. // }
  289. // if(unit==""){
  290. // condition += " AND EXPERT_UNIT IN ('"+ deptId +"')"; //不能用全局变量
  291. // }
  292. //
  293. // g.setOptions({//重置加载列表的参数
  294. //
  295. // params : {
  296. // "listId" :'260' ,
  297. // "condition" : condition,
  298. // direction:'DESC',
  299. // sort: 'UPDATEDATE'
  300. // }
  301. // });
  302. //
  303. //// g.setNewPage(1);回到第一页 等俊鹏那边重写完善
  304. // g.rend();//重新加载
  305. // }
  306. function showSameLevel(){
  307. if(zTreeCompId == ""){
  308. top.Dialog.alert("请在左侧菜单选择单位再查看专家信息!");
  309. return;
  310. }
  311. clickNum++;
  312. if(clickNum % 2 !=0){
  313. $("#10007").addClass("blue");
  314. $("#10007 span").text("查看本级单位专家(含下级)");
  315. var condition = "IS_DEL='0' AND EXPERT_UNIT IN ('"+ zTreeCompId +"')";
  316. g.setOptions({//重置加载列表的参数
  317. params : {
  318. "listId" :'260' ,
  319. "condition" : condition,
  320. direction:'DESC',
  321. sort: 'UPDATEDATE'
  322. }
  323. });
  324. }else{
  325. $("#10007").removeClass("blue");
  326. $("#10007 span").text("查看本级单位专家");
  327. var condition="EXPERT_UNIT IN (select dept_id from sys_department where dept_path like '%"+zTreeCompId+"%') and IS_DEL = '0'";
  328. g.setOptions({//重置加载列表的参数
  329. params : {
  330. "listId" :'260' ,
  331. "condition" : condition,
  332. direction:'DESC',
  333. sort: 'UPDATEDATE'
  334. }
  335. });
  336. }
  337. g.rend();
  338. }
  339. function searchHandler(){
  340. $queryForm = $("#queryForm");
  341. if($("#EXPERT_NAME_260").val()=="请输入专家姓名"){
  342. $("#EXPERT_NAME_260").val("");
  343. }
  344. $queryForm.serialize();
  345. var $comp_id = $("#selectConditions").find(".EXPERT_UNIT");
  346. var loadParams11;
  347. //判断是否有用单位做查询条件
  348. if(!!$comp_id.prop("outerHTML")){
  349. loadParams11 = {
  350. "listId" : '260',
  351. "condition" : " IS_DEL='0'",
  352. direction:'DESC',
  353. sort: 'UPDATEDATE'
  354. };
  355. }else{
  356. loadParams11 = $.extend({},loadParams,loadParams);
  357. }
  358. //获取选中的值
  359. var searchCondition = getSelectCon(conditionData);
  360. var queryParams = getQueryFormParams($queryForm);//拼接出来的条件
  361. var params=$.extend({},loadParams11,queryParams);// 默认
  362. //与之前参数条件拼接
  363. params.condition = searchCondition.condition + params.condition;
  364. // alert(JSON.stringify(params));
  365. g.setOptions({"params":params});
  366. //加载数据
  367. g.rend();
  368. }
  369. function searchHandler2(){
  370. $queryForm = $("#queryForm");
  371. if($("#EXPERT_NAME_260").val()=="请输入专家姓名"){
  372. $("#EXPERT_NAME_260").val("");
  373. }
  374. var EXPERT_NAME_260 = $("#EXPERT_NAME_260").val();
  375. var BIRTHDAY_DATE1 = $('#BIRTHDAY_DATE1').val();
  376. var BIRTHDAY_DATE2 = $('#BIRTHDAY_DATE2').val();
  377. var TAKE_DATE1 = $('#TAKE_DATE1').val();
  378. var TAKE_DATE2 = $('#TAKE_DATE2').val();
  379. var ISSUE_DATE1 = $('#ISSUE_DATE1').val();
  380. var ISSUE_DATE2 = $('#ISSUE_DATE2').val();
  381. var condition = "";
  382. if(zTreeCompId==""){
  383. condition = "IS_DEL='0' AND EXPERT_UNIT IN ('"+ deptId +"')";
  384. }else{
  385. condition = "IS_DEL='0' AND EXPERT_UNIT IN ('"+ zTreeCompId +"')";
  386. }
  387. if(EXPERT_NAME_260!=""){
  388. condition += " AND EXPERT_NAME LIKE '%" +EXPERT_NAME_260+"%'";
  389. }
  390. /***************************************时间****************************************/
  391. if((BIRTHDAY_DATE1!=""&&BIRTHDAY_DATE2=="")||(BIRTHDAY_DATE1==""&&BIRTHDAY_DATE2!="")){
  392. top.Dialog.alert("出生年月的开始日期或结束日期不能为空");
  393. return;
  394. }else if(BIRTHDAY_DATE1>BIRTHDAY_DATE2){
  395. top.Dialog.alert("出生年月的开始日期不能晚于结束日期");
  396. return;
  397. }else if(BIRTHDAY_DATE1!=""&&BIRTHDAY_DATE2!=""){
  398. condition += " AND EXPERT_BIRTHDAY BETWEEN '"+BIRTHDAY_DATE1+"' AND '"+BIRTHDAY_DATE2+"' ";
  399. }
  400. if((TAKE_DATE1!=""&&TAKE_DATE2=="")||(TAKE_DATE1==""&&TAKE_DATE2!="")){
  401. top.Dialog.alert("参加工作时间的开始日期或结束日期不能为空");
  402. return;
  403. }else if(TAKE_DATE1>TAKE_DATE2){
  404. top.Dialog.alert("参加工作时间的开始日期不能晚于结束日期");
  405. return;
  406. }else if(TAKE_DATE1!=""&&TAKE_DATE2!=""){
  407. condition += " AND WORK_TIME BETWEEN '"+TAKE_DATE1+"' AND '"+TAKE_DATE2+"' ";
  408. }
  409. if((ISSUE_DATE1!=""&&ISSUE_DATE2=="")||(ISSUE_DATE1==""&&ISSUE_DATE2!="")){
  410. top.Dialog.alert("认定时间的开始日期或结束日期不能为空");
  411. return;
  412. }else if(ISSUE_DATE1>ISSUE_DATE2){
  413. top.Dialog.alert("认定时间的开始日期不能晚于结束日期");
  414. return;
  415. }else if(ISSUE_DATE1!=""&&ISSUE_DATE2!=""){
  416. condition += " AND IDENTIFICATION_TIME BETWEEN '"+ISSUE_DATE1+"' AND '"+ISSUE_DATE2+"' ";
  417. }
  418. /************************************************************************/
  419. /****************************************复选框查询******************************************/
  420. //是否南网员工
  421. var IS_SNSTAFF = "";
  422. $("input:checkbox[name=IS_SNSTAFF]").each(function(){
  423. if($(this).attr("checked")){
  424. if($(this).val()=="0000"){
  425. IS_SNSTAFF += " IS_SNSTAFF = '1' or IS_SNSTAFF = '0' or ";
  426. }else{
  427. IS_SNSTAFF += "IS_SNSTAFF = '" + $(this).val() +"' or ";
  428. }
  429. }
  430. });
  431. if(IS_SNSTAFF!=""){
  432. IS_SNSTAFF = IS_SNSTAFF.substring(0,IS_SNSTAFF.lastIndexOf("or"));
  433. condition += " and ("+IS_SNSTAFF+") ";
  434. }
  435. //性别
  436. var EXPERT_SEX = "";
  437. $("input:checkbox[name=EXPERT_SEX]").each(function(){
  438. if($(this).attr("checked")){
  439. if($(this).val()=="0000"){
  440. EXPERT_SEX += " EXPERT_SEX = '1' or EXPERT_SEX = '0' or ";
  441. }else{
  442. EXPERT_SEX += "EXPERT_SEX = '" + $(this).val() +"' or ";
  443. }
  444. }
  445. });
  446. if(EXPERT_SEX!=""){
  447. EXPERT_SEX = EXPERT_SEX.substring(0,EXPERT_SEX.lastIndexOf("or"));
  448. condition += " and ("+EXPERT_SEX+") ";
  449. }
  450. //学历
  451. var EDUCATION = "";
  452. $("input:checkbox[name=EDUCATION]").each(function(){
  453. if($(this).attr("checked")){
  454. if($(this).val()=="0000"){
  455. EDUCATION += " EDUCATION = '1' or EDUCATION = '2' or EDUCATION = '3' or EDUCATION = '4' or ";
  456. }else{
  457. EDUCATION += "EDUCATION = '" + $(this).val() +"' or ";
  458. }
  459. }
  460. });
  461. if(EDUCATION!=""){
  462. EDUCATION = EDUCATION.substring(0,EDUCATION.lastIndexOf("or"));
  463. condition += " and ("+EDUCATION+") ";
  464. }
  465. //职称
  466. var EXPERT_TYPE = "";
  467. $("input:checkbox[name=EXPERT_TYPE]").each(function(){
  468. if($(this).attr("checked")){
  469. if($(this).val()=="0000"){
  470. EXPERT_TYPE += " EXPERT_TYPE = '1' or EXPERT_TYPE = '2' or EXPERT_TYPE = '3' or ";
  471. }else{
  472. EXPERT_TYPE += "EXPERT_TYPE = '" + $(this).val() +"' or ";
  473. }
  474. }
  475. });
  476. if(EXPERT_TYPE!=""){
  477. EXPERT_TYPE = EXPERT_TYPE.substring(0,EXPERT_TYPE.lastIndexOf("or"));
  478. condition += " and ("+EXPERT_TYPE+") ";
  479. }
  480. //职务
  481. var EXPERT_POST = "";
  482. $("input:checkbox[name=EXPERT_POST]").each(function(){
  483. if($(this).attr("checked")){
  484. if($(this).val()=="0000"){
  485. EXPERT_POST += " EXPERT_POST = '1' or EXPERT_POST = '2' or EXPERT_POST = '3' or EXPERT_POST = '4' or ";
  486. }else{
  487. EXPERT_POST += "EXPERT_POST = '" + $(this).val() +"' or ";
  488. }
  489. }
  490. });
  491. if(EXPERT_POST!=""){
  492. EXPERT_POST = EXPERT_POST.substring(0,EXPERT_POST.lastIndexOf("or"));
  493. condition += " and ("+EXPERT_POST+") ";
  494. }
  495. //专业特长
  496. var EXPERT_SPECIALTY = "";
  497. $("input:checkbox[name=EXPERT_SPECIALTY]").each(function(){
  498. if($(this).attr("checked")){
  499. if($(this).val()=="0000"){
  500. 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 " +
  501. "EXPERT_SPECIALTY = '7' or EXPERT_SPECIALTY = '8' or EXPERT_SPECIALTY = '9' or EXPERT_SPECIALTY = '10' or EXPERT_SPECIALTY = '11' or EXPERT_SPECIALTY = '12' or ";
  502. }else{
  503. EXPERT_SPECIALTY += "EXPERT_SPECIALTY = '" + $(this).val() +"' or ";
  504. }
  505. }
  506. });
  507. if(EXPERT_SPECIALTY!=""){
  508. EXPERT_SPECIALTY = EXPERT_SPECIALTY.substring(0,EXPERT_SPECIALTY.lastIndexOf("or"));
  509. condition += " and ("+EXPERT_SPECIALTY+") ";
  510. }
  511. //变更类型
  512. var CHANGE_TYPE = "";
  513. $("input:checkbox[name=CHANGE_TYPE]").each(function(){
  514. if($(this).attr("checked")){
  515. if($(this).val()=="0000"){
  516. CHANGE_TYPE += " CHANGE_TYPE = '1' or CHANGE_TYPE = '2' or ";
  517. }else{
  518. CHANGE_TYPE += "CHANGE_TYPE = '" + $(this).val() +"' or ";
  519. }
  520. }
  521. });
  522. if(CHANGE_TYPE!=""){
  523. CHANGE_TYPE = CHANGE_TYPE.substring(0,CHANGE_TYPE.lastIndexOf("or"));
  524. condition += " and ("+CHANGE_TYPE+") ";
  525. }
  526. /**********************************************************************************/
  527. // $queryForm.serialize();
  528. // var $comp_id = $("#selectConditions").find(".EXPERT_UNIT");
  529. // var loadParams11;
  530. // //判断是否有用单位做查询条件
  531. // if(!!$comp_id.prop("outerHTML")){
  532. //
  533. // loadParams11 = {
  534. // "listId" : '260',
  535. // "condition" : " IS_DEL='0'",
  536. // direction:'DESC',
  537. // sort: 'UPDATEDATE'
  538. // };
  539. // }else{
  540. //
  541. // loadParams11 = $.extend({},loadParams,loadParams);
  542. // }
  543. // //获取选中的值
  544. // var searchCondition = getSelectCon(conditionData);
  545. // var queryParams = getQueryFormParams($queryForm);//拼接出来的条件
  546. // var params=$.extend({},loadParams11,queryParams);// 默认
  547. // //与之前参数条件拼接
  548. // params.condition = searchCondition.condition + params.condition;
  549. //// alert(JSON.stringify(params));
  550. // g.setOptions({"params":params});
  551. g.setOptions({//重置加载列表的参数
  552. params : {
  553. "listId" :'260' ,
  554. "condition" : condition,
  555. direction:'DESC',
  556. sort: 'UPDATEDATE'
  557. }
  558. });
  559. //加载数据
  560. g.rend();
  561. }
  562. function resetSearch(){
  563. $('#EXPERT_NAME_260').val("");
  564. $('#BIRTHDAY_DATE1').val("");
  565. $('#BIRTHDAY_DATE2').val("");
  566. $('#TAKE_DATE1').val("");
  567. $('#TAKE_DATE2').val("");
  568. $('#ISSUE_DATE1').val("");
  569. $('#ISSUE_DATE2').val("");
  570. $("input:checkbox[name=IS_SNSTAFF]").attr("checked",false);
  571. $("input:checkbox[name=EXPERT_SEX]").attr("checked",false);
  572. $("input:checkbox[name=EDUCATION]").attr("checked",false);
  573. $("input:checkbox[name=EXPERT_TYPE]").attr("checked",false);
  574. $("input:checkbox[name=EXPERT_POST]").attr("checked",false);
  575. $("input:checkbox[name=EXPERT_SPECIALTY]").attr("checked",false);
  576. $("input:checkbox[name=CHANGE_TYPE]").attr("checked",false);
  577. }
  578. //监控模糊查询框
  579. // function check(){
  580. // var tValue="";
  581. // setInterval(function(event){
  582. // if(tValue!=$("#EXPERT_NAME_260").val()){
  583. // tValue=$("#EXPERT_NAME_260").val();
  584. // searchHandler();
  585. // }
  586. // },100);
  587. //
  588. // }
  589. //新增
  590. function addUnit(){
  591. window.location.href="expertadd.jsp";
  592. }
  593. //修改
  594. function updateUnit(){
  595. var rows = g.getSelectedRows();
  596. if(rows.length==0){
  597. top.Dialog.alert("请选择一条记录");
  598. return;
  599. }
  600. if(rows.length>1){
  601. top.Dialog.alert("只能选择一条记录");
  602. return;
  603. }
  604. var EXPERT_UNIT =rows[0].EXPERT_UNIT_260;
  605. if(deptId!=EXPERT_UNIT){
  606. top.Dialog.alert("只能维护本级单位的专家信息!");
  607. return;
  608. }
  609. var sys_is= rows[0].IS_SNSTAFF_260;
  610. var fd_id = rows[0].FD_OBJECTID260;
  611. var fd_id1 = rows[0].COLUMN_1_260;
  612. if(sys_is=="0")
  613. window.location.href="expertupdate.jsp?"+fd_id+"?"+fd_id1;
  614. else
  615. window.location.href="expertupdate-out.jsp?"+fd_id+"?"+fd_id1;
  616. }
  617. //删除
  618. function deleteUnit(){
  619. var rows = g.getSelectedRows();
  620. var rowsLength = rows.length;
  621. if (rowsLength == 0) {
  622. top.Dialog.alert("请选中要删除的记录!");
  623. return;
  624. }
  625. var ids = "";
  626. for ( var i = 0; i < rowsLength; i++) {
  627. ids += rows[i].FD_OBJECTID260 + ",";
  628. var EXPERT_UNIT =rows[i].EXPERT_UNIT_260;
  629. if(deptId!=EXPERT_UNIT){
  630. top.Dialog.alert("只能删除本级单位的专家信息!");
  631. return;
  632. }
  633. }
  634. top.Dialog.confirm("确定要删除吗?|删除", function() {
  635. // 删除记录
  636. $.post($.pathname() +"/ws/crud/CRUDService/delete/", {
  637. "objectIDs" : ids,
  638. classid : 260
  639. }, function(result) {
  640. if (result.Msg.sucsess == true) {
  641. $.messager.alert("删除成功",null,null,null,1);
  642. // 刷新表格数据
  643. g.rend();
  644. } else {
  645. top.Dialog.alert("删除失败!");
  646. }
  647. }, "json");
  648. });
  649. }
  650. //导入
  651. function showImportDialog(){
  652. window.location.href="expert-import.jsp";
  653. }
  654. //导出
  655. function exportTotalData(){
  656. var rows = g.getSelectedRows();
  657. var rowsLength = rows.length;
  658. if (rowsLength == 0) {
  659. top.Dialog.confirm("是否导出所有的应急专家信息?|确定", function() {
  660. excelExport(260,loadParams,"应急专家信息","IS_DEL,UPDATEDATE,FD_OBJECTID,EXPERT_RESUME,COLUMN_1,COLUMN_2,COLUMN_3");});
  661. return;
  662. }
  663. var ids = "";
  664. for ( var i = 0; i < rowsLength; i++) {
  665. ids += "'"+rows[i].FD_OBJECTID260+"'" + ",";
  666. }
  667. var temp = ids.substring(0,ids.length-1);
  668. var condition = " IS_DEL='0' ";
  669. condition += " AND FD_OBJECTID IN (" + temp + ") " ;
  670. var sql = {
  671. "listId" :'260' ,
  672. "condition" : condition,
  673. direction:'DESC',
  674. sort: 'UPDATEDATE'
  675. };
  676. excelExport(260,sql,"应急专家信息","IS_DEL,UPDATEDATE,FD_OBJECTID,EXPERT_RESUME,COLUMN_1,COLUMN_2,COLUMN_3");
  677. }
  678. //详情
  679. function onView(){
  680. var rows = g.getSelectedRows();
  681. if(rows.length==0){
  682. top.Dialog.alert("请选择一条记录");
  683. return;
  684. }
  685. if(rows.length>1){
  686. top.Dialog.alert("只能选择一条记录");
  687. return;
  688. }
  689. var fd_id = rows[0].FD_OBJECTID260;
  690. window.location.href="expertinfo.jsp?"+fd_id;
  691. }
  692. //点击主键跳转详细信息页面
  693. this.openDetail = function(rowindex) {
  694. var row = g.getRow(rowindex);
  695. var fd_id = row.FD_OBJECTID260;
  696. // window.location.href="expertinfo.jsp?"+fd_id;
  697. $.indexOpenNextWindow("/nwyj/page/business/am/resource/expert/expertinfo.jsp?"+fd_id);
  698. };
  699. //历史记录
  700. function historyUnit(){
  701. var rows = g.getSelectedRows();
  702. if(rows.length==0){
  703. top.Dialog.alert("请选择一条记录");
  704. return;
  705. }
  706. if(rows.length>1){
  707. top.Dialog.alert("只能选择一条记录");
  708. return;
  709. }
  710. //上一个版本的预案ID
  711. var fd_id = rows[0].COLUMN_1_260;
  712. var fd_id1 = rows[0].FD_OBJECTID260;
  713. window.location.href="expert-version.jsp?"+fd_id+"?"+fd_id1;
  714. }
  715. //专家统计
  716. function sumUnit(){
  717. window.location.href="expert-poll.jsp";
  718. }
  719. function more() {
  720. $('#moreDiv').toggle(400,function(){
  721. // $("#emptyCondition").click();
  722. // $(parent.document.body).find("iframe").height($(window.document.body).height()+30);
  723. // $(top.document.body).find("iframe").height($(window.document.body).height()+30);
  724. // setHt();
  725. checkAndSetHeight();//changeFormat.js
  726. });
  727. }
  728. function setHt(){
  729. /* alert($("#layout1 .padding_right5").height())
  730. alert($("#layout1 .selDiv").height());
  731. alert($(".l-layout-left").height()); */
  732. var leftHeight = $(".layout_content").height()+70;
  733. var rightHeight = $("#layout1 .adding_right5").height()+$("#layout1 #moreDiv").height()+70;
  734. var height = leftHeight>rightHeight?leftHeight:rightHeight;
  735. // $(window.document.body).height(height);
  736. $(top.document.body).find("#frmright").height($(window.document.body).height(height)+30);
  737. }
  738. $.messager=top.Dialog;
  739. //横向查看功能
  740. function tempValue(){
  741. var diag = new top.Dialog();
  742. diag.Title = "应急组织";
  743. diag.URL = $.pathname() + '/page/business/am/resource/ledger/readDept.jsp';
  744. diag.Width = 700;
  745. diag.Height = 500;
  746. diag.Top = "80%";
  747. diag.Left = "50%";
  748. diag.ShowButtonRow=true;
  749. diag.ButtonAlign = 'center';
  750. diag.OkButtonText="确 定";
  751. diag.OKEvent = function(){
  752. Validate(diag);
  753. };
  754. diag.show();
  755. }
  756. function Validate(diag){
  757. var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id()+""; //登录人ID
  758. var dept_name = top.com.sinosoft.lz.system.user.LoginInfo.getDeptnames(); //申请单位的名称
  759. var time1=diag.innerFrame.contentWindow.$("#time1").val();
  760. var time2=diag.innerFrame.contentWindow.$("#time2").val();
  761. var yuanyin=diag.innerFrame.contentWindow.$("#yuanyin").val();
  762. //获取zTree对象
  763. var zTree = diag.innerFrame.contentWindow.$.fn.zTree.getZTreeObj("tree-1");
  764. //得到选中的数据集
  765. var checkedNodes = zTree.getCheckedNodes(true);
  766. if(time1==""||time2==""){
  767. $.messager.alert('请选择申请查看权限的时间!');
  768. return;
  769. }
  770. if(time1>time2){
  771. $.messager.alert('请选择正确的申请查看权限的时间!');
  772. return;
  773. }
  774. if(yuanyin==""){
  775. $.messager.alert('请输入申请查看权限的原因!');
  776. return;
  777. }
  778. if(checkedNodes==""){
  779. $.messager.alert('请选择要申请查看的单位!');
  780. return;
  781. }
  782. var compValue="";
  783. var compValue2="";
  784. for(var i = 0; i < checkedNodes.length; i++){
  785. //机构名称
  786. compValue += checkedNodes[i].id + ",";
  787. compValue2 += checkedNodes[i].name+",";
  788. }
  789. var compid = compValue.substring(0,compValue.length-1);
  790. var compname = compValue2.substring(0,compValue2.length-1);
  791. //给第二个form的字段设置值
  792. $("#APPLY_PERSION_216").val(getUser_id);
  793. $("#COMPNAME_216").val(dept_name);
  794. $("#APPROVE_PERSION_216").val("暂时数据");
  795. $("#START_TIME_216").val(time1);
  796. $("#END_TIME_216").val(time2);
  797. $("#APPLY_CAUSE_216").val(yuanyin);
  798. $("#APPLY_COMPID_216").val(compid);//查看单位的ID
  799. $("#APPLY_COMPNAME_216").val(compname); //查看单位的名称
  800. var $form = $('#fillForm1');
  801. var url = $.pathname() + '/ws/crud/CRUDService/create';
  802. $.ajax({
  803. url : url,
  804. type : 'post',
  805. data : $form.serialize(),
  806. dataType : 'text',
  807. timeout : 60000,
  808. success : function(data){
  809. $.messager.alert("申请提交成功",null,null,null,-1);
  810. },
  811. error : function(){
  812. $.messager.alert('操作失败');
  813. }
  814. });
  815. top.Dialog.close();//关闭新增窗口
  816. }