123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443 |
- $(function(){
-
- // getCompName();
-
-
- /** 绑定更多的按钮点击事件 */
- $more = $("#more"); // 更多按钮
- $more.bind('click', function() {
- more();
- });
-
- $searchButt = $("#searchButt");// 更多查询按钮
- $searchButt.live('click', function() {
- searchHandler2();
- });
-
- $searchOne = $("#searchOne");//查询图标绑定查询事件
- $searchOne.bind('click', function() {
- searchHandler2();
- });
- });
- //单位ID
- var deptName = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
-
-
- function getCompName(){
- var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- var url = $.pathname() + '/ws/PlanHuiZong/ContingencyPlanHuiZong/getresourXj/';
- var params = {
- id : deptId,
- value:"DEPT_ID"
- };
- $.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":"DEPT_ID","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 exportParams = null;//导出EXCEL参数
- var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id()+""; //登录人ID //and (PLAN_STAT=1 or REMARK1='"+getUser_id +"' or UNITS='"+deptName +"')
- var loadParams = {
- "id" : deptName
- // "listId" : '263',
- // "condition" : ""
- // direction:'DESC',
- // sort: 'UPDATEDATE'
-
- };
-
- var oneCols1= [{display : '客户编号',name : 'FD_OBJECTID',width : "200",align : 'center',isPrimaryKey:true,isSort:false,
- 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 : 'CUSTOMER_NAME',width : "200",align : 'left',showTitle:true,isSort:false},
- {display : '客户类别',name : 'CUSTOMER_KIND',width : "200",align : 'center',showTitle:true,isSort:false},
- {display : '供电单位',name : 'OWNER_STATION',width : "200",align : 'center',showTitle:true,isSort:false},
- {display : '重要等级',name : 'IMPORT_LEVEL',width : "200",align : 'center',showTitle:true,isSort:false},
- {display : '电压等级',name : 'VOLTAGE_CODE',width : "200",align : 'center',showTitle:true,isSort:false},
- {display : '装见容量(kVA)',name : 'AGREEMENT_CAPACITY',width : "200",align : 'center',showTitle:true,isSort:false},
- {display : '保安负荷(kW)',name : 'SECUIRITY_LOAD',width : "200",align : 'center',showTitle:true,isSort:false}
- ];
- var oneCols2= [{display : '供电电源1',
- columns : [{display : '供电线路',name : 'GDXL1',width : "200",align : 'center',showTitle:true,isSort:false},
- {display : '上级变电站',name : 'SJBDZ1',width : "200",align : 'center',showTitle:true,isSort:false}]},
- {display : '供电电源2',
- columns : [{display : '供电线路',name : 'GDXL2',width : "200",align : 'center',showTitle:true,isSort:false},
- {display : '上级变电站',name : 'SJBDZ2',width : "200",align : 'center',showTitle:true,isSort:false}]},
- {display : '供电电源3',
- columns : [{display : '供电线路',name : 'GDXL3',width : "200",align : 'center',showTitle:true,isSort:false},
- {display : '上级变电站',name : 'SJBDZ3',width : "200",align : 'center',showTitle:true,isSort:false}]},
- {display : '供电电源4',
- columns : [{display : '供电线路',name : 'GDXL4',width : "200",align : 'center',showTitle:true,isSort:false},
- {display : '上级变电站',name : 'SJBDZ4',width : "200",align : 'center',showTitle:true,isSort:false}]},
- {display : '供电电源5',
- columns : [{display : '供电线路',name : 'GDXL5',width : "200",align : 'center',showTitle:true,isSort:false},
- {display : '上级变电站',name : 'SJBDZ5',width : "200",align : 'center',showTitle:true,isSort:false}]},
- {display : '供电电源6',
- columns : [{display : '供电线路',name : 'GDXL6',width : "200",align : 'center',showTitle:true,isSort:false},
- {display : '上级变电站',name : 'SJBDZ6',width : "200",align : 'center',showTitle:true,isSort:false}]},
- {display : '供电电源是否满足标准',name : 'IS_MEET_OF_SUPPLY',width : "200" ,showTitle:true,isSort:false}
- ];
- var oneCols3 =[{display : '自备应急电源容量(kW)',name : 'OWNED_SOURCE_CAPACITY',width : "200",align : 'center',showTitle:true,isSort:false},
- {display : '自备应急电源配比(%)',name : '',width : "200",align : 'center',showTitle:true,isSort:false},
- {display : '自备应急电源是否满足标准',name : 'IS_MEET_OF_SELF_PROVIDE',width : "200",align : 'center',showTitle:true,isSort:false}
- ];
-
- function initComplete(){
-
- /**
- * 工具条
- */
- var roleCons = roleButtonArr();
- var toolBarOpt1 = {
- items:[
- // {text: '详情', click: "onView", iconClass: 'view_tem',id:"10003"},
- {text: '导出', click: "daochu", iconClass: 'export_tem',id:"10006"},
- {text: '汇总', click: "huizong", iconClass: 'poll_tem',id:"10203"}
- ],
-
- roleCons:roleCons
- };
- /**
- * 树形列
- */
- var grid_option1 = {
- columns: [
- // //为了解决自定义表格,头上显示的主键ID,先暂时注掉2015-10-10
- // //PIGEONHOLE_MAN_ID_230_SHOW
- //// { name: 'FD_OBJECTID214', hide : true},
- // { display: '用户名称', name: 'NAME_263', align: 'center', width: "10%",isPrimaryKey:true,
- //// render : function(rowdata, value) {
- //// return '<a href="javascript:void(0)" '
- //// + 'onclick=jumpPage("'
- //// + rowdata.FD_OBJECTID263
- //// +'")>'+ rowdata.NAME_263 +'</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: 'MRID_263', align: 'center', width: "10%"},
- // { display: '用电地址', name: 'DETAILED_ADDRESS_263', align: 'center', width: "10%"},
- // { display: '用电类别', name: 'UTILIZATION_KIND_263_SHOW', align: 'center', width: "10%"},
- // { display: '供电单位(人资系统ID)', name: 'OWNER_STATION_263_SHOW', align: 'center', width: "10%"},
- // { display: '供电单位(营销系统)', name: 'GDDWBM_263', align: 'center' , width: "10%"},
- // { display: '电压等级', name: 'VOLTAGE_CODE_263_SHOW', align: 'center', width: "10%"},
- // { display: '合同容量', name: 'AGREEMENT_CAPACITY_263', align: 'center', width: "10%"},
- // { display: '负荷类型', name: 'LOAD_KIND_263_SHOW', align: 'center' , width: "10%" },
- ///* { display: '自备电源标志', name: 'OWNED_SOURCE_FLAG_263', align: 'center', width: "150px" },
- // { display: '自备电源容量', name: 'OWNED_SOURCE_CAPACITY_263', align: 'center', width: "150px" },*/
- // { display: '重要用户等级', name: 'CUSTOMER_LEVEL_263_SHOW', align: 'center', width: "10%" }
- { display: '重要客户基本信息', columns : oneCols1 , width: "1600" },
- { display: '供电电源情况', columns : oneCols2 , width: "2600" },
- { display: '自备应急电源情况', columns : oneCols3 , width: "600" },
- { display: '备注', name: '', align: 'center', width: "200" ,isSort:false}
- ],
- rownumbers : true,
- checkbox : true,
- pageSize : 10,
- // groupColumnName: "DESCRIPTION", groupColumnDisplay: "分组",
- percentWidthMode : true
- };
-
- var options1={
- url :'/nwyj/ws/customerHuiZong/customerHuiZongService/getCustomerModel',
- params:loadParams,
- width:960,
- gridOptions:grid_option1,
- singleRecodeOptions:{a:"aa"},
- paperOpration:{showInput:"true"},
- toolBarOptions:toolBarOpt1
- };
- g=gridAndSingleRecode=$("#maingrid").quickgridAndSingleRecode(options1);
-
- }
-
-
- //导出
- function daochu(){
- var rows = g.getSelectedRows();
- var rowsLength = rows.length;
- if (rowsLength == 0) {
- top.Dialog.confirm("是否导出所有的重要用户信息?|确定", function() {
- var sql = {
- "report_type" : "rccuster"
- };
- excelExport(undefined,sql,"重要用户信息","","重要用户信息",'rcdaochu');
- });
- return;
- }
-
- var ids = "";
- for ( var i = 0; i < rowsLength; i++) {
- ids += "'"+rows[i].FD_OBJECTID+"'" + ",";
- }
- var temp = ids.substring(0,ids.length-1);
-
- var sql = {
- "report_type" : "rccuster",
- "id":temp
- };
- excelExport(undefined,sql,"重要用户信息","","重要用户信息",'rcdaochu');
-
- }
-
-
- // //模糊查询
- // function searchHandler(){
- //
- // var name = $('#DETAILED_ADDRESS_263').val();//预案名称
- // var condition = " IS_DEL='0' ";
- //
- // if(name!=""){
- // condition += " AND DETAILED_ADDRESS_263 LIKE '%" +name+"%'";
- // }
- //
- // g.setOptions({//重置加载列表的参数
- //
- // params : {
- // "listId" :'263' ,
- // "condition" : condition
- // }
- // });
- //
- // g.setNewPage(1);
- // g.loadData();//刷新列表
- // }
- // //监控模糊查询框
- // function check(){
- // var tValue="";
- // setInterval(function(event){
- // if(tValue!=$("#DETAILED_ADDRESS_263").val()){
- // tValue=$("#DETAILED_ADDRESS_263").val();
- // searchHandler();
- // }
- // },100);
- //
- // }
- //查询
- function searchHandler(){
-
- $queryForm = $("#queryForm");
- if($("#NAME_263").val()=="请输入重要客户名称"){
- $("#NAME_263").val("");
- }
- $queryForm.serialize();
- var $comp_id = $("#selectConditions").find(".DEPT_ID");
- var loadParams11;
- //判断是否有用单位做查询条件
- if(!!$comp_id.prop("outerHTML")){
- loadParams11 = {
- // "id" : "",
- "condition" : ""
- // 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();
- /*$.ajax({
- url : '/nwyj/ws/customerHuiZong/customerHuiZongService/getFindCustomerId',
- type : 'post',
- timeout : 60000,
- data : params,
- dataType : 'json',
- success : function(data){
- // alert(JSON.stringify(data));
- //加载数据
- // g.setOptions({data:data});
-
- //g.rend();
- },
- error : function(e){
- $.messager.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });*/
-
-
- }
-
- function searchHandler2(){
-
- if($("#NAME").val()=="请输入重要客户名称"){
- $("#NAME").val("");
- }
-
- var name = $("#NAME").val();
-
- var condition = "";
-
- if(name!=""){
- condition += " NAME LIKE '%" +name+"%' and ";
- }
-
- //客户类别
- var KIND = "";
- $("input:checkbox[name=KIND]").each(function(){
- if($(this).attr("checked")){
- if($(this).val()=="0000"){
- KIND += " KIND = '10' or KIND = '11' or KIND = '20' or KIND = 30' or KIND = '40' or KIND = '50' or KIND = '55' or KIND = '60' or KIND = 70' or KIND = '80' or KIND = '90' or KIND = '91' or ";
- }else{
- KIND += "KIND = '" + $(this).val() +"' or ";
- }
- }
- });
- if(KIND!=""){
- KIND = KIND.substring(0,KIND.lastIndexOf("or"));
- condition += " ("+KIND+") and ";
- }
- //重要等级
- var IMPORT_LEVEL = "";
- $("input:checkbox[name=IMPORT_LEVEL]").each(function(){
- if($(this).attr("checked")){
- if($(this).val()=="0000"){
- IMPORT_LEVEL += " IMPORT_LEVEL = '1' or IMPORT_LEVEL = '2' or IMPORT_LEVEL = '3' or ";
- }else{
- IMPORT_LEVEL += "IMPORT_LEVEL = '" + $(this).val() +"' or ";
- }
- }
- });
- if(IMPORT_LEVEL!=""){
- IMPORT_LEVEL = IMPORT_LEVEL.substring(0,IMPORT_LEVEL.lastIndexOf("or"));
- condition += " ("+IMPORT_LEVEL+") and ";
- }
- //电压等级
- var VOLTAGE_CODE = "";
- $("input:checkbox[name=VOLTAGE_CODE]").each(function(){
- if($(this).attr("checked")){
- if($(this).val()=="0000"){
- VOLTAGE_CODE += " VOLTAGE_CODE = '01' or VOLTAGE_CODE = '02' or VOLTAGE_CODE = '03' or VOLTAGE_CODE = '04' or VOLTAGE_CODE = '05' or VOLTAGE_CODE = '06' or VOLTAGE_CODE = '07' or VOLTAGE_CODE = '08' or VOLTAGE_CODE = '09' or VOLTAGE_CODE = '10' or VOLTAGE_CODE = '11' or VOLTAGE_CODE = '12' orVOLTAGE_CODE = '13' or VOLTAGE_CODE = '14' or ";
- }else{
- VOLTAGE_CODE += "VOLTAGE_CODE = '" + $(this).val() +"' or ";
- }
- }
- });
- if(VOLTAGE_CODE!=""){
- VOLTAGE_CODE = VOLTAGE_CODE.substring(0,VOLTAGE_CODE.lastIndexOf("or"));
- condition += " ("+VOLTAGE_CODE+") and ";
- }
- //供电电源标准
- var IS_MEET_OF_SUPPLY = "";
- $("input:checkbox[name=IS_MEET_OF_SUPPLY]").each(function(){
- if($(this).attr("checked")){
- if($(this).val()=="0000"){
- IS_MEET_OF_SUPPLY += " IS_MEET_OF_SUPPLY = '0' or IS_MEET_OF_SUPPLY = '1' or ";
- }else{
- IS_MEET_OF_SUPPLY += "IS_MEET_OF_SUPPLY = '" + $(this).val() +"' or ";
- }
- }
- });
- if(IS_MEET_OF_SUPPLY!=""){
- IS_MEET_OF_SUPPLY = IS_MEET_OF_SUPPLY.substring(0,IS_MEET_OF_SUPPLY.lastIndexOf("or"));
- condition += " ("+IS_MEET_OF_SUPPLY+") and ";
- }
- //自备应急电源标准
- var IS_MEET_OF_SELF_PROVIDE = "";
- $("input:checkbox[name=IS_MEET_OF_SELF_PROVIDE]").each(function(){
- if($(this).attr("checked")){
- if($(this).val()=="0000"){
- IS_MEET_OF_SELF_PROVIDE += " IS_MEET_OF_SELF_PROVIDE = '0' or IS_MEET_OF_SELF_PROVIDE = '1' or ";
- }else{
- IS_MEET_OF_SELF_PROVIDE += "IS_MEET_OF_SELF_PROVIDE = '" + $(this).val() +"' or ";
- }
- }
- });
- if(IS_MEET_OF_SELF_PROVIDE!=""){
- IS_MEET_OF_SELF_PROVIDE = IS_MEET_OF_SELF_PROVIDE.substring(0,IS_MEET_OF_SELF_PROVIDE.lastIndexOf("or"));
- condition += " ("+IS_MEET_OF_SELF_PROVIDE+") and ";
- }
-
- //部门id
- var dpids = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- if(zTreeCompId=="" || zTreeCompId==dpids){
- condition += " dept_id="+dpids+" and ";
- }else{
- condition += " dept_id="+zTreeCompId+" and ";
- }
-
- var params = {
- "condition" : condition
- } ;
- g.setOptions({"params":params});
- g.rend();
-
- }
-
- //清空
- function resetSearch(){
- $('#NAME').val("");
- $("input:checkbox[name=KIND]").attr("checked",false);
- $("input:checkbox[name=IMPORT_LEVEL]").attr("checked",false);
- $("input:checkbox[name=VOLTAGE_CODE]").attr("checked",false);
- $("input:checkbox[name=IS_MEET_OF_SUPPLY]").attr("checked",false);
- $("input:checkbox[name=IS_MEET_OF_SELF_PROVIDE]").attr("checked",false);
- }
-
- //汇总(汇总本级单位预案信息)
- function huizong(){
- window.location.href="customer-poll.jsp";
- }
-
- //点击查看
- function jumpPage(id){
- window.location.href="customer-focusinfo.jsp?"+id;
- }
- //点击主键跳转详细信息页面
- this.openDetail = function(rowindex) {
- var row = g.getRow(rowindex);
- var fd_id = row.FD_OBJECTID;
- // window.location.href="customer-focusinfo2.jsp?"+fd_id;
- $.indexOpenNextWindow("/nwyj/page/business/am/customer/customer-focusinfo2.jsp?"+fd_id);
- };
- function showPrimaryKey(obj,index){
- var fd_id = obj.FD_OBJECTID;
- // window.location.href="customer-focusinfo2.jsp?"+fd_id;
- $.indexOpenNextWindow("/nwyj/page/business/am/customer/customer-focusinfo2.jsp?"+fd_id);
- }
-
- $.messager=top.Dialog;
-
- function more() {
- $('#moreDiv').toggle(400,function(){
- // $("#emptyCondition").click();
- // $(parent.document.body).find("#frmright").height($(window.document.body).height()+30);
- checkAndSetHeight();//changeFormat.js
- });
- }
|