checkrecord.js 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844
  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. const time = new Date();
  222. const Y = time.getFullYear(); //年
  223. const M = time.getMonth(); //月
  224. const D = time.getDate(); //日
  225. document.getElementById('inspectorsCheck_title2_input').value = ''
  226. document.getElementById('inspectorsCheck_title3_input1').value = 0;
  227. document.getElementById('inspectorsCheck_title3_input2').value = '';
  228. document.getElementById('inspectorsCheck_title3_input3').value = '';
  229. document.getElementById('inspectorsCheck_title3_input4').value = 4;
  230. $("#plan_name").val('');
  231. $("#data3b").val('');
  232. $("#data3a").val('');
  233. $("#zt").val('');
  234. $("#person_liable_id").val('');
  235. show_page();
  236. }
  237. mouseon = function(obj){
  238. var id = obj.id;
  239. $("#"+id).removeClass(id);
  240. $("#"+id).addClass(id+'_on');
  241. }
  242. mouseoff = function(obj){
  243. var mid = "inspectorsCheck_";
  244. for(var i=1;i<4;i++){
  245. var id = "inspectorsCheck_title"+i+"_div";
  246. $("#"+id).removeClass(id+'_on');
  247. $("#"+id).addClass(id);
  248. }
  249. if(menuidx=='m1'){
  250. mid += 'title1_div';
  251. $("#"+mid).removeClass(mid);
  252. $("#"+mid).addClass(mid+'_on');
  253. }
  254. else if(menuidx=='m2'){
  255. mid += 'title2_div';
  256. $("#"+mid).removeClass(mid);
  257. $("#"+mid).addClass(mid+'_on');
  258. }
  259. else if(menuidx=='m3'){
  260. mid += 'title3_div';
  261. $("#"+mid).removeClass(mid);
  262. $("#"+mid).addClass(mid+'_on');
  263. }
  264. }
  265. menu_click = function(obj){
  266. var id = obj.id;
  267. if(id=='inspectorsCheck_title1_div'){
  268. menuidx = 'm1';
  269. show_page();
  270. }
  271. else if(id=='inspectorsCheck_title2_div'){
  272. menuidx = 'm2';
  273. reset1();
  274. }
  275. else if(id=='inspectorsCheck_title3_div'){
  276. menuidx = 'm3';
  277. exportbtn_click();
  278. }
  279. }
  280. var maintenancedevice = function(){
  281. var maintenance_look_device = document.getElementById('inspectorsCheck_look_device');
  282. var img = document.createElement('img');
  283. img.width=400;
  284. img.height=400;
  285. img.src = baseUrl+ConfirmStore[0].picture_route;
  286. // img.src = ConfirmStore[0].picture_route;
  287. img.setAttribute('class','maintenance_look_device_img');
  288. maintenance_look_device.appendChild(img);
  289. var div4 = document.createElement('div');
  290. div4.style.textAlign='center';
  291. div4.innerHTML=ConfirmStore[0].remarks;
  292. maintenance_look_device.appendChild(div4);
  293. }
  294. var editMaintenance = function(spot_id){
  295. var spot_id = spot_id;
  296. Ext.create('Ext.window.Window', {
  297. id:'inspectorsCheck_data_win1',
  298. height: 500,
  299. width: 400,
  300. layout: 'fit',
  301. modal:true,
  302. buttons:[
  303. {
  304. text:'关闭',
  305. handler : function() {
  306. Ext.getCmp('inspectorsCheck_data_win1').destroy();
  307. }
  308. }
  309. ],
  310. closeAction:'destroy',
  311. html:'<div id="inspectorsCheck_look_device"></div>'
  312. }).show();
  313. var query = new Object();
  314. query.V_LOGINNAME = $("#V_LOGINNAME").val();
  315. // query.V_PASSWORD = $("#V_PASSWORD").val();
  316. query.id = spot_id;
  317. $.ajax({
  318. type:'POST',
  319. url: baseUrl+"iot/inspectionpoints/getList1",
  320. data: {
  321. queryJson : Ext.JSON.encode(query)
  322. },
  323. success: function(result){
  324. var json = eval('(' + result + ')');
  325. if(json.action=='getInspectionPointsList'){
  326. ConfirmStore = json.RESULT;
  327. maintenancedevice(ConfirmStore);
  328. }
  329. }
  330. });
  331. }
  332. var maintenancePresentation = function(){
  333. var maintenanceCheck_look_Presentation = document.getElementById('inspectorsCheck_look_Presentation');
  334. var img = document.createElement('img');
  335. img.src = ConfirmStore[0].report_photos;
  336. img.setAttribute('class','maintenance_look_device_img_baogao');
  337. maintenanceCheck_look_Presentation.appendChild(img);
  338. var div4 = document.createElement('div');
  339. div4.style.textAlign='center';
  340. div4.innerHTML=ConfirmStore[0].dwsb_remarks;
  341. maintenanceCheck_look_Presentation.appendChild(div4);
  342. }
  343. var editMaintenancePresentation = function(spot_id){
  344. var spot_id = spot_id;
  345. Ext.create('Ext.window.Window', {
  346. id:'inspectorsCheck_Presentation_win1',
  347. height: 400,
  348. width: 300,
  349. layout: 'fit',
  350. modal:true,
  351. buttons:[
  352. {
  353. text:'关闭',
  354. handler : function() {
  355. Ext.getCmp('inspectorsCheck_Presentation_win1').destroy();
  356. }
  357. }
  358. ],
  359. closeAction:'destroy',
  360. html:'<div id="inspectorsCheck_look_Presentation"></div>'
  361. }).show();
  362. var query = new Object();
  363. // query.V_LOGINNAME = $("#V_LOGINNAME").val();
  364. // query.V_PASSWORD = $("#V_PASSWORD").val();
  365. query.jlid = spot_id;
  366. $.ajax({
  367. type:'POST',
  368. url: baseUrl+"iot/spotoperationrecord/getJlPointsList1",
  369. data: {
  370. queryJson : Ext.JSON.encode(query)
  371. },
  372. success: function(result){
  373. var json = eval('(' + result + ')');
  374. if(json.action=='getjlPointsList'){
  375. ConfirmStore = json.RESULT;
  376. maintenancePresentation(ConfirmStore);
  377. }
  378. }
  379. });
  380. }
  381. changeon = function(obj){
  382. var id=document.getElementById('checkRecord_id').value;
  383. var value = obj.value;
  384. var query = new Object();
  385. if(value.length>0){
  386. query.data3 = value;
  387. }
  388. query.id = id;
  389. // query.V_LOGINNAME = V_LOGINNAME;
  390. // query.V_PASSWORD = V_PASSWORD;
  391. var jsonstr = Ext.JSON.encode(query);
  392. myStore1.getProxy().extraParams = {
  393. queryJson : jsonstr
  394. };
  395. Ext.getCmp('InspectorsCheckListPageToolbar1').moveFirst();
  396. }
  397. var MaintenanceCheckPanel1 =Ext.create('Ext.grid.Panel', {
  398. header :{
  399. height:0,
  400. border:'0px solid #000000'
  401. },
  402. id: 'InspectorsCheckListPanel1',
  403. store: myStore1,
  404. selModel: sm1,
  405. columns: [
  406. { header: '点位记录ID', dataIndex: 'jlid',hidden:true, menuDisabled:true },
  407. { header: '点位ID', dataIndex: 'dwid',hidden:true, menuDisabled:true },
  408. { header: '序号', dataIndex: 'xh',hidden:true, menuDisabled:true },
  409. { header: '点位名称', dataIndex: 'spot_name', width:150,align:'center', menuDisabled:true },
  410. { header: '点位地址', dataIndex: 'spot_address', width:150,align:'center', menuDisabled:true },
  411. { header: '巡检状态', dataIndex: 'wcqk', width:70,align:'center', menuDisabled:true },
  412. { header: '巡检人', dataIndex: 'wbr', width:70,align:'center', menuDisabled:true },
  413. { header: '巡检时间', dataIndex: 'wc_time', width:156,align:'center', menuDisabled:true },
  414. {
  415. text:'点位详情',
  416. xtype : 'actioncolumn',
  417. width:80,
  418. sortable:false,
  419. align:'center',
  420. menuDisabled:true,
  421. items:[{
  422. icon: '../../res/img/common/tupianbtn.png',
  423. tooltip: '点位详情',
  424. handler: function(grid, rowIndex, colIndex) {
  425. var rec = grid.getStore().getAt(rowIndex);
  426. // alert(rec.get("dwid"));
  427. editMaintenance(rec.get("dwid"));
  428. }
  429. }]
  430. },
  431. {
  432. text:'巡检报告',
  433. xtype : 'actioncolumn',
  434. width:80,
  435. sortable:false,
  436. align:'center',
  437. menuDisabled:true,
  438. items:[{
  439. icon: '../../res/img/common/tupianbtn.png',
  440. tooltip: '点位详情',
  441. handler: function(grid, rowIndex, colIndex) {
  442. var rec = grid.getStore().getAt(rowIndex);
  443. editMaintenancePresentation(rec.get("jlid"));
  444. }
  445. }]
  446. }
  447. ],
  448. columnLines: true,
  449. height: 380,
  450. width: 780,
  451. bbar: new Ext.PagingToolbar({
  452. store: myStore1,
  453. id:'InspectorsCheckListPageToolbar1',
  454. displayInfo: true,
  455. pageSize: 10,
  456. prependButtons: true,
  457. displayMsg : '显示第 {0}条到 {1}条记录,总共 {2}条',
  458. emptyMsg : "没有记录",
  459. firstText: '第一页',
  460. prevText: '前一页',
  461. nextText: '后一页',
  462. lastText: '最后一页',
  463. refreshText: '刷新',
  464. }),
  465. // frame: true,
  466. border:false,
  467. iconCls: 'icon-grid'
  468. // renderTo: Ext.getBody()
  469. });
  470. var childPanel3 = Ext.create('Ext.Panel', {
  471. height:50,
  472. width:'100%',
  473. 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>'
  474. });
  475. var piebar2 = Ext.create('Ext.panel.Panel',{
  476. id:'inspectorsCheckHtml2',
  477. width:'100%',
  478. height:50,
  479. region:'north',
  480. layout:'form',
  481. defaults:{
  482. border:false
  483. },
  484. items: [childPanel3]
  485. });
  486. var modifywin = function(id){
  487. Ext.create('Ext.window.Window', {
  488. title: '巡检点位',
  489. height: 500,
  490. width: 800,
  491. modal: true,
  492. layout:'border',
  493. items: [ piebar2,MaintenanceCheckPanel1],
  494. buttons:[
  495. {
  496. text:'关闭',
  497. handler : function() {
  498. this.up('window').hide();
  499. }
  500. }
  501. ],
  502. closeAction: 'hide'
  503. }).show();
  504. }
  505. var piedarHtml2 = function() {
  506. var date=new Date;
  507. var dates=Ext.util.Format.date(date, 'Y-m-d');
  508. var preDate = new Date(date.getTime() - 24*60*60*1000);
  509. var dates2=Ext.util.Format.date(preDate, 'Y-m-d');
  510. var maintenanceCheckHtml = document.getElementById('inspectorsCheckHtml');
  511. var divhiddle = document.createElement('div');
  512. divhiddle.id='div26_id_checkrecordPanel3';
  513. divhiddle.setAttribute('class','SpringHandleHtml3DivHiddle');
  514. maintenanceCheckHtml.appendChild(divhiddle);
  515. var title = document.createElement('div');
  516. title.setAttribute('class','MaintenancePersonTitle');
  517. title.innerHTML='巡检记录';
  518. maintenanceCheckHtml.appendChild(title);
  519. var title2 = document.createElement('div');
  520. title2.setAttribute('class','Check_title2_div');
  521. title2.innerHTML='任务名称';
  522. maintenanceCheckHtml.appendChild(title2);
  523. var input = document.createElement('input');
  524. input.setAttribute('class','Check_input_class');
  525. input.setAttribute('id','inspectorsCheck_title2_input');
  526. input.setAttribute('type','text');
  527. input.setAttribute('value','');
  528. maintenanceCheckHtml.appendChild(input);
  529. var title3 = document.createElement('div');
  530. title3.setAttribute('class','Check_title3_div');
  531. title3.innerHTML='责任人';
  532. maintenanceCheckHtml.appendChild(title3);
  533. var select = document.createElement('select');
  534. select.setAttribute('class','Check_input1_class');
  535. select.setAttribute('id','inspectorsCheck_title3_input1');
  536. maintenanceCheckHtml.appendChild(select);
  537. var option2 = document.createElement('option');
  538. option2.innerHTML='所有人';
  539. option2.setAttribute('value','0');
  540. select.appendChild(option2);
  541. for(var i=0;i<ConfirmStore1.length;i++){
  542. var option3 = document.createElement('option');
  543. option3.innerHTML=ConfirmStore1[i].name;
  544. option3.setAttribute('value',ConfirmStore1[i].person_liable_id);
  545. select.appendChild(option3);
  546. }
  547. var title4 = document.createElement('div');
  548. title4.setAttribute('class','inspectorsCheck_title1_div');
  549. title4.setAttribute('id','inspectorsCheck_title1_div');
  550. title4.setAttribute('onmouseover',"mouseon(this)");
  551. title4.setAttribute('onmouseout',"mouseoff(this)");
  552. title4.setAttribute('onclick',"menu_click(this)");
  553. maintenanceCheckHtml.appendChild(title4);
  554. var title5 = document.createElement('div');
  555. title5.setAttribute('class','inspectorsCheck_title2_div');
  556. title5.setAttribute('id','inspectorsCheck_title2_div');
  557. title5.setAttribute('onmouseover',"mouseon(this)");
  558. title5.setAttribute('onmouseout',"mouseoff(this)");
  559. title5.setAttribute('onclick',"menu_click(this)");
  560. maintenanceCheckHtml.appendChild(title5);
  561. var title6 = document.createElement('div');
  562. title6.setAttribute('class','inspectorsCheck_title3_div');
  563. title6.setAttribute('id','inspectorsCheck_title3_div');
  564. title6.setAttribute('onmouseover',"mouseon(this)");
  565. title6.setAttribute('onmouseout',"mouseoff(this)");
  566. title6.setAttribute('onclick',"menu_click(this)");
  567. maintenanceCheckHtml.appendChild(title6);
  568. var input2 = document.createElement('input');
  569. input2.setAttribute('class','Check_input2_class');
  570. input2.setAttribute('id','inspectorsCheck_title3_input2');
  571. input2.setAttribute('type','text');
  572. input2.setAttribute('readonly','true');
  573. input2.setAttribute('value',dates);
  574. maintenanceCheckHtml.appendChild(input2);
  575. var title8 = document.createElement('div');
  576. title8.setAttribute('class','Check_title8_div');
  577. title8.innerHTML='~';
  578. maintenanceCheckHtml.appendChild(title8);
  579. var input3 = document.createElement('input');
  580. input3.setAttribute('class','Check_input3_class');
  581. input3.setAttribute('id','inspectorsCheck_title3_input3');
  582. input3.setAttribute('type','text');
  583. input3.setAttribute('readonly','true');
  584. input3.setAttribute('value',dates2);
  585. maintenanceCheckHtml.appendChild(input3);
  586. //设置开始时间
  587. var startDate = laydate.render({
  588. elem: '#inspectorsCheck_title3_input3',
  589. done: function (value, date) {
  590. if (value !== '') {
  591. endDate.config.min.year = date.year;
  592. endDate.config.min.month = date.month - 1;
  593. endDate.config.min.date = date.date;
  594. } else {
  595. endDate.config.min.year = '';
  596. endDate.config.min.month = '';
  597. endDate.config.min.date = '';
  598. }
  599. }
  600. });
  601. //设置结束时间
  602. var endDate = laydate.render({
  603. elem: '#inspectorsCheck_title3_input2',
  604. done: function (value, date) {
  605. if (value !== '') {
  606. startDate.config.max.year = date.year;
  607. startDate.config.max.month = date.month - 1;
  608. startDate.config.max.date = date.date;
  609. } else {
  610. startDate.config.max.year = '';
  611. startDate.config.max.month = '';
  612. startDate.config.max.date = '';
  613. }
  614. }
  615. });
  616. var title7 = document.createElement('div');
  617. title7.setAttribute('class','Check_title7_div');
  618. title7.innerHTML=' 实际完成';
  619. maintenanceCheckHtml.appendChild(title7);
  620. var select1 = document.createElement('select');
  621. select1.setAttribute('class','Check_input4_class');
  622. select1.setAttribute('id','inspectorsCheck_title3_input4');
  623. maintenanceCheckHtml.appendChild(select1);
  624. var option3 = document.createElement('option');
  625. option3.innerHTML='所有';
  626. option3.setAttribute('value','4');
  627. select1.appendChild(option3);
  628. var option1 = document.createElement('option');
  629. option1.innerHTML='未开始';
  630. option1.setAttribute('value','0');
  631. select1.appendChild(option1);
  632. var option2 = document.createElement('option');
  633. option2.innerHTML='进行中';
  634. option2.setAttribute('value','1');
  635. select1.appendChild(option2);
  636. var option3 = document.createElement('option');
  637. option3.innerHTML='完成';
  638. option3.setAttribute('value','3');
  639. select1.appendChild(option3);
  640. var option4 = document.createElement('option');
  641. option4.innerHTML='超时';
  642. option4.setAttribute('value','2');
  643. select1.appendChild(option4);
  644. var title9 = document.createElement('div');
  645. title9.setAttribute('class','Check_title9_div');
  646. title9.innerHTML='任务状态';
  647. maintenanceCheckHtml.appendChild(title9);
  648. var title10 = document.createElement('div');
  649. title10.setAttribute('class','maintenanceCheck_title20_div');
  650. maintenanceCheckHtml.appendChild(title10);
  651. var title11 = document.createElement('div');
  652. title11.setAttribute('class','maintenanceCheck_title11_div');
  653. maintenanceCheckHtml.appendChild(title11);
  654. var title12 = document.createElement('div');
  655. title12.setAttribute('class','maintenanceCheck_title12_div');
  656. maintenanceCheckHtml.appendChild(title12);
  657. var title13 = document.createElement('div');
  658. title13.setAttribute('class','maintenanceCheck_title13_div');
  659. maintenanceCheckHtml.appendChild(title13);
  660. var title14 = document.createElement('div');
  661. title14.setAttribute('class','Check_title14_div');
  662. title14.innerHTML=jrwcrw;
  663. maintenanceCheckHtml.appendChild(title14);
  664. var title15 = document.createElement('div');
  665. title15.setAttribute('class','Check_title15_div');
  666. title15.innerHTML=csrw;
  667. maintenanceCheckHtml.appendChild(title15);
  668. var title16 = document.createElement('div');
  669. title16.setAttribute('class','Check_title16_div');
  670. title16.innerHTML=jrrw;
  671. maintenanceCheckHtml.appendChild(title16);
  672. var title17 = document.createElement('div');
  673. title17.setAttribute('class','Check_title17_div');
  674. title17.innerHTML=xjrysl;
  675. maintenanceCheckHtml.appendChild(title17);
  676. }
  677. var piedarHtml = function() {
  678. var query = new Object();
  679. query.V_LOGINNAME = $("#V_LOGINNAME").val();
  680. pieMask.show();
  681. $.ajax({
  682. type:'POST',
  683. url: baseUrl+"iot/spotoperationrecord/getList2",
  684. data: {
  685. queryJson : Ext.JSON.encode(query)
  686. },
  687. success: function(result){
  688. var json = eval('(' + result + ')');
  689. if(json.action=='getSpotOperationRecordList2'){
  690. // ConfirmStore = json.RESULT;
  691. ConfirmStore1 = json.RESULT1;
  692. xjrysl = json.xjrysl;
  693. jrwcrw = json.jrwcrw;
  694. csrw = json.csrw;
  695. jrrw = json.jrrw;
  696. piedarHtml2();
  697. }
  698. pieMask.hide();
  699. }
  700. });
  701. }
  702. var InspectorsCheckListPanel=Ext.create('Ext.grid.Panel', {
  703. header :{
  704. height:0,
  705. border:'0px solid #000000'
  706. },
  707. id: 'InspectorsCheckListPanel',
  708. store: myStore,
  709. selModel: sm,
  710. columns: [
  711. { header: 'ID', dataIndex: 'id',hidden:true, menuDisabled:true },
  712. { header: '序号', dataIndex: 'xh', width:77, menuDisabled:true },
  713. { header: '任务名称', dataIndex: 'plan_name', width:250,align:'center', menuDisabled:true },
  714. {
  715. text:'巡检点位',
  716. xtype : 'actioncolumn',
  717. width:140,
  718. sortable:false,
  719. align:'center',
  720. menuDisabled:true,
  721. items:[{
  722. icon: '../../res/img/common/chakanbtn.png',
  723. tooltip: '巡检点位',
  724. handler: function(grid, rowIndex, colIndex) {
  725. var rec = grid.getStore().getAt(rowIndex);
  726. $("#checkRecord_id").val(rec.get("id"));
  727. modifywin(rec.get("id"));
  728. var label = rec.get("id");
  729. var query = new Object();
  730. // alert(label);
  731. if(label.length>0){
  732. query.id = label;
  733. }
  734. // query.V_LOGINNAME = V_LOGINNAME;
  735. // query.V_PASSWORD = V_PASSWORD;
  736. var jsonstr = Ext.JSON.encode(query);
  737. myStore1.getProxy().extraParams = {
  738. queryJson : jsonstr
  739. };
  740. myStore1.reload();
  741. }
  742. }]
  743. },
  744. { header: '应完成时间', dataIndex: 'ywcsj', width:250,align:'center', menuDisabled:true },
  745. { header: '当前状态', dataIndex: 'zt',width:120, align:'center', menuDisabled:true },
  746. { header: '完成情况(%)', dataIndex: 'completion', width:120, align:'center', menuDisabled:true },
  747. { header: '实际完成时间', dataIndex: 'data3', width:240, align:'center', menuDisabled:true },
  748. { header: '相关责任人', dataIndex: 'name', width:100, align:'center', menuDisabled:true },
  749. { header: '联系电话', dataIndex: 'phone', width:140, align:'center', menuDisabled:true },
  750. ],
  751. columnLines: true,
  752. height: maxHeight,
  753. width: '100%',
  754. bbar: new Ext.PagingToolbar({
  755. store: myStore,
  756. id:'InspectorsCheckListPageToolbar',
  757. displayInfo: true,
  758. pageSize: countPerPage,
  759. prependButtons: true,
  760. displayMsg : '显示第 {0}条到 {1}条记录,总共 {2}条',
  761. emptyMsg : "没有记录",
  762. firstText: '第一页',
  763. prevText: '前一页',
  764. nextText: '后一页',
  765. lastText: '最后一页',
  766. refreshText: '刷新',
  767. }),
  768. border:false,
  769. iconCls: 'icon-grid'
  770. });
  771. var piebar = Ext.create('Ext.panel.Panel',{
  772. id:'inspectorsCheckHtml',
  773. width:'100%',
  774. height:250,
  775. region:'north',
  776. layout:'form',
  777. defaults:{
  778. border:false
  779. }
  780. });
  781. pieMask = new Ext.LoadMask(piebar,{msg:"Loading..."});
  782. new Ext.create('Ext.panel.Panel',{
  783. width:'100%',
  784. id: 'InspectorsCheckPiebar',
  785. layout:'border',
  786. items:[
  787. piebar,InspectorsCheckListPanel
  788. ],
  789. renderTo: Ext.getBody()
  790. });
  791. myStore.reload();
  792. myStore.addListener('load',function(store,record,opts){
  793. if(document.getElementById('div26_id_checkrecordPanel3')==undefined)
  794. piedarHtml();
  795. });
  796. maxHeight = document.documentElement.clientHeight;
  797. Ext.getCmp('InspectorsCheckPiebar').setHeight(maxHeight);
  798. });