8f0a73596e9e415178221678764aed3cb9800324.svn-base 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677
  1. //汇总
  2. //数据表格使用
  3. var g;
  4. var gridArray=[];
  5. // 公司名称数组--X轴数据
  6. var compIds = "";
  7. var series = "";
  8. var gridData = "";
  9. //单位ID
  10. var deptName = null;
  11. var role_ids = null;
  12. var sUtil = null;
  13. var yesNoData = {"list":[{"value":"是","key":"是"},{"value":"否","key":"否"}]};
  14. var level = {"list":[{"value":"特级","key":"特级"},{"value":"一级","key":"一级"},{"value":"二级","key":"二级"},{"value":"三级","key":"三级"}]};
  15. var voltage = {"list":[{"value":"10kV","key":"10kV"},{"value":"35kV","key":"35kV"},{"value":"110kV","key":"110kV"},{"value":"220kV","key":"220kV"},{"value":"380kV","key":"380kV"},{"value":"500kV","key":"500kV"}]};
  16. $(function(){
  17. /*sUtil = new SearchUtil();
  18. deptName = sUtil.resolveUrl().dept_id;*/
  19. });
  20. //$(function(){
  21. // var deptUrl = $.pathname() + "/ws/cockpit/CockpitService/selectTreeDept";
  22. // $.post(deptUrl, {unitId:sUtil.resolveUrl().dept_id }, function(data) {
  23. // console.log(JSON.stringify(data))
  24. // });
  25. //});
  26. /*//总体情况
  27. var oneCols = [ { display:'特级', columns:[{ display:'户数', name:'tjcustomerNum', minWidth:60, width:70, render:showMsg }] },
  28. { display:'一级', columns:[{ display:'户数', name:'yjcustomerNum', minWidth:60, width:70, render:showMsg }] },
  29. { display:'二级', columns:[{ display:'户数', name:'ejcustomerNum', minWidth:60, width:70, render:showMsg }] },
  30. { display:'合计', columns:[{ display:'户数', name:'hejiSum', minWidth:60, width:70, render:showMsg }] }];
  31. //供电电源配置符合要求情况
  32. var twoCols = [ { display:'特级', columns:[{ display:'户数', name:'tjgdmzcustomerNum', minWidth:60, width:70, render:showMsg },
  33. { display:'合格率(%)', name:'tjgdbfbcustomerNum', minWidth:60, width:90 }] },
  34. { display:'一级', columns:[{ display:'户数', name:'yjgdmzcustomerNum', minWidth:60, width:70, render:showMsg },
  35. { display:'合格率(%)', name:'yjgdmzbfbcustomerNum', minWidth:60, width:90 }] },
  36. { display:'二级', columns: [{ display:'户数', name:'ejgdmzcustomerNum', minWidth:60, width:70, render:showMsg },
  37. { display:'合格率(%)', name:'ejgdmzbfbcustomerNum', minWidth:60, width:90 }] },
  38. { display:'合计', columns:[{ display:'户数', name:'hejidmSum', minWidth:60, width:70, render:showMsg },
  39. { display:'合格率(%)', name:'hejidmbfbSum', minWidth:60, width:90 }] }];
  40. //自备应急电源配置符合要求情况
  41. var threeCols = [ { display:'特级', columns:[{ display:'户数', name:'tjzbmzcustomerNum', minWidth:60, width:70, render:showMsg },
  42. { display:'合格率(%)', name:'tjzbmzbfbcustomerNum', minWidth:60,width:90 }] },
  43. { display:'一级', columns:[{ display:'户数', name:'yjzbmzcustomerNum', minWidth:60, width:70, render:showMsg },
  44. { display:'合格率(%)', name:'yjzbmzbfbcustomerNum', minWidth:60, width:90 }] },
  45. { display:'二级', columns:[{ display:'户数', name:'ejzbmzcustomerNum', minWidth:60, width:70, render:showMsg },
  46. { display:'合格率(%)', name:'ejzbmzbfbcustomerNum', minWidth:60,width:90 }] },
  47. { display:'合计', columns:[{ display:'户数', name:'hejizbSum', minWidth:60, width:70, render:showMsg },
  48. { display:'合格率(%)', name:'hejizbbfbSum', minWidth:60, width:90 }] }];
  49. //“双不满足”基本情况
  50. var fourCols = [ { display:'特级', columns:[{ display:'户数', name:'tjsfcustomerNum', minWidth:60, width:70, render:showMsg }] },
  51. { display:'一级', columns:[{ display:'户数', name:'yjsfcustomerNum', minWidth:60, width:70, render:showMsg }] },
  52. { display:'二级', columns:[{ display:'户数', name:'ejsfcustomerNum', minWidth:60, width:70 ,render:showMsg }] },
  53. { display:'合计', columns:[{ display:'总户数', name:'hejisfSum', minWidth:60, width:70, render:showMsg }] }];
  54. */
  55. var oneCols1= [{display : '客户编号', name : 'MRID_308', width : "200",valign : 'center',isPrimaryKey:true,isSort:false, editor: { type: 'text',maxlength:64,tip:'请输入英文或数字' }},
  56. {display : '客户类别', name : 'KIND_308', width : "200",align : 'center',showTitle:true,editor: { type: 'text',maxlength:64,tip:'请输入英文或数字' },isSort:false},
  57. {display : '供电单位', name : 'OWNER_STATION_308', width : "200",align : 'center',showTitle:true,editor: { type: 'test',maxlength:64 },isSort:false},
  58. {display : '重要等级', name : 'IMPORT_LEVEL_308', width : "200",align : 'center',showTitle:true,editor: { type: 'select',data:level,selWidth:200 },isSort:false},
  59. {display : '电压等级', name : 'VOLTAGE_CODE_308', width : "200",align : 'center',showTitle:true,editor: { type: 'select',data:voltage,selWidth:200 },isSort:false},
  60. {display : '装见容量(kVA)',name : 'AGREEMENT_CAPACITY_308',width : "200",align : 'center',showTitle:true,editor: { type: 'text',maxlength:64,tip:'请输入英文或数字' },isSort:false},
  61. {display : '保安负荷(kW)' ,name : 'SECUIRITY_LOAD_308', width : "200",align : 'center',showTitle:true,editor: { type: 'text',maxlength:64,tip:'请输入英文或数字' },isSort:false} ];
  62. var oneCols2= [ {display : '供电电源1', columns : [{display : '供电线路',name : 'POWER1_LINE_NAME_308',width : "200",align : 'center',showTitle:true,editor: { type: 'text',maxlength:64,tip:'请输入英文或数字' },isSort:false},
  63. {display : '上级变电站',name : 'POWER1_SUBSTATION_NAME_308',width : "200",align : 'center',showTitle:true,editor: { type: 'text',maxlength:64,tip:'请输入英文或数字' },isSort:false}]},
  64. {display : '供电电源2', columns : [{display : '供电线路',name : 'POWER2_LINE_NAME_308',width : "200",align : 'center',showTitle:true,editor: { type: 'text',maxlength:64,tip:'请输入英文或数字' },isSort:false},
  65. {display : '上级变电站',name : 'POWER2_SUBSTATION_NAME_308',width : "200",align : 'center',showTitle:true,editor: { type: 'text',maxlength:64,tip:'请输入英文或数字' },isSort:false}]},
  66. {display : '供电电源3', columns : [{display : '供电线路',name : 'POWER3_LINE_NAME_308',width : "200",align : 'center',showTitle:true,editor: { type: 'text',maxlength:64,tip:'请输入英文或数字' },isSort:false},
  67. {display : '上级变电站',name : 'POWER3_SUBSTATION_NAME_308',width : "200",align : 'center',showTitle:true,editor: { type: 'text',maxlength:64,tip:'请输入英文或数字' },isSort:false}]},
  68. {display : '供电电源4', columns : [{display : '供电线路',name : 'POWER4_LINE_NAME_308',width : "200",align : 'center',showTitle:true,editor: { type: 'text',maxlength:64,tip:'请输入英文或数字' },isSort:false},
  69. {display : '上级变电站',name : 'POWER4_SUBSTATION_NAME_308',width : "200",align : 'center',showTitle:true,editor: { type: 'text',maxlength:64,tip:'请输入英文或数字' },isSort:false}]},
  70. {display : '供电电源5', columns : [{display : '供电线路',name : 'POWER5_LINE_NAME_308',width : "200",align : 'center',showTitle:true,editor: { type: 'text',maxlength:64,tip:'请输入英文或数字' },isSort:false},
  71. {display : '上级变电站',name : 'POWER5_SUBSTATION_NAME_308',width : "200",align : 'center',showTitle:true,editor: { type: 'text',maxlength:64,tip:'请输入英文或数字' },isSort:false}]},
  72. {display : '供电电源6', columns : [{display : '供电线路',name : 'POWER6_LINE_NAME_308',width : "200",align : 'center',showTitle:true,editor: { type: 'text',maxlength:64,tip:'请输入英文或数字' },isSort:false},
  73. {display : '上级变电站',name : 'POWER6_SUBSTATION_NAME_308',width : "200",align : 'center',showTitle:true,editor: { type: 'text',maxlength:64,tip:'请输入英文或数字' },isSort:false}]},
  74. {display : '供电电源是否满足标准',name : 'IS_MEET_OF_SUPPLY_308',width : "200" ,showTitle:true,editor: { type: 'select',data:yesNoData,selWidth:200 },isSort:false} ];
  75. var oneCols3 =[{display : '自备应急电源容量(kW)', name : 'OWNED_SOURCE_CAPACITY_308',width : "200",align : 'center',showTitle:true,editor: { type: 'text',maxlength:64,tip:'请输入数字' },isSort:false},
  76. {display : '自备应急电源配比(%)', name : 'ONESELF_EMERGENCIES_RATIO_308',width : "200",align : 'center',showTitle:true,editor: { type: 'text',maxlength:64,tip:'请输入数字' },isSort:false,
  77. render:function(rowdata,rowindex,value,column){
  78. if(value==null || $.trim(value)==""||value==undefined){
  79. return value;
  80. }else{
  81. return value+"%";
  82. };
  83. }
  84. },
  85. {display : '自备应急电源是否满足标准',name : 'IS_MEET_OF_SELF_PROVIDE_308',width : "200",align : 'center',showTitle:true,editor: { type: 'select',data:yesNoData,selWidth:200 },isSort:false} ];
  86. function showMsg(rowdata ,rowindex,value,column){
  87. if("总计"==rowdata.name){
  88. return value;
  89. }else{
  90. return '<a href="javascript:void(0)" '
  91. + 'onclick=showDetail("'
  92. + rowdata.compid
  93. + '",'+'"'+column.name+ '",'+'"'+value+'")>'+value+'</a>';
  94. }
  95. };
  96. function addStatus(rowdata, rowindex, value, column) {
  97. if (value == '总计') {
  98. return "<div style='background-color: #f2f2f2'>" + value + "</div>";
  99. } else {
  100. return "<div style='background-color: #dde5f0' class='company' title='"
  101. + value + "'>" + value + "</div>";
  102. }
  103. }
  104. // 表格的初始化
  105. function initComplete() {//gridData
  106. sUtil = new SearchUtil();
  107. deptName = sUtil.resolveUrl().dept_id;
  108. role_ids = sUtil.resolveUrl().role_id;
  109. $("body").eq(0).showLoading();
  110. g = $("#maingrid").quiGrid({
  111. columns:[{ display: '重要客户基本信息' , columns : oneCols1 , width: "", align:'center' },
  112. { display: '供电电源情况' , columns : oneCols2 , width: "", align:'center' },
  113. { display: '自备应急电源情况' , columns : oneCols3 , width: "", align:'center' },
  114. { display: '备注', name: '', align: 'center' , width: "200" ,isSort:false},
  115. { display: '操作',id:"caozuo", isAllowHide:false, width : "220",align : 'center',frozen:true,
  116. render:function(rowdata,rowindex,value,column){
  117. var h = '<div class="padding_top4 padding_left5">&nbsp;';
  118. if (rowdata._editing){
  119. h += '<span class="bul_ok hand" title="提交" onclick="endEdit(' + rowindex + ')"></span>&nbsp;' +
  120. '<span class="img_delete hand" title="取消" onclick="cancelAllEdit(' + rowindex + ')"></span>&nbsp;' +
  121. '</div>';
  122. }else{
  123. h += '<span class="img_edit hand" title="修改" onclick="beginEdit(' + rowindex + ')"></span>&nbsp;' +
  124. '<span class="img_delete hand" title="删除" onclick="onDelete(\'' + rowdata.FD_OBJECTID_308+"\'" + ')"></span>' ;
  125. h += '&nbsp;<img class="hand" title="调整" onclick="changeColor('+rowindex+', 1)" src="/nwyj/scripts/qui/libs/images/colorball/red1.png">' +
  126. '&nbsp;<img class="hand" title="调整" onclick="changeColor('+rowindex+', 2)" src="/nwyj/scripts/qui/libs/images/colorball/yellow1.png">' +
  127. '&nbsp;<img class="hand" title="调整" onclick="changeColor('+rowindex+', 3)" src="/nwyj/scripts/qui/libs/images/colorball/green1.png">' +
  128. '&nbsp;<img class="hand" title="调整" onclick="changeColor('+rowindex+', 4)" src="/nwyj/scripts/qui/libs/images/colorball/none.png"></div>';
  129. };
  130. return h;
  131. }
  132. },
  133. { display:'客户名称', name:'NAME_308', width:"200", align:'center', showTitle:true, editor: { type: 'text',maxlength:64,tip:'请输入英文或数字' }, isSort:false, frozen:true,
  134. render : function(rowdata, rowindex, value, column) {
  135. var c = "none";
  136. if(rowdata.COLOR_LEVEL_308=="1"){
  137. c = "#ff0000";
  138. }else if(rowdata.COLOR_LEVEL_308=="2"){
  139. c = "#dcdc22";
  140. }else if(rowdata.COLOR_LEVEL_308=="3"){
  141. c = "#4bfb4b";
  142. }else if(rowdata.COLOR_LEVEL_308=="4"){
  143. c = "none";
  144. };
  145. return "<div style='background:"+c+";'><a href='javascript:;' class='fro_name' title='" + value + "' onclick='openDetail(" + rowindex + ")'>" + value + "</a></div>";
  146. }
  147. }],
  148. url : $.pathname() + '/ws/crud/CRUDService/queryQui',
  149. params:{"listId":'308', "condition":"IS_DEL='0'"},
  150. rownumbers : true,
  151. usePager : true,
  152. width : "100%",
  153. height:"570",
  154. pageSize : 10,
  155. sortName : "COLOR_LEVEL",
  156. sortOrder:"ASC",
  157. autoCheckChildren : true,
  158. tree : { columnId : 'name' },
  159. toolbar:{items:[{text: '新增' , click: addRow , iconClass: 'icon_add'}, {line : true },
  160. {text: '单位排序', click: orderUnit , iconClass: 'order_icon'}, {line : true },
  161. {text: '等级排序', click: orderName , iconClass: 'order_icon'}, {line : true },
  162. {text: '颜色排序', click: orderColor, iconClass: 'order_icon'}, {line : true },
  163. {text: '同步系统重要用户', click: synchronizationSysUser, iconClass: 'synchronization_icing'}, {line : true },
  164. {text: '查看统计', click: statisticsSystem , iconClass: 'import_tem'} ]},
  165. enabledEdit: true,
  166. alternatingRow:false,
  167. rowAttrRender: function(rowdata, rowindex, rowid){
  168. return rowdata["__index"] % 2 == 0 ? "style='background-color:#f5f5f5;'" : "" ;
  169. },
  170. clickToEdit: false,
  171. onDblClickRow:function(rowdata, rowindex){ g.beginEdit(rowindex); },
  172. onBeforeEdit: onBeforeEdit,
  173. onBeforeSubmitEdit: onBeforeSubmitEdit,
  174. onAfterSubmitEdit: onAfterSubmitEdit,
  175. onAfterShowData:function(){
  176. if(role_ids.indexOf("R002105430335")>-1){
  177. g.toggleCol("caozuo",true);
  178. }else{
  179. g.toggleCol("caozuo",false);
  180. }
  181. }
  182. });
  183. /*
  184. $.ajax({
  185. // url : $.pathname()+ "/ws/customerHuiZong/customerHuiZongService/getZYCustomerInfo",
  186. // url : $.pathname()+ "/ws/customerHuiZong/customerHuiZongService/getCustomerModel",
  187. url : $.pathname() + '/ws/crud/CRUDService/queryQui',
  188. type : 'post',
  189. timeout : 60000,
  190. // data : {id : deptName},
  191. data : {"listId":'308', "condition":"IS_DEL='0' ORDER BY UPDATEDATE DESC"},
  192. dataType : 'json',
  193. success : function(data){
  194. g = $("#maingrid").quiGrid({
  195. // columns : [{ display:'供电单位', "name":'name', id:'name', width:130, dept_id:'dept_id', frozen:true, align:'left', render:addStatus},
  196. // { display:'总体情况', columns:oneCols, width:"", align:'center' },
  197. // { display:'供电电源配置符合要求情况', columns:twoCols, width:"", align:'center' },
  198. // { display:'自备应急电源配置符合要求情况', columns:threeCols, width:"", align:'center' },
  199. // { display:'“双不满足”基本情况', columns:fourCols, width:"", align:'center' }],
  200. columns: [{ display: '重要客户基本信息' , columns : oneCols1 , width: "", align:'center' },
  201. { display: '供电电源情况' , columns : oneCols2 , width: "", align:'center' },
  202. { display: '自备应急电源情况' , columns : oneCols3 , width: "", align:'center' },
  203. { display: '备注', name: '', align: 'center' , width: "200" ,isSort:false},
  204. { display: '操作', isAllowHide:false, width : "100",align : 'left',frozen:true,
  205. render:function(rowdata,rowindex,value,column){
  206. var h = '<div class="padding_top4 padding_left5">&nbsp;';
  207. if (rowdata._editing){
  208. h += '<span class="bul_ok hand" title="提交" onclick="endEdit(' + rowindex + ')"></span>&nbsp;' +
  209. '<span class="img_delete hand" title="取消" onclick="cancelAllEdit(' + rowindex + ')"></span>&nbsp;' +
  210. '</div>';
  211. }else{
  212. h += '<span class="img_edit hand" title="修改" onclick="beginEdit(' + rowindex + ')"></span>&nbsp;' +
  213. '<span class="img_delete hand" title="删除" onclick="onDelete(\'' + rowdata.FD_OBJECTID_308+"\'" + ')"></span>' +
  214. '</div>';
  215. };
  216. return h;
  217. }
  218. }],
  219. data:data,
  220. rownumbers : false,
  221. width : "100%",
  222. usePager : false,
  223. pageSize : 10,
  224. sortName : "UPDATEDATE",
  225. // sortOrder: "asc",
  226. autoCheckChildren : true,
  227. tree : { columnId : 'name' },
  228. toolbar:{items:[{text: '新增', click: addRow , iconClass: 'icon_add'}, {line : true },
  229. {text: '汇总', click: addUnit, iconClass: 'icon_add'}, {line : true },
  230. {text: '查看', click: onView , iconClass: 'view_tem'} ]
  231. },
  232. enabledEdit: true,
  233. clickToEdit: false,
  234. onDblClickRow:function(rowdata, rowindex){ g.beginEdit(rowindex); },
  235. onBeforeEdit: onBeforeEdit,
  236. onBeforeSubmitEdit: onBeforeSubmitEdit,
  237. onAfterSubmitEdit: onAfterSubmitEdit
  238. });
  239. gridData=data;
  240. },
  241. error : function(e){
  242. $.messager.alert('系统提示信息', '访问服务失败!', 'error');
  243. }
  244. }); */
  245. $("body").eq(0).hideLoading();
  246. }
  247. function changeColor(rowid, color){
  248. var rowData = g.getRow(rowid);
  249. delete rowData.IS_DEL_308;
  250. delete rowData.UPDATEDATE_308;
  251. delete rowData.__id;
  252. delete rowData.__previd;
  253. delete rowData.__index;
  254. delete rowData.__pid;
  255. delete rowData.__level;
  256. delete rowData.__hasChildren;
  257. delete rowData.__status;
  258. delete rowData.rowPosition;
  259. rowData.COLOR_LEVEL_308 = color;
  260. $.post($.pathname() +'/ws/crud/CRUDService/update/',rowToBO(rowData, true),function(result){
  261. if(result.Msg.sucsess){ top.Dialog.alert("调整成功"); }
  262. g.loadData();//刷新表格
  263. },"json");
  264. };
  265. function orderUnit(){
  266. g.setOptions({ sortName : "OWNER_STATION", sortOrder:"DESC" });
  267. g.setNewPage(1);//页号重置为1
  268. g.loadData();//加载数据
  269. };
  270. function orderName(){
  271. g.setOptions({ sortName : "IMPORT_LEVEL", sortOrder:"DESC" });
  272. g.setNewPage(1);//页号重置为1
  273. g.loadData();//加载数据
  274. };
  275. function orderColor(){
  276. g.setOptions({ sortName : "COLOR_LEVEL", sortOrder:"asc" });
  277. g.setNewPage(1);//页号重置为1
  278. g.loadData();//加载数据
  279. };
  280. /**
  281. * 同步系统重要用户数据
  282. */
  283. function synchronizationSysUser(){
  284. top.Dialog.confirm("同步会将当前数据更换为日常管理模块中的重要用户,这将丢失现在的所有数据,确定吗?",function(){
  285. //同步处理
  286. $.post($.pathname() + '/ws/icingZmap/IcingZmapService/synchronizationSystem', {type:"user", dept_id:deptName}, function(result){
  287. orderUnit();
  288. },"json");
  289. });
  290. };
  291. //编辑整行
  292. function beginEdit(rowid) { g.beginEdit(rowid); }
  293. //编辑前事件
  294. function onBeforeEdit(e){
  295. }
  296. //编辑提交前事件
  297. function onBeforeSubmitEdit(e){
  298. // if(e.newdata.userName==""){
  299. //
  300. // top.Dialog.alert("姓名不能为空!",null,null,null,2);
  301. //
  302. // return false;
  303. //
  304. // }
  305. //
  306. // else if (!validateInput(e.newdata.userName, "^[\u4e00-\u9fa5]+$")){
  307. //
  308. // top.Dialog.alert("姓名需要是中文!",null,null,null,2);
  309. //
  310. // return false;
  311. //
  312. // }
  313. //
  314. //
  315. //
  316. // if(e.newdata.userLoginName==""){
  317. //
  318. // top.Dialog.alert("用户名不能为空!",null,null,null,2);
  319. //
  320. // return false;
  321. //
  322. // }
  323. //
  324. // else if (!validateInput(e.newdata.userLoginName, "^[0-9a-zA-Z]+$")){
  325. //
  326. // top.Dialog.alert("用户名需要是字母或数字!",null,null,null,2);
  327. //
  328. // return false;
  329. //
  330. // }
  331. //
  332. //
  333. //
  334. // if(e.newdata.userPassword==""){
  335. //
  336. // top.Dialog.alert("密码不能为空!",null,null,null,2);
  337. //
  338. // return false;
  339. //
  340. // }
  341. //
  342. // else if (e.newdata.userPassword.length<6||e.newdata.userPassword.length>11){
  343. //
  344. // top.Dialog.alert("密码需要是6-11位!",null,null,null,2);
  345. //
  346. // return false;
  347. //
  348. // }
  349. //
  350. // else if (!validateInput(e.newdata.userPassword, "^[0-9a-zA-Z]+$")){
  351. //
  352. // top.Dialog.alert("密码需要是字母或数字!",null,null,null,2);
  353. //
  354. // return false;
  355. //
  356. // }
  357. }
  358. //编辑后事件
  359. function onAfterSubmitEdit(e){
  360. //在这里一律作修改处理
  361. var rowData = e.newdata;
  362. rowData.FD_OBJECTID_308 = e.record.FD_OBJECTID_308;
  363. // {"MRID_308":"0","KIND_308":"0","OWNER_STATION_308":"0","IMPORT_LEVEL_308":"","VOLTAGE_CODE_308":"","AGREEMENT_CAPACITY_308":"0.00","SECUIRITY_LOAD_308":"0","POWER1_LINE_NAME_308":"0","POWER1_SUBSTATION_NAME_308":"0","POWER2_LINE_NAME_308":"0","POWER2_SUBSTATION_NAME_308":"0","POWER3_LINE_NAME_308":"0","POWER3_SUBSTATION_NAME_308":"0","POWER4_LINE_NAME_308":"0","POWER4_SUBSTATION_NAME_308":"0","POWER5_LINE_NAME_308":"0","POWER5_SUBSTATION_NAME_308":"0","POWER6_LINE_NAME_308":"0","POWER6_SUBSTATION_NAME_308":"0","IS_MEET_OF_SUPPLY_308":"","OWNED_SOURCE_CAPACITY_308":"0","ONESELF_EMERGENCIES_RATIO_308":"0","IS_MEET_OF_SELF_PROVIDE_308":"","NAME_308":"怎么会这样","FD_OBJECTID_308":"308148189415011100000025100000"}
  364. //ajax方式提交数据到数据库
  365. $.post($.pathname() +'/ws/crud/CRUDService/update/',rowToBO(rowData, true),function(result){
  366. if(result.Msg.sucsess){ top.Dialog.alert(result.Msg.info); }
  367. },"json");
  368. };
  369. //结束编辑
  370. function endEdit(){
  371. g.endEdit();
  372. };
  373. //全部取消修改
  374. function cancelAllEdit(){
  375. g.cancelEdit();
  376. };
  377. //新增
  378. function addRow(){
  379. var row = g.getRow(0);
  380. var rowData={ MRID_308:"", NAME_308:"", KIND_308:"", OWNER_STATION_308:"", IMPORT_LEVEL_308:"",
  381. VOLTAGE_CODE_308:"", AGREEMENT_CAPACITY_308:"", SECUIRITY_LOAD_308:"",
  382. POWER1_LINE_NAME_308:"", POWER1_SUBSTATION_NAME_308:"", POWER2_LINE_NAME_308:"",
  383. POWER2_SUBSTATION_NAME_308:"", POWER3_LINE_NAME_308:"", POWER3_SUBSTATION_NAME_308:"",
  384. POWER4_LINE_NAME_308:"", POWER4_SUBSTATION_NAME_308:"", POWER5_LINE_NAME_308:"",
  385. POWER5_SUBSTATION_NAME_308:"", POWER6_LINE_NAME_308:"", POWER6_SUBSTATION_NAME_308:"",
  386. IS_MEET_OF_SUPPLY_308:"", OWNED_SOURCE_CAPACITY_308:"", ONESELF_EMERGENCIES_RATIO_308:"",
  387. IS_MEET_OF_SELF_PROVIDE_308:""};
  388. g.addEditRow(rowData, row, true);
  389. //在这里做新增处理
  390. $.post($.pathname() + '/ws/crud/CRUDService/create',rowToBO(rowData, false),function(result){
  391. if(result.Msg.sucsess){
  392. g.getRow(0).FD_OBJECTID_308 = result.Msg.objectID;
  393. };
  394. },"json");
  395. };
  396. //将row JSON对象转化为bo对象
  397. function rowToBO(row, flag) {
  398. var params = row;
  399. params.classid = 308;
  400. if(flag){ params.FD_OBJECTID308 = row.FD_OBJECTID_308; };
  401. var seri_params = $.param(params);
  402. return seri_params;
  403. };
  404. //查看统计
  405. function statisticsSystem(){
  406. window.parent.window.openStatisticsSystemVipUser();
  407. };
  408. //删除
  409. function onDelete(fd_id){
  410. top.Dialog.confirm("确定要删除该记录吗?",function(){
  411. var result = sUtil.getJsonData($.pathname() +"/ws/crud/CRUDService/delete", {objectIDs : fd_id, classid : 308});
  412. // $.post($.pathname() +"/ws/crud/CRUDService/delete/", { objectIDs : [row.FD_OBJECTID_308], classid : 308 }, function(result){
  413. // {"Msg":{"data":"","info":"删除成功","objectID":"","sucsess":true}} 308148188693307700000002100000
  414. //
  415. //// handleResult(result);
  416. // },"json");
  417. g.loadData();//刷新表格
  418. });
  419. };
  420. //查询
  421. function searchHandler(){
  422. var tn = $.trim($("#NAME_308").val());
  423. //去掉水印
  424. if(tn!="" && tn=="请输入名称"){
  425. $("#NAME_308").val("");
  426. }
  427. g.setOptions({params:{ listId:'308', sortName : "COLOR_LEVEL", sortOrder:"ASC", condition:"IS_DEL= '0' and NAME LIKE '%"+ $.trim($("#NAME_308").val()) +"%'"}});
  428. g.setNewPage(1);//页号重置为1
  429. g.loadData();//加载数据
  430. };
  431. /*
  432. //清单
  433. //单位ID
  434. var deptName = null;
  435. var deptId = null;
  436. var getUser_id = sUtil.resolveUrl().user_id;
  437. var loadParams = { "id" : deptName };
  438. var g;
  439. var sUtil = null;
  440. $(function(){
  441. sUtil = new SearchUtil();
  442. deptName = sUtil.resolveUrl().dept_id;
  443. deptId = deptName;
  444. });
  445. var oneCols1= [{display : '客户编号',name : 'FD_OBJECTID',width : "200",align : 'center',isPrimaryKey:true,isSort:false,
  446. render : function(rowdata, rowindex, value, column) {
  447. return "<a href='javascript:;' style='width:100%;height:100%;display:block' title='" + value + "' onclick='openDetail(" + rowindex + ")'>" + value + "</a>";
  448. }
  449. },
  450. {display : '客户名称', name : 'CUSTOMER_NAME', width : "200",align : 'left', showTitle:true,isSort:false},
  451. {display : '客户类别', name : 'CUSTOMER_KIND', width : "200",align : 'center',showTitle:true,isSort:false},
  452. {display : '供电单位', name : 'OWNER_STATION', width : "200",align : 'center',showTitle:true,isSort:false},
  453. {display : '重要等级', name : 'IMPORT_LEVEL', width : "200",align : 'center',showTitle:true,isSort:false},
  454. {display : '电压等级', name : 'VOLTAGE_CODE', width : "200",align : 'center',showTitle:true,isSort:false},
  455. {display : '装见容量(kVA)',name : 'AGREEMENT_CAPACITY',width : "200",align : 'center',showTitle:true,isSort:false},
  456. {display : '保安负荷(kW)' ,name : 'SECUIRITY_LOAD', width : "200",align : 'center',showTitle:true,isSort:false} ];
  457. var oneCols2= [{display : '供电电源1', columns : [{display : '供电线路',name : 'GDXL1',width : "200",align : 'center',showTitle:true,isSort:false},
  458. {display : '上级变电站',name : 'SJBDZ1',width : "200",align : 'center',showTitle:true,isSort:false}]},
  459. {display : '供电电源2', columns : [{display : '供电线路',name : 'GDXL2',width : "200",align : 'center',showTitle:true,isSort:false},
  460. {display : '上级变电站',name : 'SJBDZ2',width : "200",align : 'center',showTitle:true,isSort:false}]},
  461. {display : '供电电源3', columns : [{display : '供电线路',name : 'GDXL3',width : "200",align : 'center',showTitle:true,isSort:false},
  462. {display : '上级变电站',name : 'SJBDZ3',width : "200",align : 'center',showTitle:true,isSort:false}]},
  463. {display : '供电电源4', columns : [{display : '供电线路',name : 'GDXL4',width : "200",align : 'center',showTitle:true,isSort:false},
  464. {display : '上级变电站',name : 'SJBDZ4',width : "200",align : 'center',showTitle:true,isSort:false}]},
  465. {display : '供电电源5', columns : [{display : '供电线路',name : 'GDXL5',width : "200",align : 'center',showTitle:true,isSort:false},
  466. {display : '上级变电站',name : 'SJBDZ5',width : "200",align : 'center',showTitle:true,isSort:false}]},
  467. {display : '供电电源6', columns : [{display : '供电线路',name : 'GDXL6',width : "200",align : 'center',showTitle:true,isSort:false},
  468. {display : '上级变电站',name : 'SJBDZ6',width : "200",align : 'center',showTitle:true,isSort:false}]},
  469. {display : '供电电源是否满足标准',name : 'IS_MEET_OF_SUPPLY',width : "200" ,showTitle:true,isSort:false} ];
  470. var oneCols3 =[{display : '自备应急电源容量(kW)', name : 'OWNED_SOURCE_CAPACITY',width : "200",align : 'center',showTitle:true,isSort:false},
  471. {display : '自备应急电源配比(%)', name : '',width : "200",align : 'center',showTitle:true,isSort:false},
  472. {display : '自备应急电源是否满足标准',name : 'IS_MEET_OF_SELF_PROVIDE',width : "200",align : 'center',showTitle:true,isSort:false} ];
  473. function initComplete() {//gridData
  474. $("body").eq(0).showLoading();
  475. $.ajax({
  476. url : $.pathname()+ "/ws/customerHuiZong/customerHuiZongService/getCustomerModel",
  477. type : 'post',
  478. timeout : 60000,
  479. data : { "id" : deptName },
  480. dataType : 'json',
  481. success : function(data){
  482. g = $("#maingrid").quiGrid({
  483. columns: [{ display: '重要客户基本信息' , columns : oneCols1 , width: "1600" },
  484. { display: '供电电源情况' , columns : oneCols2 , width: "2600" },
  485. { display: '自备应急电源情况' , columns : oneCols3 , width: "600" },
  486. { display: '备注', name: '', align: 'center' , width: "200" ,isSort:false} ],
  487. data:data,
  488. // rownumbers : false,
  489. width : 960,
  490. pageSize : 10,
  491. percentWidthMode : true,
  492. usePager : false,
  493. autoCheckChildren : true,
  494. tree : { columnId : 'name' }
  495. });
  496. $("body").eq(0).hideLoading();
  497. gridData=data;
  498. },
  499. error : function(e){
  500. $.messager.alert('系统提示信息', '访问服务失败!', 'error');
  501. }
  502. });
  503. }
  504. function initCompleteX(){
  505. *//**
  506. * 工具条
  507. *//*
  508. var roleCons = roleButtonArr();
  509. var toolBarOpt1 = {
  510. items:[
  511. {text: '导出', click: "daochu", iconClass: 'export_tem',id:"10006"},
  512. {text: '汇总', click: "huizong", iconClass: 'poll_tem',id:"10203"}
  513. ],
  514. roleCons:roleCons
  515. };
  516. *//**
  517. * 树形列
  518. *//*
  519. var grid_option1 = {
  520. columns: [
  521. { display: '重要客户基本信息', columns : oneCols1 , width: "1600" },
  522. { display: '供电电源情况', columns : oneCols2 , width: "2600" },
  523. { display: '自备应急电源情况', columns : oneCols3 , width: "600" },
  524. { display: '备注', name: '', align: 'center', width: "200" ,isSort:false}
  525. ],
  526. rownumbers : true,
  527. checkbox : true,
  528. pageSize : 10,
  529. percentWidthMode : true
  530. };
  531. var options1={
  532. url :'/nwyj/ws/customerHuiZong/customerHuiZongService/getCustomerModel',
  533. params:loadParams,
  534. width:960,
  535. gridOptions:grid_option1,
  536. singleRecodeOptions:{a:"aa"},
  537. paperOpration:{showInput:"true"},
  538. toolBarOptions:toolBarOpt1
  539. };
  540. g=gridAndSingleRecode=$("#maingrid").quickgridAndSingleRecode(options1);
  541. }
  542. //点击查看
  543. function jumpPage(id){
  544. window.location.href="customer-focusinfo.jsp?"+id;
  545. }
  546. //点击主键跳转详细信息页面
  547. this.openDetail = function(rowindex) {
  548. var row = g.getRow(rowindex);
  549. var fd_id = row.FD_OBJECTID;
  550. $.indexOpenNextWindow("/nwyj/page/business/am/customer/customer-focusinfo2.jsp?"+fd_id);
  551. };
  552. function showPrimaryKey(obj,index){
  553. var fd_id = obj.FD_OBJECTID;
  554. $.indexOpenNextWindow("/nwyj/page/business/am/customer/customer-focusinfo2.jsp?"+fd_id);
  555. }
  556. $.messager=top.Dialog;
  557. function more() {
  558. $('#moreDiv').toggle(400,function(){
  559. checkAndSetHeight();//changeFormat.js
  560. });
  561. }
  562. */