1735cf5404f34ba9efbb4ea3c96feb2888b189a0.svn-base 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443
  1. $(function(){
  2. // getCompName();
  3. /** 绑定更多的按钮点击事件 */
  4. $more = $("#more"); // 更多按钮
  5. $more.bind('click', function() {
  6. more();
  7. });
  8. $searchButt = $("#searchButt");// 更多查询按钮
  9. $searchButt.live('click', function() {
  10. searchHandler2();
  11. });
  12. $searchOne = $("#searchOne");//查询图标绑定查询事件
  13. $searchOne.bind('click', function() {
  14. searchHandler2();
  15. });
  16. });
  17. //单位ID
  18. var deptName = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  19. function getCompName(){
  20. var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  21. var url = $.pathname() + '/ws/PlanHuiZong/ContingencyPlanHuiZong/getresourXj/';
  22. var params = {
  23. id : deptId,
  24. value:"DEPT_ID"
  25. };
  26. $.ajax({
  27. url : url,
  28. type : 'post',
  29. timeout : 60000,
  30. data : params,
  31. dataType : 'json',
  32. success : function(data){
  33. var conditionData3 = JSON.stringify(data);
  34. var test = eval("("+conditionData3+")");
  35. if(conditionData3!='{"list":[{"name":"查询单位","className":"DEPT_ID","equalType":"equal","list":[]}]}'){
  36. conditionData.list.push(test.list[0]);
  37. }
  38. createConditionsDom(conditionData);
  39. $(".item").unbind("click").bind("click",bindSelectOne);
  40. },
  41. error : function(e){
  42. $.messager.alert('系统提示信息', '访问服务失败!', 'error');
  43. }
  44. });
  45. }
  46. var g;
  47. /**定义变量**/
  48. var exportParams = null;//导出EXCEL参数
  49. var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id()+""; //登录人ID //and (PLAN_STAT=1 or REMARK1='"+getUser_id +"' or UNITS='"+deptName +"')
  50. var loadParams = {
  51. "id" : deptName
  52. // "listId" : '263',
  53. // "condition" : ""
  54. // direction:'DESC',
  55. // sort: 'UPDATEDATE'
  56. };
  57. var oneCols1= [{display : '客户编号',name : 'FD_OBJECTID',width : "200",align : 'center',isPrimaryKey:true,isSort:false,
  58. render : function(rowdata, rowindex, value, column) {
  59. return "<a href='javascript:;' style='width:100%;height:100%;display:block' title='" + value + "' onclick='openDetail(" + rowindex + ")'>" + value + "</a>";
  60. }
  61. },
  62. {display : '客户名称',name : 'CUSTOMER_NAME',width : "200",align : 'left',showTitle:true,isSort:false},
  63. {display : '客户类别',name : 'CUSTOMER_KIND',width : "200",align : 'center',showTitle:true,isSort:false},
  64. {display : '供电单位',name : 'OWNER_STATION',width : "200",align : 'center',showTitle:true,isSort:false},
  65. {display : '重要等级',name : 'IMPORT_LEVEL',width : "200",align : 'center',showTitle:true,isSort:false},
  66. {display : '电压等级',name : 'VOLTAGE_CODE',width : "200",align : 'center',showTitle:true,isSort:false},
  67. {display : '装见容量(kVA)',name : 'AGREEMENT_CAPACITY',width : "200",align : 'center',showTitle:true,isSort:false},
  68. {display : '保安负荷(kW)',name : 'SECUIRITY_LOAD',width : "200",align : 'center',showTitle:true,isSort:false}
  69. ];
  70. var oneCols2= [{display : '供电电源1',
  71. columns : [{display : '供电线路',name : 'GDXL1',width : "200",align : 'center',showTitle:true,isSort:false},
  72. {display : '上级变电站',name : 'SJBDZ1',width : "200",align : 'center',showTitle:true,isSort:false}]},
  73. {display : '供电电源2',
  74. columns : [{display : '供电线路',name : 'GDXL2',width : "200",align : 'center',showTitle:true,isSort:false},
  75. {display : '上级变电站',name : 'SJBDZ2',width : "200",align : 'center',showTitle:true,isSort:false}]},
  76. {display : '供电电源3',
  77. columns : [{display : '供电线路',name : 'GDXL3',width : "200",align : 'center',showTitle:true,isSort:false},
  78. {display : '上级变电站',name : 'SJBDZ3',width : "200",align : 'center',showTitle:true,isSort:false}]},
  79. {display : '供电电源4',
  80. columns : [{display : '供电线路',name : 'GDXL4',width : "200",align : 'center',showTitle:true,isSort:false},
  81. {display : '上级变电站',name : 'SJBDZ4',width : "200",align : 'center',showTitle:true,isSort:false}]},
  82. {display : '供电电源5',
  83. columns : [{display : '供电线路',name : 'GDXL5',width : "200",align : 'center',showTitle:true,isSort:false},
  84. {display : '上级变电站',name : 'SJBDZ5',width : "200",align : 'center',showTitle:true,isSort:false}]},
  85. {display : '供电电源6',
  86. columns : [{display : '供电线路',name : 'GDXL6',width : "200",align : 'center',showTitle:true,isSort:false},
  87. {display : '上级变电站',name : 'SJBDZ6',width : "200",align : 'center',showTitle:true,isSort:false}]},
  88. {display : '供电电源是否满足标准',name : 'IS_MEET_OF_SUPPLY',width : "200" ,showTitle:true,isSort:false}
  89. ];
  90. var oneCols3 =[{display : '自备应急电源容量(kW)',name : 'OWNED_SOURCE_CAPACITY',width : "200",align : 'center',showTitle:true,isSort:false},
  91. {display : '自备应急电源配比(%)',name : '',width : "200",align : 'center',showTitle:true,isSort:false},
  92. {display : '自备应急电源是否满足标准',name : 'IS_MEET_OF_SELF_PROVIDE',width : "200",align : 'center',showTitle:true,isSort:false}
  93. ];
  94. function initComplete(){
  95. /**
  96. * 工具条
  97. */
  98. var roleCons = roleButtonArr();
  99. var toolBarOpt1 = {
  100. items:[
  101. // {text: '详情', click: "onView", iconClass: 'view_tem',id:"10003"},
  102. {text: '导出', click: "daochu", iconClass: 'export_tem',id:"10006"},
  103. {text: '汇总', click: "huizong", iconClass: 'poll_tem',id:"10203"}
  104. ],
  105. roleCons:roleCons
  106. };
  107. /**
  108. * 树形列
  109. */
  110. var grid_option1 = {
  111. columns: [
  112. // //为了解决自定义表格,头上显示的主键ID,先暂时注掉2015-10-10
  113. // //PIGEONHOLE_MAN_ID_230_SHOW
  114. //// { name: 'FD_OBJECTID214', hide : true},
  115. // { display: '用户名称', name: 'NAME_263', align: 'center', width: "10%",isPrimaryKey:true,
  116. //// render : function(rowdata, value) {
  117. //// return '<a href="javascript:void(0)" '
  118. //// + 'onclick=jumpPage("'
  119. //// + rowdata.FD_OBJECTID263
  120. //// +'")>'+ rowdata.NAME_263 +'</a>';
  121. //// }
  122. // render : function(rowdata, rowindex, value, column) {
  123. // return "<a href='javascript:;' style='width:100%;height:100%;display:block' title='" + value + "' onclick='openDetail(" + rowindex + ")'>" + value + "</a>";
  124. // }
  125. // },
  126. // { display: '用户编号', name: 'MRID_263', align: 'center', width: "10%"},
  127. // { display: '用电地址', name: 'DETAILED_ADDRESS_263', align: 'center', width: "10%"},
  128. // { display: '用电类别', name: 'UTILIZATION_KIND_263_SHOW', align: 'center', width: "10%"},
  129. // { display: '供电单位(人资系统ID)', name: 'OWNER_STATION_263_SHOW', align: 'center', width: "10%"},
  130. // { display: '供电单位(营销系统)', name: 'GDDWBM_263', align: 'center' , width: "10%"},
  131. // { display: '电压等级', name: 'VOLTAGE_CODE_263_SHOW', align: 'center', width: "10%"},
  132. // { display: '合同容量', name: 'AGREEMENT_CAPACITY_263', align: 'center', width: "10%"},
  133. // { display: '负荷类型', name: 'LOAD_KIND_263_SHOW', align: 'center' , width: "10%" },
  134. ///* { display: '自备电源标志', name: 'OWNED_SOURCE_FLAG_263', align: 'center', width: "150px" },
  135. // { display: '自备电源容量', name: 'OWNED_SOURCE_CAPACITY_263', align: 'center', width: "150px" },*/
  136. // { display: '重要用户等级', name: 'CUSTOMER_LEVEL_263_SHOW', align: 'center', width: "10%" }
  137. { display: '重要客户基本信息', columns : oneCols1 , width: "1600" },
  138. { display: '供电电源情况', columns : oneCols2 , width: "2600" },
  139. { display: '自备应急电源情况', columns : oneCols3 , width: "600" },
  140. { display: '备注', name: '', align: 'center', width: "200" ,isSort:false}
  141. ],
  142. rownumbers : true,
  143. checkbox : true,
  144. pageSize : 10,
  145. // groupColumnName: "DESCRIPTION", groupColumnDisplay: "分组",
  146. percentWidthMode : true
  147. };
  148. var options1={
  149. url :'/nwyj/ws/customerHuiZong/customerHuiZongService/getCustomerModel',
  150. params:loadParams,
  151. width:960,
  152. gridOptions:grid_option1,
  153. singleRecodeOptions:{a:"aa"},
  154. paperOpration:{showInput:"true"},
  155. toolBarOptions:toolBarOpt1
  156. };
  157. g=gridAndSingleRecode=$("#maingrid").quickgridAndSingleRecode(options1);
  158. }
  159. //导出
  160. function daochu(){
  161. var rows = g.getSelectedRows();
  162. var rowsLength = rows.length;
  163. if (rowsLength == 0) {
  164. top.Dialog.confirm("是否导出所有的重要用户信息?|确定", function() {
  165. var sql = {
  166. "report_type" : "rccuster"
  167. };
  168. excelExport(undefined,sql,"重要用户信息","","重要用户信息",'rcdaochu');
  169. });
  170. return;
  171. }
  172. var ids = "";
  173. for ( var i = 0; i < rowsLength; i++) {
  174. ids += "'"+rows[i].FD_OBJECTID+"'" + ",";
  175. }
  176. var temp = ids.substring(0,ids.length-1);
  177. var sql = {
  178. "report_type" : "rccuster",
  179. "id":temp
  180. };
  181. excelExport(undefined,sql,"重要用户信息","","重要用户信息",'rcdaochu');
  182. }
  183. // //模糊查询
  184. // function searchHandler(){
  185. //
  186. // var name = $('#DETAILED_ADDRESS_263').val();//预案名称
  187. // var condition = " IS_DEL='0' ";
  188. //
  189. // if(name!=""){
  190. // condition += " AND DETAILED_ADDRESS_263 LIKE '%" +name+"%'";
  191. // }
  192. //
  193. // g.setOptions({//重置加载列表的参数
  194. //
  195. // params : {
  196. // "listId" :'263' ,
  197. // "condition" : condition
  198. // }
  199. // });
  200. //
  201. // g.setNewPage(1);
  202. // g.loadData();//刷新列表
  203. // }
  204. // //监控模糊查询框
  205. // function check(){
  206. // var tValue="";
  207. // setInterval(function(event){
  208. // if(tValue!=$("#DETAILED_ADDRESS_263").val()){
  209. // tValue=$("#DETAILED_ADDRESS_263").val();
  210. // searchHandler();
  211. // }
  212. // },100);
  213. //
  214. // }
  215. //查询
  216. function searchHandler(){
  217. $queryForm = $("#queryForm");
  218. if($("#NAME_263").val()=="请输入重要客户名称"){
  219. $("#NAME_263").val("");
  220. }
  221. $queryForm.serialize();
  222. var $comp_id = $("#selectConditions").find(".DEPT_ID");
  223. var loadParams11;
  224. //判断是否有用单位做查询条件
  225. if(!!$comp_id.prop("outerHTML")){
  226. loadParams11 = {
  227. // "id" : "",
  228. "condition" : ""
  229. // direction:'DESC',
  230. // sort: 'UPDATEDATE'
  231. };
  232. }else{
  233. loadParams11 = $.extend({},loadParams,loadParams);
  234. }
  235. //获取选中的值
  236. var searchCondition = getSelectCon(conditionData);
  237. var queryParams = getQueryFormParams($queryForm);//拼接出来的条件
  238. var params=$.extend({},loadParams11,queryParams);// 默认
  239. //与之前参数条件拼接
  240. params.condition = searchCondition.condition + params.condition;
  241. // alert(JSON.stringify(params));
  242. g.setOptions({"params":params});
  243. g.rend();
  244. /*$.ajax({
  245. url : '/nwyj/ws/customerHuiZong/customerHuiZongService/getFindCustomerId',
  246. type : 'post',
  247. timeout : 60000,
  248. data : params,
  249. dataType : 'json',
  250. success : function(data){
  251. // alert(JSON.stringify(data));
  252. //加载数据
  253. // g.setOptions({data:data});
  254. //g.rend();
  255. },
  256. error : function(e){
  257. $.messager.alert('系统提示信息', '访问服务失败!', 'error');
  258. }
  259. });*/
  260. }
  261. function searchHandler2(){
  262. if($("#NAME").val()=="请输入重要客户名称"){
  263. $("#NAME").val("");
  264. }
  265. var name = $("#NAME").val();
  266. var condition = "";
  267. if(name!=""){
  268. condition += " NAME LIKE '%" +name+"%' and ";
  269. }
  270. //客户类别
  271. var KIND = "";
  272. $("input:checkbox[name=KIND]").each(function(){
  273. if($(this).attr("checked")){
  274. if($(this).val()=="0000"){
  275. 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 ";
  276. }else{
  277. KIND += "KIND = '" + $(this).val() +"' or ";
  278. }
  279. }
  280. });
  281. if(KIND!=""){
  282. KIND = KIND.substring(0,KIND.lastIndexOf("or"));
  283. condition += " ("+KIND+") and ";
  284. }
  285. //重要等级
  286. var IMPORT_LEVEL = "";
  287. $("input:checkbox[name=IMPORT_LEVEL]").each(function(){
  288. if($(this).attr("checked")){
  289. if($(this).val()=="0000"){
  290. IMPORT_LEVEL += " IMPORT_LEVEL = '1' or IMPORT_LEVEL = '2' or IMPORT_LEVEL = '3' or ";
  291. }else{
  292. IMPORT_LEVEL += "IMPORT_LEVEL = '" + $(this).val() +"' or ";
  293. }
  294. }
  295. });
  296. if(IMPORT_LEVEL!=""){
  297. IMPORT_LEVEL = IMPORT_LEVEL.substring(0,IMPORT_LEVEL.lastIndexOf("or"));
  298. condition += " ("+IMPORT_LEVEL+") and ";
  299. }
  300. //电压等级
  301. var VOLTAGE_CODE = "";
  302. $("input:checkbox[name=VOLTAGE_CODE]").each(function(){
  303. if($(this).attr("checked")){
  304. if($(this).val()=="0000"){
  305. 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 ";
  306. }else{
  307. VOLTAGE_CODE += "VOLTAGE_CODE = '" + $(this).val() +"' or ";
  308. }
  309. }
  310. });
  311. if(VOLTAGE_CODE!=""){
  312. VOLTAGE_CODE = VOLTAGE_CODE.substring(0,VOLTAGE_CODE.lastIndexOf("or"));
  313. condition += " ("+VOLTAGE_CODE+") and ";
  314. }
  315. //供电电源标准
  316. var IS_MEET_OF_SUPPLY = "";
  317. $("input:checkbox[name=IS_MEET_OF_SUPPLY]").each(function(){
  318. if($(this).attr("checked")){
  319. if($(this).val()=="0000"){
  320. IS_MEET_OF_SUPPLY += " IS_MEET_OF_SUPPLY = '0' or IS_MEET_OF_SUPPLY = '1' or ";
  321. }else{
  322. IS_MEET_OF_SUPPLY += "IS_MEET_OF_SUPPLY = '" + $(this).val() +"' or ";
  323. }
  324. }
  325. });
  326. if(IS_MEET_OF_SUPPLY!=""){
  327. IS_MEET_OF_SUPPLY = IS_MEET_OF_SUPPLY.substring(0,IS_MEET_OF_SUPPLY.lastIndexOf("or"));
  328. condition += " ("+IS_MEET_OF_SUPPLY+") and ";
  329. }
  330. //自备应急电源标准
  331. var IS_MEET_OF_SELF_PROVIDE = "";
  332. $("input:checkbox[name=IS_MEET_OF_SELF_PROVIDE]").each(function(){
  333. if($(this).attr("checked")){
  334. if($(this).val()=="0000"){
  335. IS_MEET_OF_SELF_PROVIDE += " IS_MEET_OF_SELF_PROVIDE = '0' or IS_MEET_OF_SELF_PROVIDE = '1' or ";
  336. }else{
  337. IS_MEET_OF_SELF_PROVIDE += "IS_MEET_OF_SELF_PROVIDE = '" + $(this).val() +"' or ";
  338. }
  339. }
  340. });
  341. if(IS_MEET_OF_SELF_PROVIDE!=""){
  342. IS_MEET_OF_SELF_PROVIDE = IS_MEET_OF_SELF_PROVIDE.substring(0,IS_MEET_OF_SELF_PROVIDE.lastIndexOf("or"));
  343. condition += " ("+IS_MEET_OF_SELF_PROVIDE+") and ";
  344. }
  345. //部门id
  346. var dpids = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  347. if(zTreeCompId=="" || zTreeCompId==dpids){
  348. condition += " dept_id="+dpids+" and ";
  349. }else{
  350. condition += " dept_id="+zTreeCompId+" and ";
  351. }
  352. var params = {
  353. "condition" : condition
  354. } ;
  355. g.setOptions({"params":params});
  356. g.rend();
  357. }
  358. //清空
  359. function resetSearch(){
  360. $('#NAME').val("");
  361. $("input:checkbox[name=KIND]").attr("checked",false);
  362. $("input:checkbox[name=IMPORT_LEVEL]").attr("checked",false);
  363. $("input:checkbox[name=VOLTAGE_CODE]").attr("checked",false);
  364. $("input:checkbox[name=IS_MEET_OF_SUPPLY]").attr("checked",false);
  365. $("input:checkbox[name=IS_MEET_OF_SELF_PROVIDE]").attr("checked",false);
  366. }
  367. //汇总(汇总本级单位预案信息)
  368. function huizong(){
  369. window.location.href="customer-poll.jsp";
  370. }
  371. //点击查看
  372. function jumpPage(id){
  373. window.location.href="customer-focusinfo.jsp?"+id;
  374. }
  375. //点击主键跳转详细信息页面
  376. this.openDetail = function(rowindex) {
  377. var row = g.getRow(rowindex);
  378. var fd_id = row.FD_OBJECTID;
  379. // window.location.href="customer-focusinfo2.jsp?"+fd_id;
  380. $.indexOpenNextWindow("/nwyj/page/business/am/customer/customer-focusinfo2.jsp?"+fd_id);
  381. };
  382. function showPrimaryKey(obj,index){
  383. var fd_id = obj.FD_OBJECTID;
  384. // window.location.href="customer-focusinfo2.jsp?"+fd_id;
  385. $.indexOpenNextWindow("/nwyj/page/business/am/customer/customer-focusinfo2.jsp?"+fd_id);
  386. }
  387. $.messager=top.Dialog;
  388. function more() {
  389. $('#moreDiv').toggle(400,function(){
  390. // $("#emptyCondition").click();
  391. // $(parent.document.body).find("#frmright").height($(window.document.body).height()+30);
  392. checkAndSetHeight();//changeFormat.js
  393. });
  394. }