1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944 |
- var g;
- var mycol;
- var mycol1;
- var testData;
- var checkWrite = false;
- var loginName = top.com.sinosoft.lz.system.user.LoginInfo.getLogin_name();
- var maintableType = "";
- var excType = "";
- var corpId = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- // 保存公司Id变量
- var compId = corpId;
- // 获取用户Id
- var user_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
- var _thisUrl = window.location.href;
- var backUrl = "/nwyj/page/business/em/report/Report_main.jsp";
- // 获取登录用户的角色
- var role_id = getUrlParams("role_Id=", 0, _thisUrl) == "" ? getThing($.pathname()+ "/ws/getUserRole/GetRoleService/getRoleByType", {
- report_type : getUrlParams("", 1, _thisUrl)
- }, 'text') : getUrlParams("role_Id=", 0, _thisUrl);
- var corpName = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_names();
- var deptName = top.com.sinosoft.lz.system.user.LoginInfo.getDeptnames();
- var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
- var real_name = top.com.sinosoft.lz.system.user.LoginInfo.getReal_name();
- // 初始化时的报表类型
- var report_types = "";
- var isValida = true; // 是否需要验证
- var require = "";
- var flag = false;
- var flag1 = false;
- var selecta = "";
- var editingRow = "";
- var totalFlag = true;
- var deptFlag = getThing($.pathname()+ "/ws/getRepotDept/ReportDeptService/getDictionaryRole", {
- "corpId" : corpId,
- "deptId" : deptId
- }, "text");
- var deptLevel = getThing($.pathname()
- + "/ws/xianlutingyun/XianlutingyunService/getDeptLevel", {
- "comp_id" : compId
- }, "text");
- // 县区局系统部不考虑班组
- if (deptLevel == "4" && role_id == 'R002105430210') {
- if (deptFlag != "false") {
- deptFlag = "false";
- }
- }
- var yjzyGrid = "";
- if (deptFlag != "false"&&deptFlag.indexOf(role_id)>-1) {
- corpId = deptId;
- }
- //用于明细表新增按钮增加数据
- var newCompName = getThing($.pathname()
- + "/ws/xianlutingyun/XianlutingyunService/getCompName", {
- "comp_id" : corpId,
- "role_id" : role_id
- }, "text");
- //判断是否有回退功能
- var rollbackFlag = false;
- //用于判断本单位是否有配置部门
- var hasBanZuDept = getThing($.pathname()
- + "/ws/xianlutingyun/XianlutingyunService/checkBanZuDept", {
- "comp_id" : corpId,
- "role_id" : role_id
- }, "text");
- //deptLevel<3 ||deptLevel==3且有配置部门的 有回退按钮
- if(deptLevel < "3" || deptLevel == "3" && hasBanZuDept == "true"){
- rollbackFlag = true;
- }
- var clickFlag = false;
- var lockFlag = false;
- // 多个事件类型时需要选择后才汇总下级数据,默认自动汇总
- var totalFlag = true;
- var affairType = "";
- var affairLength = 0;
- var urls1 = $.pathname() + "/ws/xianlutingyun/XianlutingyunService/getAlertMsg";
- var nowRole = role_id;
- var warn_url = $.pathname()
- + "/ws/xianlutingyun/XianlutingyunService/getNeedWritePro";
- var data11 = {
- "list" : [ {
- "value" : "红色预警",
- "key" : "红色预警"
- }, {
- "value" : "橙色预警",
- "key" : "橙色预警"
- }, {
- "value" : "黄色预警",
- "key" : "黄色预警"
- }, {
- "value" : "蓝色预警",
- "key" : "蓝色预警"
- }, {
- "value" : "一级响应",
- "key" : "一级响应"
- }, {
- "value" : "二级响应",
- "key" : "二级响应"
- }, {
- "value" : "三级响应",
- "key" : "三级响应"
- }, {
- "value" : "四级响应",
- "key" : "四级响应"
- } ]
- };
- var data22 = {
- "list" : [ {
- "value" : "一级响应",
- "key" : "一级响应"
- }, {
- "value" : "二级响应",
- "key" : "二级响应"
- }, {
- "value" : "三级响应",
- "key" : "三级响应"
- }, {
- "value" : "四级响应",
- "key" : "四级响应"
- } ]
- };
- var huifu = {
- "list" : [ {
- "value" : "是",
- "key" : "是"
- }, {
- "value" : "否",
- "key" : "否"
- } ]
- };
- // 下拉框的值
- var shqk = {
- "list" : [ {
- "value" : "轻伤",
- "key" : "轻伤"
- }, {
- "value" : "重伤",
- "key" : "重伤"
- }, {
- "value" : "死亡",
- "key" : "死亡"
- }, {
- "value" : "受困",
- "key" : "受困"
- }, {
- "value" : "失踪",
- "key" : "失踪"
- }, {
- "value" : "其它",
- "key" : "其它"
- } ]
- };
- var areaData;
- if (deptLevel == 3) {
- areaData = {
- "list" : [ {
- "value" : "0",
- "key" : "不跨省调拨"
- }, {
- "value" : "1",
- "key" : "跨省调拨"
- } ]
- };
- } else {
- areaData = {
- "list" : [ {
- "value" : "0",
- "key" : "不跨市调拨"
- }, {
- "value" : "1",
- "key" : "跨市调拨"
- } ]
- };
- }
- // var areaData = {"list" : [ {"value" : "0","key" : "本地"}, {"value" : "1","key"
- // : "跨区域"}]};
- var xb = {
- "list" : [ {
- "value" : "男",
- "key" : "男"
- }, {
- "value" : "女",
- "key" : "女"
- }
- ]
- };
- var dbtype = {
- "list" : [ {
- "value" : "变电站",
- "key" : "变电站"
- }, {
- "value" : "发电厂",
- "key" : "发电厂"
- }, {
- "value" : "换流站",
- "key" : "换流站"
- }, {
- "value" : "用户站",
- "key" : "用户站"
- }
- ]
- };
- var dydj = {
- "list" : [
- /* {"value":"800kV","key":"800kV"}, */
- {
- "value" : "500kV",
- "key" : "500kV"
- }, {
- "value" : "220kV",
- "key" : "220kV"
- }, {
- "value" : "110kV",
- "key" : "110kV"
- }, {
- "value" : "35kV",
- "key" : "35kV"
- } ]
- };
- var wh = "";
- /*
- * var xqData = { "rows" :
- * [{"FD_OBJECTID":"","COMP_ID":corpId,"COMP_NAME":corpName},] };
- */
- var xqData;
- function initComplete() {
- $(".mainCon").live("click", function() {
- if (maintableType != "1") {
- g.endEdit();
- }
- });
- $(".l-grid-hd-cell-text").css("color", "white");
- // 自动补齐数据
- $("#lock").live("click", function() {
- if (!lockFlag) {
- lockFlag = true;
- $("#lock").parent().addClass("backcolor");
- $("#lock").attr("title", "单元格获取上次数据开启");
- } else {
- lockFlag = false;
- $("#lock").parent().removeClass("backcolor");
- $("#lock").attr("title", "单元格获取上次数据关闭");
- }
- });
- // 修改下级数据
- /*
- * $(".company").live("click",function(){ if(!clickFlag){ return ; } var
- * type = $("#sel").val(); var row = g.getSelectedRow(); var comp =
- * row.COMP_ID; var compName = row.COMP_NAME; var dept_level =
- * getThing($.pathname() +
- * "/ws/xianlutingyun/XianlutingyunService/getDeptLevel",{"comp_id":comp},"text");
- * if(row.hasData=="0"){ top.Dialog.alert("没有下级数据"); return ; }
- *
- * var diag = new top.Dialog(); diag.Title = "修改报表"; //diag.URL =
- * encodeURI("/nwyj/page/business/em/report/Alert_Data.html?"+type+"?"+comp+"?"+fd_id+"?"+compName+"?"+role_id+"?"+dept_level);
- * diag.URL = encodeURI("/nwyj/page/business/em/report/Alert_Data.html");
- * diag.Height = 560; diag.Width= 1200;
- *
- * diag.showOkButton = false; diag.showCancelButton = false;
- * diag.ShowMaxButton = true; diag.show();//显示窗口 diag.OnLoad=function(){
- * diag.innerFrame.contentWindow.showData(g,type,comp,compName,role_id,deptFlag,dept_level,corpId); };
- * });
- */
- console.log(_thisUrl);
- if (_thisUrl.indexOf("role_Id=") == -1) {// 从代办进入填报页面
- var reportData = window.location.href.split("?");
- var fdIds = reportData[2];
- // 报表
- var db_type = reportData[1];
- // 初始化报表模版的报表类型
- var dbType = reportData[3];
- // 事件类型
- affairType = decodeURI(reportData[4]);
- var project_name = decodeURI(reportData[5]);
- affairLength = 1;
- var data = {
- "list" : [ {
- "value" : fdIds,
- "key" : affairType,
- "warning" : project_name
- } ]
- };
- $("#affairType").data("data", data);
- $("#affairType").setValue(fdIds);
- $("#affairType").attr("disabled", true);
- $("#affairType").render();
- $("#sel").attr("disabled", true);
- excType = db_type;
- var tableType = getThing($.pathname()
- + "/ws/xianlutingyun/XianlutingyunService/getCheckType", {
- report_type : db_type
- }, 'text');
- maintableType = tableType;
- // 初始化报表模版
- getRole(nowRole, dbType);
- //加载填写说明
- getRequire(nowRole);
- var item = getItem(db_type);
- // 表头
- getColumns(db_type);
- $("#add").text("新增" + corpName + mycol1);
- $("#sel").setValue(db_type);
- changeRequireByVal(db_type);
- if (tableType == "1") {// 明细表
- if (db_type == "7") {
- $("#maingrids").show();
- initGrid(urls1, db_type);
- } else {
- $("#maingrid2").show();
- // 明细表汇总下级数据
- var item1 = getXqItem(db_type);
- checkXqHuiZong(role_id, deptLevel, true);
- initGrid1(xqData, item1, db_type);
- }
- } else {// 统计表
- if (db_type == "8" && (deptLevel == 3 || deptLevel == 4)) {
- $("#areaSel").data("data", areaData);
- $("#areaSel").render();
- $(".areaSel").show();
- } else {
- $(".areaSel").hide();
- }
- $("#maingrid").show();
- getRows(db_type);
- init(testData, item, db_type);
- /*if (db_type != "1") {
- g.setOptions({
- "height" : "90%"
- });
- g.loadData();
- }*/
- // 判断是否汇总下级数据
- checkHuiZong(role_id, deptLevel, true);
- }
- } else {
- // 报表模版初始化
- getRole(nowRole);
- //加载填写说明
- getRequire(nowRole);
- // 报表填报点击新增时新增
- getColumns(getType(nowRole));
- var itemType = $("#sel").val();
- if (itemType == "100") {
- $("#requires").hide();
- }
- excType = itemType;
- changeRequireByVal(itemType);
- var miantableType = getThing($.pathname()
- + "/ws/xianlutingyun/XianlutingyunService/getCheckType", {
- report_type : itemType
- }, 'text');
- maintableType = miantableType;
- var inititem = getItem(itemType);
- $("#add").text("新增" + corpName + mycol1);
- // 获取事件类型
- getReportAffair(itemType, nowRole);
- if (miantableType == "1") {
- if (itemType == "7") {
- $("#maingrids").show();
- initGrid(urls1);
- } else {
- $("#maingrid2").show();
- var item2 = getXqItem(itemType);
- // 明细表汇总下级数据
- checkXqHuiZong(role_id, deptLevel, totalFlag);
- initGrid1(xqData, item2);
- }
- } else {
- $("#maingrid").show();
- getRows(itemType);
- init(testData, inititem, itemType);
- // 判断是否汇总下级数据
- checkHuiZong(role_id, deptLevel, totalFlag);
- if (itemType == "100") {
- g.setOptions({
- "height" : "90%"
- });
- g.loadData();
- }
- }
- // getReportNumber(warn_url,itemType,nowRole);
- }
- // onAfterShowData();
- $("#back").hover(function() {
- $(this).attr("src", "/nwyj/images/temp/back_hover.png");
- }, function() {
- $(this).attr("src", "/nwyj/images/temp/back.png");
- });
- // 事件切换
- $("#affairType").on("change",function() {
- affairType = $(this).attr("relText");
- var report_type = $("#sel").val();
- if ("" == affairType || "请选择" == affairType.trim()) {
- g.options.data = testData;
- g.loadData();
- return;
- } else {
- var miantableType = getThing(
- $.pathname()
- + "/ws/xianlutingyun/XianlutingyunService/getCheckType",
- {
- report_type : report_type
- }, 'text');
- if (miantableType == "0") {
- checkHuiZong(role_id, deptLevel, true);
- }
- if (miantableType == "1") {
- checkXqHuiZong(role_id, deptLevel, true);
- }
- }
- });
- }
- $(function() {
- $("#lock").attr("title", "单元格获取上次数据关闭");
- $("#handlerinfo").parent().attr("title", "开启填报报表明细填写情况");
- $("#drscsj").parent().attr("title", "点击导入上次填报的数据");
- $("#hzxjsj").parent().attr("title", "点击自动汇总导入下级上报的数据");
- $("#hzxjsj_xq").parent().attr("title", "点击自动汇总导入下级上报的数据");
- $(".l-grid-hd-cell-text").css("color", "white");
- $more = $("#more"); // 更多按钮
- $more.bind('click', function() {
- more();
- });
- });
- // 初始化表格
- function init(data, item, type) {
- g = null;
- var gridObj = "";
- if (type != "8") {
- gridObj = $("#maingrid");
- $("#yjzy").hide();
- $("#maingrid").show();
- } else {
- gridObj = $("#yjzy");
- $("#yjzy").show();
- $("#maingrid").hide();
- if (deptLevel == 3 || deptLevel == 4) {
- $(".areaSel").show();
- } else {
- $(".areaSel").hide();
- }
- }
- g = gridObj
- .quiGrid({
- columns : mycol,
- data : data,
- usePager : false,
- sortName : 'id',
- headerRowHeight : 50,
- rownumbers : true,
- enabledEdit : true, // 编辑用
- width : "100%",
- /* height:"80%", */
- multihead : true,
- enabledSort : false,
- excelMode : true,
- alternatingRow : false,
- rowAttrRender : function(rowdata, rowid) {
- return "0" == rowdata.OVERSTAT ? "style=\"background-color:yellow;\""
- : '';
- },
- toolbar : {
- items : item
- },
- onAfterEdit : onAfterEdit,
- onBeforeEdit : onBeforeEdit,
- onAfterShowData : function() {
- setTjContentHeight(type);
- },
- onAfterChangeColumnWidth : changeColWidth
- });
- if (totalFlag) {
- $("#hzxjsj").parent().siblings().removeClass("backcolor");
- $("#hzxjsj").parent().addClass("backcolor");
- }
- }
- var oldVal;
- function onBeforeEdit(e) {
- var len = g.getData().length;
- if (e.rowindex == len - 1) {
- top.Dialog.alert("此行不能编辑", null, null, null, -1);
- return false;
- }
- if (e.column.name == 'BZYDW_ID' && e.rowindex == len - 1) {
- top.Dialog.alert("此单元格不能编辑", null, null, null, -1);
- return false;
- }
- if (e.column["columnname"] == "SWRYMXB_TJ" && report_types == "10") {
- top.Dialog.alert("此列不能编辑", null, null, null, -1);
- return false;
- }
- if (e.value != null && e.value != "") {
- oldVal = e.value;
- } else {
- oldVal = 0;
- }
- }
- var num1 = 0;
- function onAfterEdit(e) {
- var size = g.getData().length;
- var type = $("#sel").attr("relValue");
- var name = $("#sel").attr("relText");
- if (maintableType != "1" && num2 == 0) {
- if (e.column.isCount != 0) {
- return false;
- }
- if (isNaN(e.value)) {
- e.value = 0;
- }
- if (e.value == null || e.value == "") {
- if (lockFlag) {
- // e.value="0";
- // checkWrite = false;
- var affairfdIds = $("#affairType").val();
- var warning = "";
- if (affairfdIds != "") {
- for (var i = 0; i < affairfdIds.split(",").length; i++) {
- warning += "'" + affairfdIds.split(",")[i] + "',";
- }
- warning = warning.substring(0, warning.lastIndexOf(","));
- }
- var params = {
- "column" : e.column.name,
- "comp_id" : corpId,
- "corp_id" : e.record.COMP_ID,
- "report_type" : type,
- "report_name" : name,
- "role_id" : role_id,
- "warning" : $("#affairType").attr("relValue"),
- "affair_type" : $("#affairType").attr("relText")
- };
- $.ajax({
- url : $.pathname() + "/ws/xianlutingyun/XianlutingyunService/getCellValue2",
- type : "post",
- async : false,
- data : params,
- dataType : "text",
- success : function(data) {
- e.value = data;
- checkWrite = true;
- },
- error : function() {
- $.messager.alert('查询失败!', '访问服务失败!', 'error');
- }
- });
- } else {
- e.value = "0";
- checkWrite = true;
- }
- }
- if (e.value != null && e.value != "" && e.value != "0") {
- // 判断该单元格是否有值
- checkWrite = true;
- var Dataparams = {
- "value" : e.value,
- "column" : e.column.name,
- "comp_id" : corpId,
- "corp_id" : e.record.COMP_ID,
- "report_type" : report_types
- };
- // alert(JSON.stringify(params));
- if (report_types == '1'
- && e.column.name.indexOf("TRIP_OUT_TOTAL_") > -1
- && !isNaN(e.value)) {
- $.ajax({
- url : $.pathname()
- + "/ws/xianlutingyun/XianlutingyunService/CheckCellValue",
- type : "post",
- data : Dataparams,
- dataType : "text",
- success : function(data) {
- // alert(data);
- if (data == "false") {
- top.Dialog.alert("当前输入的数据小于最新记录数据");
- }
- },
- error : function() {
- $.messager.alert('查询失败!', '访问服务失败!', 'error');
- }
- });
- }
- }
- if (report_types == "10") {
- var RowObj = (g.getRow(e["record"]["__id"]));
- var count = RowObj["SWRYMXB_TJ"] == ""
- || RowObj["SWRYMXB_TJ"] == undefined
- || RowObj["SWRYMXB_TJ"] == "undefined" ? "0"
- : RowObj["SWRYMXB_TJ"];
- var oldCount = count;
- count = parseInt(count, 10) + parseInt(e.value, 10)
- - parseInt(oldVal, 10);
- g.updateCell("SWRYMXB_TJ", count, RowObj);
- var lastTj = g.getRow(size - 1)["SWRYMXB_TJ"] == "" ? "0" : g
- .getRow(size - 1)["SWRYMXB_TJ"];
- g.getRow(size - 1)["SWRYMXB_TJ"] = parseInt(lastTj, 10)
- + parseInt(count, 10) - oldCount;
- }
- var updatecolumn = e.column.name;
- /*
- * if(size-1 == e.rowindex){ totalFlag = false; }
- */
- num1 = g.getRow(size - 1)[updatecolumn] == ""
- || g.getRow(size - 1)[updatecolumn] == undefined ? "0" : g
- .getRow(size - 1)[updatecolumn];
- // if(totalFlag){
- num1 = getZjResult(num1, e.value, oldVal);// Math.round((parseFloat(num1)+parseFloat(e.value)-oldVal)*100)/100;
- // }
- row = g.getRow(size - 1);
- row[updatecolumn] = num1;
- row1 = g.getRow(e.rowindex);
- row1[updatecolumn] = parseFloat(e.value);
- g.updateRow(e.rowindex, row1);
- g.updateRow(size - 1, row);
- var $rowDom = $(".l-grid-body1 tr").eq(e.rowindex);
- var $tdDom = $rowDom.find("td").eq(1).find(".company");
- $tdDom.addClass("company-text");
- if (flag && num % 2 != 0 && checkWrite) {
- // alert(JSON.stringify(e.record));
- var fd_id = e.record.FD_OBJECTID;
- var name = e.column.name;
- var comp = e.record.COMP_NAME;
- var id = e.record.COMP_ID;
- var report_id = e.record.REPORT_ID;
- var display = e.column.display;
- var writeVal = $("#sel").val();
- if (writeVal == "8") {
- if (display.indexOf("人") == -1) {
- return;
- }
- }
- var totalCount = e.value;
- var wrong = $("#wrongNum").val();
- var write_url = "/nwyj/page/business/em/report/writeData/writeData1.jsp";
- var diag = new top.Dialog();// 定义一个窗口对象
- diag.Title = "明细填写";// 窗口标题
- diag.URL = encodeURI(write_url);// 窗口对应的页面
- diag.Height = 560;
- diag.Width = 1200;
- diag.showOkButton = false;
- diag.showCancelButton = false;
- diag.ShowMaxButton = true;
- diag.show();// 显示窗口
- diag.OnLoad = function() {
- diag.innerFrame.contentWindow.showDetail(fd_id, name, comp,
- writeVal, display, totalCount, e.column["__id"],
- e["record"]["__id"], wrong, checkInterface, id,
- report_id);
- };
- var bodyheight = $(window.document.body).height();
- $(window.document.body).find("#frmright").height(bodyheight);
- }
- }
- // 取消事件冒泡
- return false;
- }
- function getZjResult(arg1, arg2, arg3) {
- var r1, r2, r3, m, n;
- try {
- r1 = arg1.toString().split(".")[1].length;
- } catch (e) {
- r1 = 0;
- }
- try {
- r2 = arg2.toString().split(".")[1].length;
- } catch (e) {
- r2 = 0;
- }
- try {
- r3 = arg3.toString().split(".")[1].length;
- } catch (e) {
- r3 = 0;
- }
- m = Math.pow(10, Math.max(r1, r2, r3));
- // 动态控制精度长度
- n = Math.max(r1, r2, r3);
- return ((arg1 * m + arg2 * m - arg3 * m) / m).toFixed(n);
- }
- // 返回主页面
- function goback() {
- flag = false;
- var iframe = parent.document.getElementsByName("frmright")[0];
- if (_thisUrl.indexOf("role_Id=") == -1) {
- iframe.src = "/nwyj/page/business/em/waitdo/waitDo.html";
- } else {
- iframe.src = "/nwyj/page/business/em/report/Report_main.jsp";
- }
- }
- // 获取(表头)
- function getColumns(type) {
- if (type == '100') {
- mycol1 = "抢修工作进度情况表";
- mycol = [ {
- hide : "true",
- name : "FD_OBJECTID"
- }, {
- display : "支援单位",
- name : "COMP_NAME",
- id : "COMP_ID",
- frozen : true,
- width : '80'
- },
- // {display:"支援单位",name:"COMP_NAME",id:"COMP_ID",minWidth:'100'/*,editor:{type:"text",inputMode:"positiveDecimal",maxlength:"20"}*/},
- {
- display : "被支援单位",
- name : "BZYDW_ID",
- editor : {
- type : "text",
- inputMode : "text",
- maxlength : "15"
- },
- width : '11%'
- }, {
- display : "500kV线路",
- columns : [ {
- display : "累计完成",
- columns : [ {
- display : "组塔(基)",
- name : "LJWCZT_500",
- editor : {
- type : "text",
- inputMode : "positiveDecimal",
- maxlength : "9"
- },
- isCount : "0",
- width : '5%'
- }, {
- display : "架线(km)",
- name : "LJWCJX_500",
- editor : {
- type : "text",
- inputMode : "positiveDecimal",
- maxlength : "9"
- },
- isCount : "0",
- width : '5%'
- } ]
- } ]
- }, {
- display : "220kV线路",
- columns : [ {
- display : "累计完成",
- columns : [ {
- display : "组塔(基)",
- name : "LJWCZT_220",
- editor : {
- type : "text",
- inputMode : "positiveDecimal",
- maxlength : "9"
- },
- isCount : "0",
- width : '5%'
- }, {
- display : "架线(km)",
- name : "LJWCJX_220",
- editor : {
- type : "text",
- inputMode : "positiveDecimal",
- maxlength : "9"
- },
- isCount : "0",
- width : '5%'
- } ]
- } ]
- }, {
- display : "110kV线路",
- columns : [ {
- display : "累计完成",
- columns : [ {
- display : "组塔(基)",
- name : "LJWCZT_110",
- editor : {
- type : "text",
- inputMode : "positiveDecimal",
- maxlength : "9"
- },
- isCount : "0",
- width : '5%'
- }, {
- display : "立杆(根)",
- name : "LJWCLG_110",
- editor : {
- type : "text",
- inputMode : "positiveDecimal",
- maxlength : "9"
- },
- isCount : "0",
- width : '5%'
- }, {
- display : "架线(km)",
- name : "LJWCJX_110",
- editor : {
- type : "text",
- inputMode : "positiveDecimal",
- maxlength : "9"
- },
- isCount : "0",
- width : '5%'
- } ]
- } ]
- },
- {
- display : "10kV线路",
- columns : [ {
- display : "今日完成",
- columns : [ {
- display : "组塔(基)",
- name : "JRWCZT_10",
- editor : {
- type : "text",
- inputMode : "positiveDecimal",
- maxlength : "9"
- },
- isCount : "0",
- width : '5%'
- }, {
- display : "扶杆(根)",
- name : "JRWCFG_10",
- editor : {
- type : "text",
- inputMode : "positiveDecimal",
- maxlength : "9"
- },
- isCount : "0",
- width : '5%'
- }, {
- display : "立杆(根)",
- name : "JRWCLG_10",
- editor : {
- type : "text",
- inputMode : "positiveDecimal",
- maxlength : "9"
- },
- isCount : "0",
- width : '5%'
- }, {
- display : "架线(km)",
- name : "JRWCJX_10",
- editor : {
- type : "text",
- inputMode : "positiveDecimal",
- maxlength : "9"
- },
- isCount : "0",
- width : '5%'
- } ]
- }, {
- display : "累计完成",
- columns : [ {
- display : "组塔(基)",
- name : "LJWCZT_10",
- editor : {
- type : "text",
- inputMode : "positiveDecimal",
- maxlength : "9"
- },
- isCount : "0",
- width : '5%'
- }, {
- display : "扶杆(根)",
- name : "LJWCFG_10",
- editor : {
- type : "text",
- inputMode : "positiveDecimal",
- maxlength : "9"
- },
- isCount : "0",
- width : '5%'
- }, {
- display : "立杆(根)",
- name : "LJWCLG_10",
- editor : {
- type : "text",
- inputMode : "positiveDecimal",
- maxlength : "9"
- },
- isCount : "0",
- width : '5%'
- }, {
- display : "架线(km)",
- name : "LJWCJX_10",
- editor : {
- type : "text",
- inputMode : "positiveDecimal",
- maxlength : "9"
- },
- isCount : "0",
- width : '5%'
- } ]
- } ]
- },
- {
- display : "低压线路",
- columns : [ {
- display : "今日完成",
- columns : [ {
- display : "扶杆(根)",
- name : "JRWCFG_DY",
- editor : {
- type : "text",
- inputMode : "positiveDecimal",
- maxlength : "9"
- },
- isCount : "0",
- width : '5%'
- }, {
- display : "立杆(根)",
- name : "JRWCLG_DY",
- editor : {
- type : "text",
- inputMode : "positiveDecimal",
- maxlength : "9"
- },
- isCount : "0",
- width : '5%'
- }, {
- display : "架线(km)",
- name : "JRWCJX_DY",
- editor : {
- type : "text",
- inputMode : "positiveDecimal",
- maxlength : "9"
- },
- isCount : "0",
- width : '5%'
- } ]
- }, {
- display : "累计完成",
- columns : [ {
- display : "扶杆(根)",
- name : "LJWCFG_DY",
- editor : {
- type : "text",
- inputMode : "positiveDecimal",
- maxlength : "9"
- },
- isCount : "0",
- width : '5%'
- }, {
- display : "立杆(根)",
- name : "LJWCLG_DY",
- editor : {
- type : "text",
- inputMode : "positiveDecimal",
- maxlength : "9"
- },
- isCount : "0",
- width : '5%'
- }, {
- display : "架线(km)",
- name : "LJWCJX_DY",
- editor : {
- type : "text",
- inputMode : "positiveDecimal",
- maxlength : "9"
- },
- isCount : "0",
- width : '5%'
- } ]
- } ]
- }, {
- display : "配变",
- columns : [ {
- display : "今日完成",
- columns : [ {
- display : "修复(台)",
- name : "JRWCXF_PB",
- editor : {
- type : "text",
- inputMode : "positiveDecimal",
- maxlength : "9"
- },
- isCount : "0",
- width : '5%'
- } ]
- }, {
- display : "累计完成",
- columns : [ {
- display : "修复(台)",
- name : "LJWCXF_PB",
- editor : {
- type : "text",
- inputMode : "positiveDecimal",
- maxlength : "9"
- },
- isCount : "0",
- width : '5%'
- } ]
- } ]
- }, {
- display : "累计完成比例",
- name : "LJWCBL",
- editor : {
- type : "text",
- inputMode : "positiveDecimal",
- maxlength : "9"
- },
- width : '5%'
- }, {
- display : "今日完成其他工作",
- name : "WCQTGZ",
- editor : {
- type : "text",
- inputMode : "text",
- maxlength : "500"
- },
- width : '5%'
- }, {
- display : "遗留问题",
- name : "YLWT",
- editor : {
- type : "text",
- inputMode : "text",
- maxlength : "500"
- },
- width : '5%'
- }
- ];
- } else {
- var urls = $.pathname()
- + "/ws/xianlutingyun/XianlutingyunService/getEditColumns";
- $.ajax({
- url : urls,
- type : 'post',
- timeout : 300000,
- async : false,
- data : {
- "report_type" : type,
- "dept_level" : deptLevel,
- "role_id" : role_id,
- "rollbackFlag" : rollbackFlag
- },
- dataType : 'text',
- success : function(data) {
- mycol = eval('(' + data + ')');
- mycol1 = eval('(' + data + ')')[0].display;
- },
- error : function(e) {
- $.messager.alert('查询表头失败!', '访问服务失败!', 'error');
- }
- });
- }
- }
- // 获取行
- function getRows(value) {
- var urls = $.pathname()
- + "/ws/xianlutingyun/XianlutingyunService/getRowName";
- $.ajax({
- url : urls,
- type : 'post',
- timeout : 300000,
- async : false,
- data : {
- comp_id : corpId,
- report_type : value,
- roleId : role_id,
- corpId : compId,
- flag : deptFlag
- },
- dataType : 'json',
- success : function(data) {
- testData = data;
- },
- error : function(e) {
- $.messager.alert('查询行失败!', '访问服务失败!', 'error');
- }
- });
- }
- function operation(rowdata, rowindex, value) {
- var h = "";
- if (!rowdata._editing) {
- flag1 = false;
- h += "<a onclick='beginEdit(" + rowindex
- + ")'><span class='icon_edit'>修改</span></a>";
- h += "<a onclick='onDelete(" + rowindex
- + ")'><span class='icon_delete'>删除</span></a> ";
- } else {
- flag1 = true;
- h += "<a onclick='endEdits(" + rowindex
- + ")'><span class='icon_ok'>确认</span></a> ";
- h += "<a onclick='cancelEdit(" + rowindex
- + ")'><span class='icon_delete'>取消</span></a> ";
- }
- return h;
- }
- function backspace(rowdata, rowindex, value) {
- if (rowdata.COMP_NAME != "总计") {
- return "<a onclick='rollback(" + rowindex
- + ")'><span class='retract_tem'>回退</span></a>";
- }
- }
- // 退回
- function rollback(rowindex) {
- var row = g.getRow(rowindex);
- var fdId = row.REPORT_ID;
- var writeName = row.REAL_NAME;
- var writeMobile = row.MOBILE;
- if (fdId) {
- rollbackInfo(fdId, writeName, writeMobile);
- } else {
- top.Dialog.alert("该记录无法回退!");
- return;
- }
- }
- // 根据下拉框的选择,动态获取表头
- function change() {
- var typeVal = $("#sel").val();
- if (typeVal == "8" && ((deptLevel == 3 || deptLevel == 4))) {
- $("#areaSel").data("data", areaData);
- $("#areaSel").render();
- $(".areaSel").show();
- } else {
- $(".areaSel").hide();
- }
- report_types = typeVal;
- if (flag1) {
- top.Dialog.alert("请编辑完再切换");
- $("#sel").setValue(excType);
- return;
- }
- if (checkRowObj) {
- checkRowObj = false;
- }
- g.endEdit();
- $("body").eq(0).showLoading();
- // getReportNumber(warn_url,typeVal,nowRole);
- // 查询当前该报表的事件类型
- getReportAffair(typeVal, nowRole);
- $("#showplan").hide();
- $("#showRequire").hide();
- $("#showRequire").find("a").html("隐藏报表填报要求");
- changeTable(typeVal);
- // $(parent.document.body).find("#frmright").height($("#grid").height()+$("#requires").height()+150);
- }
- // 新增报表
- function save(type) {
- if (flag1) {
- top.Dialog.alert("请完成编辑再保存");
- return;
- }
- if (num % 2 != 0) {
- flag = false;
- $("#handlerinfo").text("开启填写明细");
- $("#handlerinfo").parent().removeClass("backcolor");
- num = 2;
- }
- g.endEdit();
- var row = g.getData();
- var json = JSON.stringify(row);
- var typeValue = $("#sel").val();
- if (maintableType == "1") {
- //保存前判断首行是否为空
- if (typeValue != '7') {
- var textInput = $("#maingrid2").find(".l-grid2").find(".l-grid-body-inner").find("tbody").find("tr");
- if (textInput.eq(0).text().trim() == "修改删除") {
- checkRowObj = true;
- }
- }else{
- var textInput = $("#maingrids").find(".l-grid2").find(".l-grid-body-inner").find("tbody").find("tr");
- if (textInput.eq(0).text().trim() == "修改删除") {
- checkRowObj = true;
- }
- }
-
- if (checkRowObj) {
- top.Dialog.confirm("内容存在空数据,是否继续保存|确定", function() {
- saveTable(type, json);
- });
- } else {
- saveTable(type, json);
- }
- } else {
- saveTable(type, json);
- }
- }
- // 重置表信息
- function clear_msg() {
- if (flag1) {
- top.Dialog.alert("请编辑完再重置");
- return;
- }
- top.Dialog.confirm("确定要重置?填写的信息会全部清除,请慎重选择|重置", function() {
- window.location.href = window.location.href;
- });
- }
- /**
- * 导入上次数据
- */
- function import_report() {
- clickFlag = false;
- checkInterface = false;
- $(".company").removeClass("company-text");
- // $(".company").removeAttr("title");
- $(".company").hover(function() {
- $(this).removeClass("company-hover");
- }, function() {
- $(this).removeClass("company-hover");
- });
- $("#drscsj").parent().addClass("backcolor");
- $("#drscsj").parent().siblings().removeClass("backcolor");
- if (num % 2 != 0) {
- flag = false;
- $("#handlerinfo").html("开启填写明细");
- num = 2;
- }
- if (flag1) {
- top.Dialog.alert("请完成编辑再导入!");
- return false;
- }
- g.endEdit();
- var value = $("#sel").val();
- // var warning = $("#warning").val();
- // var warningJson = $("#warning").data("data");
- var warning = "";
- if (affairLength == 0) {
- top.Dialog.alert("此时没有填报的计划,无法导入上次数据");
- return;
- } else {
- var affairFdId = $("#affairType").val();
- if (affairFdId == "") {
- top.Dialog.alert("请选择一个事件类型进行操作");
- return;
- }
- for (var i = 0; i < affairFdId.split(",").length; i++) {
- warning += "'" + affairFdId.split(",")[i] + "',";
- }
- warning = warning.substring(0, warning.lastIndexOf(","));
- }
- var json = JSON.stringify(g.getData());
- var urls = $.pathname()+ "/ws/xianlutingyun/XianlutingyunService/getLastReport2";
- var params = {"task_id":$("#affairType").attr("relValue"),"comp_id":corpId,"role_id":role_id,"report_type":value,"affair_type":$("#affairType").attr("relText"),"json":json};
- $("body").eq(0).showLoading();
- $.ajax({
- url : urls,
- type : 'post',
- timeout : 300000,
- /* async : false, */
- data : params,
- dataType : 'json',
- success : function(data) {
- $("body").eq(0).hideLoading();
- if (data.rows.length==0) {
- top.Dialog.alert("没有上次填报的信息");
- }else{
- g.options.data = data;
- g.loadData();
- setHight();
- }
- },
- error : function(e) {
- $.messager.alert('导入上次报表失败!', '访问服务失败!', 'error');
- }
- });
- /* } */
- }
- // 获取预警或响应编号
- function getReportNumber(url, report_type, role, affair) {
- $.ajax({
- url : url,
- type : 'post',
- timeout : 300000,
- async : false,
- data : {
- comp_id : compId,
- deptId : deptId,
- flag : deptFlag,
- report_type : report_type,
- role_id : role,
- needType : "need",
- affairType : affair
- },
- dataType : 'json',
- success : function(data) {
- $("#warning").setValue("");
- $("#warning").data("data", data);
- $("#warning").render();
- },
- error : function(e) {
- $.messager.alert('查询预警编号失败', '访问服务失败!', 'error');
- }
- });
- }
- /**
- * 获取当前时间需要填报的事件类型
- *
- * @param report_type
- * @param role
- */
- function getReportAffair(report_type, role) {
- var url = $.pathname()
- + "/ws/xianlutingyun/XianlutingyunService/getReportAffair";
- $.ajax({
- url : url,
- type : 'post',
- timeout : 300000,
- async : false,
- data : {
- comp_id : compId,
- deptId : deptId,
- flag : deptFlag,
- report_type : report_type,
- role_id : role
- },
- dataType : 'json',
- success : function(data) {
- $("#sel").attr("disabled", false);
- affairLength = data.length;
- $("#affairType").data("data", "");
- $("#affairType").data("data", data);
- $("#affairType").render();
-
- if (data.length == 1) {
- $("#affairType").setValue(data[0].value);
- $("#affairType").render();
- $("#affairType").attr("disabled", true);
- $("#affairType").render();
- totalFlag = true;
- } else if (data.length > 1) {
- $("#affairType").attr("disabled", false);
- $("#affairType").render();
- var $dom = $("#affairType").parent().find(".mainCon td input[type=text]");
- $dom.css({"border" : "solid 1px red"});
- $dom.attr("title", "当前存在多个事件类型,请选择其中一个类型汇总");
- addTooltip($dom[0]);
- totalFlag = false;
- } else {
- $("#affairType").attr("disabled", false);
- $("#affairType").render();
- totalFlag = false;
- }
- },
- error : function(e) {
- $.messager.alert('查询事件类型失败', '访问服务失败!', 'error');
- }
- });
- }
- // 监听回车
- function checkKeyCode(event) {
- if (event.keyCode == 13) {
- g.endEdit();
- }
- return false;
- }
- // 根据用户登录时的不同角色初始化下拉框
- function getRole(roleId, report_type) {
- var urls = "";
- var initParams = "";
- if (report_type != undefined) {// 代办传入报表类型
- urls = $.pathname()
- + "/ws/xianlutingyun/XianlutingyunService/getDbReport";
- initParams = {
- report_type : report_type,
- deptLevel : deptLevel
- };
- } else {
- urls = $.pathname()
- + "/ws/xianlutingyun/XianlutingyunService/getTypeSel";
- initParams = {
- role_id : roleId,
- dept_level : deptLevel
- };
- }
- selecta = getThing(urls, initParams);
- selecta2 = {list:[]};
- for(var i = 0;i<selecta.list.length;i++){
- if(!(selecta.list[i].value=="108"||selecta.list[i].value=="110"||selecta.list[i].value=="111"||selecta.list[i].value=="113"||selecta.list[i].value=="114")){
- selecta2.list.push(selecta.list[i]);
- }
- }
- $("#sel").data("data", selecta2);
- if(roleId=="R002105430211"){
- $("#sel").setValue("1");
- }else{
- $("#sel").setValue("7");
- }
- $("#sel").render();
- }
- function getRequire(roleId){
- $("#requires").empty();
- $("#changerequire").empty();
- if (roleId == "R002105430210") {
- $("#requires")
- .append("<span>填写说明:</span><br>"
- + "<span>① 单位:受灾地市局</span>;<br>"
- + "<span>② 跳闸停电(条数):相应电压等级线路跳闸的总条数,不包含重合闸成功的跳闸线路条数,且同一条线路多次跳闸,只统计为一个跳闸条数。</span><br>"
- + "<span>③ 未恢复:填写相应电压等级线路跳闸后,未恢复成热备用状态的线路条数。</span><br>"
- + "<span>④ 累计跳闸(条次):相应电压等级线路跳闸的总条次数,包含重合闸成功的跳闸线路条数,且同一条线路多次跳闸,统计为多个跳闸条次数。</span><br>"
- + "<span>⑤ 备注:填写未恢复线路名称。</span><br>"
- + "<span>⑥ 损失负荷:电网因灾损失的负荷数。电网发生故障后,在线路重合闸及备用电源自投装置动作完成后系统未恢复的负荷,包括电网减供负荷和低压脱扣负荷。</span><br>"
- + "<span>⑦ 损失占比:损失负荷数占同期电网应有负荷的百分比。</span>");
- $("#changerequire")
- .append("<span>填写说明:</span><br>"
- +"<span>① 单位:受灾地市局</span><br>"
- + "<span>② 累计停运(座):灾害过程中发生停运变电站的总座数。</span><br>"
- + "<span>③ 未恢复(座):截止当前时间未恢复变电站的总座数。</span><br>"
- + "<span>④ 备注:发生停运事件的变电站名称及目前状态。例如:XX变电站(已恢复/未恢复)</span>");
- }
- if (roleId == "R002105430213") {
- $("#requires")
- .append("<span>填写说明:</span><br>"
- +"<span>① 单位名称:公司、受灾地市局。</span><br>"
- + "<span>② 本单位预警或响应级别:防风防汛X色预警,防风防汛X级响应。</span><br>"
- + "<span>③ 同级政府相关部门名称:例如XX省防总等。</span><br>"
- + "<span>④ 同级政府相关部门预警或响应级别:防风防汛X色预警,防风防汛X级响应。</span><br>"
- + "<span>⑤ 开始时间:例如,9月9日9时30分。</span><br>"
- + "<span>⑥ 结束时间:例如,9月9日9时30分。当处于预警发布或响应启动状态时,结束时间可保持为空。</span><br>"
- + "<span>⑦ 备注:台风登陆期间不用填报。</span>");
- $("#changerequire")
- .append("<span>填写说明:</span><br>"
- +"<span>① 单位名称:受灾地市局。</span><br>"
- + "<span>② 抢修人员:填写当日投入抢修人数的最大值。</span><br>"
- + "<span>③ 抢修车辆:填写当日投入抢修车辆数的最大值。</span><br>"
- + "<span>④ 应急发电车:填写当日投入应急发电车数量的最大值。</span><br>"
- + "<span>⑤ 应急发电机:填写当日投入应急发电机数量的最大值。</span><br>"
- + "<span>⑥ 备注:台风登陆期间不用填报。</span>");
- }
- if (roleId == "R002105430211") {
- $("#requires")
- .append("<span>填写说明:</span><br>"
- +"<span>① 单位:受灾地市局。</span><br>"
- + "<span>② 备注:台风登陆期间不用填报。</span><br>"
- );
- $("#changerequire")
- .append("<span>填写说明:</span><br>"
- +"<span>① 单位:受灾地市局</span><br>"
- + "<span>② 线路受损:按单相导路(地线)受损长度统计,统计距离为断线或者整条线路损毁时的档距。</span><br>"
- + "<span>③ 线路未恢复:截至当前仍未修复的受损线路长度。</span><br>"
- + "<span>④ 配变受损:发生损害需要修复或更换的配变台数。</span><br>"
- + "<span>⑤ 配变未恢复:截至当前仍未修复或更换的配变台数。</span><br>"
- + "<span>⑥ 备注:台风登陆期间不用填报。</span>");
- }
- if (roleId == "R002105430212") {
- $("#requires")
- .append("<span>填写说明:</span><br>"
- +"<span>① 单位:受灾地市局。</span><br>"
- + "<span>② 台区:一个配变所供负荷区域计作一个台区。</span><br>"
- + "<span>③ 用户数:1)线路重复跳闸时客户停电户数不累加统计,即线路重复跳闸时,停电户数只统计一次。2)线路跳闸重合成功的客户数不统计。</span><br>"
- + "<span>④ 未恢复数:因灾发生停电的用户截至当前还未恢复供电的用户数。</span><br>"
- + "<span>⑤停电占比:停电占比=停电台区(用户)数÷当地台区(用户)总数。</span><br>"
- + "<span>⑥损失电量:灾害期间损失电量的总数。</span>");
- $("#changerequire")
- .append("<span>填写说明:</span><br>"
- +"<span>① 单位:受灾地市局。</span><br>"
- + "<span>② 累计全停:灾害发生以来发生全县(区)、全乡镇、全行政村全停的个数。</span><br>"
- + "<span>③ 当前全停:当前仍存在全县(区)、全乡镇、全行政村全停的个数。</span><br>"
- + "<span>④ 备注:台风登陆期间不用填报。</span>");
- }
- }
- // 根据用户角色登录,返回report_type 的默认值
- function getType(id) {
- if (id == "R002105430211") {
- report_types = "1";
- } else if (id == "R002105430213") {
- report_types = "7";
- }
- return report_types;
- }
- // 通过选择预警或响应编号来显示报表计划要求
- function getPlan() {
- if (num % 2 != 0) {
- num = 2;
- }
- g.endEdit();
- if (flag) {
- num = 3;
- }
- // num = 3;
- $("#sysDept").html("");
- $("#equipmentDept").html("");
- $("#markingDept").html("");
- $("#safeyDept").html("");
- $("#showTables").html("");
- $("#deptRole").text("");
- $("#star_time").html("");
- $("#end_time").html("");
- $("#type").html("");
- $("#round").html("");
- $("#temporary").html("");
- var val = $("#warning").val();
- if (val) {
- getPlanContent(val);
- } else {
- $("#showplan").hide();
- $("#showRequire").hide();
- $("#showRequire").find("a").html("隐藏报表填报要求");
- $(parent.document.body).find("#frmright").height(wh);
- }
- }
- function getPlanRequires(value) {
- require = "";
- $.ajax({
- url : $.pathname()
- + '/ws/getPlanRequires/getPlanRequireService/getPlanRequire/',
- type : 'post',
- timeout : 300000,
- async : false,
- data : {
- comp : corpId,
- warning_number : value
- },
- dataType : 'json',
- success : function(data) {
- require = data;
- },
- error : function(e) {
- $.messager.alert('查询报表计划失败!', '访问服务失败!', 'error');
- }
- });
- return require;
- }
- function showTable() {
- $("#showplan").toggle();
- var show = $("#showplan").css("display");
- if (show == "none") {
- $("#showRequire").find("a").html("显示报表填报要求");
- $(parent.document.body).find("#frmright").height(wh + 30);
- } else {
- $("#showRequire").find("a").html("隐藏报表填报要求");
- var planH = $("#showplan").height();
- var requireH = $("#showRequire").height();
- $(parent.document.body).find("#frmright").css("height",
- wh + planH + requireH + 30);
- }
- }
- /*
- * $(".l-panel-btn").live("mouseenter",function(){
- *
- * g.endEdit(); });
- */
- /**
- * 统计表汇总下级数据
- */
- function total() {
- $("#hzxjsj").parent().siblings().removeClass("backcolor");
- $("#hzxjsj").parent().addClass("backcolor");
- checkInterface = false;
- var value = $("#sel").val();
- if (num % 2 != 0) {
- flag = false;
- $("#handlerinfo").text("开启填写明细");
- num = 2;
- }
- var $dom = $("#affairType").parent().find(".mainCon td input[type=text]");
- if (affairLength == 0) {
- $dom.css({
- "border" : "solid 1px red"
- });
- $dom.attr("title", "当前没有可选的事件类型");
- addTooltip($dom[0]);
- return;
- } else {
- if ($("#affairType").val() == "") {
- $dom.css({
- "border" : "solid 1px red"
- });
- $dom.attr("title", "请选择一个事件类型进行汇总下级数据");
- addTooltip($dom[0]);
- return;
- }
- affairType = $("#affairType").attr("relText");
- }
- g.endEdit();
- var json = JSON.stringify(g.getData());
- $("body").eq(0).showLoading();
- var urls = $.pathname() + "/ws/xianlutingyun/XianlutingyunService/getChildHzReport";
- $.ajax({
- url : urls,
- type : 'post',
- timeout : 300000,
- /* async : false, */
- data : {
- comp_id : corpId,
- report_type : value,
- flag : deptFlag,
- roleId : role_id,
- taskId : $("#affairType").attr("relValue"),
- affair : $("#affairType").attr("relText"),
- json : json
- },
- dataType : 'json',
- success : function(data) {
- /*
- * testData = data; var item = getItem(value); init(testData,item);
- */
- g.options.data = data;
- g.loadData();
- setHight();
- $("body").eq(0).hideLoading();
- /*
- * clickFlag = true; $(".company").addClass("company-text");
- * $(".company").hover(function(){$(this).addClass("company-hover");},function(){$(this).removeClass("company-hover");});
- * //$(".company").attr("title","可编辑数据");
- */
- },
- error : function(e) {
- $.messager.alert('汇总下级数据失败!', '访问服务失败!', 'error');
- }
- });
- }
- /**
- * 明细汇总下级数据
- */
- function getXqtotal() {
- $("#hzxjsj_xq").parent().siblings().removeClass("backcolor");
- $("#hzxjsj_xq").parent().addClass("backcolor");
- var value = $("#sel").val();
- var $dom = $("#affairType").parent().find(".mainCon td input[type=text]");
- if (affairLength > 1 && $("#affairType").val() == "") {
- $dom.css({
- "border" : "solid 1px red"
- });
- $dom.attr("title", "请选择一个事件类型进行汇总下级数据");
- addTooltip($dom[0]);
- return;
- }
- affairType = $("#affairType").attr("relText");
- // g.endEdit();
- $("body").eq(0).showLoading();
- var urls = $.pathname()
- + "/ws/xianlutingyun/XianlutingyunService/getChildHzXqData";
- $.ajax({
- url : urls,
- type : 'post',
- timeout : 300000,
- async : false,
- data : {
- comp_id : corpId,
- report_type : value,
- flag : deptFlag,
- roleId : role_id,
- affair : affairType
- },
- dataType : 'json',
- success : function(data) {
- xqData = data;
- setHight();
- $("body").eq(0).hideLoading();
- },
- error : function(e) {
- $.messager.alert('导入上次报表失败!', '访问服务失败!', 'error');
- }
- });
- }
- var num = 2;
- function beginWrite() {
- var reportVal = $("#sel").val();
- if (reportVal == "1" || reportVal == "2" || reportVal == "3"
- || reportVal == "5" || reportVal == "8" || reportVal == "4"
- || reportVal == "101") {
- if (num % 2 == 0) {
- $("#handlerinfo").parent().addClass("backcolor");
- $("#handlerinfo").parent().siblings().removeClass("backcolor");
- $("#handlerinfo").text("关闭填写明细");
- $("#handlerinfo").parent().attr("title", "关闭填报报表明细填写情况");
- flag = true;
- } else {
- $("#handlerinfo").parent().removeClass("backcolor");
- $("#handlerinfo").parent().attr("title", "开启填报报表明细填写情况");
- $("#handlerinfo").text("开启填写明细");
- flag = false;
- }
- num++;
- } else {
- top.Dialog.alert("此表没有明细填写");
- flag = false;
- num = 2;
- }
- };
- // 更多 多选查询卡
- function more() {
- $('#moretable').toggle();
- }
- /** 绑定更多的按钮点击事件 */
- $more = $("#more"); // 更多按钮
- $more.bind('click', function() {
- more();
- });
- function changeRequireByVal(value) {
- if (value == "1") {
- $("#requires").show();
- $("#changerequire").hide();
- } else if (value == "2" || value == "101") {
- $("#requires").hide();
- $("#changerequire").show();
- }
- else if (value == "3") {
- $("#changerequire").hide();
- $("#requires").show();
- } else if (value == "4") {
- $("#requires").hide();
- $("#changerequire").show();
- } else if (value == "5") {
- $("#changerequire").hide();
- $("#requires").show();
- } else if (value == "6") {
- $("#requires").hide();
- $("#changerequire").show();
- } else if (value == "7") {
- $("#changerequire").hide();
- $("#requires").show();
- } else if (value == "8") {
- $("#requires").hide();
- $("#changerequire").show();
- } else {
- $("#requires").hide();
- $("#changerequire").hide();
- }
- }
- function initGrid(url, data, type) {
- g = null;
- g = $("#maingrids").quiGrid({
- url : url,
- params : {
- comp_id : corpId,
- affair : $("#affairType").attr("relText")
- },
- usePager : false,
- fixedCellHeight : false,
- columns : mycol,
- data : data,
- /* height:"90%", */
- headerRowHeight : 38,
- rowHeight : 38,
- width : '100%',
- rownumbers : true,
- percentWidthMode : true,
- enabledEdit : true,
- clickToEdit : false,
- onAfterSubmitEdit : onAfterSubmitEdit,
- onAfterEdit : onAfterEdit,
- onBeforeSubmitEdit : onBeforeSubmitEdit,
- onAfterShowData : function() {
- setHight();
- },
- onAfterChangeColumnWidth : changeColWidth,
- toolbar : {
- items : [ {
- text : '新增',
- click : addUser,
- iconClass : 'add1_tem'
- }, {
- line : true
- }
- ]
- }
- });
- if ($("#maingridsgrid").height() < 400) {
- g.setOptions({
- height : "400px"
- });
- g.resetHeight();
- } else {
- g.setOptions({
- height : "auto"
- });
- g.resetHeight();
- }
- $(".l-grid-hd-cell-text").css("color", "white");
- }
- function onAfterShowData() {
- /*
- * var maingridHeight = ""; if(report_types=="7"){ maingridHeight =
- * $("#maingrids").height(); }else{ maingridHeight =
- * $("#maingrid2").height(); } if(maingridHeight<536){
- * $(".l-grid-body").height(600); }
- */
- }
- // 类型为7的检测
- function onBeforeSubmitEdit(e) {
- if (isValida) {
- if (e.newdata.ORG_END_TIME != "") {
- var endTime = e.newdata.ORG_END_TIME.replace(new RegExp("-", "gm"),
- "/");
- var startTime = e.newdata.ORG_START_TIME.replace(new RegExp("-",
- "gm"), "/");
- if (new Date(startTime).getTime() > new Date(endTime).getTime()) {
- top.Dialog.alert("本单位开始时间不能早于本单位的结束时间");
- return false;
- }
- }
- if (e.newdata.GOVE_ORG_END_TIME != "") {
- var endTime = e.newdata.GOVE_ORG_END_TIME.replace(new RegExp("-",
- "gm"), "/");
- var startTime = e.newdata.GOVE_ORG_START_TIME.replace(new RegExp(
- "-", "gm"), "/");
- if (new Date(startTime).getTime() > new Date(endTime).getTime()) {
- top.Dialog.alert("同级政府开始时间不能早于同级政府的结束时间");
- return false;
- }
- }
- }
- isValida = true;
- }
- function initGrid1(data, item, type) {
- g = null;
- g = $("#maingrid2").quiGrid({
- columns : mycol,
- data : data,
- usePager : false,
- fixedCellHeight : false,
- headerRowHeight : 38,
- rowHeight : 38,
- enabledSort : false,
- width : '100%',
- /* height:"90%", */
- rownumbers : true,
- percentWidthMode : true,
- enabledEdit : true,
- clickToEdit : false,
- onAfterSubmitEdit : onAfterSubmitEdit,
- onAfterEdit : onAfterEdit,
- onBeforeSubmitEdit : checkSubmitEdit,
- onAfterShowData : function() {
- // setHight();
- setXqContentHeight();
- },
- onAfterChangeColumnWidth : changeColWidth,
- toolbar : item
- });
- if (totalFlag) {
- $("#hzxjsj_xq").parent().siblings().removeClass("backcolor");
- $("#hzxjsj_xq").parent().addClass("backcolor");
- }
- if ($("#maingrid2grid").height() < 400) {
- g.setOptions({
- height : "400px"
- });
- g.resetHeight();
- } else {
- g.setOptions({
- height : "auto"
- });
- g.resetHeight();
- }
- $(".l-grid-hd-cell-text").css("color", "white");
- }
- /**
- * 明细表工具栏 过滤规则:deptLevel小于3,等于3时要考虑是否有配置部门
- */
- function getXqItem(report_type) {
- var item = "";
- if (report_type=="2"&&(deptLevel < "3" || deptLevel == "3" && hasBanZuDept == "true")) {
- item = {
- items : [ {
- text : '新增',
- click : addUser,
- iconClass : 'add1_tem',
- id : "add"
- }, {
- line : true
- }, {
- text : '汇总下级数据',
- click : getXqtotal,
- iconClass : 'add1_tem',
- id : "hzxjsj_xq"
- }, {
- line : true
- }, {
- text : '获取接口数据',
- click : getInterFaceData,
- iconClass : 'import_tem',
- id : "jksj_xq"
- }, {
- line : true
- }, {
- text : '导入',
- click : goImport,
- iconClass : 'import_tem',
- id : "dr"
- }, {
- line : true
- },{
- text : '导出',
- click : export_report,
- iconClass : 'export_tem',
- id : "export_report"
- }, {
- line : true
- }
- /*
- * { text: '全屏', click: fullScreen2, iconClass:
- * 'import_tem',id:"qp2" }, { line: true }
- */
- ]
- };
- } else {
- item = {
- items : [ {
- text : '新增',
- click : addUser,
- iconClass : 'add1_tem',
- id : "add"
- }, {
- line : true
- }, {
- text : '获取接口数据',
- click : getInterFaceData,
- iconClass : 'import_tem',
- id : "jksj_xq"
- }, {
- line : true
- }, {
- text : '导入',
- click : goImport,
- iconClass : 'import_tem',
- id : "dr_xq"
- }, {
- line : true
- },{
- text : '导出',
- click : export_report,
- iconClass : 'export_tem',
- id : "export_report"
- }, {
- line : true
- }
- /*
- * { text: '全屏', click: fullScreen2, iconClass:
- * 'import_tem',id:"qp2" }, { line: true }
- */
- ]
- };
- }
- return item;
- }
- // 删除
- function onDelete(rowidx) {
- if (flag1 == true) {
- top.Dialog.alert("请先完成当前记录的编辑!");
- return false;
- }
- /*
- * var _editing=""; var newFlag=""; var arr=""; if(arguments.length>1){
- *
- * _editing = rowdata._editing; if(report_types!="7"){ arr =
- * getTableParamName(mycol); }else{ arr = getTableParam(mycol); } newFlag =
- * checkNew(arr,rowdata); }
- */
- /* if(!newFlag && _editing ||arguments.length==1 ){ */
- top.Dialog.confirm("确定要删除该记录吗?", function() {
- isValida = false;
- flag1 = false;
- g.endEdit(rowidx);
- // 删除记录
- if (rowidx == 0) {
- checkRowObj = false;
- }
- var row = g.getRow(rowidx);
- g.deleteRow(row);
- });
- /*
- * }else{ cancelEdit(rowidx); }
- */
- }
- // 编辑
- function beginEdit(rowid) {
- if (flag1) {
- top.Dialog.alert("请先完成正在编辑的一行!");
- return;
- // is_edit = true;
- } else {
- g.beginEdit(rowid);
- }
- }
- // 取消编辑
- function cancelEdit(rowid) {
- flag1 = false;
- g.cancelEdit(rowid);
- }
- var checkRowObj = false;
- // 结束编辑
- function endEdits(rowid) {
- var textInput = $(".l-grid-body-table").find("input[type='text']");
- var checkNum = 0;
- var len = textInput.length;
- for (var i = 0; i < len; i++) {
- if (textInput.eq(i).val() == "" || textInput.eq(i).val() == "请选择") {
- checkNum++;
- }
- }
- if (checkNum == len) {
- if (rowid > 0) {
- top.Dialog.confirm("不在首行的数据如果为空将会被删除,是否执行?", function() {
- g.endEdit(rowid);
- var rowObj = g.getRow(rowid);
- g.deleteRow(rowObj);
- });
- }
- if (rowid == 0) {
- checkRowObj = true;
- g.endEdit(rowid);
- }
- } else if (len > checkNum) {
- checkRowObj = false;
- g.endEdit(rowid);
- }
- }
- function showOrgSelect(item) {
- for (var i = 0; i < data11["list"].length; i++) {
- if (data11["list"][i]['value'] == item.ORG_GRADE)
- return data11["list"][i]['key'];
- }
- return item.ORG_GRADE;
- }
- function showGovSelect(item) {
- for (var i = 0; i < data11["list"].length; i++) {
- if (data11["list"][i]['value'] == item.GOV_ORG_GRADE)
- return data11["list"][i]['key'];
- }
- return item.GOV_ORG_GRADE;
- }
- // 新增
- var num2 = 0;
- function addUser() {
- if (flag1) {
- top.Dialog.alert("请先完成当前记录的编辑!");
- return false;
- }
- var typeValue = $("#sel").val();
- // 新增前判断首行是否为空
- if (typeValue != '7') {
- var textInput = $("#maingrid2").find(".l-grid2").find(".l-grid-body-inner").find("tbody").find("tr");
- if (textInput.eq(0).text().trim() == "修改删除") {
- checkRowObj = true;
- }
- }
- // checkRowObj 判断首行是否有空数据
- if (checkRowObj) {
- top.Dialog.alert("首行数据为空,不能继续添加");
- return false;
- }
- editingRow = 0;
- isNew = true;
- // isValida=true;
- var row = g.getRow(0);
- var rowData = {
- duty_way : 0,
- COMP_ID : corpId,
- COMP_NAME : newCompName
- };
- g.addEditRow(rowData, row, true);
- num2++;
- if ($("#maingridsgrid").height() < 400) {
- g.setOptions({
- height : "400px"
- });
- g.resetHeight();
- } else {
- g.setOptions({
- height : "auto"
- });
- g.resetHeight();
- }
- setHight();
- }
- // 编辑后事件
- function onAfterSubmitEdit(e) {
- isNew = false;
- }
- /*
- * window.onload = function (){ $(".selectbox").attr("readonly","readonly");
- * setTimeout(function(){ wh = $(window.document.body).height(); }, 1000); };
- */
- function zhiyin() {
- window.open("/nwyj/page/business/em/report/baobiaozy.html");
- }
- function print() {
- var type = $("#sel").val();
- if (maintableType == "1") {
- if (type == "7") {
- $("#maingrids").jqprint();
- } else {
- $("#maingrid2").jqprint();
- }
- } else {
- $("#maingrid").jqprint();
- }
- }
- function _addStatus(rowdata, rowindex, value, column) {
- // return "<a href='javascript:newHtml("+comp_id+","+name+")'>" + value +"
- // </a>"
- if (value == '总计') {
- return "<div style='background-color: #f2f2f2'>" + value + "</div>";
- } else {
- return "<div style='background-color: #dde5f0' class='company' title='"
- + value + "'>" + value + "</div>";
- }
- }
- // function selectWarning(json,url,textMsg){
- // var diag = new top.Dialog();//定义一个窗口对象
- // diag.Title = "选择更多填报计划";//窗口标题
- // diag.URL = "/nwyj/page/business/em/report/MoreWarning.html";//窗口对应的页面
- // diag.Height =300;
- // diag.Width = 600;
- // diag.OKEvent = function(){
- // diag.innerFrame.contentWindow.saveRecords(json,diag);
- // };
- // diag.CancelEvent = function(){
- // addRecords(url,json,textMsg,"save",backUrl);
- // diag.close();
- // };
- // diag.ButtonAlign = 'center';
- // diag.ID="warningNumber";
- // diag.show();
- // diag.OnLoad=function(){
- // diag.innerFrame.contentWindow.showWarningNumber(json);
- // };
- //
- // }
- // 能获取接口数据的数组
- var typeArr = [ "1", "2", "101", "4", "5", "3" ];
- var checkInterface = false;
- function getInterFaceData() {
- $("#jksj").parent().siblings().removeClass("backcolor");
- $("#jksj").parent().addClass("backcolor");
- $("#jksj_xq").parent().siblings().removeClass("backcolor");
- $("#jksj_xq").parent().addClass("backcolor");
- $("#affairType").parent().find(".mainCon td input[type=text]").css({"border-left":"solid 1px #a7b5bc","border-top":"solid 1px #a7b5bc","border-bottom":"solid 1px #ced9df","border-right":"none"});
- if (num % 2 != 0) {
- flag = false;
- $("#handlerinfo").html("开启填写明细");
- num = 2;
- }
- if (flag1) {
- top.Dialog.alert("请完成编辑再获取!");
- return false;
- }
- g.endEdit();
- var value = $("#sel").val();
- if ($.inArray(value, typeArr) > -1) {
- /*
- * if(value=="14"){ if(flag1){ top.Dialog.alert("请编辑完再获取"); return
- * false; } }
- */
- $("body").eq(0).showLoading();
- var faceparams = "";
- if (maintableType == "1") {
- faceparams = {
- report_type : value,
- roleId : role_id,
- corpId : compId,
- type : "xq"
- };
- } else {
- faceparams = {
- report_type : value,
- roleId : role_id,
- corpId : compId,
- type : "tj"
- };
- }
- var urls = "";
- if (value == '5') {
- $("#jksj").parent().addClass("backcolor");
- checkInterface = true;
- beginWrite();
- urls = $.pathname()
- + "/ws/xianlutingyun/XianlutingyunService/getInterfaceData";
- }
- // else{
- // urls = $.pathname() +
- // "/ws/xianlutingyun/XianlutingyunService/getNewInterFaceData";
- // }
- if (value == '1') {
- urls = $.pathname()
- + "/ws/xianlutingyun/XianlutingyunService/getNewInterFaceData";
- beginWrite();
- $("#jksj").parent().addClass("backcolor");
- checkInterface = true;
- }
- if (value == '2' || value == "101") {
- faceparams["deptLevel"] = deptLevel;
- urls = $.pathname()
- + "/ws/xianlutingyun/XianlutingyunService/getBDZData";
- beginWrite();
- $("#jksj").parent().addClass("backcolor");
- checkInterface = true;
- }
- if (value == '3' || value == '4') {
- urls = $.pathname()
- + "/ws/xianlutingyun/XianlutingyunService/getInterDG";
- beginWrite();
- $("#jksj").parent().addClass("backcolor");
- checkInterface = true;
- }
- $.ajax({
- url : urls,
- type : 'post',
- timeout : 300000,
- data : faceparams,
- dataType : 'json',
- /* async:false, */
- success : function(data) {
- $("body").eq(0).hideLoading();
- if (data["rows"].length > 0) {
- g.options.data = data;
- g.loadData();
- } else {
- top.Dialog.alert("目前暂无数据");
- }
- setHight();
- },
- error : function(e) {
- $.messager.alert('导入上次报表失败!', '访问服务失败!', 'error');
- }
- });
- } else {
- top.Dialog.alert("该表的接口暂未开通");
- }
- }
- function getItem(type) {
- var item = "";
- if (deptLevel < "3" || deptLevel == "3" && hasBanZuDept == "true") {
- if (role_id == "R002105430210" || role_id == "R002105430211"
- || role_id == "R002105430212") {
- item = [ {
- text : '开启填写明细',
- click : beginWrite,
- iconClass : 'add1_tem',
- id : "handlerinfo"
- }, {
- line : true
- }, {
- text : '导入上次数据',
- click : import_report,
- iconClass : 'import_tem',
- id : "drscsj"
- }, {
- line : true
- }, {
- text : '汇总下级数据',
- click : total,
- iconClass : 'add1_tem',
- id : "hzxjsj"
- }, {
- line : true
- }, {
- text : '获取接口数据',
- click : getInterFaceData,
- iconClass : 'add1_tem',
- id : "jksj"
- }, {
- line : true
- }, {
- text : '导入',
- click : goImport,
- iconClass : 'import_tem',
- id : "dr"
- }, {
- line : true
- }, {
- text : '自动补齐数据',
- title : "单元格获取上次数据关闭",
- iconClass : 'import_tem',
- id : "lock"
- }, {
- line : true
- }
- ];
- } else {
- item = [ {
- text : '开启填写明细',
- click : beginWrite,
- iconClass : 'add1_tem',
- id : "handlerinfo"
- }, {
- line : true
- }, {
- text : '导入上次数据',
- click : import_report,
- iconClass : 'import_tem',
- id : "drscsj"
- }, {
- line : true
- }, {
- text : '汇总下级数据',
- click : total,
- iconClass : 'add1_tem',
- id : "hzxjsj"
- }, {
- line : true
- }, {
- text : '导入',
- click : goImport,
- iconClass : 'import_tem',
- id : "dr"
- }, {
- line : true
- }, {
- text : '自动补齐数据',
- title : "单元格获取上次数据关闭",
- iconClass : 'import_tem',
- id : "lock"
- }, {
- line : true
- }
- ];
- }
- if (type == "8") {
- var tool1 = {
- text : '查看下级单位数据',
- click : getCompData,
- iconClass : 'view_tem',
- id : "corpData"
- };
- var tool2 = {
- line : true
- };
- item.push(tool1, tool2);
- }
- } else {
- item = [ {
- text : '开启填写明细',
- click : beginWrite,
- iconClass : 'add1_tem',
- id : "handlerinfo"
- }, {
- line : true
- }, {
- text : '导入上次数据',
- click : import_report,
- iconClass : 'import_tem',
- id : "drscsj"
- }, {
- line : true
- }, {
- text : '导入',
- click : goImport,
- iconClass : 'import_tem',
- id : "dr"
- }, {
- line : true
- }, {
- text : '自动补齐数据',
- title : "单元格获取上次数据关闭",
- iconClass : 'import_tem',
- id : "lock"
- }, {
- line : true
- }
- ];
- }
- return item;
- };
- /*
- * function del(type){
- *
- * if(type!="8"){ var dom = $(".l-panel-topbar").find("#corpData");
- * if(dom.length>0){ dom.remove();
- * $(".l-panel-topbar").find(".l-bar-separator").last().remove(); } } }
- */
- function goImport() {
- var sel = $("#sel").val();
- if (sel == "100") {
- top.Dialog.alert("此表暂不支持导入功能");
- return;
- }
- flag = false;
- var iframe = parent.document.getElementsByName("frmright")[0];
- iframe.src = "/nwyj/page/business/em/report/Import_Report.html?role_id="
- + role_id + "?report_type=" + $("#sel").val() + "?value="
- + $("#affairType").val();
- }
- function export_report(){
- var data = JSON.stringify(g.getData());
- var condition = {
- "report_type":$("#sel").val(),
- "json":data,
- "flag":"huizong",
- "id":corpId
- };
- excelExport("",condition,"导出"+corpName+mycol1,"",corpName+mycol1,'report');
- }
- function getPlanContent(val) {
- var datas = getPlanRequires(val);
- datas = removeNull(datas);
- $("#star_time").html(datas.rows[0].START_TIME);
- $("#end_time").html(datas.rows[0].END_TIME);
- $("#type").html(datas.rows[0].FILL_IN_SCHEDULE);
- if (datas.rows[0].FILL_IN_SCHEDULE == "周期性") {
- $("#round").html(datas.rows[0].ROUND_TIME);
- $(".round_time").show();
- $(".temporary_time").hide();
- }
- if (datas.rows[0].FILL_IN_SCHEDULE == "临时性") {
- $("#temporary").html(datas.rows[0].TEMPORARY_TIME);
- $(".temporary_time").show();
- $(".round_time").hide();
- }
- $("#showplan").show();
- $("#showRequire").show();
- $("#showRequire").find("a").html("隐藏报表填报要求");
- var message = datas.rows[0].DEPT_NAME.split(":");
- if (message[0] == "应急办") {
- $("#yjb").show();
- $("#zygl").hide();
- var planMessage = message[1].split("|");
- var depts = "";
- for (var i = 0; i < planMessage.length; i++) {
- depts = planMessage[i].split(";");
- if (depts[0] == "R002105430210") {
- $("#sysDept").html(depts[1]);
- }
- if (depts[0] == "R002105430211") {
- $("#equipmentDept").html(depts[1]);
- }
- if (depts[0] == "R002105430212") {
- $("#markingDept").html(depts[1]);
- }
- if (depts[0] == "R002105430213") {
- $("#safeyDept").html(depts[1]);
- }
- }
- } else {
- var deptRole = role_id;
- $("#yjb").hide();
- $("#zygl").show();
- var planMessage = message[1].split(";");
- var report = planMessage[2];
- if (deptRole == "R002105430210") {
- $("#deptRole").text("系统运行部");
- } else if (deptRole == "R002105430211") {
- $("#deptRole").text("生产设备部");
- } else if (deptRole == "R002105430212") {
- $("#deptRole").text("市场营销部");
- } else if (deptRole == "R002105430213") {
- $("#deptRole").text("安全监管部");
- }
- $("#showTables").html(report);
- }
- var planH = $("#showplan").height();
- var requireH = $("#showRequire").height();
- $(parent.document.body).find("#frmright").css("height",
- wh + planH + requireH + 30);
- }
- function getUrlParams(msg, num, url) {
- if (msg != "" && url.indexOf(msg) > -1 && num === 0) {
- return url.split("?")[1].split("=")[1];
- } else if (num !== 0) {
- return url.split("?")[num];
- } else {
- return "";
- }
- }
- function saveTable(type, json) {
- var textMsg = "";
- var urls = $.pathname() + "/ws/xianlutingyun/XianlutingyunService/create";
- var value = $("#sel").val();
- if (value == "8" && (deptLevel == 3 || deptLevel == 4)) {
- var areaFlag = $("#areaSel").val();
- if (areaFlag == "") {
- top.Dialog.alert("请选择区域");
- return;
- }
- }
- var recordParams = "";
- if (value != 8) {
- recordParams = {
- json : json,
- user_id : user_id,
- report_type : value,
- comp_id : corpId,
- name : real_name,
- report_comp : corpName + deptName,
- roleId : role_id,
- affair : $("#affairType").attr("relText")
- };
- } else {
- recordParams = {
- json : json,
- user_id : user_id,
- report_type : value,
- comp_id : corpId,
- name : real_name,
- report_comp : corpName + deptName,
- roleId : role_id,
- affair : $("#affairType").attr("relText"),
- flag : $("#areaSel").val()
- };
- }
- if (type == "save") {
- recordParams["operate"] = "新增了";
- recordParams["sendStat"] = "save";
- // recordParams["report_id"] =$("#warning").attr("relValue");
- // recordParams["warnText"] = $("#warning").attr("relText");
- recordParams["report_id"] = $("#affairType").val();
- // 没有事件类型时获取不到计划名称
- recordParams["warnText"] = affairLength == 0 || $("#affairType").val()==""? "" : $("#affairType").data("selectedNode").warning;
- textMsg = "新增报表";
- } else {
- recordParams["operate"] = "新增并上报了";
- recordParams["sendStat"] = "send";
- textMsg = '新增并上报报表';
- }
- if (type == "save") {
- addRecords(urls, recordParams, textMsg, type, backUrl);
- }
- if (type == "send") {
- if (affairLength == 0) {
- top.Dialog.alert("现在没有可上报的计划,请先保存");
- return;
- } else if ($("#affairType").val() == "") {
- top.Dialog.alert("请选择一种事件类型进行上报");
- return;
- } else {
- var warnText = $("#affairType").data("selectedNode").warning;
- var warnValue = $("#affairType").val();
- recordParams["report_id"] = warnValue;
- recordParams["warnText"] = warnText;
- }
- if (_thisUrl.indexOf("role_Id=") == -1) {// 返回代办页面
- backUrl = "/nwyj/page/business/em/waitdo/waitDo.html";
- addRecords(urls, recordParams, textMsg, type, backUrl);
- } else {
- addRecords(urls, recordParams, textMsg, type, backUrl);
- }
- }
- }
- /**
- * ********************************全屏代码**************************************************
- */
- /*
- * function fullScreen(){
- * if(undefined==$("#qp").attr("fullState")||0==$("#qp").attr("fullState")){
- *
- * $("#qp").attr("fullState","1").text("退出全屏");
- * $(top.document).find("#frmright").attr("width","100%").css({position:
- * "fixed",top: "0px",left: "0px","z-index": 50}); $("#maingrid").css({position:
- * "fixed",top: "0px", "z-index": 750,height:$(top.document).height()+"px",
- * "overflow-y": "auto","overflow-x": "hidden" }); }else{
- *
- * $("#qp").attr("fullState","0").text("全屏");
- * $(top.document).find("#frmright").attr("width","99%").css({position:
- * "initial"}); $("#maingrid").css({position:
- * "initial",height:"100%","overflow-y": "hidden","overflow-x": "hidden"}); } }
- * function fullScreen2(){
- * if(undefined==$("#qp2").attr("fullState")||0==$("#qp2").attr("fullState")){
- * $("#qp2").attr("fullState","1"); $("#qp2").text("退出全屏");
- * $(top.document).find("#frmright").attr("width","100%").css({position:
- * "fixed",top: "0px",left: "0px","z-index": 50});
- * $("#maingrid2").css({position: "fixed",top: "0px", "z-index":
- * 800,height:$(top.document).height()+"px", "overflow-y": "auto","overflow-x":
- * "hidden" }); }else{ $("#qp2").attr("fullState","0"); $("#qp2").text("全屏");
- * $(top.document).find("#frmright").attr("width","99%").css({position:
- * "initial"}); $("#maingrid2").css({position:
- * "initial",height:"100%","overflow-y": "hidden","overflow-x": "hidden"}); } }
- */
- function checkSubmitEdit(e) {
- if (isValida) {
- var reportType = $("#sel").val();
- if (reportType == "101") {
- reportType = "2";
- }
- if (reportType == "2") {
- if (e.newdata.DYDJ == "") {
- top.Dialog.alert("电压等级不能为空");
- return false;
- }
- if (e.newdata.BDZMC == ""
- || validateInput(e.newdata.BDZMC, "^[\" \"]+$")) {
- top.Dialog.alert("变电站名称不能为空");
- return false;
- }
- if (e.newdata.SFYHF == "") {
- top.Dialog.alert("是否已恢复不能为空");
- return false;
- }
- if (e.newdata.SFYHF != "") {
- if (e.newdata.SFYHF == "是") {
- if (e.newdata.HFSJ == ""
- || validateInput(e.newdata.HFSJ, "^[\" \"]+$")) {
- top.Dialog.alert("是否已恢复为是,请输入恢复时间");
- return false;
- }
- }
- }
- if (e.newdata.TYSJ == ""
- || validateInput(e.newdata.TYSJ, "^[\" \"]+$")) {
- top.Dialog.alert("停运时间不能为空");
- return false;
- }
- if (e.newdata.HFSJ != "") {
- var endTime = e.newdata.HFSJ
- .replace(new RegExp("-", "gm"), "/");
- var startTime = e.newdata.TYSJ.replace(new RegExp("-", "gm"),
- "/");
- if (new Date(startTime).getTime() > new Date(endTime).getTime()) {
- top.Dialog.alert("停运时间不能早于恢复时间");
- return false;
- }
- }
- }
- }
- isValida = true;
- }
- /**
- * 表格切换
- *
- * @param typeVal
- */
- function changeTable(typeVal) {
- var tableType = getThing($.pathname()
- + "/ws/xianlutingyun/XianlutingyunService/getCheckType", {
- report_type : typeVal
- }, 'text');
- maintableType = tableType;
- //加载填写说明
- getRequire(nowRole);
- changeRequireByVal(typeVal);
-
- getColumns(typeVal);
- if (tableType == "1") {
- $("#maingrid").hide();
- $("#maingrid2").hide();
- $("#maingrids").hide();
- $("#yjzy").hide();
- if (typeVal == "7") {
- $("#maingrids").show();
- initGrid(urls1);
- } else {
- $("#maingrid2").show();
- excType = typeVal;
- var item = getXqItem(typeVal);
- // 是否汇总
- console.log("2904--" + totalFlag);
- checkXqHuiZong(role_id, deptLevel, totalFlag);
- initGrid1(xqData, item);
- }
- // onAfterShowData();
- } else {
- var item = getItem(typeVal);
- $("#maingrid").show();
- $("#maingrids").hide();
- $("#maingrid2").hide();
- getRows(typeVal);
- init(testData, item, typeVal);
- // 是否汇总
- console.log("2918--" + totalFlag);
- checkHuiZong(role_id, deptLevel, totalFlag);
- }
- $("#add").text("新增" + corpName + mycol1);
- $("body").eq(0).hideLoading();
- num2 = 0;
- if (num % 2 != 0) {
- $("#handlerinfo").text("开启填写明细");
- $("#handlerinfo").parent().removeClass("backcolor");
- num = 2;
- }
- // $("#jksj").parent().removeClass("backcolor");
- // $("#drscsj").parent().removeClass("backcolor");
- $(".l-grid-body2").css({
- "overflow" : "scroll"
- });
- setHight();
- }
- function getCompData() {
- window.open("/nwyj/page/business/em/report/CompData.html?deptLevel="
- + deptLevel + "&roleId=" + role_id + "&corpId=" + corpId
- + "&compName=" + corpName + "&affair="+$("#affairType").attr("relText") + "&id="+$("#affairType").attr("relValue"));
- }
- /**
- * 统计表判断是否要汇总下级数据 需要汇总:deptLevel=2,3(配置有部门时)
- */
- function checkHuiZong(role_id, deptLevel, totalFlag) {
- console.log("checkHuiZong:" + totalFlag);
- if (totalFlag&& (deptLevel!=""&&deptLevel < "3" || deptLevel == "3" && hasBanZuDept == "true")) {
- total();
- }
- }
- /**
- * 明细表判断是否要汇总下级数据
- */
- function checkXqHuiZong(role_id, deptLevel, totalFlag) {
- console.log("checkXqHuiZong:" + totalFlag);
- if (totalFlag&& (deptLevel!=""&&deptLevel < "3" || deptLevel == "3" && hasBanZuDept == "true")) {
- getXqtotal();
- } else {
- xqData = {
- "rows" : [ {
- "FD_OBJECTID" : "",
- "COMP_ID" : corpId,
- "COMP_NAME" : newCompName
- } ]
- };
- }
- }
- /**
- * 统计表设置高度
- * @param type
- */
- function setTjContentHeight(type){
- if(type != "8"){
- $(window.document.body).height($("#maingrid").height()+$("#tianXie_con").height()+220);
- }else{
- $(window.document.body).height($("#yjzy").height()+$("#tianXie_con").height()+220);
- }
- $(top.document.body).find("#frmright").css("height",$(window.document.body).height()+30);
- }
- /**
- * 明细表设置高度
- * @param type
- */
- function setXqContentHeight(){
- $(window.document.body).height($("#maingrid2").height()+$("#tianXie_con").height()+220);
- $(top.document.body).find("#frmright").css("height",$(window.document.body).height()+30);
- }
- function changeColWidth(column,newwidth){
- if(newwidth>500){
- //重新设置宽度
- g.setColumnWidth(column.columnname,'200');
- g.loadData();
- }
- }
|