123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282 |
- var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- $(function(){
- getChildInfo();
- /** 绑定更多的按钮点击事件 */
- $more = $("#more"); // 更多按钮
- $more.bind('click', function() {
- more();
- });
- $searchButt = $("#searchButt");// 更多查询按钮
- $searchButt.live('click', function() {
- searchHandler();
- });
- $searchOne = $("#searchOne");//查询图标绑定查询事件
- $searchOne.bind('click', function() {
- searchHandler();
- });
- });
- //取页面传过来的预警级别
- var iframeUrl = window.location.href;
- var data = (iframeUrl).split('?')[1];
- 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","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: "onView", iconClass: 'view_tem' ,id:"10003"},
- {text: '历史维护记录', click: "historyUnit", iconClass: 'history_tem' ,id:"10201"},
- {text: '确定', click: "addTeamInfo",id:"10208"}
- ],
- roleCons:roleCons
- };
- /**
- * 树形列
- */
- var grid_option1 = {
- columns: [
- { display: '姓名', name: 'EXPERT_NAME_260', align: 'center', width: "10%"},
- { display: '性别', name: 'EXPERT_SEX_260_SHOW', align: 'center', width: "10%"},
- { display: '手机', name: 'EXPERT_CAL_260', align: 'center' , width: "10%"},
- { display: '所属区域', name: 'EXPERT_AREA_260', align: 'center' , width: "10%"},
- { display: '所属单位', name: 'EXPERT_UNIT_260_SHOW', align: 'center', width: "10%" },
- { display: '是否南网员工', name: 'IS_SNSTAFF_260_SHOW', align: 'center', width: "10%" },
- { display: '职称', name: 'EXPERT_TYPE_260_SHOW', align: 'center', width: "10%"},
- { display: '职务', name: 'EXPERT_POST_260_SHOW', align: 'center', width: "10%"},
- { display: '专业特长', name: 'EXPERT_SPECIALTY_260_SHOW', align: 'center', width: "10%" },
- { display: '变更类型', name: 'CHANGE_TYPE_260_SHOW', align: 'center', width: "10%"}
- ],
- rownumbers : true,
- checkbox : true,
- pageSize : 10,
- percentWidthMode : true,
- isChecked:checkedHandler,
- onCheckRow: checkRowHandler,
- onCheckAllRow: checkAllRowHandler
- };
- 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 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();
- }
-
- //绑定添加应急队伍
- /**
- * 1、取应急专家姓名、手机号格式如下:
- * 专家姓名:电话;专家姓名2:电话;
- * */
- function addTeamInfo(){
- // top.Dialog.alert("选中专家:"+checkedTextArray.join(',')+"<br/>选中id:"+checkedArray.join(',')+"<br/>手机:"+telphone.join(','));
- var rows = g.getSelectedRows();
- var rowsLength = rows.length;
- if (rowsLength == 0) {
- top.Dialog.alert("请选中要通知的应急专家!");
- return;
- }
- var msg = "";
- for(var i=0;i<checkedTextArray.length;i++){
- msg+=checkedTextArray[i] + ":" + telphone[i] + ";";
- }
-
- if(data=="expert_redAlert"){
- top.frmright.frmrightChild.iframeChild2.document.getElementById("expert_redAlert").value=msg; //两层 红色
- }else if(data=="expert_orgAlert"){
- top.frmright.frmrightChild.iframeChild2.document.getElementById("expert_orgAlert").value=msg; //两层 橙色
- }else if(data=="expert_yellowAlert"){
- top.frmright.frmrightChild.iframeChild2.document.getElementById("expert_yellowAlert").value=msg; //两层 黄色
- }else if(data=="expert_redAlertsssg"){
- top.frmright.frmrightChild.document.getElementById("expert_redAlertsssg").value=msg; //一层 一级
- }else if(data=="expert_orgAlertsssg"){
- top.frmright.frmrightChild.document.getElementById("expert_orgAlertsssg").value=msg; //一层 二级
- }else if(data=="expert_yellowAlertsssg"){
- top.frmright.frmrightChild.document.getElementById("expert_yellowAlertsssg").value=msg; //一层 三级
- }else if(data=="expert_blueAlertsssg"){
- top.frmright.frmrightChild.document.getElementById("expert_blueAlertsssg").value=msg; //一层 四级
- } else{
- top.frmright.frmrightChild.iframeChild2.document.getElementById("expert_blueAlert").value=msg; //两层 蓝色
- };
- top.Dialog.close();
- }
-
- //详情
- 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;
- }
-
- //历史记录
- 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 more() {
- $('#moreDiv').toggle();
- }
-
- $.messager=top.Dialog;
-
- //翻页记忆
- var checkedArray = [];
- var checkedTextArray = [];
- var telphone = [];
- function findCheckedArray(id)
- {
- for(var i =0;i<checkedArray.length;i++)
- {
- if(checkedArray[i] == id) return i;
- }
- return -1;
- }
- function addCheckedArray(id,name,phone)
- {
- if(findCheckedArray(id) == -1){
- checkedArray.push(id);
- checkedTextArray.push(name);
- telphone.push(phone);
- }
- }
- function removeCheckedArray(id)
- {
- var i = findCheckedArray(id);
- if(i==-1) return;
- checkedArray.splice(i,1);
- checkedTextArray.splice(i,1);
- telphone.splice(i, 1);
- }
- function checkedHandler(rowdata)
- {
- if (findCheckedArray(rowdata.FD_OBJECTID_260) == -1)
- return false;
- return true;
- }
- function checkRowHandler(checked, data)
- {
- if (checked) addCheckedArray(data.FD_OBJECTID_260,data.EXPERT_NAME_260,data.EXPERT_CAL_260);
- else removeCheckedArray(data.FD_OBJECTID_260,data.EXPERT_NAME_260,data.EXPERT_CAL_260);
- }
- function checkAllRowHandler(checked)
- {
- for (var rowid in this.records)
- {
- if(checked)
- addCheckedArray(this.records[rowid]['FD_OBJECTID_260'],this.records[rowid]['EXPERT_NAME_260'],this.records[rowid]['EXPERT_CAL_260']);
- else
- removeCheckedArray(this.records[rowid]['FD_OBJECTID_260'],this.records[rowid]['EXPERT_NAME_260'],this.records[rowid]['EXPERT_CAL_260']);
- }
- }
-
-
|