8f6fcbe328415570daca93f997d31622e18d6c1e.svn-base 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  2. $(function(){
  3. getChildInfo();
  4. /** 绑定更多的按钮点击事件 */
  5. $more = $("#more"); // 更多按钮
  6. $more.bind('click', function() {
  7. more();
  8. });
  9. $searchButt = $("#searchButt");// 更多查询按钮
  10. $searchButt.live('click', function() {
  11. searchHandler();
  12. });
  13. $searchOne = $("#searchOne");//查询图标绑定查询事件
  14. $searchOne.bind('click', function() {
  15. searchHandler();
  16. });
  17. });
  18. //取页面传过来的预警级别
  19. var iframeUrl = window.location.href;
  20. var data = (iframeUrl).split('?')[1];
  21. function getChildInfo(){
  22. var url = $.pathname() + '/ws/PlanHuiZong/ContingencyPlanHuiZong/getresourXj/';
  23. var params = {
  24. id : deptId,
  25. value:"EXPERT_UNIT"
  26. };
  27. $.ajax({
  28. url : url,
  29. type : 'post',
  30. timeout : 60000,
  31. data : params,
  32. dataType : 'json',
  33. success : function(data){
  34. var conditionData3 = JSON.stringify(data);
  35. var test = eval("("+conditionData3+")");
  36. if(conditionData3!='{"list":[{"name":"查询单位","className":"EXPERT_UNIT","list":[]}]}'){
  37. conditionData.list.push(test.list[0]);
  38. }
  39. createConditionsDom(conditionData);
  40. $(".item").unbind("click").bind("click",bindSelectOne);
  41. },
  42. error : function(e){
  43. $.messager.alert('系统提示信息', '访问服务失败!', 'error');
  44. }
  45. });
  46. }
  47. var g;
  48. /**定义变量**/
  49. var condition = "IS_DEL='0' AND EXPERT_UNIT IN ('"+ deptId +"')";
  50. //列表加载参数
  51. var loadParams = {
  52. "listId" : '260',
  53. "condition" : condition,
  54. direction:'DESC',
  55. sort: 'UPDATEDATE'
  56. };
  57. function initComplete(){
  58. /**
  59. * 工具条
  60. */
  61. var roleCons = roleButtonArr();
  62. var toolBarOpt1 = {
  63. items:[
  64. {text: '查看', click: "onView", iconClass: 'view_tem' ,id:"10003"},
  65. {text: '历史维护记录', click: "historyUnit", iconClass: 'history_tem' ,id:"10201"},
  66. {text: '确定', click: "addTeamInfo",id:"10208"}
  67. ],
  68. roleCons:roleCons
  69. };
  70. /**
  71. * 树形列
  72. */
  73. var grid_option1 = {
  74. columns: [
  75. { display: '姓名', name: 'EXPERT_NAME_260', align: 'center', width: "10%"},
  76. { display: '性别', name: 'EXPERT_SEX_260_SHOW', align: 'center', width: "10%"},
  77. { display: '手机', name: 'EXPERT_CAL_260', align: 'center' , width: "10%"},
  78. { display: '所属区域', name: 'EXPERT_AREA_260', align: 'center' , width: "10%"},
  79. { display: '所属单位', name: 'EXPERT_UNIT_260_SHOW', align: 'center', width: "10%" },
  80. { display: '是否南网员工', name: 'IS_SNSTAFF_260_SHOW', align: 'center', width: "10%" },
  81. { display: '职称', name: 'EXPERT_TYPE_260_SHOW', align: 'center', width: "10%"},
  82. { display: '职务', name: 'EXPERT_POST_260_SHOW', align: 'center', width: "10%"},
  83. { display: '专业特长', name: 'EXPERT_SPECIALTY_260_SHOW', align: 'center', width: "10%" },
  84. { display: '变更类型', name: 'CHANGE_TYPE_260_SHOW', align: 'center', width: "10%"}
  85. ],
  86. rownumbers : true,
  87. checkbox : true,
  88. pageSize : 10,
  89. percentWidthMode : true,
  90. isChecked:checkedHandler,
  91. onCheckRow: checkRowHandler,
  92. onCheckAllRow: checkAllRowHandler
  93. };
  94. var options1={
  95. url :'/nwyj/ws/crud/CRUDService/queryQui',
  96. params:loadParams,
  97. height: '100%',
  98. width:"100%",
  99. gridOptions:grid_option1,
  100. singleRecodeOptions:{a:"aa"},
  101. paperOpration:{showInput:"true"},
  102. toolBarOptions:toolBarOpt1
  103. };
  104. g=gridAndSingleRecode=$("#maingrid").quickgridAndSingleRecode(options1);
  105. }
  106. //查询
  107. function searchHandler(){
  108. $queryForm = $("#queryForm");
  109. if($("#EXPERT_NAME_260").val()=="请输入专家姓名"){
  110. $("#EXPERT_NAME_260").val("");
  111. }
  112. $queryForm.serialize();
  113. var $comp_id = $("#selectConditions").find(".EXPERT_UNIT");
  114. var loadParams11;
  115. //判断是否有用单位做查询条件
  116. if(!!$comp_id.prop("outerHTML")){
  117. loadParams11 = {
  118. "listId" : '260',
  119. "condition" : " IS_DEL='0'",
  120. direction:'DESC',
  121. sort: 'UPDATEDATE'
  122. };
  123. }else{
  124. loadParams11 = $.extend({},loadParams,loadParams);
  125. }
  126. //获取选中的值
  127. var searchCondition = getSelectCon(conditionData);
  128. var queryParams = getQueryFormParams($queryForm);//拼接出来的条件
  129. var params=$.extend({},loadParams11,queryParams);// 默认
  130. //与之前参数条件拼接
  131. params.condition = searchCondition.condition + params.condition;
  132. // alert(JSON.stringify(params));
  133. g.setOptions({"params":params});
  134. //加载数据
  135. g.rend();
  136. }
  137. //绑定添加应急队伍
  138. /**
  139. * 1、取应急专家姓名、手机号格式如下:
  140. * 专家姓名:电话;专家姓名2:电话;
  141. * */
  142. function addTeamInfo(){
  143. // top.Dialog.alert("选中专家:"+checkedTextArray.join(',')+"<br/>选中id:"+checkedArray.join(',')+"<br/>手机:"+telphone.join(','));
  144. var rows = g.getSelectedRows();
  145. var rowsLength = rows.length;
  146. if (rowsLength == 0) {
  147. top.Dialog.alert("请选中要通知的应急专家!");
  148. return;
  149. }
  150. var msg = "";
  151. for(var i=0;i<checkedTextArray.length;i++){
  152. msg+=checkedTextArray[i] + ":" + telphone[i] + ";";
  153. }
  154. if(data=="expert_redAlert"){
  155. top.frmright.frmrightChild.iframeChild2.document.getElementById("expert_redAlert").value=msg; //两层 红色
  156. }else if(data=="expert_orgAlert"){
  157. top.frmright.frmrightChild.iframeChild2.document.getElementById("expert_orgAlert").value=msg; //两层 橙色
  158. }else if(data=="expert_yellowAlert"){
  159. top.frmright.frmrightChild.iframeChild2.document.getElementById("expert_yellowAlert").value=msg; //两层 黄色
  160. }else if(data=="expert_redAlertsssg"){
  161. top.frmright.frmrightChild.document.getElementById("expert_redAlertsssg").value=msg; //一层 一级
  162. }else if(data=="expert_orgAlertsssg"){
  163. top.frmright.frmrightChild.document.getElementById("expert_orgAlertsssg").value=msg; //一层 二级
  164. }else if(data=="expert_yellowAlertsssg"){
  165. top.frmright.frmrightChild.document.getElementById("expert_yellowAlertsssg").value=msg; //一层 三级
  166. }else if(data=="expert_blueAlertsssg"){
  167. top.frmright.frmrightChild.document.getElementById("expert_blueAlertsssg").value=msg; //一层 四级
  168. } else{
  169. top.frmright.frmrightChild.iframeChild2.document.getElementById("expert_blueAlert").value=msg; //两层 蓝色
  170. };
  171. top.Dialog.close();
  172. }
  173. //详情
  174. function onView(){
  175. var rows = g.getSelectedRows();
  176. if(rows.length==0){
  177. top.Dialog.alert("请选择一条记录");
  178. return;
  179. }
  180. if(rows.length>1){
  181. top.Dialog.alert("只能选择一条记录");
  182. return;
  183. }
  184. // var fd_id = rows[0].FD_OBJECTID260;
  185. // window.location.href="expertinfo.jsp?"+fd_id;
  186. }
  187. //历史记录
  188. function historyUnit(){
  189. var rows = g.getSelectedRows();
  190. if(rows.length==0){
  191. top.Dialog.alert("请选择一条记录");
  192. return;
  193. }
  194. if(rows.length>1){
  195. top.Dialog.alert("只能选择一条记录");
  196. return;
  197. }
  198. //上一个版本的预案ID
  199. // var fd_id = rows[0].COLUMN_1_260;
  200. // var fd_id1 = rows[0].FD_OBJECTID260;
  201. // window.location.href="expert-version.jsp?"+fd_id+"?"+fd_id1;
  202. }
  203. // 更多
  204. function more() {
  205. $('#moreDiv').toggle();
  206. }
  207. $.messager=top.Dialog;
  208. //翻页记忆
  209. var checkedArray = [];
  210. var checkedTextArray = [];
  211. var telphone = [];
  212. function findCheckedArray(id)
  213. {
  214. for(var i =0;i<checkedArray.length;i++)
  215. {
  216. if(checkedArray[i] == id) return i;
  217. }
  218. return -1;
  219. }
  220. function addCheckedArray(id,name,phone)
  221. {
  222. if(findCheckedArray(id) == -1){
  223. checkedArray.push(id);
  224. checkedTextArray.push(name);
  225. telphone.push(phone);
  226. }
  227. }
  228. function removeCheckedArray(id)
  229. {
  230. var i = findCheckedArray(id);
  231. if(i==-1) return;
  232. checkedArray.splice(i,1);
  233. checkedTextArray.splice(i,1);
  234. telphone.splice(i, 1);
  235. }
  236. function checkedHandler(rowdata)
  237. {
  238. if (findCheckedArray(rowdata.FD_OBJECTID_260) == -1)
  239. return false;
  240. return true;
  241. }
  242. function checkRowHandler(checked, data)
  243. {
  244. if (checked) addCheckedArray(data.FD_OBJECTID_260,data.EXPERT_NAME_260,data.EXPERT_CAL_260);
  245. else removeCheckedArray(data.FD_OBJECTID_260,data.EXPERT_NAME_260,data.EXPERT_CAL_260);
  246. }
  247. function checkAllRowHandler(checked)
  248. {
  249. for (var rowid in this.records)
  250. {
  251. if(checked)
  252. addCheckedArray(this.records[rowid]['FD_OBJECTID_260'],this.records[rowid]['EXPERT_NAME_260'],this.records[rowid]['EXPERT_CAL_260']);
  253. else
  254. removeCheckedArray(this.records[rowid]['FD_OBJECTID_260'],this.records[rowid]['EXPERT_NAME_260'],this.records[rowid]['EXPERT_CAL_260']);
  255. }
  256. }