checkrecord.js 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840
  1. /**
  2. * checkrecord.js
  3. * 巡检记录界面
  4. * emial: yaoqiang@chinausky.com
  5. * create: 2018-12-08
  6. */
  7. Ext.Loader.setConfig({
  8. enabled: true
  9. });
  10. Ext.Loader.setPath('Ext.ux', '../../res/extjs/examples/ux');
  11. Ext.require([
  12. 'Ext.grid.*',
  13. 'Ext.data.*',
  14. 'Ext.ux.RowExpander',
  15. 'Ext.selection.CheckboxModel'
  16. ]);
  17. var company_code;
  18. var myStore=null;
  19. var myStore1=null;
  20. var V_LOGINNAME='',V_PASSWORD='';
  21. var menuidx = '';
  22. var mouseon;
  23. var changeon;
  24. var mouseoff;
  25. var menu_click;
  26. var pieMask;
  27. var sm = Ext.create('Ext.selection.CheckboxModel');
  28. var sm1 = Ext.create('Ext.selection.CheckboxModel');
  29. Ext.define('CheckRecord2',{
  30. extend: 'Ext.data.Model',
  31. fields: [
  32. {name:'id', type:'string'},
  33. {name:'xh', type:'int'},
  34. {name:'plan_name', type:'string'},
  35. {name:'ywcsj', type:'string'},
  36. {name:'zt', type:'string'},
  37. {name:'data3', type:'string'},
  38. {name:'name', type:'string'},
  39. {name:'phone', type:'string'},
  40. {name:'completion', type:'string'},
  41. {name:'xjrysl', type:'int'},
  42. {name:'jrrw', type:'int'},
  43. {name:'csrw', type:'int'},
  44. {name:'jrwcrw', type:'int'},
  45. ]
  46. });
  47. Ext.define('CheckRecord3',{
  48. extend: 'Ext.data.Model',
  49. fields: [
  50. {name:'jlid', type:'string'},
  51. {name:'dwid', type:'string'},
  52. {name:'xh', type:'int'},
  53. {name:'spot_name', type:'string'},
  54. {name:'spot_address', type:'string'},
  55. {name:'wcqk', type:'string'},
  56. {name:'wc_time', type:'string'},
  57. {name:'wbr', type:'string'},
  58. // {name:'completion_status', type:'string'},
  59. ]
  60. });
  61. function exportbtn_click(){
  62. baseUrl = document.getElementById('basePath').value;
  63. V_LOGINNAME = $("#V_LOGINNAME").val();
  64. V_PASSWORD = $("#V_PASSWORD").val();
  65. plan_name = document.getElementById('plan_name').value;
  66. person_liable_id = document.getElementById('person_liable_id').value;
  67. zt = document.getElementById('zt').value;
  68. data3a = document.getElementById('data3a').value;
  69. data3b = document.getElementById('data3b').value;
  70. // alert(plan_name);
  71. var fields = '';
  72. var array = ['xh','plan_name','ywcsj','zt','completion','data3','name','phone'];
  73. var name = ['序号','任务名称','应完成时间','当前状态','完成情况(%)','实际完成时间','相关责任人','联系电话'];
  74. for(var i=0;i<7;i++){
  75. if(i>0)
  76. fields += ',';
  77. fields += '{id:"'+array[i]+'",title:"'+name[i]+'",shown:"'+true+'"}';
  78. }
  79. var query = new Object();
  80. // query.V_LOGINNAME = V_LOGINNAME;
  81. // query.V_PASSWORD = V_PASSWORD;
  82. query.plan_name = plan_name;
  83. query.person_liable_id = person_liable_id;
  84. query.data3a = data3a;
  85. query.zt = zt;
  86. query.data3b = data3b;
  87. query.EXPORT_FILE = '巡检记录列表';
  88. query.fields = '['+fields+']';
  89. $.ajax({
  90. type:'POST',
  91. url: baseUrl+"iot/excel/view/XjSpotOperationRecordExcel1",
  92. data: {
  93. queryJson : Ext.JSON.encode(query)
  94. },
  95. success: function(result){
  96. var json = eval('(' + result + ')');
  97. if(json.action=='dormExport'){
  98. ConfirmStore = json.RESULT;
  99. var elemIF = document.createElement("iframe");
  100. elemIF.src = baseUrl+json.filename;
  101. elemIF.style.display = "none";
  102. document.body.appendChild(elemIF);
  103. }
  104. }
  105. });
  106. }
  107. Ext.onReady(function(){
  108. var baseUrl = document.getElementById('basePath').value;
  109. var theme = document.getElementById('theme').value;
  110. var chkIcon = '<img src="'+baseUrl+'res/img/common/check.gif"/>'
  111. var unchkIcon = '<img src="'+baseUrl+'res/img/common/uncheck.gif"/>'
  112. // company_code = document.getElementById('company_code').value;
  113. $("#V_LOGINNAME").val(sessionStorage.getItem('V_LOGINNAME'));
  114. $("#V_PASSWORD").val(sessionStorage.getItem('V_PASSWORD'));
  115. V_LOGINNAME = $("#V_LOGINNAME").val();
  116. V_PASSWORD = $("#V_PASSWORD").val();
  117. var countPerPage = 13;
  118. var maxHeight = 10000;
  119. var chkBoolean = function(flag) {
  120. if(flag)
  121. return chkIcon;
  122. return unchkIcon;
  123. }
  124. var queryJson = new Object();
  125. // queryJson.V_LOGINNAME = V_LOGINNAME;
  126. // queryJson.V_PASSWORD = V_PASSWORD;
  127. // queryJson.COMMSTATUS = 'NO';
  128. if((company_code!=null)&&(company_code!='null')&&(company_code.length>0))
  129. queryJson.company_code = company_code;
  130. var states1 = Ext.create('Ext.data.Store', {
  131. fields: ['status', 'name'],
  132. data : [
  133. // {"status":-1, "name":"全选"},
  134. {"status":"待开通", "name":"待开通"},
  135. {"status":"已开通", "name":"已开通"},
  136. {"status":"已锁定", "name":"已锁定"},
  137. {"status":"注销", "name":"注销"},
  138. ]
  139. });
  140. myStore = Ext.create('Ext.data.Store', {
  141. model: 'CheckRecord2',
  142. pageSize: countPerPage,
  143. proxy: {
  144. type: 'ajax',
  145. actionMethods: {
  146. create : 'POST',
  147. read : 'POST', // by default GET
  148. update : 'POST',
  149. destroy: 'POST'
  150. },
  151. url: baseUrl+'iot/spotoperationrecord/getList1',
  152. reader: {
  153. type: 'json',
  154. root: 'RESULT',
  155. totalProperty: 'totalCount'
  156. },
  157. extraParams:{
  158. queryJson:Ext.JSON.encode(queryJson)
  159. }
  160. },
  161. // sorters:[{
  162. // property:'data_time',
  163. // direction:'DESC'
  164. // }],
  165. remoteSort: true
  166. });
  167. myStore1 = Ext.create('Ext.data.Store', {
  168. model: 'CheckRecord3',
  169. pageSize: 10,
  170. proxy: {
  171. type: 'ajax',
  172. url: baseUrl+'iot/spotoperationrecord/getJlPointsList1',
  173. reader: {
  174. type: 'json',
  175. root: 'RESULT',
  176. totalProperty: 'totalCount'
  177. },
  178. extraParams:{
  179. queryJson:Ext.JSON.encode(queryJson)
  180. }
  181. },
  182. remoteSort: true
  183. });
  184. var data =Ext.Date.format(new Date(), 'm/d/Y');
  185. var show_page = function(){
  186. var plan_name = document.getElementById('inspectorsCheck_title2_input').value;
  187. var person_liable_id = document.getElementById('inspectorsCheck_title3_input1').value;
  188. var data3b = document.getElementById('inspectorsCheck_title3_input2').value;
  189. var data3a = document.getElementById('inspectorsCheck_title3_input3').value;
  190. var zt = document.getElementById('inspectorsCheck_title3_input4').value;
  191. var query = new Object();
  192. if(plan_name.length>0){
  193. query.plan_name = plan_name;
  194. $("#plan_name").val(plan_name);
  195. }
  196. if(data3b.length>0){
  197. query.data3b = data3b;
  198. $("#data3b").val(data3b);
  199. }
  200. if(data3a.length>0){
  201. query.data3a = data3a;
  202. $("#data3a").val(data3a);
  203. }
  204. if(zt.length>0){
  205. query.zt = zt;
  206. $("#zt").val(zt);
  207. }
  208. if(person_liable_id.length>0){
  209. query.person_liable_id = person_liable_id;
  210. $("#person_liable_id").val(person_liable_id);
  211. }
  212. // query.V_LOGINNAME = V_LOGINNAME;
  213. // query.V_PASSWORD = V_PASSWORD;
  214. var jsonstr = Ext.JSON.encode(query);
  215. myStore.getProxy().extraParams = {
  216. queryJson : jsonstr
  217. };
  218. Ext.getCmp('InspectorsCheckListPageToolbar').moveFirst();
  219. }
  220. var reset1 = function(){
  221. document.getElementById('inspectorsCheck_title2_input').value = '';
  222. document.getElementById('inspectorsCheck_title3_input1').value = '';
  223. document.getElementById('inspectorsCheck_title3_input2').value = '';
  224. document.getElementById('inspectorsCheck_title3_input3').value = '';
  225. document.getElementById('inspectorsCheck_title3_input4').value = '';
  226. $("#plan_name").val('');
  227. $("#data3b").val('');
  228. $("#data3a").val('');
  229. $("#zt").val('');
  230. $("#person_liable_id").val('');
  231. show_page();
  232. }
  233. mouseon = function(obj){
  234. var id = obj.id;
  235. $("#"+id).removeClass(id);
  236. $("#"+id).addClass(id+'_on');
  237. }
  238. mouseoff = function(obj){
  239. var mid = "inspectorsCheck_";
  240. for(var i=1;i<4;i++){
  241. var id = "inspectorsCheck_title"+i+"_div";
  242. $("#"+id).removeClass(id+'_on');
  243. $("#"+id).addClass(id);
  244. }
  245. if(menuidx=='m1'){
  246. mid += 'title1_div';
  247. $("#"+mid).removeClass(mid);
  248. $("#"+mid).addClass(mid+'_on');
  249. }
  250. else if(menuidx=='m2'){
  251. mid += 'title2_div';
  252. $("#"+mid).removeClass(mid);
  253. $("#"+mid).addClass(mid+'_on');
  254. }
  255. else if(menuidx=='m3'){
  256. mid += 'title3_div';
  257. $("#"+mid).removeClass(mid);
  258. $("#"+mid).addClass(mid+'_on');
  259. }
  260. }
  261. menu_click = function(obj){
  262. var id = obj.id;
  263. if(id=='inspectorsCheck_title1_div'){
  264. menuidx = 'm1';
  265. show_page();
  266. }
  267. else if(id=='inspectorsCheck_title2_div'){
  268. menuidx = 'm2';
  269. reset1();
  270. }
  271. else if(id=='inspectorsCheck_title3_div'){
  272. menuidx = 'm3';
  273. exportbtn_click();
  274. }
  275. }
  276. var maintenancedevice = function(){
  277. var maintenance_look_device = document.getElementById('inspectorsCheck_look_device');
  278. var img = document.createElement('img');
  279. img.width=400;
  280. img.height=400;
  281. img.src = baseUrl+ConfirmStore[0].picture_route;
  282. // img.src = ConfirmStore[0].picture_route;
  283. img.setAttribute('class','maintenance_look_device_img');
  284. maintenance_look_device.appendChild(img);
  285. var div4 = document.createElement('div');
  286. div4.style.textAlign='center';
  287. div4.innerHTML=ConfirmStore[0].remarks;
  288. maintenance_look_device.appendChild(div4);
  289. }
  290. var editMaintenance = function(spot_id){
  291. var spot_id = spot_id;
  292. Ext.create('Ext.window.Window', {
  293. id:'inspectorsCheck_data_win1',
  294. height: 500,
  295. width: 400,
  296. layout: 'fit',
  297. modal:true,
  298. buttons:[
  299. {
  300. text:'关闭',
  301. handler : function() {
  302. Ext.getCmp('inspectorsCheck_data_win1').destroy();
  303. }
  304. }
  305. ],
  306. closeAction:'destroy',
  307. html:'<div id="inspectorsCheck_look_device"></div>'
  308. }).show();
  309. var query = new Object();
  310. // query.V_LOGINNAME = $("#V_LOGINNAME").val();
  311. // query.V_PASSWORD = $("#V_PASSWORD").val();
  312. query.id = spot_id;
  313. $.ajax({
  314. type:'POST',
  315. url: baseUrl+"iot/inspectionpoints/getList1",
  316. data: {
  317. queryJson : Ext.JSON.encode(query)
  318. },
  319. success: function(result){
  320. var json = eval('(' + result + ')');
  321. if(json.action=='getInspectionPointsList'){
  322. ConfirmStore = json.RESULT;
  323. maintenancedevice(ConfirmStore);
  324. }
  325. }
  326. });
  327. }
  328. var maintenancePresentation = function(){
  329. var maintenanceCheck_look_Presentation = document.getElementById('inspectorsCheck_look_Presentation');
  330. var img = document.createElement('img');
  331. img.src = ConfirmStore[0].report_photos;
  332. img.setAttribute('class','maintenance_look_device_img_baogao');
  333. maintenanceCheck_look_Presentation.appendChild(img);
  334. var div4 = document.createElement('div');
  335. div4.style.textAlign='center';
  336. div4.innerHTML=ConfirmStore[0].dwsb_remarks;
  337. maintenanceCheck_look_Presentation.appendChild(div4);
  338. }
  339. var editMaintenancePresentation = function(spot_id){
  340. var spot_id = spot_id;
  341. Ext.create('Ext.window.Window', {
  342. id:'inspectorsCheck_Presentation_win1',
  343. height: 400,
  344. width: 300,
  345. layout: 'fit',
  346. modal:true,
  347. buttons:[
  348. {
  349. text:'关闭',
  350. handler : function() {
  351. Ext.getCmp('inspectorsCheck_Presentation_win1').destroy();
  352. }
  353. }
  354. ],
  355. closeAction:'destroy',
  356. html:'<div id="inspectorsCheck_look_Presentation"></div>'
  357. }).show();
  358. var query = new Object();
  359. // query.V_LOGINNAME = $("#V_LOGINNAME").val();
  360. // query.V_PASSWORD = $("#V_PASSWORD").val();
  361. query.jlid = spot_id;
  362. $.ajax({
  363. type:'POST',
  364. url: baseUrl+"iot/spotoperationrecord/getJlPointsList1",
  365. data: {
  366. queryJson : Ext.JSON.encode(query)
  367. },
  368. success: function(result){
  369. var json = eval('(' + result + ')');
  370. if(json.action=='getjlPointsList'){
  371. ConfirmStore = json.RESULT;
  372. maintenancePresentation(ConfirmStore);
  373. }
  374. }
  375. });
  376. }
  377. changeon = function(obj){
  378. var id=document.getElementById('checkRecord_id').value;
  379. var value = obj.value;
  380. var query = new Object();
  381. if(value.length>0){
  382. query.data3 = value;
  383. }
  384. query.id = id;
  385. // query.V_LOGINNAME = V_LOGINNAME;
  386. // query.V_PASSWORD = V_PASSWORD;
  387. var jsonstr = Ext.JSON.encode(query);
  388. myStore1.getProxy().extraParams = {
  389. queryJson : jsonstr
  390. };
  391. Ext.getCmp('InspectorsCheckListPageToolbar1').moveFirst();
  392. }
  393. var MaintenanceCheckPanel1 =Ext.create('Ext.grid.Panel', {
  394. header :{
  395. height:0,
  396. border:'0px solid #000000'
  397. },
  398. id: 'InspectorsCheckListPanel1',
  399. store: myStore1,
  400. selModel: sm1,
  401. columns: [
  402. { header: '点位记录ID', dataIndex: 'jlid',hidden:true, menuDisabled:true },
  403. { header: '点位ID', dataIndex: 'dwid',hidden:true, menuDisabled:true },
  404. { header: '序号', dataIndex: 'xh',hidden:true, menuDisabled:true },
  405. { header: '点位名称', dataIndex: 'spot_name', width:150,align:'center', menuDisabled:true },
  406. { header: '点位地址', dataIndex: 'spot_address', width:150,align:'center', menuDisabled:true },
  407. { header: '巡检状态', dataIndex: 'wcqk', width:70,align:'center', menuDisabled:true },
  408. { header: '巡检人', dataIndex: 'wbr', width:70,align:'center', menuDisabled:true },
  409. { header: '巡检时间', dataIndex: 'wc_time', width:156,align:'center', menuDisabled:true },
  410. {
  411. text:'点位详情',
  412. xtype : 'actioncolumn',
  413. width:80,
  414. sortable:false,
  415. align:'center',
  416. menuDisabled:true,
  417. items:[{
  418. icon: '../../res/img/common/tupianbtn.png',
  419. tooltip: '点位详情',
  420. handler: function(grid, rowIndex, colIndex) {
  421. var rec = grid.getStore().getAt(rowIndex);
  422. // alert(rec.get("dwid"));
  423. editMaintenance(rec.get("dwid"));
  424. }
  425. }]
  426. },
  427. {
  428. text:'巡检报告',
  429. xtype : 'actioncolumn',
  430. width:80,
  431. sortable:false,
  432. align:'center',
  433. menuDisabled:true,
  434. items:[{
  435. icon: '../../res/img/common/tupianbtn.png',
  436. tooltip: '点位详情',
  437. handler: function(grid, rowIndex, colIndex) {
  438. var rec = grid.getStore().getAt(rowIndex);
  439. editMaintenancePresentation(rec.get("jlid"));
  440. }
  441. }]
  442. }
  443. ],
  444. columnLines: true,
  445. height: 380,
  446. width: 780,
  447. bbar: new Ext.PagingToolbar({
  448. store: myStore1,
  449. id:'InspectorsCheckListPageToolbar1',
  450. displayInfo: true,
  451. pageSize: 10,
  452. prependButtons: true,
  453. displayMsg : '显示第 {0}条到 {1}条记录,总共 {2}条',
  454. emptyMsg : "没有记录",
  455. firstText: '第一页',
  456. prevText: '前一页',
  457. nextText: '后一页',
  458. lastText: '最后一页',
  459. refreshText: '刷新',
  460. }),
  461. // frame: true,
  462. border:false,
  463. iconCls: 'icon-grid'
  464. // renderTo: Ext.getBody()
  465. });
  466. var childPanel3 = Ext.create('Ext.Panel', {
  467. height:50,
  468. width:'100%',
  469. html: '<div class="MaintenanceCheckTitle">巡检状态:</div><select class="Check_select_class" onchange="changeon(this)"><option value="0">所有</option><option value="1">未完成</option><option value="2">已完成</option></select>'
  470. });
  471. var piebar2 = Ext.create('Ext.panel.Panel',{
  472. id:'inspectorsCheckHtml2',
  473. width:'100%',
  474. height:50,
  475. region:'north',
  476. layout:'form',
  477. defaults:{
  478. border:false
  479. },
  480. items: [childPanel3]
  481. });
  482. var modifywin = function(id){
  483. Ext.create('Ext.window.Window', {
  484. title: '巡检点位',
  485. height: 500,
  486. width: 800,
  487. modal: true,
  488. layout:'border',
  489. items: [ piebar2,MaintenanceCheckPanel1],
  490. buttons:[
  491. {
  492. text:'关闭',
  493. handler : function() {
  494. this.up('window').hide();
  495. }
  496. }
  497. ],
  498. closeAction: 'hide'
  499. }).show();
  500. }
  501. var piedarHtml2 = function() {
  502. var date=new Date;
  503. var dates=Ext.util.Format.date(date, 'Y-m-d');
  504. var preDate = new Date(date.getTime() - 24*60*60*1000);
  505. var dates2=Ext.util.Format.date(preDate, 'Y-m-d');
  506. var maintenanceCheckHtml = document.getElementById('inspectorsCheckHtml');
  507. var divhiddle = document.createElement('div');
  508. divhiddle.id='div26_id_checkrecordPanel3';
  509. divhiddle.setAttribute('class','SpringHandleHtml3DivHiddle');
  510. maintenanceCheckHtml.appendChild(divhiddle);
  511. var title = document.createElement('div');
  512. title.setAttribute('class','MaintenancePersonTitle');
  513. title.innerHTML='巡检记录';
  514. maintenanceCheckHtml.appendChild(title);
  515. var title2 = document.createElement('div');
  516. title2.setAttribute('class','Check_title2_div');
  517. title2.innerHTML='任务名称';
  518. maintenanceCheckHtml.appendChild(title2);
  519. var input = document.createElement('input');
  520. input.setAttribute('class','Check_input_class');
  521. input.setAttribute('id','inspectorsCheck_title2_input');
  522. input.setAttribute('type','text');
  523. input.setAttribute('value','');
  524. maintenanceCheckHtml.appendChild(input);
  525. var title3 = document.createElement('div');
  526. title3.setAttribute('class','Check_title3_div');
  527. title3.innerHTML='责任人';
  528. maintenanceCheckHtml.appendChild(title3);
  529. var select = document.createElement('select');
  530. select.setAttribute('class','Check_input1_class');
  531. select.setAttribute('id','inspectorsCheck_title3_input1');
  532. maintenanceCheckHtml.appendChild(select);
  533. var option2 = document.createElement('option');
  534. option2.innerHTML='所有人';
  535. option2.setAttribute('value','0');
  536. select.appendChild(option2);
  537. for(var i=0;i<ConfirmStore1.length;i++){
  538. var option3 = document.createElement('option');
  539. option3.innerHTML=ConfirmStore1[i].name;
  540. option3.setAttribute('value',ConfirmStore1[i].person_liable_id);
  541. select.appendChild(option3);
  542. }
  543. var title4 = document.createElement('div');
  544. title4.setAttribute('class','inspectorsCheck_title1_div');
  545. title4.setAttribute('id','inspectorsCheck_title1_div');
  546. title4.setAttribute('onmouseover',"mouseon(this)");
  547. title4.setAttribute('onmouseout',"mouseoff(this)");
  548. title4.setAttribute('onclick',"menu_click(this)");
  549. maintenanceCheckHtml.appendChild(title4);
  550. var title5 = document.createElement('div');
  551. title5.setAttribute('class','inspectorsCheck_title2_div');
  552. title5.setAttribute('id','inspectorsCheck_title2_div');
  553. title5.setAttribute('onmouseover',"mouseon(this)");
  554. title5.setAttribute('onmouseout',"mouseoff(this)");
  555. title5.setAttribute('onclick',"menu_click(this)");
  556. maintenanceCheckHtml.appendChild(title5);
  557. var title6 = document.createElement('div');
  558. title6.setAttribute('class','inspectorsCheck_title3_div');
  559. title6.setAttribute('id','inspectorsCheck_title3_div');
  560. title6.setAttribute('onmouseover',"mouseon(this)");
  561. title6.setAttribute('onmouseout',"mouseoff(this)");
  562. title6.setAttribute('onclick',"menu_click(this)");
  563. maintenanceCheckHtml.appendChild(title6);
  564. var input2 = document.createElement('input');
  565. input2.setAttribute('class','Check_input2_class');
  566. input2.setAttribute('id','inspectorsCheck_title3_input2');
  567. input2.setAttribute('type','text');
  568. input2.setAttribute('readonly','true');
  569. input2.setAttribute('value',dates);
  570. maintenanceCheckHtml.appendChild(input2);
  571. var title8 = document.createElement('div');
  572. title8.setAttribute('class','Check_title8_div');
  573. title8.innerHTML='~';
  574. maintenanceCheckHtml.appendChild(title8);
  575. var input3 = document.createElement('input');
  576. input3.setAttribute('class','Check_input3_class');
  577. input3.setAttribute('id','inspectorsCheck_title3_input3');
  578. input3.setAttribute('type','text');
  579. input3.setAttribute('readonly','true');
  580. input3.setAttribute('value',dates2);
  581. maintenanceCheckHtml.appendChild(input3);
  582. //设置开始时间
  583. var startDate = laydate.render({
  584. elem: '#inspectorsCheck_title3_input3',
  585. done: function (value, date) {
  586. if (value !== '') {
  587. endDate.config.min.year = date.year;
  588. endDate.config.min.month = date.month - 1;
  589. endDate.config.min.date = date.date;
  590. } else {
  591. endDate.config.min.year = '';
  592. endDate.config.min.month = '';
  593. endDate.config.min.date = '';
  594. }
  595. }
  596. });
  597. //设置结束时间
  598. var endDate = laydate.render({
  599. elem: '#inspectorsCheck_title3_input2',
  600. done: function (value, date) {
  601. if (value !== '') {
  602. startDate.config.max.year = date.year;
  603. startDate.config.max.month = date.month - 1;
  604. startDate.config.max.date = date.date;
  605. } else {
  606. startDate.config.max.year = '';
  607. startDate.config.max.month = '';
  608. startDate.config.max.date = '';
  609. }
  610. }
  611. });
  612. var title7 = document.createElement('div');
  613. title7.setAttribute('class','Check_title7_div');
  614. title7.innerHTML='完成时间';
  615. maintenanceCheckHtml.appendChild(title7);
  616. var select1 = document.createElement('select');
  617. select1.setAttribute('class','Check_input4_class');
  618. select1.setAttribute('id','inspectorsCheck_title3_input4');
  619. maintenanceCheckHtml.appendChild(select1);
  620. var option3 = document.createElement('option');
  621. option3.innerHTML='所有';
  622. option3.setAttribute('value','4');
  623. select1.appendChild(option3);
  624. var option1 = document.createElement('option');
  625. option1.innerHTML='未开始';
  626. option1.setAttribute('value','0');
  627. select1.appendChild(option1);
  628. var option2 = document.createElement('option');
  629. option2.innerHTML='进行中';
  630. option2.setAttribute('value','1');
  631. select1.appendChild(option2);
  632. var option3 = document.createElement('option');
  633. option3.innerHTML='完成';
  634. option3.setAttribute('value','3');
  635. select1.appendChild(option3);
  636. var option4 = document.createElement('option');
  637. option4.innerHTML='超时';
  638. option4.setAttribute('value','2');
  639. select1.appendChild(option4);
  640. var title9 = document.createElement('div');
  641. title9.setAttribute('class','Check_title9_div');
  642. title9.innerHTML='任务状态';
  643. maintenanceCheckHtml.appendChild(title9);
  644. var title10 = document.createElement('div');
  645. title10.setAttribute('class','maintenanceCheck_title20_div');
  646. maintenanceCheckHtml.appendChild(title10);
  647. var title11 = document.createElement('div');
  648. title11.setAttribute('class','maintenanceCheck_title11_div');
  649. maintenanceCheckHtml.appendChild(title11);
  650. var title12 = document.createElement('div');
  651. title12.setAttribute('class','maintenanceCheck_title12_div');
  652. maintenanceCheckHtml.appendChild(title12);
  653. var title13 = document.createElement('div');
  654. title13.setAttribute('class','maintenanceCheck_title13_div');
  655. maintenanceCheckHtml.appendChild(title13);
  656. var title14 = document.createElement('div');
  657. title14.setAttribute('class','Check_title14_div');
  658. title14.innerHTML=jrwcrw;
  659. maintenanceCheckHtml.appendChild(title14);
  660. var title15 = document.createElement('div');
  661. title15.setAttribute('class','Check_title15_div');
  662. title15.innerHTML=csrw;
  663. maintenanceCheckHtml.appendChild(title15);
  664. var title16 = document.createElement('div');
  665. title16.setAttribute('class','Check_title16_div');
  666. title16.innerHTML=jrrw;
  667. maintenanceCheckHtml.appendChild(title16);
  668. var title17 = document.createElement('div');
  669. title17.setAttribute('class','Check_title17_div');
  670. title17.innerHTML=xjrysl;
  671. maintenanceCheckHtml.appendChild(title17);
  672. }
  673. var piedarHtml = function() {
  674. var query = new Object();
  675. // query.V_LOGINNAME = $("#V_LOGINNAME").val();
  676. pieMask.show();
  677. $.ajax({
  678. type:'POST',
  679. url: baseUrl+"iot/spotoperationrecord/getList2",
  680. data: {
  681. queryJson : Ext.JSON.encode(query)
  682. },
  683. success: function(result){
  684. var json = eval('(' + result + ')');
  685. if(json.action=='getSpotOperationRecordList2'){
  686. // ConfirmStore = json.RESULT;
  687. ConfirmStore1 = json.RESULT1;
  688. xjrysl = json.xjrysl;
  689. jrwcrw = json.jrwcrw;
  690. csrw = json.csrw;
  691. jrrw = json.jrrw;
  692. piedarHtml2();
  693. }
  694. pieMask.hide();
  695. }
  696. });
  697. }
  698. var InspectorsCheckListPanel=Ext.create('Ext.grid.Panel', {
  699. header :{
  700. height:0,
  701. border:'0px solid #000000'
  702. },
  703. id: 'InspectorsCheckListPanel',
  704. store: myStore,
  705. selModel: sm,
  706. columns: [
  707. { header: 'ID', dataIndex: 'id',hidden:true, menuDisabled:true },
  708. { header: '序号', dataIndex: 'xh', width:77, menuDisabled:true },
  709. { header: '任务名称', dataIndex: 'plan_name', width:250,align:'center', menuDisabled:true },
  710. {
  711. text:'巡检点位',
  712. xtype : 'actioncolumn',
  713. width:140,
  714. sortable:false,
  715. align:'center',
  716. menuDisabled:true,
  717. items:[{
  718. icon: '../../res/img/common/chakanbtn.png',
  719. tooltip: '巡检点位',
  720. handler: function(grid, rowIndex, colIndex) {
  721. var rec = grid.getStore().getAt(rowIndex);
  722. $("#checkRecord_id").val(rec.get("id"));
  723. modifywin(rec.get("id"));
  724. var label = rec.get("id");
  725. var query = new Object();
  726. // alert(label);
  727. if(label.length>0){
  728. query.id = label;
  729. }
  730. // query.V_LOGINNAME = V_LOGINNAME;
  731. // query.V_PASSWORD = V_PASSWORD;
  732. var jsonstr = Ext.JSON.encode(query);
  733. myStore1.getProxy().extraParams = {
  734. queryJson : jsonstr
  735. };
  736. myStore1.reload();
  737. }
  738. }]
  739. },
  740. { header: '应完成时间', dataIndex: 'ywcsj', width:250,align:'center', menuDisabled:true },
  741. { header: '当前状态', dataIndex: 'zt',width:120, align:'center', menuDisabled:true },
  742. { header: '完成情况(%)', dataIndex: 'completion', width:120, align:'center', menuDisabled:true },
  743. { header: '实际完成时间', dataIndex: 'data3', width:240, align:'center', menuDisabled:true },
  744. { header: '相关责任人', dataIndex: 'name', width:100, align:'center', menuDisabled:true },
  745. { header: '联系电话', dataIndex: 'phone', width:140, align:'center', menuDisabled:true },
  746. ],
  747. columnLines: true,
  748. height: maxHeight,
  749. width: '100%',
  750. bbar: new Ext.PagingToolbar({
  751. store: myStore,
  752. id:'InspectorsCheckListPageToolbar',
  753. displayInfo: true,
  754. pageSize: countPerPage,
  755. prependButtons: true,
  756. displayMsg : '显示第 {0}条到 {1}条记录,总共 {2}条',
  757. emptyMsg : "没有记录",
  758. firstText: '第一页',
  759. prevText: '前一页',
  760. nextText: '后一页',
  761. lastText: '最后一页',
  762. refreshText: '刷新',
  763. }),
  764. border:false,
  765. iconCls: 'icon-grid'
  766. });
  767. var piebar = Ext.create('Ext.panel.Panel',{
  768. id:'inspectorsCheckHtml',
  769. width:'100%',
  770. height:250,
  771. region:'north',
  772. layout:'form',
  773. defaults:{
  774. border:false
  775. }
  776. });
  777. pieMask = new Ext.LoadMask(piebar,{msg:"Loading..."});
  778. new Ext.create('Ext.panel.Panel',{
  779. width:'100%',
  780. id: 'InspectorsCheckPiebar',
  781. layout:'border',
  782. items:[
  783. piebar,InspectorsCheckListPanel
  784. ],
  785. renderTo: Ext.getBody()
  786. });
  787. myStore.reload();
  788. myStore.addListener('load',function(store,record,opts){
  789. if(document.getElementById('div26_id_checkrecordPanel3')==undefined)
  790. piedarHtml();
  791. });
  792. maxHeight = document.documentElement.clientHeight;
  793. Ext.getCmp('InspectorsCheckPiebar').setHeight(maxHeight);
  794. });